[Bf-blender-cvs] [457ecc68259] master: Partially revert "Collection duplication from Outliner: add a 'duplicate hierarchy' operation."

Bastien Montagne noreply at git.blender.org
Fri Mar 8 17:53:56 CET 2019


Commit: 457ecc68259afae74fde9e475ce86e0b472c5f50
Author: Bastien Montagne
Date:   Fri Mar 8 17:13:33 2019 +0100
Branches: master
https://developer.blender.org/rB457ecc68259afae74fde9e475ce86e0b472c5f50

Partially revert "Collection duplication from Outliner: add a 'duplicate hierarchy' operation."

This partially reverts commit a77feabb51470b9cfb71be7f0ea7e774d6591799,
removing the shallow 'duplicate hierarchy' option from outliner.

Core changes from that commit in BKE_collections are kept.

===================================================================

M	release/scripts/startup/bl_ui/space_outliner.py
M	source/blender/blenkernel/intern/collection.c
M	source/blender/editors/space_outliner/outliner_collections.c
M	source/blender/editors/space_outliner/outliner_intern.h
M	source/blender/editors/space_outliner/outliner_ops.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py
index 59b6757c308..6d90c24ff99 100644
--- a/release/scripts/startup/bl_ui/space_outliner.py
+++ b/release/scripts/startup/bl_ui/space_outliner.py
@@ -192,9 +192,8 @@ class OUTLINER_MT_collection(Menu):
         space = context.space_data
 
         layout.operator("outliner.collection_new", text="New").nested = True
-        layout.operator("outliner.collection_duplicate_hierarchy", text="Duplicate Hierarchy")
+        layout.operator("outliner.collection_duplicate", text="Duplicate Collection")
         layout.operator("outliner.collection_duplicate_linked", text="Duplicate Linked")
-        layout.operator("outliner.collection_duplicate", text="Duplicate Full")
 
         layout.separator()
 
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c
index 8a71c0c2e10..a4d2ee55de1 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -298,9 +298,11 @@ Collection *BKE_collection_copy(Main *bmain, Collection *parent, Collection *col
  *
  * \warning If any 'deep copy' behavior is enabled, this functions will clear all \a bmain id.idnew pointers.
  *
- * \param do_hierarchy If true, it will recursively make shallow copies of children collections and objects.
+ * \param do_hierarchy If true, it will recursively make shallow copies of children collections.
+ * \param do_objects If true, it will also make duplicates of objects.
+ *                   This one does nothing if \a do_hierarchy is not set.
  * \param do_obdata If true, it will also make deep duplicates of objects, using behavior defined in user settings
- *                  (U.dupflag). This one does nothing if \a do_hierarchy is not set.
+ *                  (U.dupflag). This one does nothing if \a do_hierarchy and \a do_objects are not set.
  */
 Collection *BKE_collection_duplicate(
         Main *bmain, Collection *parent, Collection *collection,
diff --git a/source/blender/editors/space_outliner/outliner_collections.c b/source/blender/editors/space_outliner/outliner_collections.c
index 7377faa09ac..a95d292ec74 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);
-	const bool hierarchy = strstr(op->idname, "hierarchy") != NULL;
 	const 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, true, !hierarchy, !linked);
+			BKE_collection_duplicate(bmain, parent, collection, true, true, !linked);
 			break;
 	}
 
@@ -479,21 +478,6 @@ static int collection_duplicate_exec(bContext *C, wmOperator *op)
 	return OPERATOR_FINISHED;
 }
 
-void OUTLINER_OT_collection_duplicate_hierarchy(wmOperatorType *ot)
-{
-	/* identifiers */
-	ot->name = "Duplicate Collection Hierarchy";
-	ot->idname = "OUTLINER_OT_collection_duplicate_hierarchy";
-	ot->description = "Recursively duplicate the collection and all its children, with linked objects";
-
-	/* 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(wmOperatorType *ot)
 {
 	/* identifiers */
diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h
index 5af8e2252ef..b93217395d6 100644
--- a/source/blender/editors/space_outliner/outliner_intern.h
+++ b/source/blender/editors/space_outliner/outliner_intern.h
@@ -315,7 +315,6 @@ bool outliner_is_collection_tree_element(const TreeElement *te);
 struct Collection *outliner_collection_from_tree_element(const TreeElement *te);
 
 void OUTLINER_OT_collection_new(struct wmOperatorType *ot);
-void OUTLINER_OT_collection_duplicate_hierarchy(struct wmOperatorType *ot);
 void OUTLINER_OT_collection_duplicate_linked(struct wmOperatorType *ot);
 void OUTLINER_OT_collection_duplicate(struct wmOperatorType *ot);
 void OUTLINER_OT_collection_delete(struct wmOperatorType *ot);
diff --git a/source/blender/editors/space_outliner/outliner_ops.c b/source/blender/editors/space_outliner/outliner_ops.c
index af73e88aa73..5d9437210e2 100644
--- a/source/blender/editors/space_outliner/outliner_ops.c
+++ b/source/blender/editors/space_outliner/outliner_ops.c
@@ -93,7 +93,6 @@ void outliner_operatortypes(void)
 
 	/* collections */
 	WM_operatortype_append(OUTLINER_OT_collection_new);
-	WM_operatortype_append(OUTLINER_OT_collection_duplicate_hierarchy);
 	WM_operatortype_append(OUTLINER_OT_collection_duplicate_linked);
 	WM_operatortype_append(OUTLINER_OT_collection_duplicate);
 	WM_operatortype_append(OUTLINER_OT_collection_delete);



More information about the Bf-blender-cvs mailing list