Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_view3d_toolbar.py
| Context not available. | |||||
| from bl_ui.properties_paint_common import ( | from bl_ui.properties_paint_common import ( | ||||
| UnifiedPaintPanel, | UnifiedPaintPanel, | ||||
| brush_mask_texture_settings, | brush_mask_texture_settings, | ||||
| brush_texpaint_common, | |||||
| brush_texpaint_common_color, | brush_texpaint_common_color, | ||||
| brush_texpaint_common_gradient, | brush_texpaint_common_gradient, | ||||
| brush_texpaint_common_clone, | brush_texpaint_common_clone, | ||||
| brush_texpaint_common_options, | |||||
| brush_texture_settings, | brush_texture_settings, | ||||
| brush_basic_gpencil_paint_settings, | |||||
| brush_basic_gpencil_weight_settings, | |||||
| draw_all_brush_settings | |||||
| ) | ) | ||||
| from bl_ui.utils import PresetPanel | from bl_ui.utils import PresetPanel | ||||
| Context not available. | |||||
| class VIEW3D_PT_tools_particlemode(Panel, View3DPaintPanel): | class VIEW3D_PT_tools_particlemode(Panel, View3DPaintPanel): | ||||
| bl_context = ".paint_common" # dot on purpose (access from topbar) | bl_context = ".paint_common" # dot on purpose (access from topbar) | ||||
| bl_label = "Particle tools" | bl_label = "Brush" | ||||
| bl_options = {'HIDE_HEADER'} | |||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| settings = cls.paint_settings(context) | settings = cls.paint_settings(context) | ||||
| Context not available. | |||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| layout.use_property_decorate = False # No animation. | layout.use_property_decorate = False # No animation. | ||||
| settings = self.paint_settings(context) | settings = UnifiedPaintPanel.paint_settings(context) | ||||
| brush = settings.brush | |||||
| if not self.is_popover: | |||||
| row = layout.row() | |||||
| row.column().template_ID_preview(settings, "brush", new="brush.add", rows=3, cols=8) | |||||
| row.menu("VIEW3D_MT_brush_context_menu", icon='DOWNARROW_HLT', text="") | |||||
| # Sculpt Mode # | |||||
| if context.sculpt_object and brush: | |||||
| from bl_ui.properties_paint_common import ( | |||||
| brush_basic_sculpt_settings, | |||||
| ) | |||||
| capabilities = brush.sculpt_capabilities | |||||
| col = layout.column() | |||||
| if not self.is_popover: | |||||
| brush_basic_sculpt_settings(col, context, brush) | |||||
| # normal_radius_factor | |||||
| col.separator() | |||||
| row = col.row() | |||||
| row.prop(brush, "normal_radius_factor", slider=True) | |||||
| if brush.sculpt_tool == 'ELASTIC_DEFORM': | |||||
| col.separator() | |||||
| row = col.row() | |||||
| row.prop(brush, "elastic_deform_type") | |||||
| row = col.row() | |||||
| row.prop(brush, "elastic_deform_volume_preservation", slider=True) | |||||
| elif brush.sculpt_tool == 'POSE': | |||||
| row = col.row() | |||||
| row.prop(brush, "pose_offset") | |||||
pablodp606: This property is missing in the patch | |||||
| elif brush.sculpt_tool == 'GRAB': | |||||
| col.separator() | |||||
| row = col.row() | |||||
| row.prop(brush, "use_grab_active_vertex") | |||||
| # topology_rake_factor | |||||
| if ( | |||||
| capabilities.has_topology_rake and | |||||
| context.sculpt_object.use_dynamic_topology_sculpting | |||||
| ): | |||||
| row = col.row() | |||||
| row.prop(brush, "topology_rake_factor", slider=True) | |||||
| # auto_smooth_factor and use_inverse_smooth_pressure | |||||
| if capabilities.has_auto_smooth: | |||||
| row = col.row(align=True) | |||||
| row.prop(brush, "auto_smooth_factor", slider=True) | |||||
| row.prop(brush, "use_inverse_smooth_pressure", toggle=True, text="") | |||||
| # normal_weight | |||||
| if capabilities.has_normal_weight: | |||||
| row = col.row(align=True) | |||||
| row.prop(brush, "normal_weight", slider=True) | |||||
| # crease_pinch_factor | |||||
| if capabilities.has_pinch_factor: | |||||
| row = col.row(align=True) | |||||
| if (brush.sculpt_tool in ('BLOB', 'SNAKE_HOOK')): | |||||
| row.prop(brush, "crease_pinch_factor", slider=True, text="Magnify") | |||||
| else: | |||||
| row.prop(brush, "crease_pinch_factor", slider=True, text="Pinch") | |||||
| # rake_factor | |||||
| if capabilities.has_rake_factor: | |||||
| row = col.row(align=True) | |||||
| row.prop(brush, "rake_factor", slider=True) | |||||
| if brush.sculpt_tool == 'MASK': | |||||
| col.prop(brush, "mask_tool") | |||||
| # plane_offset, use_offset_pressure, use_plane_trim, plane_trim | |||||
| if capabilities.has_plane_offset: | |||||
| row = col.row(align=True) | |||||
| row.prop(brush, "plane_offset", slider=True) | |||||
| row.prop(brush, "use_offset_pressure", text="") | |||||
| col.separator() | |||||
| row = col.row() | |||||
| row.prop(brush, "use_plane_trim", text="Plane Trim") | |||||
| row = col.row() | |||||
| row.active = brush.use_plane_trim | |||||
| row.prop(brush, "plane_trim", slider=True, text="Distance") | |||||
| # height | |||||
| if capabilities.has_height: | |||||
| row = col.row() | |||||
| row.prop(brush, "height", slider=True, text="Height") | |||||
| # use_persistent, set_persistent_base | |||||
| if capabilities.has_persistence: | |||||
| ob = context.sculpt_object | |||||
| do_persistent = True | |||||
| # not supported yet for this case | |||||
| for md in ob.modifiers: | |||||
| if md.type == 'MULTIRES': | |||||
| do_persistent = False | |||||
| break | |||||
| if do_persistent: | |||||
| col.prop(brush, "use_persistent") | |||||
| col.operator("sculpt.set_persistent_base") | |||||
| # Texture Paint Mode # | |||||
| elif context.image_paint_object and brush: | |||||
| brush_texpaint_common(self, context, layout, brush, settings, True) | |||||
| # Weight Paint Mode # | |||||
| elif context.weight_paint_object and brush: | |||||
| from bl_ui.properties_paint_common import ( | |||||
| brush_basic_wpaint_settings, | |||||
| ) | |||||
| col = layout.column() | |||||
| if not self.is_popover: | |||||
| brush_basic_wpaint_settings(col, context, brush) | |||||
| # Vertex Paint Mode # | |||||
| elif context.vertex_paint_object and brush: | |||||
| from bl_ui.properties_paint_common import ( | |||||
| brush_basic_vpaint_settings, | |||||
| ) | |||||
| col = layout.column() | |||||
| if not self.is_popover: | |||||
| brush_basic_vpaint_settings(col, context, brush) | |||||
| class VIEW3D_PT_tools_brush_color(Panel, View3DPaintPanel): | |||||
| bl_context = ".paint_common" # dot on purpose (access from topbar) | |||||
| bl_parent_id = "VIEW3D_PT_tools_brush" | |||||
| bl_label = "Color Picker" | |||||
| @classmethod | |||||
| def poll(cls, context): | |||||
| settings = cls.paint_settings(context) | |||||
| brush = settings.brush | |||||
| if context.image_paint_object: | |||||
| capabilities = brush.image_paint_capabilities | |||||
| return capabilities.has_color | |||||
| elif context.vertex_paint_object: | |||||
| capabilities = brush.vertex_paint_capabilities | |||||
| return capabilities.has_color | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| settings = self.paint_settings(context) | |||||
| brush = settings.brush | brush = settings.brush | ||||
| if context.vertex_paint_object: | draw_all_brush_settings(layout, context, brush, context.object.mode, popover=self.is_popover) | ||||
| brush_texpaint_common_color(self, context, layout, brush, settings, True) | |||||
| else: | |||||
| layout.prop(brush, "color_type", expand=True) | |||||
| if brush.color_type == 'COLOR': | |||||
| brush_texpaint_common_color(self, context, layout, brush, settings, True) | |||||
| elif brush.color_type == 'GRADIENT': | |||||
| brush_texpaint_common_gradient(self, context, layout, brush, settings, True) | |||||
| class VIEW3D_PT_tools_brush_swatches(Panel, View3DPaintPanel): | class VIEW3D_PT_tools_brush_swatches(Panel, View3DPaintPanel): | ||||
| bl_context = ".paint_common" # dot on purpose (access from topbar) | bl_context = ".paint_common" # dot on purpose (access from topbar) | ||||
| Context not available. | |||||
| brush_texpaint_common_clone(self, context, layout, brush, settings, True) | brush_texpaint_common_clone(self, context, layout, brush, settings, True) | ||||
| class VIEW3D_PT_tools_brush_options(Panel, View3DPaintPanel): | |||||
| bl_context = ".paint_common" # dot on purpose (access from topbar) | |||||
| bl_parent_id = "VIEW3D_PT_tools_brush" | |||||
| bl_label = "Options" | |||||
| bl_options = {'DEFAULT_CLOSED'} | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| tool_settings = context.tool_settings | |||||
| settings = self.paint_settings(context) | |||||
| brush = settings.brush | |||||
| capabilities = brush.sculpt_capabilities | |||||
| layout.use_property_split = True | |||||
| layout.use_property_decorate = False # No animation. | |||||
| col = layout.column() | |||||
| if context.image_paint_object and brush: | |||||
| brush_texpaint_common_options(self, context, layout, brush, settings, True) | |||||
| elif context.sculpt_object and brush: | |||||
| col.prop(brush, "use_automasking_topology") | |||||
| if capabilities.has_accumulate: | |||||
| col.prop(brush, "use_accumulate") | |||||
| UnifiedPaintPanel.prop_unified_size(col, context, brush, "use_locked_size") | |||||
| if capabilities.has_sculpt_plane: | |||||
| col.prop(brush, "sculpt_plane") | |||||
| col.prop(brush, "use_original_normal") | |||||
| col.prop(brush, "use_original_plane") | |||||
| col.prop(brush, "use_frontface", text="Front Faces Only") | |||||
| col.prop(brush, "use_projected") | |||||
| elif context.weight_paint_object and brush: | |||||
| if brush.weight_tool != 'SMEAR': | |||||
| col.prop(brush, "use_accumulate") | |||||
| col.prop(brush, "use_frontface", text="Front Faces Only") | |||||
| col.prop(brush, "use_projected") | |||||
| col.prop(tool_settings, "use_auto_normalize", text="Auto Normalize") | |||||
| col.prop(tool_settings, "use_multipaint", text="Multi-Paint") | |||||
| elif context.vertex_paint_object and brush: | |||||
| if brush.vertex_tool != 'SMEAR': | |||||
| col.prop(brush, "use_accumulate") | |||||
| col.prop(brush, "use_alpha") | |||||
| col.prop(brush, "use_frontface", text="Front Faces Only") | |||||
| col.prop(brush, "use_projected") | |||||
| class TEXTURE_UL_texpaintslots(UIList): | class TEXTURE_UL_texpaintslots(UIList): | ||||
| def draw_item(self, _context, layout, _data, item, icon, _active_data, _active_propname, _index): | def draw_item(self, _context, layout, _data, item, icon, _active_data, _active_propname, _index): | ||||
| # mat = data | # mat = data | ||||
| Context not available. | |||||
| col.operator("object.voxel_remesh", text="Remesh") | col.operator("object.voxel_remesh", text="Remesh") | ||||
| # TODO, move to space_view3d.py | # TODO, move to space_view3d.py | ||||
| class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel): | class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel): | ||||
| bl_context = ".sculpt_mode" # dot on purpose (access from topbar) | bl_context = ".sculpt_mode" # dot on purpose (access from topbar) | ||||
| bl_label = "Options" | bl_label = "Options" | ||||
| Context not available. | |||||
| col = flow.column() | col = flow.column() | ||||
| col.prop(sculpt, "use_deform_only") | col.prop(sculpt, "use_deform_only") | ||||
| class VIEW3D_PT_sculpt_options_unified(Panel, View3DPaintPanel): | |||||
| bl_context = ".sculpt_mode" # dot on purpose (access from topbar) | |||||
| bl_parent_id = "VIEW3D_PT_sculpt_options" | |||||
| bl_label = "Unified Brush" | |||||
| @classmethod | |||||
| def poll(cls, context): | |||||
| return (context.sculpt_object and context.tool_settings.sculpt) | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| layout.use_property_split = True | |||||
| layout.use_property_decorate = False | |||||
| self.unified_paint_settings(layout, context) | |||||
| class VIEW3D_PT_sculpt_options_gravity(Panel, View3DPaintPanel): | class VIEW3D_PT_sculpt_options_gravity(Panel, View3DPaintPanel): | ||||
| bl_context = ".sculpt_mode" # dot on purpose (access from topbar) | bl_context = ".sculpt_mode" # dot on purpose (access from topbar) | ||||
| bl_parent_id = "VIEW3D_PT_sculpt_options" | bl_parent_id = "VIEW3D_PT_sculpt_options" | ||||
| Context not available. | |||||
| wpaint = tool_settings.weight_paint | wpaint = tool_settings.weight_paint | ||||
| col = layout.column() | col = layout.column() | ||||
| col.prop(tool_settings, "use_auto_normalize", text="Auto Normalize") | |||||
| col.prop(tool_settings, "use_multipaint", text="Multi-Paint") | |||||
| col.prop(wpaint, "use_group_restrict") | col.prop(wpaint, "use_group_restrict") | ||||
| obj = context.weight_paint_object | obj = context.weight_paint_object | ||||
| Context not available. | |||||
| row.prop(mesh, "use_mirror_topology") | row.prop(mesh, "use_mirror_topology") | ||||
| class VIEW3D_PT_tools_weightpaint_options_unified(Panel, View3DPaintPanel): | |||||
| bl_context = ".weightpaint" | |||||
| bl_label = "Unified Brush" | |||||
| bl_parent_id = "VIEW3D_PT_tools_weightpaint_options" | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| layout.use_property_split = True | |||||
| layout.use_property_decorate = False | |||||
| self.unified_paint_settings(layout, context) | |||||
| # ********** default tools for vertex-paint **************** | # ********** default tools for vertex-paint **************** | ||||
| Context not available. | |||||
| bl_label = "Options" | bl_label = "Options" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| @classmethod | |||||
| def poll(self, context): | |||||
| # This is currently unused, since there aren't any Vertex Paint mode specific options. | |||||
| return False | |||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.label(text="Unified Brush") | |||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| layout.use_property_decorate = False | layout.use_property_decorate = False | ||||
| self.unified_paint_settings(layout, context) | |||||
| # TODO, move to space_view3d.py | # TODO, move to space_view3d.py | ||||
| class VIEW3D_PT_tools_vertexpaint_symmetry(Panel, View3DPaintPanel): | class VIEW3D_PT_tools_vertexpaint_symmetry(Panel, View3DPaintPanel): | ||||
| Context not available. | |||||
| col = flow.column() | col = flow.column() | ||||
| col.prop(ipaint, "use_backface_culling", text="Backface Culling") | col.prop(ipaint, "use_backface_culling", text="Backface Culling") | ||||
| class VIEW3D_PT_tools_imagepaint_options_unified(Panel, View3DPaintPanel): | |||||
| bl_context = ".imagepaint" # dot on purpose (access from topbar) | |||||
| bl_parent_id = "VIEW3D_PT_tools_imagepaint_options" | |||||
| bl_label = "Unified Brush" | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| layout.use_property_split = True | |||||
| layout.use_property_decorate = False | |||||
| self.unified_paint_settings(layout, context) | |||||
| class VIEW3D_PT_tools_imagepaint_options_cavity(View3DPaintPanel, Panel): | class VIEW3D_PT_tools_imagepaint_options_cavity(View3DPaintPanel, Panel): | ||||
| bl_context = ".imagepaint" # dot on purpose (access from topbar) | bl_context = ".imagepaint" # dot on purpose (access from topbar) | ||||
| bl_label = "Cavity Mask" | bl_label = "Cavity Mask" | ||||
| Context not available. | |||||
| layout.template_curve_mapping(ipaint, "cavity_curve", brush=True, | layout.template_curve_mapping(ipaint, "cavity_curve", brush=True, | ||||
| use_negative_slope=True) | use_negative_slope=True) | ||||
| # TODO, move to space_view3d.py | |||||
| class VIEW3D_PT_imagepaint_options(View3DPaintPanel): | |||||
| bl_label = "Options" | |||||
| @classmethod | |||||
| def poll(cls, context): | |||||
| return (context.image_paint_object and context.tool_settings.image_paint) | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| col = layout.column() | |||||
| self.unified_paint_settings(col, context) | |||||
| class VIEW3D_MT_tools_projectpaint_stencil(Menu): | class VIEW3D_MT_tools_projectpaint_stencil(Menu): | ||||
| bl_label = "Mask Layer" | bl_label = "Mask Layer" | ||||
| Context not available. | |||||
| class VIEW3D_PT_tools_grease_pencil_brush(View3DPanel, Panel): | class VIEW3D_PT_tools_grease_pencil_brush(View3DPanel, Panel): | ||||
| bl_context = ".greasepencil_paint" | bl_context = ".greasepencil_paint" | ||||
| bl_label = "Brush" | bl_label = "GP PAINT Brush" | ||||
| bl_category = "Tool" | bl_category = "Tool" | ||||
| @classmethod | @classmethod | ||||
| Context not available. | |||||
| row.prop(gp_settings, "use_material_pin", text="") | row.prop(gp_settings, "use_material_pin", text="") | ||||
| if not self.is_popover: | if not self.is_popover: | ||||
| from bl_ui.properties_paint_common import ( | |||||
| brush_basic_gpencil_paint_settings, | |||||
| ) | |||||
| brush_basic_gpencil_paint_settings(layout, context, brush, compact=True) | brush_basic_gpencil_paint_settings(layout, context, brush, compact=True) | ||||
Done Inline Actionstabs on empty lines are bad! ;) Lots of those here, to be fixed. mont29: tabs on empty lines are bad! ;)
Lots of those here, to be fixed. | |||||
| Context not available. | |||||
| col = layout.column() | col = layout.column() | ||||
| if not self.is_popover: | if not self.is_popover: | ||||
| from bl_ui.properties_paint_common import ( | |||||
| brush_basic_gpencil_weight_settings, | |||||
| ) | |||||
| brush_basic_gpencil_weight_settings(col, context, brush) | brush_basic_gpencil_weight_settings(col, context, brush) | ||||
| Context not available. | |||||
| VIEW3D_PT_tools_posemode_options, | VIEW3D_PT_tools_posemode_options, | ||||
| VIEW3D_PT_slots_projectpaint, | VIEW3D_PT_slots_projectpaint, | ||||
| VIEW3D_PT_tools_brush, | VIEW3D_PT_tools_brush, | ||||
| VIEW3D_PT_tools_brush_color, | |||||
| VIEW3D_PT_tools_brush_swatches, | VIEW3D_PT_tools_brush_swatches, | ||||
| VIEW3D_PT_tools_brush_clone, | VIEW3D_PT_tools_brush_clone, | ||||
| VIEW3D_PT_tools_brush_options, | |||||
| TEXTURE_UL_texpaintslots, | TEXTURE_UL_texpaintslots, | ||||
| VIEW3D_MT_tools_projectpaint_uvlayer, | VIEW3D_MT_tools_projectpaint_uvlayer, | ||||
| VIEW3D_PT_stencil_projectpaint, | VIEW3D_PT_stencil_projectpaint, | ||||
| Context not available. | |||||
| VIEW3D_PT_sculpt_symmetry, | VIEW3D_PT_sculpt_symmetry, | ||||
| VIEW3D_PT_sculpt_symmetry_for_topbar, | VIEW3D_PT_sculpt_symmetry_for_topbar, | ||||
| VIEW3D_PT_sculpt_options, | VIEW3D_PT_sculpt_options, | ||||
| VIEW3D_PT_sculpt_options_unified, | |||||
| VIEW3D_PT_sculpt_options_gravity, | VIEW3D_PT_sculpt_options_gravity, | ||||
| VIEW3D_PT_tools_weightpaint_symmetry, | VIEW3D_PT_tools_weightpaint_symmetry, | ||||
| VIEW3D_PT_tools_weightpaint_symmetry_for_topbar, | VIEW3D_PT_tools_weightpaint_symmetry_for_topbar, | ||||
| VIEW3D_PT_tools_weightpaint_options, | VIEW3D_PT_tools_weightpaint_options, | ||||
| VIEW3D_PT_tools_weightpaint_options_unified, | |||||
| VIEW3D_PT_tools_vertexpaint_symmetry, | VIEW3D_PT_tools_vertexpaint_symmetry, | ||||
| VIEW3D_PT_tools_vertexpaint_symmetry_for_topbar, | VIEW3D_PT_tools_vertexpaint_symmetry_for_topbar, | ||||
| VIEW3D_PT_tools_vertexpaint_options, | VIEW3D_PT_tools_vertexpaint_options, | ||||
| VIEW3D_PT_tools_imagepaint_symmetry, | VIEW3D_PT_tools_imagepaint_symmetry, | ||||
| VIEW3D_PT_tools_imagepaint_options, | VIEW3D_PT_tools_imagepaint_options, | ||||
| VIEW3D_PT_tools_imagepaint_options_cavity, | VIEW3D_PT_tools_imagepaint_options_cavity, | ||||
| VIEW3D_PT_tools_imagepaint_options_unified, | |||||
| VIEW3D_PT_tools_imagepaint_options_external, | VIEW3D_PT_tools_imagepaint_options_external, | ||||
| VIEW3D_MT_tools_projectpaint_stencil, | VIEW3D_MT_tools_projectpaint_stencil, | ||||
| VIEW3D_PT_tools_particlemode, | VIEW3D_PT_tools_particlemode, | ||||
| Context not available. | |||||
This property is missing in the patch