Files
UnrealEngine/Engine/Plugins/Animation/PoseSearch/Source/Editor/Private/PoseSearchMeshComponent.cpp
Brandyn / Techy fcc1b09210 init
2026-04-04 15:40:51 -05:00

40 lines
1.2 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "PoseSearchMeshComponent.h"
#include "Engine/SkinnedAsset.h"
#include UE_INLINE_GENERATED_CPP_BY_NAME(PoseSearchMeshComponent)
void UPoseSearchMeshComponent::Initialize(const FTransform& InComponentToWorld)
{
SetComponentToWorld(InComponentToWorld);
const FReferenceSkeleton& SkeletalMeshRefSkeleton = GetSkinnedAsset()->GetRefSkeleton();
// set up bone visibility states as this gets skipped since we allocate the component array before registration
for (int32 BaseIndex = 0; BaseIndex < 2; ++BaseIndex)
{
BoneVisibilityStates[BaseIndex].SetNum(SkeletalMeshRefSkeleton.GetNum());
for (int32 BoneIndex = 0; BoneIndex < SkeletalMeshRefSkeleton.GetNum(); BoneIndex++)
{
BoneVisibilityStates[BaseIndex][BoneIndex] = BVS_ExplicitlyHidden;
}
}
Refresh();
}
void UPoseSearchMeshComponent::Refresh()
{
// Flip buffers once to copy the directly-written component space transforms
bNeedToFlipSpaceBaseBuffers = true;
bHasValidBoneTransform = false;
FlipEditableSpaceBases();
bHasValidBoneTransform = true;
InvalidateCachedBounds();
UpdateBounds();
MarkRenderTransformDirty();
MarkRenderDynamicDataDirty();
MarkRenderStateDirty();
}