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:
-rw-r--r--release/scripts/startup/bl_ui/space_outliner.py15
-rw-r--r--source/blender/editors/space_outliner/outliner_collections.c28
-rw-r--r--source/blender/editors/space_outliner/outliner_intern.h3
-rw-r--r--source/blender/editors/space_outliner/outliner_ops.c3
4 files changed, 10 insertions, 39 deletions
diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py
index 159a97e8625..2076fde336e 100644
--- a/release/scripts/startup/bl_ui/space_outliner.py
+++ b/release/scripts/startup/bl_ui/space_outliner.py
@@ -157,17 +157,6 @@ class OUTLINER_MT_collection_view_layer(Menu):
layout.operator("outliner.collection_holdout_clear")
-class OUTLINER_MT_collection_duplicate(Menu):
- bl_label = "Duplicate"
-
- def draw(self, context):
- layout = self.layout
-
- layout.operator("outliner.collection_duplicate", text="Collection")
- layout.operator("outliner.collection_duplicate_hierarchy", text="Hierarchy")
- layout.operator("outliner.collection_duplicate_linked_hierarchy", text="Linked Hierarchy")
-
-
class OUTLINER_MT_collection_visibility(Menu):
bl_label = "Visibility"
@@ -203,7 +192,8 @@ class OUTLINER_MT_collection(Menu):
space = context.space_data
layout.operator("outliner.collection_new", text="New").nested = True
- layout.menu("OUTLINER_MT_collection_duplicate")
+ layout.operator("outliner.collection_duplicate", text="Duplicate Collection")
+ layout.operator("outliner.collection_duplicate_linked", text="Duplicate Linked")
layout.separator()
@@ -356,7 +346,6 @@ classes = (
OUTLINER_MT_editor_menus,
OUTLINER_MT_edit_datablocks,
OUTLINER_MT_collection,
- OUTLINER_MT_collection_duplicate,
OUTLINER_MT_collection_new,
OUTLINER_MT_collection_visibility,
OUTLINER_MT_collection_view_layer,
diff --git a/source/blender/editors/space_outliner/outliner_collections.c b/source/blender/editors/space_outliner/outliner_collections.c
index 61c02d18f8f..750c78d76b9 100644
--- a/source/blender/editors/space_outliner/outliner_collections.c
+++ b/source/blender/editors/space_outliner/outliner_collections.c
@@ -448,7 +448,6 @@ static int collection_duplicate_exec(bContext *C, wmOperator *op)
Main *bmain = CTX_data_main(C);
SpaceOutliner *soops = CTX_wm_space_outliner(C);
TreeElement *te = outliner_active_collection(C);
- bool hierarchy = strstr(op->idname, "hierarchy") != NULL;
bool linked = strstr(op->idname, "linked") != NULL;
/* Can happen when calling from a key binding. */
@@ -469,7 +468,7 @@ static int collection_duplicate_exec(bContext *C, wmOperator *op)
case SO_SCENES:
case SO_VIEW_LAYER:
case SO_LIBRARIES:
- BKE_collection_duplicate(bmain, parent, collection, hierarchy, !linked);
+ BKE_collection_duplicate(bmain, parent, collection, true, !linked);
break;
}
@@ -484,7 +483,7 @@ void OUTLINER_OT_collection_duplicate(wmOperatorType *ot)
/* identifiers */
ot->name = "Duplicate Collection";
ot->idname = "OUTLINER_OT_collection_duplicate";
- ot->description = "Make a new collection with linked content (collection and objects)";
+ ot->description = "Duplicate all objects and collections and make them single user";
/* api callbacks */
ot->exec = collection_duplicate_exec;
@@ -494,27 +493,12 @@ void OUTLINER_OT_collection_duplicate(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
-void OUTLINER_OT_collection_duplicate_hierarchy(wmOperatorType *ot)
+void OUTLINER_OT_collection_duplicate_linked(wmOperatorType *ot)
{
/* identifiers */
- ot->name = "Duplicate Collection Hierarchy";
- ot->idname = "OUTLINER_OT_collection_duplicate_hierarchy";
- ot->description = "Duplicate entire hierarchy and make all content single user";
-
- /* api callbacks */
- ot->exec = collection_duplicate_exec;
- ot->poll = ED_outliner_collections_editor_poll;
-
- /* flags */
- ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
-}
-
-void OUTLINER_OT_collection_duplicate_linked_hierarchy(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name = "Duplicate Linked Collection Hierarchy";
- ot->idname = "OUTLINER_OT_collection_duplicate_linked_hierarchy";
- ot->description = "Duplicate entire hierarchy with linked object data";
+ ot->name = "Duplicate Linked Collection";
+ ot->idname = "OUTLINER_OT_collection_duplicate_linked";
+ ot->description = "Duplicate all objects and collections with linked object data";
/* api callbacks */
ot->exec = collection_duplicate_exec;
diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h
index a1751e90660..0e215c595c1 100644
--- a/source/blender/editors/space_outliner/outliner_intern.h
+++ b/source/blender/editors/space_outliner/outliner_intern.h
@@ -316,8 +316,7 @@ struct Collection *outliner_collection_from_tree_element(const TreeElement *te);
void OUTLINER_OT_collection_new(struct wmOperatorType *ot);
void OUTLINER_OT_collection_duplicate(struct wmOperatorType *ot);
-void OUTLINER_OT_collection_duplicate_hierarchy(struct wmOperatorType *ot);
-void OUTLINER_OT_collection_duplicate_linked_hierarchy(struct wmOperatorType *ot);
+void OUTLINER_OT_collection_duplicate_linked(struct wmOperatorType *ot);
void OUTLINER_OT_collection_delete(struct wmOperatorType *ot);
void OUTLINER_OT_collection_objects_select(struct wmOperatorType *ot);
void OUTLINER_OT_collection_objects_deselect(struct wmOperatorType *ot);
diff --git a/source/blender/editors/space_outliner/outliner_ops.c b/source/blender/editors/space_outliner/outliner_ops.c
index 404ad17ba4e..eea06fc0b0c 100644
--- a/source/blender/editors/space_outliner/outliner_ops.c
+++ b/source/blender/editors/space_outliner/outliner_ops.c
@@ -94,8 +94,7 @@ void outliner_operatortypes(void)
/* collections */
WM_operatortype_append(OUTLINER_OT_collection_new);
WM_operatortype_append(OUTLINER_OT_collection_duplicate);
- WM_operatortype_append(OUTLINER_OT_collection_duplicate_hierarchy);
- WM_operatortype_append(OUTLINER_OT_collection_duplicate_linked_hierarchy);
+ WM_operatortype_append(OUTLINER_OT_collection_duplicate_linked);
WM_operatortype_append(OUTLINER_OT_collection_delete);
WM_operatortype_append(OUTLINER_OT_collection_objects_select);
WM_operatortype_append(OUTLINER_OT_collection_objects_deselect);