diff options
author | Joshua Leung <aligorith@gmail.com> | 2018-08-23 04:54:07 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2018-08-23 08:07:38 +0300 |
commit | 2f2ab13b5f46b26dcffb889ac4294a52c6c79085 (patch) | |
tree | 0e95be1e88c167141f9a8bae189906df6665de7b /source/blender/depsgraph | |
parent | e5e42b77820999a4fe6de3fde92ac3b741bbe243 (diff) |
Depsgraph Filtering: Fix ID node filtering problems
* COW data hasn't been expanded yet when we try to filter the graph
(you need to have tagged + evaluated it for this data to exist),
so all the offending nodes would just get left in
* Added more debug prints to verify whether the id_nodes vector is
getting cleared correctly
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_query_filter.cc | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_query_filter.cc b/source/blender/depsgraph/intern/depsgraph_query_filter.cc index 11d8de098b9..5614804078d 100644 --- a/source/blender/depsgraph/intern/depsgraph_query_filter.cc +++ b/source/blender/depsgraph/intern/depsgraph_query_filter.cc @@ -125,19 +125,8 @@ bool deg_filter_free_idnode(Depsgraph *graph, IDDepsNode *id_node, /* This node has not been marked for deletion */ return false; } - else if (id_node->id_cow == NULL) { - /* This means builder "stole" ownership of the copy-on-written - * datablock for her own dirty needs. - */ - printf(" no id_cow "); - return false; - } - else if (!deg_copy_on_write_is_expanded(id_node->id_cow)) { - printf(" id_cow collapsed "); - return false; - } else { - const ID_Type id_type = GS(id_node->id_cow->name); + const ID_Type id_type = GS(id_node->id_orig->name); if (filter(id_type)) { printf(" id_type (T) = %d "); id_node->destroy(); @@ -277,10 +266,15 @@ Depsgraph *DEG_graph_filter(const Depsgraph *graph_src, Main *bmain, DEG_FilterQ retained_ids = NULL; /* Debug - Are the desired targets still in there? */ - printf("Filtered graph sanity check:\n"); + printf("Filtered Graph Sanity Check - Do targets exist?:\n"); LISTBASE_FOREACH(DEG_FilterTarget *, target, &query->targets) { printf(" %s -> %d\n", target->id->name, BLI_ghash_haskey(deg_graph_new->id_hash, target->id)); } + printf("Filtered Graph Sanity Check - Remaining ID Nodes:\n"); + size_t id_node_idx = 0; + foreach (DEG::IDDepsNode *id_node, deg_graph_new->id_nodes) { + printf(" %d: %s\n", id_node_idx++, id_node->id_orig->name); + } /* Print Stats */ // XXX: Hide behind debug flags @@ -289,7 +283,7 @@ Depsgraph *DEG_graph_filter(const Depsgraph *graph_src, Main *bmain, DEG_FilterQ unsigned int s_idh = BLI_ghash_len(deg_graph_src->id_hash); size_t n_outer, n_operations, n_relations; - size_t n_ids = deg_graph_src->id_nodes.size(); + size_t n_ids = deg_graph_new->id_nodes.size(); unsigned int n_idh = BLI_ghash_len(deg_graph_new->id_hash); DEG_stats_simple(graph_src, &s_outer, &s_operations, &s_relations); |