@@ -0,0 +1,1906 @@
+# UI%0A# if cmds.window(%22setAttrWin%22,exists=1):cmds.deleteUI(%22setAttrWin%22,window=1)%0A# w=450%0A# window=cmds.window(%22setAttrWin%22,t=%22BlendShape Tools%22,s=0,mb=1,rtf=1,mxb=0,mnb=0,w=w)%0A%0A# Add coordinate attribute%0Aobjs = cmds.ls(sl=1,fl=1,type='transform')%0Aname = %22pivotCenter%22%0Afor obj in objs:%0A    if name in cmds.listAttr(obj):%0A        cfm_dlg = cmds.confirmDialog( title='Confirm', message='Duplicated Attribute!Do you want to delete it?', %0A                           button=%5B'Yes','No'%5D, defaultButton='Yes', cancelButton='No', dismissString='No' )%0A        if cfm_dlg == 'Yes':%0A            cmds.deleteAttr(%22%7B0%7D.%7B1%7D%22.format(obj,name))%0A            # perform new attrs%0A            v1,v2,v3 = %5B0,0,0%5D%0A            cmds.addAttr(obj,ln=name,at='double3')%0A            for attr_name in %5B%22%7B0%7DX%22.format(name),%22%7B0%7DY%22.format(name),%22%7B0%7DZ%22.format(name)%5D:%0A                print attr_name%0A                cmds.addAttr(obj,ln=attr_name,at='double',p=name)%0A            cmds.setAttr(%22%7B0%7D.%7B1%7D%22.format(obj,name),v1,v2,v3,type='double3')%0A            for attr_name in %5B%22%7B0%7DX%22.format(name),%22%7B0%7DY%22.format(name),%22%7B0%7DZ%22.format(name)%5D:%0A                cmds.setAttr(%22%7B0%7D.%7B1%7D%22.format(obj,attr_name),e=True,k=True)%0A%0A# Add single string attribute%0Aobjs = cmds.ls(sl=1,fl=1,type='transform')%0Aname = %22MDL%22%0Afor obj in objs:%0A    if name in cmds.listAttr(obj):%0A        cfm_dlg = cmds.confirmDialog( title='Confirm', message='Duplicated Attribute!Do you want to delete it?', %0A                           button=%5B'Yes','No'%5D, defaultButton='Yes', cancelButton='No', dismissString='No' )%0A        if cfm_dlg == 'Yes':%0A            cmds.deleteAttr(%22%7B0%7D.%7B1%7D%22.format(obj,name))%0A            # perform new attrs%0A            string = %22test string%22%0A            cmds.addAttr(obj,ln=name,dt='string')%0A            cmds.setAttr(%22%7B0%7D.%7B1%7D%22.format(obj,name),string,type='string',e=True,k=True)%0A%0A# Get pivot center%0Av1,v2,v3 = cmds.xform(obj,q=True,ws=True,piv=True)%5B0:3%5D%0A

Create addAttrsUI.py