Advertisement
Guest User

Untitled

a guest
Jun 1st, 2020
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1.  
  2. fn sortByMinZ a b = if a.min.z > b.min.z then -1 else if a.min.z < b.min.z then 1 else 0
  3.  
  4. nodes = selection as array
  5.  
  6. qsort nodes sortByMinZ
  7.  
  8.  
  9. time_offset = 5f -- start to end duration in frames
  10.  
  11. offset_target = pickObject()
  12.  
  13. with animate on
  14. (
  15. for i=0 to nodes.count-1 do
  16. (
  17. local t_start = (i * time_offset) as time
  18.  
  19. at time t_start
  20. (
  21. nodes[i+1].position = nodes[i+1].position
  22. )
  23.  
  24. at time (t_start + time_offset)
  25. (
  26. nodes[i+1].position.x += offset_target.pos.x - nodes[i+1].center.x
  27. nodes[i+1].position.y += offset_target.pos.y - nodes[i+1].center.y
  28. /* nodes[i+1].position.z += offset_target.pos.z - nodes[i+1].center.z */ -- ignore z axis offset
  29. )
  30.  
  31. )
  32. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement