au.MetaSound.Parameter.EnableWarningOnIgnoredParameter
au.MetaSound.Parameter.EnableWarningOnIgnoredParameter
#Overview
name: au.MetaSound.Parameter.EnableWarningOnIgnoredParameter
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
If enabled, a warning will be logged when a parameters sent to a MetaSound is ignored.\n0: Disabled (default), !0: Enabled
It is referenced in 6
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of au.MetaSound.Parameter.EnableWarningOnIgnoredParameter
is to control whether warnings are logged when parameters sent to a MetaSound are ignored. This setting variable is primarily used for debugging and development purposes within the MetaSound system.
This setting variable is used in the MetaSound plugin, which is part of Unreal Engine’s audio system. Specifically, it’s used in the MetasoundFrontend and MetasoundEngine modules.
The value of this variable is set through a console variable (CVar) system. It’s initialized to 0 (disabled) by default, but can be changed at runtime or through configuration files.
The associated variable MetaSoundParameterEnableWarningOnIgnoredParameterCVar
directly interacts with it. This is an int32 variable that holds the actual value of the console variable.
Developers should be aware that enabling this variable (setting it to a non-zero value) will cause warnings to be logged when parameters are ignored. This can be useful for debugging, but may cause log spam in release builds if not managed properly.
Best practices when using this variable include:
- Enabling it during development and testing phases to catch potential issues with parameter setting.
- Disabling it in release builds to avoid unnecessary log spam.
- Using it in conjunction with other debugging tools to diagnose issues related to MetaSound parameter handling.
Regarding the associated variable MetaSoundParameterEnableWarningOnIgnoredParameterCVar
:
The purpose of this variable is to store the actual value of the console variable au.MetaSound.Parameter.EnableWarningOnIgnoredParameter
. It’s used internally by the MetaSound system to determine whether to log warnings about ignored parameters.
This variable is used in various parts of the MetaSound system, including the MetaSound source, parameter transmitter, and generator builder.
The value of this variable is set by the console variable system and can be changed at runtime.
It directly interacts with the console variable au.MetaSound.Parameter.EnableWarningOnIgnoredParameter
, essentially serving as its in-memory representation.
Developers should be aware that this variable is used in conditional statements to determine whether to log warnings. Changes to this variable will immediately affect the logging behavior of the MetaSound system.
Best practices for this variable include:
- Not modifying it directly, but instead using the console variable system to change its value.
- Being aware of its state when debugging MetaSound parameter issues.
- Considering its performance impact in tight loops, as checking its value frequently could potentially affect performance in some scenarios.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Runtime/Metasound/Source/MetasoundFrontend/Private/MetasoundParameterTransmitter.cpp:13
Scope (from outer to inner):
file
namespace Metasound
Source code excerpt:
FAutoConsoleVariableRef CVarMetaSoundParameterEnableWarningOnIgnoredParameter(
TEXT("au.MetaSound.Parameter.EnableWarningOnIgnoredParameter"),
MetaSoundParameterEnableWarningOnIgnoredParameterCVar,
TEXT("If enabled, a warning will be logged when a parameters sent to a MetaSound is ignored.\n")
TEXT("0: Disabled (default), !0: Enabled"),
ECVF_Default);
#Associated Variable and Callsites
This variable is associated with another variable named MetaSoundParameterEnableWarningOnIgnoredParameterCVar
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Runtime/Metasound/Source/MetasoundEngine/Private/MetasoundSource.cpp:1205
Scope (from outer to inner):
file
function void UMetaSoundSource::InitParametersInternal
Source code excerpt:
#if !NO_LOGGING
if (::Metasound::MetaSoundParameterEnableWarningOnIgnoredParameterCVar)
{
const FString AssetName = GetName();
UE_LOG(LogMetaSound, Warning, TEXT("Failed to set parameter '%s' in asset '%s': No name specified, no transmittable input found, or type mismatch."), *Parameter.ParamName.ToString(), *AssetName);
}
#endif // !NO_LOGGING
}
#Loc: <Workspace>/Engine/Plugins/Runtime/Metasound/Source/MetasoundFrontend/Private/MetasoundParameterTransmitter.cpp:10
Scope (from outer to inner):
file
namespace Metasound
Source code excerpt:
namespace Metasound
{
int32 MetaSoundParameterEnableWarningOnIgnoredParameterCVar = 0;
FAutoConsoleVariableRef CVarMetaSoundParameterEnableWarningOnIgnoredParameter(
TEXT("au.MetaSound.Parameter.EnableWarningOnIgnoredParameter"),
MetaSoundParameterEnableWarningOnIgnoredParameterCVar,
TEXT("If enabled, a warning will be logged when a parameters sent to a MetaSound is ignored.\n")
TEXT("0: Disabled (default), !0: Enabled"),
ECVF_Default);
namespace Frontend
#Loc: <Workspace>/Engine/Plugins/Runtime/Metasound/Source/MetasoundFrontend/Private/MetasoundParameterTransmitter.cpp:338
Scope (from outer to inner):
file
namespace Metasound
function bool FMetaSoundParameterTransmitter::SetParameterWithLiteral
Source code excerpt:
// Enable / disable via CVAR to avoid log spam.
if (MetaSoundParameterEnableWarningOnIgnoredParameterCVar)
{
UE_LOG(LogMetaSound, Warning, TEXT("Failed to set parameter %s in asset %s on instance %d with value %s. No runtime modifiable input with that name exists on instance."), *InParameterName.ToString(), *DebugMetaSoundName.ToString(), InstanceID, *LexToString(InLiteral));
}
return false;
}
#Loc: <Workspace>/Engine/Plugins/Runtime/Metasound/Source/MetasoundFrontend/Public/MetasoundParameterTransmitter.h:15
Scope (from outer to inner):
file
namespace Metasound
Source code excerpt:
namespace Metasound
{
extern METASOUNDFRONTEND_API int32 MetaSoundParameterEnableWarningOnIgnoredParameterCVar;
class FMetasoundGenerator;
namespace Frontend
{
METASOUNDFRONTEND_API FLiteral ConvertParameterToLiteral(FAudioParameter&& InValue);
#Loc: <Workspace>/Engine/Plugins/Runtime/Metasound/Source/MetasoundGenerator/Private/MetasoundGeneratorBuilder.cpp:218
Scope (from outer to inner):
file
namespace Metasound
namespace GeneratorBuilder
function FInputVertexInterfaceData BuildGraphOperatorInputs
Source code excerpt:
InputData.BindVertex(ParamName, *DataReference);
}
else if(MetaSoundParameterEnableWarningOnIgnoredParameterCVar)
{
UE_LOG(LogMetaSound, Warning, TEXT("Failed to create initial input data reference from parameter %s of type %s on graph in MetaSoundSource [%s]"), *ParamName.ToString(), *InputVertex->DataTypeName.ToString(), *InInitParams.MetaSoundName);
}
}
else if(MetaSoundParameterEnableWarningOnIgnoredParameterCVar)
{
UE_LOG(LogMetaSound, Warning, TEXT("Failed to set initial input parameter %s on graph in MetaSoundSource [%s]"), *ParamName.ToString(), *InInitParams.MetaSoundName);
}
}
// Set any remaining inputs to their default values.