cwisbg

Dup move animaiton

Jan 23rd, 2019
433
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. #Dup move animaiton
  2. from pymel.core import *
  3. import random as r
  4. sl = selected()
  5. dupGrp = ls("DupGrp")[0]
  6. curentFrame = currentTime(q=1)
  7. for s in sl:
  8.  
  9. pap = s.listRelatives(p=1)
  10. parent(s,w=1)
  11. d = duplicate(dupGrp, un=1, rr=1, n = s+"_dup")[0]
  12. parent(d,s)
  13. if pap:
  14. setAttr(d.scale, .5,.5,.5)
  15. else:
  16. setAttr(d.scale, 1,1,1)
  17. parent(d,w=1)
  18. mO = 0
  19.  
  20. pc = parentConstraint(s,d, mo=0)
  21. dC = d.listRelatives(c=1)
  22. for cc in dC:
  23. animCrv = cc.listConnections(t="animCurve")
  24. if animCrv:
  25. k = keyframe(animCrv, iub=1, r=1, o="over", tc = curentFrame)
  26.  
  27. if pap:
  28. parent(s,pap)
  29. delete(pc)
Advertisement
Add Comment
Please, Sign In to add comment