PDA

View Full Version : selected keyrange lenght?


loran
02-02-2011, 10: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?

TheGrak
02-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)

lo
02-03-2011, 05:27 AM
or simply
animationrange.end.frame-animationrange.start.frame

loran
02-03-2011, 11:39 AM
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

noouch
02-03-2011, 12:51 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]
)

lo
02-03-2011, 01:07 PM
why do you need to iterate over all the keys?
Is it possible to have out-of-order keys?

noouch
02-03-2011, 01:14 PM
why do you need to iterate over all the keys?
Is it possible to have out-of-order keys?
Thanks, now I feel extra-stupid :D
fixed it good.

CGTalk Moderation
02-03-2011, 01:14 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.