Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_view3d_toolbar.py
| Show All 13 Lines | |||||
| # along with this program; if not, write to the Free Software Foundation, | # along with this program; if not, write to the Free Software Foundation, | ||||
| # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
| # | # | ||||
| # ##### END GPL LICENSE BLOCK ##### | # ##### END GPL LICENSE BLOCK ##### | ||||
| # <pep8 compliant> | # <pep8 compliant> | ||||
| from bpy.types import Menu, Panel, UIList | from bpy.types import Menu, Panel, UIList | ||||
| from bl_ui.properties_grease_pencil_common import ( | from bl_ui.properties_grease_pencil_common import ( | ||||
| GreasePencilStrokeEditPanel, | |||||
| GreasePencilStrokeSculptPanel, | |||||
| GreasePencilSculptOptionsPanel, | GreasePencilSculptOptionsPanel, | ||||
| GreasePencilAppearancePanel, | GreasePencilDisplayPanel, | ||||
| ) | ) | ||||
| from bl_ui.properties_paint_common import ( | from bl_ui.properties_paint_common import ( | ||||
| UnifiedPaintPanel, | UnifiedPaintPanel, | ||||
| brush_mask_texture_settings, | BrushSelectPanel, | ||||
| brush_texpaint_common, | ClonePanel, | ||||
| brush_texpaint_common_color, | TextureMaskPanel, | ||||
| brush_texpaint_common_gradient, | ColorPalettePanel, | ||||
| brush_texpaint_common_clone, | StrokePanel, | ||||
| brush_texpaint_common_options, | SmoothStrokePanel, | ||||
| FalloffPanel, | |||||
| DisplayPanel, | |||||
| brush_texture_settings, | brush_texture_settings, | ||||
| brush_settings, | |||||
| brush_settings_advanced, | |||||
| draw_color_settings, | |||||
| ) | ) | ||||
| from bl_ui.utils import PresetPanel | from bl_ui.utils import PresetPanel | ||||
| class VIEW3D_MT_brush_context_menu(Menu): | class VIEW3D_MT_brush_context_menu(Menu): | ||||
| bl_label = "Material Specials" | bl_label = "Brush Specials" | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| settings = UnifiedPaintPanel.paint_settings(context) | settings = UnifiedPaintPanel.paint_settings(context) | ||||
| brush = getattr(settings, "brush", None) | brush = getattr(settings, "brush", None) | ||||
| # skip if no active brush | # skip if no active brush | ||||
| ▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | def draw_vpaint_symmetry(layout, vpaint): | ||||
| row.prop(vpaint, "use_symmetry_y", text="Y", toggle=True) | row.prop(vpaint, "use_symmetry_y", text="Y", toggle=True) | ||||
| row.prop(vpaint, "use_symmetry_z", text="Z", toggle=True) | row.prop(vpaint, "use_symmetry_z", text="Z", toggle=True) | ||||
| col = layout.column() | col = layout.column() | ||||
| col.use_property_split = True | col.use_property_split = True | ||||
| col.use_property_decorate = False | col.use_property_decorate = False | ||||
| col.prop(vpaint, "radial_symmetry", text="Radial") | col.prop(vpaint, "radial_symmetry", text="Radial") | ||||
| # Most of these panels should not be visible in GP edit modes | |||||
| # Most of these panels should not be visible in GP edit modes | |||||
| def is_not_gpencil_edit_mode(context): | def is_not_gpencil_edit_mode(context): | ||||
| is_gpmode = ( | is_gpmode = ( | ||||
| context.active_object and | context.active_object and | ||||
| context.active_object.mode in {'EDIT_GPENCIL', 'PAINT_GPENCIL', 'SCULPT_GPENCIL', 'WEIGHT_GPENCIL'} | context.active_object.mode in {'EDIT_GPENCIL', 'PAINT_GPENCIL', 'SCULPT_GPENCIL', 'WEIGHT_GPENCIL'} | ||||
| ) | ) | ||||
| return not is_gpmode | return not is_gpmode | ||||
| ▲ Show 20 Lines • Show All 189 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| col.active = pose.use_mirror_x | col.active = pose.use_mirror_x | ||||
| col.prop(pose, "use_mirror_relative") | col.prop(pose, "use_mirror_relative") | ||||
| layout.label(text="Affect Only") | layout.label(text="Affect Only") | ||||
| layout.prop(tool_settings, "use_transform_pivot_point_align", text="Locations") | layout.prop(tool_settings, "use_transform_pivot_point_align", text="Locations") | ||||
| # ********** default tools for paint modes **************** | # ********** default tools for paint modes **************** | ||||
| class TEXTURE_UL_texpaintslots(UIList): | |||||
| def draw_item(self, _context, layout, _data, item, icon, _active_data, _active_propname, _index): | |||||
| # mat = data | |||||
| class View3DPaintPanel(UnifiedPaintPanel): | if self.layout_type in {'DEFAULT', 'COMPACT'}: | ||||
| bl_space_type = 'VIEW_3D' | layout.prop(item, "name", text="", emboss=False, icon_value=icon) | ||||
| bl_region_type = 'UI' | elif self.layout_type == 'GRID': | ||||
| layout.alignment = 'CENTER' | |||||
| layout.label(text="") | |||||
| class View3DPaintPanel(View3DPanel, UnifiedPaintPanel): | |||||
| bl_category = "Tool" | bl_category = "Tool" | ||||
| class View3DPaintBrushPanel(View3DPaintPanel): | |||||
| @classmethod | |||||
| def poll(cls, context): | |||||
| mode = cls.get_brush_mode(context) | |||||
| return mode is not None | |||||
| 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 = "Particle Tool" | ||||
| bl_options = {'HIDE_HEADER'} | bl_options = {'HIDE_HEADER'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| settings = cls.paint_settings(context) | settings = context.tool_settings.particle_edit | ||||
| return (settings and settings.brush and context.particle_edit_object) | return (settings and settings.brush and context.particle_edit_object) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| settings = self.paint_settings(context) | settings = context.tool_settings.particle_edit | ||||
| brush = settings.brush | brush = settings.brush | ||||
| tool = settings.tool | tool = settings.tool | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| layout.use_property_decorate = False # No animation. | layout.use_property_decorate = False # No animation. | ||||
| if tool is not None: | if tool is not None: | ||||
| col = layout.column() | col = layout.column() | ||||
| Show All 16 Lines | def draw(self, context): | ||||
| elif tool == 'COMB': | elif tool == 'COMB': | ||||
| layout.prop(settings, "use_emitter_deflect", text="Deflect Emitter") | layout.prop(settings, "use_emitter_deflect", text="Deflect Emitter") | ||||
| col = layout.column() | col = layout.column() | ||||
| col.active = settings.use_emitter_deflect | col.active = settings.use_emitter_deflect | ||||
| col.prop(settings, "emitter_distance", text="Distance") | col.prop(settings, "emitter_distance", text="Distance") | ||||
| # TODO, move to space_view3d.py | # TODO, move to space_view3d.py | ||||
| class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel): | class VIEW3D_PT_tools_brush_select(Panel, View3DPaintBrushPanel, BrushSelectPanel): | ||||
| bl_context = ".paint_common" # dot on purpose (access from topbar) | bl_context = ".paint_common" | ||||
| bl_label = "Brush" | bl_label = "Brushes" | ||||
| @classmethod | |||||
| def poll(cls, context): | # TODO, move to space_view3d.py | ||||
| settings = cls.paint_settings(context) | class VIEW3D_PT_tools_brush_settings(Panel, View3DPaintBrushPanel): | ||||
| return (settings and | bl_context = ".paint_common" | ||||
| settings.brush and | bl_label = "Brush Settings" | ||||
| (context.sculpt_object or | |||||
| context.vertex_paint_object or | |||||
| context.weight_paint_object or | |||||
| context.image_paint_object)) | |||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| 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 = self.paint_settings(context) | ||||
| brush = settings.brush | brush = settings.brush | ||||
| if not self.is_popover: | brush_settings(layout.column(), context, brush, popover=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") | |||||
| elif brush.sculpt_tool == 'GRAB': | |||||
pablodp606: This property is missing in the patch | |||||
| 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: | class VIEW3D_PT_tools_brush_settings_advanced(Panel, View3DPaintBrushPanel): | ||||
| brush_texpaint_common(self, context, layout, brush, settings, projpaint=True) | bl_context = ".paint_common" | ||||
| bl_parent_id = "VIEW3D_PT_tools_brush_settings" | |||||
| # Weight Paint Mode # | bl_label = "Advanced" | ||||
| elif context.weight_paint_object and brush: | bl_options = {'DEFAULT_CLOSED'} | ||||
| from bl_ui.properties_paint_common import ( | |||||
| brush_basic_wpaint_settings, | |||||
| ) | |||||
| col = layout.column() | |||||
| if not self.is_popover: | def draw(self, context): | ||||
| brush_basic_wpaint_settings(col, context, brush) | layout = self.layout | ||||
| # Vertex Paint Mode # | layout.use_property_split = True | ||||
| elif context.vertex_paint_object and brush: | layout.use_property_decorate = False # No animation. | ||||
| from bl_ui.properties_paint_common import ( | |||||
| brush_basic_vpaint_settings, | |||||
| ) | |||||
| col = layout.column() | settings = UnifiedPaintPanel.paint_settings(context) | ||||
| brush = settings.brush | |||||
| if not self.is_popover: | brush_settings_advanced(layout.column(), context, brush, self.is_popover) | ||||
| brush_basic_vpaint_settings(col, context, brush) | |||||
| class VIEW3D_PT_tools_brush_color(Panel, View3DPaintPanel): | class VIEW3D_PT_tools_brush_color(Panel, View3DPaintPanel): | ||||
| bl_context = ".paint_common" # dot on purpose (access from topbar) | bl_context = ".paint_common" | ||||
| bl_parent_id = "VIEW3D_PT_tools_brush" | bl_parent_id = "VIEW3D_PT_tools_brush_settings" | ||||
| bl_label = "Color Picker" | bl_label = "Color Picker" | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| settings = cls.paint_settings(context) | settings = cls.paint_settings(context) | ||||
| brush = settings.brush | brush = settings.brush | ||||
| if context.image_paint_object: | if context.image_paint_object: | ||||
| capabilities = brush.image_paint_capabilities | capabilities = brush.image_paint_capabilities | ||||
| return capabilities.has_color | return capabilities.has_color | ||||
| elif context.vertex_paint_object: | elif context.vertex_paint_object: | ||||
| capabilities = brush.vertex_paint_capabilities | capabilities = brush.vertex_paint_capabilities | ||||
| return capabilities.has_color | return capabilities.has_color | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| settings = self.paint_settings(context) | settings = self.paint_settings(context) | ||||
| brush = settings.brush | brush = settings.brush | ||||
| if context.vertex_paint_object: | draw_color_settings(context, layout, brush, color_type = not context.vertex_paint_object) | ||||
| brush_texpaint_common_color(self, context, layout, brush, settings, projpaint=True) | |||||
| else: | |||||
| layout.prop(brush, "color_type", expand=True) | |||||
| if brush.color_type == 'COLOR': | |||||
| brush_texpaint_common_color(self, context, layout, brush, settings, projpaint=True) | |||||
| elif brush.color_type == 'GRADIENT': | |||||
| brush_texpaint_common_gradient(self, context, layout, brush, settings, projpaint=True) | |||||
| class VIEW3D_PT_tools_brush_swatches(Panel, View3DPaintPanel): | class VIEW3D_PT_tools_brush_swatches(Panel, View3DPaintPanel, ColorPalettePanel): | ||||
| bl_context = ".paint_common" # dot on purpose (access from topbar) | bl_context = ".paint_common" | ||||
| bl_parent_id = "VIEW3D_PT_tools_brush" | bl_parent_id = "VIEW3D_PT_tools_brush_settings" | ||||
| bl_label = "Color Palette" | bl_label = "Color Palette" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| @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) | |||||
| layout.template_ID(settings, "palette", new="palette.new") | |||||
| if settings.palette: | |||||
| layout.template_palette(settings, "palette", color=True) | |||||
| class VIEW3D_PT_tools_brush_clone(Panel, View3DPaintPanel, ClonePanel): | |||||
| class VIEW3D_PT_tools_brush_clone(Panel, View3DPaintPanel): | bl_context = ".paint_common" | ||||
| bl_context = ".paint_common" # dot on purpose (access from topbar) | bl_parent_id = "VIEW3D_PT_tools_brush_settings" | ||||
| bl_parent_id = "VIEW3D_PT_tools_brush" | |||||
| bl_label = "Clone from Paint Slot" | bl_label = "Clone from Paint Slot" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| @classmethod | |||||
| def poll(cls, context): | |||||
| settings = cls.paint_settings(context) | |||||
| brush = settings.brush | |||||
| return brush.image_tool == 'CLONE' | |||||
| def draw_header(self, context): | |||||
| settings = self.paint_settings(context) | |||||
| self.layout.prop(settings, "use_clone_layer", text="") | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| settings = self.paint_settings(context) | |||||
| brush = settings.brush | |||||
| layout.active = settings.use_clone_layer | |||||
| brush_texpaint_common_clone(self, context, layout, brush, settings, projpaint=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, projpaint=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): | |||||
| def draw_item(self, _context, layout, _data, item, icon, _active_data, _active_propname, _index): | |||||
| # mat = data | |||||
| if self.layout_type in {'DEFAULT', 'COMPACT'}: | |||||
| layout.prop(item, "name", text="", emboss=False, icon_value=icon) | |||||
| elif self.layout_type == 'GRID': | |||||
| layout.alignment = 'CENTER' | |||||
| layout.label(text="") | |||||
| class VIEW3D_MT_tools_projectpaint_uvlayer(Menu): | class VIEW3D_MT_tools_projectpaint_uvlayer(Menu): | ||||
| bl_label = "Clone Layer" | bl_label = "Clone Layer" | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| for i, uv_layer in enumerate(context.active_object.data.uv_layers): | for i, uv_layer in enumerate(context.active_object.data.uv_layers): | ||||
| ▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| layout.separator() | layout.separator() | ||||
| split = layout.split() | split = layout.split() | ||||
| split.label(text="UV Map Needed", icon='INFO') | split.label(text="UV Map Needed", icon='INFO') | ||||
| split.operator("paint.add_simple_uvs", icon='ADD', text="Add Simple UVs") | split.operator("paint.add_simple_uvs", icon='ADD', text="Add Simple UVs") | ||||
| elif have_image: | elif have_image: | ||||
| layout.separator() | layout.separator() | ||||
| layout.operator("image.save_all_modified", text="Save All Images", icon='FILE_TICK') | layout.operator("image.save_all_modified", text="Save All Images", icon='FILE_TICK') | ||||
| # TODO, move to space_view3d.py | |||||
| # TODO, move to space_view3d.py | |||||
| class VIEW3D_PT_stencil_projectpaint(View3DPanel, Panel): | class VIEW3D_PT_stencil_projectpaint(View3DPanel, Panel): | ||||
| bl_category = "Tool" | bl_category = "Tool" | ||||
| bl_context = ".imagepaint" # dot on purpose (access from topbar) | bl_context = ".imagepaint" # dot on purpose (access from topbar) | ||||
| bl_label = "Mask" | bl_label = "Mask" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| bl_ui_units_x = 14 | bl_ui_units_x = 14 | ||||
| @classmethod | @classmethod | ||||
| Show All 35 Lines | def draw(self, context): | ||||
| col.separator() | col.separator() | ||||
| row = col.row(align=True) | row = col.row(align=True) | ||||
| row.prop(ipaint, "stencil_color", text="Display Color") | row.prop(ipaint, "stencil_color", text="Display Color") | ||||
| row.prop(ipaint, "invert_stencil", text="", icon='IMAGE_ALPHA') | row.prop(ipaint, "invert_stencil", text="", icon='IMAGE_ALPHA') | ||||
| # TODO, move to space_view3d.py | # TODO, move to space_view3d.py | ||||
| class VIEW3D_PT_tools_brush_display(Panel, View3DPaintPanel): | class VIEW3D_PT_tools_brush_display(Panel, View3DPaintBrushPanel, DisplayPanel): | ||||
| bl_context = ".paint_common" # dot on purpose (access from topbar) | bl_context = ".paint_common" | ||||
| bl_label = "Display" | bl_parent_id = "VIEW3D_PT_tools_brush_settings" | ||||
| bl_label = "Brush Tip" | |||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| @classmethod | |||||
| def poll(cls, context): | |||||
| settings = cls.paint_settings(context) | |||||
| return (settings and | |||||
| settings.brush and | |||||
| (context.sculpt_object or | |||||
| context.vertex_paint_object or | |||||
| context.weight_paint_object or | |||||
| context.image_paint_object)) | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| layout.use_property_split = True | |||||
| layout.use_property_decorate = False | |||||
| settings = self.paint_settings(context) | |||||
| brush = settings.brush | |||||
| tex_slot = brush.texture_slot | |||||
| tex_slot_mask = brush.mask_texture_slot | |||||
| col = layout.column() | |||||
| row = col.row(align=True) | |||||
| sub = row.row(align=True) | |||||
| sub.prop(brush, "cursor_overlay_alpha", text="Curve Alpha") | |||||
| sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA') | |||||
| row.prop( | |||||
| brush, "use_cursor_overlay", text="", toggle=True, | |||||
| icon='HIDE_OFF' if brush.use_cursor_overlay else 'HIDE_ON', | |||||
| ) | |||||
| col.active = brush.brush_capabilities.has_overlay | |||||
| if context.image_paint_object or context.sculpt_object or context.vertex_paint_object: | |||||
| row = col.row(align=True) | |||||
| sub = row.row(align=True) | |||||
| sub.prop(brush, "texture_overlay_alpha", text="Texture Alpha") | |||||
| sub.prop(brush, "use_primary_overlay_override", toggle=True, text="", icon='BRUSH_DATA') | |||||
| if tex_slot.map_mode != 'STENCIL': | |||||
| row.prop( | |||||
| brush, "use_primary_overlay", text="", toggle=True, | |||||
| icon='HIDE_OFF' if brush.use_primary_overlay else 'HIDE_ON', | |||||
| ) | |||||
| if context.image_paint_object: | |||||
| row = col.row(align=True) | |||||
| sub = row.row(align=True) | |||||
| sub.prop(brush, "mask_overlay_alpha", text="Mask Texture Alpha") | |||||
| sub.prop(brush, "use_secondary_overlay_override", toggle=True, text="", icon='BRUSH_DATA') | |||||
| if tex_slot_mask.map_mode != 'STENCIL': | |||||
| row.prop( | |||||
| brush, "use_secondary_overlay", text="", toggle=True, | |||||
| icon='HIDE_OFF' if brush.use_secondary_overlay else 'HIDE_ON', | |||||
| ) | |||||
| # TODO, move to space_view3d.py | # TODO, move to space_view3d.py | ||||
| class VIEW3D_PT_tools_brush_texture(Panel, View3DPaintPanel): | class VIEW3D_PT_tools_brush_texture(Panel, View3DPaintPanel): | ||||
| bl_context = ".paint_common" # dot on purpose (access from topbar) | bl_context = ".paint_common" | ||||
| bl_parent_id = "VIEW3D_PT_tools_brush_settings" | |||||
| bl_label = "Texture" | bl_label = "Texture" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| settings = cls.paint_settings(context) | settings = cls.paint_settings(context) | ||||
| return (settings and settings.brush and | return (settings and settings.brush and | ||||
| (context.sculpt_object or context.image_paint_object or context.vertex_paint_object)) | (context.sculpt_object or context.image_paint_object or context.vertex_paint_object)) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| settings = self.paint_settings(context) | settings = self.paint_settings(context) | ||||
| brush = settings.brush | brush = settings.brush | ||||
| col = layout.column() | col = layout.column() | ||||
| col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8) | col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8) | ||||
| brush_texture_settings(col, brush, context.sculpt_object) | brush_texture_settings(col, brush, context.sculpt_object) | ||||
| # TODO, move to space_view3d.py | # TODO, move to space_view3d.py | ||||
| class VIEW3D_PT_tools_mask_texture(Panel, View3DPaintPanel): | class VIEW3D_PT_tools_mask_texture(Panel, View3DPaintPanel, TextureMaskPanel): | ||||
| bl_category = "Tool" | bl_category = "Tool" | ||||
| bl_context = ".imagepaint" # dot on purpose (access from topbar) | bl_context = ".imagepaint" # dot on purpose (access from topbar) | ||||
| bl_parent_id = "VIEW3D_PT_tools_brush_settings" | |||||
| bl_label = "Texture Mask" | bl_label = "Texture Mask" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| settings = cls.paint_settings(context) | settings = cls.paint_settings(context) | ||||
| return (settings and settings.brush and context.image_paint_object) | return (settings and settings.brush and context.image_paint_object) | ||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| brush = context.tool_settings.image_paint.brush | |||||
| col = layout.column() | |||||
| col.template_ID_preview(brush, "mask_texture", new="texture.new", rows=3, cols=8) | |||||
| brush_mask_texture_settings(col, brush) | |||||
| # TODO, move to space_view3d.py | # TODO, move to space_view3d.py | ||||
| class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel): | class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintBrushPanel, StrokePanel): | ||||
| bl_context = ".paint_common" # dot on purpose (access from topbar) | bl_context = ".paint_common" | ||||
| bl_parent_id = "VIEW3D_PT_tools_brush_settings" | |||||
| bl_label = "Stroke" | bl_label = "Stroke" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| @classmethod | |||||
| def poll(cls, context): | |||||
| settings = cls.paint_settings(context) | |||||
| return (settings and | |||||
| settings.brush and | |||||
| (context.sculpt_object or | |||||
| context.vertex_paint_object or | |||||
| context.weight_paint_object or | |||||
| context.image_paint_object)) | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| settings = self.paint_settings(context) | |||||
| brush = settings.brush | |||||
| layout.use_property_split = True | |||||
| layout.use_property_decorate = False | |||||
| col = layout.column() | |||||
| col.prop(brush, "stroke_method") | |||||
| if brush.use_anchor: | |||||
| col.prop(brush, "use_edge_to_edge", text="Edge To Edge") | |||||
| if brush.use_airbrush: | |||||
| col.prop(brush, "rate", text="Rate", slider=True) | |||||
| if brush.use_space: | |||||
| row = col.row(align=True) | |||||
| row.prop(brush, "spacing", text="Spacing") | |||||
| row.prop(brush, "use_pressure_spacing", toggle=True, text="") | |||||
| if brush.use_line or brush.use_curve: | |||||
| row = col.row(align=True) | |||||
| row.prop(brush, "spacing", text="Spacing") | |||||
| if brush.use_curve: | |||||
| col.template_ID(brush, "paint_curve", new="paintcurve.new") | |||||
| col.operator("paintcurve.draw") | |||||
| if context.sculpt_object: | |||||
| if brush.sculpt_capabilities.has_space_attenuation: | class VIEW3D_PT_tools_brush_stroke_smooth_stroke(Panel, View3DPaintPanel, SmoothStrokePanel): | ||||
| col.prop(brush, "use_space_attenuation") | bl_context = ".paint_common" | ||||
| bl_label = "Stabilize Stroke" | |||||
| col.prop(brush, "use_scene_spacing") | |||||
| if brush.sculpt_capabilities.has_jitter: | |||||
| row = col.row(align=True) | |||||
| if brush.use_relative_jitter: | |||||
| row.prop(brush, "jitter", slider=True) | |||||
| else: | |||||
| row.prop(brush, "jitter_absolute") | |||||
| row.prop(brush, "use_relative_jitter", icon_only=True) | |||||
| row.prop(brush, "use_pressure_jitter", toggle=True, text="") | |||||
| else: | |||||
| row = col.row(align=True) | |||||
| if brush.use_relative_jitter: | |||||
| row.prop(brush, "jitter", slider=True) | |||||
| else: | |||||
| row.prop(brush, "jitter_absolute") | |||||
| row.prop(brush, "use_relative_jitter", icon_only=True) | |||||
| row.prop(brush, "use_pressure_jitter", toggle=True, text="") | |||||
| col.prop(settings, "input_samples") | |||||
| class VIEW3D_PT_tools_brush_stroke_smooth_stroke(Panel, View3DPaintPanel): | |||||
| bl_context = ".paint_common" # dot on purpose (access from topbar) | |||||
| bl_label = "Smooth Stroke" | |||||
| bl_parent_id = "VIEW3D_PT_tools_brush_stroke" | bl_parent_id = "VIEW3D_PT_tools_brush_stroke" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| @classmethod | |||||
| def poll(cls, context): | |||||
| settings = cls.paint_settings(context) | |||||
| brush = settings.brush | |||||
| if brush.brush_capabilities.has_smooth_stroke: | |||||
| return True | |||||
| def draw_header(self, context): | |||||
| settings = self.paint_settings(context) | |||||
| brush = settings.brush | |||||
| self.layout.prop(brush, "use_smooth_stroke", text="") | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| layout.use_property_split = True | |||||
| layout.use_property_decorate = False | |||||
| settings = self.paint_settings(context) | |||||
| brush = settings.brush | |||||
| col = layout.column() | |||||
| col.active = brush.use_smooth_stroke | |||||
| col.prop(brush, "smooth_stroke_radius", text="Radius", slider=True) | |||||
| col.prop(brush, "smooth_stroke_factor", text="Factor", slider=True) | |||||
| # TODO, move to space_view3d.py | # TODO, move to space_view3d.py | ||||
| class VIEW3D_PT_tools_brush_falloff(Panel, View3DPaintPanel): | class VIEW3D_PT_tools_brush_falloff(Panel, View3DPaintPanel, FalloffPanel): | ||||
| bl_context = ".paint_common" # dot on purpose (access from topbar) | bl_context = ".paint_common" | ||||
| bl_parent_id = "VIEW3D_PT_tools_brush_settings" | |||||
| bl_label = "Falloff" | bl_label = "Falloff" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| @classmethod | |||||
| def poll(cls, context): | |||||
| settings = cls.paint_settings(context) | |||||
| return (settings and settings.brush and settings.brush.curve) | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| settings = self.paint_settings(context) | |||||
| brush = settings.brush | |||||
| col = layout.column(align=True) | |||||
| row = col.row(align=True) | |||||
| row.prop(brush, "curve_preset", text="") | |||||
| if brush.curve_preset == 'CUSTOM': | |||||
| layout.template_curve_mapping(brush, "curve", brush=True) | |||||
| col = layout.column(align=True) | |||||
| row = col.row(align=True) | |||||
| row.operator("brush.curve_preset", icon='SMOOTHCURVE', text="").shape = 'SMOOTH' | |||||
| row.operator("brush.curve_preset", icon='SPHERECURVE', text="").shape = 'ROUND' | |||||
| row.operator("brush.curve_preset", icon='ROOTCURVE', text="").shape = 'ROOT' | |||||
| row.operator("brush.curve_preset", icon='SHARPCURVE', text="").shape = 'SHARP' | |||||
| row.operator("brush.curve_preset", icon='LINCURVE', text="").shape = 'LINE' | |||||
| row.operator("brush.curve_preset", icon='NOCURVE', text="").shape = 'MAX' | |||||
| class VIEW3D_PT_tools_brush_falloff_frontface(View3DPaintPanel, Panel): | class VIEW3D_PT_tools_brush_falloff_frontface(View3DPaintPanel, Panel): | ||||
| bl_context = ".imagepaint" # dot on purpose (access from topbar) | bl_context = ".imagepaint" # dot on purpose (access from topbar) | ||||
| bl_label = "Frontface Falloff" | bl_label = "Frontface Falloff" | ||||
| bl_parent_id = "VIEW3D_PT_tools_brush_falloff" | bl_parent_id = "VIEW3D_PT_tools_brush_falloff" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| @classmethod | @classmethod | ||||
| ▲ Show 20 Lines • Show All 150 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| col.prop(mesh, "remesh_voxel_adaptivity") | col.prop(mesh, "remesh_voxel_adaptivity") | ||||
| col.prop(mesh, "use_remesh_fix_poles") | col.prop(mesh, "use_remesh_fix_poles") | ||||
| col.prop(mesh, "use_remesh_smooth_normals") | col.prop(mesh, "use_remesh_smooth_normals") | ||||
| col.prop(mesh, "use_remesh_preserve_volume") | col.prop(mesh, "use_remesh_preserve_volume") | ||||
| col.prop(mesh, "use_remesh_preserve_paint_mask") | col.prop(mesh, "use_remesh_preserve_paint_mask") | ||||
| 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" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| return (context.sculpt_object and context.tool_settings.sculpt) | return (context.sculpt_object and context.tool_settings.sculpt) | ||||
| Show All 10 Lines | def draw(self, context): | ||||
| col = flow.column() | col = flow.column() | ||||
| col.prop(sculpt, "use_threaded", text="Threaded Sculpt") | col.prop(sculpt, "use_threaded", text="Threaded Sculpt") | ||||
| col = flow.column() | col = flow.column() | ||||
| col.prop(sculpt, "show_low_resolution") | col.prop(sculpt, "show_low_resolution") | ||||
| 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" | ||||
| bl_label = "Gravity" | bl_label = "Gravity" | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| return (context.sculpt_object and context.tool_settings.sculpt) | return (context.sculpt_object and context.tool_settings.sculpt) | ||||
| ▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | |||||
| class VIEW3D_PT_sculpt_symmetry_for_topbar(Panel): | class VIEW3D_PT_sculpt_symmetry_for_topbar(Panel): | ||||
| bl_space_type = 'TOPBAR' | bl_space_type = 'TOPBAR' | ||||
| bl_region_type = 'HEADER' | bl_region_type = 'HEADER' | ||||
| bl_label = "Symmetry" | bl_label = "Symmetry" | ||||
| draw = VIEW3D_PT_sculpt_symmetry.draw | draw = VIEW3D_PT_sculpt_symmetry.draw | ||||
| class VIEW3D_PT_tools_brush_display_show_brush(Panel, View3DPaintPanel): | |||||
| bl_context = ".paint_common" # dot on purpose (access from topbar) | |||||
| bl_label = "Show Brush" | |||||
| bl_parent_id = "VIEW3D_PT_tools_brush_display" | |||||
| bl_options = {'DEFAULT_CLOSED'} | |||||
| def draw_header(self, context): | |||||
| settings = self.paint_settings(context) | |||||
| self.layout.prop(settings, "show_brush", text="") | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| layout.use_property_split = True | |||||
| layout.use_property_decorate = False | |||||
| settings = self.paint_settings(context) | |||||
| brush = settings.brush | |||||
| col = layout.column() | |||||
| col.active = settings.show_brush | |||||
| if context.sculpt_object and context.tool_settings.sculpt: | |||||
| if brush.sculpt_capabilities.has_secondary_color: | |||||
| col.prop(brush, "cursor_color_add", text="Add") | |||||
| col.prop(brush, "cursor_color_subtract", text="Subtract") | |||||
| else: | |||||
| col.prop(brush, "cursor_color_add", text="Color") | |||||
| else: | |||||
| col.prop(brush, "cursor_color_add", text="Color") | |||||
| class VIEW3D_PT_tools_brush_display_custom_icon(Panel, View3DPaintPanel): | |||||
| bl_context = ".paint_common" # dot on purpose (access from topbar) | |||||
| bl_label = "Custom Icon" | |||||
| bl_parent_id = "VIEW3D_PT_tools_brush_display" | |||||
| bl_options = {'DEFAULT_CLOSED'} | |||||
| def draw_header(self, context): | |||||
| settings = self.paint_settings(context) | |||||
| brush = settings.brush | |||||
| self.layout.prop(brush, "use_custom_icon", text="") | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| layout.use_property_split = True | |||||
| layout.use_property_decorate = False | |||||
| settings = self.paint_settings(context) | |||||
| brush = settings.brush | |||||
| col = layout.column() | |||||
| col.active = brush.use_custom_icon | |||||
| col.prop(brush, "icon_filepath", text="") | |||||
| # ********** default tools for weight-paint **************** | # ********** default tools for weight-paint **************** | ||||
| # TODO, move to space_view3d.py | # TODO, move to space_view3d.py | ||||
| class VIEW3D_PT_tools_weightpaint_symmetry(Panel, View3DPaintPanel): | class VIEW3D_PT_tools_weightpaint_symmetry(Panel, View3DPaintPanel): | ||||
| bl_context = ".weightpaint" | bl_context = ".weightpaint" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| bl_label = "Symmetry" | bl_label = "Symmetry" | ||||
| Show All 29 Lines | def draw(self, context): | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| layout.use_property_decorate = False | layout.use_property_decorate = False | ||||
| tool_settings = context.tool_settings | tool_settings = context.tool_settings | ||||
| 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 | ||||
| if obj.type == 'MESH': | if obj.type == 'MESH': | ||||
| mesh = obj.data | mesh = obj.data | ||||
| col.prop(mesh, "use_mirror_x") | col.prop(mesh, "use_mirror_x") | ||||
| row = col.row() | row = col.row() | ||||
| row.active = mesh.use_mirror_x | row.active = mesh.use_mirror_x | ||||
| 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 **************** | ||||
| # TODO, move to space_view3d.py | # TODO, move to space_view3d.py | ||||
| class VIEW3D_PT_tools_vertexpaint_options(Panel, View3DPaintPanel): | class VIEW3D_PT_tools_vertexpaint_options(Panel, View3DPaintPanel): | ||||
| bl_context = ".vertexpaint" # dot on purpose (access from topbar) | bl_context = ".vertexpaint" # dot on purpose (access from topbar) | ||||
| 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): | ||||
| bl_context = ".vertexpaint" # dot on purpose (access from topbar) | bl_context = ".vertexpaint" # dot on purpose (access from topbar) | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| bl_label = "Symmetry" | bl_label = "Symmetry" | ||||
| @classmethod | @classmethod | ||||
| ▲ Show 20 Lines • Show All 105 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| col = flow.column() | col = flow.column() | ||||
| col.prop(ipaint, "use_occlude") | col.prop(ipaint, "use_occlude") | ||||
| 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" | ||||
| bl_parent_id = "VIEW3D_PT_tools_imagepaint_options" | bl_parent_id = "VIEW3D_PT_tools_imagepaint_options" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| tool_settings = context.tool_settings | tool_settings = context.tool_settings | ||||
| Show All 14 Lines | |||||
| # TODO, move to space_view3d.py | # TODO, move to space_view3d.py | ||||
| class VIEW3D_PT_imagepaint_options(View3DPaintPanel): | class VIEW3D_PT_imagepaint_options(View3DPaintPanel): | ||||
| bl_label = "Options" | bl_label = "Options" | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| # This is currently unused, since there aren't any Vertex Paint mode specific options. | |||||
| return False | |||||
| return (context.image_paint_object and context.tool_settings.image_paint) | return (context.image_paint_object and context.tool_settings.image_paint) | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | |||||
| col = layout.column() | layout.use_property_decorate = False | ||||
| 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" | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| for i, uv_layer in enumerate(context.active_object.data.uv_layers): | for i, uv_layer in enumerate(context.active_object.data.uv_layers): | ||||
| ▲ Show 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| sub.prop(pe, "fade_frames", slider=True) | sub.prop(pe, "fade_frames", slider=True) | ||||
| # ********** grease pencil object tool panels **************** | # ********** grease pencil object tool panels **************** | ||||
| # Grease Pencil drawing brushes | # Grease Pencil drawing brushes | ||||
| class VIEW3D_PT_tools_grease_pencil_brush(View3DPanel, Panel): | class GreasePencilPanel: | ||||
| bl_context = ".greasepencil_paint" | bl_context = ".greasepencil_paint" | ||||
| bl_label = "Brush" | |||||
| bl_category = "Tool" | bl_category = "Tool" | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| is_3d_view = context.space_data.type == 'VIEW_3D' | if context.space_data.type in ('VIEW_3D', 'PROPERTIES'): | ||||
| if is_3d_view: | |||||
| if context.gpencil_data is None: | if context.gpencil_data is None: | ||||
| return False | return False | ||||
| gpd = context.gpencil_data | gpd = context.gpencil_data | ||||
| return bool(gpd.is_stroke_paint_mode) | return bool(gpd.is_stroke_paint_mode) | ||||
| else: | else: | ||||
| return True | return True | ||||
| class VIEW3D_PT_tools_grease_pencil_brush_select(Panel, View3DPanel, GreasePencilPanel): | |||||
| bl_label = "Brushes" | |||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| layout.use_property_decorate = False | layout.use_property_decorate = False | ||||
| tool_settings = context.scene.tool_settings | tool_settings = context.scene.tool_settings | ||||
| gpencil_paint = tool_settings.gpencil_paint | gpencil_paint = tool_settings.gpencil_paint | ||||
| row = layout.row() | row = layout.row() | ||||
| col = row.column() | row.column().template_ID_preview(gpencil_paint, "brush", new="brush.add_gpencil", rows=3, cols=8) | ||||
| col.template_ID_preview(gpencil_paint, "brush", new="brush.add_gpencil", rows=3, cols=8) | |||||
| col = row.column() | col = row.column() | ||||
| brush = gpencil_paint.brush | col.operator("gpencil.brush_presets_create", icon='PRESET_NEW', text="") | ||||
| if context.mode == 'PAINT_GPENCIL': | |||||
| brush = tool_settings.gpencil_paint.brush | |||||
| gp_settings = brush.gpencil_settings | |||||
| col.prop(brush, "use_custom_icon", toggle=True, icon='FILE_IMAGE', text="") | |||||
| if(brush.use_custom_icon): | |||||
| layout.row().prop(brush, "icon_filepath", text="") | |||||
| else: | |||||
| layout.row().prop(gp_settings, "gp_icon", text="Icon") | |||||
| class VIEW3D_PT_tools_grease_pencil_brush_settings(Panel, View3DPanel, GreasePencilPanel): | |||||
| bl_label = "Brush Settings" | |||||
| # What is the point of brush presets? Seems to serve the exact same purpose as brushes themselves?? | |||||
| def draw_header_preset(self, _context): | |||||
| VIEW3D_PT_gpencil_brush_presets.draw_panel_header(self.layout) | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| layout.use_property_split = True | |||||
| layout.use_property_decorate = False | |||||
| sub = col.column(align=True) | tool_settings = context.scene.tool_settings | ||||
| sub.operator("gpencil.brush_presets_create", icon='PRESET_NEW', text="") | gpencil_paint = tool_settings.gpencil_paint | ||||
| brush = gpencil_paint.brush | |||||
| if brush is not None: | if brush is not None: | ||||
| gp_settings = brush.gpencil_settings | gp_settings = brush.gpencil_settings | ||||
| if brush.gpencil_tool in {'DRAW', 'FILL'}: | if brush.gpencil_tool in {'DRAW', 'FILL'}: | ||||
| row = layout.row(align=True) | row = layout.row(align=True) | ||||
| row_mat = row.row() | row_mat = row.row() | ||||
| if gp_settings.use_material_pin: | if gp_settings.use_material_pin: | ||||
| row_mat.template_ID(gp_settings, "material", live_icon=True) | row_mat.template_ID(gp_settings, "material", live_icon=True) | ||||
| else: | else: | ||||
| row_mat.template_ID(context.active_object, "active_material", live_icon=True) | row_mat.template_ID(context.active_object, "active_material", live_icon=True) | ||||
| row_mat.enabled = False # will otherwise allow to change material in active slot | row_mat.enabled = False # will otherwise allow to change material in active slot | ||||
| 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 ( | from bl_ui.properties_paint_common import ( | ||||
| brush_basic_gpencil_paint_settings, | brush_basic_gpencil_paint_settings, | ||||
| ) | ) | ||||
| tool = context.workspace.tools.from_space_view3d_mode(context.mode, create=False) | brush_basic_gpencil_paint_settings(layout, context, brush, compact=False) | ||||
| brush_basic_gpencil_paint_settings(layout, context, brush, tool, compact=True, is_toolbar=False) | |||||
| # Grease Pencil drawing brushes options | class VIEW3D_PT_tools_grease_pencil_brush_advanced(View3DPanel, Panel): | ||||
| class VIEW3D_PT_tools_grease_pencil_brush_option(View3DPanel, Panel): | |||||
| bl_context = ".greasepencil_paint" | bl_context = ".greasepencil_paint" | ||||
| bl_label = "Options" | bl_label = "Advanced" | ||||
| bl_parent_id = 'VIEW3D_PT_tools_grease_pencil_brush_settings' | |||||
| bl_category = "Tool" | bl_category = "Tool" | ||||
| bl_options = {'DEFAULT_CLOSED'} | |||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| brush = context.tool_settings.gpencil_paint.brush | brush = context.tool_settings.gpencil_paint.brush | ||||
| return brush is not None and brush.gpencil_tool not in {'ERASE', 'FILL'} | return brush is not None and brush.gpencil_tool != 'ERASE' | ||||
| def draw_header_preset(self, _context): | |||||
| VIEW3D_PT_gpencil_brush_presets.draw_panel_header(self.layout) | |||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| layout.use_property_decorate = False | layout.use_property_decorate = False | ||||
| brush = context.tool_settings.gpencil_paint.brush | tool_settings = context.scene.tool_settings | ||||
| gpencil_paint = tool_settings.gpencil_paint | |||||
| if brush is not None: | brush = gpencil_paint.brush | ||||
| gp_settings = brush.gpencil_settings | gp_settings = brush.gpencil_settings | ||||
| col = layout.column(align=True) | col = layout.column(align=True) | ||||
| if brush is not None: | |||||
| if brush.gpencil_tool != 'FILL': | |||||
| col.prop(gp_settings, "input_samples") | col.prop(gp_settings, "input_samples") | ||||
| col.separator() | col.separator() | ||||
| col.prop(gp_settings, "active_smooth_factor") | col.prop(gp_settings, "active_smooth_factor") | ||||
| col.separator() | col.separator() | ||||
| col.prop(gp_settings, "angle", slider=True) | col.prop(gp_settings, "angle", slider=True) | ||||
| col.prop(gp_settings, "angle_factor", text="Factor", slider=True) | col.prop(gp_settings, "angle_factor", text="Factor", slider=True) | ||||
| ob = context.object | ob = context.object | ||||
| ma = None | |||||
| if ob and brush.gpencil_settings.use_material_pin is False: | if ob and brush.gpencil_settings.use_material_pin is False: | ||||
| ma = ob.active_material | ma = ob.active_material | ||||
| elif brush.gpencil_settings.material: | elif brush.gpencil_settings.material: | ||||
| ma = brush.gpencil_settings.material | ma = brush.gpencil_settings.material | ||||
| else: | |||||
| ma = None | |||||
| col.separator() | col.separator() | ||||
| subcol = col.column(align=True) | subcol = col.column(align=True) | ||||
| if ma and ma.grease_pencil.mode == 'LINE': | if ma and ma.grease_pencil.mode == 'LINE': | ||||
| subcol.enabled = False | subcol.enabled = False | ||||
| subcol.prop(gp_settings, "gradient_factor", slider=True) | subcol.prop(gp_settings, "gradient_factor", slider=True) | ||||
| subcol.prop(gp_settings, "gradient_shape") | subcol.prop(gp_settings, "gradient_shape") | ||||
| elif brush.gpencil_tool == 'FILL': | |||||
| col.prop(gp_settings, "fill_factor", text="Resolution") | |||||
| if gp_settings.fill_draw_mode != 'STROKE': | |||||
| col.prop(gp_settings, "show_fill", text="Ignore Transparent Strokes") | |||||
| col.prop(gp_settings, "fill_threshold", text="Threshold") | |||||
| class VIEW3D_PT_tools_grease_pencil_brush_stabilizer(View3DPanel, Panel): | |||||
| class VIEW3D_PT_tools_grease_pencil_brush_stabilizer(Panel, View3DPanel): | |||||
| bl_context = ".greasepencil_paint" | bl_context = ".greasepencil_paint" | ||||
| bl_parent_id = 'VIEW3D_PT_tools_grease_pencil_brush_option' | bl_parent_id = 'VIEW3D_PT_tools_grease_pencil_brush_settings' | ||||
| bl_label = "Stabilize" | bl_label = "Stabilize Stroke" | ||||
| bl_category = "Tool" | bl_category = "Tool" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| brush = context.tool_settings.gpencil_paint.brush | brush = context.tool_settings.gpencil_paint.brush | ||||
| return brush is not None and brush.gpencil_tool == 'DRAW' | return brush is not None and brush.gpencil_tool == 'DRAW' | ||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| if self.is_popover: return | |||||
| brush = context.tool_settings.gpencil_paint.brush | brush = context.tool_settings.gpencil_paint.brush | ||||
| gp_settings = brush.gpencil_settings | gp_settings = brush.gpencil_settings | ||||
| self.layout.prop(gp_settings, "use_settings_stabilizer", text="") | self.layout.prop(gp_settings, "use_settings_stabilizer", text="") | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| layout.use_property_decorate = False | layout.use_property_decorate = False | ||||
| brush = context.tool_settings.gpencil_paint.brush | brush = context.tool_settings.gpencil_paint.brush | ||||
| gp_settings = brush.gpencil_settings | gp_settings = brush.gpencil_settings | ||||
| layout.active = gp_settings.use_settings_stabilizer | |||||
| layout.prop(brush, "smooth_stroke_radius", text="Radius", slider=True) | if self.is_popover: | ||||
| layout.prop(brush, "smooth_stroke_factor", text="Factor", slider=True) | row = layout.row() | ||||
| row.prop(gp_settings, "use_settings_stabilizer", text="") | |||||
| row.label(text=self.bl_label) | |||||
| col = layout.column() | |||||
| col.active = gp_settings.use_settings_stabilizer | |||||
| class VIEW3D_PT_tools_grease_pencil_brush_settings(View3DPanel, Panel): | col.prop(brush, "smooth_stroke_radius", text="Radius", slider=True) | ||||
| col.prop(brush, "smooth_stroke_factor", text="Factor", slider=True) | |||||
| class VIEW3D_PT_tools_grease_pencil_brush_post_processing(View3DPanel, Panel): | |||||
| bl_context = ".greasepencil_paint" | bl_context = ".greasepencil_paint" | ||||
| bl_parent_id = 'VIEW3D_PT_tools_grease_pencil_brush_option' | bl_parent_id = 'VIEW3D_PT_tools_grease_pencil_brush_settings' | ||||
| bl_label = "Post-Processing" | bl_label = "Post-Processing" | ||||
| bl_category = "Tool" | bl_category = "Tool" | ||||
| bl_options = {'DEFAULT_CLOSED'} | |||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| brush = context.tool_settings.gpencil_paint.brush | brush = context.tool_settings.gpencil_paint.brush | ||||
| return brush is not None and brush.gpencil_tool != 'ERASE' | return brush is not None and brush.gpencil_tool not in ('ERASE', 'FILL') | ||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| if self.is_popover: return | |||||
| brush = context.tool_settings.gpencil_paint.brush | brush = context.tool_settings.gpencil_paint.brush | ||||
| gp_settings = brush.gpencil_settings | gp_settings = brush.gpencil_settings | ||||
| self.layout.prop(gp_settings, "use_settings_postprocess", text="") | self.layout.prop(gp_settings, "use_settings_postprocess", text="") | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| layout.use_property_decorate = False | layout.use_property_decorate = False | ||||
| brush = context.tool_settings.gpencil_paint.brush | brush = context.tool_settings.gpencil_paint.brush | ||||
| gp_settings = brush.gpencil_settings | gp_settings = brush.gpencil_settings | ||||
| layout.active = gp_settings.use_settings_postprocess | |||||
| if self.is_popover: | |||||
| row = layout.row() | |||||
| row.prop(gp_settings, "use_settings_postprocess", text="") | |||||
| row.label(text=self.bl_label) | |||||
| col = layout.column(align=True) | col = layout.column(align=True) | ||||
| col.active = gp_settings.use_settings_postprocess | |||||
| col = col.column(align=True) | |||||
| col.prop(gp_settings, "pen_smooth_factor") | col.prop(gp_settings, "pen_smooth_factor") | ||||
| col.prop(gp_settings, "pen_smooth_steps") | col.prop(gp_settings, "pen_smooth_steps") | ||||
| col = layout.column(align=True) | col = col.column(align=True) | ||||
| col.prop(gp_settings, "pen_thick_smooth_factor") | col.prop(gp_settings, "pen_thick_smooth_factor") | ||||
| col.prop(gp_settings, "pen_thick_smooth_steps", text="Iterations") | col.prop(gp_settings, "pen_thick_smooth_steps", text="Iterations") | ||||
| col = layout.column(align=True) | col = col.column(align=True) | ||||
| col.prop(gp_settings, "pen_subdivision_steps") | col.prop(gp_settings, "pen_subdivision_steps") | ||||
| col.prop(gp_settings, "random_subdiv", text="Randomness", slider=True) | col.prop(gp_settings, "random_subdiv", text="Randomness", slider=True) | ||||
| col = layout.column(align=True) | col = col.column(align=True) | ||||
| col.prop(gp_settings, "simplify_factor") | col.prop(gp_settings, "simplify_factor") | ||||
| col = layout.column(align=True) | col = col.column(align=True) | ||||
| col.prop(gp_settings, "trim") | col.prop(gp_settings, "trim") | ||||
| class VIEW3D_PT_tools_grease_pencil_brush_random(View3DPanel, Panel): | class VIEW3D_PT_tools_grease_pencil_brush_random(View3DPanel, Panel): | ||||
| bl_context = ".greasepencil_paint" | bl_context = ".greasepencil_paint" | ||||
| bl_parent_id = 'VIEW3D_PT_tools_grease_pencil_brush_option' | bl_parent_id = 'VIEW3D_PT_tools_grease_pencil_brush_settings' | ||||
| bl_label = "Randomize" | bl_label = "Randomize" | ||||
| bl_category = "Tool" | bl_category = "Tool" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| brush = context.tool_settings.gpencil_paint.brush | brush = context.tool_settings.gpencil_paint.brush | ||||
| return brush is not None and brush.gpencil_tool != 'ERASE' | return brush is not None and brush.gpencil_tool not in ('ERASE', 'FILL') | ||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| if self.is_popover: return | |||||
| brush = context.tool_settings.gpencil_paint.brush | brush = context.tool_settings.gpencil_paint.brush | ||||
| gp_settings = brush.gpencil_settings | gp_settings = brush.gpencil_settings | ||||
| self.layout.prop(gp_settings, "use_settings_random", text="") | self.layout.prop(gp_settings, "use_settings_random", text="") | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| layout.use_property_decorate = False | layout.use_property_decorate = False | ||||
| brush = context.tool_settings.gpencil_paint.brush | brush = context.tool_settings.gpencil_paint.brush | ||||
| gp_settings = brush.gpencil_settings | gp_settings = brush.gpencil_settings | ||||
| layout.active = gp_settings.use_settings_random | |||||
| layout.prop(gp_settings, "random_pressure", text="Pressure", slider=True) | if self.is_popover: | ||||
| layout.prop(gp_settings, "random_strength", text="Strength", slider=True) | row = layout.row() | ||||
| layout.prop(gp_settings, "uv_random", text="UV", slider=True) | row.prop(gp_settings, "use_settings_random", text="") | ||||
| row.label(text=self.bl_label) | |||||
| row = layout.row(align=True) | col = layout.column() | ||||
| col.active = gp_settings.use_settings_random | |||||
| col.prop(gp_settings, "random_pressure", text="Pressure", slider=True) | |||||
| col.prop(gp_settings, "random_strength", text="Strength", slider=True) | |||||
| col.prop(gp_settings, "uv_random", text="UV", slider=True) | |||||
| row = col.row(align=True) | |||||
| row.prop(gp_settings, "pen_jitter", slider=True) | row.prop(gp_settings, "pen_jitter", slider=True) | ||||
| row.prop(gp_settings, "use_jitter_pressure", text="", icon='STYLUS_PRESSURE') | row.prop(gp_settings, "use_jitter_pressure", text="", icon='STYLUS_PRESSURE') | ||||
| # Grease Pencil drawingcurves | # Grease Pencil drawingcurves | ||||
| class VIEW3D_PT_tools_grease_pencil_brushcurves(View3DPanel, Panel): | class VIEW3D_PT_tools_grease_pencil_brushcurves(View3DPanel, Panel): | ||||
| bl_context = ".greasepencil_paint" | bl_context = ".greasepencil_paint" | ||||
| bl_parent_id = 'VIEW3D_PT_tools_grease_pencil_brush_settings' | |||||
| bl_label = "Curves" | bl_label = "Curves" | ||||
| bl_category = "Tool" | bl_category = "Tool" | ||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| brush = context.tool_settings.gpencil_paint.brush | brush = context.tool_settings.gpencil_paint.brush | ||||
| return brush is not None and brush.gpencil_tool not in {'ERASE', 'FILL'} | return brush is not None and brush.gpencil_tool not in {'ERASE', 'FILL'} | ||||
| ▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| brush = context.tool_settings.gpencil_paint.brush | brush = context.tool_settings.gpencil_paint.brush | ||||
| gp_settings = brush.gpencil_settings | gp_settings = brush.gpencil_settings | ||||
| layout.template_curve_mapping(gp_settings, "curve_jitter", brush=True, | layout.template_curve_mapping(gp_settings, "curve_jitter", brush=True, | ||||
| use_negative_slope=True) | use_negative_slope=True) | ||||
| # Grease Pencil stroke editing tools | |||||
| class VIEW3D_PT_tools_grease_pencil_edit(GreasePencilStrokeEditPanel, Panel): | |||||
| bl_space_type = 'VIEW_3D' | |||||
| bl_category = "Tool" | |||||
| # Grease Pencil stroke interpolation tools | # Grease Pencil stroke interpolation tools | ||||
| class VIEW3D_PT_tools_grease_pencil_interpolate(Panel): | class VIEW3D_PT_tools_grease_pencil_interpolate(Panel): | ||||
| bl_space_type = 'VIEW_3D' | bl_space_type = 'VIEW_3D' | ||||
| bl_region_type = 'HEADER' | bl_region_type = 'HEADER' | ||||
| bl_label = "Interpolate" | bl_label = "Interpolate" | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| Show All 32 Lines | def draw(self, context): | ||||
| layout.prop(settings, "back") | layout.prop(settings, "back") | ||||
| elif settings.type == 'ELASTIC': | elif settings.type == 'ELASTIC': | ||||
| sub = layout.column(align=True) | sub = layout.column(align=True) | ||||
| sub.prop(settings, "amplitude") | sub.prop(settings, "amplitude") | ||||
| sub.prop(settings, "period") | sub.prop(settings, "period") | ||||
| # Grease Pencil stroke sculpting tools | # Grease Pencil stroke sculpting tools | ||||
| class VIEW3D_PT_tools_grease_pencil_sculpt(GreasePencilStrokeSculptPanel, View3DPanel, Panel): | |||||
| class VIEW3D_PT_tools_grease_pencil_sculpt_select(Panel, View3DPanel): | |||||
| bl_context = ".greasepencil_sculpt" | bl_context = ".greasepencil_sculpt" | ||||
| bl_category = "Tools" | bl_label = "Brushes" | ||||
| bl_label = "Brush" | |||||
| bl_category = "Tool" | bl_category = "Tool" | ||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| layout.use_property_split = True | |||||
| layout.use_property_decorate = False | |||||
| settings = context.tool_settings.gpencil_sculpt | |||||
| brush = settings.brush | |||||
| layout.template_icon_view(settings, "sculpt_tool", show_labels=True) | |||||
| class VIEW3D_PT_tools_grease_pencil_sculpt_settings(Panel, View3DPanel): | |||||
| bl_context = ".greasepencil_sculpt" | |||||
| bl_category = "Tool" | |||||
| bl_label = "Brush Settings" | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| layout.use_property_split = True | |||||
| layout.use_property_decorate = False | |||||
| settings = context.tool_settings.gpencil_sculpt | |||||
| brush = settings.brush | |||||
| if not self.is_popover: | |||||
| from bl_ui.properties_paint_common import ( | |||||
| brush_basic_gpencil_sculpt_settings, | |||||
| ) | |||||
| brush_basic_gpencil_sculpt_settings(layout, context, brush) | |||||
| # Grease Pencil weight painting tools | # Grease Pencil weight painting tools | ||||
| class VIEW3D_PT_tools_grease_pencil_weight_paint(View3DPanel, Panel): | |||||
| class VIEW3D_PT_tools_grease_pencil_weight_paint_select(View3DPanel, Panel): | |||||
| bl_context = ".greasepencil_weight" | bl_context = ".greasepencil_weight" | ||||
| bl_category = "Tools" | bl_label = "Brushes" | ||||
| bl_label = "Brush" | |||||
| bl_category = "Tool" | bl_category = "Tool" | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| layout.use_property_decorate = False | layout.use_property_decorate = False | ||||
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. | |||||
| settings = context.tool_settings.gpencil_sculpt | settings = context.tool_settings.gpencil_sculpt | ||||
| brush = settings.brush | brush = settings.brush | ||||
| layout.template_icon_view(settings, "weight_tool", show_labels=True) | layout.template_icon_view(settings, "weight_tool", show_labels=True) | ||||
| col = layout.column() | |||||
| class VIEW3D_PT_tools_grease_pencil_weight_paint_settings(Panel, View3DPanel): | |||||
| bl_context = ".greasepencil_weight" | |||||
| bl_category = "Tool" | |||||
| bl_label = "Brush Settings" | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| layout.use_property_split = True | |||||
| layout.use_property_decorate = False | |||||
| settings = context.tool_settings.gpencil_sculpt | |||||
| brush = settings.brush | |||||
| if not self.is_popover: | if not self.is_popover: | ||||
| from bl_ui.properties_paint_common import ( | from bl_ui.properties_paint_common import ( | ||||
| brush_basic_gpencil_weight_settings, | brush_basic_gpencil_weight_settings, | ||||
| ) | ) | ||||
| brush_basic_gpencil_weight_settings(col, context, brush) | brush_basic_gpencil_weight_settings(layout, context, brush) | ||||
| # Grease Pencil Brush Appearance (one for each mode) | class VIEW3D_PT_tools_grease_pencil_sculpt_options(GreasePencilSculptOptionsPanel, Panel, View3DPanel): | ||||
| class VIEW3D_PT_tools_grease_pencil_paint_appearance(GreasePencilAppearancePanel, View3DPanel, Panel): | bl_context = ".greasepencil_sculpt" | ||||
| bl_context = ".greasepencil_paint" | bl_parent_id = 'VIEW3D_PT_tools_grease_pencil_sculpt_settings' | ||||
| bl_label = "Display" | |||||
| bl_category = "Tool" | bl_category = "Tool" | ||||
| bl_label = "Sculpt Strokes" | |||||
| class VIEW3D_PT_tools_grease_pencil_sculpt_appearance(GreasePencilAppearancePanel, View3DPanel, Panel): | # Grease Pencil Brush Appearance (one for each mode) | ||||
| bl_context = ".greasepencil_sculpt" | class VIEW3D_PT_tools_grease_pencil_paint_appearance(GreasePencilDisplayPanel, Panel, View3DPanel): | ||||
| bl_label = "Display" | bl_context = ".greasepencil_paint" | ||||
| bl_parent_id = 'VIEW3D_PT_tools_grease_pencil_brush_settings' | |||||
| bl_label = "Brush Tip" | |||||
| bl_category = "Tool" | bl_category = "Tool" | ||||
| class VIEW3D_PT_tools_grease_pencil_sculpt_options(GreasePencilSculptOptionsPanel, View3DPanel, Panel): | class VIEW3D_PT_tools_grease_pencil_sculpt_appearance(GreasePencilDisplayPanel, Panel, View3DPanel): | ||||
| bl_context = ".greasepencil_sculpt" | bl_context = ".greasepencil_sculpt" | ||||
| bl_label = "Sculpt Strokes" | bl_parent_id = 'VIEW3D_PT_tools_grease_pencil_sculpt_settings' | ||||
| bl_parent_id = 'VIEW3D_PT_tools_grease_pencil_sculpt' | bl_label = "Brush Tip" | ||||
| bl_category = "Tool" | bl_category = "Tool" | ||||
| class VIEW3D_PT_tools_grease_pencil_weight_appearance(GreasePencilAppearancePanel, View3DPanel, Panel): | class VIEW3D_PT_tools_grease_pencil_weight_appearance(GreasePencilDisplayPanel, Panel, View3DPanel): | ||||
| bl_context = ".greasepencil_weight" | bl_context = ".greasepencil_weight" | ||||
| bl_label = "Display" | bl_parent_id = 'VIEW3D_PT_tools_grease_pencil_weight_paint_settings' | ||||
| bl_category = "Tool" | bl_category = "Tool" | ||||
| bl_label = "Brush Tip" | |||||
| class VIEW3D_PT_gpencil_brush_presets(PresetPanel, Panel): | class VIEW3D_PT_gpencil_brush_presets(Panel, PresetPanel): | ||||
| """Brush settings""" | """Brush settings""" | ||||
| bl_label = "Brush Presets" | bl_label = "Brush Presets" | ||||
| preset_subdir = "gpencil_brush" | preset_subdir = "gpencil_brush" | ||||
| preset_operator = "script.execute_preset" | preset_operator = "script.execute_preset" | ||||
| preset_add_operator = "scene.gpencil_brush_preset_add" | preset_add_operator = "scene.gpencil_brush_preset_add" | ||||
| classes = ( | classes = ( | ||||
| VIEW3D_MT_brush_context_menu, | VIEW3D_MT_brush_context_menu, | ||||
| VIEW3D_MT_brush_context_menu_paint_modes, | VIEW3D_MT_brush_context_menu_paint_modes, | ||||
| VIEW3D_PT_tools_object_options, | VIEW3D_PT_tools_object_options, | ||||
| VIEW3D_PT_tools_object_options_transform, | VIEW3D_PT_tools_object_options_transform, | ||||
| VIEW3D_PT_tools_meshedit_options, | VIEW3D_PT_tools_meshedit_options, | ||||
| VIEW3D_PT_tools_meshedit_options_automerge, | VIEW3D_PT_tools_meshedit_options_automerge, | ||||
| VIEW3D_PT_tools_curveedit_options_stroke, | VIEW3D_PT_tools_curveedit_options_stroke, | ||||
| VIEW3D_PT_tools_armatureedit_options, | VIEW3D_PT_tools_armatureedit_options, | ||||
| 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_select, | ||||
| VIEW3D_PT_tools_brush_settings, | |||||
| VIEW3D_PT_tools_brush_color, | VIEW3D_PT_tools_brush_color, | ||||
| VIEW3D_PT_tools_brush_swatches, | VIEW3D_PT_tools_brush_swatches, | ||||
| VIEW3D_PT_tools_brush_settings_advanced, | |||||
| 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, | ||||
| VIEW3D_PT_tools_brush_texture, | VIEW3D_PT_tools_brush_texture, | ||||
| VIEW3D_PT_tools_mask_texture, | VIEW3D_PT_tools_mask_texture, | ||||
| VIEW3D_PT_tools_brush_stroke, | VIEW3D_PT_tools_brush_stroke, | ||||
| VIEW3D_PT_tools_brush_stroke_smooth_stroke, | VIEW3D_PT_tools_brush_stroke_smooth_stroke, | ||||
| VIEW3D_PT_tools_brush_falloff, | VIEW3D_PT_tools_brush_falloff, | ||||
| VIEW3D_PT_tools_brush_falloff_frontface, | VIEW3D_PT_tools_brush_falloff_frontface, | ||||
| VIEW3D_PT_tools_brush_falloff_normal, | VIEW3D_PT_tools_brush_falloff_normal, | ||||
| VIEW3D_PT_tools_brush_display, | VIEW3D_PT_tools_brush_display, | ||||
| VIEW3D_PT_tools_brush_display_show_brush, | |||||
| VIEW3D_PT_tools_brush_display_custom_icon, | |||||
| VIEW3D_PT_sculpt_dyntopo, | VIEW3D_PT_sculpt_dyntopo, | ||||
| VIEW3D_PT_sculpt_dyntopo_remesh, | VIEW3D_PT_sculpt_dyntopo_remesh, | ||||
| VIEW3D_PT_sculpt_voxel_remesh, | VIEW3D_PT_sculpt_voxel_remesh, | ||||
| 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, | ||||
| VIEW3D_PT_tools_particlemode_options, | VIEW3D_PT_tools_particlemode_options, | ||||
| VIEW3D_PT_tools_particlemode_options_shapecut, | VIEW3D_PT_tools_particlemode_options_shapecut, | ||||
| VIEW3D_PT_tools_particlemode_options_display, | VIEW3D_PT_tools_particlemode_options_display, | ||||
| VIEW3D_PT_gpencil_brush_presets, | VIEW3D_PT_gpencil_brush_presets, | ||||
| VIEW3D_PT_tools_grease_pencil_brush, | VIEW3D_PT_tools_grease_pencil_brush_select, | ||||
| VIEW3D_PT_tools_grease_pencil_brush_option, | |||||
| VIEW3D_PT_tools_grease_pencil_brush_settings, | VIEW3D_PT_tools_grease_pencil_brush_settings, | ||||
| VIEW3D_PT_tools_grease_pencil_brush_advanced, | |||||
| VIEW3D_PT_tools_grease_pencil_brush_post_processing, | |||||
| VIEW3D_PT_tools_grease_pencil_brush_stabilizer, | VIEW3D_PT_tools_grease_pencil_brush_stabilizer, | ||||
| VIEW3D_PT_tools_grease_pencil_brush_random, | VIEW3D_PT_tools_grease_pencil_brush_random, | ||||
| VIEW3D_PT_tools_grease_pencil_brushcurves, | VIEW3D_PT_tools_grease_pencil_brushcurves, | ||||
| VIEW3D_PT_tools_grease_pencil_brushcurves_sensitivity, | VIEW3D_PT_tools_grease_pencil_brushcurves_sensitivity, | ||||
| VIEW3D_PT_tools_grease_pencil_brushcurves_strength, | VIEW3D_PT_tools_grease_pencil_brushcurves_strength, | ||||
| VIEW3D_PT_tools_grease_pencil_brushcurves_jitter, | VIEW3D_PT_tools_grease_pencil_brushcurves_jitter, | ||||
| VIEW3D_PT_tools_grease_pencil_sculpt, | |||||
| VIEW3D_PT_tools_grease_pencil_weight_paint, | |||||
| VIEW3D_PT_tools_grease_pencil_paint_appearance, | VIEW3D_PT_tools_grease_pencil_paint_appearance, | ||||
| VIEW3D_PT_tools_grease_pencil_sculpt_select, | |||||
| VIEW3D_PT_tools_grease_pencil_sculpt_settings, | |||||
| VIEW3D_PT_tools_grease_pencil_sculpt_options, | VIEW3D_PT_tools_grease_pencil_sculpt_options, | ||||
| VIEW3D_PT_tools_grease_pencil_sculpt_appearance, | VIEW3D_PT_tools_grease_pencil_sculpt_appearance, | ||||
| VIEW3D_PT_tools_grease_pencil_weight_paint_select, | |||||
| VIEW3D_PT_tools_grease_pencil_weight_paint_settings, | |||||
| VIEW3D_PT_tools_grease_pencil_weight_appearance, | VIEW3D_PT_tools_grease_pencil_weight_appearance, | ||||
| VIEW3D_PT_tools_grease_pencil_interpolate, | VIEW3D_PT_tools_grease_pencil_interpolate, | ||||
| ) | ) | ||||
| if __name__ == "__main__": # only for live edit. | if __name__ == "__main__": # only for live edit. | ||||
| from bpy.utils import register_class | from bpy.utils import register_class | ||||
| for cls in classes: | for cls in classes: | ||||
| register_class(cls) | register_class(cls) | ||||
This property is missing in the patch