Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2017-07-18 13:12:15 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-07-19 16:20:06 +0300
commit5727e8706fa5bf847696d4433323c5a96c83dae8 (patch)
tree11b00bacb500038f55b980a42e9a9125c94209d0 /source/blender/blenkernel
parent2fe5cf4807d15eb5a1bbaef8715eb277627c17d4 (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')
-rw-r--r--source/blender/blenkernel/BKE_particle.h3
-rw-r--r--source/blender/blenkernel/intern/particle_system.c11
2 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h
index ec707c84872..639aefd029f 100644
--- a/source/blender/blenkernel/BKE_particle.h
+++ b/source/blender/blenkernel/BKE_particle.h
@@ -473,6 +473,9 @@ typedef struct ParticleRenderData {
struct EvaluationContext;
+void BKE_particle_system_settings_eval(struct EvaluationContext *eval_ctx,
+ struct ParticleSystem *psys);
+
void BKE_particle_system_eval(struct EvaluationContext *eval_ctx,
struct Scene *scene,
struct Object *ob,
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);
}