UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
CachedAnimDataLibrary.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
8#include "CachedAnimDataLibrary.generated.h"
9
10class UAnimInstance;
11
15UCLASS(meta = (ScriptName = "CachedAnimDataLibrary"), MinimalAPI)
17{
19
20 /*** CachedAnimStateData ***/
21
22 // Returns whether a state is relevant (specified in the provided FCachedAnimStateData)
23 UFUNCTION(BlueprintPure, Category = "Utilities|Animation|StateMachine")
24 static ENGINE_API bool StateMachine_IsStateRelevant(UAnimInstance* InAnimInstance, UPARAM(ref) const FCachedAnimStateData& CachedAnimStateData);
25
26 // Returns the weight of a state, relative to its state machine (specified in the provided FCachedAnimStateData)
27 UFUNCTION(BlueprintPure, Category = "Utilities|Animation|StateMachine")
28 static ENGINE_API float StateMachine_GetLocalWeight(UAnimInstance* InAnimInstance, UPARAM(ref) const FCachedAnimStateData& CachedAnimStateData);
29
30 // Returns the weight of a state, relative to the graph (specified in the provided FCachedAnimStateData)
31 UFUNCTION(BlueprintPure, Category = "Utilities|Animation|StateMachine")
32 static ENGINE_API float StateMachine_GetGlobalWeight(UAnimInstance* InAnimInstance, UPARAM(ref) const FCachedAnimStateData& CachedAnimStateData);
33
34 /*** CachedAnimStateArray ***/
35
36 // Returns the summed weight of a state or states, relative to their state machine (specified in the provided FCachedAnimStateArray)
37 UFUNCTION(BlueprintPure, Category = "Utilities|Animation|StateMachine")
38 static ENGINE_API float StateMachine_GetTotalWeight(UAnimInstance* InAnimInstance, UPARAM(ref) const FCachedAnimStateArray& CachedAnimStateArray);
39
40 // Returns true when the weight of the input state (or summed weight for multiple input states) is 1.0 of greater (specified in the provided FCachedAnimStateArray)
41 UFUNCTION(BlueprintPure, Category = "Utilities|Animation|StateMachine")
42 static ENGINE_API bool StateMachine_IsFullWeight(UAnimInstance* InAnimInstance, UPARAM(ref) const FCachedAnimStateArray& CachedAnimStateArray);
43
44 // Returns true when the input state, or states, have any weight (specified in the provided FCachedAnimStateArray)
45 UFUNCTION(BlueprintPure, Category = "Utilities|Animation|StateMachine")
46 static ENGINE_API bool StateMachine_IsRelevant(UAnimInstance* InAnimInstance, UPARAM(ref) const FCachedAnimStateArray& CachedAnimStateArray);
47
48 /*** CachedAnimAssetPlayerData ***/
49
50 // Gets the accumulated time, in seconds, of the asset player in the specified state. Assumes only one player in the state (specified in the provided FCachedAnimAssetPlayerData)
51 UFUNCTION(BlueprintPure, Category = "Utilities|Animation|StateMachine")
52 static ENGINE_API float StateMachine_GetAssetPlayerTime(UAnimInstance* InAnimInstance, UPARAM(ref) const FCachedAnimAssetPlayerData& CachedAnimAssetPlayerData);
53
54 // Gets the accumulated time, as a fraction, of the asset player in the specified state. Assumes only one player in the state (specified in the provided FCachedAnimAssetPlayerData)
55 UFUNCTION(BlueprintPure, Category = "Utilities|Animation|StateMachine")
56 static ENGINE_API float StateMachine_GetAssetPlayerTimeRatio(UAnimInstance* InAnimInstance, UPARAM(ref) const FCachedAnimAssetPlayerData& CachedAnimAssetPlayerData);
57
58 /*** CachedAnimRelevancyData ***/
59
60 // Gets the accumulated time, in seconds, of the most relevant asset player in the specified state (specified in the provided FCachedAnimRelevancyData)
61 UFUNCTION(BlueprintPure, Category = "Utilities|Animation|StateMachine")
62 static ENGINE_API float StateMachine_GetRelevantAnimTime(UAnimInstance* InAnimInstance, UPARAM(ref) const FCachedAnimRelevancyData& CachedAnimRelevancyData);
63
64 // Gets the time to the end of the asset, in seconds, of the most relevant asset player in the specified state (specified in the provided FCachedAnimRelevancyData)
65 UFUNCTION(BlueprintPure, Category = "Utilities|Animation|StateMachine")
66 static ENGINE_API float StateMachine_GetRelevantAnimTimeRemaining(UAnimInstance* InAnimInstance, UPARAM(ref) const FCachedAnimRelevancyData& CachedAnimRelevancyData);
67
68 // Gets the time to the end of the asset, as a fraction, of the most relevant asset player in the specified state (specified in the provided FCachedAnimRelevancyData)
69 UFUNCTION(BlueprintPure, Category = "Utilities|Animation|StateMachine")
70 static ENGINE_API float StateMachine_GetRelevantAnimTimeRemainingFraction(UAnimInstance* InAnimInstance, UPARAM(ref) const FCachedAnimRelevancyData& CachedAnimRelevancyData);
71
72 /*** CachedAnimTransitionData ***/
73
74 // Gets the crossfade duration of the transition between the two input states. If multiple transition rules exist, the first will be returned (specified in the provided FCachedAnimTransitionData)
75 UFUNCTION(BlueprintPure, Category = "Utilities|Animation|StateMachine")
76 static ENGINE_API float StateMachine_GetCrossfadeDuration(UAnimInstance* InAnimInstance, UPARAM(ref) const FCachedAnimTransitionData& CachedAnimTransitionData);
77
78};
79
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UPARAM(...)
Definition ObjectMacros.h:748
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define GENERATED_UCLASS_BODY(...)
Definition ObjectMacros.h:768
#define UCLASS(...)
Definition ObjectMacros.h:776
Definition AnimInstance.h:353
Definition BlueprintFunctionLibrary.h:16
Definition CachedAnimDataLibrary.h:17
Definition CachedAnimData.h:92
Definition CachedAnimData.h:121
Definition CachedAnimData.h:65
Definition CachedAnimData.h:17
Definition CachedAnimData.h:153