- Изменено
Getting the current frame of an animation
Hi
Is it possible to get the current animation frame from the Skeleton Data?
Thanks in advance,
Julen.
Btw, I've just realized that the Beta exports (both JSON and Binary) don't include the FPS field.
Is this a bug?
Edit: Silly me, our animator didn't export nonesential data
current animation frame from the skeleton data?
Hi Pharan, thanks for answering, sorry for my poor explanation.
I was wondering if it is possible to get the actual frame that the animation is in instead of having to calculate it myself.
Ex: Walking is in Frame 4 of 24.
About the calculation, I suppose that adding the time elapsed in each update and comparing it into a precalculated Frame-TimeInterval table would be correct, knowing the time interval between each frame:
frameInterval = (animationDuration * animationSpeed) / totalAnimationFrames
Thanks in advance,
Julen.
The integer frames only exist in Spine editor's dopesheet.
All keys actually use seconds as their unit of time.
You can calculate them back if you know the Spine editor dopesheet fps setting.
Any time in seconds can be converted to frames : frames = seconds * framesPerSecond