[Bf-blender-cvs] [eccbca9e7dd] blender2.8: Depsgraph: Fix several ID blocks added multiple times to depsgraph

Sergey Sharybin noreply at git.blender.org
Fri May 4 16:37:25 CEST 2018


Commit: eccbca9e7ddf826aab2e0a8566735b27ea3bbe37
Author: Sergey Sharybin
Date:   Fri May 4 16:36:27 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBeccbca9e7ddf826aab2e0a8566735b27ea3bbe37

Depsgraph: Fix several ID blocks added multiple times to depsgraph

Ideally, we need to get rid of whole bmain iteration in depsgraph
construction, but then it's not clear which movie clips and such
to evaluate.

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

M	source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
M	source/blender/depsgraph/intern/builder/deg_builder_relations.cc

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

diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 3c7740e62fd..0545dd33a29 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -1337,6 +1337,9 @@ void DepsgraphNodeBuilder::build_compositor(Scene *scene)
 
 void DepsgraphNodeBuilder::build_gpencil(bGPdata *gpd)
 {
+	if (built_map_.checkIsBuiltAndTag(gpd)) {
+		return;
+	}
 	ID *gpd_id = &gpd->id;
 
 	/* TODO(sergey): what about multiple users of same datablock? This should
@@ -1351,6 +1354,9 @@ void DepsgraphNodeBuilder::build_gpencil(bGPdata *gpd)
 
 void DepsgraphNodeBuilder::build_cachefile(CacheFile *cache_file)
 {
+	if (built_map_.checkIsBuiltAndTag(cache_file)) {
+		return;
+	}
 	ID *cache_file_id = &cache_file->id;
 	/* Animation, */
 	build_animdata(cache_file_id);
@@ -1361,6 +1367,9 @@ void DepsgraphNodeBuilder::build_cachefile(CacheFile *cache_file)
 
 void DepsgraphNodeBuilder::build_mask(Mask *mask)
 {
+	if (built_map_.checkIsBuiltAndTag(mask)) {
+		return;
+	}
 	ID *mask_id = &mask->id;
 	Mask *mask_cow = get_cow_datablock(mask);
 	/* F-Curve based animation. */
@@ -1379,6 +1388,9 @@ void DepsgraphNodeBuilder::build_mask(Mask *mask)
 
 void DepsgraphNodeBuilder::build_movieclip(MovieClip *clip)
 {
+	if (built_map_.checkIsBuiltAndTag(clip)) {
+		return;
+	}
 	ID *clip_id = &clip->id;
 	MovieClip *clip_cow = get_cow_datablock(clip);
 	/* Animation. */
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index 94c9f0cdd57..ae25aa77d98 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -1983,6 +1983,9 @@ void DepsgraphRelationBuilder::build_compositor(Scene *scene)
 
 void DepsgraphRelationBuilder::build_gpencil(bGPdata *gpd)
 {
+	if (built_map_.checkIsBuiltAndTag(gpd)) {
+		return;
+	}
 	/* animation */
 	build_animdata(&gpd->id);
 
@@ -1991,12 +1994,18 @@ void DepsgraphRelationBuilder::build_gpencil(bGPdata *gpd)
 
 void DepsgraphRelationBuilder::build_cachefile(CacheFile *cache_file)
 {
+	if (built_map_.checkIsBuiltAndTag(cache_file)) {
+		return;
+	}
 	/* Animation. */
 	build_animdata(&cache_file->id);
 }
 
 void DepsgraphRelationBuilder::build_mask(Mask *mask)
 {
+	if (built_map_.checkIsBuiltAndTag(mask)) {
+		return;
+	}
 	ID *mask_id = &mask->id;
 	/* F-Curve animation. */
 	build_animdata(mask_id);
@@ -2013,6 +2022,9 @@ void DepsgraphRelationBuilder::build_mask(Mask *mask)
 
 void DepsgraphRelationBuilder::build_movieclip(MovieClip *clip)
 {
+	if (built_map_.checkIsBuiltAndTag(clip)) {
+		return;
+	}
 	/* Animation. */
 	build_animdata(&clip->id);
 }



More information about the Bf-blender-cvs mailing list