UAnimInstance::AddPoseSnapshot
#include "Animation/AnimInstance.h"
Access: public
Specifiers: ENGINE_API
Description
Registers a pre-constructed pose snapshot under the given name. Unlike SavePoseSnapshot which captures the current pose automatically, this function lets you provide a manually built FPoseSnapshot — useful when constructing poses procedurally or importing them from an external source.
Caveats & Gotchas
- • If a snapshot with the same name already exists, it is overwritten without warning. Use GetPoseSnapshot first if you need to check for an existing snapshot before replacing it.
- • The snapshot data is copied into internal storage. Modifying the passed-in FPoseSnapshot after this call does not affect the stored version — you must call AddPoseSnapshot again to update it.
Signature
ENGINE_API void AddPoseSnapshot(FName SnapshotName, FPoseSnapshot& InSnapshot); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| SnapshotName | FName | Name under which to store the snapshot, used later to retrieve it from the animation graph via a Pose Snapshot node. | — |
| InSnapshot | FPoseSnapshot& | The pre-built pose snapshot data to add. The snapshot struct contains bone transforms and curve values. | — |
Return Type
void Example
Add a procedurally constructed pose snapshot C++
void UMyAnimInstance::StoreCustomPose()
{
FPoseSnapshot Snapshot;
Snapshot.SkeletalMeshName = GetSkelMeshComponent()->GetSkeletalMeshAsset()->GetFName();
Snapshot.BoneNames = GetSkelMeshComponent()->GetBoneNames();
// Populate transforms from custom source
Snapshot.LocalTransforms = ComputeCustomBoneTransforms();
AddPoseSnapshot(FName("CustomPose"), Snapshot);
} See Also
Tags
Version History
Introduced in: 4.20
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?