[Bf-blender-cvs] [e5a0cf730ae] blender2.8: UI: use two columns for the overlay popover
Campbell Barton
noreply at git.blender.org
Sun Jun 10 15:24:26 CEST 2018
Commit: e5a0cf730aecb4e9b357d7dadc56b1a7e736fe6f
Author: Campbell Barton
Date: Sun Jun 10 15:22:47 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBe5a0cf730aecb4e9b357d7dadc56b1a7e736fe6f
UI: use two columns for the overlay popover
Also use sub-panels.
Patch by @billreynish w/ edits.
===================================================================
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 3a8fb3ce2f0..cb6f63afdab 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -3607,15 +3607,22 @@ class VIEW3D_PT_overlay(Panel):
col = layout.column()
col.active = display_all
- col.prop(view, "show_manipulator", text="Manipulators")
-
- col.prop(overlay, "show_text", text="Text")
- col.prop(overlay, "show_cursor", text="3D Cursor")
- col.prop(overlay, "show_outline_selected")
- col.prop(overlay, "show_all_objects_origin")
- col.prop(overlay, "show_relationship_lines")
- col.prop(overlay, "show_motion_paths")
- col.prop(overlay, "show_face_orientation")
+ split = col.split()
+
+ sub = split.column()
+ sub.prop(view, "show_manipulator", text="Manipulators")
+ sub.prop(overlay, "show_text", text="Text")
+ sub.prop(overlay, "show_cursor", text="3D Cursor")
+ sub.prop(overlay, "show_outline_selected")
+ sub.prop(overlay, "show_all_objects_origin")
+
+ sub = split.column()
+ sub.prop(overlay, "show_relationship_lines")
+ sub.prop(overlay, "show_motion_paths")
+ sub.prop(overlay, "show_face_orientation")
+ sub.prop(overlay, "show_backface_culling")
+ if shading.type == "MATERIAL":
+ sub.prop(overlay, "show_look_dev")
row = col.row()
row.prop(overlay, "show_wireframes")
@@ -3623,11 +3630,6 @@ class VIEW3D_PT_overlay(Panel):
sub.active = overlay.show_wireframes
sub.prop(overlay, "wireframe_threshold", text="")
- col.prop(overlay, "show_backface_culling")
-
- if shading.type == "MATERIAL":
- col.prop(overlay, "show_look_dev")
-
col = layout.column()
col.active = display_all
split = col.split(percentage=0.55)
@@ -3638,82 +3640,97 @@ class VIEW3D_PT_overlay(Panel):
row.prop(overlay, "show_axis_y", text="Y", toggle=True)
row.prop(overlay, "show_axis_z", text="Z", toggle=True)
- sub = col.column(align=True)
- sub.active = bool(overlay.show_floor or view.region_quadviews or not view.region_3d.is_perspective)
- subsub = sub.column(align=True)
- subsub.active = overlay.show_floor
- subsub.prop(overlay, "grid_scale", text="Scale")
- subsub.prop(overlay, "grid_subdivisions", text="Subdivisions")
+ if overlay.show_floor:
+ sub = col.column(align=True)
+ sub.active = bool(overlay.show_floor or view.region_quadviews or not view.region_3d.is_perspective)
+ subsub = sub.column(align=True)
+ subsub.active = overlay.show_floor
+ subsub.prop(overlay, "grid_scale", text="Scale")
+ subsub.prop(overlay, "grid_subdivisions", text="Subdivisions")
col.prop(view, "show_reconstruction", text="Motion Tracking")
- sub = col.column(align=True)
-
- sub.active = view.show_reconstruction
- sub.prop(view, "show_camera_path", text="Camera Path")
- sub.prop(view, "show_bundle_names", text="3D Marker Names")
- sub.label(text="Track Type and Size:")
- row = sub.row(align=True)
- row.prop(view, "tracks_draw_type", text="")
- row.prop(view, "tracks_draw_size", text="")
- col.separator()
-
- if context.mode == 'EDIT_MESH':
- data = context.active_object.data
- statvis = context.tool_settings.statvis
- with_freestyle = bpy.app.build_options.freestyle
- col.separator()
- col.label(text="Edit Mesh:")
+ if view.show_reconstruction:
+ sub = col.column(align=True)
+ sub.active = view.show_reconstruction
+ sub.prop(view, "show_camera_path", text="Camera Path")
+ sub.prop(view, "show_bundle_names", text="3D Marker Names")
+ sub.label(text="Track Type and Size:")
+ row = sub.row(align=True)
+ row.prop(view, "tracks_draw_type", text="")
+ row.prop(view, "tracks_draw_size", text="")
+
+
+class VIEW3D_PT_overlay_edit_mesh(Panel):
+ bl_space_type = 'VIEW_3D'
+ bl_region_type = 'HEADER'
+ bl_parent_id = 'VIEW3D_PT_overlay'
+ bl_label = "Edit Mesh"
- col.prop(overlay, "show_occlude_wire")
+ @classmethod
+ def poll(cls, context):
+ return context.mode == 'EDIT_MESH'
- col.prop(overlay, "show_weight")
- col.label("Show Zero Weights:")
- col.row().prop(toolsettings, "vertex_group_user", expand=True)
+ def draw(self, context):
+ layout = self.layout
+
+ view = context.space_data
+ shading = view.shading
+ overlay = view.overlay
+ toolsettings = context.tool_settings
+ display_all = overlay.show_overlays
+ data = context.active_object.data
+ statvis = context.tool_settings.statvis
+ with_freestyle = bpy.app.build_options.freestyle
- col.label(text="Normals:")
- row = col.row(align=True)
+ col = layout.column()
+ col.active = display_all
- row.prop(overlay, "show_vertex_normals", text="", icon='VERTEXSEL')
- row.prop(overlay, "show_split_normals", text="", icon='LOOPSEL')
- row.prop(overlay, "show_face_normals", text="", icon='FACESEL')
+ split = col.split()
- sub = row.row(align=True)
- sub.active = overlay.show_vertex_normals or overlay.show_face_normals or overlay.show_split_normals
- sub.prop(overlay, "normals_length", text="Size")
+ sub = split.column()
+ sub.prop(data, "show_faces", text="Faces")
+ sub.prop(data, "show_edges", text="Edges")
+ sub.prop(data, "show_edge_crease", text="Creases")
+ sub.prop(data, "show_edge_sharp", text="Sharp", text_ctxt=i18n_contexts.plural)
+ sub.prop(data, "show_edge_bevel_weight", text="Bevel")
+ if not with_freestyle:
+ sub.prop(data, "show_edge_seams", text="Seams")
- split = col.split()
+ sub = split.column()
+ sub.prop(overlay, "show_occlude_wire")
+ sub.prop(data, "show_extra_edge_length", text="Edge Length")
+ sub.prop(data, "show_extra_edge_angle", text="Edge Angle")
+ sub.prop(data, "show_extra_face_area", text="Face Area")
+ sub.prop(data, "show_extra_face_angle", text="Face Angle")
- sub = split.column()
- sub.prop(data, "show_faces", text="Faces")
- sub.prop(data, "show_edges", text="Edges")
- sub.prop(data, "show_edge_crease", text="Creases")
+ if bpy.app.debug:
+ sub.prop(data, "show_extra_indices", text="Indices")
- if with_freestyle:
- sub.prop(data, "show_edge_seams", text="Seams")
+ if with_freestyle:
+ col.label(text="Freestyle:")
+ row = col.row()
+ row.prop(data, "show_freestyle_edge_marks", text="Edge Marks")
+ row.prop(data, "show_freestyle_face_marks", text="Face Marks")
+ row.prop(data, "show_edge_seams", text="Seams")
- sub = split.column()
- if not with_freestyle:
- sub.prop(data, "show_edge_seams", text="Seams")
- sub.prop(data, "show_edge_sharp", text="Sharp", text_ctxt=i18n_contexts.plural)
- col.prop(data, "show_edge_bevel_weight", text="Bevel")
- if with_freestyle:
- sub.prop(data, "show_freestyle_edge_marks", text="Edge Marks")
- sub.prop(data, "show_freestyle_face_marks", text="Face Marks")
+ col.label(text="Normals:")
+ row = col.row(align=True)
- col.separator()
- split = col.split()
- sub = split.column()
- sub.label(text="Edge Info:")
- sub.prop(data, "show_extra_edge_length", text="Length")
- sub.prop(data, "show_extra_edge_angle", text="Angle")
- sub = split.column()
- sub.label(text="Face Info:")
- sub.prop(data, "show_extra_face_area", text="Area")
- sub.prop(data, "show_extra_face_angle", text="Angle")
- if bpy.app.debug:
- sub.prop(data, "show_extra_indices", text="Indices")
-
- col.prop(data, "show_statvis", text="Mesh Analysis")
+ row.prop(overlay, "show_vertex_normals", text="", icon='VERTEXSEL')
+ row.prop(overlay, "show_split_normals", text="", icon='LOOPSEL')
+ row.prop(overlay, "show_face_normals", text="", icon='FACESEL')
+
+ sub = row.row(align=True)
+ sub.active = overlay.show_vertex_normals or overlay.show_face_normals or overlay.show_split_normals
+ sub.prop(overlay, "normals_length", text="Size")
+
+ col.prop(overlay, "show_weight")
+ if overlay.show_weight:
+ col.label("Show Zero Weights:")
+ col.row().prop(toolsettings, "vertex_group_user", expand=True)
+
+ col.prop(data, "show_statvis", text="Mesh Analysis")
+ if data.show_statvis:
sub = col.column()
sub.active = data.show_statvis
sub.prop(statvis, "type")
@@ -3722,12 +3739,12 @@ class VIEW3D_PT_overlay(Panel):
row = sub.row(align=True)
row.prop(statvis, "overhang_min", text="")
row.prop(statvis, "overhang_max", text="")
- layout.row().prop(statvis, "overhang_axis", expand=True)
+ sub.row().prop(statvis, "overhang_axis", expand=True)
elif statvis_type == 'THICKNESS':
row = sub.row(align=True)
row.prop(statvis, "thickness_min", text="")
row.prop(statvis, "thickness_max", text="")
- layout.prop(statvis, "thickness_samples")
+ sub.prop(statvis, "thickness_samples")
elif statvis_type == 'INTERSECT':
pass
elif statvis_type == 'DISTORT':
@@ -3739,43 +3756,125 @@ class VIEW3D_PT_overlay(Panel):
row.prop(statvis, "sharp_min", text="")
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list