I’ve tried all that I could think of, but nothing seems to change the camera lens.
#include "MyCineCameraComponent.h"
#include "Camera/CameraTypes.h"
#include "Engine/Scene.h"
#include "Math/Color.h"
MyCineCameraComponent::MyCineCameraComponent()
{
FCameraLensSettings cs;
cs.DiaphragmBladeCount = 8;
cs.MaxFocalLength = 2000.0f;
cs.MinFocalLength = 10.0f;
cs.MaxFStop = 2.8f;
cs.MinFStop = 1.8f;
cs.MinimumFocusDistance = 10.0f;
LensSettings = cs;
FCameraFocusSettings fs;
fs.bDrawDebugFocusPlane = true;
fs.DebugFocusPlaneColor = FColor(255.0f, 0.0f, 0.0f, 1.0f);
FocusSettings = fs;
DefaultLensFocalLength = 24.0f;
DefaultLensFStop = 2.0f;
CurrentFocalLength = 12.0f;
}
void MyCineCameraComponent::TickComponent(float deltaTime, ELevelTick tick, FActorComponentTickFunction *fn)
{
Super::TickComponent(deltaTime, tick, fn);
FPostProcessSettings post;
post.bOverride_DepthOfFieldFocalDistance = true;
post.bOverride_DepthOfFieldFstop = true;
post.bOverride_DepthOfFieldMinFstop = true;
post.bOverride_SceneColorTint = true;
post.bOverride_VignetteIntensity = true;
post.bOverride_DepthOfFieldVignetteSize = true;
post.DepthOfFieldFstop = 2.0f;
post.DepthOfFieldMinFstop = 1.8f;
post.DepthOfFieldFocalDistance = 12.0f;
post.DepthOfFieldVignetteSize = 50.0f;
post.MotionBlurAmount = 0.0f;
post.MotionBlurMax = 0.0f;
post.SceneColorTint = FLinearColor(255.0f, 0.0f, 0.0f, 1.0f);
post.VignetteIntensity = 1.0f;
FMinimalViewInfo cl;
cl.AspectRatio = 16.0f / 9.0f;
cl.bConstrainAspectRatio = true;
cl.DesiredFOV = 120.0f;
cl.FOV = 120.0f;
cl.PostProcessBlendWeight = 1.0f;
cl.PostProcessSettings = post;
UpdateCameraLens(deltaTime, cl);
}