I am building a ui an I am using checkboxes to enable sliders. Currently selecting and deselecting checkboxes enables and disables my sliders which is all well and good but I am trying to get it so when I select a checkbox it disables all other checkboxes. I have the checkbox's command set to a different function which i use to to enable and disable the corresponding sliders. I tried using an if statement but it gives me an error," Error: RuntimeError: file <maya console> line 38: Object 'False' not found."
class sliderWindow():
def __init__(self):
self.size = [500, 500]
def windMain(self):
main = cmds.window(
self.name, widthHeight=self.size,sizeable=True)
cmds.columnLayout()
self.rBtn = cmds.checkBox(label='test1', enable=True)
self.rLayout = cmds.rowLayout(nc = 3,enable=False)
self.slider1 = cmds.floatSliderGrp(label = 'TestS1', field = True, min = 0.000, max = 1.000, value = 0.500, step = 0.001)
cmds.setParent('..')
cmds.checkBox(self.rBtn, e= True,cc=partial(self.changeBox,self.rLayout))
self.gBtn = cmds.checkBox(label='test2', enable=True)
self.gLayout = cmds.rowLayout(nc=3,enable=False)
self.slider2 = cmds.floatSliderGrp(label='testS2', field=True, min=0.000, max=1.000, value=0.500, step=0.001)
cmds.setParent('..')
cmds.checkBox(self.gBtn, e=True, cc=partial(self.changeBox, self.gLayout))
cmds.showWindow(main)
def changeBox(self,widget,*args):
if hasattr(self, 'currentState'):
self.currentState = cmds.rowLayout(self.currentState,q=True,enable=False)
self.currentState = cmds.rowLayout(widget,q=True,enable=True)
cmds.rowLayout(widget,e=True,enable=(1-self.currentState))
any help is appreciated. Thank you!