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:
authorCampbell Barton <ideasman42@gmail.com>2020-09-08 09:02:16 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-09-08 09:14:39 +0300
commit748deced1c7b85009142d1ebbffba4c1f2405a3f (patch)
tree0d31bc76263bd27f936b15133ebdcf91e67af5b3 /source/blender/windowmanager/intern/wm_files_link.c
parente467c54d58c88316d959f2481dc7484037a4c0be (diff)
Link/Append: support instancing object data
This patch supports instantiating object data on append/link, reported as a bug T58304. This is an option, available when linking/appending, similar to the existing "Instance Collections" option. Reviewed by @sybren Ref D8792
Diffstat (limited to 'source/blender/windowmanager/intern/wm_files_link.c')
-rw-r--r--source/blender/windowmanager/intern/wm_files_link.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c
index 8c14055696c..6c7205b25d4 100644
--- a/source/blender/windowmanager/intern/wm_files_link.c
+++ b/source/blender/windowmanager/intern/wm_files_link.c
@@ -137,6 +137,9 @@ static short wm_link_append_flag(wmOperator *op)
if (RNA_boolean_get(op->ptr, "instance_collections")) {
flag |= FILE_GROUP_INSTANCE;
}
+ if (RNA_boolean_get(op->ptr, "instance_object_data")) {
+ flag |= FILE_OBDATA_INSTANCE;
+ }
return flag;
}
@@ -395,7 +398,7 @@ static int wm_link_append_exec(bContext *C, wmOperator *op)
RPT_WARNING,
"Scene '%s' is linked, instantiation of objects & groups is disabled",
scene->id.name + 2);
- flag &= ~FILE_GROUP_INSTANCE;
+ flag &= ~(FILE_GROUP_INSTANCE | FILE_OBDATA_INSTANCE);
scene = NULL;
}
@@ -566,6 +569,14 @@ static void wm_link_append_properties_common(wmOperatorType *ot, bool is_link)
"Instance Collections",
"Create instances for collections, rather than adding them directly to the scene");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+
+ prop = RNA_def_boolean(
+ ot->srna,
+ "instance_object_data",
+ true,
+ "Instance Object Data",
+ "Create instances for object data which are not referenced by any objects");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
void WM_OT_link(wmOperatorType *ot)