I’m investigating if it’s possible to trigger the execution of a script, function or method via the scriptJob -command when the user exits a particular tool (specified by me).
I know there’s the ToolChanged -event - but that isn’t exactly what I need. Also, I dislike many of the scriptJob events because of how general they are. It’s easy to get unwanted results when so many different things might trigger the scriptJob accidently.
[QUOTE=Nightshade;24051]Also, I dislike many of the scriptJob events because of how general they are. It’s easy to get unwanted results when so many different things might trigger the scriptJob accidently.[/QUOTE]
Because you want to very explicit, why don’t you just launch the command or script on tool exit, from whatever tool you are targeting?
[QUOTE=Sariel;24052]Because you want to very explicit, why don’t you just launch the command or script on tool exit, from whatever tool you are targeting?[/QUOTE]
That’s what I want to do.
But how do I do that upon exiting say, the artistan brush context/tool?
have you tried the afterStrokeCommand -asc flag on ArtPaintContext?
http://download.autodesk.com/us/maya/2010help/CommandsPython/show.html?artAttrCtx.html&cat=General
[QUOTE=Nightshade;24053]That’s what I want to do.
But how do I do that upon exiting say, the artistan brush context/tool?[/QUOTE]
Ah sorry, I misunderstood.
Theo is right in that there are usually callbacks for you to hack into, but you might also consider the -tfp command for the artisan brush.
Accepts a strings describing the name of a MEL procedure which is invoked whenever the tool is turned off. For example, cloth invokes “clothPaintToolOff” when the cloth paint tool is turned on. Define this callback if your tool requires special functionality when your tool is deactivated. It is typical that if you implement a toolOffProc you will want to implement a toolOnProc as well (see the -toolOnProc flag. In query mode, the name of the currently registered MEL command is returned and this will be an empty string if none is defined.
[QUOTE=Sariel;24059]Ah sorry, I misunderstood.
Theo is right in that there are usually callbacks for you to hack into, but you might also consider the -tfp command for the artisan brush.
Accepts a strings describing the name of a MEL procedure which is invoked whenever the tool is turned off. For example, cloth invokes “clothPaintToolOff” when the cloth paint tool is turned on. Define this callback if your tool requires special functionality when your tool is deactivated. It is typical that if you implement a toolOffProc you will want to implement a toolOnProc as well (see the -toolOnProc flag. In query mode, the name of the currently registered MEL command is returned and this will be an empty string if none is defined.[/QUOTE]
Alright thanks for your answers.