You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#preflight 636531a1581dc906bce283d1 #rb none [CL 22994620 by henrik karlsson in ue5-main branch]
23 lines
941 B
C++
23 lines
941 B
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
#include "AnimCustomInstanceHelper.h"
|
|
#include "Animation/Skeleton.h"
|
|
#include "Engine/SkeletalMesh.h"
|
|
|
|
/////////////////////////////////////////////////////
|
|
// FAnimCustomInstanceHelper
|
|
/////////////////////////////////////////////////////
|
|
|
|
|
|
bool FAnimCustomInstanceHelper::ShouldCreateCustomInstancePlayer(const USkeletalMeshComponent* SkeletalMeshComponent)
|
|
{
|
|
const USkeletalMesh* SkeletalMesh = SkeletalMeshComponent->GetSkeletalMeshAsset();
|
|
const USkeleton* Skeleton = SkeletalMesh ? SkeletalMesh->GetSkeleton() : nullptr;
|
|
|
|
// create proper anim instance to animate
|
|
UAnimInstance* AnimInstance = SkeletalMeshComponent->GetAnimInstance();
|
|
|
|
return (AnimInstance == nullptr || SkeletalMeshComponent->GetAnimationMode() != EAnimationMode::AnimationBlueprint ||
|
|
AnimInstance->GetClass() != SkeletalMeshComponent->AnimClass || !Skeleton || !AnimInstance->CurrentSkeleton);
|
|
} |