Commit Graph

562 Commits

Author SHA1 Message Date
f057a38e98 Changed BLI_convertstringcode to replace any number of hashes with the frame number.
somefile_##.png -> somefile_01.png
somefile_########-image.png -> somefile_00000001-image.png

Before, A hash at the end of the string would be replaced by a number with 4 characters. This is still default if no #'s are in the string, so nothing has changed.

To use this function from the python api use scene.render.getFrameFilename()
2008-04-11 15:47:21 +00:00
a02937d86c Fix for bug #8920: particles reactor crash and memory leak. 2008-04-11 12:29:29 +00:00
1fe5302cce Point Cache Refactoring
=======================

Caching and Baking:
- The point cache is now cleared on DAG_object_flush_update(), and not cleared for time dependency graph updates.
- There is now a Bake button instead of Protect. Also cache start and end frames were added to softbody and particles.
- The cloth autoprotect feature was removed.
- The Ctrl+B menu now also bakes cloth and particles next to softbody and fluids. Additionally there are now frree bake and free cache menu entries.
- The point cache api has been changed. There is now a PTCacheID struct for each point cache type that can be filled and then used to call the point cache functions.
- PointCache struct was added to DNA and is automatically allocated for each physics type.
- Soft body now supports Bake Editing just like cloth.
- Tried to make the systems deal consistently with time ipo's and offsets. Still not sure it all works correct, but too complicated to solve completely now.

Library Linking:
- Added some more warnings to prevent editing settings on library linked objects.
- Linked objects now read from the cache located next to the original library file, and never write to it. This restores old behavior for softbodies. For local simulation the mesh and not the object should be linked.
- Dupligroups and proxies can't create local point caches at the moment, how to implement that I'm not sure. We probably need a proxy point cache for that to work (ugh).

Physics UI:
- Renamed deflection panel to collision for consistency and reorganized the buttons. Also removed some softbody collision buttons from the softbody panel that were duplicated in this panel for cloth.
- Tweaked field panel buttons to not jump around when changing options.
- Tabbing e.g. Soft Body Collision into the Soft Body panel, it now only shows Collision to make the panel names readable.
- I tried to make enabled/disabling physics more consistent, since all three system did things different. Now the two modifier buttons to enable the modifier for the viewport and rendering are also duplicated in the physics panels. Toggling the Soft Body and Cloth buttons now both remove their modifiers.
- Fixed modifier error drawing glitch.

Particles:
- Particles are now recalculated more often than before. Previously it did partial updates based on the changes, but that doesn't work well with DAG_object_flush_update() ..
- Fixed memory leak loading keyed particle system. Now keys are not written to file anymore but always created after loading.
- Make particle threads work with autothreads.

Continue Physics:
- The timeline play now has a Continue Physics option in the playback menu, which keeps the simulations going without writing them to the cache.
- This doesn't always work that well, some changes are not immediately updated, but this can be improved later. Still it's fun to get a feel for the physics.

