Notifications
Clear all
[Closed] selected keyrange lenght?
Feb 02, 2011 11:03 pm
I want to know the number of frames in the selected key range. I can’t find it
I tryed to get it from the getTimeRange but failed
any help?
6 Replies
Feb 02, 2011 11:03 pm
perhaps this may help
local myAnimStart = ((animationRange.start as integer)/TicksPerFrame)
local myAnimEnd = ((animationRange.end as integer)/TicksPerFrame)
local myTotalFrames = (myAnimEnd-myAnimStart)
Feb 02, 2011 11:03 pm
animationrange.end.frame-animationrange.start.frame returns the timeline range, not the selected keyframes range.
Imagine a animated box from frame 5 to frame15: keyframe range = 10
Feb 02, 2011 11:03 pm
Kinda crude and works only for position. Adjust to fit your needs:
fn getKeyRange node = (
node.pos.controller.keys[node.pos.controller.keys.count]-node.pos.controller.keys[1]
)
Feb 02, 2011 11:03 pm
why do you need to iterate over all the keys?
Is it possible to have out-of-order keys?
1 Reply