r.SkeletalMeshClothBlend.Enabled

r.SkeletalMeshClothBlend.Enabled

#Overview

name: r.SkeletalMeshClothBlend.Enabled

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 r.SkeletalMeshClothBlend.Enabled is to control the use of cloth blend weight values in skeletal mesh components. It is primarily related to the rendering system, specifically for skeletal mesh rendering and cloth simulation.

This setting variable is used in the Engine module, particularly in the skeletal rendering subsystem. It’s referenced in the SkeletalRender.cpp file, which is part of the core rendering functionality for skeletal meshes in Unreal Engine.

The value of this variable is set as a console variable using TAutoConsoleVariable. It’s initialized with a default value of true, meaning the cloth blend weight feature is enabled by default.

The associated variable CVarSkeletalMeshClothBlendEnabled directly interacts with r.SkeletalMeshClothBlend.Enabled. They share the same value and purpose.

Developers must be aware that when this variable is disabled (set to false), all cloth blend weights will become 0, effectively disabling the cloth blending feature for skeletal meshes. This can have a significant impact on the appearance and behavior of cloth simulations in the game.

Best practices when using this variable include:

  1. Only disable it if you’re certain you don’t need cloth blending for any skeletal meshes in your project.
  2. If you’re experiencing performance issues related to cloth simulation, consider disabling this as a temporary measure to isolate the problem.
  3. Be aware that changing this value at runtime may cause visual changes in cloth-enabled characters or objects.

Regarding the associated variable CVarSkeletalMeshClothBlendEnabled:

This is the actual C++ variable that controls the feature. It’s implemented as a TAutoConsoleVariable, which allows it to be changed via console commands or through code.

The IsSkeletalMeshClothBlendEnabled() function provides a convenient way to check the current state of this setting from anywhere in the code. This function is likely called in various parts of the skeletal mesh rendering pipeline to determine whether to apply cloth blend weights.

Developers should use the IsSkeletalMeshClothBlendEnabled() function when they need to check this setting in their code, rather than accessing the CVarSkeletalMeshClothBlendEnabled variable directly. This provides a layer of abstraction and makes the code more maintainable.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SkeletalRender.cpp:52

Scope: file

Source code excerpt:

#endif // RHI_RAYTRACING

static TAutoConsoleVariable<bool> CVarSkeletalMeshClothBlendEnabled(TEXT("r.SkeletalMeshClothBlend.Enabled"), true, TEXT("Enable the use of the cloth blend weight value set by the skeletal mesh component. When disabled all cloth blend weight will become 0."));

/*-----------------------------------------------------------------------------
FSkeletalMeshObject
-----------------------------------------------------------------------------*/

FSkeletalMeshObject::FSkeletalMeshObject(USkinnedMeshComponent* InMeshComponent, FSkeletalMeshRenderData* InSkelMeshRenderData, ERHIFeatureLevel::Type InFeatureLevel)

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SkeletalRender.cpp:52

Scope: file

Source code excerpt:

#endif // RHI_RAYTRACING

static TAutoConsoleVariable<bool> CVarSkeletalMeshClothBlendEnabled(TEXT("r.SkeletalMeshClothBlend.Enabled"), true, TEXT("Enable the use of the cloth blend weight value set by the skeletal mesh component. When disabled all cloth blend weight will become 0."));

/*-----------------------------------------------------------------------------
FSkeletalMeshObject
-----------------------------------------------------------------------------*/

FSkeletalMeshObject::FSkeletalMeshObject(USkinnedMeshComponent* InMeshComponent, FSkeletalMeshRenderData* InSkelMeshRenderData, ERHIFeatureLevel::Type InFeatureLevel)

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SkeletalRender.cpp:526

Scope (from outer to inner):

file
function     bool IsSkeletalMeshClothBlendEnabled

Source code excerpt:

bool IsSkeletalMeshClothBlendEnabled()
{
	return CVarSkeletalMeshClothBlendEnabled.GetValueOnAnyThread();
}