diff options
author | Bastien Montagne <mont29> | 2022-09-05 16:46:00 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-09-05 17:12:54 +0300 |
commit | cd49fee741148dc9dcc0cbefce0b70ea0f2d55c6 (patch) | |
tree | e8dc62543d0706f127a4e80683ab18dc72ec0494 /source/blender/io/wavefront_obj | |
parent | dd19d6456abf9ee230bcce62fd67f6ab7ab91f16 (diff) |
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
Diffstat (limited to 'source/blender/io/wavefront_obj')
-rw-r--r-- | source/blender/io/wavefront_obj/importer/obj_import_mtl.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/io/wavefront_obj/importer/obj_import_mtl.cc b/source/blender/io/wavefront_obj/importer/obj_import_mtl.cc index 58d414a59ad..0922a71979e 100644 --- a/source/blender/io/wavefront_obj/importer/obj_import_mtl.cc +++ b/source/blender/io/wavefront_obj/importer/obj_import_mtl.cc @@ -380,7 +380,8 @@ bNodeTree *create_mtl_node_tree(Main *bmain, Material *mat, bool relative_paths) { - bNodeTree *ntree = ntreeAddTree(nullptr, "Shader Nodetree", ntreeType_Shader->idname); + bNodeTree *ntree = ntreeAddTreeEmbedded( + nullptr, &mat->id, "Shader Nodetree", ntreeType_Shader->idname); bNode *bsdf = add_node(ntree, SH_NODE_BSDF_PRINCIPLED, node_locx_bsdf, node_locy_top); bNode *output = add_node(ntree, SH_NODE_OUTPUT_MATERIAL, node_locx_output, node_locy_top); |