#1572: Camera mode on the new interface kit #1621

Closed
TheSlowly wants to merge 0 commits from TheSlowly/Slipstream:camera-kit-1572 into main
Collaborator

Part of #1572: camera mode's overlay (#1573, #1576–#1579, presets #1231) rebuilt as one RmlUi document on the new interface kit, plus saving to inventory, profile and e-mail.

  • One document (slcameraview.cpp) over a UI-free model (slcameramodel.cpp) replaces the hand-drawn overlay. The input decisions are tested (camera-input, camera-bar-layout), the document by a new camera-rml check.
  • Runs in every UIRenderer mode; the classic snapshot window opens only if RmlUi cannot start.
  • Save to inventory, Share to profile and Send by e-mail, each confirmed on a card first.
  • Camera mode owns its keys (no fall-through to gestures; menu shortcuts that would open hidden windows do nothing). Help is F1, review R.
  • Outside camera mode: RmlUi fields (the new interface too) get text input for AltGr and dead keys, copy and paste, and their cursor; the classic snapshot window remembers "Current Window"; one shutter sound per inventory snapshot.
  • New setting UIKitTheme (0 dark, 1 light), read by camera mode only for now.

Design: doc/camera-mode-design.md. Test plan: doc/testplans/1572-camera-mode.md. Played in-world with UIRenderer 0 and the dark theme. Not run yet: UIRenderer 1 and 2, the light theme, and the inventory / profile / e-mail uploads.

Part of #1572: camera mode's overlay (#1573, #1576–#1579, presets #1231) rebuilt as one RmlUi document on the new interface kit, plus saving to inventory, profile and e-mail. - One document (`slcameraview.cpp`) over a UI-free model (`slcameramodel.cpp`) replaces the hand-drawn overlay. The input decisions are tested (`camera-input`, `camera-bar-layout`), the document by a new `camera-rml` check. - Runs in every `UIRenderer` mode; the classic snapshot window opens only if RmlUi cannot start. - Save to inventory, Share to profile and Send by e-mail, each confirmed on a card first. - Camera mode owns its keys (no fall-through to gestures; menu shortcuts that would open hidden windows do nothing). Help is F1, review R. - Outside camera mode: RmlUi fields (the new interface too) get text input for AltGr and dead keys, copy and paste, and their cursor; the classic snapshot window remembers "Current Window"; one shutter sound per inventory snapshot. - New setting `UIKitTheme` (0 dark, 1 light), read by camera mode only for now. Design: `doc/camera-mode-design.md`. Test plan: `doc/testplans/1572-camera-mode.md`. Played in-world with `UIRenderer` 0 and the dark theme. Not run yet: `UIRenderer` 1 and 2, the light theme, and the inventory / profile / e-mail uploads.
Camera mode asks the RmlUi host to install at its first entry, in any
UIRenderer mode, and the host keeps it for the session. While camera
mode is up its document is the only one shown and it draws although the
interface is hidden; with UIRenderer 0 the host records nothing while
camera mode is closed. If RmlUi is poisoned or the document cannot
start, snapshots open the classic snapshot window instead.

The document is a stub for now (a pill and the shutter); the hand-drawn
overlay still draws on top. SLCameraModeTestPoison is a temporary switch
to test the fallback and goes away with the old overlay.
Pure layout for the quick-shot bar, tested on the host: the shutter on
the window's centre line at any width and UI scale, outer buttons 104 dp
and inner 168 dp on both sides, labels one type step smaller before they
truncate, and the 8 s hint row.
Pure decisions for camera mode's input, tested on the host: a click
focuses, a double-click on the same spot within the double-click time
focuses and shoots, the click that brings the window to the front and a
drag do nothing, right-click vs right-drag, the wheel's target by state
and modifiers, and the camera keys standing back while typing.
Exposure, focus, drive, the shot, framing settings and the Q menu values
move from slcameramode.cpp into SLCameraModel, which neither draws nor
hit-tests. The hand-drawn overlay and the input handlers now call it;
behaviour is unchanged. The model adds what the kit overlay will need:
a cell per value (value, unit, plain name, off, the marked dial), named
steps and resets, and accessors for the AF point, notices and the drive.
The camera document now has the quick-shot bar (Leave, Save to disk,
the shutter on the centre line, the size and file type, Controls) laid
out by the tested bar geometry, the corner marks, the hint row for 8 s
after entering or opening Controls, the mouse and keys card behind ?,
and notices from the camera. Holding the shutter focuses, letting go
over it shoots, sliding off cancels. The document gets first refusal on
clicks and the wheel over its elements.

New settings: SLCameraModeControlsOpen, SLCameraModeBarHidden,
SLCameraModeBarTop and UIKitTheme.
Save to disk (with the folder shots go to) and Open classic snapshot
window; the size popover chooses the aspect, the size (window, three
presets or custom), the file type, the JPEG quality and post effects.
The values live in the existing snapshot settings, written through the
camera model. Esc and a click outside close a popover; a field being
typed in keeps its keys.
With Controls open, the strip above the bar shows every camera value
with its unit and a plain word under it; the dial the wheel turns is
tinted and underlined, values whose effect is off are dimmed. A click
switches motion blur, depth of field or white balance on and off, or
steps the others. The chips choose the grid (with previews), switch the
level and open Photo Studio. The crop mask, grid, level, tilt knob
(drag to tilt, double-click to straighten) and AF point are part of the
document, placed from the camera model.
The Q menu's values (mode, ISO, white balance, drive, focus, picture
style, aspect, grid) are one grid of value cells: at the pointer for
quick settings, centred for the Q key, and from the strip's more cell.
The wheel over a cell changes it, a click steps it, the arrows choose
and change, Esc or a click outside closes it.
The handle under the bar (or H) takes the bar out of the frame, a
remembered state: only the shutter and the handle stay, a notice says
how to bring it back, and resting the pointer on the edge shows the bar
for as long as the pointer stays on it (no timers). Dragging the handle
past half the window moves the bar to the top edge. While the bar is
out, the wheel's change shows in a readout above the shutter.
After a shot: "Saved to disk" with Show in folder at the top for 3 s,
the session's newest thumbnails bottom-left (then "+N"), and a card
for any of them (or the newest, from P): the preview, its histogram,
when it was taken, size and type, Show in folder, Retake and Delete.
Show in folder and Delete say so when the file is no longer on disk.

The shots reach RmlUi as their viewer textures through a source for
"llext:camshot/" names on the atlas (alongside the classic presenter's);
each shot has a serial, and its textures are let go when it leaves the
review. The viewer window keeps the path of the last snapshot saved to
disk and opens the snapshot folder for both the snapshot panel and
camera mode.
The rail's sections and rows (look and grade, sky and time, haze,
effects, scene, camera presets) are data the kit overlay draws: a panel
on the remembered side, opened from the Photo Studio chip, with
sliders that follow a drag or the wheel, switches, choices with arrows
and button rows; Open Photo Studio leaves camera mode first. The rail
now docks to the right edge by default.
Camera mode routes input through the tested decisions: a click on the
picture focuses there, a double-click on the same spot focuses and
shoots, the click that brings the window to the front does nothing;
right-click opens quick settings at the pointer and a right-drag orbits
the camera's focus without turning the avatar; the wheel moves the
camera in quick shot and turns the marked value with Controls open, the
value under the pointer, the grid over its chip, the tilt over its
knob, with Shift, Ctrl and Alt as before. The camera keys stand back
while a field, popover or card is open; Esc closes the innermost one.
New rebindable keys: H (the bar) and ? (the mouse and keys card).

The old overlay's hit-testing goes; its drawing stays until the next
change.
UIKitTheme (0 dark, 1 light) chooses the kit tokens the camera document
loads with; a change reloads the document under the new tokens and keeps
every state. The viewfinder marks (corners, level, tilt knob, AF point,
centre cross) stay light in both themes since they sit on the world.
What the hand-drawn overlay still did on its own, now in the kit
document: the plain-language help for the strip cell under the pointer,
the self-timer countdown and the progress of a burst or bracket, the
shutter's flash over the frame, the count of unread conversations, and
the saved camera setups (a Presets chip: apply, delete, save under a
name). A click on the exposure or ISO cell sets it back to 0 / 100, as
the old dials did.
The kit document is camera mode's only overlay now: the viewfinder,
info bar, top row, Q menu and their hit-testing go from slcameramode.cpp
(which keeps entry, exit and input routing), slcameradraw.h goes, and
the rail, the review and the presets keep only their data and actions.
A preset's delete asks once more before it removes the file, as the old
panel did. The temporary switch that forced the RmlUi fallback is gone.
- The press that brings the window to the front goes nowhere, not even
  to the overlay's shutter or Leave (tested: activationPressGoesNowhere).
