diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-01-29 23:01:53 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-01-29 23:01:57 +0300 |
commit | 0f35436bcfaa6f415d5a43bd62bae86320bd75ae (patch) | |
tree | e3b4d5bbab4905203fbacd18832a459ee293e4de /release/scripts/startup/bl_ui/space_outliner.py | |
parent | 38bc973a6cc099982b6ee1c12d900e06f5dae646 (diff) |
Outliner: Moving object context menu to Python, and adding hierarchy
As suggested by Pablo Vazquez, though I think we can refine it a bit with icons.
I will wait for his feedback on it.
Diffstat (limited to 'release/scripts/startup/bl_ui/space_outliner.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_outliner.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py index 8b46ae99b8c..28644428cf8 100644 --- a/release/scripts/startup/bl_ui/space_outliner.py +++ b/release/scripts/startup/bl_ui/space_outliner.py @@ -201,6 +201,40 @@ class OUTLINER_MT_context_scene_collection(Menu): layout.operator("outliner.collection_objects_remove", text="Remove Selected", icon='ZOOMOUT') +class OUTLINER_MT_context_object_select(Menu): + bl_label = "Object Operation Select" + + def draw(self, context): + layout = self.layout + + layout.operator("outliner.object_operation", text="Select").type='SELECT' + layout.operator("outliner.object_operation", text="Deselect").type='DESELECT' + layout.operator("outliner.object_operation", text="Select Hierarchy").type='SELECT_HIERARCHY' + + +class OUTLINER_MT_context_object_delete(Menu): + bl_label = "Object Operation Delete" + + def draw(self, context): + layout = self.layout + + layout.operator("outliner.object_operation", text="Delete").type='DELETE' + layout.operator("outliner.object_operation", text="Delete Hierarchy").type='DELETE_HIERARCHY' + + +class OUTLINER_MT_context_object(Menu): + bl_label = "Object" + + def draw(self, context): + layout = self.layout + + layout.menu("OUTLINER_MT_context_object_select", text="Select") + layout.menu("OUTLINER_MT_context_object_delete", text="Delete") + layout.separator() + layout.operator("outliner.object_operation", text="Remap Users").type='REMAP' + layout.operator("outliner.object_operation", text="Rename").type='RENAME' + + classes = ( OUTLINER_HT_header, OUTLINER_MT_editor_menus, @@ -209,6 +243,9 @@ classes = ( OUTLINER_MT_edit_datablocks, OUTLINER_MT_edit_orphan_data, OUTLINER_MT_context_scene_collection, + OUTLINER_MT_context_object, + OUTLINER_MT_context_object_delete, + OUTLINER_MT_context_object_select, ) if __name__ == "__main__": # only for live edit. |