Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/intern/node.cc')
-rw-r--r--source/blender/blenkernel/intern/node.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc
index 86c05d6d085..d50b8662f82 100644
--- a/source/blender/blenkernel/intern/node.cc
+++ b/source/blender/blenkernel/intern/node.cc
@@ -404,7 +404,7 @@ static void node_foreach_path(ID *id, BPathForeachPathData *bpath_data)
}
}
-static ID *node_owner_get(Main *bmain, ID *id)
+static ID *node_owner_get(Main *bmain, ID *id, ID *owner_id_hint)
{
if ((id->flag & LIB_EMBEDDED_DATA) == 0) {
return id;
@@ -412,6 +412,12 @@ static ID *node_owner_get(Main *bmain, ID *id)
/* TODO: Sort this NO_MAIN or not for embedded node trees. See T86119. */
// BLI_assert((id->tag & LIB_TAG_NO_MAIN) == 0);
+ bNodeTree *ntree = reinterpret_cast<bNodeTree *>(id);
+
+ if (owner_id_hint != nullptr && ntreeFromID(owner_id_hint) == ntree) {
+ return owner_id_hint;
+ }
+
ListBase *lists[] = {&bmain->materials,
&bmain->lights,
&bmain->worlds,
@@ -421,7 +427,6 @@ static ID *node_owner_get(Main *bmain, ID *id)
&bmain->simulations,
nullptr};
- bNodeTree *ntree = (bNodeTree *)id;
for (int i = 0; lists[i] != nullptr; i++) {
LISTBASE_FOREACH (ID *, id_iter, lists[i]) {
if (ntreeFromID(id_iter) == ntree) {