You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb trivial #jira UE-111945 #ROBOMERGE-SOURCE: CL 15831794 in //UE5/Release-5.0-EarlyAccess/... #ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v785-15821902) [CL 15834107 by phil popp in ue5-main branch]
56 lines
1.7 KiB
C++
56 lines
1.7 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
/*
|
|
|
|
Macros to make parameter definitions a little easier
|
|
Use in a namespace
|
|
|
|
namespace Metasound
|
|
{
|
|
namespace MyNodeVertexNames
|
|
{
|
|
METASOUND_PARAM(InputParam1, "Param 1", "Tooltip for param1.");
|
|
METASOUND_PARAM(InputParam2, "Param 2", "Tooltip for param2.");
|
|
METASOUND_PARAM(OutputParam1, "Out Param1", "Tooltip for output param 2.");
|
|
METASOUND_PARAM(OutputParam2, "Out Param2", "Tooltip for output param 2.");
|
|
}
|
|
}
|
|
|
|
Then to retrieve just do when in a:
|
|
|
|
using namespace MyNodeVertexNames;
|
|
|
|
METASOUND_GET_PARAM_NAME(InputParam1)
|
|
METASOUND_GET_PARAM_TT(InputParam1)
|
|
|
|
For variable parameters (e.g. templated on number), do the following:
|
|
|
|
namespace TriggerAccumulatorVertexNames
|
|
{
|
|
METASOUND_PARAM(InputParam, "Param {0}", "Do {0} tooltip.");
|
|
}
|
|
|
|
Then to retrieve the name/tooltip use:
|
|
|
|
METASOUND_GET_VARIABLE_PARAM_NAME(InputParam, NUMBER);
|
|
|
|
Where NUMBER is a number (or whatever) to slot into the format specifier you defined in the param def.
|
|
|
|
*/
|
|
|
|
|
|
#define METASOUND_PARAM(NAME, NAME_TEXT, TOOLTIP_TEXT) \
|
|
static const TCHAR* NAME##Name = TEXT(NAME_TEXT); \
|
|
static const FText NAME##Tooltip = LOCTEXT(#NAME "Tooltip", TOOLTIP_TEXT); \
|
|
|
|
|
|
#define METASOUND_GET_PARAM_NAME(NAME) NAME##Name
|
|
#define METASOUND_GET_PARAM_TT(NAME) NAME##Tooltip
|
|
#define METASOUND_GET_PARAM_NAME_AND_TT(NAME) NAME##Name, NAME##Tooltip
|
|
|
|
#define METASOUND_GET_VARIABLE_PARAM_NAME(NAME, INDEX) FString::Format(NAME##Name, {INDEX})
|
|
#define METASOUND_GET_VARIABLE_TT(NAME, INDEX) FText::Format(NAME##Tooltip, INDEX)
|
|
#define METASOUND_GET_VARIABLE_PARAM_NAME_AND_TT(NAME, INDEX) FString::Format(NAME##Name, {INDEX}), FText::Format(NAME##Tooltip, INDEX)
|