Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. def time_connect(name):
  2. " This is to connect standin seq to time node instead of expression "
  3.  
  4. import maya.cmds as cmds
  5. timeNode = cmds.ls(type='time')
  6. standinList = cmds.ls(name, dag=True, type='aiStandIn')
  7. print standinList
  8.  
  9. for i in standinList:
  10. print i
  11. try:
  12. # standinShape = cmds.listRelatives(i, type='aiStandIn')
  13. cmds.setAttr(i + '.useFrameExtension', 0)
  14. x = cmds.listConnections(i, type='expression')
  15. cmds.delete(x)
  16. cmds.connectAttr(timeNode[0] + '.outTime', i + '.frameNumber', f=True)
  17. cmds.setAttr(i + '.useFrameExtension', 1)
  18. except RuntimeError as e:
  19. print " Could not connect Attributes "
  20.  
  21. time_connect()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement