USkeleton

[USkeleton](API\Runtime\Engine\Animation\USkeleton) : that links between mesh and animation

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Animation/Skeleton.h

Include

#include "Animation/Skeleton.h"

Syntax

class USkeleton :
    public UObject,
    public IInterface_AssetUserData,
    public IInterface_PreviewMeshProvider

Remarks

USkeleton : that links between mesh and animation

  • Bone hierarchy for animations

  • Bone/track linkup between mesh and animation

  • Retargetting related

  • Mirror table

Variables

Name Description

Public variable

TArray< FName >

 

AnimationNotifies

AnimNotifiers that has been created.

Protected variable

FSmartNameMappi...

 

AnimCurveMapping

Cached ptr to the persistent AnimCurveMapping.

Public variable

TMap< FName, FR...

 

AnimRetargetSources

Serializable retarget sources for this skeleton

Protected variable

TArray< UAssetU...

 

AssetUserData

Array of user data stored with the asset

Public variable

TArray< UBlendP...

 

BlendProfiles

List of blend profiles available in this skeleton

Protected variable

TArray< struct ...

 

BoneTree

Skeleton bone tree - each contains name and parent index

Protected variable

TArray< uint16 ...

 

DefaultCurveUIDList

This is default curve uid list used like ref pose, as default value don't use this unless you want all curves from the skeleton FBoneContainer contains only list that is used by current LOD

Protected variable

TArray< FName >

 

ExistingMarkerNames

Cached marker sync marker names (stripped for non editor)

Protected variable

FGuid

 

Guid

Guid for skeleton

Public variable

TArray< struct ...

 

LinkupCache

Non-serialised cache of linkups between different skeletal meshes and this Skeleton.

Protected variable

FOnSkeletonHier...

 

OnSkeletonHierarchyChanged

Public variable

FPreviewAssetAt...

 

PreviewAttachedAssetContainer

Attached assets component for this skeleton

Protected variable

FReferenceSkele...

 

ReferenceSkeleton

Reference Skeleton

Public variable

TMap< TWeakObje...

 

SkelMesh2LinkupCache

Runtime built mapping table between SkeletalMeshes, and LinkupCache array indices.

Protected variable

FSmartNameConta...

 

SmartNames

Container for smart name mappings.

Public variable

TArray< class U...

 

Sockets

Array of named socket locations, set up in editor and used as a shortcut instead of specifying everything explicitly to AttachComponent in the SkeletalMeshComponent.

Protected variable

FGuid

 

VirtualBoneGuid

Guid for virtual bones.

Protected variable

TArray< FVirtua...

 

VirtualBones

Array of this skeletons virtual bones.

Constructors

Name Description

Public function

USkeleton

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function

void

 

AccumulateCurveMetaData

(
    FName CurveName,
    bool bMaterialSet,
    bool bMorphtargetSet
)

This is called when you know both flags - called by post serialize

Public function

void

 

AddNewAnimationNotify

(
    FName NewAnimNotifyName
)

Adds a new anim notify to the cached AnimationNotifies array.

Public function

bool

 

AddNewVirtualBone

(
    const FName SourceBoneName,
    const FName TargetBoneName,
    FName& NewVirtualBoneName
)

Public function

bool

 

AddNewVirtualBone

(
    const FName SourceBoneName,
    const FName TargetBoneName
)

Public function

bool

 

AddSlotGroupName

(
    const FName& InNewGroupName
)

Returns true if Group is added, false if it already exists

Public function

bool

 

AddSmartNameAndModify

(
    FName ContainerName,
    FName NewDisplayName,
    FSmartName& NewName
)

Smart Name Interfaces.

Protected function

int32

 

BuildLinkup

(
    const USkeletalMesh* InSkelMes...
)

Build Look up between SkelMesh to BoneTree

Public function

void

 

CallbackRetargetSourceChanged()

Public function

void

 

ClearCacheData()

Clears all cache data

Public function Const

void

 

CollectAnimationNotifies

(
    TArray< FName >& OutNotifies
)

Collect animation notifies that are referenced in all animations that use this skeleton (uses the asset registry).

Public function

void

 

CollectAnimationNotifies()

Collect animation notifies that are referenced in all animations that use this skeleton (uses the asset registry).

Public function Const

bool

 

ContainsSlotName

(
    const FName& InSlotName
)

Protected function

void

 

ConvertToFReferenceSkeleton()

Conversion function.

Public function

UBlendProfil...

 

CreateNewBlendProfile

(
    const FName& InProfileName
)

Create a new blend profile with the specified name

Protected function

bool

 

CreateReferenceSkeletonFromMesh

(
    const USkeletalMesh* InSkeleta...,
    const TArray< int32 >& RequiredRef...
)

Create Reference Skeleton From the given Mesh

Protected function Const

bool

 

