You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Skeleton compatibility is now bi-directional. Specifying a compatible skeleton A -> B now implies B -> A. Skeleton compatibility is now an editor-only concern. The runtime will attempt to do the 'best it can' via name -> name mappings. Only the editor will prevent assigning incompatible skeletons in (e.g.) asset pickers etc. Skeleton compatibility checks in editor can now be disabled in the editor preferences (and each asset picker now has a checkbox option in its view settings that allows for quick access to this). Moves FSkeletonRemapping to its own file (which is now private). Skeleton remappings are now generated on demand on worker threads just before animation decompression and stored in a registry, guarded by FRWScopeLock for thread-safety. Fixed some anim BP compiler edge cases where asset references on pins were not getting preloaded correctly, causing skeletons to be erroneously reported as missing. Exposed the current asset registry filter in SAssetView so that menu extensions can access it (and use it to provide context) #jira UE-166054 #jira UE-167355 #rb Jurre.deBaare,John.vanderBerg #preflight 635902602e6690262afa86f9 [CL 22878911 by Thomas Sarkanen in ue5-main branch]
64 lines
2.1 KiB
C++
64 lines
2.1 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "AnimGraphNode_PoseHandler.h"
|
|
#include "Animation/PoseAsset.h"
|
|
#include "AnimNodes/AnimNode_PoseHandler.h"
|
|
#include "Kismet2/CompilerResultsLog.h"
|
|
#include "IAnimBlueprintNodeOverrideAssetsContext.h"
|
|
|
|
UAnimGraphNode_PoseHandler::UAnimGraphNode_PoseHandler(const FObjectInitializer& ObjectInitializer)
|
|
:Super(ObjectInitializer)
|
|
{
|
|
|
|
}
|
|
|
|
void UAnimGraphNode_PoseHandler::ValidateAnimNodeDuringCompilation(USkeleton* ForSkeleton, FCompilerResultsLog& MessageLog)
|
|
{
|
|
Super::ValidateAnimNodeDuringCompilation(ForSkeleton, MessageLog);
|
|
|
|
ValidateAnimNodeDuringCompilationHelper(ForSkeleton, MessageLog, GetPoseHandlerNode()->PoseAsset, UPoseAsset::StaticClass(), FindPin(GET_MEMBER_NAME_STRING_CHECKED(FAnimNode_PoseHandler, PoseAsset)), GET_MEMBER_NAME_CHECKED(FAnimNode_PoseHandler, PoseAsset));
|
|
}
|
|
|
|
void UAnimGraphNode_PoseHandler::SetAnimationAsset(UAnimationAsset* Asset)
|
|
{
|
|
if (UPoseAsset* PoseAsset = Cast<UPoseAsset>(Asset))
|
|
{
|
|
GetPoseHandlerNode()->PoseAsset = PoseAsset;
|
|
}
|
|
}
|
|
|
|
void UAnimGraphNode_PoseHandler::OnOverrideAssets(IAnimBlueprintNodeOverrideAssetsContext& InContext) const
|
|
{
|
|
if(InContext.GetAssets().Num() > 0)
|
|
{
|
|
if (UPoseAsset* PoseAsset = Cast<UPoseAsset>(InContext.GetAssets()[0]))
|
|
{
|
|
FAnimNode_PoseHandler& AnimNode = InContext.GetAnimNode<FAnimNode_PoseHandler>();
|
|
AnimNode.SetPoseAsset(PoseAsset);
|
|
}
|
|
}
|
|
}
|
|
|
|
void UAnimGraphNode_PoseHandler::PreloadRequiredAssets()
|
|
{
|
|
PreloadRequiredAssetsHelper(GetPoseHandlerNode()->PoseAsset, FindPin(GET_MEMBER_NAME_STRING_CHECKED(FAnimNode_PoseHandler, PoseAsset)));
|
|
|
|
Super::PreloadRequiredAssets();
|
|
}
|
|
|
|
UAnimationAsset* UAnimGraphNode_PoseHandler::GetAnimationAsset() const
|
|
{
|
|
UPoseAsset* PoseAsset = GetPoseHandlerNode()->PoseAsset;
|
|
UEdGraphPin* PoseAssetPin = FindPin(GET_MEMBER_NAME_STRING_CHECKED(FAnimNode_PoseHandler, PoseAsset));
|
|
if (PoseAssetPin != nullptr && PoseAsset == nullptr)
|
|
{
|
|
PoseAsset = Cast<UPoseAsset>(PoseAssetPin->DefaultObject);
|
|
}
|
|
|
|
return PoseAsset;
|
|
}
|
|
|
|
TSubclassOf<UAnimationAsset> UAnimGraphNode_PoseHandler::GetAnimationAssetClass() const
|
|
{
|
|
return UPoseAsset::StaticClass();
|
|
} |