Navigation
API > API/Plugins > API/Plugins/MetasoundFrontend
Forward Declarations.
MetaSound Frontend Registration Actions
MetaSound Frontend Registration Actions are used to register and unregister MetaSound nodes and data types at the module level.
Usage:
Node Developers can utilize these actions by implementing the following:
- Add private definitions to the module's Build.cs file for METASOUND_PLUGIN and METASOUND_MODULE PrivateDefinitions.Add("METASOUND_PLUGIN=MyPlugin") PrivateDefinitions.Add("METASOUND_MODULE=MyModule") These definitions must be private to the module.
- Implement a module registration group using the provided macros. In MyModule.cpp METASOUND_IMPLEMENT_MODULE_REGISTRATION_LIST
- Use METASOUND_REGISTER_NODE(...) and METASOUND_REGISTER_NODE_AND_CONFIGURATION(...) in the cpp files to setup registration actions for their nodes.
- Trigger registration in their module's StartupModule and ShutdownModule calls void FMyModule::StartupModule() { METASOUND_REGISTER_ITEMS_IN_MODULE } void FMyModule::ShutdownModule() { METASOUND_UNREGISTER_ITEMS_IN_MODULE }
Implementation:
This system uses creates a linked list of FRegistrationActions that is constructed during static initialization. Each module contains it's own linked list of FRegistrationActions and thus only performs registration and unregistration actions associated with the module. This allows registration actions to be declared locally within the cpp file containing the node or data type, while maintaining the association with the owning plugin and module.
Each module's linked list contains a unique class name and does not export it's API. This is in order to protect against modules accidentally adding their registration actions to the wrong linked list. The unique name for the module's list is created by combining the METASOUND_PLUGIN and METASOUND_MODULE private macro definitions. If those definitions are missing, a global linked list serves as a backup.
Thread safety for this system is provided by two mechanisms.
- Initialization of the registration actions linked list is thread safe by the fact that static initialization in C++ is single threaded. The list structure (e.g. Head & Next pointers) should not be modified outside of static initialization.
- RegisterAll and UnregisterAll should only be called during StartupModule and ShutdownModule because module startup and shutdown are also run single threaded.
| Name | Metasound::Frontend::EAutoUpdateEligibility |
| Type | enum |
| Header File | /Engine/Plugins/Runtime/Metasound/Source/MetasoundFrontend/Public/MetasoundFrontendDocumentBuilder.h |
| Include Path | #include "MetasoundFrontendDocumentBuilder.h" |
Syntax
namespace Metasound
{
namespace Frontend
{
enum EAutoUpdateEligibility
{
None = 0,
Ineligible,
Eligible_MinorVersionUpdate,
Eligible_InterfaceChange,
Eligible_NodeUpdateTransform,
COUNT,
}
}
}
Values
| Name | Remarks |
|---|---|
| None | |
| Ineligible | |
| Eligible_MinorVersionUpdate | |
| Eligible_InterfaceChange | |
| Eligible_NodeUpdateTransform | |
| COUNT |