[Bf-blender-cvs] [66521b382b3] master: Depsgraph: Correction to previous particle fix

Sergey Sharybin noreply at git.blender.org
Tue Feb 6 14:51:04 CET 2018


Commit: 66521b382b33168dc661f53b20a3cde7933eecf6
Author: Sergey Sharybin
Date:   Tue Feb 6 14:47:02 2018 +0100
Branches: master
https://developer.blender.org/rB66521b382b33168dc661f53b20a3cde7933eecf6

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.

===================================================================

M	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
M	source/blender/render/intern/source/pipeline.c

===================================================================

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 <errno.h>
 
 #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;
+						}
+					}
 				}
 			}
 		}



More information about the Bf-blender-cvs mailing list