[Bf-blender-cvs] [75d69eab693] blender2.8: Minor cleanup to last commit

Campbell Barton noreply at git.blender.org
Thu Jul 12 10:55:20 CEST 2018


Commit: 75d69eab69307891f197ff1c93b8a7e4454cccf7
Author: Campbell Barton
Date:   Thu Jul 12 10:54:30 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB75d69eab69307891f197ff1c93b8a7e4454cccf7

Minor cleanup to last commit

No need to make attr-lists with the current layout logic.

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

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 e3463017237..db5efeb43c2 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -3709,41 +3709,36 @@ class VIEW3D_PT_object_type_visibility(Panel):
 
         col = layout.column()
 
-        attr_object_types_all = (
-            (
-                "mesh",
-                "curve",
-                "surf",
-                "meta",
-                "font",
-            ),
-            (
-                "armature",
-                "lattice",
-                "empty",
-                "camera",
-                "lamp",
-                "light_probe",
-                "speaker",
-            ),
+        attr_object_types = (
+            "mesh",
+            "curve",
+            "surf",
+            "meta",
+            "font",
+            None,
+            "armature",
+            "lattice",
+            "empty",
+            "camera",
+            "lamp",
+            "light_probe",
+            "speaker",
         )
 
-        is_first = True
-        for attr_object_types in attr_object_types_all:
-            if is_first is False:
+        for attr in attr_object_types:
+            if attr is None:
                 col.separator()
-            is_first = False
+                continue
 
-            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]
+            attr_v = "show_object_viewport_" f"{attr:s}"
+            attr_s = "show_object_select_" f"{attr:s}"
 
-            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'
+            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)
+            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