[Bf-blender-cvs] [77928c2a091] blender2.8: UI: Group geometry in object visibility popover

Campbell Barton noreply at git.blender.org
Thu Jul 12 10:51:08 CEST 2018


Commit: 77928c2a091581939ec40231ce043c6a2f3bf783
Author: Campbell Barton
Date:   Thu Jul 12 10:48:18 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB77928c2a091581939ec40231ce043c6a2f3bf783

UI: Group geometry in object visibility popover

Makes it easy to quickly hide all non-geometry.

===================================================================

M	release/scripts/startup/bl_ui/space_view3d.py

===================================================================

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):



More information about the Bf-blender-cvs mailing list