DoesParentChainMatch

(
    int32 StartBoneTreeIndex,
    const USkeletalMesh* InSkelMes...
)

Check if Parent Chain Matches between BoneTree, and SkelMesh Meaning if BoneTree has A->B->C (top to bottom) and if SkelMesh has A->C It will fail since it's missing B We ensure this chain matches to play animation properly

Public function

FAnimSlotGro...

 

FindAnimSlotGroup

(
    const FName& InGroupName
)

Public function Const

const FAnimS...

 

FindAnimSlotGroup

(
    const FName& InGroupName
)

Public function Const

USkeletalMes...

 

FindCompatibleMesh()

Find the first compatible mesh for this skeleton

Public function Const

int32

 

FindRigBoneMapping

(
    const FName& NodeName
)

Public function Const

USkeletalMes...

 

FindSocket

(
    FName InSocketName
)

Public function Const

USkeletalMes...

 

FindSocketAndIndex

(
    FName InSocketName,
    int32& OutIndex
)

Public function Const

UDataAsset &...

 

GetAdditionalPreviewSkeletalMeshes()

Get the additional skeletal meshes we use when previewing this skeleton

Public function Const

uint16

 

GetAnimCurveUidVersion()

Return version of AnimCurveUidVersion

Public function

USkeletalMes...

 

GetAssetPreviewMesh

(
    UObject* InAsset
)

Public function

UBlendProfil...

 

GetBlendProfile

(
    const FName& InProfileName
)

Get the specified blend profile by name

Public function Const

EBoneTransla...

 

GetBoneTranslationRetargetingMode

(
    const int32 BoneTreeIdx
)

Public function Const

int32

 

GetChildBones

(
    int32 ParentBoneIndex,
    TArray< int32 >& Children
)

Get List of Child Bones of the ParentBoneIndex

Public function Const

const FCurve...

 

GetCurveMetaData

(
    const FSmartName& CurveName
)

These return container of curve meta data, if you modify this container, you'll have to call REfreshCAchedAnimationCurveData to apply

Public function

FCurveMetaDa...

 

GetCurveMetaData

(
    const FSmartName& CurveName
)

These return container of curve meta data, if you modify this container, you'll have to call REfreshCAchedAnimationCurveData to apply

Public function Const

const FCurve...

 

GetCurveMetaData

(
    const SmartName::UID_Type CurveUID
)

These return container of curve meta data, if you modify this container, you'll have to call REfreshCAchedAnimationCurveData to apply

Public function Const

const FCurve...

 

GetCurveMetaData

(
    const FName& CurveName
)

These return container of curve meta data, if you modify this container, you'll have to call REfreshCAchedAnimationCurveData to apply

Public function

FCurveMetaDa...

 

GetCurveMetaData

(
    const FName& CurveName
)

These return container of curve meta data, if you modify this container, you'll have to call REfreshCAchedAnimationCurveData to apply

Public function Const

const TArray...

 

GetDefaultCurveUIDList()

Public function Const

const TArray...

 

GetExistingMarkerNames()

Get existing (seen) sync marker names for this Skeleton.

Public function Const

const FGuid

 

GetGuid()

Public function

int32

 

GetMappedValidNodes

(
    TArray< FName >& OutValidNodeNames
)

This make sure it stays within the valid range

Public function

int32

 

GetMeshBoneIndexFromSkeletonBoneIndex

(
    const USkeletalMesh* InSkelMes...,
    const int32 SkeletonBoneIndex
)

Get Reference Bone Index from Bone Tree Index

Public function

int32

 

GetMeshLinkupIndex

(
    const USkeletalMesh* InSkelMes...
)

Find a mesh linkup table (mapping of skeleton bone tree indices to refpose indices) for a particular SkeletalMesh If one does not already exist, create it now.

Public function

int32

 

GetRawAnimationTrackIndex

(
    const int32 InSkeletonBoneIndex,
    const UAnimSequence* InAnimSeq
)

Get Track index of InAnimSeq for the BoneTreeIndex of BoneTree this is slow, and it's not supposed to be used heavily

Public function Const

const FRefer...

 

GetReferenceSkeleton()

Accessor to Reference Skeleton to make data read only

Public function Const

const TArray...

 

GetRefLocalPoses

(
    FName RetargetSource
)

Public function Const

FName

 

GetRetargetSourceForMesh

(
    USkeletalMesh* InMesh
)

Find a retarget source for a particular skel mesh.

Public function Const

URig *

 

GetRig()

Public function Const

FName

 

GetRigBoneMapping

(
    const FName& NodeName
)

Public function Const

FName

 

GetRigNodeNameFromBoneName

(
    const FName& BoneName
)

Public function

int32

 

GetSkeletonBoneIndexFromMeshBoneIndex

