DefaultCropPresetName
DefaultCropPresetName
#Overview
name: DefaultCropPresetName
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 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of DefaultCropPresetName is to specify the default crop preset for cinematic cameras in Unreal Engine 5. This setting variable is used in the Cinematic Camera system, which is part of the CinematicCamera module.
The CinematicCamera module relies on this setting variable, as evidenced by its usage in the UCineCameraComponent and UCineCameraSettings classes. These classes are responsible for managing cinematic camera properties and settings.
The value of this variable is set in the UCineCameraSettings class, which is derived from UDeveloperSettings. It can be modified through the engine’s configuration system or programmatically using the SetDefaultCropPresetName function.
DefaultCropPresetName interacts with the CropPresets array, which contains a list of available crop presets. The default crop preset specified by DefaultCropPresetName should correspond to one of the presets defined in the CropPresets array.
Developers should be aware that changing this variable will affect the initial crop settings for all cinematic cameras in the project. It’s important to ensure that the specified default crop preset name exists in the CropPresets array to avoid potential issues.
Best practices when using this variable include:
- Choosing a default crop preset that is suitable for the majority of your project’s cinematic shots.
- Ensuring that the DefaultCropPresetName always corresponds to a valid preset in the CropPresets array.
- Using the SetDefaultCropPresetName function to modify this value programmatically, as it also calls SaveConfig() to persist the changes.
- Considering the impact on existing cinematic cameras in the project when changing the default crop preset.
- Documenting any custom crop presets and the default selection for project consistency.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEngine.ini:3356, section: [/Script/CinematicCamera.CineCameraSettings]
- INI Section:
/Script/CinematicCamera.CineCameraSettings
- Raw value:
"No Crop"
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/CinematicCamera/Private/CineCameraComponent.cpp:51
Scope (from outer to inner):
file
function UCineCameraComponent::UCineCameraComponent
Source code excerpt:
SetFilmbackPresetByNameInternal(CineCameraSettings->DefaultFilmbackPreset, FilmbackSettings_DEPRECATED);
SetLensPresetByNameInternal(CineCameraSettings->DefaultLensPresetName);
SetCropPresetByNameInternal(CineCameraSettings->DefaultCropPresetName);
// other lens defaults
CurrentAperture = CineCameraSettings->DefaultLensFStop;
CurrentFocalLength = CineCameraSettings->DefaultLensFocalLength;
RecalcDerivedData();
#Loc: <Workspace>/Engine/Source/Runtime/CinematicCamera/Private/CineCameraSettings.cpp:90
Scope (from outer to inner):
file
function void UCineCameraSettings::SetDefaultCropPresetName
Source code excerpt:
void UCineCameraSettings::SetDefaultCropPresetName(const FString InDefaultCropPresetName)
{
DefaultCropPresetName = InDefaultCropPresetName;
SaveConfig();
}
void UCineCameraSettings::SetCropPresets(const TArray<FNamedPlateCropPreset>& InCropPresets)
{
CropPresets = InCropPresets;
#Loc: <Workspace>/Engine/Source/Runtime/CinematicCamera/Public/CineCameraSettings.h:305
Scope (from outer to inner):
file
class class UCineCameraSettings : public UDeveloperSettings
Source code excerpt:
/** Name of the default crop preset */
UPROPERTY(config, EditAnywhere, BlueprintReadWrite, BlueprintSetter=SetDefaultCropPresetName, Category=Crop, meta=(GetOptions=GetCropPresetNames))
FString DefaultCropPresetName;
/** List of available crop presets */
UPROPERTY(config, EditAnywhere, BlueprintReadWrite, BlueprintSetter=SetCropPresets, Category=Crop, meta=(TitleProperty=Name))
TArray<FNamedPlateCropPreset> CropPresets;
static CINEMATICCAMERA_API TArray<FNamedLensPreset> const& GetLensPresets();