Convert frames to time

Hi all,
I’d like to start an animation group on a specific frame. That works perfectly with:

But I also want it to stop at a specific frame. I can use this function
scene.animationGroups[0].start(false, 1, fromTime, toTime);

But it uses time as input. Is there a way to convert frames to time so I can make my animation play the exact range I want?

Nope it uses frames as well so you’are all good!

I started with adding frame numbers. But that didn’t work. So then I used:
console.log(scene.animationGroups[0].from, scene.animationGroups[0].to) to get the numbers that were used. And it returned seconds (0 - 16.66666). My animation is from frame 0 - 480
If I use the time input it works… (it’s on glTF imported model with animation).

I’m trying to create a playground but it won’t let me download a model from an external domain.

I have created a playground with a different animated model that can be displayed.

The start values have to be given in seconds as well.

Ok I understand the confusion. This may come from your gltf file.

It may be exported with time inside the keyframe

Anyway if this is the case as animation run at 60fps, you can get the time by doing time = frame / 60

thank you for clearing this up. It seems my file is 30fps. But just wanted to know if I was missing something.

You’re not :slight_smile: