Files
UnrealEngineUWP/Engine/Source/Editor/AnimGraph/Private/AnimBlueprintExtension_BlendSpaceGraph.cpp
thomas sarkanen 659801cd66 Fix internal blendspaces not being saved/copied in certain circumstances
As the blendspace was duplicated from a previously duplicated node, it was marked as transient and hence was not saved along with the class. This is not a problem in the editor as the blend space is always regenerated on load, but in cooked games the blendspace was never saved in the cook and thus not present at runtime.

#jira FROST-2756
#rb Jurre.deBaare,Danny.Chapman

#ROBOMERGE-SOURCE: CL 16416162 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v811-16416015)

[CL 16416163 by thomas sarkanen in ue5-main branch]
2021-05-21 07:50:50 -04:00

18 lines
730 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "AnimBlueprintExtension_BlendSpaceGraph.h"
#include "Animation/BlendSpace.h"
void UAnimBlueprintExtension_BlendSpaceGraph::HandleStartCompilingClass(const UClass* InClass, IAnimBlueprintCompilationBracketContext& InCompilationContext, IAnimBlueprintGeneratedClassCompiledData& OutCompiledData)
{
Subsystem.BlendSpaces.Empty();
Class = const_cast<UClass*>(InClass);
}
UBlendSpace* UAnimBlueprintExtension_BlendSpaceGraph::AddBlendSpace(UBlendSpace* InSourceBlendSpace)
{
UBlendSpace* CopiedBlendSpace = DuplicateObject(InSourceBlendSpace, Class);
CopiedBlendSpace->ClearFlags(RF_Transient);
Subsystem.BlendSpaces.Add(CopiedBlendSpace);
return CopiedBlendSpace;
}