diff options
author | Bastien Montagne <bastien@blender.org> | 2021-11-04 20:53:05 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-11-04 21:00:22 +0300 |
commit | 1c6d3d614a498eab2938aa873e3089942d2774ab (patch) | |
tree | efb1fc33fac845cc2968fb85f779df719f302a5c /source/blender/windowmanager | |
parent | 101fa4a425d6723c58823484d7e7f3a98acc774f (diff) |
Minor tweaks to new append code.
* Name generated 'append' collection, instead of getting a generic
meaningless name.
* Do not check if a collections's objects are already instantiated, when
we already know that we want to instantiate that collection.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files_link.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c index c3e0764f6c2..28af4049378 100644 --- a/source/blender/windowmanager/intern/wm_files_link.c +++ b/source/blender/windowmanager/intern/wm_files_link.c @@ -52,6 +52,8 @@ #include "BLO_readfile.h" +#include "BLT_translation.h" + #include "BKE_armature.h" #include "BKE_context.h" #include "BKE_global.h" @@ -354,7 +356,8 @@ static void wm_append_loose_data_instantiate_ensure_active_collection( *r_active_collection = lc->collection; } else { - *r_active_collection = BKE_collection_add(bmain, scene->master_collection, NULL); + *r_active_collection = BKE_collection_add( + bmain, scene->master_collection, DATA_("Appended Data")); } } } @@ -438,11 +441,13 @@ static void wm_append_loose_data_instantiate(WMLinkAppendData *lapp_data, Collection *collection = (Collection *)id; /* We always add collections directly selected by the user. */ bool do_add_collection = (item->append_tag & WM_APPEND_TAG_INDIRECT) == 0; - LISTBASE_FOREACH (CollectionObject *, coll_ob, &collection->gobject) { - Object *ob = coll_ob->ob; - if (!object_in_any_scene(bmain, ob)) { - do_add_collection = true; - break; + if (!do_add_collection) { + LISTBASE_FOREACH (CollectionObject *, coll_ob, &collection->gobject) { + Object *ob = coll_ob->ob; + if (!object_in_any_scene(bmain, ob)) { + do_add_collection = true; + break; + } } } if (do_add_collection) { |