diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-03-28 18:32:51 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-03-29 13:41:11 +0300 |
commit | 44cd24a9cee9ffb14b5d26a622f2158f55e008ba (patch) | |
tree | 4ff9740ad9fe6a99797c9b0a0d08130efaf13ed5 /source/blender/blenkernel/intern/particle_system.c | |
parent | 526719bccb8bc8a592ad951cb3a137ce56fa4834 (diff) |
Particles: Remove dedicated recalc field from ParticleSettings
Use more generic id->recalc flag.
Also sanitize flag flush from settings to particle system.
Need to do such flush before triggering point cache reset, since
point cache reset will do some logic based on what flags are set.
This will solve crash caused by threaded update which will set
some bitflags while point cache reset is in progress.
Diffstat (limited to 'source/blender/blenkernel/intern/particle_system.c')
-rw-r--r-- | source/blender/blenkernel/intern/particle_system.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index f27a570ca29..b80eca0ed59 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -4417,24 +4417,16 @@ void BKE_particlesystem_id_loop(ParticleSystem *psys, ParticleSystemIDFunc func, /* **** Depsgraph evaluation **** */ -void BKE_particle_system_settings_eval(const struct EvaluationContext *UNUSED(eval_ctx), - ParticleSystem *psys) -{ - DEG_debug_print_eval(__func__, psys->name, psys); - psys->recalc |= psys->part->recalc; -} - -void BKE_particle_system_settings_recalc_clear(struct EvaluationContext *UNUSED(eval_ctx), - ParticleSettings *particle_settings) -{ - DEG_debug_print_eval(__func__, particle_settings->id.name, particle_settings); - particle_settings->recalc = 0; -} - void BKE_particle_system_eval_init(const struct EvaluationContext *UNUSED(eval_ctx), Scene *scene, Object *ob) { DEG_debug_print_eval(__func__, ob->id.name, ob); + for (ParticleSystem *psys = ob->particlesystem.first; + psys != NULL; + psys = psys->next) + { + psys->recalc |= (psys->part->id.recalc & DEG_TAG_PSYS_ALL); + } BKE_ptcache_object_reset(scene, ob, PTCACHE_RESET_DEPSGRAPH); } |