[Bf-blender-cvs] [72b61763da5] blender2.8: Depsgraph: Begin bringing API to pass explicit graph
Sergey Sharybin
noreply at git.blender.org
Tue Oct 24 16:04:26 CEST 2017
Commit: 72b61763da593fb6a9822f3e37eff9dd2973bf66
Author: Sergey Sharybin
Date: Tue Oct 24 15:14:22 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB72b61763da593fb6a9822f3e37eff9dd2973bf66
Depsgraph: Begin bringing API to pass explicit graph
This is a first step towards an updated API where we pass explicit graph rather
than a scene. This is because we can no longer deduct which graph to use since
it will depend on a context.
Will happen in several steps, so bisecting will not be such a pain.
===================================================================
M source/blender/depsgraph/DEG_depsgraph.h
M source/blender/depsgraph/intern/depsgraph_tag.cc
M source/blender/makesrna/intern/rna_depsgraph.c
===================================================================
diff --git a/source/blender/depsgraph/DEG_depsgraph.h b/source/blender/depsgraph/DEG_depsgraph.h
index b76545a2884..34e59966a71 100644
--- a/source/blender/depsgraph/DEG_depsgraph.h
+++ b/source/blender/depsgraph/DEG_depsgraph.h
@@ -134,7 +134,7 @@ void DEG_free_node_types(void);
/* Update Tagging -------------------------------- */
/* Update dependency graph when visible scenes/layers changes. */
-void DEG_graph_on_visible_update(struct Main *bmain, struct Scene *scene);
+void DEG_graph_on_visible_update(struct Main *bmain, Depsgraph *depsgraph);
/* Update all dependency graphs when visible scenes/layers changes. */
void DEG_on_visible_update(struct Main *bmain, const bool do_time);
@@ -167,9 +167,7 @@ enum {
DEG_TAG_SHADING_UPDATE = (1 << 9),
};
void DEG_id_tag_update(struct ID *id, int flag);
-void DEG_id_tag_update_ex(struct Main *bmain,
- struct ID *id,
- int flag);
+void DEG_id_tag_update_ex(struct Main *bmain, struct ID *id, int flag);
/* Tag given ID type for update.
*
diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc
index 19d3dda1896..cde87ba126c 100644
--- a/source/blender/depsgraph/intern/depsgraph_tag.cc
+++ b/source/blender/depsgraph/intern/depsgraph_tag.cc
@@ -361,7 +361,7 @@ void deg_id_tag_update(Main *bmain, ID *id, int flag)
}
}
-void deg_graph_on_visible_update(Main *bmain, Scene *scene, Depsgraph *graph)
+void deg_graph_on_visible_update(Main *bmain, Depsgraph *graph)
{
/* Make sure objects are up to date. */
GHASH_FOREACH_BEGIN(DEG::IDDepsNode *, id_node, graph->id_hash)
@@ -389,7 +389,7 @@ void deg_graph_on_visible_update(Main *bmain, Scene *scene, Depsgraph *graph)
}
GHASH_FOREACH_END();
/* Make sure collection properties are up to date. */
- IDDepsNode *scene_id_node = graph->find_id_node(&scene->id);
+ IDDepsNode *scene_id_node = graph->find_id_node(&graph->scene->id);
BLI_assert(scene_id_node != NULL);
scene_id_node->tag_update(graph);
}
@@ -436,16 +436,14 @@ void DEG_scene_flush_update(Main *bmain, Scene *scene)
if (scene->depsgraph_legacy == NULL) {
return;
}
- DEG::deg_graph_flush_updates(
- bmain,
- reinterpret_cast<DEG::Depsgraph *>(scene->depsgraph_legacy));
+ DEG::deg_graph_flush_updates(bmain, (DEG::Depsgraph *)scene->depsgraph_legacy);
}
/* Update dependency graph when visible scenes/layers changes. */
-void DEG_graph_on_visible_update(Main *bmain, Scene *scene)
+void DEG_graph_on_visible_update(Main *bmain, Depsgraph *depsgraph)
{
- DEG::Depsgraph *graph = (DEG::Depsgraph *)scene->depsgraph_legacy;
- DEG::deg_graph_on_visible_update(bmain, scene, graph);
+ DEG::Depsgraph *graph = (DEG::Depsgraph *)depsgraph;
+ DEG::deg_graph_on_visible_update(bmain, graph);
}
void DEG_on_visible_update(Main *bmain, const bool UNUSED(do_time))
@@ -455,7 +453,7 @@ void DEG_on_visible_update(Main *bmain, const bool UNUSED(do_time))
scene = (Scene *)scene->id.next)
{
if (scene->depsgraph_legacy != NULL) {
- DEG_graph_on_visible_update(bmain, scene);
+ DEG_graph_on_visible_update(bmain, scene->depsgraph_legacy);
}
}
}
diff --git a/source/blender/makesrna/intern/rna_depsgraph.c b/source/blender/makesrna/intern/rna_depsgraph.c
index 88a1873c17f..bab718c7235 100644
--- a/source/blender/makesrna/intern/rna_depsgraph.c
+++ b/source/blender/makesrna/intern/rna_depsgraph.c
@@ -141,7 +141,7 @@ static void rna_Depsgraph_debug_rebuild(Depsgraph *UNUSED(graph), bContext *C)
DEG_relations_tag_update(bmain);
for (sce = bmain->scene.first; sce; sce = sce->id.next) {
DEG_scene_relations_rebuild(bmain, sce);
- DEG_graph_on_visible_update(bmain, sce);
+ DEG_graph_on_visible_update(bmain, sce->depsgraph_legacy);
}
}
More information about the Bf-blender-cvs
mailing list