- The shutter, bar, AF point and tilt knob size with their borders, and
  the bar's buttons sit inside its border: the shutter is on the centre
  line again.
- The review card shows its preview once it is on the GPU (a source that
  failed once never loads again).
- A "Depth preview (hold)" chip, as the old overlay had; the tilt knob
  stays when the level is off.
- Tab moves through the overlay's controls, Space activates the focused
  one, Enter does too while a popover is open.
- The JPEG quality slider no longer holds the keyboard; middle-click
  over the overlay stays voice; deleting a shot's file is the review's
  job, the rail's open state the rail's; the default preset name and
  the level and unread readouts follow the string and legibility rules.
- Leaving camera mode with the interface hidden resets the overlay for
  the next entry; a failed RmlUi capture falls back to the classic
  window instead of leaving camera mode without an overlay.
- The overlay keeps the mockups' proportions on any window: dp is the UI
  unit times the window height over 720 (1x to 2x), times the new
  SLCameraModeOverlaySize. On a 1440-high window at UI size 1 it was half
  the intended size.
- Icons are drawn (close, chevrons, download, sliders, more): the fonts
  have no glyphs for them and showed boxes.
- Quick shot is the picture alone: the grid, level and tilt come with
  Controls, as on the boards.
- Popovers and cards draw above the Photo Studio rail (the grid menu
  opened behind it).
Every text of the camera document sits on a surface of at least 0.92
alpha, so the outline the glass tokens add only roughened small text.
The RmlUi backend draws shapes without edge anti-aliasing, so the
shutter's rounded borders came out jagged. Its ring and disc (and the
tilt knob) are now one radial gradient each, drawn by the gradient
shader, which softens the edges over about a pixel.
- A row whose setting was changed shows a small reset arrow at its end;
  it puts that setting back to its default.
- A choice with nothing to choose from (no saved Looks) says "none
  saved" and is greyed, instead of arrows that did nothing; the value
  itself is clickable (the next choice).
- The rail's rows are read at 4 Hz (a choice lists a folder), and at
  once while a slider is dragged or after a click.
- The Grid and Presets menus open under their chip, right-aligned to it,
  and stay in the space left: beside the Photo Studio rail when it is
  open on the right, at the window's edge otherwise (one placement for
  every chip menu).
- While the grid menu is open, the frame shows the grid under the
  pointer; it goes back to the chosen one when the pointer leaves.
- The help for a strip cell is a small card: a title, what it does, a
  low-to-high scale where there is one, and what a click does. It waits
  until the pointer rests half a second and takes the hint row's place
  instead of covering it.
- The hovered value in the strip and in quick settings shows step
  arrows (up: forward, down: back), in the cell's padding; a click on
  the cell keeps its own action.
- Rail labels get room and an ellipsis; the level readout never shows
  -0.0; the depth preview chip is "Depth preview"; three thumbnails (four
  reached the bar on a 1280-wide window); notices sit under the saved
  confirmation instead of on it.
- The mouse and keys card's rows grow with their text (a long line
  overlapped the next row).
- The review card shows a placeholder while its preview reaches the GPU.
- The ? button is a gradient disc (smooth edge), like the shutter.
- A plain hyphen in the exposure tip (the minus sign may be missing from
  the face).
