a.OutputMontageFrameRateWarning

a.OutputMontageFrameRateWarning

#Overview

name: a.OutputMontageFrameRateWarning

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

It is referenced in 5 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of a.OutputMontageFrameRateWarning is to control whether warnings should be displayed about incompatible frame rates in Animation Montages and Composites.

This setting variable is primarily used in the animation system of Unreal Engine 5. Specifically, it’s utilized in the AnimCompositeBase, AnimComposite, and AnimMontage modules.

The value of this variable is set through a console variable (CVar) system. It’s defined as a TAutoConsoleVariable with a default value of false.

The associated variable CVarOutputMontageFrameRateWarning directly interacts with a.OutputMontageFrameRateWarning. They share the same value and purpose.

Developers must be aware that this variable is only active when WITH_EDITOR is defined, indicating it’s primarily for development and debugging purposes, not for use in shipped games.

Best practices when using this variable include:

  1. Enable it during development to catch frame rate incompatibilities early.
  2. Use it in conjunction with thorough testing of animation assets to ensure consistent frame rates across montages and composites.
  3. Be prepared to handle and resolve the warnings it generates, as they can indicate potential issues in animation playback.

Regarding the associated variable CVarOutputMontageFrameRateWarning:

The purpose of CVarOutputMontageFrameRateWarning is identical to a.OutputMontageFrameRateWarning - it controls the output of warnings about incompatible frame rates in animation assets.

This variable is used in the same animation system modules as a.OutputMontageFrameRateWarning.

Its value is set and accessed through the CVar system, typically using GetValueOnAnyThread() method.

CVarOutputMontageFrameRateWarning directly interacts with a.OutputMontageFrameRateWarning, as they are essentially the same variable.

Developers should be aware that this variable is checked at runtime in the relevant animation processing code. When true, it will output warning logs about frame rate incompatibilities.

Best practices for using CVarOutputMontageFrameRateWarning include:

  1. Use it for debugging animation frame rate issues during development.
  2. Be prepared to handle the performance impact of additional logging when enabled.
  3. Consider wrapping calls to this variable in #if WITH_EDITOR guards if you want to ensure it’s only used in editor builds.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Animation/AnimCompositeBase.cpp:23

Scope (from outer to inner):

file
namespace    UE
namespace    Anim

Source code excerpt:

	{		
		TAutoConsoleVariable<bool> CVarOutputMontageFrameRateWarning(
			TEXT("a.OutputMontageFrameRateWarning"),
			false,
			TEXT("If true will warn the user about Animation Montages/Composites composed of incompatible animation assets (incompatible frame-rates)."));
	}
}
#endif // WITH_EDITOR

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Animation/AnimCompositeBase.h:20

Scope (from outer to inner):

file
namespace    UE
namespace    Anim

Source code excerpt:

namespace UE { namespace Anim
{
	extern TAutoConsoleVariable<bool> CVarOutputMontageFrameRateWarning;
}}

#endif // WITH_EDITOR

/** Struct defining a RootMotionExtractionStep.
 * When extracting RootMotion we can encounter looping animations (wrap around), or different animations.

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Animation/AnimComposite.cpp:238

Scope: file

Source code excerpt:

						}						

						if (UE::Anim::CVarOutputMontageFrameRateWarning.GetValueOnAnyThread() == true)
						{
							UE_LOG(LogAnimation, Warning, TEXT("Frame rate of animation %s (%s) is incompatible with other animations in Animation Composite %s - underlying frame-rate will be set to %s:%s"), *Base->GetName(), *BaseFrameRate.ToPrettyText().ToString(), *GetName(), *Super::GetSamplingFrameRate().ToPrettyText().ToString(), *AssetString);
						}
						
						bValidFrameRate = false;
						break;

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Animation/AnimCompositeBase.cpp:22

Scope (from outer to inner):

file
namespace    UE
namespace    Anim

Source code excerpt:

	namespace Anim
	{		
		TAutoConsoleVariable<bool> CVarOutputMontageFrameRateWarning(
			TEXT("a.OutputMontageFrameRateWarning"),
			false,
			TEXT("If true will warn the user about Animation Montages/Composites composed of incompatible animation assets (incompatible frame-rates)."));
	}
}
#endif // WITH_EDITOR

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Animation/AnimMontage.cpp:3097

Scope: file

Source code excerpt:

							}						

							if (UE::Anim::CVarOutputMontageFrameRateWarning.GetValueOnAnyThread() == true)
							{
								UE_LOG(LogAnimation, Warning, TEXT("Frame rate of animation %s (%s) is incompatible with other animations in Animation Montage %s - underlying frame-rate will be set to %s:%s"), *Base->GetName(), *BaseFrameRate.ToPrettyText().ToString(), *GetName(), *Super::GetSamplingFrameRate().ToPrettyText().ToString(), *AssetString);
							}
						
							bValidFrameRate = false;
							break;