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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-12-07 21:35:52 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-12-07 22:38:17 +0300
commit416e66c7fe211e7e21d0d4fad987d4219c191f71 (patch)
treefc70437cdc5b049fccdf3da995930e105da0332b /source/blender/nodes
parent074c00f9d6cc720461e6c8c7c13ed4e408ef372e (diff)
Fix ShaderNodeCustomGroup.copy method being called too often
This is only supposed to happen when copying nodes that are part of the user editable database, not temporary copies for the dependency graph. The LIB_ID_COPY_LOCALIZE test was wrong because it is a combination of multiple bitflags as pointed out by Bastien, and was actually redundant anyway since LIB_ID_CREATE_NO_MAIN is part of it.
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/shader/node_shader_tree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/nodes/shader/node_shader_tree.c b/source/blender/nodes/shader/node_shader_tree.c
index 4bcd77496c1..ffeeb7525d5 100644
--- a/source/blender/nodes/shader/node_shader_tree.c
+++ b/source/blender/nodes/shader/node_shader_tree.c
@@ -635,7 +635,8 @@ static bNode *ntree_shader_copy_branch(bNodeTree *ntree,
LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
if (node->tmp_flag >= 0) {
int id = node->tmp_flag;
- nodes_copy[id] = BKE_node_copy_ex(ntree, node, LIB_ID_CREATE_NO_USER_REFCOUNT);
+ nodes_copy[id] = BKE_node_copy_ex(
+ ntree, node, LIB_ID_CREATE_NO_USER_REFCOUNT | LIB_ID_CREATE_NO_MAIN);
nodes_copy[id]->tmp_flag = -2; /* Copy */
/* Make sure to clear all sockets links as they are invalid. */
LISTBASE_FOREACH (bNodeSocket *, sock, &nodes_copy[id]->inputs) {