Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2021-11-04 20:53:05 +0300
committerBastien Montagne <bastien@blender.org>2021-11-04 21:00:22 +0300
commit1c6d3d614a498eab2938aa873e3089942d2774ab (patch)
treeefb1fc33fac845cc2968fb85f779df719f302a5c /source/blender/windowmanager/intern/wm_files_link.c
parent101fa4a425d6723c58823484d7e7f3a98acc774f (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/intern/wm_files_link.c')
-rw-r--r--source/blender/windowmanager/intern/wm_files_link.c17
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) {