Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_view3d.py
| Show First 20 Lines • Show All 5,795 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| sub = row.row() | sub = row.row() | ||||
| sub.active = display_all and overlay.show_xray_bone | sub.active = display_all and overlay.show_xray_bone | ||||
| sub.prop(overlay, "xray_alpha_bone", text="Fade Geometry") | sub.prop(overlay, "xray_alpha_bone", text="Fade Geometry") | ||||
| else: | else: | ||||
| row = col.row() | row = col.row() | ||||
| row.prop(overlay, "show_xray_bone") | 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_space_type = 'VIEW_3D' | ||||
| bl_region_type = 'HEADER' | bl_region_type = 'HEADER' | ||||
| bl_parent_id = 'VIEW3D_PT_overlay' | bl_parent_id = 'VIEW3D_PT_overlay' | ||||
| bl_label = "" | bl_label = "Texture Paint" | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | 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 = self.layout | ||||
| layout.label(text={ | view = context.space_data | ||||
| 'PAINT_TEXTURE': "Texture Paint", | overlay = view.overlay | ||||
| 'PAINT_VERTEX': "Vertex Paint", | display_all = overlay.show_overlays | ||||
| 'PAINT_WEIGHT': "Weight Paint", | |||||
| }[context.mode]) | 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): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| view = context.space_data | view = context.space_data | ||||
| overlay = view.overlay | overlay = view.overlay | ||||
| display_all = overlay.show_overlays | display_all = overlay.show_overlays | ||||
| col = layout.column() | col = layout.column() | ||||
| col.active = display_all | col.active = display_all | ||||
| col.prop(overlay, { | col.prop(overlay, "vertex_paint_mode_opacity", text="Opacity") | ||||
| 'PAINT_TEXTURE': "texture_paint_mode_opacity", | col.prop(overlay, "show_paint_wire") | ||||
brecht: For translation to properly detect this string, please restructure code like:
```
if context. | |||||
| 'PAINT_VERTEX': "vertex_paint_mode_opacity", | |||||
| 'PAINT_WEIGHT': "weight_paint_mode_opacity", | |||||
| }[context.mode], text="Opacity") | 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" | |||||
| if context.mode == 'PAINT_WEIGHT': | @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 = col.split(factor=0.33) | ||||
| row.label(text="Zero Weights") | row.label(text="Zero Weights") | ||||
| sub = row.row() | sub = row.row() | ||||
| sub.prop(context.tool_settings, "vertex_group_user", expand=True) | sub.prop(context.tool_settings, "vertex_group_user", expand=True) | ||||
| col.prop(overlay, "show_wpaint_contours") | col.prop(overlay, "show_wpaint_contours") | ||||
| if context.mode in {'PAINT_WEIGHT', 'PAINT_VERTEX'}: | |||||
| col.prop(overlay, "show_paint_wire") | col.prop(overlay, "show_paint_wire") | ||||
| class VIEW3D_PT_pivot_point(Panel): | class VIEW3D_PT_pivot_point(Panel): | ||||
| bl_space_type = 'VIEW_3D' | bl_space_type = 'VIEW_3D' | ||||
| bl_region_type = 'HEADER' | bl_region_type = 'HEADER' | ||||
| bl_label = "Pivot Point" | bl_label = "Pivot Point" | ||||
| bl_ui_units_x = 8 | bl_ui_units_x = 8 | ||||
| ▲ Show 20 Lines • Show All 808 Lines • ▼ Show 20 Lines | classes = ( | ||||
| VIEW3D_PT_overlay_geometry, | VIEW3D_PT_overlay_geometry, | ||||
| VIEW3D_PT_overlay_motion_tracking, | VIEW3D_PT_overlay_motion_tracking, | ||||
| VIEW3D_PT_overlay_edit_mesh, | VIEW3D_PT_overlay_edit_mesh, | ||||
| VIEW3D_PT_overlay_edit_mesh_shading, | VIEW3D_PT_overlay_edit_mesh_shading, | ||||
| VIEW3D_PT_overlay_edit_mesh_measurement, | VIEW3D_PT_overlay_edit_mesh_measurement, | ||||
| VIEW3D_PT_overlay_edit_mesh_normals, | VIEW3D_PT_overlay_edit_mesh_normals, | ||||
| VIEW3D_PT_overlay_edit_mesh_freestyle, | VIEW3D_PT_overlay_edit_mesh_freestyle, | ||||
| VIEW3D_PT_overlay_edit_curve, | 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_pose, | ||||
| VIEW3D_PT_overlay_sculpt, | VIEW3D_PT_overlay_sculpt, | ||||
| VIEW3D_PT_pivot_point, | VIEW3D_PT_pivot_point, | ||||
| VIEW3D_PT_snapping, | VIEW3D_PT_snapping, | ||||
| VIEW3D_PT_proportional_edit, | VIEW3D_PT_proportional_edit, | ||||
| VIEW3D_PT_gpencil_origin, | VIEW3D_PT_gpencil_origin, | ||||
| VIEW3D_PT_gpencil_lock, | VIEW3D_PT_gpencil_lock, | ||||
| VIEW3D_PT_gpencil_guide, | VIEW3D_PT_gpencil_guide, | ||||
| Show All 18 Lines | |||||
For translation to properly detect this string, please restructure code like:
if context.mode == 'PAINT_TEXTURE': col.prop(overlay, "texture_paint_mode_opacity", text="Stencil Opacity") elif context.mode == 'PAINT_VERTEX': col.prop(overlay, "vertex_paint_mode_opacity", text="Opacity") elif context.mode == 'PAINT_WEIGHT': col.prop(overlay, "weight_paint_mode_opacity", text="Opacity")