diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-02-06 23:27:26 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-02-06 23:39:14 +0300 |
commit | 77b61b554ca10353b408645e3316e06c8d240388 (patch) | |
tree | 91d3c613b5b47e85ca7163c06673f5b63ea00602 /release | |
parent | 107486e67378779cd53d13c91df5afb1c858c1fa (diff) |
Outliner: Add object(s) to new collection
Suggested by Pablo Vazquez (venomgfx).
The idea here is that it should be easy to work in the outliner by picking a
bunch of objects and adding them to a new collection.
Where is the new collection? In the same level as the "outliner active" object.
Note, since the outliner has no pure concept of an active object, I'm using
the highlight tag for this. Hopefully it works fine.
It should work in "Collections", "View Layer", and "Groups".
Only when collections are not filtered out.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/space_outliner.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py index b0cdc101c6b..6682e792d6c 100644 --- a/release/scripts/startup/bl_ui/space_outliner.py +++ b/release/scripts/startup/bl_ui/space_outliner.py @@ -223,6 +223,16 @@ class OUTLINER_MT_context_object_delete(Menu): layout.operator("outliner.object_operation", text="Delete Hierarchy").type='DELETE_HIERARCHY' +class OUTLINER_MT_context_object_collection(Menu): + bl_label = "Object Operation Collection" + + def draw(self, context): + layout = self.layout + + layout.operator("outliner.object_add_to_new_collection", text="Add to New Collection", icon='ZOOMIN') + layout.operator("outliner.object_remove_from_collection", text="Remove from Collection", icon='ZOOMOUT') + + class OUTLINER_MT_context_object(Menu): bl_label = "Object" @@ -231,11 +241,10 @@ class OUTLINER_MT_context_object(Menu): layout.menu("OUTLINER_MT_context_object_select", text="Select") layout.menu("OUTLINER_MT_context_object_delete", text="Delete") + layout.menu("OUTLINER_MT_context_object_collection", text="Collection") layout.separator() layout.operator("outliner.object_operation", text="Remap Users").type='REMAP' layout.operator("outliner.object_operation", text="Rename").type='RENAME' - layout.separator() - layout.operator("outliner.object_remove_from_collection", text="Remove from Collection") classes = ( @@ -249,6 +258,7 @@ classes = ( OUTLINER_MT_context_object, OUTLINER_MT_context_object_delete, OUTLINER_MT_context_object_select, + OUTLINER_MT_context_object_collection, ) if __name__ == "__main__": # only for live edit. |