[Bf-blender-cvs] [87186f49cc5] blender2.8: UI: Tweaks to Object Types Visibility popover.
Pablo Vazquez
noreply at git.blender.org
Fri Nov 9 02:58:37 CET 2018
Commit: 87186f49cc5ac8e858e9515abfd615219d76ce95
Author: Pablo Vazquez
Date: Fri Nov 9 02:58:25 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB87186f49cc5ac8e858e9515abfd615219d76ce95
UI: Tweaks to Object Types Visibility popover.
Replace checkbox for visibility with eye icon instead.
Thanks a.monti and zebus3d for the help.
Closes T57714
Part of UI Paper Cuts T56950
===================================================================
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 a80203f0971..6411ea8702c 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -3993,28 +3993,30 @@ class VIEW3D_PT_object_type_visibility(Panel):
view = context.space_data
+ layout.label(text="Object Types Visibility")
col = layout.column()
- attr_object_types = (
+ attr_object_types = {
# Geometry
- "mesh",
- "curve",
- "surf",
- "meta",
- "font",
- None,
+ "mesh" : "Mesh",
+ "curve" : "Curve",
+ "surf" : "Surface",
+ "meta" : "Meta",
+ "font" : "Font",
+ None : None,
# Other
- "armature",
- "lattice",
- "empty",
- "grease_pencil",
- "camera",
- "light",
- "light_probe",
- "speaker",
- )
-
- for attr in attr_object_types:
+ "armature" : "Armature",
+ "lattice" : "Lattice",
+ "empty" : "Empty",
+ "grease_pencil" : "Grease Pencil",
+ "camera" : "Camera",
+ "light" : "Light",
+ "light_probe" : "Light Probe",
+ "speaker" : "Speaker",
+ }
+
+
+ for attr, attr_name in attr_object_types.items():
if attr is None:
col.separator()
continue
@@ -4022,10 +4024,14 @@ class VIEW3D_PT_object_type_visibility(Panel):
attr_v = "show_object_viewport_" f"{attr:s}"
attr_s = "show_object_select_" f"{attr:s}"
+ icon_v = 'VISIBLE_IPO_ON' if getattr(view, attr_v) else 'VISIBLE_IPO_OFF'
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.alignment = 'RIGHT'
+
+ row.label(text=attr_name)
+ row.prop(view, attr_v, text="", icon=icon_v, emboss=False)
row.active = getattr(view, attr_v)
row.prop(view, attr_s, text="", icon=icon_s, emboss=False)
More information about the Bf-blender-cvs
mailing list