class

Skeleton

Module
Animation
Header
#include "Animation/Skeleton.h"
Namespace
Mowo

Constructors

SignatureNameDescription
Skeleton() = defaultSkeleton

Public functions

ReturnsNameDescription
voidAddBone
voidSetBoneOffset
int32_tFindBoneIndex
const Bone&GetBone
uint32_tGetBoneCount
const std::vector<Bone>&GetBones
voidSetRootTransformRoot transform: accumulated transforms of non-bone ancestor nodes (e.g.
const Mat4&GetRootTransform
voidComputeSkinningMatricesCompute final bone matrices for GPU upload globalTransforms: array of bone-space -> model-space transforms (computed by animation) outMatrices: finalMatrix[i] = globalTransform[i] * offsetMatrix[i]
voidComputeGlobalTransformsCompute global transforms from local transforms (hierarchy walk)
voidSetLodBonesToRemoveA distant character does not need its finger, jaw or twist bones animated: the pixels those bones move are smaller than the error.
const std::vector<uint8_t>*GetLodRequiredBonesnullptr = every bone is required at this LOD (the common case — no caller should have to build an all-ones mask to ask the question).
uint32_tGetLodCountHighest authored LOD index + 1 (0 when nothing is authored).
uint32_tGetLodRequiredBoneCountBones actually evaluated at this LOD — what a test or a stat reads to see the work the mask removed.
int32_tAddVirtualBoneAn IK goal or an aim point that lives in one bone's space but sits where another bone is — a hand target under the spine, a weapon point under the head — without re-authoring the skeleton in a DCC.
boolIsVirtualBone
voidRemoveVirtualBonesDrops every virtual bone and keeps the imported rig.
const std::vector<FVirtualBone>&GetVirtualBones

Function details

Skeleton

C++
Skeleton() = default

AddBone

C++
void AddBone(const Bone& bone)

SetBoneOffset

C++
void SetBoneOffset(uint32_t index, const Mat4& offset)

FindBoneIndex

C++
int32_t FindBoneIndex(const std::string& name) const

GetBone

C++
const Bone& GetBone(uint32_t index) const

GetBoneCount

C++
uint32_t GetBoneCount() const

GetBones

C++
const std::vector<Bone>& GetBones() const

SetRootTransform

C++
void SetRootTransform(const Mat4& transform)

Root transform: accumulated transforms of non-bone ancestor nodes (e.g. Armature)

GetRootTransform

C++
const Mat4& GetRootTransform() const

ComputeSkinningMatrices

C++
void ComputeSkinningMatrices(const std::vector<Mat4>& globalTransforms, std::vector<Mat4>& outMatrices) const

Compute final bone matrices for GPU upload globalTransforms: array of bone-space -> model-space transforms (computed by animation) outMatrices: finalMatrix[i] = globalTransform[i] * offsetMatrix[i]

ComputeGlobalTransforms

C++
void ComputeGlobalTransforms(const std::vector<Mat4>& localTransforms, std::vector<Mat4>& outGlobalTransforms) const

Compute global transforms from local transforms (hierarchy walk)

SetLodBonesToRemove

C++
void SetLodBonesToRemove(uint32_t lod, const std::vector<std::string>& boneNames)

A distant character does not need its finger, jaw or twist bones animated: the pixels those bones move are smaller than the error. Naming a bone here excludes it AND its whole subtree from evaluation at that LOD and every coarser one — a child cannot be animated by a parent that is not, and UE's authoring model is the same "remove this branch". An excluded bone is not deleted: it keeps its BIND local transform, so its subtree still rides its parent rigidly and the palette keeps its length. That is what makes this safe to switch per frame — nothing downstream (skinning matrices, sockets, attachment) changes shape. LOD 0 is always fully required; a level that was never authored inherits the closest coarser one that was, so a mesh with masks at 1 and 3 does the right thing at 2 without the caller repeating itself.

GetLodRequiredBones

C++
const std::vector<uint8_t>* GetLodRequiredBones(uint32_t lod) const

nullptr = every bone is required at this LOD (the common case — no caller should have to build an all-ones mask to ask the question). Otherwise one byte per bone, 1 = evaluate it.

GetLodCount

C++
uint32_t GetLodCount() const

Highest authored LOD index + 1 (0 when nothing is authored).

GetLodRequiredBoneCount

C++
uint32_t GetLodRequiredBoneCount(uint32_t lod) const

Bones actually evaluated at this LOD — what a test or a stat reads to see the work the mask removed.

AddVirtualBone

C++
int32_t AddVirtualBone(const std::string& name, const std::string& sourceBone, const std::string& targetBone)

An IK goal or an aim point that lives in one bone's space but sits where another bone is — a hand target under the spine, a weapon point under the head — without re-authoring the skeleton in a DCC. The bone is appended after every real bone and carries no skin weights, so the skin palette, the clip bindings and every existing index stay valid. Its drive happens inside ComputeGlobalTransforms, the one hierarchy walk every pose consumer (animation system, anim graph, control rig, retargeting, the editors' previews) goes through, so it follows Target on every frame of every one of them. -1 when the name is empty or taken, a bone is missing, source equals target, or the skeleton is at the bone limit.

IsVirtualBone

C++
bool IsVirtualBone(uint32_t index) const

RemoveVirtualBones

C++
void RemoveVirtualBones()

Drops every virtual bone and keeps the imported rig. The object stays the one the level's animators share, so a re-authored set can be laid onto it in place; a pose buffer sized for the old count is resized by the next ComputeGlobalTransforms.

GetVirtualBones

C++
const std::vector<FVirtualBone>& GetVirtualBones() const
Generated from Animation/Skeleton.h via animation.json · Oct 26, 2026Version 1.0.0