AnimPreviewLightBrightness

AnimPreviewLightBrightness

#Overview

name: AnimPreviewLightBrightness

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 6 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of AnimPreviewLightBrightness is to control the brightness of the light used in animation previews within the Unreal Engine editor. This setting is primarily used for rendering and visualization purposes in the animation editing tools.

AnimPreviewLightBrightness is utilized by several Unreal Engine subsystems and modules, primarily those related to animation editing and preview. Based on the callsites, it’s used in:

  1. The IKRig Editor plugin
  2. The Persona editor (animation editing tool)
  3. The DetailCustomizations module
  4. The UnrealEd module

The value of this variable is set in the USkeletalMeshEditorSettings class, which is part of the UnrealEd module. It’s defined as a UPROPERTY with the EditAnywhere and config specifiers, meaning it can be edited in the editor and saved to configuration files.

AnimPreviewLightBrightness interacts with other related variables, specifically:

Developers should be aware that:

  1. This variable affects the visual appearance of animations in the editor, not in the final game.
  2. Changes to this value will impact all animation previews in the editor.
  3. The value is multiplied by PI in the constructor of USkeletalMeshEditorSettings, so the actual brightness might be higher than the raw value suggests.

Best practices when using this variable include:

  1. Adjust it in conjunction with other lighting settings (direction and color) for the best preview results.
  2. Be consistent in its usage across a project to ensure all team members are viewing animations under similar lighting conditions.
  3. Consider the impact on different types of materials and character designs when setting this value.
  4. Remember that while it’s important for preview quality, it doesn’t affect the final in-game rendering.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:141, section: [/Script/UnrealEd.SkeletalMeshEditorSettings]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Animation/IKRig/Source/IKRigEditor/Private/RetargetEditor/SRetargetAnimAssetsWindow.cpp:582

Scope (from outer to inner):

file
function     FRetargetPoseViewportClient::FRetargetPoseViewportClient

Source code excerpt:

	PreviewScene->SetLightDirection(Options->AnimPreviewLightingDirection);
	PreviewScene->SetLightColor(Options->AnimPreviewDirectionalColor);
	PreviewScene->SetLightBrightness(Options->AnimPreviewLightBrightness);

	// add a skylight so that models are visible from all angles
	// TODO, why isn't this working?
	FPreviewSceneProfile& DefaultProfile = UAssetViewerSettings::Get()->Profiles[GetMutableDefault<UEditorPerProjectUserSettings>()->AssetViewerProfileIndex];
	DefaultProfile.LoadEnvironmentMap();
	UTextureCube* CubeMap = DefaultProfile.EnvironmentCubeMap.Get();

#Loc: <Workspace>/Engine/Source/Editor/DetailCustomizations/Private/AnimMontageSegmentDetails.cpp:97

Scope (from outer to inner):

file
function     void FAnimationSegmentViewportClient::UpdateLighting

Source code excerpt:

	PreviewScene->SetLightDirection(Options->AnimPreviewLightingDirection);
	PreviewScene->SetLightColor(Options->AnimPreviewDirectionalColor);
	PreviewScene->SetLightBrightness(Options->AnimPreviewLightBrightness);
}


FSceneInterface* FAnimationSegmentViewportClient::GetScene() const
{
	return PreviewScene->GetScene();

#Loc: <Workspace>/Engine/Source/Editor/Persona/Private/SAnimationSequenceBrowser.cpp:1579

Scope (from outer to inner):

file
function     void SAnimationSequenceBrowser::CreateAssetTooltipResources

Source code excerpt:

	PreviewScene.SetLightDirection(Options->AnimPreviewLightingDirection);
	PreviewScene.SetLightColor(Options->AnimPreviewDirectionalColor);
	PreviewScene.SetLightBrightness(Options->AnimPreviewLightBrightness);
}

bool SAnimationSequenceBrowser::OnVisualizeAssetToolTip(const TSharedPtr<SWidget>& TooltipContent, FAssetData& AssetData)
{
	// Resolve the asset
	USkeletalMesh* MeshToUse = nullptr;

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Settings/SkeletalMeshEditorSettings.h:34

Scope (from outer to inner):

file
class        class USkeletalMeshEditorSettings : public UObject

Source code excerpt:


	UPROPERTY(EditAnywhere, config, Category=AnimationPreview, meta=(DisplayName="Viewport Light Brightness"))
	float AnimPreviewLightBrightness;

	UPROPERTY(EditAnywhere, config, Category=AnimationPreview, meta=(DisplayName="Viewport Lighting Direction"))
	FRotator AnimPreviewLightingDirection;

	UPROPERTY(EditAnywhere, config, Category=AnimationPreview, meta=(DisplayName="Viewport Directional Color"))
	FColor AnimPreviewDirectionalColor;

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/SSkeletonWidget.cpp:596

Scope (from outer to inner):

file
class        class FBasePoseViewportClient: public FEditorViewportClient
function     void UpdateLighting

Source code excerpt:

		PreviewScene->SetLightDirection(Options->AnimPreviewLightingDirection);
		PreviewScene->SetLightColor(Options->AnimPreviewDirectionalColor);
		PreviewScene->SetLightBrightness(Options->AnimPreviewLightBrightness);
	}
};

////////////////////////////////
// SBasePoseViewport
void SBasePoseViewport::Construct(const FArguments& InArgs)

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/SettingsClasses.cpp:163

Scope (from outer to inner):

file
function     USkeletalMeshEditorSettings::USkeletalMeshEditorSettings

Source code excerpt:

	AnimPreviewSkyBrightness = 0.2f * PI;
	AnimPreviewDirectionalColor = FColor::White;
	AnimPreviewLightBrightness = 1.0f * PI;
}

/* UEditorExperimentalSettings interface
 *****************************************************************************/

static TAutoConsoleVariable<int32> CVarEditorHDRSupport(