DefaultLensPresetName

DefaultLensPresetName

#Overview

name: DefaultLensPresetName

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

#Summary

#Usage in the C++ source code

The purpose of DefaultLensPresetName is to specify the default lens preset for the Cinematic Camera component in Unreal Engine 5. This setting is used within the CinematicCamera module, which is part of the engine’s camera system for creating high-quality, film-like camera behaviors.

The CinematicCamera module relies on this setting variable, particularly within the UCineCameraComponent and UCineCameraSettings classes. It is used to initialize the lens settings when a new CineCameraComponent is created.

The value of this variable is set in several ways:

  1. It can be configured in the project settings under the CinematicCamera category.
  2. It can be set programmatically using the SetDefaultLensPresetName function in UCineCameraSettings.
  3. It was previously stored in the UCineCameraComponent class but has been deprecated in version 5.1 and moved to UCineCameraSettings.

This variable interacts with other camera-related settings, such as DefaultLensFocalLength and DefaultLensFStop. These settings work together to define the initial state of a cinematic camera in the engine.

Developers should be aware of the following when using this variable:

  1. The variable has been moved from UCineCameraComponent to UCineCameraSettings in UE 5.1, so older code may need to be updated.
  2. The value should correspond to a valid lens preset name defined in the engine or project settings.
  3. Changing this value will affect the initial lens configuration for all new cinematic cameras created in the project.

Best practices when using this variable include:

  1. Use the SetDefaultLensPresetName function to change the value programmatically, as it ensures the change is saved to the configuration.
  2. Ensure that the specified lens preset name exists in your project’s camera settings.
  3. Consider the implications of changing this value on existing cameras and cinematics in your project.
  4. Use in conjunction with other camera settings (like focal length and aperture) to achieve the desired cinematic look.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEngine.ini:3351, section: [/Script/CinematicCamera.CineCameraSettings]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/CinematicCamera/Private/CineCameraComponent.cpp:50

Scope (from outer to inner):

file
function     UCineCameraComponent::UCineCameraComponent

Source code excerpt:

	SetFilmbackPresetByNameInternal(CineCameraSettings->DefaultFilmbackPreset, Filmback);
	SetFilmbackPresetByNameInternal(CineCameraSettings->DefaultFilmbackPreset, FilmbackSettings_DEPRECATED);
	SetLensPresetByNameInternal(CineCameraSettings->DefaultLensPresetName);
	SetCropPresetByNameInternal(CineCameraSettings->DefaultCropPresetName);
	// other lens defaults
	CurrentAperture = CineCameraSettings->DefaultLensFStop;
	CurrentFocalLength = CineCameraSettings->DefaultLensFocalLength;

#Loc: <Workspace>/Engine/Source/Runtime/CinematicCamera/Private/CineCameraSettings.cpp:53

Scope (from outer to inner):

file
function     void UCineCameraSettings::SetDefaultLensPresetName

Source code excerpt:

void UCineCameraSettings::SetDefaultLensPresetName(const FString InDefaultLensPresetName)
{
	DefaultLensPresetName = InDefaultLensPresetName;
	SaveConfig();
}

void UCineCameraSettings::SetDefaultLensFocalLength(const float InDefaultLensFocalLength)
{
	DefaultLensFocalLength = InDefaultLensFocalLength;

#Loc: <Workspace>/Engine/Source/Runtime/CinematicCamera/Private/CineCameraSettings.cpp:214

Scope (from outer to inner):

file
function     void UCineCameraSettings::CopyOldConfigSettings

Source code excerpt:


	FString OldDefaultLensPresetName;
	if (GConfig->GetString(*CineCameraConfigSection, TEXT("DefaultLensPresetName"), OldDefaultLensPresetName, GEngineIni))
	{
		GConfig->SetString(*SettingsConfigSection, TEXT("DefaultLensPresetName"), *OldDefaultLensPresetName, GEngineIni);
	}

	float OldDefaultLensFocalLength;
	if (GConfig->GetFloat(*CineCameraConfigSection, TEXT("DefaultLensFocalLength"), OldDefaultLensFocalLength, GEngineIni))
	{
		GConfig->SetFloat(*SettingsConfigSection, TEXT("DefaultLensFocalLength"), OldDefaultLensFocalLength, GEngineIni);

#Loc: <Workspace>/Engine/Source/Runtime/CinematicCamera/Public/CineCameraComponent.h:229

Scope (from outer to inner):

file
class        class UCineCameraComponent : public UCameraComponent

Source code excerpt:

	UE_DEPRECATED(5.1, "This property is now located on the UCineCameraSettings object")
	UPROPERTY(config)
	FString DefaultLensPresetName;

	/** Default focal length (will be constrained by default lens) */
	UE_DEPRECATED(5.1, "This property is now located on the UCineCameraSettings object")
	UPROPERTY(config)
	float DefaultLensFocalLength;
	

#Loc: <Workspace>/Engine/Source/Runtime/CinematicCamera/Public/CineCameraSettings.h:281

Scope (from outer to inner):

file
class        class UCineCameraSettings : public UDeveloperSettings

Source code excerpt:

	/** Name of the default lens preset */
	UPROPERTY(config, EditAnywhere, BlueprintReadWrite, BlueprintSetter=SetDefaultLensPresetName, Category=Lens, meta=(GetOptions=GetLensPresetNames))
	FString DefaultLensPresetName;
	
	/** Default focal length (will be constrained by default lens) */
	UPROPERTY(config, EditAnywhere, BlueprintReadWrite, BlueprintSetter=SetDefaultLensFocalLength, Category=Lens)
	float DefaultLensFocalLength;
	
	/** Default aperture (will be constrained by default lens) */