Depsgraph: Rework debug relations update function
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 25 Oct 2017 10:11:49 +0000 (12:11 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 25 Oct 2017 10:11:49 +0000 (12:11 +0200)
Make it a tag for relations update function instead, since we will not be able
to easily rebuild relations, and we wouldn't be able to iterate all scenes.

This is a part of mowing depsgraph to be per-workspace/layer in 2.8 branch.

source/blender/makesrna/intern/rna_depsgraph.c

index 4a53cea5f958cecec3a6bf7a27c672959359b657..adb99acef1f524e88b8a1ed289a13de8fc8ea243 100644 (file)
@@ -42,8 +42,7 @@
 
 #ifdef RNA_RUNTIME
 
-#include "BKE_report.h"
-
+#include "DEG_depsgraph_build.h"
 #include "DEG_depsgraph_debug.h"
 
 static void rna_Depsgraph_debug_graphviz(Depsgraph *graph, const char *filename)
@@ -56,14 +55,9 @@ static void rna_Depsgraph_debug_graphviz(Depsgraph *graph, const char *filename)
        fclose(f);
 }
 
-static void rna_Depsgraph_debug_rebuild(Depsgraph *UNUSED(graph), Main *bmain)
+static void rna_Depsgraph_debug_tag_update(Depsgraph *graph)
 {
-       Scene *sce;
-       DAG_relations_tag_update(bmain);
-       for (sce = bmain->scene.first; sce; sce = sce->id.next) {
-               DAG_scene_relations_rebuild(bmain, sce);
-               DEG_graph_on_visible_update(bmain, sce);
-       }
+       DEG_graph_tag_relations_update(graph);
 }
 
 static void rna_Depsgraph_debug_stats(Depsgraph *graph, char *result)
@@ -91,8 +85,7 @@ static void rna_def_depsgraph(BlenderRNA *brna)
                                        "File in which to store graphviz debug output");
        RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
 
-       func = RNA_def_function(srna, "debug_rebuild", "rna_Depsgraph_debug_rebuild");
-       RNA_def_function_flag(func, FUNC_USE_MAIN);
+       func = RNA_def_function(srna, "debug_tag_update", "rna_Depsgraph_debug_tag_update");
 
        func = RNA_def_function(srna, "debug_stats", "rna_Depsgraph_debug_stats");
        RNA_def_function_ui_description(func, "Report the number of elements in the Dependency Graph");