[Bf-blender-cvs] [e198c5a175c] master: Fix crash happening with hair step

Sergey Sharybin noreply at git.blender.org
Fri Jan 25 14:02:46 CET 2019


Commit: e198c5a175cf2c44a034d9a42e51027fe89002b8
Author: Sergey Sharybin
Date:   Fri Jan 25 13:58:42 2019 +0100
Branches: master
https://developer.blender.org/rBe198c5a175cf2c44a034d9a42e51027fe89002b8

Fix crash happening with hair step

The issue was caused by the hair step checking whether
particle system needs to have path cache. This was done
in a way which was traversing an entire scene and was
checking every object for particle instance modifier.

Ideally, path cache should be an own operation in the
dependency graph. Or at least, this flag should be set
by dependency graph builder, similar to curve's path.

Since the code was broken already (it was only checking
first particle instance modifier), it is easier to
remove the buggy code, solve the crash and move on for
now.

If this causes an issue, simply set particle system to
be rendered as path.

Fixes crash with playback of Spring scenes.

===================================================================

M	source/blender/blenkernel/intern/particle_system.c

===================================================================

diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 86d2ceddced..bed03858db8 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -2969,23 +2969,6 @@ static void psys_update_path_cache(ParticleSimulationData *sim, float cfra, cons
 		}
 	}
 
-
-	/* particle instance modifier with "path" option need cached paths even if particle system doesn't */
-	if (skip) {
-		FOREACH_SCENE_OBJECT_BEGIN(sim->scene, ob)
-		{
-			ModifierData *md = modifiers_findByType(ob, 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;
-				}
-			}
-		}
-		FOREACH_SCENE_OBJECT_END;
-	}
-
 	if (!skip) {
 		psys_cache_paths(sim, cfra, use_render_params);



More information about the Bf-blender-cvs mailing list