Commit Graph

310 Commits

Author SHA1 Message Date
fb97780fdf Bug fix: particle dynamics were being calculated if point cache was only half baked (reported by Michael Fox in #blendercoders)
* When a simulation is baked no dynamics calculations should happen anymore (even outside of baked frame range) since these can be very time consuming and baked simulations are supposed to be fast!
2011-01-18 09:25:37 +00:00
4e15c169c6 Fix for [#25572] crash when changing vertex group density in particle mode
* Hair was freed & redone on changes, but particle mode data wasn't updated.
2011-01-12 10:01:33 +00:00
fded5e5ce5 comment/remove unused vars from particle and multires code.
also remove calls to dm->getFaceDataArray() within a loop for particle grid distribution,
instead call this once at the start and reuse the result.
2011-01-11 07:38:16 +00:00
5feb46d814 callback function ptcache_particle_extra_read() was incorrect type, also fix some other compiler warnings with recent commits. 2011-01-10 05:17:53 +00:00
9231ff4160 Viscoelastic springs for sph particle fluids, original patch by Stephen Whitehorn (chickencoop)
* Viscoelastic springs between the fluid particles can simulate all kinds
  of viscous and elastic substances, such as jelly and honey. This is
  achieved by creating springs dynamically between neighboring particles
  and adjusting their rest length based on stretching/compression.
* This nearly completes the currently intended functionality for particle
  fluids. The last missing thing is a surfacing extraction algorithm,
  which is needed for a proper representation of a sph fluid.
* I also cleaned up and renamed some of the fluid parameters to make the
  ui a bit easier to understand.
* One addition to the patch is an option to use "initial rest length" for
  the springs, which uses the lengths between the particles at the time of
  spring creation as the spring rest lengths instead of interaction radius/2.
  This makes the fluid keep it's original shape better (good for very
  viscoelastic materials), but can create large density differences inside
  the fluid (not really physically correct for a fluid).
* Viscoelastic springs are stored in point cache as extra data.
2011-01-09 19:09:41 +00:00
3b74074aec remove unused code & variables. 2011-01-08 12:43:44 +00:00
89c9aaaa25 remove references to BKE_utildefines where its not needed.
- move GS() define into DNA_ID.h
- add BLI_utildefines as an automatic include with makesrna generated files.
2011-01-07 19:18:31 +00:00
8f21a43535 split BKE_utildefines.h, now it only has blender specific defines like GS() MAKE_ID, FILE_MAXDIR, moved the generic defines to BLI_utildefines.h.
no functional changes.
2011-01-07 18:36:47 +00:00
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
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
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
109d3b8454 bugfix [#25519] particlesystem, type hair, hair dynamics enabled: crash with amount 0 2011-01-07 04:30:02 +00:00
7a7760e938 Fix for [#25492] Cached particles are killed too early
* Own mistake from the sph particle fluids fix.
2011-01-05 08:52:13 +00:00
a7ceeafd71 - correct typos in comments.
- move boxpack struct out of the public header.
2011-01-02 11:06:50 +00:00
a6a2512f47 Pointcache code cleanup and disk cache compression options:
* Massive reorganization of pointcache code, things are now cleaner than ever.
* For all but smoke the cache is first written to memory when using disk cache and after that written to disk in one operation. This allows less disk operations and the possibility to compress the data before writing it to disk.
* Previously only smoke cache could be compressed, now the same options exist for other physics types too (when using disk cache). For now the default compression option is still "no compression", but if there aren't any problems this can be set to "light compression" as it's actually faster than no compression in most cases since there's less data to write to the disk. Based on quick tests heavy compression can reduce the file size down to 1/3rd of the original size, but is really slow compared to other options, so it should be used only if file size is critical!
* The pointcache code wasn't really 64bit compatible (for disk cache) until now, so this update should fix some crashes on 64bit builds too. Now all integer data that's saved to disk uses 32 bit unsigned integers, so simulations done on 64bit should load fine on 32bit machines and vice versa. (Important disk cache simulations made on 64bit builds should be converted to memory cache in a revision before this commit).
* There are also the beginnings of extradata handling code in pointcache in anticipation of adding the dynamic springs for particle fluids (the springs need to be stored as extradata into point cache).
* Particles were being read from the cache with a slightly wrong framerate. In most cases this probably wasn't noticeable, but none the less the code is now correct in every way.
* Small other fixes here and there & some cosmetic changes to cache panel, but over all there should be no functional changes other than the new disk cache compression options.
* This whole re-organization also seems to fix bug #25436 and hopefully shouldn't introduce any new ones!
2011-01-02 06:52:47 +00:00
9d756fb761 Fix for [#25339] Rendering Fluid's Float Particals cause crash when utilizng raytracing
* Fluidsim particles hadn't really been working at all for who knows how long, even in viewport!
2010-12-22 09:30:13 +00:00
b58dbbd51b Extreme makeover of pointcache code:
* Pointcache code was quite ugly looking and complicated, so here are mostly just cosmetic adjustments, but some improved logic also.
* Slight cleanup of pointcache ui too.
* Shouldn't have any functional changes what so ever, so poke me right away if something seems off.
2010-12-18 15:03:31 +00:00
ee762ce93f Fix for mistake in own commit
* Was a bit too eager to clean up, so all particles got reset when changing a particle value when animation was playing.
2010-12-18 09:32:27 +00:00
48abe2a27f Big fix: particle pointcache was cleared fully on any particle setting change
* Now only the cache after current frame is cleared.
* Probably own fault from my last commit.
2010-12-17 13:13:32 +00:00
6b2b56c35e Fix for [#25218] No smoke is emitted when particle system starts and ends on same frame
* Depsgraph wasn't updated properly for smoke flow collision object dependencies.
* Smoke also wasn't properly using the actual emission frame of the flow particles.
* There was a lot of bloated logic in some parts of particle code so this fix turned into a small scale cleanup operation.
** As a result particle updating and cache usage should be a bit more stable too.
2010-12-15 17:05:34 +00:00
2dc61df9ea Fix for [#25206] Particles system can't start at frame 0
* The basic problem is that frame 0 can't be cached, so the correct solution is to read frame 1 and interpolate backwards from that state.
2010-12-14 15:49:36 +00:00
7bf5d9449c "Fix" for [#25184] Forces for growing hair - update inconsistency - as discussed with Jahka on Saturday on IRC
* New option to "Regrow hair" for each frame.
* This was perhaps more a feature request, but there was a similar useful feature called "animated hair" in particles at some point.
* The previous behavior for hair growing was inconsistent to say the least, so this is a nice option to have.
2010-12-13 10:45:24 +00:00
f610c9b8a2 Bug fix: child particles weren't always updated correctly
* Calling update_children(..) is very light if there's nothing to update, so it doesn't matter if it's called every time the particle system is updated.
2010-12-10 10:34:12 +00:00
fe19e5336b Fix for [#25095] Particle systems and object with collision modifier bug
* Collisions didn't take emitter object layer into account
2010-12-10 08:29:46 +00:00
8c467a9c8a Fix for [#25036] boids particle from 2.49 opened in 2.5 is crash !?
* Old boids didn't have all of the necessary data for the new system.
* Changed the particles code so that a check for all necessary data is always done before starting actual dynamics calculations.
2010-12-05 01:48:49 +00:00
263830f000 Enabled GCC -Wwrite-strings warning for CMake and replaced many 'char's for 'const char's,.
Only one functional change where Transform orientations passed "" to BIF_createTransformOrientation() which could then have the value written into.
2010-12-03 17:05:21 +00:00
5ca7c1b0f8 Fix for [#25006] Particle system crash (missing check for negative index) 2010-12-02 14:52:07 +00:00
0b74aab939 remove unused argument. 2010-11-19 01:06:46 +00:00
b83cc77b14 Bugfix #24795: Typo fix in particle_system.c
Also, fixed indention in armature.c (stupid space-based indention)
2010-11-18 23:48:55 +00:00
71721f02fc Algorithm fix for fluid particles:
* The SPH fluid particle algorithm was implemented a bit wrong. This problem could for example result in the fluid moving sideways after being dropped straight to a horizontal collision surface, a very big no-no as far as real world physics are concerned!
* After some extensive code shuffling the algorithm is now much more true to the paper it was implemented from, and more importantly now the physics should be correct too!
* The main thing was that fluids calculations can effect many particles simultaneously, so just a single loop through all particles can't work properly. As a side note this also means that the actual fluid algorithm can't be made threaded :(
* To make things work I also had to reshuffle some general particle physics code, but there should be no functional changes what so ever to other physics types, so poke me immediately if something strange happens.

Note to users: these changes will most probably effect the way previously done sph fluid simulations look, so some parameter tweaking will be needed to get things back looking the way they were.
2010-11-18 19:12:36 +00:00
c658141fad Fix for [#24750] Particles draw percentage setting is not working in No Physics mode 2010-11-16 16:56:21 +00:00
303646fbd4 Fix for [#24706] 2.55 beta Hair now only rendering small fuzzy blob 2010-11-16 16:39:35 +00:00
5182fa2e05 Fix for [#24724] Emission settings of Particles with no physics are stuck to Previous newtonian settings. 2010-11-15 09:15:23 +00:00
b874bdc227 Fix for [#24580] and [#24600]
* Particles didn't want to stay cached, even if there were no actual chages.
* Particle states weren't set properly for times before actual simulation start.
2010-11-09 11:17:00 +00:00
66b274766a minor c90 compat edits. (no functional changes). 2010-11-05 13:37:18 +00:00
09435ec149 Oops, particle collisions didn't take simulation subframes into account at all.
* This caused nearly all particles to leak through the collision surface if simulation subframes were used and the collision object was moving.
* In addition to fixing this I also did some more cleanup of the collision code and refined some of the comments.
2010-11-02 21:16:41 +00:00
7a56940207 Fix for [#24401] Fluid particles leak through walls of moving object 2010-10-27 14:56:53 +00:00
Nathan Letwory
dad9423dd6 Include BLI_storage.h where zlib.h is also included. Some systems need _LARGESOURCE64_FILE defined for zlib to not throw errors. 2010-10-22 14:04:54 +00:00
fec8292df1 remove unused args for some modifiers, no functional change. 2010-10-21 01:10:22 +00:00
4d37cf90b9 remove G.sce, use G.main->name instead.
Both stored the filename of the blend file, but G.sce stored the last opened file.
This will make blender act differently in some cases since a relative path to the last opened file will no longer resolve (which is correct IMHO since that file isnt open and the path might not even be valid anymore).

Tested linking with durian files and rendering to relative paths when no files is loaded however we may need to have some operators give an error if they are used on the default startup.blend.
2010-10-18 06:41:16 +00:00
8268a4be71 most unused arg warnings corrected.
- removed deprecated bitmap arg from IMB_allocImBuf (plugins will need updating).
- mostly tagged UNUSED() since some of these functions look like they may need to have the arguments used later.
2010-10-16 14:32:17 +00:00
d3bf6b7224 Fix for [#24237] Hair dynamics with zero particles generates a segmentation fault 2010-10-14 09:01:03 +00:00
361bd506dc Fix for [#23970] Memory problem when setting hair amount to zero 2010-09-24 07:39:52 +00:00
7cbed194f4 Fix for [#23872] particle deflection in conjunction with SPH particles is apparently buggy
* Fix turned into a thorough cleanup and reorganization of particle collision response code.
* Collisions are now much more accurate, stable and even a bit more in agreement with real world physics.
* Only still remaining problem is rotating/deforming deflector objects, but that's something for the future.
* Visible changes should only be positive, i.e. no leaking particles, no strange instabilities etc.
2010-09-23 09:31:13 +00:00
b4a4c33054 Possible fix for all the particles related SIMD SVBVH bugs.
* Velocity for particles that were born at exactly integer frames was calculated wrong when they were born.
Note: If you had a raytrace acceleration related bug, please clear the pointcache for all particles, toggle a particle setting to reset pointcache and rebake to create a valid simulation.
2010-09-17 19:02:19 +00:00
9234f29e67 bugfix [#23405] PNG Images bigger then 2gig wont load with blender.
all image formats should be able to load files bigger then 2gig (when its supported)
2010-09-15 06:43:36 +00:00
f0fe8a559d Partial fix for [#23714] Linked instance group with particles doesn't render properly
* Only partial because rendering of dupliobjects / groups with particles isn't yet fully implemented
2010-09-08 11:08:34 +00:00
d89d724c46 Fix for [#22387] Collider stickiness seems to have broke
* Note that this fix might slightly change the simulation results of some files that use the stickiness value, but lowering the value should fix these issues.
2010-09-03 07:47:10 +00:00
9659d47d8b Fix for [#23642] Particle system "Lifetime" setting does not animate 2010-09-03 06:12:40 +00:00
f611fa80af Fix for [#23298] Kill particle breaks when baking simulation
* Cached particle die times are now read from cached data
2010-09-02 10:26:19 +00:00