diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2019-07-17 14:50:24 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2019-08-06 09:20:56 +0300 |
commit | 972c05537d31191b6bf3cc61d847825ab1cd3610 (patch) | |
tree | f9939088dfdab46afeb1e3d0ea9a5bb2d4855b17 /release | |
parent | 08717f4a2c3c17bf800b0612daf4ef5c797a0f94 (diff) |
Refactor Paint Overlay Opacity Panel
It is now possible to translate this panel. Due to the previous
structure the translation tools were not able to pick the strings up as
translatable strings.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D5279
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 76 |
1 files changed, 53 insertions, 23 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 582d4fe1258..540ed82a35c 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -5801,23 +5801,36 @@ class VIEW3D_PT_overlay_pose(Panel): row.prop(overlay, "show_xray_bone") -class VIEW3D_PT_overlay_paint(Panel): +class VIEW3D_PT_overlay_texture_paint(Panel): bl_space_type = 'VIEW_3D' bl_region_type = 'HEADER' bl_parent_id = 'VIEW3D_PT_overlay' - bl_label = "" + bl_label = "Texture Paint" @classmethod def poll(cls, context): - return context.mode in {'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE'} + return context.mode == 'PAINT_TEXTURE' - def draw_header(self, context): + def draw(self, context): layout = self.layout - layout.label(text={ - 'PAINT_TEXTURE': "Texture Paint", - 'PAINT_VERTEX': "Vertex Paint", - 'PAINT_WEIGHT': "Weight Paint", - }[context.mode]) + view = context.space_data + overlay = view.overlay + display_all = overlay.show_overlays + + col = layout.column() + col.active = display_all + col.prop(overlay, "texture_paint_mode_opacity") + + +class VIEW3D_PT_overlay_vertex_paint(Panel): + bl_space_type = 'VIEW_3D' + bl_region_type = 'HEADER' + bl_parent_id = 'VIEW3D_PT_overlay' + bl_label = "Vertex Paint" + + @classmethod + def poll(cls, context): + return context.mode == 'PAINT_VERTEX' def draw(self, context): layout = self.layout @@ -5828,22 +5841,37 @@ class VIEW3D_PT_overlay_paint(Panel): col = layout.column() col.active = display_all - col.prop(overlay, { - 'PAINT_TEXTURE': "texture_paint_mode_opacity", - 'PAINT_VERTEX': "vertex_paint_mode_opacity", - 'PAINT_WEIGHT': "weight_paint_mode_opacity", - }[context.mode], text="Opacity") + col.prop(overlay, "vertex_paint_mode_opacity", text="Opacity") + col.prop(overlay, "show_paint_wire") - if context.mode == 'PAINT_WEIGHT': - row = col.split(factor=0.33) - row.label(text="Zero Weights") - sub = row.row() - sub.prop(context.tool_settings, "vertex_group_user", expand=True) - col.prop(overlay, "show_wpaint_contours") +class VIEW3D_PT_overlay_weight_paint(Panel): + bl_space_type = 'VIEW_3D' + bl_region_type = 'HEADER' + bl_parent_id = 'VIEW3D_PT_overlay' + bl_label = "Weight Paint" + + @classmethod + def poll(cls, context): + return context.mode == 'PAINT_WEIGHT' + + def draw(self, context): + layout = self.layout + view = context.space_data + overlay = view.overlay + display_all = overlay.show_overlays + + col = layout.column() + col.active = display_all + + col.prop(overlay, "weight_paint_mode_opacity", text="Opacity") + row = col.split(factor=0.33) + row.label(text="Zero Weights") + sub = row.row() + sub.prop(context.tool_settings, "vertex_group_user", expand=True) - if context.mode in {'PAINT_WEIGHT', 'PAINT_VERTEX'}: - col.prop(overlay, "show_paint_wire") + col.prop(overlay, "show_wpaint_contours") + col.prop(overlay, "show_paint_wire") class VIEW3D_PT_pivot_point(Panel): @@ -6668,7 +6696,9 @@ classes = ( VIEW3D_PT_overlay_edit_mesh_normals, VIEW3D_PT_overlay_edit_mesh_freestyle, VIEW3D_PT_overlay_edit_curve, - VIEW3D_PT_overlay_paint, + VIEW3D_PT_overlay_texture_paint, + VIEW3D_PT_overlay_vertex_paint, + VIEW3D_PT_overlay_weight_paint, VIEW3D_PT_overlay_pose, VIEW3D_PT_overlay_sculpt, VIEW3D_PT_pivot_point, |