diff options
Diffstat (limited to 'source/blender/blenkernel/intern/material.c')
-rw-r--r-- | source/blender/blenkernel/intern/material.c | 15 |
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 */ |