diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-06-21 17:30:34 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-06-21 18:08:42 +0300 |
commit | 991d4f1c6b661d9a6b00e073d9a01c8a8a133b12 (patch) | |
tree | 5f2ca156d07e3155107a09d5c3cfb2b2db128880 /source/blender/blenkernel/intern/effect.c | |
parent | 318ad705ad366f457ada2e9fe5f6c43902bd62ae (diff) |
Fix incorrect use of G.is_rendering for particles in some places.
Diffstat (limited to 'source/blender/blenkernel/intern/effect.c')
-rw-r--r-- | source/blender/blenkernel/intern/effect.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index 7e506570b7e..c155fbc1d97 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -188,8 +188,9 @@ static void add_object_to_effectors(ListBase **effectors, struct Depsgraph *deps static void add_particles_to_effectors(ListBase **effectors, struct Depsgraph *depsgraph, Scene *scene, EffectorWeights *weights, Object *ob, ParticleSystem *psys, ParticleSystem *psys_src, bool for_simulation) { ParticleSettings *part= psys->part; + const bool for_render = (DEG_get_mode(depsgraph) == DAG_EVAL_RENDER); - if ( !psys_check_enabled(ob, psys, G.is_rendering) ) + if ( !psys_check_enabled(ob, psys, for_render) ) return; if ( psys == psys_src && (part->flag & PART_SELF_EFFECT) == 0) @@ -215,7 +216,9 @@ ListBase *pdInitEffectors( struct Depsgraph *depsgraph, Scene *scene, Object *ob_src, ParticleSystem *psys_src, EffectorWeights *weights, bool for_simulation) { - Base *base = BKE_collection_or_layer_objects(depsgraph, scene, NULL, weights->group); + /* For dependency building, we get objects from the scene. + * For simulation, we get objects from the depsgraph. */ + Base *base = BKE_collection_or_layer_objects((for_simulation) ? depsgraph : NULL, scene, NULL, weights->group); ListBase *effectors = NULL; for (; base; base = base->next) { |