The rail's scrolling body was a flex child, which RmlUi sized to almost
nothing: titles wrapped word by word and the rows collapsed. The rail is
now plainly positioned (header, scrolling body, the Open Photo Studio
button). While it is open, the strip, the hint row and the tips centre
in the space beside it instead of running under it.
Scaling the overlay with the window (2x at 1440 high) made it too large.
It follows the UI size again, like the rest of the kit;
SLCameraModeOverlaySize (0.75 to 2.5, default 1) scales it on its own and
applies at once.
The chips are the mockup's three again (Grid, Level and tilt, Photo
Studio). Depth preview stays on its key (held), named in the aperture
tip and the mouse and keys card. The saved camera setups (apply, delete
with a second click, save under a name) live in the rail's Camera
presets section, under the camera views (whose row is now "View").
Moving the presets into the rail left one closing tag of their old
popover behind. It ended the data-model element early, so the rest of
the overlay showed raw {{bindings}} with every panel open. RmlUi says
nothing about unbalanced markup, so a new check (camera-rml) reads the
document out of the source and requires balanced tags, everything inside
the one data model, and every {{variable}} and data-* expression bound.
The strip, hints and tips no longer centre in the space beside an open
rail (which put the strip off the bar's centre line); they stay centred
on the window, and the rail stops above them only when one of them would
run under it.
- The review's thumbnails and preview were the shots' engine textures,
  sampled in place without the per-frame check that needs: texture
  streaming can re-upload or free them, and the overlay then drew from
  freed memory (a lost GPU device, the last pass rmlui_geometry). The
  review now keeps CPU copies and RmlUi uploads its own textures from
  them, released with the shot.
- A device reset being recovered no longer sends camera mode to the
  classic window: failures are waited out, and only an overlay that
  cannot come back (poisoned, or failing for 10 s) gives way.
- The thumbnail row's markup is valid again (data-for on an img).
- The review card matches board 29: Show in folder and the more menu
  (Retake went); the thumbnails say which key shows all shots.
- Save-to rows carry icons (download, window), as on board 22.
- The mouse and keys card has a mouse icon per mouse row and a working
  Change keys link (leaves camera mode, opens Preferences > Controls).
- The readout beside the lone shutter has its dial: thirteen ticks with
  the value's place on its scale marked; the lone shutter is a little
  larger (board 27).
- The thumbnails sit at the foot of the review card, one panel, as on
  board 29.
- Icon strokes are thinner, closer to the mockups' line icons.
- The mouse and keys card lights the part each row is about (left or
  right button, the wheel, the middle press); the shutter row has a
  small shutter and says which button it is and what holding it does.
- Resting the pointer on the shutter shows a tip: click takes the
  picture, holding focuses first (let go to shoot, slide off to cancel).
- The rail's side button is a dock icon showing where it moves to (a
  chevron read as collapse); its choice arrows are drawn like the rest.
RmlUi draws no bare text directly inside a flex container: the review
card's more menu showed an empty row (its Delete) and the custom size
lost its "x" between the fields. Both are wrapped now, and camera-rml
flags bare text in any flex container of the document or the kit.
A tip is centred over the strip value or the shutter it is about (kept
inside the window) instead of the middle of the screen; it is always in
the document and placed before it shows, so it never appears elsewhere
first. The card is a little wider and each end of its scale stays on one
line.
With the review card (or any popover) open, every camera command stood
back and its key fell through to gestures: B, L, V and H did nothing and
a gesture on the same key fired instead. Now only Enter stands back, and
only for a popover or menu (its focused item); the review card blocks
nothing; typing in a field keeps every key; and a key bound to a camera
command is always the camera's, never a gesture's. Tested:
lettersWorkWithMenuOpen.
The inventory upload of LLSnapshotLivePreview::saveTexture becomes
uploadSnapshotTexture(image, filter, ...), with snapshotTextureCost(w, h)
for its price; the classic window calls it as before, camera mode can
now too.
The save-to menu chooses where the shutter sends a shot (remembered:
SLCameraModeDestination): disk, inventory (a texture in Snapshots,
priced in the menu), the profile feed, or e-mail (a postcard). The bar
names the destination with its icon.

Anything that costs L$ or publishes asks first: a card with the price
(inventory) or a caption and "add where it was taken" (profile), and
"Don't ask again this session". E-mail asks for the address, subject
and message every time; a bad address or a missing subject is said on
the card. Bursts and brackets save to disk (one upload or post per frame
would cost or spam), and say so. The confirmation says where the shot
went; Show in folder only for the disk.

