From 846105d254bf720dc8c1a0f1ffc892af7c25b06e Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 4 Feb 2019 20:09:26 +0100 Subject: Cleanup: use LIB_ID_COPY_LOCALIZE in BKE_libblock_copy_for_localize(). This is a slightly more risky commit, as it is very difficult to fathom all that may happen when localazing IDs. Would not expect any issue though. Note that a big TODO remain to refactor fully that ID localization process (for 'shading IDs'), it's still doing pretty much same thing as regular out-of-main copies, but the infamous ntree topic makes it delicate to handle... --- source/blender/blenkernel/intern/library.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 7484ca4d716..13701537a1b 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -1408,12 +1408,11 @@ void *BKE_libblock_copy(Main *bmain, const ID *id) return idn; } +/* XXX TODO: get rid of this useless wrapper at some point... */ void *BKE_libblock_copy_for_localize(const ID *id) { ID *idn; - BKE_libblock_copy_ex(NULL, id, &idn, (LIB_ID_CREATE_NO_MAIN | - LIB_ID_CREATE_NO_USER_REFCOUNT | - LIB_ID_COPY_NO_ANIMDATA)); + BKE_libblock_copy_ex(NULL, id, &idn, LIB_ID_COPY_LOCALIZE | LIB_ID_COPY_NO_ANIMDATA); return idn; } -- cgit v1.2.3