IDMAnagement: Add owner ID pointer to embedded ones.
Add a dedicated `owner_id` pointer to ID types that can be embedded (Collections and NodeTrees), and modify slightly come code to make handling those more safe and consistent. This implements first part of T69169. Reviewed By: brecht Differential Revision: https://developer.blender.org/D15838
This commit is contained in:
@@ -1108,7 +1108,7 @@ static std::string bc_get_uvlayer_name(Mesh *me, int layer)
|
||||
static bNodeTree *prepare_material_nodetree(Material *ma)
|
||||
{
|
||||
if (ma->nodetree == nullptr) {
|
||||
ma->nodetree = ntreeAddTree(nullptr, "Shader Nodetree", "ShaderNodeTree");
|
||||
ntreeAddTreeEmbedded(nullptr, &ma->id, "Shader Nodetree", "ShaderNodeTree");
|
||||
ma->use_nodes = true;
|
||||
}
|
||||
return ma->nodetree;
|
||||
|
||||
Reference in New Issue
Block a user