diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-07-13 11:07:09 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-07-13 11:07:09 +0300 |
commit | 527674b316b8a2736deb3ef7f64aa2861b03da87 (patch) | |
tree | 95c56c1560ce627bd6db8b9589791d6d904f0a6a /source/blender/depsgraph | |
parent | 8939787bfb4b9068408f5fb931354d0fe68faf86 (diff) |
Depsgraph: Accumulate object layers from all bases
This solves bug when same object is instanced from multiple bases.
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_nodes.cc | 4 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/nodes/deg_node.cc | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index 2d67ef1d584..e036878ddff 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -397,12 +397,12 @@ 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); - id_node->layers = base->lay; + id_node->layers |= base->lay; return; } IDDepsNode *id_node = add_id_node(&ob->id); - id_node->layers = base->lay; + id_node->layers |= base->lay; ob->customdata_mask = 0; /* standard components */ diff --git a/source/blender/depsgraph/intern/nodes/deg_node.cc b/source/blender/depsgraph/intern/nodes/deg_node.cc index 12d5ee00a63..db807d22b89 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node.cc +++ b/source/blender/depsgraph/intern/nodes/deg_node.cc @@ -181,6 +181,11 @@ void IDDepsNode::init(const ID *id, const string &UNUSED(subdata)) this->layers = (1 << 20) - 1; this->eval_flags = 0; + /* For object we initialize layers to layer from base. */ + if (GS(id) == ID_OB) { + this->layers = 0; + } + components = BLI_ghash_new(id_deps_node_hash_key, id_deps_node_hash_key_cmp, "Depsgraph id components hash"); |