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-09-09 12:46:28 +0300
committerBastien Montagne <bastien@blender.org>2021-09-10 10:28:44 +0300
commit93d2940603121acc47ea9860dac98e4e63c8f1d3 (patch)
tree5ef777595ee0f5706e1a140aa6f6516bac6ace5e
parent284c9430f9bbdbe132f9eb9c4b428bf5d25df0ca (diff)
Link/Append: Fix unreported obdata being instantiated even when already used by linked/appended data.
Do not instantiate obdata when it is not actually loose.
-rw-r--r--source/blender/blenloader/intern/readfile.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 9704e8bb413..15653264211 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -4561,6 +4561,17 @@ static void add_loose_object_data_to_scene(Main *mainvar,
active_collection = lc->collection;
}
+ /* Do not re-instantiate obdata IDs that are already instantiated by an object. */
+ LISTBASE_FOREACH (Object *, ob, &mainvar->objects) {
+ if ((ob->id.tag & LIB_TAG_PRE_EXISTING) == 0 && ob->data != NULL) {
+ ID *obdata = ob->data;
+ BLI_assert(ID_REAL_USERS(obdata) > 0);
+ if ((obdata->tag & LIB_TAG_PRE_EXISTING) == 0) {
+ obdata->tag &= ~LIB_TAG_DOIT;
+ }
+ }
+ }
+
/* Loop over all ID types, instancing object-data for ID types that have support for it. */
ListBase *lbarray[INDEX_ID_MAX];
int i = set_listbasepointers(mainvar, lbarray);