Files
UnrealEngineUWP/Engine/Plugins/Runtime/Metasound/Source/MetasoundEngine/Private/Metasound.cpp
Ethan Geller 529318d783 #jira UEAU-524
Implement UMetasoundSource, Archetype registry, and implement Archetype support in the metasound editor.
#rb rob.gay, phil.popp
#fyi rob.gay, phil.popp

[CL 13940440 by Ethan Geller in ue5-main branch]
2020-07-23 20:32:26 -04:00

68 lines
1.4 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "Metasound.h"
#include "CoreMinimal.h"
#include "HAL/FileManager.h"
#include "StructSerializer.h"
#include "UObject/UnrealType.h"
#include "MetasoundArchetypeRegistration.h"
UMetasound::UMetasound(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
, FMetasoundAssetBase(RootMetasoundDocument)
{
}
#if WITH_EDITORONLY_DATA
UEdGraph* UMetasound::GetGraph()
{
return Graph;
}
const UEdGraph* UMetasound::GetGraph() const
{
return Graph;
}
UEdGraph& UMetasound::GetGraphChecked()
{
check(Graph);
return *Graph;
}
const UEdGraph& UMetasound::GetGraphChecked() const
{
check(Graph);
return *Graph;
}
void UMetasound::SetGraph(UEdGraph* InGraph)
{
Graph = InGraph;
}
#endif // WITH_EDITORONLY_DATA
// This can be used to update the metadata (name, author, etc) for this metasound.
// @param InMetadata may be updated with any corrections we do to the input metadata.
void UMetasound::SetMetadata(FMetasoundClassMetadata& InMetadata)
{
FMetasoundAssetBase::SetMetadata(InMetadata);
MarkPackageDirty();
}
void UMetasound::PostLoad()
{
ConformDocumentToArchetype();
}
FMetasoundArchetype UMetasound::GetArchetype() const
{
FMetasoundArchetype Archetype;
static FName MetasoundArchetypeName = TEXT("Generic Metasound");
Archetype.ArchetypeName = MetasoundArchetypeName;
return Archetype;
}