From b9c400cee2ea34fc1d1a03bf27938d56785a11a5 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 29 Aug 2019 16:34:17 +0200 Subject: BKE_libblock_relink_ex: pass all remapping flags instead of a single boolean. There is no reasons to limit access to remapping flags here, we may want to use other options than only the ID_REMAP_SKIP_NEVER_NULL_USAGE one... --- source/blender/blenkernel/intern/library_remap.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'source/blender/blenkernel/intern/library_remap.c') diff --git a/source/blender/blenkernel/intern/library_remap.c b/source/blender/blenkernel/intern/library_remap.c index 04ea540fac9..61f506a8a6c 100644 --- a/source/blender/blenkernel/intern/library_remap.c +++ b/source/blender/blenkernel/intern/library_remap.c @@ -652,12 +652,11 @@ void BKE_libblock_unlink(Main *bmain, * ... sigh */ void BKE_libblock_relink_ex( - Main *bmain, void *idv, void *old_idv, void *new_idv, const bool us_min_never_null) + Main *bmain, void *idv, void *old_idv, void *new_idv, const short remap_flags) { ID *id = idv; ID *old_id = old_idv; ID *new_id = new_idv; - int remap_flags = us_min_never_null ? 0 : ID_REMAP_SKIP_NEVER_NULL_USAGE; /* No need to lock here, we are only affecting given ID, not bmain database. */ @@ -945,7 +944,7 @@ void BKE_id_free_ex(Main *bmain, void *idv, int flag, const bool use_flag_from_i #endif if ((flag & LIB_ID_FREE_NO_USER_REFCOUNT) == 0) { - BKE_libblock_relink_ex(bmain, id, NULL, NULL, true); + BKE_libblock_relink_ex(bmain, id, NULL, NULL, 0); } BKE_libblock_free_datablock(id, flag); @@ -1091,7 +1090,7 @@ static void id_delete(Main *bmain, const bool do_tagged_deletion) bmain, id, NULL, ID_REMAP_FLAG_NEVER_NULL_USAGE | ID_REMAP_FORCE_NEVER_NULL_USAGE); /* Since we removed ID from Main, * we also need to unlink its own other IDs usages ourself. */ - BKE_libblock_relink_ex(bmain, id, NULL, NULL, true); + BKE_libblock_relink_ex(bmain, id, NULL, NULL, 0); /* Now we can safely mark that ID as not being in Main database anymore. */ id->tag |= LIB_TAG_NO_MAIN; /* This is needed because we may not have remapped usages -- cgit v1.2.3