Collections: Operator to duplicate a collection

When duplicating a layer collection directly linked to the view layer we copy
the collection and link it.

For all the not directly linked layer collectionns, we try to sync the layer
collection flags, overrides, ...

Also we make sure the new collection is right after the original collection.

We also expose this in RNA, via collection.duplicate().
This commit is contained in:
Dalai Felinto
2018-02-01 21:11:59 -02:00
parent a4d2b102f3
commit c7c070c2ec
10 changed files with 348 additions and 19 deletions

View File

@@ -195,6 +195,7 @@ class OUTLINER_MT_context_scene_collection(Menu):
layout = self.layout
layout.operator("outliner.collection_nested_new", text="New Collection", icon='NEW')
layout.operator("outliner.collection_duplicate", text="Duplicate Collection")
layout.operator("outliner.collection_delete_selected", text="Delete Collections", icon='X')
layout.separator()
layout.operator("outliner.collection_objects_add", text="Add Selected", icon='ZOOMIN')