a.AnimNode.Inertialization.IgnoreDeficit

a.AnimNode.Inertialization.IgnoreDeficit

#Overview

name: a.AnimNode.Inertialization.IgnoreDeficit

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 a.AnimNode.Inertialization.IgnoreDeficit is to control whether the animation system should ignore the inertialization time deficit caused by interruptions during the animation process. This setting is part of the animation system in Unreal Engine 5, specifically related to the Inertialization feature.

The Unreal Engine subsystem that relies on this setting variable is the Animation system, particularly the Inertialization module within the Engine’s runtime. This can be seen from the file path “Engine/Source/Runtime/Engine/Private/Animation/AnimNode_Inertialization.cpp”.

The value of this variable is set as a console variable (CVar) with an initial value of 0, meaning it’s disabled by default. It can be changed at runtime through console commands or programmatically.

This variable interacts with the InertializationDeficit variable within the FAnimNode_Inertialization::Evaluate_AnyThread function. When the CVar is set to 0 (false), the system considers the inertialization deficit; when set to 1 (true), it ignores the deficit.

Developers must be aware that enabling this variable (setting it to 1) will cause the animation system to ignore time deficits caused by interruptions during inertialization. This could lead to smoother animations in some cases but might also result in less accurate motion in scenarios where precise timing is crucial.

Best practices when using this variable include:

  1. Leave it disabled (0) for most use cases to ensure accurate animation timing.
  2. Enable it (1) only when you need to prioritize smooth transitions over precise timing, and after thorough testing.
  3. Consider the impact on gameplay and visual fidelity when changing this setting.

Regarding the associated variable CVarAnimInertializationIgnoreDeficit:

This is the actual CVar object that controls the behavior described above. It’s defined using TAutoConsoleVariable, which allows it to be changed at runtime. The purpose and usage are identical to a.AnimNode.Inertialization.IgnoreDeficit, as they represent the same setting.

The value of CVarAnimInertializationIgnoreDeficit is accessed in the animation code using the GetValueOnAnyThread() method, which suggests it can be safely read from any thread.

When working with this variable, developers should:

  1. Use CVarAnimInertializationIgnoreDeficit.GetValueOnAnyThread() to read its current value in C++ code.
  2. Be aware that changes to this variable will affect all animations using the Inertialization system.
  3. Consider exposing this setting in a user-friendly way if it’s meant to be adjusted by end-users or designers.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Animation/AnimNode_Inertialization.cpp:24

Scope: file

Source code excerpt:

TAutoConsoleVariable<int32> CVarAnimInertializationEnable(TEXT("a.AnimNode.Inertialization.Enable"), 1, TEXT("Enable / Disable Inertialization"));
TAutoConsoleVariable<int32> CVarAnimInertializationIgnoreVelocity(TEXT("a.AnimNode.Inertialization.IgnoreVelocity"), 0, TEXT("Ignore velocity information during Inertialization (effectively reverting to a quintic diff blend)"));
TAutoConsoleVariable<int32> CVarAnimInertializationIgnoreDeficit(TEXT("a.AnimNode.Inertialization.IgnoreDeficit"), 0, TEXT("Ignore inertialization time deficit caused by interruptions"));


namespace UE::Anim
{

	void IInertializationRequester::RequestInertialization(const FInertializationRequest& InInertializationRequest)

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Animation/AnimNode_Inertialization.cpp:24

Scope: file

Source code excerpt:

TAutoConsoleVariable<int32> CVarAnimInertializationEnable(TEXT("a.AnimNode.Inertialization.Enable"), 1, TEXT("Enable / Disable Inertialization"));
TAutoConsoleVariable<int32> CVarAnimInertializationIgnoreVelocity(TEXT("a.AnimNode.Inertialization.IgnoreVelocity"), 0, TEXT("Ignore velocity information during Inertialization (effectively reverting to a quintic diff blend)"));
TAutoConsoleVariable<int32> CVarAnimInertializationIgnoreDeficit(TEXT("a.AnimNode.Inertialization.IgnoreDeficit"), 0, TEXT("Ignore inertialization time deficit caused by interruptions"));


namespace UE::Anim
{

	void IInertializationRequester::RequestInertialization(const FInertializationRequest& InInertializationRequest)

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Animation/AnimNode_Inertialization.cpp:469

Scope (from outer to inner):

file
function     void FAnimNode_Inertialization::Evaluate_AnyThread

Source code excerpt:

			// and reduce future durations if interruptions continue. Without this mitigation,
			// repeated interruptions will lead to a degenerate pose because the pose target is unstable.
			bool bApplyDeficit = InertializationDeficit > 0.0f && !CVarAnimInertializationIgnoreDeficit.GetValueOnAnyThread();
			InertializationDeficit = InertializationDuration - InertializationElapsedTime;
			AppliedDeficit = bApplyDeficit ? InertializationDeficit : 0.0f;
		}

		InertializationState = EInertializationState::Pending;
		InertializationElapsedTime = 0.0f;