Say, I have 2 checkBoxes…
How do I create a function such that when Maya cmds.checkBox1 is checked, cmds.checkBox2 and vice-verse, as long only one checkBox is checked and not both?
I tried to hardcode it, but it does not seems to be working. In my code below, when I checked chk1, chk2 is still enabled and checkable…
import maya.cmds as cmds
def test1(self, *args):
print "User checked option1"
cmds.checkBox(chk2, query = True, value = True, enable = False)
def test2(self, *args):
print "User checked option2"
w = cmds.window(w=150, h=100, title = "Export Selection" )
cmds.columnLayout( adjustableColumn=True )
form = cmds.formLayout(numberOfDivisions=100)
chk1 = cmds.checkBox( label='option1', onc = test1 )
chk2 = cmds.checkBox( label='option2', onc = test2 )
cmds.formLayout(form, edit=True, attachForm=[\
(chk1, 'top', 15),\
(chk1, 'left', 15),\
(chk2, 'top', 30),\
(chk2, 'left', 15)])
cmds.showWindow( window )