2021-01-13 10:48:59 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#include "MetasoundFrontendController.h"
|
|
|
|
|
|
|
|
|
|
#include "MetasoundFrontendInvalidController.h"
|
2021-10-12 21:21:22 -04:00
|
|
|
#include "MetasoundFrontendDocumentController.h"
|
- Fix for attempting to access EngineSubsystem during MetaSound versioning (serialization), which can assert when apparently certain commands in certain contexts can attempt to preload assets prior to the init phase.
- Minor Fix for LocText duplication
#tests BuildCookRun, -game, version MetaSounds assets in editor, PIE
[FYI] bob.tellez
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL33084850
[FYI] Rob.Gay
Original CL Desc
-----------------------------------------------------------------
Version Metasound Document to include all ed data and make all Metasound EdGraph data transient
- Add input template nodes
- Add comment node data to document
- Keep references to member literal data (i.e. knob/slider ranges) in document metadata to ensure continued serialization and flexibility to add more editor-only fields and literal metadata
- Misc builder API updates, bug fixes and migration of controllers to builder API in anticipation of pages
- Sunset non-deterministic guid cvar
#rb phil.popp, helen.yang
[FYI] sondra.moyls
#tests Standard Automated Audio Tests, EngineTests, Offline QA Smoke pass, CPR, etc., extensive MetaSound Editor use, -game MetaSound qa levels, AudioUnitTests
#jira UE-194159
[CL 33102023 by rob gay in ue5-main branch]
2024-04-19 10:09:04 -04:00
|
|
|
#include "NodeTemplates/MetasoundFrontendNodeTemplateInput.h"
|
2022-09-13 21:51:22 -04:00
|
|
|
#include "NodeTemplates/MetasoundFrontendNodeTemplateReroute.h"
|
|
|
|
|
|
2021-01-13 10:48:59 -04:00
|
|
|
|
|
|
|
|
namespace Metasound
|
|
|
|
|
{
|
|
|
|
|
namespace Frontend
|
|
|
|
|
{
|
- Fix for attempting to access EngineSubsystem during MetaSound versioning (serialization), which can assert when apparently certain commands in certain contexts can attempt to preload assets prior to the init phase.
- Minor Fix for LocText duplication
#tests BuildCookRun, -game, version MetaSounds assets in editor, PIE
[FYI] bob.tellez
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL33084850
[FYI] Rob.Gay
Original CL Desc
-----------------------------------------------------------------
Version Metasound Document to include all ed data and make all Metasound EdGraph data transient
- Add input template nodes
- Add comment node data to document
- Keep references to member literal data (i.e. knob/slider ranges) in document metadata to ensure continued serialization and flexibility to add more editor-only fields and literal metadata
- Misc builder API updates, bug fixes and migration of controllers to builder API in anticipation of pages
- Sunset non-deterministic guid cvar
#rb phil.popp, helen.yang
[FYI] sondra.moyls
#tests Standard Automated Audio Tests, EngineTests, Offline QA Smoke pass, CPR, etc., extensive MetaSound Editor use, -game MetaSound qa levels, AudioUnitTests
#jira UE-194159
[CL 33102023 by rob gay in ue5-main branch]
2024-04-19 10:09:04 -04:00
|
|
|
namespace ControllerPrivate
|
|
|
|
|
{
|
|
|
|
|
// This check for class name is a hack due to the fact that handles do not provide a builder
|
|
|
|
|
// in order to do a proper look-up of a rerouted output's access/data type. Once calling systems of the
|
|
|
|
|
// recurse functions utilizing this function are refactored to use the builder API, this can be removed.
|
|
|
|
|
bool IsRerouteClass(const FMetasoundFrontendClassName& ClassName)
|
|
|
|
|
{
|
|
|
|
|
return ClassName == FRerouteNodeTemplate::ClassName || ClassName == FInputNodeTemplate::ClassName;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-01-13 10:48:59 -04:00
|
|
|
FOutputHandle IOutputController::GetInvalidHandle()
|
|
|
|
|
{
|
2021-10-12 21:21:22 -04:00
|
|
|
static FOutputHandle Invalid = MakeShared<FInvalidOutputController>();
|
|
|
|
|
return Invalid;
|
2021-01-13 10:48:59 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FInputHandle IInputController::GetInvalidHandle()
|
|
|
|
|
{
|
2021-10-12 21:21:22 -04:00
|
|
|
static FInputHandle Invalid = MakeShared<FInvalidInputController>();
|
|
|
|
|
return Invalid;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FVariableHandle IVariableController::GetInvalidHandle()
|
|
|
|
|
{
|
|
|
|
|
static FVariableHandle Invalid = MakeShared<FInvalidVariableController>();
|
|
|
|
|
return Invalid;
|
2021-01-13 10:48:59 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FNodeHandle INodeController::GetInvalidHandle()
|
|
|
|
|
{
|
2021-10-12 21:21:22 -04:00
|
|
|
static FNodeHandle Invalid = MakeShared<FInvalidNodeController>();
|
|
|
|
|
return Invalid;
|
2021-01-13 10:48:59 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FGraphHandle IGraphController::GetInvalidHandle()
|
|
|
|
|
{
|
2021-10-12 21:21:22 -04:00
|
|
|
static FGraphHandle Invalid = MakeShared<FInvalidGraphController>();
|
|
|
|
|
return Invalid;
|
2021-01-13 10:48:59 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FDocumentHandle IDocumentController::GetInvalidHandle()
|
|
|
|
|
{
|
2021-10-12 21:21:22 -04:00
|
|
|
static FDocumentHandle Invalid = MakeShared<FInvalidDocumentController>();
|
|
|
|
|
return Invalid;
|
2021-01-13 10:48:59 -04:00
|
|
|
}
|
|
|
|
|
|
2021-05-10 19:52:56 -04:00
|
|
|
FDocumentHandle IDocumentController::CreateDocumentHandle(FDocumentAccessPtr InDocument)
|
2021-01-13 10:48:59 -04:00
|
|
|
{
|
|
|
|
|
// Create using standard document controller.
|
|
|
|
|
return FDocumentController::CreateDocumentHandle(InDocument);
|
|
|
|
|
}
|
2021-01-13 19:18:22 -04:00
|
|
|
|
2021-05-20 19:33:21 -04:00
|
|
|
FDocumentHandle IDocumentController::CreateDocumentHandle(FMetasoundFrontendDocument& InDocument)
|
|
|
|
|
{
|
|
|
|
|
return CreateDocumentHandle(MakeAccessPtr<FDocumentAccessPtr>(InDocument.AccessPoint, InDocument));
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-10 19:52:56 -04:00
|
|
|
FConstDocumentHandle IDocumentController::CreateDocumentHandle(FConstDocumentAccessPtr InDocument)
|
2021-01-13 19:18:22 -04:00
|
|
|
{
|
|
|
|
|
// Create using standard document controller.
|
2024-05-08 14:53:53 -04:00
|
|
|
return FDocumentController::CreateDocumentHandle(InDocument);
|
2021-01-13 19:18:22 -04:00
|
|
|
}
|
2021-05-20 19:33:21 -04:00
|
|
|
|
|
|
|
|
FConstDocumentHandle IDocumentController::CreateDocumentHandle(const FMetasoundFrontendDocument& InDocument)
|
|
|
|
|
{
|
|
|
|
|
return CreateDocumentHandle(MakeAccessPtr<FConstDocumentAccessPtr>(InDocument.AccessPoint, InDocument));
|
|
|
|
|
}
|
2021-10-12 21:21:22 -04:00
|
|
|
|
|
|
|
|
FDocumentAccess IDocumentAccessor::GetSharedAccess(IDocumentAccessor& InDocumentAccessor)
|
|
|
|
|
{
|
|
|
|
|
return InDocumentAccessor.ShareAccess();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FConstDocumentAccess IDocumentAccessor::GetSharedAccess(const IDocumentAccessor& InDocumentAccessor)
|
|
|
|
|
{
|
|
|
|
|
return InDocumentAccessor.ShareAccess();
|
|
|
|
|
}
|
2022-09-13 21:51:22 -04:00
|
|
|
|
|
|
|
|
FConstOutputHandle FindReroutedOutput(FConstOutputHandle InOutputHandle)
|
|
|
|
|
{
|
|
|
|
|
if (InOutputHandle->IsValid())
|
|
|
|
|
{
|
|
|
|
|
FConstNodeHandle NodeHandle = InOutputHandle->GetOwningNode();
|
|
|
|
|
if (NodeHandle->IsValid())
|
|
|
|
|
{
|
- Fix for attempting to access EngineSubsystem during MetaSound versioning (serialization), which can assert when apparently certain commands in certain contexts can attempt to preload assets prior to the init phase.
- Minor Fix for LocText duplication
#tests BuildCookRun, -game, version MetaSounds assets in editor, PIE
[FYI] bob.tellez
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL33084850
[FYI] Rob.Gay
Original CL Desc
-----------------------------------------------------------------
Version Metasound Document to include all ed data and make all Metasound EdGraph data transient
- Add input template nodes
- Add comment node data to document
- Keep references to member literal data (i.e. knob/slider ranges) in document metadata to ensure continued serialization and flexibility to add more editor-only fields and literal metadata
- Misc builder API updates, bug fixes and migration of controllers to builder API in anticipation of pages
- Sunset non-deterministic guid cvar
#rb phil.popp, helen.yang
[FYI] sondra.moyls
#tests Standard Automated Audio Tests, EngineTests, Offline QA Smoke pass, CPR, etc., extensive MetaSound Editor use, -game MetaSound qa levels, AudioUnitTests
#jira UE-194159
[CL 33102023 by rob gay in ue5-main branch]
2024-04-19 10:09:04 -04:00
|
|
|
const FMetasoundFrontendClassName& ClassName = NodeHandle->GetClassMetadata().GetClassName();
|
|
|
|
|
if (ControllerPrivate::IsRerouteClass(ClassName))
|
2022-09-13 21:51:22 -04:00
|
|
|
{
|
|
|
|
|
TArray<FConstInputHandle> Inputs = NodeHandle->GetConstInputs();
|
|
|
|
|
if (!Inputs.IsEmpty())
|
|
|
|
|
{
|
|
|
|
|
FConstInputHandle RerouteInputHandle = Inputs.Last();
|
|
|
|
|
if (RerouteInputHandle->IsValid())
|
|
|
|
|
{
|
|
|
|
|
FConstOutputHandle ConnectedOutputHandle = RerouteInputHandle->GetConnectedOutput();
|
|
|
|
|
return FindReroutedOutput(ConnectedOutputHandle);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return InOutputHandle;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FindReroutedInputs(FConstInputHandle InHandleToCheck, TArray<FConstInputHandle>& InOutInputHandles)
|
|
|
|
|
{
|
- Fix for attempting to access EngineSubsystem during MetaSound versioning (serialization), which can assert when apparently certain commands in certain contexts can attempt to preload assets prior to the init phase.
- Minor Fix for LocText duplication
#tests BuildCookRun, -game, version MetaSounds assets in editor, PIE
[FYI] bob.tellez
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL33084850
[FYI] Rob.Gay
Original CL Desc
-----------------------------------------------------------------
Version Metasound Document to include all ed data and make all Metasound EdGraph data transient
- Add input template nodes
- Add comment node data to document
- Keep references to member literal data (i.e. knob/slider ranges) in document metadata to ensure continued serialization and flexibility to add more editor-only fields and literal metadata
- Misc builder API updates, bug fixes and migration of controllers to builder API in anticipation of pages
- Sunset non-deterministic guid cvar
#rb phil.popp, helen.yang
[FYI] sondra.moyls
#tests Standard Automated Audio Tests, EngineTests, Offline QA Smoke pass, CPR, etc., extensive MetaSound Editor use, -game MetaSound qa levels, AudioUnitTests
#jira UE-194159
[CL 33102023 by rob gay in ue5-main branch]
2024-04-19 10:09:04 -04:00
|
|
|
using namespace ControllerPrivate;
|
2022-09-13 21:51:22 -04:00
|
|
|
|
|
|
|
|
if (InHandleToCheck->IsValid())
|
|
|
|
|
{
|
|
|
|
|
FConstNodeHandle NodeHandle = InHandleToCheck->GetOwningNode();
|
|
|
|
|
if (NodeHandle->IsValid())
|
|
|
|
|
{
|
- Fix for attempting to access EngineSubsystem during MetaSound versioning (serialization), which can assert when apparently certain commands in certain contexts can attempt to preload assets prior to the init phase.
- Minor Fix for LocText duplication
#tests BuildCookRun, -game, version MetaSounds assets in editor, PIE
[FYI] bob.tellez
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL33084850
[FYI] Rob.Gay
Original CL Desc
-----------------------------------------------------------------
Version Metasound Document to include all ed data and make all Metasound EdGraph data transient
- Add input template nodes
- Add comment node data to document
- Keep references to member literal data (i.e. knob/slider ranges) in document metadata to ensure continued serialization and flexibility to add more editor-only fields and literal metadata
- Misc builder API updates, bug fixes and migration of controllers to builder API in anticipation of pages
- Sunset non-deterministic guid cvar
#rb phil.popp, helen.yang
[FYI] sondra.moyls
#tests Standard Automated Audio Tests, EngineTests, Offline QA Smoke pass, CPR, etc., extensive MetaSound Editor use, -game MetaSound qa levels, AudioUnitTests
#jira UE-194159
[CL 33102023 by rob gay in ue5-main branch]
2024-04-19 10:09:04 -04:00
|
|
|
if (ControllerPrivate::IsRerouteClass(NodeHandle->GetClassMetadata().GetClassName()))
|
2022-09-13 21:51:22 -04:00
|
|
|
{
|
|
|
|
|
TArray<FConstOutputHandle> Outputs = NodeHandle->GetConstOutputs();
|
|
|
|
|
for (FConstOutputHandle& OutputHandle : Outputs)
|
|
|
|
|
{
|
|
|
|
|
TArray<FConstInputHandle> LinkedInputs = OutputHandle->GetConstConnectedInputs();
|
|
|
|
|
for (FConstInputHandle LinkedInput : LinkedInputs)
|
|
|
|
|
{
|
|
|
|
|
FindReroutedInputs(LinkedInput, InOutInputHandles);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
InOutInputHandles.Add(InHandleToCheck);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IterateReroutedInputs(FConstInputHandle InHandleToCheck, TFunctionRef<void(FConstInputHandle)> Func)
|
|
|
|
|
{
|
|
|
|
|
if (InHandleToCheck->IsValid())
|
|
|
|
|
{
|
|
|
|
|
FConstNodeHandle NodeHandle = InHandleToCheck->GetOwningNode();
|
|
|
|
|
if (NodeHandle->IsValid())
|
|
|
|
|
{
|
- Fix for attempting to access EngineSubsystem during MetaSound versioning (serialization), which can assert when apparently certain commands in certain contexts can attempt to preload assets prior to the init phase.
- Minor Fix for LocText duplication
#tests BuildCookRun, -game, version MetaSounds assets in editor, PIE
[FYI] bob.tellez
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL33084850
[FYI] Rob.Gay
Original CL Desc
-----------------------------------------------------------------
Version Metasound Document to include all ed data and make all Metasound EdGraph data transient
- Add input template nodes
- Add comment node data to document
- Keep references to member literal data (i.e. knob/slider ranges) in document metadata to ensure continued serialization and flexibility to add more editor-only fields and literal metadata
- Misc builder API updates, bug fixes and migration of controllers to builder API in anticipation of pages
- Sunset non-deterministic guid cvar
#rb phil.popp, helen.yang
[FYI] sondra.moyls
#tests Standard Automated Audio Tests, EngineTests, Offline QA Smoke pass, CPR, etc., extensive MetaSound Editor use, -game MetaSound qa levels, AudioUnitTests
#jira UE-194159
[CL 33102023 by rob gay in ue5-main branch]
2024-04-19 10:09:04 -04:00
|
|
|
if (ControllerPrivate::IsRerouteClass(NodeHandle->GetClassMetadata().GetClassName()))
|
2022-09-13 21:51:22 -04:00
|
|
|
{
|
|
|
|
|
TArray<FConstOutputHandle> Outputs = NodeHandle->GetConstOutputs();
|
|
|
|
|
for (FConstOutputHandle& OutputHandle : Outputs)
|
|
|
|
|
{
|
|
|
|
|
TArray<FConstInputHandle> LinkedInputs = OutputHandle->GetConstConnectedInputs();
|
|
|
|
|
for (FConstInputHandle LinkedInput : LinkedInputs)
|
|
|
|
|
{
|
|
|
|
|
IterateReroutedInputs(LinkedInput, Func);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Func(InHandleToCheck);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} // namespace Frontend
|
|
|
|
|
} // namespace Metasound
|