Also: the review histogram has its dark and bright ends labelled.
- Popovers placed from code (quick settings at the pointer, save-to,
  size, grid) stay in the document, hidden, so their place is set before
  they show: the first placement used to find nothing.
- The strip's more cell opens quick settings right above it.
- Quick settings explain themselves like the strip (a tip over the whole
  grid, centred on the cell, never over the other row); one placement
  for every tip.
- Status pills by the ? say what is on and easy to forget: focus
  locked, depth preview held, a timer / burst / bracket drive, unread
  conversations; the AF point shows AF-L while the focus is locked.
- The AF point can be dragged: it focuses where it is let go.
- Reviewing shots moves to R (P is the program mode in the strip).
Half a second felt slow while finding out what things do.
- Turning the shutter or aperture cell (the wheel over it, its arrows)
  in P or the other priority mode switches to Tv or Av, keeping the
  exposure, and says so: only that value moves. The dials over the
  picture keep program shift.
- The Photo Studio rail's rows explain themselves like the strip (the old
  rail's help, reworded into title, line and scale), beside the rail and
  level with the row; the reset arrow says what it does.
The wheel over the picture turned the "marked" dial with Controls open
and moved the camera with Controls closed: one gesture, two meanings.
Now it always moves the camera in or out; a value changes when the
pointer is on it (the strip, quick settings, the rail); Shift+wheel is
exposure and Ctrl+wheel the lens zoom, as before. The marked dial and
its underline go. Tested: wheelTable.
The ends of a tip's scale had half the card each and did not wrap: a long
high end ran past the edge. Each end now takes its own width at its
side, and the high end wraps under (still on the right) when both do not
fit.
"Window" stored the window's size at the time, so after a resize it
showed as Custom with stale numbers, and a preset equal to the window
(2560 x 1440 on a 1440p screen) lit "Window" instead of itself. Window
now leaves the size unset (the window's size, as the setting always
meant), and a preset row is on only when it was picked.
The rows called a data callback named "size", a name RmlUi reserves:
it refused the binding with only a log line, so no click did anything.
The callback is now pickSize, and the camera-rml check fails on any
reserved or unbound callback name. The menu's heading is now
"Resolution" (and the aspect follows it: "As resolution").
One Enter reached camera mode twice, as the key and then as its
character. Enter on the send card sent the shot and then took a new
one (with "don't ask again" ticked, that one uploaded or posted at
once); Enter in a field let go of it and then shot or sent the card;
a held Enter's repeat confirmed a card that opened under it. The
character of a handled Enter now does nothing, and neither does a
repeat (slcamin::takeReturn, tested in enterIsOnePress).

RmlUi keeps focus on a control that hid after it was clicked, so Space
could click the card's Delete again and delete the next shot's file.
Space and Enter now click only a focused control that shows
(navActivatesFocus, tested in hiddenFocusNeverClicks), and Delete lets
go of focus.
- A shot waiting on the card is never replaced unseen: the shutter or a
  timer says to send or cancel it first.
- Each card starts clean: no caption, message, subject or location from
  the last one, so a personal message never goes to the next person;
  only the last address is offered again.
- "Don't ask again" lasts until camera mode closes (the label says so),
  and closing it lets go of the waiting full-size shot.
- With a non-disk destination, the folder hint for bursts and brackets
  says to take the single shot with Save to disk.
