a.SkinWeightProfile.DefaultLODOverride

a.SkinWeightProfile.DefaultLODOverride

#Overview

name: a.SkinWeightProfile.DefaultLODOverride

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.SkinWeightProfile.DefaultLODOverride is to control the Level of Detail (LOD) index at which the default Skin Weight Profile should override the Skeletal Mesh’s default Skin Weights. This setting is primarily used in the animation system, specifically for managing skin weight profiles in skeletal meshes.

This setting variable is utilized by the Unreal Engine’s animation system, particularly within the SkinWeightProfile module. It’s part of the Engine’s core functionality for handling skeletal mesh rendering and animation.

The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of -1 and can be changed at runtime using console commands or through engine configuration files.

The variable interacts closely with GSkinWeightProfilesDefaultLODOverride, which is the actual integer variable that stores the value. They share the same value, with a.SkinWeightProfile.DefaultLODOverride being the console variable name used to access and modify the value.

Developers must be aware that this variable affects the behavior of skin weight profile application across different LOD levels. A value of -1 means no override is applied, while a value of 0 or greater will cause the default skin weight profile to be applied from that LOD index onwards.

Best practices when using this variable include:

  1. Only modify it when you need to change the default behavior of skin weight profile application.
  2. Consider the performance implications of applying skin weight profiles at lower LOD levels.
  3. Use in conjunction with other skin weight profile settings for optimal results.

Regarding the associated variable GSkinWeightProfilesDefaultLODOverride:

The purpose of GSkinWeightProfilesDefaultLODOverride is to store the actual integer value that determines the LOD override for default skin weight profiles. It’s the internal representation of the a.SkinWeightProfile.DefaultLODOverride console variable.

This variable is used directly in the engine’s code to determine when to apply the default skin weight profile. It’s referenced in the SkinWeightProfile.cpp file, particularly in functions related to overriding base buffer skin weight data and setting dynamic default skin weight profiles.

The value of this variable is set through the console variable system, mirroring the value of a.SkinWeightProfile.DefaultLODOverride.

It interacts closely with other skin weight profile-related variables and is used in conditional checks to determine skin weight profile application behavior.

Developers should be aware that this variable directly affects the engine’s internal logic for skin weight profile application. Changes to this variable will immediately impact how skeletal meshes are rendered at different LOD levels.

Best practices for using this variable include:

  1. Avoid modifying it directly in code; instead, use the console variable system for changes.
  2. Consider the impact on performance and visual quality when adjusting this value.
  3. Test thoroughly across different LOD levels when making changes to ensure desired behavior.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Animation/SkinWeightProfile.cpp:123

Scope: file

Source code excerpt:

int32 GSkinWeightProfilesDefaultLODOverride = -1;
FAutoConsoleVariableRef CVarSkinWeightProfilesDefaultLODOverride(
	TEXT("a.SkinWeightProfile.DefaultLODOverride"),
	GSkinWeightProfilesDefaultLODOverride,
	TEXT("Override LOD index from which on the default Skin Weight Profile should override the Skeletal Mesh's default Skin Weights"),
	FConsoleVariableDelegate::CreateStatic(&OnDefaultProfileCVarsChanged),
	ECVF_Scalability
);

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Animation/SkinWeightProfile.cpp:121

Scope: file

Source code excerpt:

);

int32 GSkinWeightProfilesDefaultLODOverride = -1;
FAutoConsoleVariableRef CVarSkinWeightProfilesDefaultLODOverride(
	TEXT("a.SkinWeightProfile.DefaultLODOverride"),
	GSkinWeightProfilesDefaultLODOverride,
	TEXT("Override LOD index from which on the default Skin Weight Profile should override the Skeletal Mesh's default Skin Weights"),
	FConsoleVariableDelegate::CreateStatic(&OnDefaultProfileCVarsChanged),
	ECVF_Scalability
);

int32 GSkinWeightProfilesAllowedFromLOD = -1;

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Animation/SkinWeightProfile.cpp:274

Scope (from outer to inner):

file
function     void FSkinWeightProfilesData::OverrideBaseBufferSkinWeightData
lambda-function

Source code excerpt:

			{
				// In case the default LOD index has been overridden check against that
				if (GSkinWeightProfilesDefaultLODOverride >= 0)
				{
					return (ProfileInfo.DefaultProfile.Default && LODIndex >= GSkinWeightProfilesDefaultLODOverride);
				}

				// Otherwise check if this profile is set as default and the current LOD index is applicable
				return (ProfileInfo.DefaultProfile.Default && LODIndex >= ProfileInfo.DefaultProfileFromLODIndex.Default);
			});
		}

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Animation/SkinWeightProfile.cpp:323

Scope (from outer to inner):

file
function     void FSkinWeightProfilesData::SetDynamicDefaultSkinWeightProfile
lambda-function

Source code excerpt:


			// In case the default LOD index has been overridden check against that
			if (GSkinWeightProfilesDefaultLODOverride >= 0)
			{
				return (ProfileInfo.DefaultProfile.Default && LODIndex >= GSkinWeightProfilesDefaultLODOverride);
			}

			// Otherwise check if this profile is set as default and the current LOD index is applicable
			return (ProfileInfo.DefaultProfile.Default && LODIndex >= ProfileInfo.DefaultProfileFromLODIndex.Default);
		});

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/Animation/SkinWeightProfile.h:23

Scope: file

Source code excerpt:


extern ENGINE_API int32 GSkinWeightProfilesLoadByDefaultMode;
extern ENGINE_API int32 GSkinWeightProfilesDefaultLODOverride;
extern ENGINE_API int32 GSkinWeightProfilesAllowedFromLOD;

extern ENGINE_API FAutoConsoleVariableRef CVarSkinWeightsLoadByDefaultMode;
extern ENGINE_API FAutoConsoleVariableRef CVarSkinWeightProfilesDefaultLODOverride;
extern ENGINE_API FAutoConsoleVariableRef CVarSkinWeightProfilesAllowedFromLOD;