global proc MyOptionVarCallback()
{
    int $val = `optionVar -q createPolyPrimitiveAsTool`;
    print ("Create polys with tool: " + $val + "\n");
}

scriptJob -optionVarChange "createPolyPrimitiveAsTool"
"MyOptionVarCallback";


I think there's a flag for that, although the doc's might have it spelled
incorrectly for some reason.  This code will run whenever you change the
"Interactive Creation" option.

-Tim

On Tue, Oct 29, 2019 at 12:20 PM kiteh <kiteh.0...@gmail.com> wrote:

> Hi all, I am trying to write a custom scriptJob that will activates when
> it detects a change in an `optionVar` value.
>
> Initially, I was using `RecentCommandChanged` as the event name, which
> seemingly have work, but however, it calls everything I navigate to another
> (new) tool command.
> Is there a better event name/ create a personal event that I can adopt?
>
> P.S: The current code I am working on uses MEL and hence unable to use the
> ones within OpenMaya.
>
> Appreciate in advance for any replies.
>
> Cheers.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to python_inside_maya+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/3618aa5f-00d7-44c4-813d-62d49c9e29e7%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/3618aa5f-00d7-44c4-813d-62d49c9e29e7%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CALKD2WpRjEVPHmNeD9btt6P3mXKy_BKG975TOnqABg9D_0Fuog%40mail.gmail.com.

Reply via email to