From d211c36c836a929d9ac6feb693fbab2e1599fa00 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 24 Nov 2017 16:34:06 +0100 Subject: Depsgraph: Allow tagging whole scene for base flags flush --- source/blender/depsgraph/intern/depsgraph_tag.cc | 31 ++++++++++++++++-------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'source') diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc index d13f40af1bc..faaf3a828b2 100644 --- a/source/blender/depsgraph/intern/depsgraph_tag.cc +++ b/source/blender/depsgraph/intern/depsgraph_tag.cc @@ -287,7 +287,6 @@ void id_tag_update_select_update(Depsgraph *graph, IDDepsNode *id_node) ComponentDepsNode *component; OperationDepsNode *node = NULL; const ID_Type id_type = GS(id_node->id_orig->name); - if (id_type == ID_SCE) { /* We need to flush base flags to all objects in a scene since we * don't know which ones changed. However, we don't want to update @@ -328,17 +327,29 @@ void id_tag_update_select_update(Depsgraph *graph, IDDepsNode *id_node) void id_tag_update_base_flags(Depsgraph *graph, IDDepsNode *id_node) { - ComponentDepsNode *component = - id_node->find_component(DEG_NODE_TYPE_LAYER_COLLECTIONS); - if (component == NULL) { - return; + ComponentDepsNode *component; + OperationDepsNode *node = NULL; + const ID_Type id_type = GS(id_node->id_orig->name); + if (id_type == ID_SCE) { + component = id_node->find_component(DEG_NODE_TYPE_LAYER_COLLECTIONS); + if (component == NULL) { + return; + } + node = component->find_operation(DEG_OPCODE_VIEW_LAYER_INIT); } - OperationDepsNode *node = - component->find_operation(DEG_OPCODE_OBJECT_BASE_FLAGS); - if (node == NULL) { - return; + else if (id_type == ID_OB) { + component = id_node->find_component(DEG_NODE_TYPE_LAYER_COLLECTIONS); + if (component == NULL) { + return; + } + node = component->find_operation(DEG_OPCODE_OBJECT_BASE_FLAGS); + if (node == NULL) { + return; + } + } + if (node != NULL) { + node->tag_update(graph); } - node->tag_update(graph); } void id_tag_update_ntree_special(Main *bmain, Depsgraph *graph, ID *id, int flag) -- cgit v1.2.3