ToolSpec¶
Type
ToolSpec configures a viewport tool passed to plugin:Tool.
Id¶
Id is the tool identifier referenced in RibbonSpec.Items.
Label¶
Label is the button text.
Tooltip¶
Tooltip is the button hover text, or nil.
Icon¶
Icon is a button icon path inside the plugin folder, or nil.
Operator¶
Operator is the Id of the declared operator run on "confirm".
Keys¶
Keys lists up to 64 key names ("Escape", "Return", "Backspace", "Tab", "Space", "Delete", "A" to "Z", "0" to "9") sent to Modal instead of viewport shortcuts; "Escape" is always included.
Modal¶
Modal(ctx: PluginContext, event: PluginEvent) -> ("running" | "confirm" | "cancel" | "exit", ...any)
Modal handles PluginEvents as Modal(ctx, event) while the tool is active. When the tool activates, Studio calls Modal once with "Escape" so the tool can reset its Lua state and ignores that call's return values.
Return (state, overlay, status, extra):
state:"running"stays active,"confirm"runsOperator,"cancel"stays active and clears wheel capture, and"exit"returns to Select.overlay: OptionalOverlayItemlist drawn until the next return.status: Optional status bar string.extra: Parameter table forOperatorwhenstateis"confirm", ortrueto capture mouse wheel events whenstateis"running".