UAnimSharingInstance

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

UObjectBase

UObjectBaseUtility

UObject

UAnimSharingInstance

References

Module

AnimationSharing

Header

/Engine/Plugins/Developer/AnimationSharing/Source/AnimationSharing/Public/AnimationSharingManager.h

Include

#include "AnimationSharingManager.h"

Syntax

UCLASS()
class UAnimSharingInstance : public UObject

Variables

Name Description

Public variable

TArray< FAdditi...

 

AdditiveInstances

Currently running additive instances

Public variable

UAnimationShari...

 

AnimSharingManager

Animation sharing manager for the current world

Public variable

TArray< FBlendI...

 

BlendInstances

Currently running blend instances

Public variable

FInstanceStack<...

 

BlendInstanceStack

Blend actors data structure

Public variable

bool

 

bNativeStateProcessor

Public variable

uint32

 

NumSetups

Number of animation setups

Public variable

TArray< FOnDema...

 

OnDemandInstances

Currently running on-demand instance

Public variable

TArray< FPerAct...

 

PerActorData

Per actor data, matches RegisteredActors

Public variable

TArray< FPerCom...

 

PerComponentData

Per component state data indexed from FPerActorData.ComponentIndices

Public variable

TArray< FPerSta...

 

PerStateData

Array of unique state data

Public variable UProperty Category Transient visibleanywhere

TArray< TObject...

 

RegisteredActors

Actors currently registered to be animation driven by the AnimManager using this setup

Public variable

const FAnimatio...

 

ScalabilitySettings

Platform specific scalability settings

Public variable UProperty Category Transient visibleanywhere

TObjectPtr< AAc...

 

SharingActor

Actor to which all the running SkeletalMeshComponents used for the sharing are attached to

Public variable

USignificanceMa...

 

SignificanceManager

Significance manager used for retrieve AI actor significance values

Public variable

FVector

 

SkeletalMeshBounds

Bounds for the currently used skeletal mesh

Public variable UProperty Category Transient visibleanywhere

TObjectPtr< UEn...

 

StateEnum

Enum class set up by the user to 'describe' the animation states

Public variable UProperty Category, EditAnywhere Transient

TObjectPtr< UAn...

 

StateProcessor

(Blueprint)class instance used for determining the state enum value for each registered actor

Public variable UProperty Category Transient visibleanywhere

TArray< TObject...

 

UsedAnimationSequences

Public variable

float

 

WorldTime

Holds the current frame world time

Functions

Name Description

Public function Const

float

 

CalculateBlendTime

(
    uint8 StateIndex
)

Retrieves the blend-time for this specific state

Public function Const

uint32

 

DeterminePermutationIndex

(
    uint32 ActorIndex,
    uint8 State
)

Determines a permutation index for the given actor and state

Public function

uint8

 

DetermineStateForActor

(
    uint32 ActorIndex,
    bool& bShouldProcess
)

This uses the StateProcessor to determine the state index the actor is currently in

Public function

bool

 

DoAnyActorsRequireTicking

(
    const InstanceType& Instance
)

Public function

void

 

FreeAdditiveInstance

(
    uint8 StateIndex,
    FAdditiveAnimationInstance* In...
)

Frees up an Additive Animation instance and resets it state

Public function

void

 

FreeBlendInstance

(
    FTransitionBlendInstance* Inst...
)

Frees up a Blend instance and resets its state

Public function

void

 

KickoffInstances()

Kicks off the blend and on-demand instances at the end of the current frame tick, this sets up the blend instance with the correct components to blend between

Public function

void

 

RemoveAdditiveInstance

(
    int32 InstanceIndex
)

Public function

void

 

RemoveBlendInstance

(
    int32 InstanceIndex
)

Removal functions which also make sure that indices of other data-structres are correctly remapped

Public function

void

 

RemoveComponent

(
    int32 ComponentIndex
)

Public function

void

 

RemoveFromCurrentBlend

(
    int32 ActorIndex
)

Removal functions which also make sure the actor is set to the correct master pose component

Public function

void

 

RemoveFromCurrentOnDemand

(
    int32 ActorIndex
)

Public function

void

 

RemoveOnDemandInstance

(
    int32 InstanceIndex
)

Public function

void

 

SetComponentTick

