diff options
author | Janne Karhu <jhkarh@gmail.com> | 2012-02-12 04:25:52 +0400 |
---|---|---|
committer | Janne Karhu <jhkarh@gmail.com> | 2012-02-12 04:25:52 +0400 |
commit | a7458742b1f87c918fad6e7f0081e5d2b2e94125 (patch) | |
tree | c60197638edd28fd2d135a4e86a7617a357fdba8 /source/blender/blenkernel/intern/particle_system.c | |
parent | 0327b9a0cf9cac49936a09a9fc943be5e5337813 (diff) |
Fix [#29265] Particle Instance: Create Along Paths + Children inconsistent with actual children hair particles
* Hair particle rotations weren't calculated properly for particle locations along a path and the "particle on path" calculations were not correct in many other ways too.
* Now the particle's location along a path is interpolated directly from the cached paths if it exist. These paths are always correctly calculated.
* Paths are now cached if a particle instance modifier using the particle system with the path option exists.
Diffstat (limited to 'source/blender/blenkernel/intern/particle_system.c')
-rw-r--r-- | source/blender/blenkernel/intern/particle_system.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 5a64da7354e..e853c0fee19 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -3407,6 +3407,7 @@ static void psys_update_path_cache(ParticleSimulationData *sim, float cfra) ParticleSystem *psys = sim->psys; ParticleSettings *part = psys->part; ParticleEditSettings *pset = &sim->scene->toolsettings->particle; + Base *base; int distr=0, alloc=0, skip=0; if((psys->part->childtype && psys->totchild != get_psys_tot_child(sim->scene, psys)) || psys->recalc&PSYS_RECALC_RESET) @@ -3449,6 +3450,19 @@ static void psys_update_path_cache(ParticleSimulationData *sim, float cfra) } } + + /* particle instance modifier with "path" option need cached paths even if particle system doesn't */ + for (base = sim->scene->base.first; base; base= base->next) { + ModifierData *md = modifiers_findByType(base->object, eModifierType_ParticleInstance); + if(md) { + ParticleInstanceModifierData *pimd = (ParticleInstanceModifierData *)md; + if(pimd->flag & eParticleInstanceFlag_Path && pimd->ob == sim->ob && pimd->psys == (psys - (ParticleSystem*)sim->ob->particlesystem.first)) { + skip = 0; + break; + } + } + } + if(!skip) { psys_cache_paths(sim, cfra); |