Activate Add-Point Tool from a script ( or known methods to start a tool)

21 views
Skip to first unread message

Сергей Прохорович

unread,
Nov 4, 2022, 2:14:36 PM11/4/22
to Softimage Mailing List
Hey! Hope this group is not completely dead :)
Anyone remember if it's possible to invoke a tool that can't be started with ToolName() command from a script?

By running
var toolname = ActiveToolName;
I got
// INFO : current tool: AddPointOnCurveTool
but it says "// ERROR : Object expected" when I try to run AddPointOnCurveToo()
For some tools it does work though, like BezierCurveTool() actually starts the tool.
Any thoughts?

Marco Wehe

unread,
Nov 5, 2022, 7:19:11 AM11/5/22
to Softimage Mailing List
Hi,

I haven't got xsi on me right now to test this. But usually this error means that you aren't supplying the right arguments.
Most functions (tools) require some input. i.e. Tool(object) - you have to make sure you give it the object, this might be the current selection or a name.

 In your case it needs valid curve object.

`SIAddPointOnCurve( InputObj, [InsertPosition], [X], [Y], [Z], [Local], [CurveType] );`

See the example in the SDK guide.

Hope that helps,
Marco

Сергей Прохорович

unread,
Nov 5, 2022, 7:31:34 AM11/5/22
to Softimage Mailing List
No, its a different command. `SIAddPointOnCurve adds points as a result of execution, while result of execution of AddPointOnCurveTool() should be an activated 'Add-Point' tool in viewport.
Anyway, I used content search inside dll files inside softimage folders looking for "AddPoint", "PointOnCurve" etc strings and found the correct name for the command. So there are three commands instead:
AddPointOnCurveToolByCVs, AddPointOnCurveToolByKnotPoints, AddPointOnCurveToolByBezierKnotPoints
which is kinda logical, since in UI also three commands available. And I tried some name combos before but turned out I was adding 'ByCVs'  in wrong place ( AddPointOnCurveByKnotsTool ) heh.
From now on searching inside dlls would be my last resort trick :)
Reply all
Reply to author
Forward
0 new messages