Fix assert after recent changes.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 20 Mar 2019 17:17:24 +0000 (18:17 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Wed, 20 Mar 2019 17:39:56 +0000 (18:39 +0100)
Mark as localized immediately, so that functions that edit the node tree can
verify they are being used under the correct conditions.

source/blender/blenkernel/intern/node.c

index d4dd74a..aabd32d 100644 (file)
@@ -2045,6 +2045,8 @@ bNodeTree *ntreeLocalize(bNodeTree *ntree)
                        (LIB_ID_COPY_LOCALIZE |
                         LIB_ID_COPY_NO_ANIMDATA));
 
+               ltree->id.tag |= LIB_TAG_LOCALIZED;
+
                for (node = ltree->nodes.first; node; node = node->next) {
                        if ((ELEM(node->type, NODE_GROUP, NODE_CUSTOM_GROUP)) && node->id) {
                                node->id = (ID *)ntreeLocalize((bNodeTree *)node->id);
@@ -2062,8 +2064,6 @@ bNodeTree *ntreeLocalize(bNodeTree *ntree)
                if (ntree->typeinfo->localize)
                        ntree->typeinfo->localize(ltree, ntree);
 
-               ltree->id.tag |= LIB_TAG_LOCALIZED;
-
                BLI_mutex_unlock(ntree->duplilock);
 
                return ltree;