You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
MetaSound preset fixes: Update node descriptions for referencing graphs, remove variable header, prevent preset vertices from being renamed
#jira UE-144913 #jira UE-158433 #rb rob.gay #preflight 634de597820aa0c193075786 [CL 22628259 by helen yang in ue5-main branch]
This commit is contained in:
@@ -2892,10 +2892,19 @@ namespace Metasound
|
||||
|
||||
void FEditor::CollectStaticSections(TArray<int32>& StaticSectionIDs)
|
||||
{
|
||||
Frontend::FConstDocumentHandle DocumentHandle = GetMetaSoundGraphChecked().GetDocumentHandle();
|
||||
const FMetasoundFrontendGraphClass& RootGraphClass = DocumentHandle->GetRootGraphClass();
|
||||
const bool bIsPreset = RootGraphClass.PresetOptions.bIsPreset;
|
||||
|
||||
for (int32 i = 0; i < static_cast<int32>(ENodeSection::COUNT); ++i)
|
||||
{
|
||||
if (static_cast<ENodeSection>(i) != ENodeSection::None)
|
||||
{
|
||||
// Presets do not have variables
|
||||
if (bIsPreset && static_cast<ENodeSection>(i) == ENodeSection::Variables)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
StaticSectionIDs.Add(i);
|
||||
}
|
||||
}
|
||||
|
||||
+16
-1
@@ -217,6 +217,9 @@ void UMetasoundEditorGraphVertex::SetDescription(const FText& InDescription, boo
|
||||
|
||||
FNodeHandle NodeHandle = GetNodeHandle();
|
||||
NodeHandle->SetDescription(InDescription);
|
||||
|
||||
Graph->RegisterGraphWithFrontend();
|
||||
Graph->GetModifyContext().AddMemberIDsModified({ GetMemberID() });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -538,7 +541,10 @@ bool UMetasoundEditorGraphVertex::IsInterfaceMember() const
|
||||
|
||||
bool UMetasoundEditorGraphVertex::CanRename() const
|
||||
{
|
||||
return !IsInterfaceMember();
|
||||
Metasound::Frontend::FConstDocumentHandle DocumentHandle = GetOwningGraph()->GetDocumentHandle();
|
||||
const FMetasoundFrontendGraphClass& RootGraphClass = DocumentHandle->GetRootGraphClass();
|
||||
|
||||
return !RootGraphClass.PresetOptions.bIsPreset && !IsInterfaceMember();
|
||||
}
|
||||
|
||||
bool UMetasoundEditorGraphVertex::CanRename(const FText& InNewName, FText& OutError) const
|
||||
@@ -557,6 +563,15 @@ bool UMetasoundEditorGraphVertex::CanRename(const FText& InNewName, FText& OutEr
|
||||
return false;
|
||||
}
|
||||
|
||||
Metasound::Frontend::FConstDocumentHandle DocumentHandle = GetOwningGraph()->GetDocumentHandle();
|
||||
const FMetasoundFrontendGraphClass& RootGraphClass = DocumentHandle->GetRootGraphClass();
|
||||
|
||||
if (RootGraphClass.PresetOptions.bIsPreset)
|
||||
{
|
||||
OutError = FText::Format(LOCTEXT("GraphVertexRenameInvalid_Preset", "{0} is a vertex in a preset graph and cannot be renamed."), InNewName);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool bIsNameValid = true;
|
||||
const FString NewName = InNewName.ToString();
|
||||
FConstNodeHandle NodeHandle = GetConstNodeHandle();
|
||||
|
||||
Reference in New Issue
Block a user