diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-12 11:48:18 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-12 11:51:00 +0300 |
commit | 77928c2a091581939ec40231ce043c6a2f3bf783 (patch) | |
tree | 3aa51ee074422fc66aadff103fc9821f7ee857d6 /release | |
parent | 864a4cf64becfd63864832c9019a79b8926f2d39 (diff) |
UI: Group geometry in object visibility popover
Makes it easy to quickly hide all non-geometry.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 53 |
1 files changed, 31 insertions, 22 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 7067cd6deca..e3463017237 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -3709,32 +3709,41 @@ class VIEW3D_PT_object_type_visibility(Panel): col = layout.column() - heading_pair = ("Visible", "Selectable") - attr_object_types = ( - "mesh", - "curve", - "surf", - "meta", - "font", - "armature", - "lattice", - "empty", - "camera", - "lamp", - "light_probe", - "speaker", + attr_object_types_all = ( + ( + "mesh", + "curve", + "surf", + "meta", + "font", + ), + ( + "armature", + "lattice", + "empty", + "camera", + "lamp", + "light_probe", + "speaker", + ), ) - attr_vis = [f"show_object_viewport_{attr}" for attr in attr_object_types] - attr_sel = [f"show_object_select_{attr}" for attr in attr_object_types] + is_first = True + for attr_object_types in attr_object_types_all: + if is_first is False: + col.separator() + is_first = False - for attr_v, attr_s in zip(attr_vis, attr_sel): - icon_s = 'RESTRICT_SELECT_OFF' if getattr(view, attr_s) else 'RESTRICT_SELECT_ON' + attr_vis = ["show_object_viewport_" f"{attr:s}" for attr in attr_object_types] + attr_sel = ["show_object_select_" f"{attr:s}" for attr in attr_object_types] - row = col.row(align=True) - row.prop(view, attr_v) - row.active = getattr(view, attr_v) - row.prop(view, attr_s, text="", icon=icon_s, emboss=False) + for attr_v, attr_s in zip(attr_vis, attr_sel): + icon_s = 'RESTRICT_SELECT_OFF' if getattr(view, attr_s) else 'RESTRICT_SELECT_ON' + + row = col.row(align=True) + row.prop(view, attr_v) + row.active = getattr(view, attr_v) + row.prop(view, attr_s, text="", icon=icon_s, emboss=False) class VIEW3D_PT_shading(Panel): |