cwisbg

offsetMotionPath

Sep 23rd, 2020
843
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # select object on motion path- needs animation keys already set
  2. from pymel.core import *
  3. duplicates = 5
  4. startFrame = 0
  5. endFrame = 100
  6. offsetAmnt = float(endFrame)/float(duplicates)
  7. sl = selected()
  8. objectList = sl[:-1]
  9. pathCrv = sl[-1]
  10. for o in objectList:
  11.     offsetBy = 0
  12.     for d in range(0,duplicates):  
  13.         dup = duplicate(o)
  14.         moPath = pathAnimation(dup, c=pathCrv ,startTimeU = startFrame+offsetBy, endTimeU = endFrame+offsetBy, follow=1, fm=1,fa="x")
  15.         offsetBy += offsetAmnt
  16.  
RAW Paste Data