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:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-05-03 12:07:09 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-05-03 12:25:47 +0300
commit1833e8d7b0945605fda5beb8f224b019aaf7d6a8 (patch)
tree62c4b325d8e8ce1d79f30ba694735d11e421b536 /source/blender/blenkernel/intern/material.c
parent8431e0aab55a597cb3141e02c0d4e03f9fb027c6 (diff)
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.
Diffstat (limited to 'source/blender/blenkernel/intern/material.c')
-rw-r--r--source/blender/blenkernel/intern/material.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index 725a7b07194..131d79c249f 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -187,15 +187,18 @@ Material *BKE_material_localize(Material *ma)
* ... Once f*** nodes are fully converted to that too :( */
Material *man;
-
- man = BKE_libblock_copy_nolib(&ma->id, false);
+
+ BKE_id_copy_ex(
+ NULL, &ma->id, (ID **)&man,
+ (LIB_ID_CREATE_NO_MAIN |
+ LIB_ID_CREATE_NO_USER_REFCOUNT |
+ LIB_ID_COPY_NO_PREVIEW |
+ LIB_ID_COPY_NO_ANIMDATA),
+ false);
man->texpaintslot = NULL;
man->preview = NULL;
-
- if (ma->nodetree)
- man->nodetree = ntreeLocalize(ma->nodetree);
-
+
BLI_listbase_clear(&man->gpumaterial);
/* TODO Duplicate Engine Settings and set runtime to NULL */