BigMouth
03-27-2008, 06:15 PM
Basically, what I'm trying to do is create a button that automatically adjusts the animationRange to the amount of keyframes on a selected object.
So if an object it's last key frame is on frame 120, and the animationRange is currently at 0-70, pressing the button automatically makes the animationRange 0-120.
I kinda got this to work, but not quite.
The thing is... I have know exactly how many keyframes are on the object, and take the last key Index and put it in the variable below ("last'). The problem is, each object doesn't have the same amount of keyframes.
The code below works just fine if the object in question just happens to have 3 key frames.
How can I make it find the last key frame, put that number into "last" variable?
last = 3
lastFrame = getKeyTime $.pos.controller last
animationRange = interval 0f lastFrame
So if an object it's last key frame is on frame 120, and the animationRange is currently at 0-70, pressing the button automatically makes the animationRange 0-120.
I kinda got this to work, but not quite.
The thing is... I have know exactly how many keyframes are on the object, and take the last key Index and put it in the variable below ("last'). The problem is, each object doesn't have the same amount of keyframes.
The code below works just fine if the object in question just happens to have 3 key frames.
How can I make it find the last key frame, put that number into "last" variable?
last = 3
lastFrame = getKeyTime $.pos.controller last
animationRange = interval 0f lastFrame
