diff options
author | Maxim Vasiliev <qmax> | 2020-01-05 18:46:11 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2020-01-05 20:27:00 +0300 |
commit | e993667a46c2fa1c6f6f3dc609b334448ab347d8 (patch) | |
tree | 49619631060b8f6f9122ce6caea1b516f2f68f37 | |
parent | b15f601d2ce34fc10cc0bfe515fb89f6189f582b (diff) |
Fix (unreported) critical mistake in Node copying code.
Nice reversed-logic mistake in rB693721cc7e7d.
How this could remain unnoticed for almost one year is fairly
mysterious, this should have basically broke all node tree copying,
would expect such bug to get reported within days, weeks at most...
Probably because that function is not that much used in current code.
Nice reminder also that those bloody nodetrees still need a lot of
cleanup/refactor/simplification when it comes to ID management code.
Reported/fixed as part of D6484, but this really needs its own commit.
-rw-r--r-- | source/blender/blenkernel/intern/node.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index be28ca26459..13169d9ace8 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -1595,7 +1595,7 @@ void BKE_node_tree_copy_data(Main *UNUSED(bmain), bNodeTree *ntreeCopyTree_ex(const bNodeTree *ntree, Main *bmain, const bool do_id_user) { bNodeTree *ntree_copy; - const int flag = do_id_user ? LIB_ID_CREATE_NO_USER_REFCOUNT | LIB_ID_CREATE_NO_MAIN : 0; + const int flag = do_id_user ? 0 : LIB_ID_CREATE_NO_USER_REFCOUNT | LIB_ID_CREATE_NO_MAIN; BKE_id_copy_ex(bmain, (ID *)ntree, (ID **)&ntree_copy, flag); return ntree_copy; } |