diff options
Diffstat (limited to 'source/blender/blenkernel/intern/action.c')
-rw-r--r-- | source/blender/blenkernel/intern/action.c | 34 |
1 files changed, 3 insertions, 31 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index f7ff1261c8a..470098f8c7c 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -95,34 +95,9 @@ bAction *add_empty_action(Main *bmain, const char name[]) /* .................................. */ // does copy_fcurve... -void BKE_action_make_local(Main *bmain, bAction *act) +void BKE_action_make_local(Main *bmain, bAction *act, const bool lib_local) { - bool is_local = false, is_lib = false; - - /* - only lib users: do nothing - * - only local users: set flag - * - mixed: make copy - */ - - if (!ID_IS_LINKED_DATABLOCK(act)) { - return; - } - - BKE_library_ID_test_usages(bmain, act, &is_local, &is_lib); - - if (is_local) { - if (!is_lib) { - id_clear_lib_data(bmain, &act->id); - BKE_id_expand_local(&act->id); - } - else { - bAction *act_new = BKE_action_copy(bmain, act); - - act_new->id.us = 0; - - BKE_libblock_remap(bmain, act, act_new, ID_REMAP_SKIP_INDIRECT_USAGE); - } - } + BKE_id_make_local_generic(bmain, &act->id, true, lib_local); } /* .................................. */ @@ -181,10 +156,7 @@ bAction *BKE_action_copy(Main *bmain, bAction *src) } } - if (ID_IS_LINKED_DATABLOCK(src)) { - BKE_id_expand_local(&dst->id); - BKE_id_lib_local_paths(bmain, src->id.lib, &dst->id); - } + BKE_id_copy_ensure_local(bmain, &src->id, &dst->id); return dst; } |