Commit Graph

27748 Commits

Author SHA1 Message Date
Janne Karhu a601fd8893 Bug fix: unbaked particle cache was cleared from current frame onwards on file load. 2011-01-07 17:27:27 +00:00
Brecht Van Lommel b9fe5399e8 Revert bump mapping patch for now, backwards compatibility is not good enough,
we may need to preserve the previous method.
2011-01-07 16:55:56 +00:00
Brecht Van Lommel f01cac08e7 Fix #25078: texture mapping options (e.g. size) not working correctly with bump.
This problem was in both new bump and new new bump. The derivatives used for
bump mapping did not include the mapping, which gave mismatched offset for the
taps, now just do the mapping beforehand.
2011-01-07 15:41:24 +00:00
Brecht Van Lommel c8e0ca44a3 Improved bump mapping patch by M.G. Kishalmi (lmg) and M.S. Mikkelsen (sparky).
Many thanks to them!

For comparison, see here:
http://kishalmi.servus.at/3D/bumpcode/

Based on algorithm in: Mikkelsen M. S.: Simulation of Wrinkled Surfaces Revisited.
http://jbit.net/~sparky/sfgrad_bump/mm_sfgrad_bump.pdf

This fixes bugs:
#24591: Artefacts/strange normal mapping when anti-aliasing is on
#24735: Error at the Normal function.
#24962: Normals are not calculated correctly if anti-aliasing is off
#25103: Weird artefacts in Normal

This will break render compatibility a bit, but fixing this bugs would have also
done that, so in this case it should be acceptable.

