am new to python..I try to create a button with a ui..for the first time its ok.. if i try to run the script for the 2nd time its shows myrigshortcut is not unique. please help me to rectify this
import maya.cmds as christy
if christy.dockControl('MyRigShortcut', exists=True):
christy.deleteUI('MyRigShortcut', window=True)
myWindow = christy.window( iconName='Short Name', widthHeight=(200, 55) )
christy.columnLayout( adjustableColumn=True )
christy.button (label = 'Show/Hide Joint', c = 'HideShow()')
christy.setParent('..')
christy.showWindow(myWindow)
def HideShow():
jointList = []
jointList =
christy.ls(type = 'joint' )
for j in jointList:
n = christy.getAttr (j+'.drawStyle')
if (n==0):
christy.setAttr(j+'.drawStyle',2)
else:
christy.setAttr(j+'.drawStyle',0)
buttonForm = christy.formLayout( parent = myWindow)
christy.dockControl( 'MyRigShortcut',area='left', content= myWindow , allowedArea='left' )