- The AF-L mark shows as soon as L is pressed.
- Two hint strings nothing used are gone.
uploadSnapshotTexture played the shutter sound, and camera mode had
already played it at the shutter: it now returns whether it uploaded
and the classic window plays the sound itself. The classic window no
longer pins an unset snapshot size (camera mode's Window) to the
window's current pixels when it opens.
The depth of field followed the AF point only when it was let go. Past
the drag slop, each frame the pointer moved focuses where it is now
(one pick per move, none while it rests).
The preview was 284 dp in a 300 dp card, so it sat against the left
with a gap on the right; it now spans the same width as the histogram
and the rows under it.
F1 opens the mouse and keys card (it was Shift+/, which is not "?" on
every layout) and, taken by camera mode, no longer opens Photo Studio
unseen behind it. The status pills are centred on the round help
button beside them.
Menu shortcuts (Ctrl+P, Ctrl+I, Ctrl+M, ...) opened their windows
behind camera mode, unseen but with their sound. Camera mode now
swallows them, at the two places the menus take shortcuts (so gestures
keep their usual turn), and the command palette key. Those that act on
the world, the avatar or the camera still work: fullscreen, quit, the
snapshot key (it leaves camera mode), the sky presets, zoom, freeze
world, fly, sit, run, stop and resync animations, hide particles. The
camera-input check fails if one of those names stops being a menu item.
"As resolution" is wider than a ratio: equal segments cut it off.
- A shot to disk played the shutter sound twice (capture, then the save);
  the save plays it once the file is written, as for every snapshot.
- Dragging the AF point picks at most 10 times a second: picks test
  rigged meshes, which stuttered in a crowd. The release still focuses
  exactly where the point lands.
- An inventory upload that could not be encoded says so instead of
  showing "uploading".
- "Letter keys start chat" no longer focuses the hidden chat bar in
  camera mode (the next Enter would have shot instead of sending).
- The classic snapshot window keeps an unset size if either side is
  unset; camera mode checks a key is a menu shortcut before it walks
  the list of shortcuts it lets through.
- The camera-rml check also catches an unbound callback named without
  parentheses.
- RmlUi text fields use the viewer's clipboard, and camera mode passes
  Ctrl+C, Ctrl+X and Ctrl+V to them (Ctrl+A already went): an address
  can be pasted into the e-mail card, a size or a preset name copied.
- The classic snapshot window opens on "Current Window" when no disk
  size is saved, and stores "Current Window" as unset: it and camera
  mode's Window are the same choice, so neither pins the window's size
  on the other (a resize while the classic window was open could).
- A field being typed in turns the window's text input on (and off when
  typing ends), as classic fields do: AltGr, dead keys and input methods
  type their characters. Without it the window passed the bare key, so
  AltGr+2 typed "2" instead of "@".
- Over the overlay the cursor is the one its RCSS asks for (RmlUi reports
  it through SetMouseCursor): an I-beam over a field, the kit's hand over
  its buttons, the arrow elsewhere; over the picture it stays the tool's.
- The message box lays out lines (18 dp, padded) instead of inheriting
  the single-line field's 22 dp line, so the caret sits inside the box.
The same gaps camera mode's fields had, in the new interface (the
command field, the chat line, the inventory search): its input view now
turns the window's text input on while it holds the keyboard (AltGr,
dead keys, input methods), forwards Ctrl+C/X/V as well as Ctrl+A, and
sets the cursor its RCSS asks for (slRmlUiCursorType, shared with
camera mode). The developer guide states these rules for RmlUi surfaces,
with the data-model names RmlUi reserves.
main greys the god rays row while volumetric fog or the physical sky
replaces the pass, with a tooltip saying so (6d402f289b); that tooltip
lived in the hand-drawn rail. The overlay's rail tip now shows a greyed
row's reason under its name.
The overlay had moved tilt onto a small knob at the end of the level line,
shown only with Level: hard to hit (review). The tilt is an arc at the
frame's right again, -40..+40 degrees, as before the overlay was rebuilt:
a click or drag anywhere along it tilts there, the wheel over it turns
half a degree, a double-click levels; the knob shows the angle and turns
green when level. It shows with the controls whether Level is on or not;
the level line is the horizon alone. The arc is a gradient ring clipped
by its band (smooth edges), and it explains itself beside it.
The ring showed as a full circle: RmlUi clips a box's children only when
they overflow its layout, and absolutely placed ones never do (clip:
always forces it). The drag and the wheel took the whole rectangle the
arc spans, up to 150 px inside the curve; eight boxes along the arc now
take them, about 18 dp either side of the line.
The readout beside the level line showed "roll · pitch" with no labels;
the roll now repeats the tilt arc's label, and the pitch was a mystery.
It shows only the pitch, as "Looking up 8.8°" / "Looking down 8.8°", and
goes once the camera looks straight ahead.
Author
Collaborator

Merged into main in fedb692509; closing.

Merged into main in fedb692509; closing.
TheSlowly closed this pull request 2026-11-22 03:07:42 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sky_line/Slipstream!1621
No description provided.