diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-04-29 13:55:29 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-04-30 12:32:02 +0300 |
commit | c8f3377d03531ec52fc8dd6fa5802679166997b8 (patch) | |
tree | 8a2ef328e1ccda447649a90cb54b6d1dc7ebd7d6 /source/blender/depsgraph/intern/depsgraph_build.cc | |
parent | 587ee46d884c7508017de2635372ffac8ef638a5 (diff) |
Depsgraph: Add generic animated properties cache
Allows to speed up lookups like "is property FOO of data BAR animated".
Can be used to optimize object's visibility check, but also allows to
check animation on bones without too much of time penalty.
The cache is shared between both nodes and relations builder.
Currently is not used, just a boilerplate for an upcoming changes in
an actual logic.
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph_build.cc')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_build.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc b/source/blender/depsgraph/intern/depsgraph_build.cc index e4c84264960..dd2979160cd 100644 --- a/source/blender/depsgraph/intern/depsgraph_build.cc +++ b/source/blender/depsgraph/intern/depsgraph_build.cc @@ -46,6 +46,7 @@ extern "C" { #include "DEG_depsgraph_build.h" #include "builder/deg_builder.h" +#include "builder/deg_builder_cache.h" #include "builder/deg_builder_cycle.h" #include "builder/deg_builder_nodes.h" #include "builder/deg_builder_relations.h" @@ -238,14 +239,15 @@ void DEG_graph_build_from_view_layer(Depsgraph *graph, BLI_assert(BLI_findindex(&scene->view_layers, view_layer) != -1); BLI_assert(deg_graph->scene == scene); BLI_assert(deg_graph->view_layer == view_layer); + DEG::DepsgraphBuilderCache builder_cache; /* Generate all the nodes in the graph first */ - DEG::DepsgraphNodeBuilder node_builder(bmain, deg_graph); + DEG::DepsgraphNodeBuilder node_builder(bmain, deg_graph, &builder_cache); node_builder.begin_build(); node_builder.build_view_layer(scene, view_layer, DEG::DEG_ID_LINKED_DIRECTLY); node_builder.end_build(); /* Hook up relationships between operations - to determine evaluation * order. */ - DEG::DepsgraphRelationBuilder relation_builder(bmain, deg_graph); + DEG::DepsgraphRelationBuilder relation_builder(bmain, deg_graph, &builder_cache); relation_builder.begin_build(); relation_builder.build_view_layer(scene, view_layer); relation_builder.build_copy_on_write_relations(); |