Files
UnrealEngineUWP/Engine/Source/Editor/DetailCustomizations/Private/CameraCropSettingsCustomization.h
Guillaume Abadie dd0382b57c Implements anamorphic lens' squeeze factor and post desqueeze aspect ratio crop on the cinecamera
Notes:
* Model used for the squeeze factor is HorizontalFocalLength = LensFocalLength / SqueezeFactor; VerticalFocalLength = LensFocalLength;
* The renderer renders the desqueezed image directly because of not wanting to add support to maintain non squared pixel.
* Squeeze factor is only hooked in to DOF's CoC.
* Squeeze factor currently also affects depth blur which it shouldn't in theory, requires dual CoC shader permutations in DOF algorithm to do that correctly.
* Crop's model fits an aspect ratio directly into the desqueezed full sensor image.
* Crop settings are directly applied to the camera's FOV calculation of the camera to avoid rendering extra pixels.
* Custom crop aspect ratios can be added into the project's DefaultEngine.ini

#rb colin.benoit, rod.bogart, pat.tubach
#fyi colin.benoit, rod.bogart, pat.tubach
#jira none
#preflight 62fcefe51e39eb26a08cede2

[CL 21424608 by Guillaume Abadie in ue5-main branch]
2022-08-17 10:08:42 -04:00

39 lines
1.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Widgets/SWidget.h"
#include "Widgets/Input/SComboBox.h"
#include "IPropertyTypeCustomization.h"
class FDetailWidgetRow;
class IPropertyHandle;
class FCameraCropSettingsCustomization : public IPropertyTypeCustomization
{
public:
FCameraCropSettingsCustomization();
static TSharedRef<IPropertyTypeCustomization> MakeInstance();
/** IPropertyTypeCustomization instance */
virtual void CustomizeHeader(TSharedRef<IPropertyHandle> PropertyHandle, FDetailWidgetRow& HeaderRow, IPropertyTypeCustomizationUtils& CustomizationUtils) override;
virtual void CustomizeChildren( TSharedRef<IPropertyHandle> StructPropertyHandle, class IDetailChildrenBuilder& ChildBuilder, IPropertyTypeCustomizationUtils& StructCustomizationUtils ) override;
protected:
TSharedPtr<IPropertyHandle> AspectRatioHandle;
TSharedPtr<class SComboBox< TSharedPtr<FString> > > PresetComboBox;
TArray< TSharedPtr< FString > > PresetComboList;
void OnPresetChanged(TSharedPtr<FString> NewSelection, ESelectInfo::Type SelectInfo);
TSharedRef<SWidget> MakePresetComboWidget(TSharedPtr<FString> InItem);
FText GetPresetComboBoxContent() const;
TSharedPtr<FString> GetPresetString() const;
protected:
};