[Bf-blender-cvs] [da78338da03] blender2.8: Depsgraph: Add function to update relations within a given graph

Sergey Sharybin noreply at git.blender.org
Wed Oct 25 13:45:09 CEST 2017


Commit: da78338da035a95b6eb5c5c52144ffa0e7bcb236
Author: Sergey Sharybin
Date:   Wed Oct 25 12:27:37 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBda78338da035a95b6eb5c5c52144ffa0e7bcb236

Depsgraph: Add function to update relations within a given graph

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

M	source/blender/depsgraph/DEG_depsgraph_build.h
M	source/blender/depsgraph/intern/depsgraph_build.cc

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

diff --git a/source/blender/depsgraph/DEG_depsgraph_build.h b/source/blender/depsgraph/DEG_depsgraph_build.h
index 84cf12ba675..df82e962900 100644
--- a/source/blender/depsgraph/DEG_depsgraph_build.h
+++ b/source/blender/depsgraph/DEG_depsgraph_build.h
@@ -65,6 +65,11 @@ void DEG_graph_build_from_scene(struct Depsgraph *graph,
 /* Tag relations from the given graph for update. */
 void DEG_graph_tag_relations_update(struct Depsgraph *graph);
 
+/* Create or update relations in the specified graph. */
+void DEG_graph_relations_update(struct Depsgraph *graph,
+                                struct Main *bmain,
+                                struct Scene *scene);
+
 /* Tag all relations in the database for update.*/
 void DEG_relations_tag_update(struct Main *bmain);
 
diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc b/source/blender/depsgraph/intern/depsgraph_build.cc
index 87dcde045a6..9822cd154b1 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.cc
+++ b/source/blender/depsgraph/intern/depsgraph_build.cc
@@ -257,6 +257,17 @@ void DEG_graph_tag_relations_update(Depsgraph *graph)
 	deg_graph->need_update = true;
 }
 
+/* Create or update relations in the specified graph. */
+void DEG_graph_relations_update(Depsgraph *graph, Main *bmain, Scene *scene)
+{
+	DEG::Depsgraph *deg_graph = (DEG::Depsgraph *)graph;
+	if (!deg_graph->need_update) {
+		/* Graph is up to date, nothing to do. */
+		return;
+	}
+	DEG_graph_build_from_scene(graph, bmain, scene);
+}
+
 /* Tag all relations for update. */
 void DEG_relations_tag_update(Main *bmain)
 {
@@ -282,17 +293,7 @@ void DEG_scene_relations_update(Main *bmain, Scene *scene)
 		DEG_graph_build_from_scene(scene->depsgraph_legacy, bmain, scene);
 		return;
 	}
-
-	DEG::Depsgraph *graph = reinterpret_cast<DEG::Depsgraph *>(scene->depsgraph_legacy);
-	if (!graph->need_update) {
-		/* Graph is up to date, nothing to do. */
-		return;
-	}
-
-	/* Build new nodes and relations. */
-	DEG_graph_build_from_scene(reinterpret_cast< ::Depsgraph * >(graph),
-	                           bmain,
-	                           scene);
+	DEG_graph_relations_update(scene->depsgraph_legacy, bmain, scene);
 }
 
 /* Rebuild dependency graph only for a given scene. */



More information about the Bf-blender-cvs mailing list