DefaultRecomputeTangentDeformer

DefaultRecomputeTangentDeformer

#Overview

name: DefaultRecomputeTangentDeformer

The value of this variable can be defined or overridden in .ini config files. 1 .ini config file referencing this setting variable.

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of DefaultRecomputeTangentDeformer is to provide a default deformer for skinned meshes that require tangent recomputation in the Optimus deformer system within Unreal Engine 5.

This setting variable is primarily used in the Optimus deformer system, which is part of the DeformerGraph plugin in Unreal Engine 5. It’s specifically related to the animation and mesh deformation subsystems.

The value of this variable is set in the Optimus Settings, which can be accessed and modified through the project settings in the Unreal Engine editor. It’s defined as a TSoftObjectPtr in the UOptimusSettings class.

DefaultRecomputeTangentDeformer interacts with other variables such as DefaultDeformer and DefaultMode. These variables work together to determine which deformer to use in different scenarios.

Developers must be aware that this variable is only used when certain conditions are met:

  1. The Optimus Settings’ DefaultMode is not set to “Never”
  2. The mesh is requesting tangent recomputation
  3. No other deformer has been explicitly set for the mesh

Best practices when using this variable include:

  1. Ensure that the assigned deformer is specifically designed for tangent recomputation
  2. Only set this variable if you need a default deformer for meshes that require tangent recomputation
  3. Be mindful of the performance implications of using a tangent recomputation deformer by default
  4. Regularly review and update the assigned deformer as needed to maintain optimal performance and quality

When working with this variable, developers should also consider the overall deformer strategy for their project and how this default deformer fits into that strategy.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Plugins/Animation/DeformerGraph/Config/BaseDeformerGraph.ini:47, section: [/Script/OptimusSettings.OptimusSettings]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Animation/DeformerGraph/Source/OptimusSettings/Private/OptimusSettingsModule.cpp:85

Scope (from outer to inner):

file
function     void FOptimusSettingsModule::CacheDefaultMeshDeformers

Source code excerpt:

	const bool bLoadDeformers = InSettings != nullptr && InSettings->DefaultMode != EOptimusDefaultDeformerMode::Never;
	DefaultDeformer = TStrongObjectPtr<UMeshDeformer>(bLoadDeformers && !InSettings->DefaultDeformer.IsNull() ? InSettings->DefaultDeformer.LoadSynchronous() : nullptr);
	DefaultRecomputeTangentDeformer = TStrongObjectPtr<UMeshDeformer>(bLoadDeformers && !InSettings->DefaultRecomputeTangentDeformer.IsNull() ? InSettings->DefaultRecomputeTangentDeformer.LoadSynchronous() : nullptr);
}

TObjectPtr<UMeshDeformer> FOptimusSettingsModule::GetDefaultMeshDeformer(FDefaultMeshDeformerSetup const& Setup)
{
	const UOptimusSettings* Settings = GetDefault<UOptimusSettings>();
	if (Settings != nullptr && 

#Loc: <Workspace>/Engine/Plugins/Animation/DeformerGraph/Source/OptimusSettings/Private/OptimusSettingsModule.cpp:95

Scope (from outer to inner):

file
function     TObjectPtr<UMeshDeformer> FOptimusSettingsModule::GetDefaultMeshDeformer

Source code excerpt:

		(Settings->DefaultMode == EOptimusDefaultDeformerMode::OptIn && Setup.bIsRequestingDeformer)))
	{
		if (Setup.bIsRequestingRecomputeTangent && DefaultRecomputeTangentDeformer)
		{
			return DefaultRecomputeTangentDeformer.Get();
		}
		if (DefaultDeformer)
		{ 
			return DefaultDeformer.Get();
		}
	}

#Loc: <Workspace>/Engine/Plugins/Animation/DeformerGraph/Source/OptimusSettings/Private/OptimusSettingsModule.h:23

Scope (from outer to inner):

file
class        class FOptimusSettingsModule : public IModuleInterface, public IMeshDeformerProvider

Source code excerpt:


	TStrongObjectPtr<UMeshDeformer> DefaultDeformer;
	TStrongObjectPtr<UMeshDeformer> DefaultRecomputeTangentDeformer;
};

#Loc: <Workspace>/Engine/Plugins/Animation/DeformerGraph/Source/OptimusSettings/Public/OptimusSettings.h:38

Scope (from outer to inner):

file
class        class UOptimusSettings : public UDeveloperSettings

Source code excerpt:

	/** A default deformer that will be used on a skinned mesh if no other deformer has been set, and if the mesh has requested to recompute tangets. */
	UPROPERTY(config, EditAnywhere, Category = DeformerGraph, meta = (AllowedClasses = "/Script/OptimusCore.OptimusDeformer", EditCondition = "DefaultMode != EOptimusDefaultDeformerMode::Never"))
	TSoftObjectPtr<UMeshDeformer> DefaultRecomputeTangentDeformer;

#if WITH_EDITOR
	DECLARE_MULTICAST_DELEGATE_OneParam(FOnUpdateSettings, UOptimusSettings const*);
	static FOnUpdateSettings OnSettingsChange;

	void PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent) override;