diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-07-18 13:12:15 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-07-19 16:20:06 +0300 |
commit | 5727e8706fa5bf847696d4433323c5a96c83dae8 (patch) | |
tree | 11b00bacb500038f55b980a42e9a9125c94209d0 /source/blender/blenkernel/intern/particle_system.c | |
parent | 2fe5cf4807d15eb5a1bbaef8715eb277627c17d4 (diff) |
Depsgraph: Use dependency graph flush routines to update particle settings
Previously tagging particle settings for update will iterate over all objects and
all their particle system to see whether something needs an update or not. Now we
put ParticleSettings as an ID to the dependency graph, so tagging it for update
will nicely flush updates to all dependent particle systems.
Current downside of this is that due to limitation of flush routines it will cause
some extra particle system re-evaluation when it technically not needed, and what's
more annoying currently it will discard point caches more often.
However, this is a good and simple demonstration case to improve tagging/flushing
system to accommodate for such cases (similar issues happens with CoW and shading
components). So let's try to find some generic solution to the problem!
Diffstat (limited to 'source/blender/blenkernel/intern/particle_system.c')
-rw-r--r-- | source/blender/blenkernel/intern/particle_system.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index a6ed50fd0e9..389a98e2573 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -4353,13 +4353,22 @@ void BKE_particlesystem_id_loop(ParticleSystem *psys, ParticleSystemIDFunc func, /* **** Depsgraph evaluation **** */ +void BKE_particle_system_settings_eval(struct EvaluationContext *UNUSED(eval_ctx), + ParticleSystem *psys) +{ + if (G.debug & G_DEBUG_DEPSGRAPH) { + printf("%s on %s (%p)\n", __func__, psys->name, psys); + } + psys->recalc |= PSYS_RECALC; +} + void BKE_particle_system_eval(struct EvaluationContext *UNUSED(eval_ctx), Scene *scene, Object *ob, ParticleSystem *psys) { if (G.debug & G_DEBUG_DEPSGRAPH) { - printf("%s on %s:%s\n", __func__, ob->id.name, psys->name); + printf("%s on %s:%s (%p)\n", __func__, ob->id.name, psys->name, psys); } BKE_ptcache_object_reset(scene, ob, PTCACHE_RESET_DEPSGRAPH); } |