diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-08-28 12:00:42 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-08-28 12:00:42 +0300 |
commit | 49e7b77b1952c6ea4ab5064d0d31b54052301ffd (patch) | |
tree | c934123fe054128b2cc214fcc22a8c84ef2dc949 /source/blender/depsgraph/intern | |
parent | 6b5d8c29e6d6fca192002edba2fd2c7234eb1996 (diff) |
Depsgraph: Pass copy-on-write pointer to material update
Unfortunately, there is something else wrong going on here, which makes objects
black after tweaking material settings.
Diffstat (limited to 'source/blender/depsgraph/intern')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_nodes.cc | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index 659b7cefacb..e8f3b6bd61c 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -1144,30 +1144,27 @@ void DepsgraphNodeBuilder::build_nodetree(bNodeTree *ntree) } /* Recursively build graph for material */ -void DepsgraphNodeBuilder::build_material(Material *ma) +void DepsgraphNodeBuilder::build_material(Material *material) { - ID *ma_id = &ma->id; - if (ma_id->tag & LIB_TAG_DOIT) { + ID *material_id = &material->id; + if (material_id->tag & LIB_TAG_DOIT) { return; } - - /* material itself */ - add_id_node(ma_id); - + material_id->tag |= LIB_TAG_DOIT; + /* Material itself. */ + add_id_node(material_id); + Material *material_cow = get_cow_datablock(material); /* Shading update. */ - add_operation_node(ma_id, + add_operation_node(material_id, DEG_NODE_TYPE_SHADING, - function_bind(BKE_material_eval, _1, ma), + function_bind(BKE_material_eval, _1, material_cow), DEG_OPCODE_MATERIAL_UPDATE); - - /* material animation */ - build_animdata(ma_id); - - /* textures */ - build_texture_stack(ma->mtex); - - /* material's nodetree */ - build_nodetree(ma->nodetree); + /* Material animation. */ + build_animdata(material_id); + /* Textures. */ + build_texture_stack(material->mtex); + /* Material's nodetree. */ + build_nodetree(material->nodetree); } /* Texture-stack attached to some shading datablock */ |