UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Content Creation
Materials
Unigine Material Library
Tutorials

Animation

Unigine supports bone-based animation (skinned, SMESH/SANIM). If you are new to animation, please, read overview article before going further.

FPS for Playback

There is one guideline which concerns all animation created for your project: choose one FPS and stick to it (usually it's 25 or 30 FPS). It does not matter which will you choose, just do it. Otherwise, beware of your programmers.

Skinned Mesh Animation

Files with skinned mesh animation have an extension SMESH and are of two types: containing geometry data plus animation and animation-only. The latter are useless without a "main" skinned mesh with geometry in a bind pose. There is also an additional SANIM format, which contains only animation and is intended for small animation sequences.

Each animation of a given model can occupy a separate animation layer, and different animations of the same model can be combined together by blending between the layers.

Requirements

The following conditions are necessary:

  • A file with geometry data should contain a bind pose of a model.
  • Bone names cannot be longer than 128 characters. Longer names are simply trimmed.
  • Maximum number of bones per surface depends on a target graphics card. The maximum number of bones per surface is equal to 96 to avoid crashes on graphics APIs of DirectX 9 level. If the number exceeds this limit, small child bones will be simply ignored by export. It is usually a good idea to set the limit of 64, as each bone is represented with three vectors. Each of these vectors is a parameter to an animation shader, and older cards have lower limits to a number of parameters that can be passed to a shader.

Guidelines and Tips

  • When choosing bone names stick to the Latin charset to avoid possible portability issues.
  • When saving animation in an external file, use SANIM files for small animation sequences as they will occupy less space because of compression. But if you need precise animations, use SMESH files.
  • After export, check animation in ResourceEditor. Remember that by default ResourceEditor plays animation with 25 FPS. If you want to test an external animation, do the following:
    1. Load the file which contains a bind pose by clicking Load mesh.
    2. Click Load mesh again and check Animation only at the bottom of the dialog window.
    3. Choose a file with required animation.
    Notice
    You can load external animation for a skinned mesh in UnigineEditor or by using scripting.
  • If there will be plenty of animations for a single mesh that can be combined, it is better to store only a bind pose in a main SMESH file, put all animations in external files and load them when needed. To export only a bind pose of a mesh, check Bind pose in export plugin settings during export.
  • It might be easier to create complex movements by blending small animations of parts of a mesh. To create such small animation, select only those bones which participate in it before export.
Last update: 2017-07-03