diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-12-07 21:35:52 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-12-07 22:38:17 +0300 |
commit | 416e66c7fe211e7e21d0d4fad987d4219c191f71 (patch) | |
tree | fc70437cdc5b049fccdf3da995930e105da0332b /source/blender/blenkernel/intern/node.c | |
parent | 074c00f9d6cc720461e6c8c7c13ed4e408ef372e (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/blenkernel/intern/node.c')
-rw-r--r-- | source/blender/blenkernel/intern/node.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 779728cb037..578d81b157c 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -1146,8 +1146,9 @@ bNode *BKE_node_copy_ex(bNodeTree *ntree, const bNode *node_src, const int flag) node_dst->new_node = NULL; - bool do_copy_api = !((flag & LIB_ID_CREATE_NO_MAIN) || (flag & LIB_ID_COPY_LOCALIZE)); - if (node_dst->typeinfo->copyfunc_api && do_copy_api) { + /* Only call copy function when a copy is made for the main database, not + * for cases like the dependency graph and localization. */ + if (node_dst->typeinfo->copyfunc_api && !(flag & LIB_ID_CREATE_NO_MAIN)) { PointerRNA ptr; RNA_pointer_create((ID *)ntree, &RNA_Node, node_dst, &ptr); |