Hi Justin, the python command actually sets the optionVar in the tool 
itself.

def toggle_mode():
    state = cmds.optionVar(q = 'myToolState')

    # In the method of these two, it will set the optionVar value again
    # cmds.optionVar(intValue = ('myToolState', state))
    if state == 1:
        print "Enable myToolState"
        myTool.utils.enableState()
    else:
        print "DISABLE myToolState"
        myTool.utils.disableState()

And in the `get_state`, it's meant to be that way. So in the code itself, 
if the state is 0, it means enable while if the state is 1, it means 
disable...

-- 
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/a0eeea83-a598-4a10-b32b-4d706ca5d266%40googlegroups.com.

Reply via email to