SHARE
TWEET

maw tposer

yaotungyu Jun 2nd, 2020 796 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def maw_tposer_setup():
  2.     for a in cmds.ls(type='assetInfo'):
  3.         start_frame = cmds.playbackOptions(q=1,min=1)
  4.         tpose_0 = start_frame+5
  5.         tpose_1 = tpose_0+5
  6.        
  7.         #names
  8.         cmds.select(a)
  9.         ns = a.split(':')[0]
  10.        
  11.         #tposing
  12.         if cmds.objExists(ns+':'+cmds.getAttr(a+'.assetType')):
  13.             if 'TPose' in cmds.listAttr(ns+':'+cmds.getAttr(a+'.assetType')):
  14.                 cmds.setKeyframe(ns+':'+cmds.getAttr(a+'.assetType')+'.TPose',t=tpose_0,v=0)
  15.                 cmds.setKeyframe(ns+':'+cmds.getAttr(a+'.assetType')+'.TPose',t=tpose_1,v=1)
  16.            
  17.                 #reset controls
  18.                 for c in cmds.ls(ns + ':*Ctrl', ns + ':*Ctrl1', ns + ':*Xtras'):
  19.                     if not cmds.getAttr(c+'.t',lock=1):
  20.                         cmds.setKeyframe(c+'.t',t=tpose_0)
  21.                         cmds.setKeyframe(c+'.t',t=start_frame,v=0)
  22.                     if not cmds.getAttr(c+'.r',lock=1):
  23.                         cmds.setKeyframe(c+'.r',t=tpose_0)
  24.                         cmds.setKeyframe(c+'.r',t=start_frame,v=0)
  25.  
  26.                 for n in cmds.ls(ns+':*',type='nucleus'):
  27.                     cmds.setAttr(n+'.startFrame',tpose_1)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top