Files
UnrealEngine/Engine/Plugins/Runtime/Metasound/Source/MetasoundEditor/Private/MetasoundNodeConfigurationCustomization.cpp
Brandyn / Techy fcc1b09210 init
2026-04-04 15:40:51 -05:00

41 lines
1.5 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "MetasoundNodeConfigurationCustomization.h"
#include "MetasoundEditorGraphNode.h"
#include "MetasoundFrontendDocumentBuilder.h"
#include "MetasoundBuilderBase.h"
#include "PropertyHandle.h"
#include "IDetailPropertyRow.h"
namespace Metasound::Editor
{
void FMetaSoundNodeConfigurationDataDetails::OnChildRowAdded(IDetailPropertyRow& ChildRow)
{
FInstancedStructDataDetails::OnChildRowAdded(ChildRow);
TSharedPtr<IPropertyHandle> ChildHandle = ChildRow.GetPropertyHandle();
if (ChildHandle)
{
TDelegate<void(const FPropertyChangedEvent&)> OnValueChangedDelegate = TDelegate<void(const FPropertyChangedEvent&)>::CreateSP(this, &FMetaSoundNodeConfigurationDataDetails::OnChildPropertyChanged);
ChildHandle->SetOnPropertyValueChangedWithData(OnValueChangedDelegate);
ChildHandle->SetOnChildPropertyValueChangedWithData(OnValueChangedDelegate);
}
}
void FMetaSoundNodeConfigurationDataDetails::OnChildPropertyChanged(const FPropertyChangedEvent& InPropertyChangedEvent)
{
if (GraphNode.IsValid())
{
// Don't update interface on interactive changes (ex. dragging slider) to avoid refresh spam
if (InPropertyChangedEvent.ChangeType != EPropertyChangeType::Interactive)
{
// Update the node config interface
FMetaSoundFrontendDocumentBuilder& DocBuilder = GraphNode->GetBuilderChecked().GetBuilder();
const FGuid& NodeID = GraphNode->GetNodeID();
DocBuilder.UpdateNodeInterfaceFromConfiguration(NodeID);
}
}
}
} // namespace Metasound::Editor