diff options
Diffstat (limited to 'source/blender/blenkernel/intern/world.c')
-rw-r--r-- | source/blender/blenkernel/intern/world.c | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c index f926e29ea84..78342e9919a 100644 --- a/source/blender/blenkernel/intern/world.c +++ b/source/blender/blenkernel/intern/world.c @@ -176,32 +176,7 @@ World *localize_world(World *wrld) return wrldn; } -void BKE_world_make_local(Main *bmain, World *wrld, const bool force_local) +void BKE_world_make_local(Main *bmain, World *wrld, const bool lib_local) { - bool is_local = false, is_lib = false; - - /* - only lib users: do nothing (unless force_local is set) - * - only local users: set flag - * - mixed: make copy - */ - - if (!ID_IS_LINKED_DATABLOCK(wrld)) { - return; - } - - BKE_library_ID_test_usages(bmain, wrld, &is_local, &is_lib); - - if (force_local || is_local) { - if (!is_lib) { - id_clear_lib_data(bmain, &wrld->id); - BKE_id_expand_local(&wrld->id); - } - else { - World *wrld_new = BKE_world_copy(bmain, wrld); - - wrld_new->id.us = 0; - - BKE_libblock_remap(bmain, wrld, wrld_new, ID_REMAP_SKIP_INDIRECT_USAGE); - } - } + BKE_id_make_local_generic(bmain, &wrld->id, true, lib_local); } |