a.AnimNode.Inertialization.IgnoreVelocity

a.AnimNode.Inertialization.IgnoreVelocity

#Overview

name: a.AnimNode.Inertialization.IgnoreVelocity

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.IgnoreVelocity is to control whether velocity information is ignored during the Inertialization process in Unreal Engine’s animation system. This setting is primarily used for testing and debugging purposes.

This setting variable is used by the animation system, specifically within the Inertialization node functionality. It is part of the Engine module, as evidenced by its location in the Engine/Source/Runtime/Engine/Private/Animation/ directory.

The value of this variable is set through a console variable (CVar) named CVarAnimInertializationIgnoreVelocity. It is initialized with a default value of 0, meaning velocity information is not ignored by default.

This variable interacts with the Inertialization node in the animation system. When set to 1 (true), it causes the system to ignore velocity information during Inertialization, effectively reverting to a quintic difference blend.

Developers must be aware that this variable is primarily intended for testing and debugging purposes. Enabling it (setting it to 1) will change the behavior of the Inertialization node, which could affect the smoothness and accuracy of animations.

Best practices when using this variable include:

  1. Keeping it disabled (set to 0) for normal gameplay and production builds.
  2. Only enabling it temporarily when debugging animation issues related to Inertialization.
  3. Being aware that enabling this setting may change the visual quality of animations, as it reverts to a simpler blending method.

Regarding the associated variable CVarAnimInertializationIgnoreVelocity:

This is the actual console variable that controls the behavior described above. It is defined as a TAutoConsoleVariable, which means it can be changed at runtime through the console.

The purpose of CVarAnimInertializationIgnoreVelocity is to provide a way to toggle the “ignore velocity” behavior at runtime, which is useful for quick testing and debugging without recompiling the engine.

This variable is used in the FAnimNode_Inertialization::Evaluate_AnyThread function to determine whether to clear the time accumulator, which effectively invalidates any recorded velocities.

Developers should be aware that changes to this console variable will take effect immediately, potentially affecting all active Inertialization nodes in the scene.

Best practices for using CVarAnimInertializationIgnoreVelocity include:

  1. Using it in conjunction with other debugging tools when investigating animation issues.
  2. Resetting it to its default value (0) after debugging to ensure normal animation behavior.
  3. Considering adding it to a list of debug settings that can be toggled as a group for comprehensive animation debugging.

#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:23

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
{

#Associated Variable and Callsites

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

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

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
{

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

Scope (from outer to inner):

file
function     void FAnimNode_Inertialization::Evaluate_AnyThread

Source code excerpt:


	// Ignore the inertialization velocities if requested (for testing / debugging)
	if (CVarAnimInertializationIgnoreVelocity.GetValueOnAnyThread())
	{
		// Clear the time accumulator (so as to invalidate any recorded velocities)
		DeltaTime = 0.0f;
	}

	// Get the parent actor attachment information (to detect and counteract discontinuities when changing parents)