Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_grease_pencil_common.py
| Show All 38 Lines | def gpencil_stroke_placement_settings(context, layout): | ||||
| if context.space_data.type != 'VIEW_3D': | if context.space_data.type != 'VIEW_3D': | ||||
| col.label(text="Stroke Placement:") | col.label(text="Stroke Placement:") | ||||
| row = col.row(align=True) | row = col.row(align=True) | ||||
| row.prop_enum(tool_settings, propname, 'VIEW') | row.prop_enum(tool_settings, propname, 'VIEW') | ||||
| row.prop_enum(tool_settings, propname, 'CURSOR', text="Cursor") | row.prop_enum(tool_settings, propname, 'CURSOR', text="Cursor") | ||||
| def gpencil_active_brush_settings_simple(context, layout): | |||||
| tool_settings = context.tool_settings | |||||
| brush = tool_settings.gpencil_paint.brush | |||||
| if brush is None: | |||||
| layout.label(text="No Active Brush") | |||||
| return | |||||
| col = layout.column() | |||||
| col.label(text="Active Brush: ") | |||||
| row = col.row(align=True) | |||||
| row.operator_context = 'EXEC_REGION_WIN' | |||||
| row.operator_menu_enum("gpencil.brush_change", "brush", text="", icon='BRUSH_DATA') | |||||
| row.prop(brush, "name", text="") | |||||
| col.prop(brush, "size", slider=True) | |||||
| row = col.row(align=True) | |||||
| row.prop(brush, "use_random_pressure", text="", icon='RNDCURVE') | |||||
| row.prop(brush, "pen_sensitivity_factor", slider=True) | |||||
| row.prop(brush, "use_pressure", text="", icon='STYLUS_PRESSURE') | |||||
| row = col.row(align=True) | |||||
| row.prop(brush, "use_random_strength", text="", icon='RNDCURVE') | |||||
| row.prop(brush, "strength", slider=True) | |||||
| row.prop(brush, "use_strength_pressure", text="", icon='STYLUS_PRESSURE') | |||||
| row = col.row(align=True) | |||||
| row.prop(brush, "jitter", slider=True) | |||||
| row.prop(brush, "use_jitter_pressure", text="", icon='STYLUS_PRESSURE') | |||||
| row = col.row() | |||||
| row.prop(brush, "angle", slider=True) | |||||
| row.prop(brush, "angle_factor", text="Factor", slider=True) | |||||
| # XXX: To be replaced with active tools | # XXX: To be replaced with active tools | ||||
| class AnnotationDrawingToolsPanel: | class AnnotationDrawingToolsPanel: | ||||
| # subclass must set | # subclass must set | ||||
| # bl_space_type = 'IMAGE_EDITOR' | # bl_space_type = 'IMAGE_EDITOR' | ||||
| bl_label = "Annotation" | bl_label = "Annotation" | ||||
| bl_category = "Annotation" | bl_category = "Annotation" | ||||
| bl_region_type = 'TOOLS' | bl_region_type = 'TOOLS' | ||||
| ▲ Show 20 Lines • Show All 485 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| # - After Frames | # - After Frames | ||||
| sub = split.column(align=True) | sub = split.column(align=True) | ||||
| row = sub.row(align=True) | row = sub.row(align=True) | ||||
| row.prop(gpl, "annotation_onion_after_color", text="") | row.prop(gpl, "annotation_onion_after_color", text="") | ||||
| sub.prop(gpl, "annotation_onion_after_range", text="After") | sub.prop(gpl, "annotation_onion_after_range", text="After") | ||||
| class GreasePencilToolsPanel: | |||||
| # For use in "2D" Editors without their own toolbar | |||||
| # subclass must set | |||||
| # bl_space_type = 'IMAGE_EDITOR' | |||||
| bl_label = "Grease Pencil Settings" | |||||
| bl_region_type = 'UI' | |||||
| bl_options = {'DEFAULT_CLOSED'} | |||||
| @classmethod | |||||
| def poll(cls, _context): | |||||
| # XXX - disabled in 2.8 branch. | |||||
| # return (context.gpencil_data is not None) | |||||
| return False | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| gpencil_active_brush_settings_simple(context, layout) | |||||
| layout.separator() | |||||
| gpencil_stroke_placement_settings(context, layout) | |||||
| class GreasePencilMaterialsPanel: | class GreasePencilMaterialsPanel: | ||||
| # Mix-in, use for properties editor and top-bar. | # Mix-in, use for properties editor and top-bar. | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| show_full_ui = (self.bl_space_type == 'PROPERTIES') | show_full_ui = (self.bl_space_type == 'PROPERTIES') | ||||
| is_view3d = (self.bl_space_type == 'VIEW_3D') | is_view3d = (self.bl_space_type == 'VIEW_3D') | ||||
| tool_settings = context.scene.tool_settings | tool_settings = context.scene.tool_settings | ||||
| ▲ Show 20 Lines • Show All 367 Lines • Show Last 20 Lines | |||||