Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_view3d_toolbar.py
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| return context.active_object | return context.active_object | ||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| tool_settings = context.tool_settings | tool_settings = context.tool_settings | ||||
| self.layout.prop(tool_settings, "use_mesh_automerge", text="", toggle=False) | self.layout.prop(tool_settings, "use_mesh_automerge", | ||||
| text=self.bl_label if self.is_popover else "", toggle=False) | |||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| tool_settings = context.tool_settings | tool_settings = context.tool_settings | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| layout.use_property_decorate = False | layout.use_property_decorate = False | ||||
| ▲ Show 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | |||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| brush = context.tool_settings.image_paint.brush | brush = context.tool_settings.image_paint.brush | ||||
| ob = context.active_object | ob = context.active_object | ||||
| return (brush is not None and ob is not None) | return (brush is not None and ob is not None) | ||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| ipaint = context.tool_settings.image_paint | ipaint = context.tool_settings.image_paint | ||||
| self.layout.prop(ipaint, "use_stencil_layer", text="") | self.layout.prop(ipaint, "use_stencil_layer", text=self.bl_label if self.is_popover else "") | ||||
| 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.tool_settings | tool_settings = context.tool_settings | ||||
| ipaint = tool_settings.image_paint | ipaint = tool_settings.image_paint | ||||
| ▲ Show 20 Lines • Show All 122 Lines • ▼ Show 20 Lines | |||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| return (context.weight_paint_object or context.vertex_paint_object) | return (context.weight_paint_object or context.vertex_paint_object) | ||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| settings = self.paint_settings(context) | settings = self.paint_settings(context) | ||||
| brush = settings.brush | brush = settings.brush | ||||
| self.layout.prop(brush, "use_frontface_falloff", text="") | self.layout.prop(brush, "use_frontface_falloff", text=self.bl_label if self.is_popover else "") | ||||
| def draw(self, context): | def draw(self, context): | ||||
| settings = self.paint_settings(context) | settings = self.paint_settings(context) | ||||
| brush = settings.brush | brush = settings.brush | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| Show All 12 Lines | |||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| return context.image_paint_object | return context.image_paint_object | ||||
| def draw_header(self, context): | def draw_header(self, context): | ||||
| tool_settings = context.tool_settings | tool_settings = context.tool_settings | ||||
| ipaint = tool_settings.image_paint | ipaint = tool_settings.image_paint | ||||
| self.layout.prop(ipaint, "use_normal_falloff", text="") | self.layout.prop(ipaint, "use_normal_falloff", text=self.bl_label if self.is_popover else "") | ||||
| def draw(self, context): | def draw(self, context): | ||||
| tool_settings = context.tool_settings | tool_settings = context.tool_settings | ||||
| ipaint = tool_settings.image_paint | ipaint = tool_settings.image_paint | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| ▲ Show 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | |||||
| bl_label = "Cavity Mask" | bl_label = "Cavity Mask" | ||||
| bl_parent_id = "VIEW3D_PT_mask" | bl_parent_id = "VIEW3D_PT_mask" | ||||
| 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 | ||||
| ipaint = tool_settings.image_paint | ipaint = tool_settings.image_paint | ||||
| self.layout.prop(ipaint, "use_cavity", text="") | self.layout.prop(ipaint, "use_cavity", text=self.bl_label if self.is_popover else "") | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| tool_settings = context.tool_settings | tool_settings = context.tool_settings | ||||
| ipaint = tool_settings.image_paint | ipaint = tool_settings.image_paint | ||||
| layout.active = ipaint.use_cavity | layout.active = ipaint.use_cavity | ||||
| ▲ Show 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | |||||
| bl_ui_units_x = 12 | bl_ui_units_x = 12 | ||||
| @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(self, _context): | def draw(self, _context): | ||||
| # layout = self.layout | layout = self.layout | ||||
| pass | layout.use_property_split = True | ||||
| layout.use_property_decorate = False | |||||
| class VIEW3D_PT_tools_grease_pencil_brush_stabilizer(Panel, View3DPanel): | 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_stroke' | bl_parent_id = 'VIEW3D_PT_tools_grease_pencil_brush_stroke' | ||||
| bl_label = "Stabilize Stroke" | 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=self.bl_label if self.is_popover else "") | |||||
| 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 | ||||
| if self.is_popover: | |||||
| row = layout.row() | |||||
| row.prop(gp_settings, "use_settings_stabilizer", text="") | |||||
| row.label(text=self.bl_label) | |||||
| col = layout.column() | col = layout.column() | ||||
| col.active = gp_settings.use_settings_stabilizer | col.active = gp_settings.use_settings_stabilizer | ||||
| col.prop(brush, "smooth_stroke_radius", text="Radius", slider=True) | col.prop(brush, "smooth_stroke_radius", text="Radius", slider=True) | ||||
| col.prop(brush, "smooth_stroke_factor", text="Factor", slider=True) | col.prop(brush, "smooth_stroke_factor", text="Factor", slider=True) | ||||
| class VIEW3D_PT_tools_grease_pencil_brush_post_processing(View3DPanel, Panel): | 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_stroke' | bl_parent_id = 'VIEW3D_PT_tools_grease_pencil_brush_stroke' | ||||
| bl_label = "Post-Processing" | bl_label = "Post-Processing" | ||||
| 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', 'TINT'} | return brush is not None and brush.gpencil_tool not in {'ERASE', 'FILL', 'TINT'} | ||||
| 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=self.bl_label if self.is_popover else "") | |||||
| 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 | ||||
| if self.is_popover: | |||||
| row = layout.row() | |||||
| row.prop(gp_settings, "use_settings_postprocess", text="") | |||||
| row.label(text=self.bl_label) | |||||
| col = layout.column() | col = layout.column() | ||||
| col.active = gp_settings.use_settings_postprocess | col.active = gp_settings.use_settings_postprocess | ||||
| col1 = col.column(align=True) | col1 = col.column(align=True) | ||||
| col1.prop(gp_settings, "pen_smooth_factor") | col1.prop(gp_settings, "pen_smooth_factor") | ||||
| col1.prop(gp_settings, "pen_smooth_steps") | col1.prop(gp_settings, "pen_smooth_steps") | ||||
| col1 = col.column(align=True) | col1 = col.column(align=True) | ||||
| Show All 14 Lines | |||||
| 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', 'TINT'} | return brush is not None and brush.gpencil_tool not in {'ERASE', 'FILL', 'TINT'} | ||||
| 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=self.bl_label if self.is_popover else "") | ||||
| 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.tool_settings | tool_settings = context.tool_settings | ||||
| brush = tool_settings.gpencil_paint.brush | brush = tool_settings.gpencil_paint.brush | ||||
| mode = tool_settings.gpencil_paint.color_mode | mode = tool_settings.gpencil_paint.color_mode | ||||
| gp_settings = brush.gpencil_settings | gp_settings = brush.gpencil_settings | ||||
| if self.is_popover: | |||||
| row = layout.row() | |||||
| row.prop(gp_settings, "use_settings_random", text="") | |||||
| row.label(text=self.bl_label) | |||||
| col = layout.column() | col = layout.column() | ||||
| col.enabled = gp_settings.use_settings_random | col.enabled = gp_settings.use_settings_random | ||||
| row = col.row(align=True) | row = col.row(align=True) | ||||
| row.prop(gp_settings, "random_pressure", text="Radius", slider=True) | row.prop(gp_settings, "random_pressure", text="Radius", slider=True) | ||||
| row.prop(gp_settings, "use_stroke_random_radius", text="", icon='GP_SELECT_STROKES') | row.prop(gp_settings, "use_stroke_random_radius", text="", icon='GP_SELECT_STROKES') | ||||
| row.prop(gp_settings, "use_random_press_radius", text="", icon='STYLUS_PRESSURE') | row.prop(gp_settings, "use_random_press_radius", text="", icon='STYLUS_PRESSURE') | ||||
| if gp_settings.use_random_press_radius and self.is_popover is False: | if gp_settings.use_random_press_radius and self.is_popover is False: | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||