AnimPreviewDirectionalColor
AnimPreviewDirectionalColor
#Overview
name: AnimPreviewDirectionalColor
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 AnimPreviewDirectionalColor is to set the color of the directional light in animation preview scenes within the Unreal Engine editor. This setting is primarily used for visualization and rendering purposes in various animation-related tools and editors.
AnimPreviewDirectionalColor is utilized by several Unreal Engine subsystems and modules, particularly those related to animation editing and preview. Based on the callsites, it’s used in:
- IKRig Editor plugin
- Animation Montage editing system
- Animation Sequence Browser
- Skeletal Mesh Editor
- Skeleton Widget
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 config specifier, meaning it can be configured in the project settings.
AnimPreviewDirectionalColor interacts with other animation preview settings, such as:
- AnimPreviewLightingDirection
- AnimPreviewLightBrightness
Developers should be aware that:
- This setting affects the visual appearance of animations in preview windows and may impact how animations look during editing.
- Changes to this color will affect all animation previews that use these settings.
- The color is represented as an FColor, allowing for full RGBA control.
Best practices when using this variable include:
- Choose a color that provides good visibility for your animated models without washing out details.
- Consider how this color interacts with your project’s overall art style and lighting.
- Be consistent in its use across your project to maintain a uniform look in animation previews.
- If you need different lighting for specific assets, consider creating custom preview scenes rather than changing this global setting.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:143, section: [/Script/UnrealEd.SkeletalMeshEditorSettings]
- INI Section:
/Script/UnrealEd.SkeletalMeshEditorSettings
- Raw value:
(B=253,G=253,R=253,A=255)
- Is Array:
False
#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:581
Scope (from outer to inner):
file
function FRetargetPoseViewportClient::FRetargetPoseViewportClient
Source code excerpt:
const USkeletalMeshEditorSettings* Options = GetDefault<USkeletalMeshEditorSettings>();
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();
#Loc: <Workspace>/Engine/Source/Editor/DetailCustomizations/Private/AnimMontageSegmentDetails.cpp:96
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
{
#Loc: <Workspace>/Engine/Source/Editor/Persona/Private/SAnimationSequenceBrowser.cpp:1578
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
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Settings/SkeletalMeshEditorSettings.h:40
Scope (from outer to inner):
file
class class USkeletalMeshEditorSettings : public UObject
Source code excerpt:
UPROPERTY(EditAnywhere, config, Category=AnimationPreview, meta=(DisplayName="Viewport Directional Color"))
FColor AnimPreviewDirectionalColor;
};
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/SSkeletonWidget.cpp:595
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
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/SettingsClasses.cpp:162
Scope (from outer to inner):
file
function USkeletalMeshEditorSettings::USkeletalMeshEditorSettings
Source code excerpt:
AnimPreviewFloorColor = FColor(51, 51, 51);
AnimPreviewSkyBrightness = 0.2f * PI;
AnimPreviewDirectionalColor = FColor::White;
AnimPreviewLightBrightness = 1.0f * PI;
}
/* UEditorExperimentalSettings interface
*****************************************************************************/