From 66521b382b33168dc661f53b20a3cde7933eecf6 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 6 Feb 2018 14:47:02 +0100 Subject: Depsgraph: Correction to previous particle fix The reason it appeared working was due to left-over debug code to force time dependency. Real fix seems to include force tagging objects used by duplication, similar to what we do for some other modifiers already. --- .../intern/builder/deg_builder_relations.cc | 1 - source/blender/render/intern/source/pipeline.c | 24 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index c30d3fecdd5..553442e3ca5 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -193,7 +193,6 @@ static bool particle_system_depends_on_time(ParticleSystem *psys) static bool object_particles_depends_on_time(Object *object) { - return true; BLI_LISTBASE_FOREACH (ParticleSystem *, psys, &object->particlesystem) { if (particle_system_depends_on_time(psys)) { return true; diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index f1dce4d0cfb..6ed2534f152 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -37,9 +37,11 @@ #include #include "DNA_anim_types.h" +#include "DNA_group_types.h" #include "DNA_image_types.h" #include "DNA_node_types.h" #include "DNA_object_types.h" +#include "DNA_particle_types.h" #include "DNA_scene_types.h" #include "DNA_sequence_types.h" #include "DNA_userdef_types.h" @@ -2088,6 +2090,28 @@ static void tag_dependend_objects_for_render(Scene *scene, int renderlay) DAG_id_tag_update(&smd->target->id, OB_RECALC_DATA); } } + else if (md->type == eModifierType_ParticleSystem) { + ParticleSystemModifierData *psmd = (ParticleSystemModifierData *)md; + ParticleSystem *psys = psmd->psys; + ParticleSettings *part = psys->part; + switch (part->ren_as) { + case PART_DRAW_OB: + if (part->dup_ob != NULL) { + DAG_id_tag_update(&part->dup_ob->id, OB_RECALC_DATA); + } + break; + case PART_DRAW_GR: + if (part->dup_group != NULL) { + for (GroupObject *go = part->dup_group->gobject.first; + go != NULL; + go = go->next) + { + DAG_id_tag_update(&go->ob->id, OB_RECALC_DATA); + } + } + break; + } + } } } } -- cgit v1.2.3