Skip to content

Blueprint & C++

Everything photo mode does is available from Blueprint and C++ through UTALensmanSubsystem, a local player subsystem.

  • Blueprint: Get Lensman (with a player index, 0 by default) or Get Lensman (Controller).
  • C++: UTALensmanLibrary::GetLensman(WorldContext) or LocalPlayer->GetSubsystem<UTALensmanSubsystem>().
UTALensmanSubsystem* Lensman = UTALensmanLibrary::GetLensman(this);
Lensman->SetPhotoModeBlocked(TEXT("Cutscene"), false);
if (Lensman->EnterPhotoMode(MyProfile))
{
Lensman->SetControlValue(TALensmanIds::FocalLength, 85.f);
Lensman->SetControlValue(TALensmanIds::Aperture, 1.8f);
Lensman->StepControl(TALensmanIds::Filter, +1);
Lensman->TakePhoto();
}
Function Description
Enter Photo Mode (Profile) Opens photo mode, with this profile or the usual one. Returns false when it is blocked.
Exit Photo Mode, Toggle Photo Mode
Is Photo Mode Active
Can Enter Photo Mode (out Reason) Whether it may open, and why not.
Set Photo Mode Blocked (Reason, Blocked) Blocks or allows photo mode for a reason; blocking closes it.
Function Description
Get Tabs Every tab with its rows: id, label, type (slider, choice, toggle, action, grid), value, range, options, display text, hint and badge. Grid rows also have a picture and a second line per item.
Get Selected Tab, Set Selected Tab
Get Selected Control, Set Selected Control
Get Control (Id) One row by id.
Set Control Value (Id, Value) A slider’s value, a choice’s index or a toggle’s 0 or 1.
Step Control (Id, Direction) One press of left (−1) or right (+1).
Activate Control (Id) Presses a button row or flips a toggle.
Reset Settings Resets lens, filter, frame, lights and stickers.
Get State, Set State Read and write every setting at once: presets, saved looks.

The ids are in TALensmanIds:

Tab Ids
Camera CameraMode, FocalLength, Roll, Speed, TimeMode, Tripod, ResetCamera
Looks GameLooks, MyLooks, ApplyLook, SaveLook, RenameLook, DeleteLook, CopyLookCode, EnterLookCode
Lens FocusMode, FocusDistance, Aperture, Exposure, Vignette, Grain, ChromaticAberration, Bloom
Filter Filter, FilterStrength, Contrast, Saturation, Temperature
Character Subject, Pose, Expression, LookAt, Turn, HidePlayer, HideOthers
Lights Light, LightOn, LightPreset, LightAngle, LightHeight, LightDistance, LightIntensity, LightHue, LightSaturation, LightSoftness
Scene LightingScenario, SunHeight, SunDirection, TimeOfDay, ResetScene
Frame Frame, AspectRatio, Guide, Logo
Stickers StickerPack, StickerToAdd, AddSticker, SelectedSticker, StickerSize, StickerRotation, MoveSticker, RemoveSticker, ClearStickers

The Clip tab rows have ids too (CaptureMode, ClipFormat, ClipLength, ClipFrameRate, ClipSize, ClipMotion, ClipMotionAmount, ClipSmooth, ClipLoop, RecordClip); the clip settings themselves live in the state (Clip).

The tab ids are Camera, Looks, Lens, Look (the Filter tab), Character, Lights, Scene, Frame, Stickers and Clip.

Function Description
Take Photo Takes a photo. Returns false while the previous one is still being taken.
Is Taking Photo
Get Photo Folder
Get Gallery The gallery object; works outside photo mode too.

The gallery (TALensman Gallery) has Get Folder, Refresh, Get Photos (photos and clips, newest first), Get Thumbnail, Get Image and Get Preview Strip (loaded in the background; On Image Loaded fires when ready), Delete Photo, Open Folder and Reveal Photo (desktop only) and the event On Changed. An entry (TALensman Photo) has its file path, thumbnail path, time, width, height and level, its type (Photo, Gif or Video) and, for clips, the length, frame count and frame rate.

TALensman Clip Player plays a clip from the gallery into a texture: Open, Close, Tick, Get Texture, Is Playing, Set Playing, Get Time, Get Duration and Get Error.

Function Description
Get Looks The game’s looks (built-in first), then the player’s slots.
Get Game Look Count How many of them are the game’s.
Get Selected Look, Get Look Thumbnail (Index) The chosen tile and a tile’s picture.
Apply Look (Index)
Save Look (Slot, Name), Delete Look (Slot), Rename Look (Slot, Name) The player’s slots.
Get Current Look, Apply Look Settings (Look) The current settings as a look, and applying one.
Describe Look (Look) One line such as “85 mm · f/1.8 · Vintage 80% · Polaroid frame · 2 lights”.
Get Look Code (Index) A share code; −1 = the current settings.
Apply Look Code (Code, out Message), Describe Look Code (Code, out Summary, out Problem) Applies a code, or says what it holds and what is wrong with it.
Get Text Box Default, Submit Text Box (Box, Text, out Message) The text box for share codes and look names.

See Looks & share codes.

Function Description
Start Clip (out Error) Starts recording with the clip settings in the state.
Stop Clip (Keep) Stops early; Keep off cancels the clip.
Is Recording Clip, Is Saving Clip
Get Clip Progress, Get Clip Time (out Seconds, out Length)
Is Clip Format Available (Format) Whether GIF or MP4 can be made here.
Get Clip Size The clip’s size in pixels.

See Clips.

Function Description
Set Tripod, Get Tripod Off, Position or Full.
Can Move Sun Whether the Scene tab can turn the sun.
Set Sun Angles (Height, Direction)
Get Lighting Scenarios, Set Lighting Scenario (Index)
Reset Scene Back to the level’s own sun and lighting.

See Scene.

Function Description
Get Page, Set Page Controls (the menu), Gallery or Hidden.
Get Widget, Get Screen Widget The photo mode widget, or what is on screen (its CommonUI host if there is one).
Is Using Gamepad
Get Photo Area (Viewport Size) The part of the screen the photo covers.
Show Message (Text), Show Success (Text) A short message at the top of the screen.
Function Description
Get Subjects The listed characters.
Get Subject Actor The selected one.
Get Subject Pose, Set Subject Pose Pose (−1 = own), expression (−1 = none), look (off or at the camera) and turn of the selected character.
Function Description
Add Sticker (Library Index, Position) Places a sticker from the profile; position from 0 to 1. Returns its index.
Set Sticker Transform (Index, Position, Size, Rotation)
Remove Sticker, Select Sticker
Is Moving Sticker, Set Moving Sticker The gamepad move mode.
Function Description
Focus At Screen Position, Focus At Center Lock focus on what is there (Locked point).
Get Focus Point, Get Focus Screen Position
Get Current Focus Distance
Get Camera Transform, Get Rig
Get Profile, Get Input Config The profile and input layout in use.
Event When
On Photo Mode Entered, On Photo Mode Exited Photo mode opened or closed.
On Photo Taken The shutter fired.
On Photo Saved (Photo) The file is written.
On Look Applied A look was applied.
On Clip Started A clip started recording.
On Clip Saved (Photo) The clip file is written.
On Controls Changed (Control Id) A row changed; None means the whole menu.
On Page Changed (Page)

In C++, OnCaptureFailed reports a failed photo with the message.