[Bf-blender-cvs] [be8855a2ef0] blender2.8: UI: move visibility panel into the side bar
Campbell Barton
noreply at git.blender.org
Mon Jul 9 17:00:58 CEST 2018
Commit: be8855a2ef03c918cd8a7bd13dc315a37d5bfc80
Author: Campbell Barton
Date: Mon Jul 9 17:00:09 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBbe8855a2ef03c918cd8a7bd13dc315a37d5bfc80
UI: move visibility panel into the side bar
===================================================================
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 b0abb1b3117..c905dc51b0e 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -112,14 +112,6 @@ class VIEW3D_HT_header(Header):
sub.active = overlay.show_overlays
sub.popover(space_type='VIEW_3D', region_type='HEADER', panel_type="VIEW3D_PT_overlay")
- layout.popover(
- text="",
- icon='HIDE_OFF',
- space_type='VIEW_3D',
- region_type='HEADER',
- panel_type="VIEW3D_PT_object_type_visibility",
- )
-
layout.separator_spacer()
# Mode & Transform Settings
@@ -3697,6 +3689,52 @@ class VIEW3D_PT_view3d_cursor(Panel):
layout.column().prop(view, "cursor_location", text="Location")
+class VIEW3D_PT_object_type_visibility(Panel):
+ bl_space_type = 'VIEW_3D'
+ bl_region_type = 'UI'
+ bl_label = "View Object Types"
+ bl_options = {'DEFAULT_CLOSED'}
+
+ def draw(self, context):
+ layout = self.layout
+ view = context.space_data
+
+ col = layout.column()
+
+ split = col.split()
+
+ heading_pair = ("Visible", "Selectable")
+ attr_object_types = (
+ "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]
+
+ sub = split.column()
+ sub.label("Visible")
+ for attr_v in attr_vis:
+ sub.prop(view, attr_v)
+
+ sub = split.column()
+ sub.label("Selectable")
+ for attr_v, attr_s in zip(attr_vis, attr_sel):
+ row = sub.row(align=True)
+ row.active = getattr(view, attr_v)
+ row.prop(view, attr_s)
+
+
class VIEW3D_PT_shading(Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'HEADER'
@@ -4129,51 +4167,6 @@ class VIEW3D_PT_overlay_paint(Panel):
col.prop(overlay, "show_paint_wire")
-class VIEW3D_PT_object_type_visibility(Panel):
- bl_space_type = 'VIEW_3D'
- bl_region_type = 'HEADER'
- bl_label = "Object Visibility"
-
- def draw(self, context):
- layout = self.layout
- view = context.space_data
-
- col = layout.column()
-
- split = col.split()
-
- heading_pair = ("Visible", "Selectable")
- attr_object_types = (
- "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]
-
- sub = split.column()
- sub.label("Visible")
- for attr_v in attr_vis:
- sub.prop(view, attr_v)
-
- sub = split.column()
- sub.label("Selectable")
- for attr_v, attr_s in zip(attr_vis, attr_sel):
- row = sub.row(align=True)
- row.active = getattr(view, attr_v)
- row.prop(view, attr_s)
-
-
class VIEW3D_PT_pivot_point(Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'HEADER'
@@ -4505,6 +4498,7 @@ classes = (
VIEW3D_PT_view3d_properties,
VIEW3D_PT_view3d_camera_lock,
VIEW3D_PT_view3d_cursor,
+ VIEW3D_PT_object_type_visibility,
VIEW3D_PT_quad_view,
VIEW3D_PT_view3d_stereo,
VIEW3D_PT_shading,
@@ -4518,7 +4512,6 @@ classes = (
VIEW3D_PT_overlay_pose,
VIEW3D_PT_overlay_paint,
VIEW3D_PT_overlay_sculpt,
- VIEW3D_PT_object_type_visibility,
VIEW3D_PT_pivot_point,
VIEW3D_PT_snapping,
VIEW3D_PT_transform_orientations,
More information about the Bf-blender-cvs
mailing list