From e198c5a175cf2c44a034d9a42e51027fe89002b8 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 25 Jan 2019 13:58:42 +0100 Subject: [PATCH] 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. --- .../blender/blenkernel/intern/particle_system.c | 17 ----------------- 1 file changed, 17 deletions(-) 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);