UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AnimNode_CopyPoseFromMesh.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 "AnimNode_CopyPoseFromMesh.generated.h"
9
10class USkeletalMeshComponent;
12
17USTRUCT(BlueprintInternalUseOnly)
19{
21
22 /* This is used by default if it's valid */
23 UPROPERTY(BlueprintReadWrite, transient, Category=Copy, meta=(PinShownByDefault))
25
26 /* If SourceMeshComponent is not valid, and if this is true, it will look for attahced parent as a source */
27 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Copy, meta = (NeverAsPin))
28 uint8 bUseAttachedParent : 1;
29
30 /* Copy curves also from SouceMeshComponent. This will copy the curves if this instance also contains curve attributes */
31 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Copy, meta = (NeverAsPin))
32 uint8 bCopyCurves : 1;
33
34 /* Copy custom attributes (animation attributes) from SourceMeshComponent */
35 UPROPERTY(EditAnywhere, BlueprintReadWrite, DisplayName = "Copy Custom Attributes(Animation Attributes)",Category = Copy, meta = (NeverAsPin))
37
38 /* Use root space transform to copy to the target pose. By default, it copies their relative transform (bone space)*/
39 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Copy, meta = (NeverAsPin))
40 uint8 bUseMeshPose : 1;
41
42 /* If you want to specify copy root, use this - this will ensure copy only below of this joint (inclusively) */
43 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Copy, meta = (NeverAsPin))
44 FName RootBoneToCopy;
45
47
48 // FAnimNode_Base interface
54 virtual bool HasPreUpdate() const override { return true; }
55 ANIMGRAPHRUNTIME_API virtual void PreUpdate(const UAnimInstance* InAnimInstance) override;
56 // End of FAnimNode_Base interface
57
58private:
59 // this is source mesh references, so that we could compare and see if it has changed
60 TWeakObjectPtr<USkeletalMeshComponent> CurrentlyUsedSourceMeshComponent;
61 TWeakObjectPtr<USkeletalMesh> CurrentlyUsedSourceMesh;
62 TWeakObjectPtr<USkeletalMesh> CurrentlyUsedMesh;
63
64 // target mesh
65 TWeakObjectPtr<USkeletalMesh> CurrentlyUsedTargetMesh;
66 // cache of target space bases to source space bases
67 TMap<int32, int32> BoneMapToSource;
68 TMap<int32, int32> SourceBoneToTarget;
69
70 // Cached transforms, copied on the game thread
71 TArray<FTransform> SourceMeshTransformArray;
72
73 // Cached curves, copied on the game thread
74 FBlendedHeapCurve SourceCurves;
75
76 // Cached attributes, copied on the game thread
77 UE::Anim::FMeshAttributeContainer SourceCustomAttributes;
78
79 // reinitialize mesh component
82};
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define USTRUCT(...)
Definition ObjectMacros.h:746
#define GENERATED_USTRUCT_BODY(...)
Definition ObjectMacros.h:767
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition NameTypes.h:617
Definition Array.h:670
Definition UnrealString.h.inl:34
Definition AnimInstance.h:353
Definition AnimInstanceProxy.h:144
friend class USkeletalMeshComponent
Definition AnimInstanceProxy.h:584
ENGINE_API void GatherDebugData(FNodeDebugData &DebugData)
Definition AnimInstanceProxy.cpp:2193
virtual ENGINE_API void PreUpdate(UAnimInstance *InAnimInstance, float DeltaSeconds)
Definition AnimInstanceProxy.cpp:469
Definition AnimNodeBase.h:853
Definition AnimNode_CopyPoseFromMesh.h:19
Definition AnimNodeBase.h:337
Definition AnimNodeBase.h:324
Definition AnimNodeBase.h:354
Definition AnimCurveTypes.h:1049
Definition AnimNodeBase.h:642
Definition AnimNodeBase.h:479
Definition WeakObjectPtrTemplates.h:25
Definition AttributesRuntime.h:42