diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-11-21 16:36:36 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-01-20 13:36:59 +0300 |
commit | 4a4959a647bf37bf7653ab506596eed0ca0857ec (patch) | |
tree | 3919667a1ce32cff2cc01fddc05b1fb3313c15d5 | |
parent | a3f66a868e09f211dacd58c541ad9316f60f8338 (diff) |
Fix T49981: New Depsgraph - When camera is on inactive layer, it does not evaluate constraints
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_nodes.cc | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index 4de82dd63e4..e312c4e0dcb 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -372,19 +372,26 @@ SubgraphDepsNode *DepsgraphNodeBuilder::build_subgraph(Group *group) void DepsgraphNodeBuilder::build_object(Scene *scene, Base *base, Object *ob) { - if (ob->id.tag & LIB_TAG_DOIT) { - IDDepsNode *id_node = m_graph->find_id_node(&ob->id); - if (base != NULL) { - id_node->layers |= base->lay; - } - return; - } - ob->id.tag |= LIB_TAG_DOIT; - - IDDepsNode *id_node = add_id_node(&ob->id); + const bool has_object = (ob->id.tag & LIB_TAG_DOIT); + IDDepsNode *id_node = (has_object) + ? m_graph->find_id_node(&ob->id) + : add_id_node(&ob->id); + /* Update node layers. + * Do it for both new and existing ID nodes. This is so because several + * bases might be sharing same object. + */ if (base != NULL) { id_node->layers |= base->lay; } + if (ob == scene->camera) { + /* Camera should always be updated, it used directly by viewport. */ + id_node->layers |= (unsigned int)(-1); + } + /* Skip rest of components if the ID node was already there. */ + if (has_object) { + return; + } + ob->id.tag |= LIB_TAG_DOIT; ob->customdata_mask = 0; /* Standard components. */ |