CropPresets
CropPresets
#Overview
name: CropPresets
The value of this variable can be defined or overridden in .ini config files. 4
.ini config files referencing this setting variable.
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of CropPresets is to provide a configurable list of preset crop settings for cinematic cameras in Unreal Engine 5. This variable is part of the CinematicCamera module and is used to manage different crop configurations for camera plates.
The CinematicCamera module relies on this setting variable. It’s primarily used within the UCineCameraSettings class, which is a part of the cinematic camera system in Unreal Engine.
The value of this variable is set through the SetCropPresets function, which takes an array of FNamedPlateCropPreset structures. This function also saves the configuration, indicating that the presets are persistent across sessions.
CropPresets interacts with other variables and functions within the UCineCameraSettings class, such as LensPresets and FilmbackPresets. These presets work together to provide a comprehensive set of camera configuration options.
Developers must be aware that:
- CropPresets is a config property, meaning it can be modified in project settings.
- It’s exposed to Blueprints, allowing for runtime modifications.
- The presets are stored as an array of FNamedPlateCropPreset structures, each containing a name and associated crop settings.
Best practices when using this variable include:
- Providing meaningful names for each preset to make them easily identifiable.
- Ensuring that the preset list covers the most commonly used crop settings for your project.
- Using the GetCropPresetByName function to retrieve specific presets by name, rather than accessing the array directly.
- Considering performance implications when frequently accessing or modifying these presets, as they involve config operations.
- Utilizing the Blueprint-exposed functions for runtime modifications if needed, but being cautious about saving changes that might affect other parts of the project.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEngine.ini:3352, section: [/Script/CinematicCamera.CineCameraSettings]
- INI Section:
/Script/CinematicCamera.CineCameraSettings
- Raw value:
(Name="No Crop",CropSettings=(AspectRatio=0))
- Is Array:
True
Location: <Workspace>/Engine/Config/BaseEngine.ini:3353, section: [/Script/CinematicCamera.CineCameraSettings]
- INI Section:
/Script/CinematicCamera.CineCameraSettings
- Raw value:
(Name="1.33 (4:3)",CropSettings=(AspectRatio=1.333333))
- Is Array:
True
Location: <Workspace>/Engine/Config/BaseEngine.ini:3354, section: [/Script/CinematicCamera.CineCameraSettings]
- INI Section:
/Script/CinematicCamera.CineCameraSettings
- Raw value:
(Name="1.77 (16:9)",CropSettings=(AspectRatio=1.777778))
- Is Array:
True
Location: <Workspace>/Engine/Config/BaseEngine.ini:3355, section: [/Script/CinematicCamera.CineCameraSettings]
- INI Section:
/Script/CinematicCamera.CineCameraSettings
- Raw value:
(Name="2.39",CropSettings=(AspectRatio=2.39))
- Is Array:
True
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/CinematicCamera/Private/CineCameraSettings.cpp:96
Scope (from outer to inner):
file
function void UCineCameraSettings::SetCropPresets
Source code excerpt:
void UCineCameraSettings::SetCropPresets(const TArray<FNamedPlateCropPreset>& InCropPresets)
{
CropPresets = InCropPresets;
SaveConfig();
}
TArray<FNamedLensPreset> const& UCineCameraSettings::GetLensPresets()
{
return GetDefault<UCineCameraSettings>()->LensPresets;
#Loc: <Workspace>/Engine/Source/Runtime/CinematicCamera/Private/CineCameraSettings.cpp:112
Scope (from outer to inner):
file
function TArray<FNamedPlateCropPreset> const& UCineCameraSettings::GetCropPresets
Source code excerpt:
TArray<FNamedPlateCropPreset> const& UCineCameraSettings::GetCropPresets()
{
return GetDefault<UCineCameraSettings>()->CropPresets;
}
bool UCineCameraSettings::GetLensPresetByName(const FString PresetName, FCameraLensSettings& LensSettings)
{
FNamedLensPreset* NamedLensPreset = LensPresets.FindByPredicate([PresetName](const FNamedLensPreset& Preset)
{
#Loc: <Workspace>/Engine/Source/Runtime/CinematicCamera/Private/CineCameraSettings.cpp:139
Scope (from outer to inner):
file
function bool UCineCameraSettings::GetCropPresetByName
Source code excerpt:
bool UCineCameraSettings::GetCropPresetByName(const FString PresetName, FPlateCropSettings& CropSettings)
{
FNamedPlateCropPreset* NamedCropPreset = CropPresets.FindByPredicate([PresetName](const FNamedPlateCropPreset& Preset)
{
return Preset.Name == PresetName;
});
CropSettings = NamedCropPreset ? NamedCropPreset->CropSettings : FPlateCropSettings();
return NamedCropPreset != nullptr;
#Loc: <Workspace>/Engine/Source/Runtime/CinematicCamera/Private/CineCameraSettings.cpp:178
Scope (from outer to inner):
file
function TArray<FString> UCineCameraSettings::GetCropPresetNames
Source code excerpt:
{
TArray<FString> CropPresetNames;
for (const FNamedPlateCropPreset& CropPreset : CropPresets)
{
CropPresetNames.Emplace(CropPreset.Name);
}
return CropPresetNames;
}
#Loc: <Workspace>/Engine/Source/Runtime/CinematicCamera/Public/CineCameraSettings.h:309
Scope (from outer to inner):
file
class class UCineCameraSettings : public UDeveloperSettings
Source code excerpt:
/** 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();
static CINEMATICCAMERA_API TArray<FNamedFilmbackPreset> const& GetFilmbackPresets();
static CINEMATICCAMERA_API TArray<FNamedPlateCropPreset> const& GetCropPresets();
// Gets the Lens settings associated with a given preset name