cwisbg

animation offset

Jul 10th, 2018
419
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.72 KB | None | 0 0
  1. # animation offset
  2. # select hirarchy
  3. # updated 7-10, actually works now :)
  4. from pymel.core import *
  5.  
  6. sl = selected()
  7. #attrList = "translateX", "translateY", "translateZ","rotateX", "rotateY", "rotateZ"
  8. attrList = ["scaleX"]
  9. currentFrame = currentTime(q=1)
  10.  
  11. offsetAmnt = 10
  12. offsetValue = currentFrame
  13. for s in sl:
  14.     sC = [s]#listRelatives(s,c=1)
  15.     maxSearch = 10
  16.     while sC:
  17.         if maxSearch == 0:
  18.             break
  19.         for attr in attrList:
  20.             animCrv = sC[0].listConnections(t="animCurveTU")
  21.             if animCrv:
  22.                 k = keyframe(animCrv, iub=1, r=1, o="over", tc = offsetValue)
  23.         sC = listRelatives(sC,c=1)
  24.         maxSearch -= 1
  25.         offsetValue += offsetAmnt
Advertisement
Add Comment
Please, Sign In to add comment