a.MotionTrajectory.Stride
a.MotionTrajectory.Stride
#Overview
name: a.MotionTrajectory.Stride
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Configure the sample stride when displaying information
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of a.MotionTrajectory.Stride is to configure the sample stride when displaying debug information for motion trajectories in Unreal Engine’s animation system.
This setting variable is primarily used in the animation subsystem of Unreal Engine, specifically in the motion trajectory debugging functionality. It’s part of the Engine module, as evident from its location in the Engine/Source/Runtime/Engine directory.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 1 in the source code:
TAutoConsoleVariable<int32> CVarMotionTrajectoryDebugStride(TEXT("a.MotionTrajectory.Stride"), 1, TEXT("Configure the sample stride when displaying information"));
This variable interacts with other debug-related variables, such as CVarMotionTrajectoryDebug and CVarMotionTrajectoryDebugOptions. Together, these variables control various aspects of motion trajectory debugging.
Developers should be aware that this variable affects the granularity of debug information displayed for motion trajectories. A higher stride value will result in fewer samples being displayed, which can be useful for performance reasons or to reduce visual clutter when debugging complex animations.
Best practices when using this variable include:
- Adjusting the stride value based on the complexity of the animation and the level of detail needed for debugging.
- Using it in conjunction with other motion trajectory debug options for comprehensive analysis.
- Remembering to disable or reset debug settings in production builds.
The associated variable CVarMotionTrajectoryDebugStride serves the same purpose as a.MotionTrajectory.Stride. It’s the actual CVar object used in the C++ code to access and modify the stride value. This variable is used in the FTrajectorySampleRange::DebugDrawTrajectory function to determine the stride for debug drawing:
const int32 DebugSampleStride = CVarMotionTrajectoryDebugStride.GetValueOnAnyThread();
Developers should use CVarMotionTrajectoryDebugStride.GetValueOnAnyThread() to read the current stride value in C++ code, and can modify it at runtime using console commands or through the project settings interface in the Unreal Editor.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Animation/MotionTrajectoryTypes.cpp:20
Scope: file
Source code excerpt:
TAutoConsoleVariable<int32> CVarMotionTrajectoryDebug(TEXT("a.MotionTrajectory.Debug"), 0, TEXT("Turn on debug drawing for motion trajectory"));
TAutoConsoleVariable<int32> CVarMotionTrajectoryDebugStride(TEXT("a.MotionTrajectory.Stride"), 1, TEXT("Configure the sample stride when displaying information"));
TAutoConsoleVariable<int32> CVarMotionTrajectoryDebugOptions(TEXT("a.MotionTrajectory.Options"), 0, TEXT("Toggle motion trajectory sample information:\n 0. Disable Text\n 1. Index\n2. Accumulated Time\n 3. Position\n 4. Velocity\n 5. Acceleration"));
#endif
namespace
{
template<class U> static inline U CubicCRSplineInterpSafe(const U& P0, const U& P1, const U& P2, const U& P3, const float I, const float A = 0.5f)
#Associated Variable and Callsites
This variable is associated with another variable named CVarMotionTrajectoryDebugStride
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Animation/MotionTrajectoryTypes.cpp:20
Scope: file
Source code excerpt:
TAutoConsoleVariable<int32> CVarMotionTrajectoryDebug(TEXT("a.MotionTrajectory.Debug"), 0, TEXT("Turn on debug drawing for motion trajectory"));
TAutoConsoleVariable<int32> CVarMotionTrajectoryDebugStride(TEXT("a.MotionTrajectory.Stride"), 1, TEXT("Configure the sample stride when displaying information"));
TAutoConsoleVariable<int32> CVarMotionTrajectoryDebugOptions(TEXT("a.MotionTrajectory.Options"), 0, TEXT("Toggle motion trajectory sample information:\n 0. Disable Text\n 1. Index\n2. Accumulated Time\n 3. Position\n 4. Velocity\n 5. Acceleration"));
#endif
namespace
{
template<class U> static inline U CubicCRSplineInterpSafe(const U& P0, const U& P1, const U& P2, const U& P3, const float I, const float A = 0.5f)
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Animation/MotionTrajectoryTypes.cpp:208
Scope (from outer to inner):
file
function void FTrajectorySampleRange::DebugDrawTrajectory
Source code excerpt:
{
#if ENABLE_ANIM_DEBUG
const int32 DebugSampleStride = CVarMotionTrajectoryDebugStride.GetValueOnAnyThread();
const int32 DebugSampleOptions = CVarMotionTrajectoryDebugOptions.GetValueOnAnyThread();
#endif
for (int32 Idx = 0, Num = Samples.Num(); Idx < Num; Idx++)
{
const FTransform SampleTransformWS = Samples[Idx].Transform * WorldTransform;
const FVector SamplePositionWS = SampleTransformWS.GetTranslation();