Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_view3d.py
| Context not available. | |||||
| ) | ) | ||||
| from bl_ui.properties_paint_common import ( | from bl_ui.properties_paint_common import ( | ||||
| UnifiedPaintPanel, | UnifiedPaintPanel, | ||||
| brush_basic_texpaint_settings, | |||||
| ) | ) | ||||
| from bl_ui.properties_grease_pencil_common import ( | from bl_ui.properties_grease_pencil_common import ( | ||||
| AnnotationDataPanel, | AnnotationDataPanel, | ||||
| Context not available. | |||||
| if brush is None: | if brush is None: | ||||
| return | return | ||||
| from bl_ui.properties_paint_common import ( | tool_settings = context.tool_settings | ||||
| brush_basic_sculpt_settings, | capabilities = brush.sculpt_capabilities | ||||
| ) | |||||
| brush_basic_sculpt_settings(layout, context, brush, compact=True) | ups = tool_settings.unified_paint_settings | ||||
| size = "size" | |||||
| size_owner = ups if ups.use_unified_size else brush | |||||
| if size_owner.use_locked_size == 'SCENE': | |||||
| size = "unprojected_radius" | |||||
| # NOTE: We don't draw UnifiedPaintSettings in the header to reduce clutter. D5928#136281 | |||||
| UnifiedPaintPanel.prop_unified(layout, context, size_owner, size, pressure_name="use_pressure_size", text="Radius", slider=True) | |||||
| # strength, use_strength_pressure | |||||
| pressure_name = "use_pressure_strength" if capabilities.has_strength_pressure else None | |||||
| UnifiedPaintPanel.prop_unified(layout, context, brush, "strength", pressure_name=pressure_name, text="Strength") | |||||
| # direction | |||||
| if not capabilities.has_direction: | |||||
| layout.row().prop(brush, "direction", expand=True, text="") | |||||
| @staticmethod | @staticmethod | ||||
| def PAINT_TEXTURE(context, layout, tool): | def PAINT_TEXTURE(context, layout, tool): | ||||
| Context not available. | |||||
| if brush is None: | if brush is None: | ||||
| return | return | ||||
| from bl_ui.properties_paint_common import ( | |||||
| UnifiedPaintPanel, | |||||
| brush_basic_texpaint_settings, | |||||
| ) | |||||
| capabilities = brush.image_paint_capabilities | |||||
| if capabilities.has_color: | |||||
| UnifiedPaintPanel.prop_unified_color(layout, context, brush, "color", text="") | |||||
| brush_basic_texpaint_settings(layout, context, brush, compact=True) | brush_basic_texpaint_settings(layout, context, brush, compact=True) | ||||
| @staticmethod | @staticmethod | ||||
| Context not available. | |||||
| if brush is None: | if brush is None: | ||||
| return | return | ||||
| from bl_ui.properties_paint_common import ( | brush_basic_texpaint_settings(layout, context, brush, compact=True) | ||||
| UnifiedPaintPanel, | |||||
| brush_basic_vpaint_settings, | |||||
| ) | |||||
| capabilities = brush.vertex_paint_capabilities | |||||
| if capabilities.has_color: | |||||
| UnifiedPaintPanel.prop_unified_color(layout, context, brush, "color", text="") | |||||
| brush_basic_vpaint_settings(layout, context, brush, compact=True) | |||||
| @staticmethod | @staticmethod | ||||
| def PAINT_WEIGHT(context, layout, tool): | def PAINT_WEIGHT(context, layout, tool): | ||||
| Context not available. | |||||
| if brush is None: | if brush is None: | ||||
| return | return | ||||
| from bl_ui.properties_paint_common import brush_basic_wpaint_settings | # NOTE: We don't draw UnifiedPaintSettings in the header to reduce clutter. D5928#136281 | ||||
| brush_basic_wpaint_settings(layout, context, brush, compact=True) | capabilities = brush.weight_paint_capabilities | ||||
| if capabilities.has_weight: | |||||
| UnifiedPaintPanel.prop_unified(layout, context, brush, "weight", slider=True) | |||||
| UnifiedPaintPanel.prop_unified(layout, context, brush, "size", pressure_name="use_pressure_size", slider=True, text="Radius") | |||||
| UnifiedPaintPanel.prop_unified(layout, context, brush, "strength", pressure_name="use_pressure_strength") | |||||
| @staticmethod | @staticmethod | ||||
| def PAINT_GPENCIL(context, layout, tool): | def PAINT_GPENCIL(context, layout, tool): | ||||
| Context not available. | |||||
| show_snap = True | show_snap = True | ||||
| else: | else: | ||||
| from bl_ui.properties_paint_common import UnifiedPaintPanel | |||||
| paint_settings = UnifiedPaintPanel.paint_settings(context) | paint_settings = UnifiedPaintPanel.paint_settings(context) | ||||
| if paint_settings: | if paint_settings: | ||||
| Context not available. | |||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| brush = context.tool_settings.vertex_paint.brush | brush = context.tool_settings.vertex_paint.brush | ||||
| capabilities = brush.vertex_paint_capabilities | capabilities = brush.vertex_paint_capabilities | ||||
| Context not available. | |||||
| UnifiedPaintPanel.prop_unified_color_picker(split, context, brush, "color", value_slider=True) | UnifiedPaintPanel.prop_unified_color_picker(split, context, brush, "color", value_slider=True) | ||||
| layout.prop(brush, "blend", text="") | layout.prop(brush, "blend", text="") | ||||
| UnifiedPaintPanel.prop_unified_size(layout, context, brush, "size", slider=True) | UnifiedPaintPanel.prop_unified(layout, context, brush, "size", unified_name="use_unified_size", pressure_name="use_pressure_size", slider=True) | ||||
| UnifiedPaintPanel.prop_unified_strength(layout, context, brush, "strength") | UnifiedPaintPanel.prop_unified(layout, context, brush, "strength", unified_name="use_unified_strength", pressure_name="use_pressure_strength", slider=True) | ||||
| class VIEW3D_PT_paint_texture_context_menu(Panel): | class VIEW3D_PT_paint_texture_context_menu(Panel): | ||||
| # Only for popover, these are dummy values. | # Only for popover, these are dummy values. | ||||
| bl_space_type = 'VIEW_3D' | bl_space_type = 'VIEW_3D' | ||||
| bl_region_type = 'WINDOW' | bl_region_type = 'WINDOW' | ||||
| bl_label = "Texture Paint Context Menu" | bl_label = "Texture Paint Context Menu" | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| brush = context.tool_settings.image_paint.brush | brush = context.tool_settings.image_paint.brush | ||||
| capabilities = brush.image_paint_capabilities | capabilities = brush.image_paint_capabilities | ||||
| Context not available. | |||||
| layout.prop(brush, "blend", text="") | layout.prop(brush, "blend", text="") | ||||
| if capabilities.has_radius: | if capabilities.has_radius: | ||||
| UnifiedPaintPanel.prop_unified_size(layout, context, brush, "size", slider=True) | UnifiedPaintPanel.prop_unified(layout, context, brush, "size", unified_name="use_unified_size", pressure_name="use_pressure_size", slider=True) | ||||
| UnifiedPaintPanel.prop_unified_strength(layout, context, brush, "strength") | UnifiedPaintPanel.prop_unified(layout, context, brush, "strength", unified_name="use_unified_strength", pressure_name="use_pressure_strength", slider=True) | ||||
| class VIEW3D_PT_paint_weight_context_menu(Panel): | class VIEW3D_PT_paint_weight_context_menu(Panel): | ||||
| Context not available. | |||||
| layout = self.layout | layout = self.layout | ||||
| brush = context.tool_settings.weight_paint.brush | brush = context.tool_settings.weight_paint.brush | ||||
| UnifiedPaintPanel.prop_unified_weight(layout, context, brush, "weight", slider=True) | UnifiedPaintPanel.prop_unified(layout, context, brush, "weight", unified_name="use_unified_weight", slider=True) | ||||
| UnifiedPaintPanel.prop_unified_size(layout, context, brush, "size", slider=True) | UnifiedPaintPanel.prop_unified(layout, context, brush, "size", unified_name="use_unified_size", pressure_name="use_pressure_size", slider=True) | ||||
| UnifiedPaintPanel.prop_unified_strength(layout, context, brush, "strength") | UnifiedPaintPanel.prop_unified(layout, context, brush, "strength", unified_name="use_unified_strength", pressure_name="use_pressure_strength", slider=True) | ||||
| class VIEW3D_PT_sculpt_context_menu(Panel): | class VIEW3D_PT_sculpt_context_menu(Panel): | ||||
| Context not available. | |||||
| brush = context.tool_settings.sculpt.brush | brush = context.tool_settings.sculpt.brush | ||||
| capabilities = brush.sculpt_capabilities | capabilities = brush.sculpt_capabilities | ||||
| UnifiedPaintPanel.prop_unified_size(layout, context, brush, "size", slider=True) | UnifiedPaintPanel.prop_unified(layout, context, brush, "size", unified_name="use_unified_size", pressure_name="use_pressure_size", slider=True) | ||||
| UnifiedPaintPanel.prop_unified_strength(layout, context, brush, "strength") | UnifiedPaintPanel.prop_unified(layout, context, brush, "strength", unified_name="use_unified_strength", pressure_name="use_pressure_strength", slider=True) | ||||
| if capabilities.has_auto_smooth: | if capabilities.has_auto_smooth: | ||||
| layout.prop(brush, "auto_smooth_factor", slider=True) | layout.prop(brush, "auto_smooth_factor", slider=True) | ||||
| Context not available. | |||||