diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-06-20 11:04:43 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-06-20 11:14:04 +0300 |
commit | df2d05b203e130d1053883b0ebbab829267a10ae (patch) | |
tree | e6c4910512317e93c16297171171086d07a43a56 /release/scripts/startup/bl_ui/space_outliner.py | |
parent | 9f9756ec35060e2685742cdff510136208e6352a (diff) |
Outliner: add object mode switching to RMB menu
Diffstat (limited to 'release/scripts/startup/bl_ui/space_outliner.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_outliner.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py index 9a27985a352..f825546bb47 100644 --- a/release/scripts/startup/bl_ui/space_outliner.py +++ b/release/scripts/startup/bl_ui/space_outliner.py @@ -205,6 +205,8 @@ class OUTLINER_MT_object(Menu): layout = self.layout space = context.space_data + obj = context.active_object + object_mode = 'OBJECT' if obj is None else obj.mode layout.operator("outliner.object_operation", text="Delete").type = 'DELETE' if space.display_mode == 'VIEW_LAYER' and not space.use_filter_collection: @@ -218,6 +220,14 @@ class OUTLINER_MT_object(Menu): layout.separator() + if object_mode in {'EDIT', 'POSE'}: + name = bpy.types.Object.bl_rna.properties["mode"].enum_items[object_mode].name + layout.operator("outliner.object_operation", text=f"{name} Set").type = 'OBJECT_MODE_ENTER' + layout.operator("outliner.object_operation", text=f"{name} Clear").type = 'OBJECT_MODE_EXIT' + del name + + layout.separator() + if not (space.display_mode == 'VIEW_LAYER' and not space.use_filter_collection): layout.operator("outliner.id_operation", text="Unlink").type = 'UNLINK' layout.separator() |