Advertisement
cwisbg

offsetMotionPath

Sep 23rd, 2020
1,197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  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.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement