a.URO.ForceAnimRate
a.URO.ForceAnimRate
#Overview
name: a.URO.ForceAnimRate
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Non-zero to force anim rate. 10 = eval anim every ten frames for those meshes that can do it. In some cases a frame is considered to be 30fps.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of a.URO.ForceAnimRate is to control the animation update rate in Unreal Engine’s skeletal mesh animation system. It allows developers to force a specific animation evaluation rate for meshes that support it.
This setting variable is primarily used by the animation system within Unreal Engine’s runtime. Specifically, it’s utilized in the SkinnedMeshComponent, which is part of the Engine module.
The value of this variable is set through a console variable (CVar) system. It’s defined as a TAutoConsoleVariable with an initial value of 0.
The associated variable CVarForceAnimRate directly interacts with a.URO.ForceAnimRate. They share the same value and purpose.
Developers must be aware that:
- This variable is intended for testing and debugging purposes.
- It affects the animation evaluation frequency, which can impact performance and visual quality.
- A non-zero value forces the animation rate, where 10 means evaluating the animation every ten frames.
- In some cases, a frame is considered to be 30fps, so the actual update rate may vary depending on the game’s frame rate.
Best practices when using this variable include:
- Use it primarily for debugging and performance testing.
- Be cautious when applying it in production builds, as it can affect game performance and animation smoothness.
- Consider the target platform and performance requirements when adjusting this value.
- Remember to reset it to 0 (default) after testing to allow the engine to manage animation rates automatically.
Regarding the associated variable CVarForceAnimRate:
The purpose of CVarForceAnimRate is identical to a.URO.ForceAnimRate, as they are directly linked.
It’s used in the AnimUpdateRateSetParams function within the FAnimUpdateRateManager namespace. This function is responsible for setting animation update rate parameters.
The value is retrieved using CVarForceAnimRate.GetValueOnGameThread() and, if non-zero, is used to set the DesiredEvaluationRate for animations.
Developers should be aware that changes to CVarForceAnimRate will directly affect the animation update rate, potentially impacting performance and visual quality.
Best practices for CVarForceAnimRate align with those for a.URO.ForceAnimRate, emphasizing its use for debugging and testing rather than production environments.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/SkinnedMeshComponent.cpp:202
Scope (from outer to inner):
file
namespace FAnimUpdateRateManager
Source code excerpt:
static TAutoConsoleVariable<int32> CVarForceAnimRate(
TEXT("a.URO.ForceAnimRate"),
0,
TEXT("Non-zero to force anim rate. 10 = eval anim every ten frames for those meshes that can do it. In some cases a frame is considered to be 30fps."));
static TAutoConsoleVariable<int32> CVarForceInterpolation(
TEXT("a.URO.ForceInterpolation"),
0,
#Associated Variable and Callsites
This variable is associated with another variable named CVarForceAnimRate
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/SkinnedMeshComponent.cpp:201
Scope (from outer to inner):
file
namespace FAnimUpdateRateManager
Source code excerpt:
}
static TAutoConsoleVariable<int32> CVarForceAnimRate(
TEXT("a.URO.ForceAnimRate"),
0,
TEXT("Non-zero to force anim rate. 10 = eval anim every ten frames for those meshes that can do it. In some cases a frame is considered to be 30fps."));
static TAutoConsoleVariable<int32> CVarForceInterpolation(
TEXT("a.URO.ForceInterpolation"),
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/SkinnedMeshComponent.cpp:287
Scope (from outer to inner):
file
namespace FAnimUpdateRateManager
function void AnimUpdateRateSetParams
Source code excerpt:
}
int32 ForceAnimRate = CVarForceAnimRate.GetValueOnGameThread();
if (ForceAnimRate)
{
DesiredEvaluationRate = ForceAnimRate;
}
if (bUsingRootMotionFromEverything && DesiredEvaluationRate > 1)