RigVM.EnablePreLoadFiltering

RigVM.EnablePreLoadFiltering

#Overview

name: RigVM.EnablePreLoadFiltering

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 RigVM.EnablePreLoadFiltering is to optimize load times for RigVM graphs by skipping them during the preload phase. This setting variable is primarily used in the RigVM system, which is part of Unreal Engine’s animation and rigging framework.

The RigVM module, specifically the RigVMDeveloper subsystem, relies on this setting variable. This can be seen from the file path where the variable is defined: Engine/Plugins/Runtime/RigVM/Source/RigVMDeveloper/Private/RigVMBlueprint.cpp.

The value of this variable is set as a console variable using TAutoConsoleVariable. It is initialized to true by default, meaning that preload filtering is enabled out of the box.

This variable interacts with the URigVMBlueprint class, specifically in the RequiresForceLoadMembers function. When the variable is set to true, it affects how RigVM graphs are loaded, potentially improving load times.

Developers must be aware that changing this variable will impact the loading behavior of RigVM graphs. Setting it to false will disable the optimization, which might be necessary for debugging or in scenarios where full preloading is required.

Best practices when using this variable include:

  1. Leaving it enabled (true) for production builds to benefit from improved load times.
  2. Consider disabling it temporarily during development if you need to debug issues related to RigVM graph loading.
  3. Be cautious when modifying this setting, as it can affect the performance of RigVM-based systems in your project.

Regarding the associated variable CVarRigVMEnablePreLoadFiltering:

The purpose of CVarRigVMEnablePreLoadFiltering is to provide programmatic access to the RigVM.EnablePreLoadFiltering console variable within the C++ code.

This variable is used in the RigVMDeveloper module, specifically in the URigVMBlueprint class.

The value of this variable is set when the TAutoConsoleVariable is initialized, which happens when the module is loaded.

CVarRigVMEnablePreLoadFiltering directly interacts with the RequiresForceLoadMembers function of URigVMBlueprint, controlling whether RigVM graphs are filtered during preload.

Developers should be aware that this variable provides a way to check the current state of the preload filtering optimization at runtime.

Best practices for using CVarRigVMEnablePreLoadFiltering include:

  1. Use it to conditionally execute code based on whether preload filtering is enabled.
  2. Avoid frequently checking or changing its value, as it’s intended to be a relatively static configuration.
  3. If you need to temporarily disable preload filtering in code, consider using a scoped change rather than modifying the global state.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Runtime/RigVM/Source/RigVMDeveloper/Private/RigVMBlueprint.cpp:41

Scope: file

Source code excerpt:


TAutoConsoleVariable<bool> CVarRigVMEnablePreLoadFiltering(
	TEXT("RigVM.EnablePreLoadFiltering"),
	true,
	TEXT("When true the RigVMGraphs will be skipped during preload to speed up load times."));

TAutoConsoleVariable<bool> CVarRigVMEnablePostLoadHashing(
	TEXT("RigVM.EnablePostLoadHashing"),
	true,

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Plugins/Runtime/RigVM/Source/RigVMDeveloper/Private/RigVMBlueprint.cpp:40

Scope: file

Source code excerpt:

#define LOCTEXT_NAMESPACE "RigVMBlueprint"

TAutoConsoleVariable<bool> CVarRigVMEnablePreLoadFiltering(
	TEXT("RigVM.EnablePreLoadFiltering"),
	true,
	TEXT("When true the RigVMGraphs will be skipped during preload to speed up load times."));

TAutoConsoleVariable<bool> CVarRigVMEnablePostLoadHashing(
	TEXT("RigVM.EnablePostLoadHashing"),

#Loc: <Workspace>/Engine/Plugins/Runtime/RigVM/Source/RigVMDeveloper/Private/RigVMBlueprint.cpp:339

Scope (from outer to inner):

file
function     bool URigVMBlueprint::RequiresForceLoadMembers

Source code excerpt:

{
	// only filter if the console variable is enabled
	if(!CVarRigVMEnablePreLoadFiltering->GetBool())
	{
		return UBlueprint::RequiresForceLoadMembers(InObject);
	}

	// we can stop traversing when hitting a URigVMNode
	// except for collapse nodes - since they contain a graphs again