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.
This commit is contained in:
Maxim Vasiliev 2020-01-05 16:46:11 +01:00 committed by Bastien Montagne
parent b15f601d2c
commit e993667a46
Notes: blender-bot 2023-02-14 10:21:10 +01:00
Referenced by issue #74665, Ungrouping destroys NodeCustomGroups
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}