Cleanup: use LIB_ID_COPY_LOCALIZE in BKE_libblock_copy_for_localize().
authorBastien Montagne <montagne29@wanadoo.fr>
Mon, 4 Feb 2019 19:09:26 +0000 (20:09 +0100)
committerBastien Montagne <montagne29@wanadoo.fr>
Tue, 5 Feb 2019 09:53:16 +0000 (10:53 +0100)
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

index 7484ca4d716a90abbb585b9d82c48c444452c1af..13701537a1be845446830b3ad1839447e3ce70ad 100644 (file)
@@ -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;
 }