AnimPreviewLightingDirection
AnimPreviewLightingDirection
#Overview
name: AnimPreviewLightingDirection
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 AnimPreviewLightingDirection is to control the direction of the lighting in the animation preview viewport for skeletal meshes in Unreal Engine 5. This setting variable is used to set the light direction in various preview scenes related to animation and skeletal mesh editing.
AnimPreviewLightingDirection is primarily used in the Unreal Engine’s animation and skeletal mesh editing subsystems. It is referenced in multiple modules and plugins, including:
- IKRig Editor plugin
- Detail Customizations module
- Persona module (Animation tools)
- UnrealEd module (Core editor functionality)
The value of this variable is set in the USkeletalMeshEditorSettings class constructor, which is defined in the UnrealEd module. The default value is a FRotator(-45.0f, 45.0f, 0), representing a rotation of -45 degrees around the X-axis and 45 degrees around the Y-axis.
AnimPreviewLightingDirection interacts with other related variables such as:
- AnimPreviewDirectionalColor: Sets the color of the directional light
- AnimPreviewLightBrightness: Controls the brightness of the light
Developers should be aware that:
- This variable affects the visual appearance of skeletal meshes and animations in various editor viewports and preview windows.
- Changes to this setting will impact all animation preview scenes across different tools in the engine.
- The lighting direction can significantly affect how animations and skeletal meshes appear, potentially influencing how artists and animators perceive their work.
Best practices when using this variable include:
- Ensure consistency across your project by communicating any changes to this setting with your art and animation teams.
- Consider creating project-specific presets for different lighting scenarios if needed.
- Be mindful of how changes to this variable might affect the visibility of important animation details or skeletal mesh features.
- Use in conjunction with other lighting-related settings (color, brightness) to achieve the desired preview environment.
- Remember that this is a preview setting and may not reflect the final in-game lighting conditions.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:142, section: [/Script/UnrealEd.SkeletalMeshEditorSettings]
- INI Section:
/Script/UnrealEd.SkeletalMeshEditorSettings
- Raw value:
(Pitch=320.000000,Yaw=290.000000,Roll=0.000000)
- 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:580
Scope (from outer to inner):
file
function FRetargetPoseViewportClient::FRetargetPoseViewportClient
Source code excerpt:
// update lighting
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];
#Loc: <Workspace>/Engine/Source/Editor/DetailCustomizations/Private/AnimMontageSegmentDetails.cpp:95
Scope (from outer to inner):
file
function void FAnimationSegmentViewportClient::UpdateLighting
Source code excerpt:
const USkeletalMeshEditorSettings* Options = GetDefault<USkeletalMeshEditorSettings>();
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:1577
Scope (from outer to inner):
file
function void SAnimationSequenceBrowser::CreateAssetTooltipResources
Source code excerpt:
const USkeletalMeshEditorSettings* Options = GetDefault<USkeletalMeshEditorSettings>();
PreviewScene.SetLightDirection(Options->AnimPreviewLightingDirection);
PreviewScene.SetLightColor(Options->AnimPreviewDirectionalColor);
PreviewScene.SetLightBrightness(Options->AnimPreviewLightBrightness);
}
bool SAnimationSequenceBrowser::OnVisualizeAssetToolTip(const TSharedPtr<SWidget>& TooltipContent, FAssetData& AssetData)
{
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/Settings/SkeletalMeshEditorSettings.h:37
Scope (from outer to inner):
file
class class USkeletalMeshEditorSettings : public UObject
Source code excerpt:
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:594
Scope (from outer to inner):
file
class class FBasePoseViewportClient: public FEditorViewportClient
function void UpdateLighting
Source code excerpt:
const USkeletalMeshEditorSettings* Options = GetDefault<USkeletalMeshEditorSettings>();
PreviewScene->SetLightDirection(Options->AnimPreviewLightingDirection);
PreviewScene->SetLightColor(Options->AnimPreviewDirectionalColor);
PreviewScene->SetLightBrightness(Options->AnimPreviewLightBrightness);
}
};
////////////////////////////////
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Settings/SettingsClasses.cpp:158
Scope (from outer to inner):
file
function USkeletalMeshEditorSettings::USkeletalMeshEditorSettings
Source code excerpt:
: Super(ObjectInitializer)
{
AnimPreviewLightingDirection = FRotator(-45.0f, 45.0f, 0);
AnimPreviewSkyColor = FColor::Blue;
AnimPreviewFloorColor = FColor(51, 51, 51);
AnimPreviewSkyBrightness = 0.2f * PI;
AnimPreviewDirectionalColor = FColor::White;
AnimPreviewLightBrightness = 1.0f * PI;
}