Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- nodes = selection as array
- qsort nodes sortByMinZ
- time_offset = 5f -- start to end duration in frames
- offset_target = pickObject()
- with animate on
- (
- for i=0 to nodes.count-1 do
- (
- local t_start = (i * time_offset) as time
- at time t_start
- (
- nodes[i+1].position = nodes[i+1].position
- )
- at time (t_start + time_offset)
- (
- nodes[i+1].position.x += offset_target.pos.x - nodes[i+1].center.x
- nodes[i+1].position.y += offset_target.pos.y - nodes[i+1].center.y
- /* nodes[i+1].position.z += offset_target.pos.z - nodes[i+1].center.z */ -- ignore z axis offset
- )
- )
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement