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' )

-- 
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/e7f84d83-7e5f-40a8-b5d3-19a613416da1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to