This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Version Control
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Skinned Mesh

A  skinned mesh is an object that can contain both mesh geometry and animation data. It is usually used for rendering characters with a bone-based animation or a morph target animation (also known as blend shapes).

The animation data and the mesh geometry can be stored in a single .mesh file or in separate .mesh and .anim files. Separate files are usually used for complex objects with a number of animation (for example, characters), single file is usually used for simple objects (for example, lift doors).

A skinned mesh is created in third-party graphics programs (such as 3ds Max, Maya, etc.)

Most operations with the skinned mesh are performed via scripts, but you can do some of them via UnigineEditor:

  • Add a Skinned Mesh.
  • Load a Skinned Mesh and animation.
  • Adjust animation settings.

The mesh limitations set in UNIGINE:

Maximum number of vertices per mesh 4,294,967,295
Maximum number of surfaces per mesh 32,768
Maximum amount of weights per vertex 4
Maximum amount of bones per surface 128
Maximum number of active morph targets per mesh 7

See Also#

Adding a Skinned Mesh#

To add a skinned mesh to the scene via UnigineEditor, do the following:

  1. Run UnigineEditor.
  2. On the Menu bar, click Create -> Mesh -> Skinned.

  3. In the dialog window that opens, choose the path to the .mesh file.
  4. Place the mesh somewhere in the world.
Notice
You can change the path to the mesh at any time in the MeshSkinned tab.

Loading a Skinned Mesh and Animation#

To replace a loaded skinned mesh with a new one, do the following:

  1. Choose the mesh in the World Hierarchy window and go to the Node tab of the Parameters window.
  2. In the Mesh Skinned section, choose the path to the new .mesh file in the Mesh field.

To add animation or replace the existing with a new one via UnigineEditor, do the following:

  1. Choose the mesh in the World Hierarchy window and go to the Node tab of the Parameters window.
  2. In the Mesh Skinned section, choose the path to a new .anim file in the Preview Animation field.

Setting Up Animation#

You can perform the following operations with the skinned mesh animation via UnigineEditor:

Mesh Skinned tab
Loop Play an animation in a loop.
Quaternion Toggles the dual-quaternion skinning mode on and off. The dual-quaternion model is an accurate, computationally efficient, robust, and flexible method of representing rigid transforms and it is used in skeletal animation.
Controlled Set the flag identifying that the mesh animation is controlled by a parent skinned mesh.
Time Set the animation time, in animation frames. The time count starts from the zero frame. If the time is set to be between frames, animation is blended. If the time is set outside the animation frame range, the animation is looped.
Playback Speed The multiplier of the animation playback time.
Preview Animation Path to a file with animation (.anim) to be played.
Play Start the animation playback.
Stop Stop the animation playback.

Setting Up Bones#

Bone hierarchy of your skinned mesh is displayed in the Bones section of the Parameters window.

Each bone of a skinned mesh can be bound to a separate node to control its transformation giving you a lot of flexibility. For example, you can animate these nodes via the Tracker tool or enable physics-based control over skinned mesh bones binding them to nodes driven by physics.

Mesh Skinned tab
Visualize Bones Enable visualizer for bones and their basis vectors to monitor your settings while adjusting them. The visualizer is rendered even when a skinned mesh is not selected in the World Nodes hierarchy, making it possible to show positions of bones for multiple meshes simultaneously.
Notice
The global Visualizer is enabled automatically, when you check this option.
Create Dummy Hierarchy Creates a hierarchy of dummy nodes for the skinned mesh, where each node has the same name and transform as the corresponding bone and is bound to it with default settings.
Notice
The hierarchy can also be generated for selected bones only.
Bind Node Node whose transformation is used to control the transformation of the bone.
Node Transform Basis Defines which transformation of the bound node (World or Local) is to be used to override the transformation of the selected bone.
Bone Transform Basis Defines which transformation of the selected bone is to be overridden by the node's transformation:
  • World coordinates
  • Coordinates relative to the skinned mesh object
  • Coordinates of the parent bone
Bind Mode Defines the type of blending of node's and bone's transformations:
  • Override — replace bone's transformation with the transformation of the node.
  • Additive — node's transformation is added to the current transformation of the bone.
Position Offset Translation part of the additional transformation matrix applied to the node's transformation before applying it to bone's transformation. This parameter serves for the purpose of additional correction of the node's transform for the bone's basis.
Rotation Offset Rotation part of the additional transformation matrix applied to the node's transformation before applying it to bone's transformation. This parameter serves for the purpose of additional correction of the node's transform for the bone's basis.
Scale Offset Scaling part of the additional transformation matrix applied to the node's transformation before applying it to bone's transformation. This parameter serves for the purpose of additional correction of the node's transform for the bone's basis.
Reset Node Transform Resets initial node transformation.
Reset Bone Transform Reset bone transformation. This button is used to restore initial transformation of the bone after modifying it via a bound node.

Optimizing Animation Playback#

Updating each frame a huge number of objects located far away from the camera that are hardly distinguishable or observed as a mass is a waste of resources.

To improve performance and avoid the excessive load, animation playback can be updated with a reduced framerate. When the player is out of the area specified by Update Distance Limit, the animation stops to be updated and freezes statically.

The set of frame rates enables you to specify how often the animation playback should be updated when the object is visible, when only the shadow of the Skinned Mesh is visible, or when it is not visible at all.

Parameters tab -> Periodic Update section
FPS When Object Is Rendered To Viewport Update rate value for the case when the object is rendered to viewport.
FPS When Only Object Shadows Are Rendered Update rate value when the object itself is outside the viewing frustum, and only its shadow is rendered to viewport.
FPS When Object Is Not Rendered At All Update rate value when both the object and its shadow are not rendered to the viewport.
Update Distance Limit Distance from the camera up to which the object should be updated.
Notice
These values are not fixed and can be adjusted by the Engine at any time to ensure best performance.

This feature is enabled with default settings ensuring optimum performance and can be adjusted per-object in the UnigineEditor or via API at run time.

Warning
Please be aware that using reduced update frame rate for an object should be carefully considered in your application's logic, as it may lead to various issues with rendering Skinned / Dynamic Meshes (flickering due to misalignment, e.g. in case of attaching a cloth to a skinned mesh).
Last update: 2023-06-23
Build: ()