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:
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/object/object_add.c20
-rw-r--r--source/blender/editors/space_outliner/outliner_collections.c2
2 files changed, 16 insertions, 6 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index df3968b2424..429c34333a4 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -3316,8 +3316,13 @@ Base *ED_object_add_duplicate(
Base *basen;
Object *ob;
- basen = object_add_duplicate_internal(
- bmain, scene, view_layer, base->object, dupflag, LIB_ID_DUPLICATE_IS_SUBPROCESS);
+ basen = object_add_duplicate_internal(bmain,
+ scene,
+ view_layer,
+ base->object,
+ dupflag,
+ LIB_ID_DUPLICATE_IS_SUBPROCESS |
+ LIB_ID_DUPLICATE_IS_ROOT_ID);
if (basen == NULL) {
return NULL;
}
@@ -3353,8 +3358,13 @@ static int duplicate_exec(bContext *C, wmOperator *op)
BKE_main_id_clear_newpoins(bmain);
CTX_DATA_BEGIN (C, Base *, base, selected_bases) {
- Base *basen = object_add_duplicate_internal(
- bmain, scene, view_layer, base->object, dupflag, LIB_ID_DUPLICATE_IS_SUBPROCESS);
+ Base *basen = object_add_duplicate_internal(bmain,
+ scene,
+ view_layer,
+ base->object,
+ dupflag,
+ LIB_ID_DUPLICATE_IS_SUBPROCESS |
+ LIB_ID_DUPLICATE_IS_ROOT_ID);
/* note that this is safe to do with this context iterator,
* the list is made in advance */
@@ -3458,7 +3468,7 @@ static int object_add_named_exec(bContext *C, wmOperator *op)
* function will only work if the object is already linked in the view layer, which is not
* the case here. So we have to do the new-ID relinking ourselves (#copy_object_set_idnew()).
*/
- LIB_ID_DUPLICATE_IS_SUBPROCESS);
+ LIB_ID_DUPLICATE_IS_SUBPROCESS | LIB_ID_DUPLICATE_IS_ROOT_ID);
if (basen == NULL) {
BKE_report(op->reports, RPT_ERROR, "Object could not be duplicated");
diff --git a/source/blender/editors/space_outliner/outliner_collections.c b/source/blender/editors/space_outliner/outliner_collections.c
index 062d2e2b5d1..59f36967e18 100644
--- a/source/blender/editors/space_outliner/outliner_collections.c
+++ b/source/blender/editors/space_outliner/outliner_collections.c
@@ -625,7 +625,7 @@ static int collection_duplicate_exec(bContext *C, wmOperator *op)
}
const eDupli_ID_Flags dupli_flags = USER_DUP_OBJECT | (linked ? 0 : U.dupflag);
- BKE_collection_duplicate(bmain, parent, collection, dupli_flags, 0);
+ BKE_collection_duplicate(bmain, parent, collection, dupli_flags, LIB_ID_DUPLICATE_IS_ROOT_ID);
DEG_relations_tag_update(bmain);
WM_main_add_notifier(NC_SCENE | ND_LAYER, CTX_data_scene(C));