Fix for material/node tree localization

The workaround removal was wrong, the whole id->adt of a local
copy is to be NULL.

But now instead of modifying original datablock, we tell library
manager to not copy animation data.
This commit is contained in:
2018-05-03 11:07:09 +02:00
parent 8431e0aab5
commit 1833e8d7b0
4 changed files with 25 additions and 10 deletions

View File

@@ -2001,8 +2001,13 @@ bNodeTree *ntreeLocalize(bNodeTree *ntree)
/* Make full copy outside of Main database.
* Note: previews are not copied here.
*/
BKE_id_copy_ex(G.main, (ID *)ntree, (ID **)&ltree,
LIB_ID_CREATE_NO_MAIN | LIB_ID_CREATE_NO_USER_REFCOUNT | LIB_ID_COPY_NO_PREVIEW, false);
BKE_id_copy_ex(
NULL, &ntree->id, (ID **)&ltree,
(LIB_ID_CREATE_NO_MAIN |
LIB_ID_CREATE_NO_USER_REFCOUNT |
LIB_ID_COPY_NO_PREVIEW |
LIB_ID_COPY_NO_ANIMDATA),
false);
ltree->flag |= NTREE_IS_LOCALIZED;
for (node = ltree->nodes.first; node; node = node->next) {