Patch committed with these modifications:
* Bump method Old/3-Tap/5-Tap option in UI, 3-Tap is default
* Only compute normal perturbation vectors when needed
* Fix some middle of block variable definitions for MSVC
2011-01-07 14:42:01 +00:00
Campbell Barton 03e0f28ea0 bugfix [#25528] lack of update and crash using hook modifier. 2011-01-07 11:48:35 +00:00
Janne Karhu 3c6077e8ec Bug fix: particle point cache was reset on start frame if particles had grid distribution even if there were no changes. 2011-01-07 11:38:28 +00:00
Janne Karhu 29efbf8a04 New hair child options:
* Renamed children to "simple" and "interpolated" as this is
  easier to explain and more descriptive than "from particles"
  and "from faces".
* Also shuffled the child ui around a bit to make it clearer.
* Child seed parameter allows to change the seed for children
  independent of the main seed value.
* Long hair mode for interpolated children:
  - Making even haircuts was impossible before as the child
    strand lengths were even, but their root coordinates were
    not similar in relation to the parent strands.
  - The "long hair" option uses the tips of the parent strands
    to calculate the child strand tips.
* Hair parting options:
  - Hair parting can now be calculated dynamically on the fly
    when in 2.49 there was a cumbersome way of using emitter mesh
    seams to define parting lines.
  - For long hair parting can be created by a tip distance/root
    distance threshold. For example setting the minimum threshold
    to 2.0 creates partings between children belonging to parents
    with tip distance of three times the root distance
    ((1+2)*root distance).
  - For short hair the parting thresholds are used as angles
    between the root directions.
* New kink parameters:
  - Kink flatness calculates kink into a shape that would have
    been achieved with an actual curling iron.
  - Kink amplitude clump determines how much the main clump value
    effects the kink amplitude.
  - The beginning of kink is now smoothed to make the hair look
    more natural close to the roots.
* Some bugs fixed along the way too:
  - Child parent's were not determined correctly in some cases.
  - Children didn't always look correct in particle mode.
  - Changing child parameters caused actual particles to be
    recalculated.
* Also cleaned up some deprecated code.

All in all there should be no real changes to how old files look
(except perhaps a bit better!), but the new options should make
hair/fur creation a bit more enjoyable. I'll try to make a video
demonstrating the new stuff shortly.
2011-01-07 11:24:34 +00:00
Campbell Barton 7ad97b04b7 cmake: share the DNA_*.h list definition between makesrna and makesdna 2011-01-07 11:08:47 +00:00
Janne Karhu 841c50b5e2 Fix for [#25526] Inmediate crash when changing amount of particles in a particle system
* Point cache index array doesn't necessarily have all particles if the particles were re-allocated recently.
2011-01-07 10:38:17 +00:00
Janne Karhu 96128ee69f Fix for [#25506] Hair showing up in places not assigned by a weightmap
* Two separate bugs, with very similar symptoms.
* The distribution binary search didn't work correctly in cases where there were a lot of faces with 0 weights.
* Maximum distribution sum should have been exactly 1, but due to the wonderful nature of floats this wasn't the case at all.
2011-01-07 10:13:30 +00:00
Campbell Barton 57a3cff3b8 patch [#25440] Object.vertex_group fixin'
from Dan Eicher (dna) 

 From the tracker (with minor edits)
========================

cube = bpy.data.objects['Cube']
foo = cube.vertex_groups.new('foo')
foo.add([1,3,5,7], 1.0, 'ADD')

for i in range(len(cube.data.vertices)):
    try:
        weight = foo.weight(i)
        print('vert: %i weight: %f' % (i, weight))
    except:
        pass

foo.remove([1,3])

cube.vertex_groups.remove(foo)
2011-01-07 09:50:23 +00:00
Campbell Barton 41c00063dd another error in commit r34143, was using the define's 'BLEN' & 'DER_' however the latter is incorrect since DER- is used for 64bit blend files.
removed the define.
2011-01-07 09:47:05 +00:00
Campbell Barton 7fe16a24a4 fix for error in own commit r34143 2011-01-07 08:59:00 +00:00
Campbell Barton 54ceccd0ee - cmake use execute_process, exec_program is deprecated.
- game engine builds without python again.
2011-01-07 08:43:29 +00:00
Campbell Barton f3a00259e2 bugfix [#25457] Lack of update on undoing a lattice rig 2011-01-07 07:36:51 +00:00
Campbell Barton a132674634 patch [#25490] Fix for [#22096] Blender tries to open non-blend file
from Alexander Kuznetsov (alexk) with edits.

From the report:
Blender assumed that all files are .blend as retval = 0;

Now retval is initialized as file cannot be open (-1) for gzopen fail and directory case
retval = -2; is defined for not supported formats
This must be assigned before #ifdef WITH_PYTHON because this part can be missing
Finally retval = 0; if it is a .blend file

---
also made other edits.

- exotic.c's blend header checking was sloppy, didn't check data was actually read, only checked first 4 bytes and had a check for "blend.gz" extension which is unnecessary.
- use defines to help readability for BKE_read_exotic & BKE_read_file return values.
- no need to check for a NULL pointer before calling BKE_reportf(). (will just print to the console)
- print better reports when the file fails to load.
2011-01-07 06:50:29 +00:00
Campbell Barton 0db684be3c incorrectly documented return type 2011-01-07 06:39:48 +00:00
Matt Ebb 82659944c6 Fix/add OSX style text editing shortcuts to default keymap 2011-01-07 05:50:17 +00:00
Campbell Barton 0f2089afa1 py/rna api speedup for collection slicing in all cases, rather then having an exception for [:].
- avoid looping over the entire collection unless a negative index is used.
- dont use the get index function for building the slice list, instead loop over the collection until the stop value.
2011-01-07 05:33:30 +00:00
Campbell Barton 5d74d65106 bugfix [#25519] particlesystem, type hair, hair dynamics enabled: crash with amount 0 2011-01-07 04:38:31 +00:00
Campbell Barton 109d3b8454 bugfix [#25519] particlesystem, type hair, hair dynamics enabled: crash with amount 0 2011-01-07 04:30:02 +00:00
Campbell Barton adf961a46c fix [#25520] crash when closing the properties panel in uv/image editor
don't draw the image if the size is 0.

Crash was actually an assert() so debug builds only, replace assert() with BKE_assert() so crash is opt in build option.
2011-01-07 04:10:37 +00:00
Campbell Barton e14247d079 bugfix [#25522] Export to X3D is missing ImageTexture and TextureTransform for plane with image texture
- tile option was broken.
- added basic export of texture/mtex transformation.
- recent mesh update broke material/image export with no UVs
2011-01-07 02:39:48 +00:00
Ton Roosendaal af64765456 Todo items:
- Toobar views were reset on hide/unhide. Now they keep the view
  and zoom level.
- Added operator to delete all unused 'space data', this to make
  clean startup.blend files, remove unused editors, and to be
  able to test starting defaults for editors.
  No hotkey, use search for "Clean-up space-data"
2011-01-06 17:54:17 +00:00
Ton Roosendaal b67d08c3c7 Todo item:
Compositor: Texture Node now behaves like an image.
- Image always in render output size
- Buffer outputs RGBA and Value both supported
- Works for filter and blur and scaling too.
- Mixing 2 textures works

Implementation note:
The texture node was meant to be 'procedural', not a buffer
but a color-sample method. Unfortunately the node editor 
didn't support this well, blur/filter/scale ignored it too.

For now, its better to drop this procedural concept, then
things work at least as expected. :)
2011-01-06 14:58:58 +00:00
Ton Roosendaal 7b302d5052 Bug fix:
On texture-space transform, pressing Rkey crashed.
Now it refuses to enter rotation mode. :)
2011-01-06 14:19:46 +00:00
Campbell Barton 149955b3e2 print_m3/m4 didnt use const char *, which gave an errror with passing strings & pedantic warnings.
also minor rename in bvh export
2011-01-06 13:49:09 +00:00
Ton Roosendaal 5cef085f77 Todo item:
Auto-texture space now is more responsive and correct.
- on transforming it, the buttons get redrawn to show option was reset
- on enabling option, texture space is recalculated/reset
2011-01-06 11:16:35 +00:00
Ton Roosendaal a4c0d644c9 Bugfix #25505
Mesh properties: Auto Texture space option missing
2011-01-06 09:55:20 +00:00
Campbell Barton 28e689b9aa bugfix [#25498] Projection paint clone tool leaves seams 2011-01-06 09:32:25 +00:00
Campbell Barton 3ecacb5654 fix [#25507] Select Interior faces in edit mode gives python error 2011-01-06 05:45:41 +00:00
Joshua Leung 80e6d92639 Missed this file for markers commit... it already had a markers menu
defined, but it was outdated
2011-01-06 05:04:44 +00:00
Campbell Barton a0b134cd88 bugfix [#25488] Game engine crash when try to run after blender app start
- also found other places where utf8 isnt ensured.
- remove duplicate NULL checks in object_edit.c
2011-01-06 05:04:07 +00:00
Joshua Leung aafd32ab98 Added back "Marker" menu to all animation editors.
Issues:
- It looks a bit crowded though, so perhaps we could do without, and
just leave it for the TimeLine only?
- Due to the way the invoke() testing works, the rename operator
called from the menu currently fails. Will need to experiment more
with execution options to find a workaround.
2011-01-06 04:47:57 +00:00
Campbell Barton bba20eb5ae use ED_markers_get_first_selected() where possible, simplify ed_marker_rename_exec 2011-01-06 04:35:57 +00:00
Campbell Barton 68b931b03f py/rna optimizations, will help for faster exporting.
Speedup for getting collection indices, avoid getting the collection length unless a negative index is given. This avoids a loop over the entire collection in many cases.

Speedup for getting collection slices by detecting collection[:] and internally calling collection.values(), this gives a big speedup with some collections because each slice item would loop over the list until that index was found.

Rough test with 336 objects.
- getting index of listbase collection ~ 5.0x faster
- getting index of array collection ~ 1.15x faster

- getting slices of listbase collections ~ 34.0x faster
- getting slices of array collections ~ 1.5x faster
2011-01-06 04:01:06 +00:00
Joshua Leung 1246f1c9b5 Markers Todo: Adding back "Rename Marker" operator (Ctrl M).
As we don't have any dedicated text-input boxes anymore, this is a bit
more clunky than it should optimally be.
2011-01-06 03:10:41 +00:00
Joshua Leung f233f63d97 == Long-Standing 2.5 Todo - Markers fully working again in all
animation editors (DopeSheet, Graph Editor, NLA, Sequencer) ==

=== Usage Notes ===
In animation editors, marker operators will only be considered while
the mouse is hovering near/over the horizontal scrollbar (i.e. where
the markers usually appear). That means, in order to do something to
the markers, just position your cursor in line with the row of
markers, and then use the same hotkeys you'd use in the TimeLine (so,
unlike in 2.4x, no more need to hold down extra modifier keys for this
case). In the TimeLine, nothing changes, so you don't need to worry
about mouse placement there :)

=== Technical Details ===
Since early 2.5 versions, this functionality has been disabled, as the
markers were always getting evaluated first, and hence "swallowing"
all the events before the editor's own keymaps could access them.

In order to get this working again, I've had to give every marker
operator a "wrapper" invoke callback which performs some checking to
ensure that the mouse is close to the markers (vertically) before the
operator will try to be run. This wrapper also makes sure that once
the operator has finished running, that if it didn't manage to do
anything, then the editor's own keymaps get to have a go.

The vertical tolerance used is currently 30 pixels (as was used for
the borderselect operator).

=== Other Assorted Changes ===
* Gave marker operators dependent on having selected markers to
operate on suitable poll() callbacks. These new poll callbacks ensure
that there are selected markers for the operator to operate on,
further cutting down the number of places where markers may override
standard hotkeys (and avoiding calls to the wrappers too)
* Simplified some of the selection code
* Made some formatting tweaks for consistency, and in one case so that
my text editor's function-list display doesn't get confused
2011-01-06 02:35:12 +00:00
Matt Ebb af5ed099e9 Improve reliability when setting property editor context via rna 2011-01-06 02:20:30 +00:00
Campbell Barton 6247a11076 fix for error in own recent commit, r34098. 2011-01-06 02:20:25 +00:00
Campbell Barton 9b8cbe47bd error in recent x3d commit using undefined autosmooth var. 2011-01-06 01:45:25 +00:00
Campbell Barton a15189f845 fix for clang static check warnings.
- convertblender.c, remove assignments to unused vars.
- readfile.c, fix 2 possible crashes. null pointers were being checked for then used later without checking.
- space_graph.c, use switch statement for automatic color assignment rather then a float array.
2011-01-06 01:35:07 +00:00
Campbell Barton 5f64450726 remove assignments which are unused. 2011-01-06 01:29:13 +00:00
Luca Bonavita 7196fb370e == blender icon ==
I've been asked by Giuseppe Ghibò (joeghi) for more icons for Mandriva Linux distro.
I've noticed that some folders had a blender.svg different from the one in scalable/, so made them all the same derived from 
scalable/blender.svg

Now each svg file has "document properties" of the right dimensions according to the folder it's in, and the svg is saved so that people
just have to press "export bitmap" in Inkscape in case they need it.
2011-01-05 20:18:16 +00:00
Guillermo S. Romero a46689b15d SVN maintenance. 2011-01-05 19:19:49 +00:00
Ton Roosendaal 979742241f Bugfix, irc report:
Outliner: using the object-data icons to enter editmode, didn't
reset the toolbar Operator redo. It was not using an operator
call here. Note to self: more outliner tools don't...

Error was that operator-redo then would repeat an action incorrect.
2011-01-05 18:12:54 +00:00
Ton Roosendaal 37931a6b1a Todo item: brought transform texture space back.
Code changes are minimal, re-using the code as already was there.

Options are in pulldown menu, or SHIFT+T and SHIFT+ALT+T

Might be that Martin likes to see it different... do we need
a special operatortype for it?
2011-01-05 17:27:26 +00:00
Sergey Sharybin 91d352024b Get rid of uninitialized variable and malicios derived mesh relising.
Pointer by llvn analyzer.
2011-01-05 15:58:44 +00:00
Campbell Barton 054deb4584 remove ED_retopo.h 2011-01-05 15:37:36 +00:00
Ton Roosendaal b067a85aa3 Todo item:
Object color option now is incorporated in preview render, and
in display in 3D window.

Note that Object-color is "modulating" the render result, it just
multiplies... which is very limited for practical use. This was
added for Apricot game project. The original meaning however was
to replace diffuse only... so specular and light work still correct.

ALso made header for properties editor start on top, to reflect
default (report in tracker).
2011-01-05 15:10:35 +00:00