Guest User

Untitled

a guest
Jan 16th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.19 KB | None | 0 0
  1. import maya.cmds as cmds
  2.  
  3. # Makes a fucking window  
  4.  
  5. window = cmds.window( title="window", iconName='Short Name', widthHeight =(150, 170) )
  6. cmds.columnLayout(adjustableColumn=True )
  7. #BUTTONS EVERYWHERE
  8.  
  9. # Freeze Transformation Button
  10. cmds.button( label='Freeze Transformation', c=('cmds.makeIdentity( apply=True, translate=1, rotate=1, scale=0, jointOrient=1 )' ) )
  11.  
  12. # Lock Attributes
  13. cmds.button( label='Lock Attributes',c= joint )
  14.  
  15. def joint(*args):
  16.     for attr in 'tx', 'ty', 'tz', 'sx', 'sy', 'sz', 'rx', 'ry', 'rz':  
  17.         cmds.setAttr('joint1.' + attr, lock=True)
  18.         cmds.setAttr('joint2.' + attr, lock=True)
  19.         cmds.setAttr('joint3.' + attr, lock=True)
  20.         cmds.setAttr('joint4.' + attr, lock=True)
  21.  
  22. # Unlock Attributes
  23. cmds.button( label='Unlock Attributes',c= joint )
  24.  
  25. def joint(*args):
  26.     for attr in 'tx', 'ty', 'tz', 'sx', 'sy', 'sz', 'rx', 'ry', 'rz':  
  27.         cmds.setAttr('joint1.' + attr, lock=False)
  28.         cmds.setAttr('joint2.' + attr, lock=False)
  29.         cmds.setAttr('joint3.' + attr, lock=False)
  30.         cmds.setAttr('joint4.' + attr, lock=)
  31.  
  32. # Closing Button
  33. cmds.button( label='Close', c=('cmds.deleteUI(\"' + window + '\", window=True)') )
  34. cmds.setParent( '..' )
  35. cmds.showWindow( window )
Add Comment
Please, Sign In to add comment