(
    const USkeletalMesh* InSkelMes...,
    const int32 MeshBoneIndex
)

Get Bone Tree Index from Reference Bone Index

Public function Const

FName

 

GetSlotGroupName

(
    const FName& InSlotName
)

Public function Const

const TArray...

 

GetSlotGroups()

Public function

bool

 

GetSmartNameByName

(
    const FName& ContainerName,
    const FName& InName,
    FSmartName& OutSmartName
)

Public function

bool

 

GetSmartNameByUID

(
    const FName& ContainerName,
    SmartName::UID_Type UID,
    FSmartName& OutSmartName
)

Public function Const

const FSmart...

 

GetSmartNameContainer

(
    const FName& ContainerName
)

Get or add a smartname container with the given name.

Public function Const

SmartName::U...

 

GetUIDByName

(
    const FName& ContainerName,
    const FName& Name
)

Quick wrapper function for Find UID by name, if not found, it will return SmartName::MaxUID

Public function Const

FGuid

 

GetVirtualBoneGuid()

Public function Const

const TArray...

 

GetVirtualBones()

Accessor for the array of virtual bones on this skeleton

Protected function

void

 

HandleSkeletonHierarchyChange()

Call this when the skeleton has changed to fix dependent assets

Public function

void

 

HandleVirtualBoneChanges()

Public function Const

bool

 

IsCompatible

(
    USkeleton const* InSkeleton
)

Check if this skeleton may be used with other skeleton

Public function Const

bool

 

IsCompatibleMesh

(
    const USkeletalMesh* InSkelMes...
)

Indexing naming convention

Public function

void

 

LoadAdditionalPreviewSkeletalMeshes()

Load any additional meshes we may have

Public function

bool

 

MergeAllBonesToBoneTree

(
    const USkeletalMesh* InSkelMes...
)

Merge all Bones to BoneTrees if not exists

Public function

bool

 

MergeBonesToBoneTree

(
    const USkeletalMesh* InSkeleta...,
    const TArray< int32 >& RequiredRef...
)

Merge Bones (RequiredBones from InSkelMesh) to BoneTrees if not exists

Public function

void

 

RebuildLinkup

(
    const USkeletalMesh* InSkelMes...
)

Rebuild Look up between SkelMesh to BoneTree - this should only get called when SkelMesh is re-imported or so, where the mapping may be no longer valid

Public function

bool

 

RecreateBoneTree

(
    USkeletalMesh* InSkelMesh
)

Merge has failed, then Recreate BoneTree

Protected function

void

 

RefreshAllRetargetSources()

Refresh All Retarget Sources

Public function

void

 

RefreshRigConfig()

Verify if it has all latest data

Public function

void

 

RegisterMarkerName

(
    FName MarkerName
)

Register a new sync marker name.

Public function

FDelegateHan...

 

RegisterOnRetargetSourceChanged

(
    const FOnRetargetSourceChanged& De...
)

Registers a delegate to be called after the preview animation has been changed

Public function

void

 

RegisterOnSkeletonHierarchyChanged

(
    const FOnSkeletonHierarchyChanged&...
)

Registers a delegate to be called after notification has changed

Public function

bool

 

RegisterSlotNode

(
    const FName& InSlotName
)

Register a slot name. Return true if a slot was registered, false if it was already registered.

Public function

void

 

RemoveBonesFromSkeleton

(
    const TArray< FName >& BonesToRemo...,
    bool bRemoveChildBones
)

Removes the supplied bones from the skeleton

Public function

void

 

RemoveLinkup

(
    const USkeletalMesh* InSkelMes...
)

Remove Link up cache for the SkelMesh

Public function

void

 

RemoveMarkerName

(
    FName MarkerName
)

Remove a sync marker name.

Public function

void

 

RemoveSlotGroup

(
    const FName& InSlotName
)

Public function

void

 

RemoveSlotName

(
    const FName& InSlotName
)

Edits/removes slot group data WARNING: Does not verify that the names aren't used anywhere - if it isn't checked by the caller the names will be recreated when referencing assets load again.

Public function

void

 

RemoveSmartnameAndModify

(
    FName ContainerName,
    SmartName::UID_Type Uid
)

Removes a smartname from the specified container and modifies the skeleton.

Public function

void

 

RemoveSmartnamesAndModify

(
    FName ContainerName,
    const TArray< FName >& Names
)

Removes smartnames from the specified container and modifies the skeleton.

Public function

void

 

RemoveVirtualBones

(
    const TArray< FName >& BonesToRemo...
)

Public function

void

 

RenameSlotName

(
    const FName& OldName,
    const FName& NewName
)

Public function

bool

 

RenameSmartnameAndModify

(
    FName ContainerName,
    SmartName::UID_Type Uid,
    FName NewName
)

Renames a smartname in the specified container and modifies the skeleton return bool - Whether the rename was sucessful

