a.SkinWeightProfile.AllowedFromLOD

a.SkinWeightProfile.AllowedFromLOD

#Overview

name: a.SkinWeightProfile.AllowedFromLOD

This variable is created as a Console Variable (cvar).

It is referenced in 7 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of a.SkinWeightProfile.AllowedFromLOD is to control the Level of Detail (LOD) from which skin weight profiles can be applied in the Unreal Engine’s animation system. This setting is used to optimize performance by limiting the application of detailed skin weight profiles to higher LOD levels.

This setting variable is primarily used in the Engine’s animation system, specifically in the skin weight profile functionality. It is part of the Unreal Engine’s core rendering and animation modules.

The value of this variable is set through a console variable (CVar) system, allowing it to be changed at runtime. It’s initialized with a default value of -1, which means skin weight profiles are allowed on all LOD levels by default.

The associated variable GSkinWeightProfilesAllowedFromLOD directly interacts with a.SkinWeightProfile.AllowedFromLOD. They share the same value, with GSkinWeightProfilesAllowedFromLOD being the internal C++ variable used in the engine code.

Developers must be aware that:

  1. This variable affects performance and visual quality, as it determines when detailed skin weight profiles are applied.
  2. Setting a higher value can improve performance but may reduce visual quality on lower LOD levels.
  3. The variable is marked with ECVF_Scalability, indicating it’s part of the engine’s scalability system.

Best practices when using this variable include:

  1. Carefully balance performance and visual quality when adjusting this value.
  2. Test thoroughly on target hardware to ensure optimal settings.
  3. Consider using different values for different performance settings or platforms.

Regarding GSkinWeightProfilesAllowedFromLOD: This is the internal C++ variable that directly corresponds to a.SkinWeightProfile.AllowedFromLOD. It’s used throughout the engine code to determine whether skin weight profiles should be applied at a given LOD level. The variable is checked in various functions related to skin weight profile application and skeletal mesh rendering. Developers working directly with the engine source code should use this variable when implementing or modifying skin weight profile functionality.

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

Scope: file

Source code excerpt:

int32 GSkinWeightProfilesAllowedFromLOD = -1;
FAutoConsoleVariableRef CVarSkinWeightProfilesAllowedFromLOD(
	TEXT("a.SkinWeightProfile.AllowedFromLOD"),
	GSkinWeightProfilesAllowedFromLOD,
	TEXT("Override LOD index from which on the Skin Weight Profile can be applied"),
	FConsoleVariableDelegate::CreateStatic(&OnDefaultProfileCVarsChanged),
	ECVF_Scalability
);

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

);

int32 GSkinWeightProfilesAllowedFromLOD = -1;
FAutoConsoleVariableRef CVarSkinWeightProfilesAllowedFromLOD(
	TEXT("a.SkinWeightProfile.AllowedFromLOD"),
	GSkinWeightProfilesAllowedFromLOD,
	TEXT("Override LOD index from which on the Skin Weight Profile can be applied"),
	FConsoleVariableDelegate::CreateStatic(&OnDefaultProfileCVarsChanged),
	ECVF_Scalability
);

FArchive& operator<<(FArchive& Ar, FRuntimeSkinWeightProfileData& OverrideData)

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

Scope (from outer to inner):

file
function     void FSkinWeightProfilesData::OverrideBaseBufferSkinWeightData

Source code excerpt:


		// Setup to not apply any skin weight profiles at this LOD level
		if (LODIndex >= GSkinWeightProfilesAllowedFromLOD)
		{
			DefaultProfileIndex = OnPickOverrideSkinWeightProfile.IsBound() ? OnPickOverrideSkinWeightProfile.Execute(Mesh, MakeArrayView(Profiles), LODIndex) : Profiles.IndexOfByPredicate([LODIndex](FSkinWeightProfileInfo ProfileInfo)
			{
				// In case the default LOD index has been overridden check against that
				if (GSkinWeightProfilesDefaultLODOverride >= 0)
				{

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

Scope (from outer to inner):

file
function     void FSkinWeightProfilesData::SetDynamicDefaultSkinWeightProfile
lambda-function

Source code excerpt:

		{
			// Setup to not apply any skin weight profiles at this LOD level
			if (LODIndex < GSkinWeightProfilesAllowedFromLOD)
			{
				return false;
			}

			// In case the default LOD index has been overridden check against that
			if (GSkinWeightProfilesDefaultLODOverride >= 0)

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/SkinnedMeshComponent.cpp:4713

Scope (from outer to inner):

file
function     bool USkinnedMeshComponent::SetSkinWeightProfile

Source code excerpt:

        {
			// Check whether or not setting a profile is allow for this LOD index
			if (LODIndex > GSkinWeightProfilesAllowedFromLOD)
			{
				FSkeletalMeshLODRenderData& RenderData = SkelMeshRenderData->LODRenderData[LODIndex];

				bContainsProfile |= RenderData.SkinWeightProfilesData.ContainsProfile(InProfileName);

				// Retrieve this profile's skin weight buffer

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/SkinnedMeshComponent.cpp:4763

Scope (from outer to inner):

file
lambda-function

Source code excerpt:


								// Check whether or not setting a profile is allow for this LOD index
								if (Index > GSkinWeightProfilesAllowedFromLOD)
								{
									// Retrieve this profile's skin weight buffer
									FSkinWeightVertexBuffer* Buffer = SkinweightData.GetOverrideBuffer(ProfileName);
									FSkelMeshComponentLODInfo& Info = Component->LODInfo[Index];
									Info.OverrideProfileSkinWeights = Buffer;
								}

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

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;

/** Structure storing user facing properties, and is used to identify profiles at the SkeletalMesh level*/