Todo:
- Point cache can get out of sync with and undo and changing a file without saving it.
- Change the point cache file format to store a version (so old point cache files can be either converted or at least ignored), and to do correct endian conversion.
- Menu item and/or buttons for Ctrl+B.
- A system("rm ..") was changed to remove() since the former is very slow for clearing point caches. These system() calls were already giving trouble in a bug in the tracker, but really most use of this system("") should be changed and tested.
- The Soft Body Collision and Clot Collision panel titles don't mention there's point cache settings there too, doing that makes them unreadable with the default panel setup.. but may need to make the names longer anyway.
2008-04-10 11:39:20 +00:00
5dbe42af07 Fix to make grass render the same on solaris as linux, by doing
pointer comparisons in qsort. This works for glibc according to
the documentation, and appears to work on solaris too.
2008-04-02 22:18:32 +00:00
49c65433cc Fix for bug: [#8117] Particles with fluid broken
-Handling of fluid particles was not coded at all
-Now things should work properly, but as fluid particles are not very familiar to me I'd appreciate some thorough testing
2008-04-02 17:48:46 +00:00
3932c747d6 Fix for bug: [#8810] Sticky button in particle effector menu creates unexpected effect
-Particle dietime was calculated wrong when a collision killed particles before their natural death
-Collision code still had some issues with object vs. global space
2008-04-01 00:40:28 +00:00
fd46b91650 Fix for bug: [#8817] Particleradius doesn't update until changing the amount of particles
-Reactor particles didn't initialize their birth times etc. properly when cache was cleared
2008-03-31 21:51:46 +00:00
0ce8fe1ec4 Fix for bug: [#8818] Particle reflecting strange from a simple plane 2008-03-31 20:54:00 +00:00
7f556ba4ef Fix for bug #8467: a softbody hair crash. 2008-03-14 18:21:06 +00:00
21dd86a159 Fix for bug [#8465] particle children for emitter particles doesn't render
-cached step didn't react to rendering and create child particles
-now emitter particle children can use the render amount too
2008-03-07 23:08:15 +00:00
64e76e7e02 Fix for bug [#8402] Hair particles don't react on changing of curve guides
-guide calculation was accessing wrong pointers in hair calculation
-now guides also respect the "apply effectors to children" - button, but not the "stiff" value
-disabled guide calculation for initial hair calculation as it's all done dynamically later
-few useless commented lines cleaned out
2008-03-07 22:39:54 +00:00
6af5a98c7e Bugfix: jitterd particle distribution was really slow for a large
number of particles/face. Now for > 25 particles/face it switches
to using a QMC hammersley distribution, much faster, for less
jitter still looks a bit better.
2008-02-28 13:31:25 +00:00
cbf278246f Fix for bug: cross platform strand render differences with kink/branch.
This time is was due to different accuracy of floating point computation,
now it uses does a comparison a bit different to avoid this.

Also changed the vectoquat function to be threadsafe.
2008-02-27 14:17:32 +00:00
d058a525db Bugfix for some particle system vertex group memory leaks. 2008-02-25 16:46:58 +00:00
6e4683fc52 Fix for bug #8353: switching particle hair with softbody to emit crashed.
Fix for bug #8355: crash zooming in render window.
2008-02-24 21:29:20 +00:00
1159bc9189 Fix for bug #8304: child distribution gave different results across
platforms. Cause was a function(rng_getFloat(), rng_getFloat()),
apparently the order in which rng_getFloat() is evaluated is not
compatible between operating systems.
2008-02-24 14:53:44 +00:00
46f27200e1 Bugfix: effectors in dupligroups didn't work, if the particle didn't
specify a group of effectors. Now it goes into groups recursively to
find effectors.
2008-02-22 16:31:10 +00:00
97d40faee9 Added an option for texture forcefields to use the root location of a particle for its texture coords.
Without this, animating grass would either look like seaweed (with low freq texture)
Or the grass would wrinkle up and get kinks (high freq texture)
This lets you use a high frequency texture while having straight grass.
2008-02-19 18:36:50 +00:00
41e4d7e4e6 Disable particle time looping for hair, doesn't have any purpose there,
only gives weird results.
2008-02-18 15:56:34 +00:00
314736eeb4 particle bug - Edit Particles could reference invalid face indices's,
Now particles lookup every face in the derived mesh to be placed on the mesh.
2008-02-18 14:06:45 +00:00
785b4dcdda Fix for bug #8052: particle emit from verts and volume didn't support
subsurf/derivedmesh mapping yet.

Also added int-to-pointer and back conversion function to solve warnings.
Note that it is only allowed to store an int in a pointer and then get
it back, but not a pointer in an int!
2008-02-18 10:49:46 +00:00
0fe6abbfa3 texture forcefields had a bug where uninitialized values could be used.
do_texture_effector assumed multitex_ext would assign r/g/b colors which isnt true for grey textures.
Fallback to PFIELD_TEX_GRAD with grey textures, node this in tooltip also.
2008-02-17 23:53:48 +00:00
1111561dd3 Particle looping works again at least to some extent (don't have time to test thoroughly). Instant looping had to be removed as it caused more trouble than good things. 2008-02-17 14:44:12 +00:00
b4f975b91a Particles' angular velocity mode "velocity" was actually just a duplicate of "spin" without any angular velocity, so it was removed. 2008-02-13 21:06:37 +00:00
7109955904 It seems my fix for bug 8274 broke hair, so reverting that and opening the bug again in the tracker :) 2008-02-13 18:57:28 +00:00
cc64c96c51 Fix for bug: [#8274] Particle System cannot be persuaded to recalculate
-The exact time for a particle being unborn or alive needed some adjusting
2008-02-13 15:33:37 +00:00
b12793fb4f Render Simplification
This adds a few settings to control global render quality, for faster
renders when tweaking lighting etc. The implementation is not so great,
and this should really be part of a proper render profile and preset
system. So for now it's a hidden Peach feature, enabled by setting rt
to 1. Before the next release, I'll either remove or improve it.

Settings are:

- Maximum subsurf level
- Child particles percentage
- Maximum shadow map samples
- AO and SSS quality factor
2008-02-13 11:18:08 +00:00
f695c1524c Fix for bug: [#8269] Particle / Vizualization / Draw / Disp reduces rendered particles
- Hair didn't update the visibility flag of each particle
- Changing the disp value gave a too strong update call to particles
- Changed disp value behavior for dynamic particles a bit, now all particles are always calculated for uncached frames so that every particle gets it's data cached. Now the disp value actually does what it's supposed to do, it alters the amount of particles DISPlayed in viewport, but doesn't change the simulations. (With old particles it was possible to only calculate the disp amount of particles too as everything was always recalculated from scratch anyways, but now that particles are more complicated and cached etc. it's not an option anymore.)
2008-02-12 15:26:20 +00:00
e706fc522b Fix for bug #8186. 2008-02-11 17:24:03 +00:00
8e94028ed5 Bounding box clipping in the render engine.
Now bounding boxes are computed per object, and checked first before
zbuffering objects. For strands, bounding boxes are computed per
original face in the mesh. Overall the speed improvement from this 
is quite small (zbuffering is rarely the bottleneck), but it seems a
sensible thing to do anyway.
2008-01-29 12:20:42 +00:00
fcff2e0c5f Added an "effector" vertex group for hair, that defines how much
influence effectors have.
2008-01-24 14:16:52 +00:00
f1fcbd8f14 Changed the way falloff for fields works, was hard to control well.
Specifically with maxdist set, the falloff is now from 1.0 to 0.0 at
the maxdist, so that there isn't a sudden discontinuity.
2008-01-23 22:46:09 +00:00
ec04c09365 Fix for error in approximate AO in last commit, made it really slow.
Also, duplis are now taking into account, the proper way to exclude
them is to set the material to be not traceable.

Removed an unnecessary pointer from the VlakRen struct to save some
memory, not really that significant, but still, saves 70 mb for 10
million faces.
2008-01-21 23:17:19 +00:00
14241f8349 Fixes:
- Particle system distribution wasn't flushed properly for non-edited hair.
- For instances in the renderer, also count their verts and faces in the stats.
- Fix for error in the "surface diffuse" formula for strand shading.
2008-01-21 14:18:24 +00:00
cb025f95de - Regarding the Peach "hair effectors" request in the mailing list I coded quick support so that effectors now can effect combed hair too. Nothing special needed to use, just normal field effectors, although there is a new "stiff" parameter in extras panel. (Note, at least for now this only works with path visualization)
- Keyed particles work again for all visualizations (previously only "path"), they still need some work though to be fully operational.
- Keyed particles weren't saved or loaded correctly.
2008-01-17 00:28:14 +00:00
e83b7bb46c Bugfix: with non-random particle distribution, the first particle could
still end up on a zero weight face.
2008-01-10 23:06:55 +00:00
Chris Want
5e3cffc64a Patch to change license to GPL only, from GSR. 2008-01-07 19:13:47 +00:00
fe6c98a4d9 Particle object and group visualization now also work for hair, to
make for example feathers. Also made dupliparts work within groups.

One issue still is that in particle editmode, the duplis can interfere
with brushes and selection, though tweaking the dupli object position
can alleviate the problem.
2008-01-07 16:26:41 +00:00
56faf73e3c - Bugfix for flickering shadow with strand simplification.
- On non-edited hair, don't generate child particles for
  each step, only at the end.
- Small optimization in the kd-tree.
2008-01-03 22:43:51 +00:00
2c6e0f5ab2 Bugfix for memory leak with particle roughness vertex groups. 2008-01-02 17:57:18 +00:00
58bf29e389 removed blenderdef.h, BIF_*, BDR_* and BSE_* header files (except for BIF_gl.h and BIF_glutil.h) 2008-01-01 18:16:10 +00:00
d5e491c3ef Recoded particles initial rotations to allow much more flexible settings. 2008-01-01 01:00:05 +00:00
5307c07832 Badlevel call amount reduced to 21!
(worst was radio module)
2007-12-29 18:44:31 +00:00
64dd90af0b - particle size changes weren't updated without a cache clear
- protecting the particle cache now actually protects the cache a bit better and not just prevent the clear button from working
- cache was being used for "none" physics.
- a bad tooltip for "reactor initial velocity"
2007-12-28 16:13:52 +00:00
25135a201b - removing conflicts in svn merge (didnt notice)
- adding more Makefiles
2007-12-24 19:13:04 +00:00
276e056912 Bugfix for strand simplification, without random distribution enabled.
Bugfix (hopefully) for missing strands on render bug, probably related
to preview render.
2007-12-21 10:57:02 +00:00
c805d35c40 Bugfix for strand simplification commit, made child particles
from particles crash.
2007-12-20 17:08:17 +00:00
0f2b2e3c60 Strand Render Simplification
============================

- Strand render now has options to remove child strands as
  the object's faces becomes smaller, in the Simplification
  particle panel.
- "Reference Size" is the approximate size of the object on
  screen, after which simplification starts.
- "Rate" is how fast strands are removed.
- "Transition" is the percentage of strands being faded out as
  they are removed.

- Another "Viewport" option removes strands on faces that are
  outside of the viewport. "Rate" again controls how fast these
  are removed.

- Strand render in Blender Units now has an adjustable minimum
  width. Below this minimum width, strands start fading out
  instead of getting smaller.
2007-12-20 16:35:27 +00:00
84b58f8653 Particles
=========

- The render and realtime button for the particle system modifier
  and the enabled button for particles now work seperate again,
  made a bad design decision to tie them together. Now with only
  the render button and not realtime enabled it renders.
- Fix for bug #7948: particle mode crash while constraining axis.
- Fix for bug #7945: crash loading effector groups from an old file.
- Fix for bug #7942: crash for reactor particles emitting from particles.
2007-12-18 16:55:09 +00:00
f4e1c89b20 Bugfix: the transform of a particle system in a dupli-group was wrong. 2007-12-17 21:19:17 +00:00