animationassimp

What is aiAnimation in assimp library?


What is aiAnimation in assimp library?

I learned about implementing skeletal animation using assimp at the link below.text

Therefore, I loaded a 3D model file intended to be used in Unity and an FBX file containing only the armature to be applied to that model.

However, the 3D model is not drawn well. When I looked into it, I found that there were multiple aiAnimations. I know that aiAnimation is an array of aiNodeAnim. When there was only one aiAnimation, it was possible to draw properly.

What is the situation when there are multiple aiAnimations, and how should I play the animations?

3D model with multiple aiAnimations enter image description here

3D model with one aiAnimation(plays properly) enter image description here

I tried to play the animation using aiNodeAnim included in all aiAnimation, but it turned out like the top image.


Solution

  • The struct aiAnimation contains all the information basic animations for meshes and nodes. Each animation consists of an array of channels. Each channel is used to describe one way of animation like translation or rotation.

    These animations will be applied onto the meshes or the nodes. You can use them to simulate the spin for a cube by defining one channel to the aiNode with rotation.