Or maybe i can somehow force run one of a CustomTool callbacks ? It would
be handy too.

2016-06-02 15:57 GMT+03:00 Andrew Prostrelov <prostre...@gmail.com>:

> Hi.
> I suppose this one is a simple question but so far i can't handle it:
> how should i exit from CustomTool registered by my XSI plugin ?
>
> I want exit from my tool after shortcut CTRL+Z was released.
> // So i register this shortcut ...
>     CustomTool_Activate(ToolContext& in_ctxt)
>     {
>         in_ctxt.RegisterShortcutKey( 0x5A, L"myKey", siCtrlMask /* ctrl
> */, true /*repeatable*/ );
>     }
>
> // ... and try to change tools (since in_ctxt.ExitTool() works only in
> Mouse and Menu callbacks) to exit from my tool
>     CStatus KeyUp( ToolContext& in_ctxt )
>     {
>         if((ULONG) in_ctxt.GetShortcutKey() == 0x5A)
>         {
>
> Application().ExecuteScriptCode(L"Application.ActivateSelectTool()",
> L"Python" );            // mimic exit from tool
>         }
>         return CStatus::OK;
>     }
>
> But this way XSI crashes when tools are changed. And i can't understand
> why.
> On other hand there are no problems if i switch to SelectTool in XSI (not
> inside plugin code).
> This tool is a dummy so, no additional pointers in user data etc that can
> crash it.
>
------
Softimage Mailing List.
To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com with 
"unsubscribe" in the subject, and reply to confirm.

Reply via email to