You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
- Expose I/O arrays to UI (TODO: fix rename. We currently have two places we're caching input/output names and no easy way to snatch I/O metadata from I/O node. Could we add function to reference name from description instead of caching on node?) - Stub in json import exposition to UI - Fix crash with removing inputs/outputs - Various clean-up #rb ethan.geller #jira UEAU-527 [CL 13937505 by Rob Gay in ue5-main branch]
85 lines
1.7 KiB
C++
85 lines
1.7 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"
|
|
|
|
|
|
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;
|
|
}
|
|
|
|
const FText& UMetasound::GetInputToolTip(FString InputName) const
|
|
{
|
|
for (const FMetasoundInputDescription& Desc : RootMetasoundDocument.RootClass.Inputs)
|
|
{
|
|
if (Desc.Name == InputName)
|
|
{
|
|
return Desc.ToolTip;
|
|
}
|
|
}
|
|
|
|
return FText::GetEmpty();
|
|
}
|
|
|
|
const FText& UMetasound::GetOutputToolTip(FString OutputName) const
|
|
{
|
|
for (const FMetasoundOutputDescription& Desc : RootMetasoundDocument.RootClass.Outputs)
|
|
{
|
|
if (Desc.Name == OutputName)
|
|
{
|
|
return Desc.ToolTip;
|
|
}
|
|
}
|
|
|
|
return FText::GetEmpty();
|
|
}
|
|
|
|
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();
|
|
}
|
|
|
|
// delete this asset's current metasound document,
|
|
// and replace it with InClassDescription.
|
|
void UMetasound::SetMetasoundDocument(const FMetasoundDocument& InDocument)
|
|
{
|
|
RootMetasoundDocument = InDocument;
|
|
}
|