You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
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]
68 lines
1.4 KiB
C++
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;
|
|
}
|