Ensure that BP events are called in anim BP editor when recompiling

More fallout from the new re-instancing path

#jira UE-157753
#rb Jurre.deBaare
#preflight 632345b7600516561b058ea1

[CL 22038407 by samuele rigamonti in ue5-main branch]
This commit is contained in:
samuele rigamonti
2022-09-15 17:07:04 -04:00
parent c4652e5977
commit 297bafa165

View File

@@ -3854,19 +3854,17 @@ void UAnimInstance::HandleObjectsReinstanced(const TMap<UObject*, UObject*>& Old
if(bThisObjectWasReinstanced)
{
TRACE_OBJECT_LIFETIME_BEGIN(this);
RecalcRequiredBones();
// Minimally reinit proxy (i.e. dont call per-node initialization) unless we are in an editor preview world (i.e. we are in the anim BP editor)
FAnimInstanceProxy& Proxy = GetProxyOnGameThread<FAnimInstanceProxy>();
UWorld* World = GetWorld();
if(World && World->WorldType == EWorldType::EditorPreview)
{
Proxy.Initialize(this);
Proxy.InitializeRootNode();
InitializeAnimation(false);
}
else
{
RecalcRequiredBones();
FAnimInstanceProxy& Proxy = GetProxyOnGameThread<FAnimInstanceProxy>();
Proxy.Initialize(this);
Proxy.InitializeCachedClassData();
Proxy.InitializeRootNode_WithRoot(Proxy.RootNode);