au.MetaSound.AutoUpdate.NativeClassesOfEqualVersion

au.MetaSound.AutoUpdate.NativeClassesOfEqualVersion

#Overview

name: au.MetaSound.AutoUpdate.NativeClassesOfEqualVersion

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of au.MetaSound.AutoUpdate.NativeClassesOfEqualVersion is to control the auto-update behavior of native MetaSound classes that share the same version number but have different interfaces. This setting is part of the MetaSound system, which is a node-based audio generation and processing framework in Unreal Engine 5.

This setting variable is primarily used in the MetaSound plugin, specifically within the MetasoundFrontend module. Based on the callsites, it’s clear that this variable is used in the node controller logic of the MetaSound system.

The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 1 (true) and can be changed at runtime through console commands or configuration files.

The associated variable MetaSoundAutoUpdateNativeClassesOfEqualVersionCVar is an integer that directly holds the value of the console variable. This variable is used in the actual C++ logic to control the behavior.

Developers must be aware that enabling this setting (value != 0) may result in slower graph load times. This is because the system will attempt to auto-update node references to native classes with interface discrepancies, which can be a time-consuming process.

Best practices when using this variable include:

  1. Keep it enabled (default value) during development to ensure that node references are up-to-date.
  2. Consider disabling it in release builds or when performance is critical, especially if you’re confident that all node references are already up-to-date.
  3. Be mindful of the performance impact when working with large MetaSound graphs.

Regarding the associated variable MetaSoundAutoUpdateNativeClassesOfEqualVersionCVar:

The purpose of this variable is to hold the actual integer value that determines whether auto-updating should occur for native classes of equal version.

This variable is used directly in the C++ code to control the logic flow. For example, in the CanAutoUpdate function of the FBaseNodeController class, it’s checked to determine whether auto-updating should proceed for native classes.

The value of this variable is set by the console variable system and can be changed at runtime.

It interacts closely with the console variable au.MetaSound.AutoUpdate.NativeClassesOfEqualVersion, essentially serving as its backing store.

Developers should be aware that this variable directly affects the behavior of the MetaSound system and can impact performance. Changes to this variable will immediately affect the auto-update behavior of native MetaSound classes.

Best practices for this variable include:

  1. Avoid modifying it directly in code; instead, use the console variable system to change its value.
  2. When debugging auto-update issues with native MetaSound classes, check the value of this variable to ensure it’s set as expected.
  3. Consider exposing this setting in user-facing configuration options if fine-tuning of MetaSound performance is required.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Plugins/Runtime/Metasound/Source/MetasoundFrontend/Private/MetasoundFrontendNodeController.cpp:17

Scope: file

Source code excerpt:

static int32 MetaSoundAutoUpdateNativeClassesOfEqualVersionCVar = 1;
FAutoConsoleVariableRef CVarMetaSoundAutoUpdateNativeClass(
	TEXT("au.MetaSound.AutoUpdate.NativeClassesOfEqualVersion"),
	MetaSoundAutoUpdateNativeClassesOfEqualVersionCVar,
	TEXT("If true, node references to native classes that share a version number will attempt to auto-update if the interface is different, which results in slower graph load times.\n")
	TEXT("0: Don't auto-update native classes of the same version with interface discrepancies, !0: Auto-update native classes of the same version with interface discrepancies (default)"),
	ECVF_Default);

namespace Metasound

#Associated Variable and Callsites

This variable is associated with another variable named MetaSoundAutoUpdateNativeClassesOfEqualVersionCVar. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Plugins/Runtime/Metasound/Source/MetasoundFrontend/Private/MetasoundFrontendNodeController.cpp:15

Scope: file

Source code excerpt:

#define LOCTEXT_NAMESPACE "MetasoundFrontendNodeController"

static int32 MetaSoundAutoUpdateNativeClassesOfEqualVersionCVar = 1;
FAutoConsoleVariableRef CVarMetaSoundAutoUpdateNativeClass(
	TEXT("au.MetaSound.AutoUpdate.NativeClassesOfEqualVersion"),
	MetaSoundAutoUpdateNativeClassesOfEqualVersionCVar,
	TEXT("If true, node references to native classes that share a version number will attempt to auto-update if the interface is different, which results in slower graph load times.\n")
	TEXT("0: Don't auto-update native classes of the same version with interface discrepancies, !0: Auto-update native classes of the same version with interface discrepancies (default)"),
	ECVF_Default);

namespace Metasound
{

#Loc: <Workspace>/Engine/Plugins/Runtime/Metasound/Source/MetasoundFrontend/Private/MetasoundFrontendNodeController.cpp:1046

Scope (from outer to inner):

file
namespace    Metasound
namespace    Frontend
function     bool FBaseNodeController::CanAutoUpdate

Source code excerpt:

				if (bIsClassNative)
				{
					if (!MetaSoundAutoUpdateNativeClassesOfEqualVersionCVar)
					{
						return false;
					}
				}
				else
				{