(
    uint8 StateIndex,
    uint32 ComponentIndex
)

Sets the whether or not any of the slave components are visible

Public function

void

 

SetComponentUsage

(
    bool bUsage,
    uint8 StateIndex,
    uint32 ComponentIndex
)

Marks the component as either used/not-used, this is used to disable ticking of components which are not in use

Public function

void

 

SetMasterComponentForActor

(
    uint32 ActorIndex,
    USkeletalMeshComponent* Compon...
)

Sets up all components of an actor to be slaves of Component

Public function

void

 

SetPermutationSlaveComponent

(
    uint8 StateIndex,
    uint32 ActorIndex,
    uint32 PermutationIndex
)

Sets up the correct MasterPoseComponent according to the state and permutation indices

Public function

bool

 

Setup

(
    UAnimationSharingManager* Anim...,
    const FPerSkeletonAnimationSharingS...,
    const FAnimationSharingScalability ...,
    uint32 Index
)

Initial set up of all animation sharing data and states

Public function

uint32

 

SetupAdditiveInstance

(
    uint8 StateIndex,
    uint8 FromState,
    uint8 StateComponentIndex
)

Retrieves an additive instance, these are unique and cannot be reused

Public function

uint32

 

SetupBlend

(
    uint8 FromState,
    uint8 ToState,
    uint32 ActorIndex
)

Retrieves a blend instance, this could either mean reusing an already in progress one or a brand new one (if available according to scalability settings) returns whether or not the setup was successful

Public function

uint32

 

SetupBlendBetweenOnDemands

(
    uint8 FromOnDemandInstanceIndex,
    uint32 ToOnDemandInstanceIndex,
    uint32 ActorIndex
)

Retrieves a blend instance, and sets up a blend between a currently running On-Demand instance and another one which was started this frame

Public function

uint32

 

SetupBlendFromOnDemand

(
    uint8 ToState,
    uint32 OnDemandInstanceIndex,
    uint32 ActorIndex
)

Retrieves a blend instance, and sets up a blend from a currently running On-Demand instance to ToState

Public function

uint32

 

SetupBlendToOnDemand

(
    uint8 FromState,
    uint32 ToOnDemandInstanceIndex,
    uint32 ActorIndex
)

Retrieves a blend instance, and setups up a blend to an On-Demand instance from a regular animation state

Public function

uint32

 

SetupOnDemandInstance

(
    uint8 StateIndex
)

Retrieves a blend instance, this could either mean reusing an already in progress one or a brand new one (if available according to scalability settings) returns an index into OnDemandInstances array or INDEX_NONE if unable to setup an instance

Public function

void

 

SetupSlaveComponent

(
    uint8 CurrentState,
    uint32 ActorIndex
)

Sets up the correct MasterPoseComponent for the passed in Component and State indices

Public function

void

 

SetupState

(
    FPerStateData& StateData,
    const FAnimationStateEntry& StateE...,
    USkeletalMesh* SkeletalMesh,
    const FPerSkeletonAnimationSharingS...,
    uint32 Index
)

Populates data for a state setup

Public function

void

 

SwitchBetweenOnDemands

(
    uint32 FromOnDemandInstanceIndex,
    uint32 ToOnDemandInstanceIndex,
    uint32 ActorIndex
)

Switches between on-demand instances directly, without blending

Public function

void

 

TickActorStates()

Ticks all Actor Data entries and determines their current state, if changed since last tick it will alter their animation accordingly

Public function

void

 

TickAdditiveInstances()

Ticks all currently running additive animation instances, this checks whether or not it has finished yet and sets the base-component as the master component when it has

Public function

void

 

TickAnimationStates()

Ticks all unique animation states, this checks which components are currently used and turns of those which currently don't have any slaves

Public function

void

 

TickBlendInstances()

Ticks all currently running blend instances, checks whether or not the blend is finished and forwards the actor/components to the correct animation state

Public function

void

 

TickDebugInformation()

Ticks various types of debugging data / drawing (not active in shipping build)

Public function

void

 

TickOnDemandInstances()

Ticks all currently running on-demand instances, this checks whether or not the animation has finished or if we have to start blending out of the state already

Overridden from UObject

Name Description

Public function Virtual

void

 

BeginDestroy()

Called before destroying the object.