Armature reconstruction

Documentation of the process to reconstruct an Arma 3 skeleton as an FK armature in Blender

Introduction

Arma 3 has no file formats that can store an armature/skeleton in the sense that modern, more general purpose 3D scene formats like FBX, BLEND (Blender's own project file), USD can. This means that the data has to be distributed distributed accross multiple files:

  1. model.cfg that contains the skeleton bone hierarchy of the armature to which the animation applies

  2. bone pivot points stored in the Memory LOD of a P3D model file, linked in the model.cfg

From these two files, we can extract all (or almost all) the necessary information needed to reconstruct the armature.

Bone hierarchy

The first batch of information we need is having the list of bones in the skeleton, and their bone -> parent hierarchy.

This data can be found in the character model.cfg files. Most common skeleton in Arma 3 is the OFP2_ManSkeleton, so let's take that as an example.

The bone list defines how the graph-like skeleton structure is composed.

Pivot points

The pivot points define the positions of the heads of the armature bones, around which the bones rotate. Each position is defined by a vertex in the Memory LOD of the pivot points model file, with each vertex assigned to a unique vertex group, defining the bone it belongs to.

We can extract these points from the binary data in the P3D file.

Reconstruction

Given the bone hierarchy and the positions of the bones, we can reconstruct the skeleton as an FK armature.

For every bone in the hierarchy:

  1. Create a bone with the head-end at the associated pivot point

  2. Find the pivots of children bones (if any)

  3. Move tail-end of bone

    • If bone has no children, leave the bone vertical (not necessary, but the easiest to automate)

    • If bone has exactly 1 child, move the tail to the pivot of the child

    • If bone has multiple children, move the tail to the average point of the pivots of the children

It's possible that the pivot model might be missing the pivot point for one or more bones. In that case we can either skip those bones, or create them at a default location, and position them manually later.

After every bone is created, we can set up the parenting relations. Every bone needs to have its parent set. It's recommended that the tail-end of bones with exactly 1 child is connected to the head-end of that child, in order to make posing easier.

Due to the nature of how Arma 3 RTM animation files store the animation transformation, as long as the bone heads are in the correct places, the rotational orientation of the bones in the rest position doesn't actually matter. Because of this, the bones can be rotated in any way to make posing easier (as long as the heads are not moved).

Last updated