Crystal Space 2.0.0: 5.8.5 Exporting Animated Meshes

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

### 5.8.5 Exporting Animated Meshes

If a Blender mesh object contains either an armature or any shape keys, then it will be exported as an Animesh Mesh Object. In the other case, then it will be exported as a static mesh.

The data that is exported is the same as the one exported with static meshes, plus the data relevant for the animation (that will be presented in this section).

All this data will be split in two different files in the `‘factories’` directory:

- the animated mesh factory, in a file of the same name than the Blender mesh.
- the skeleton factory and the animations, in a file of the same name than the Blender mesh plus the `‘_rig’` postfix.

Similarly to the static meshes, it is possible to define an Animesh as `‘Double Sided’`.

#### Submeshes

Faces that uses a different material are put in a separate submesh, similarly to the static meshes.

#### Morph Targets

The Blender shape keys (i.e. variations of the positions of the vertices of the mesh) are exported as Crystal Space's morph targets.

The shape key with the name `‘Basis’` is selected as the default position of the vertices (i.e. the main `‘vertex’` render buffer of the animated mesh). All other shape keys are exported as a different morph target.

#### Skeleton and Bone Influences

The Blender armature of the mesh, if any, is exported as the Crystal Space's skeleton of the animated mesh. Along with the skeleton, the Blender weight map of the mesh (defining in which proportion each vertex is influenced by the motion of the bones) is exported as the bone influences of the animated mesh.

#### Animations

All the keyframe animations of the mesh are exported too.

Warning: Only the positional and rotational components of the key frames are exported. The Crystal Space's animated mesh doesn't (yet) support morphing and scaling components.

Warning: The Blender object constraints defined on the skeleton (such as `‘Inverse Kinematics’`, `‘Copy Rotation’`) will not be exported correctly. So make sure to disable any constraint first (in the `‘Object Constraints’` context of the `‘Properties’` window, when the skeleton is selected).

#### Sockets

You can attach external meshes to the bone of an animated mesh, in order for them to follow the motion of the bone, whatever its animation. This is made through Crystal Space socket objects (`CS::Mesh::iAnimatedMeshSocket`).

To define a socket in Blender, you must:

- Create an additional dummy external object that will be used to define the socket. The size or shape doesn't matter, only its position and name.
- Place the dummy mesh at the position you want for of your socket (with the skeleton in its default pose).
- Parent the dummy mesh to a bone of the armature. For this, do *precisely* the following:
  - select your armature, put it in `‘Pose’` mode and select the bone on the armature
  - in the Blender outliner, left-click to select your dummy mesh
  - still in the Blender outliner, hold down `‘SHIFT’` and left-click on your animated mesh
  - in the Blender 3D view, press `‘CTRL-P’` then select `‘Bone’` in the `‘Parent To’` menu

There are no restrictions on the number of sockets.

#### Warning on socket objects attached to scaled armatures

If you're planning to change the default scale of the armature used to attach some objects, you must first define the socket on the armature with its default scale of 1. Afterwards, you can change the armature's scale: in the same way as Blender, the exported socket object will be scaled proportionally to the armature.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

This document was generated using texi2html 1.76.