How to avoid loop animation on entities


#1

Hi guys.
We tried to have a single loop animation on an entity with this code:

Entities.editEntity(entity, {animation: {url: "https://dl.dropboxusercontent.com/u/7497773/stand_to_sit%20(2).fbx", loop: false}});

but the animation didn’t stop. It’s still looping.
On ‘Edit property’ the “Animation loop” is disabled.

Why?


#2

I think you may have to also define the endFrame for the animation for it to be able to tell when to stop looping.

Entities.editEntity(entity, {animation: {url: “https://dl.dropboxusercontent.com/u/7497773/stand_to_sit%20(2).fbx”, loop: false, endFrame: 90, hold: true}});

The above forexample, stops the animation after reaching frame 90. where as hold makes it stop on the last frame, and keep that pose until a new animation is set, and not clear the bones positions.

Otherwise the animations keeps repeating while the frame count keeps going if hold is not set.

By default, the endFrame, if not set is 100000 and the animation is stacked to it self until it reaches that end frame. So it actually keeps playing back the animation until it reaches frame 10000, where it will stop or loop, depending on the setting set.


#3

Perfect.
Last little question: is there an easy way to check how many frames is the fbx made of?


#4

If you created it in blender, the end frame can be any point of the animation, buy usually this is the very last set keyframe. The unfortunately isnt a quicker way of checking it that i know of

If you werent the one who created the animation you can import the animation in Blender or in Autodesk’s FBX viewer (or even Windows 10 3D model viewer) and check the last keyframe in the animation that you want to use as the stop point