Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
| Show First 20 Lines • Show All 158 Lines • ▼ Show 20 Lines | def draw_settings_common(context, layout, tool): | ||||
| if len(text) > maxw: | if len(text) > maxw: | ||||
| text = text[:maxw - 5] + '..' + text[-3:] | text = text[:maxw - 5] + '..' + text[-3:] | ||||
| else: | else: | ||||
| text = "" | text = "" | ||||
| gpl = context.active_annotation_layer | gpl = context.active_annotation_layer | ||||
| if gpl is not None: | if gpl is not None: | ||||
| layout.label(text="Annotation:") | layout.label(text="Annotation:") | ||||
| if context.space_data.type == 'VIEW_3D': | if context.space_data.type in ('VIEW_3D', 'SEQUENCE_EDITOR'): | ||||
| if region_type == 'TOOL_HEADER': | if region_type == 'TOOL_HEADER': | ||||
| sub = layout.split(align=True, factor=0.5) | sub = layout.split(align=True, factor=0.5) | ||||
| sub.ui_units_x = 6.5 | sub.ui_units_x = 6.5 | ||||
| sub.prop(gpl, "color", text="") | sub.prop(gpl, "color", text="") | ||||
| else: | else: | ||||
| sub = layout.row(align=True) | sub = layout.row(align=True) | ||||
| sub.prop(gpl, "color", text="") | sub.prop(gpl, "color", text="") | ||||
| sub.popover( | sub.popover( | ||||
| Show All 25 Lines | def draw_settings_common(context, layout, tool): | ||||
| 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" and region_type != 'TOOL_HEADER': | elif tool.idname == "builtin.annotate": | ||||
| layout.separator() | |||||
| props = tool.operator_properties("gpencil.annotate") | props = tool.operator_properties("gpencil.annotate") | ||||
| if region_type == 'TOOL_HEADER': | |||||
| row = layout.row() | |||||
| row.prop(props, "use_stabilizer", text="Stabilize Stroke") | |||||
| subrow = layout.row(align=False) | |||||
| subrow.active = props.use_stabilizer | |||||
| subrow.prop(props, "stabilizer_radius", text="Radius", slider=True) | |||||
| subrow.prop(props, "stabilizer_factor", text="Factor", slider=True) | |||||
| 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): | ||||
| return dict( | return dict( | ||||
| idname="builtin.annotate", | idname="builtin.annotate", | ||||
| label="Annotate", | label="Annotate", | ||||
| icon="ops.gpencil.draw", | icon="ops.gpencil.draw", | ||||
| cursor='PAINT_BRUSH', | cursor='PAINT_BRUSH', | ||||
| ▲ Show 20 Lines • Show All 2,817 Lines • Show Last 20 Lines | |||||