Public function

void

 

RenameVirtualBone

(
    const FName OriginalBoneName,
    const FName NewBoneName
)

Public function

void

 

SetAdditionalPreviewSkeletalMeshes

(
    UDataAsset* InPreviewCollectio...
)

Set the additional skeletal meshes we use when previewing this skeleton

Public function

void

 

SetBoneTranslationRetargetingMode

(
    const int32 BoneIndex,
    EBoneTranslationRetargetingMode::Ty...,
    bool bChildrenToo
)

Public function

bool

 

SetRigBoneMapping

(
    const FName& NodeName,
    FName BoneName
)

Public function

void

 

SetRigConfig

(
    URig* Rig
)

Public function

void

 

SetSlotGroupName

(
    const FName& InSlotName,
    const FName& InGroupName
)

Public function

void

 

UnregisterOnRetargetSourceChanged

(
    FDelegateHandle Handle
)

Unregisters a delegate to be called after the preview animation has been changed

Public function

void

 

UnregisterOnSkeletonHierarchyChanged

(
    void* Unregister
)

Public function

void

 

UpdateReferencePoseFromMesh

(
    const USkeletalMesh* InSkelMes...
)

Create RefLocalPoses from InSkelMesh.

Public function

void

 

UpdateRetargetSource

(
    const FName InName
)

Update Retarget Source with given name

Public function

int32

 

ValidatePreviewAttachedObjects()

Makes sure all attached objects are valid and removes any that aren't.

Public function

void

 

VerifySmartName

(
    const FName& ContainerName,
    FSmartName& InOutSmartName
)

Make sure the smart name has valid UID and so on

Public function

void

 

VerifySmartNames

(
    const FName& ContainerName,
    TArray< FSmartName >& InOutSmartNa...
)

Make sure the smart name has valid UID and so on

Overridden from UObject

Name Description

Public function Virtual

void

 

BeginDestroy()

Called before destroying the object.

Public function Virtual Const

bool

 

IsPostLoadThreadSafe()

Called during async load to determine if PostLoad can be called on the loading thread.

Public function Virtual

void

 

PostDuplicate

(
    bool bDuplicateForPIE
)

Called after duplication & serialization and before PostLoad.

Public function Virtual

void

 

PostEditUndo()

Called after applying a transaction to the object.

Public function Virtual

void

 

PostInitProperties()

Called after the C++ constructor and after the properties have been initialized, including those loaded from config.

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object.

Public function Virtual

void

 

PreEditUndo()

Called before applying a transaction to the object.

Public function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Handles reading, writing, and reference collecting using FArchive.

Overridden from IInterface_AssetUserData

Name Description

Public function Virtual

void

 

AddAssetUserData

(
    UAssetUserData* InUserData
)

Public function Virtual Const

const TArray...

 

GetAssetUserDataArray()

Public function Virtual

UAssetUserDa...

 

GetAssetUserDataOfClass

(
    TSubclassOf< UAssetUserData > InUse...
)

Public function Virtual

void

 

RemoveUserDataOfClass

(
    TSubclassOf< UAssetUserData > InUse...
)

Overridden from IInterface_PreviewMeshProvider

Name Description

Public function Virtual Const

USkeletalMes...

 

GetPreviewMesh()

Get the preview mesh for this asset

Public function Virtual

USkeletalMes...

 

GetPreviewMesh

(
    bool bFindIfNotSet
)

IInterface_PreviewMeshProvider interface

Public function Virtual

void

 

SetPreviewMesh

(
    USkeletalMesh* PreviewMesh,
    bool bMarkAsDirty
)

Set the preview mesh for this asset

Typedefs

Name

Description

AnimCurveUID

Typedefs for greater smartname UID readability, add one for each smartname category.

FBoneTreeType

FOnRetargetSourceChanged

FOnRetargetSourceChangedMulticaster

FOnSkeletonHierarchyChanged

FOnSkeletonHierarchyChangedMulticaster

Constants

Name

Description

AnimCurveMappingName

Names for smartname mappings, if you're adding a new category of smartnames add a new name here.

AnimNotifyTag

Asset registry information for animation notifies.

AnimNotifyTagDelimiter

AnimTrackCurveMappingName

Names for smartname mappings, if you're adding a new category of smartnames add a new name here.

CurveNameTag

Asset registry information for animation curves.

CurveTagDelimiter

RigTag

Rig Configs

Deprecated Variables

Name Description

Protected variable

TArray< FTransf...

 

RefLocalPoses_DEPRECATED

Reference skeleton poses in local space

Deprecated Functions

Name Description

Public function Const

const TArray...

 

GetBoneTree()

GetBoneTree should not be called. Please use GetBoneTranslationRetargetingMode()/SetBoneTranslationRetargetingMode() functions instead

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss