Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
| Show First 20 Lines • Show All 179 Lines • ▼ Show 20 Lines | def draw_settings_common(context, layout, tool): | ||||
| ) | ) | ||||
| else: | else: | ||||
| layout.prop(gpl, "color", text="") | layout.prop(gpl, "color", text="") | ||||
| space_type = tool.space_type | space_type = tool.space_type | ||||
| tool_settings = context.tool_settings | tool_settings = context.tool_settings | ||||
| if space_type == 'VIEW_3D': | if space_type == 'VIEW_3D': | ||||
| layout.separator() | |||||
| row = layout.row(align=True) | row = layout.row(align=True) | ||||
| row.prop(tool_settings, "annotation_stroke_placement_view3d", text="Placement") | row.prop(tool_settings, "annotation_stroke_placement_view3d", text="Placement") | ||||
| if tool_settings.gpencil_stroke_placement_view3d == 'CURSOR': | if tool_settings.gpencil_stroke_placement_view3d == 'CURSOR': | ||||
| row.prop(tool_settings.gpencil_sculpt, "lockaxis") | row.prop(tool_settings.gpencil_sculpt, "lockaxis") | ||||
| elif tool_settings.gpencil_stroke_placement_view3d in {'SURFACE', 'STROKE'}: | elif tool_settings.gpencil_stroke_placement_view3d in {'SURFACE', 'STROKE'}: | ||||
| row.prop(tool_settings, "use_gpencil_stroke_endpoints") | row.prop(tool_settings, "use_gpencil_stroke_endpoints") | ||||
| elif space_type in {'IMAGE_EDITOR', 'NODE_EDITOR', 'SEQUENCE_EDITOR', 'CLIP_EDITOR'}: | |||||
| layout.separator() | |||||
| elif space_type in {'IMAGE_EDITOR', 'NODE_EDITOR', 'SEQUENCE_EDITOR', 'CLIP_EDITOR'}: | |||||
| row = layout.row(align=True) | row = layout.row(align=True) | ||||
| row.prop(tool_settings, "annotation_stroke_placement_view2d", text="Placement") | row.prop(tool_settings, "annotation_stroke_placement_view2d", text="Placement") | ||||
| if tool.idname == "builtin.annotate_line": | if tool.idname == "builtin.annotate_line": | ||||
| layout.separator() | |||||
| props = tool.operator_properties("gpencil.annotate") | props = tool.operator_properties("gpencil.annotate") | ||||
| if region_type == 'TOOL_HEADER': | if region_type == 'TOOL_HEADER': | ||||
| row = layout.row() | row = layout.row() | ||||
| row.ui_units_x = 15 | row.ui_units_x = 15 | ||||
| row.prop(props, "arrowstyle_start", text="Start") | row.prop(props, "arrowstyle_start", text="Start") | ||||
| row.separator() | row.separator() | ||||
| row.prop(props, "arrowstyle_end", text="End") | row.prop(props, "arrowstyle_end", text="End") | ||||
| else: | else: | ||||
| col = layout.row().column(align=True) | col = layout.row().column(align=True) | ||||
| col.prop(props, "arrowstyle_start", text="Style Start") | col.prop(props, "arrowstyle_start", text="Style Start") | ||||
| col.prop(props, "arrowstyle_end", text="End") | col.prop(props, "arrowstyle_end", text="End") | ||||
| elif tool.idname == "builtin.annotate": | elif tool.idname == "builtin.annotate": | ||||
| props = tool.operator_properties("gpencil.annotate") | props = tool.operator_properties("gpencil.annotate") | ||||
| if region_type == 'TOOL_HEADER': | if region_type == 'TOOL_HEADER': | ||||
| row = layout.row() | row = layout.row() | ||||
| row.prop(props, "use_stabilizer", text="Stabilize Stroke") | row.prop(props, "use_stabilizer", text="Stabilize Stroke") | ||||
| subrow = layout.row(align=False) | subrow = layout.row(align=False) | ||||
| subrow.active = props.use_stabilizer | subrow.active = props.use_stabilizer | ||||
| subrow.prop(props, "stabilizer_radius", text="Radius", slider=True) | subrow.prop(props, "stabilizer_radius", text="Radius", slider=True) | ||||
| subrow.prop(props, "stabilizer_factor", text="Factor", slider=True) | subrow.prop(props, "stabilizer_factor", text="Factor", slider=True) | ||||
| else: | else: | ||||
| layout.separator() | |||||
| layout.prop(props, "use_stabilizer", text="Stabilize Stroke") | layout.prop(props, "use_stabilizer", text="Stabilize Stroke") | ||||
| col = layout.column(align=False) | col = layout.column(align=False) | ||||
| col.active = props.use_stabilizer | col.active = props.use_stabilizer | ||||
| col.prop(props, "stabilizer_radius", text="Radius", slider=True) | col.prop(props, "stabilizer_radius", text="Radius", slider=True) | ||||
| col.prop(props, "stabilizer_factor", text="Factor", slider=True) | col.prop(props, "stabilizer_factor", text="Factor", slider=True) | ||||
| @ToolDef.from_fn.with_args(draw_settings=draw_settings_common) | @ToolDef.from_fn.with_args(draw_settings=draw_settings_common) | ||||
| def scribble(*, draw_settings): | def scribble(*, draw_settings): | ||||
| ▲ Show 20 Lines • Show All 2,929 Lines • Show Last 20 Lines | |||||