3D and Materials: the Lighting tab's widget moves lights around the object

The panel's Lighting tab shows a sphere above the list of lights with
every light of the selected 3D effect at its Rotation and Height, filled
in front of the object and hollow behind it. Dragging a light moves it
on its side of the object, previewed while the pointer is down and one
undo step on release; a press selects it in the list. Move Light to Back
and Move Light to Front change the selected light's side. Each light
takes the keyboard focus, where the arrow keys move it (Shift steps
15 degrees), and screen readers name it with its settings. The widget
sends effect.setParams like the light settings below it.
This commit is contained in:
dotCooCoo
2026-11-14 17:37:56 -08:00
parent dafd993395
commit 0939157d12
35 changed files with 559 additions and 4 deletions
+1
View File
@@ -105,6 +105,7 @@ pub mod relink;
pub mod rename_artboards;
pub(crate) mod revolve;
pub(crate) mod revolve_gizmo;
pub(crate) mod revolve_lights;
pub mod safe_mode;
pub mod saturate;
pub mod save_brush_library;
+5 -1
View File
@@ -362,6 +362,10 @@ fn lighting_controls(ui: &mut egui::Ui, d: &mut Dialog) {
// A mixed Shading leaves the light settings on, for the effects that shade.
ui.add_enabled_ui(flag(d, "shade", true) != Some(false), |ui| {
lighting_presets(ui, d);
// The panel's lighting widget; the dialog moves lights with its rings on the artboard.
if d.bool("__panel") {
super::revolve_lights::show(ui, d);
}
light_list(ui, d);
let mut selected = selected_light(d);
let before = light_record(&selected);
@@ -429,7 +433,7 @@ const LIGHT_KEYS: [(&str, &str); 6] = [
("behind", "lightBehind"),
];
fn explicit_lights(d: &Dialog) -> Option<&Vec<Value>> {
pub(super) fn explicit_lights(d: &Dialog) -> Option<&Vec<Value>> {
d.fields.get("lights").and_then(Value::as_array).filter(|v| !v.is_empty() && v.len() <= vectorcraft_three_d::MAX_LIGHTS)
}
+2 -2
View File
@@ -186,13 +186,13 @@ struct Drag {
fields: serde_json::Map<String, serde_json::Value>,
}
fn wrap(n: f64, snap: bool) -> f64 {
pub(super) fn wrap(n: f64, snap: bool) -> f64 {
let n = if snap { (n / 15.0).round() * 15.0 } else { n };
(n + 180.0).rem_euclid(360.0) - 180.0
}
/// A Height, 0° to 90°, on 15° steps with Shift.
fn snap_height(height: f64, snap: bool) -> f64 {
pub(super) fn snap_height(height: f64, snap: bool) -> f64 {
(if snap { (height / 15.0).round() * 15.0 } else { height }).clamp(0.0, 90.0)
}
@@ -0,0 +1,266 @@
//! The lighting widget on the 3D and Materials panel's Lighting tab for Extrude & Bevel, Revolve,
//! Inflate and Rotate: a sphere that shows each of the effect's lights
//! at its Rotation and Height, a filled sun in front of the object and a hollow one behind it.
//! Dragging a light moves it on its side of the object, a press selects it in the list of lights,
//! and the button below the sphere moves the selected light to the back or the front of the object.
//! Each light takes the keyboard focus, where the arrow keys move it, and has a name for screen
//! readers. The widget edits the panel's fields as the light settings do, so the panel previews a
//! drag and records it as one undo step when the pointer is released.
use egui::{Id, Key, Modifiers, Rect, Sense, Stroke, Vec2, vec2};
use serde_json::{Value, json};
use vectorcraft_geom::Point;
use vectorcraft_three_d::{DEFAULT_LIGHT, Revolve};
use super::revolve::{c3, explicit_lights, light_record, set_light_value};
use super::revolve_gizmo::{snap_height, wrap};
use crate::state::Dialog;
use crate::theme::Tokens;
/// The sphere's largest radius, in points.
pub(crate) const RADIUS: f32 = 56.0;
/// The radius of a light's sun.
const SUN: f32 = 7.0;
/// The arrow keys' steps in degrees, without and with Shift.
const STEP: f64 = 1.0;
const SHIFT_STEP: f64 = 15.0;
/// The keys that move the focused light.
const ARROWS: [Key; 4] = [Key::ArrowLeft, Key::ArrowRight, Key::ArrowUp, Key::ArrowDown];
/// One light as the widget shows it.
#[derive(Clone, Copy, Debug, PartialEq)]
pub(crate) struct Light {
pub rotation: f64,
pub height: f64,
pub behind: bool,
pub color: egui::Color32,
}
impl Light {
fn options(self) -> Revolve {
Revolve { light_rotation: self.rotation, light_height: self.height, light_behind: self.behind, ..Default::default() }
}
/// Where the light sits on a sphere of radius 1 around the origin, y down: the direction the
/// shading uses, seen from the front.
pub(crate) fn offset(self) -> Vec2 {
let [x, y, _] = self.options().light_direction();
vec2(x as f32, y as f32)
}
/// The Rotation and Height, rounded to 0.1°, of the light moved to `offset` (radius 1, y down)
/// on its side of the object: the farther out, the lower. Shift (`snap`) snaps both to 15°.
pub(crate) fn moved_to(self, offset: Vec2, snap: bool) -> (f64, f64) {
let [rotation, height] = self.options().light_at_on_side(Point::new(f64::from(offset.x), f64::from(offset.y)));
(round(wrap(rotation, snap)), round(snap_height(height, snap)))
}
/// The Rotation and Height after one press of `key` (Left and Right turn the light around the
/// object counterclockwise and clockwise, Up and Down raise and lower it). Only the setting the
/// key moves changes, rounded to 0.1°. `None` for another key.
fn stepped(self, key: Key, step: f64) -> Option<(f64, f64)> {
let turn = |by: f64| round(wrap(self.rotation + by, false));
let raise = |by: f64| round(snap_height(self.height + by, false));
match key {
Key::ArrowLeft => Some((turn(step), self.height)),
Key::ArrowRight => Some((turn(-step), self.height)),
Key::ArrowUp => Some((self.rotation, raise(step))),
Key::ArrowDown => Some((self.rotation, raise(-step))),
_ => None,
}
}
/// The name screen readers give the light at `index`: its number, Rotation, Height and side.
fn name(self, index: usize) -> String {
let side = if self.behind { format!(", {}", tl!("Light behind the object")) } else { String::new() };
format!("{} {}: {} {:.1}°, {} {:.1}°{side}", c3("Light"), index + 1, tl!("Rotation"), self.rotation, tl!("Height"), self.height)
}
}
fn round(n: f64) -> f64 {
(n * 10.0).round() / 10.0
}
/// The effect's lights: each light of its list, or its single light, with the effect's defaults for
/// the settings a light leaves out or the selected effects hold with different values (null).
pub(crate) fn lights(d: &Dialog) -> Vec<Light> {
let defaults = vectorcraft_effects::default_params(&d.str("__effect")).unwrap_or(json!({}));
let list = explicit_lights(d).cloned().unwrap_or_else(|| vec![light_record(d)]);
list.iter()
.map(|light| {
let value =
|key: &str, field: &str| light.get(key).filter(|v| !v.is_null()).or_else(|| defaults.get(field)).cloned().unwrap_or(Value::Null);
let [r, g, b] = value("color", "lightColor")
.as_str()
.filter(|s| s.len() == 7 && s.starts_with('#'))
.and_then(vectorcraft_color::Color::from_hex)
.unwrap_or(vectorcraft_color::Color::WHITE)
.to_rgb_uncalibrated()
.map(|c| (c * 255.0).round() as u8);
Light {
rotation: value("rotation", "lightRotation").as_f64().unwrap_or(DEFAULT_LIGHT.0),
height: value("height", "lightHeight").as_f64().unwrap_or(DEFAULT_LIGHT.1),
behind: value("behind", "lightBehind").as_bool().unwrap_or(false),
color: egui::Color32::from_rgb(r, g, b),
}
})
.collect()
}
/// The index of the selected light among `count` lights.
fn selected(d: &Dialog, count: usize) -> usize {
d.fields.get("__light").and_then(Value::as_u64).and_then(|v| usize::try_from(v).ok()).unwrap_or(0).min(count.saturating_sub(1))
}
/// Makes light `index` the selected one, as a choice in the list of lights does.
fn select(ui: &egui::Ui, d: &mut Dialog, index: usize) {
if d.fields.get("__light").and_then(Value::as_u64) != Some(index as u64) {
ui.memory_mut(|m| m.stop_text_input());
super::revolve_gizmo::clear(ui.ctx());
}
d.fields.insert("__light".into(), json!(index));
}
/// Draws the sphere with the lights and the button that moves the selected light to the back or
/// the front, editing `d.fields`.
pub(super) fn show(ui: &mut egui::Ui, d: &mut Dialog) {
let lights = lights(d);
let Some(&first) = lights.first() else { return };
let current = selected(d, lights.len());
let t = Tokens::get(ui.ctx());
let radius = RADIUS.min((ui.available_width() * 0.5 - SUN - 8.0).max(24.0));
let (rect, _) = ui.allocate_exact_size(vec2(ui.available_width(), (radius + SUN + 6.0) * 2.0), Sense::hover());
let center = rect.center();
let painter = ui.painter_at(rect);
// The sphere: its rim is Height 0, its center Height 90°, and the ring between them 45°.
painter.circle(center, radius, t.input, Stroke::new(1.0, t.input_border));
painter.circle_stroke(center, radius * std::f32::consts::FRAC_1_SQRT_2, Stroke::new(1.0, t.input_border.gamma_multiply(0.5)));
for axis in [vec2(radius, 0.0), vec2(0.0, radius)] {
painter.line_segment([center - axis, center + axis], Stroke::new(1.0, t.input_border.gamma_multiply(0.5)));
}
painter.circle(center, 4.0, t.panel, Stroke::new(1.0, t.text_dim));
// The selected light last, so it is drawn above the others and a press there takes it.
let order = (0..lights.len()).filter(|&i| i != current).chain([current]);
let mut moved = None;
let mut picked = None;
let enabled = ui.is_enabled();
for index in order {
let light = lights.get(index).copied().unwrap_or(first);
let at = center + light.offset() * radius;
let id = Id::unique(("three-d-lighting-widget", index));
let response = ui.interact(Rect::from_center_size(at, Vec2::splat((SUN + 4.0) * 2.0)), id, Sense::click_and_drag());
response.widget_info(|| egui::WidgetInfo::labeled(egui::Role::Slider, enabled, light.name(index)));
if response.drag_started() || response.clicked() {
// A light the pointer took takes the keyboard focus too, so the arrow keys move it next.
response.request_focus();
picked = Some(index);
}
if response.gained_focus() {
picked = Some(index);
}
let origin = ui.input(|i| i.pointer.press_origin());
if response.drag_started()
&& let Some(origin) = origin
{
// The offset from the press to the light's center, kept for the drag, and whether the
// pointer has left the press yet.
ui.data_mut(|m| m.insert_temp(id, (at - origin, false)));
}
// The frame that releases the pointer can also move it: the light goes where it was dropped,
// the point of the press included once the pointer has left it.
if (response.dragged() || response.drag_stopped())
&& let Some(p) = response.interact_pointer_pos().or_else(|| ui.input(|i| i.pointer.latest_pos()))
{
let (grip, left): (Vec2, bool) = ui.data(|m| m.get_temp(id)).unwrap_or_default();
let left = left || origin != Some(p);
ui.data_mut(|m| m.insert_temp(id, (grip, left)));
if left {
let snap = ui.input(|i| i.modifiers.shift);
moved = Some((index, light.moved_to((p + grip - center) / radius, snap)));
}
}
if response.has_focus() {
ui.memory_mut(|m| {
m.set_focus_lock_filter(id, egui::EventFilter { horizontal_arrows: true, vertical_arrows: true, ..Default::default() })
});
// Every arrow-key press in the frame moves the light in turn, in the order it came.
let presses = ui.input_mut(|i| {
let mut presses = vec![];
i.events.retain(|e| match e {
egui::Event::Key { key, pressed: true, modifiers, .. }
if ARROWS.contains(key) && (modifiers.matches_exact(Modifiers::NONE) || modifiers.matches_exact(Modifiers::SHIFT)) =>
{
presses.push((*key, if modifiers.shift { SHIFT_STEP } else { STEP }));
false
}
_ => true,
});
presses
});
let mut next = light;
for (key, step) in presses {
if let Some((rotation, height)) = next.stepped(key, step) {
(next.rotation, next.height) = (rotation, height);
}
}
if next != light {
moved = Some((index, (next.rotation, next.height)));
}
}
paint_light(ui, at, light, index == current, response.has_focus(), response.hovered() || response.dragged());
if response.hovered() || response.dragged() {
ui.ctx().set_cursor_icon(if response.dragged() { egui::CursorIcon::Grabbing } else { egui::CursorIcon::Grab });
}
response.on_hover_text(tl!("Drag a light to move it. The arrow keys move the focused light; Shift steps 15°."));
}
if let Some(index) = picked {
select(ui, d, index);
}
// Only a setting that moved is written: a press that leaves a light where it is, or a key at a
// limit, changes nothing, and a key leaves the other setting as each selected effect has it.
if let Some((index, (rotation, height))) = moved
&& let Some(light) = lights.get(index)
{
for (key, value, was) in [("lightRotation", rotation, light.rotation), ("lightHeight", height, light.height)] {
if (value - was).abs() > 1e-9 {
select(ui, d, index);
set_light_value(d, key, json!(value));
}
}
}
let index = selected(d, lights.len());
let behind = lights.get(index).is_some_and(|l| l.behind);
ui.horizontal(|ui| {
let text = if behind { tl!("Move Light to Front") } else { tl!("Move Light to Back") };
if ui.button(text).clicked() {
select(ui, d, index);
set_light_value(d, "lightBehind", json!(!behind));
}
});
ui.add_space(4.0);
}
/// A light's sun: filled with its color in front of the object, hollow behind it, larger and
/// ringed when it is the selected light, with a second ring while it has the keyboard focus.
fn paint_light(ui: &egui::Ui, at: egui::Pos2, light: Light, selected: bool, focused: bool, hot: bool) {
let t = Tokens::get(ui.ctx());
let painter = ui.painter();
let r = if selected { SUN } else { SUN - 2.0 };
let outline = Stroke::new(if hot { 2.5 } else { 1.5 }, if selected { t.warning } else { t.warning.gamma_multiply(0.7) });
if light.behind {
painter.circle(at, r, t.panel, outline);
painter.circle_stroke(at, r * 0.5, Stroke::new(1.5, light.color));
} else {
painter.circle(at, r, light.color, outline);
}
if selected {
for i in 0..8 {
let angle = i as f32 * std::f32::consts::TAU / 8.0;
let direction = vec2(angle.cos(), angle.sin());
painter.line_segment([at + direction * (r + 2.0), at + direction * (r + 4.0)], Stroke::new(1.25, t.warning));
}
}
if focused {
painter.circle_stroke(at, r + 6.0, Stroke::new(1.0, t.accent));
}
}
+3
View File
@@ -5706,6 +5706,9 @@ theme Appearance Външен вид
Softness Мекота
Ambient Light Околна светлина
Light behind the object Светлина зад обекта
Move Light to Back Премести светлината отзад
Move Light to Front Премести светлината отпред
Drag a light to move it. The arrow keys move the focused light; Shift steps 15°. Плъзнете светлина, за да я преместите. Клавишите със стрелки местят фокусираната светлина; Shift я мести с 15°.
Shadows Сенки
Distance from Object Разстояние от обекта
Shadow Bounds Граници на сянката
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -5792,6 +5792,9 @@ mark-style Japanese Japanski
Softness Mekoća
Ambient Light Ambijentalno svjetlo
Light behind the object Svjetlo iza objekta
Move Light to Back Pomjeri svjetlo iza
Move Light to Front Pomjeri svjetlo naprijed
Drag a light to move it. The arrow keys move the focused light; Shift steps 15°. Prevucite svjetlo da ga pomjerite. Tipke sa strelicama pomjeraju fokusirano svjetlo; Shift ga pomjera za 15°.
Shadows Sjene
Distance from Object Udaljenost od objekta
Shadow Bounds Granice sjene
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -2338,6 +2338,9 @@ digits Malayalam Malaiàlam
Ligatures are off while the text is tracked. Les lligadures estan desactivades mentre el text té espaiat.
Light Clar
Light behind the object Llum darrere de l’objecte
Move Light to Back Mou la llum al darrere
Move Light to Front Mou la llum al davant
Drag a light to move it. The arrow keys move the focused light; Shift steps 15°. Arrossegueu una llum per moure-la. Les tecles de fletxa mouen la llum amb el focus; Maj la mou de 15° en 15°.
Shadows Ombres
Distance from Object Distància de l’objecte
Shadow Bounds Límits de l’ombra
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -6095,6 +6095,9 @@ mark-style Japanese Japonské
Softness Měkkost
Ambient Light Okolní světlo
Light behind the object Světlo za objektem
Move Light to Back Přesunout světlo dozadu
Move Light to Front Přesunout světlo dopředu
Drag a light to move it. The arrow keys move the focused light; Shift steps 15°. Přetažením světlo přesunete. Šipky posouvají světlo s fokusem; se Shiftem po 15°.
Shadows Stíny
Distance from Object Vzdálenost od objektu
Shadow Bounds Hranice stínu
Can't render this file because it is too large.
+3
View File
@@ -6049,6 +6049,9 @@ mark-style Japanese Japansk
Softness Blødhed
Ambient Light Omgivelseslys
Light behind the object Lys bag objektet
Move Light to Back Flyt lys bagud
Move Light to Front Flyt lys frem
Drag a light to move it. The arrow keys move the focused light; Shift steps 15°. Træk et lys for at flytte det. Piletasterne flytter lyset med fokus; Skift flytter det 15° ad gangen.
Shadows Skygger
Distance from Object Afstand fra objektet
Shadow Bounds Skyggegrænser
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -5677,6 +5677,9 @@ effect Soft Weich
Softness Weichheit
Ambient Light Umgebungslicht
Light behind the object Licht hinter dem Objekt
Move Light to Back Licht nach hinten
Move Light to Front Licht nach vorne
Drag a light to move it. The arrow keys move the focused light; Shift steps 15°. Ziehen Sie ein Licht, um es zu verschieben. Die Pfeiltasten verschieben das fokussierte Licht; mit Umschalt in Schritten von 15°.
Shadows Schatten
Distance from Object Abstand vom Objekt
Shadow Bounds Schattenbegrenzung
Can't render this file because it is too large.
+3
View File
@@ -5773,6 +5773,9 @@ digits Malayalam Μαλαγιάλαμ
to set spacing and orientation για ορισμό απόστασης και προσανατολισμού
: :
Light behind the object Φως πίσω από το αντικείμενο
Move Light to Back Μετακίνηση φωτός πίσω
Move Light to Front Μετακίνηση φωτός μπροστά
Drag a light to move it. The arrow keys move the focused light; Shift steps 15°. Σύρετε ένα φως για να το μετακινήσετε. Τα πλήκτρα βέλους μετακινούν το εστιασμένο φως· με Shift ανά 15°.
Shadows Σκιές
Distance from Object Απόσταση από το αντικείμενο
Shadow Bounds Όρια σκιάς
Can't render this file because it is too large.
+3
View File
@@ -6038,6 +6038,9 @@ mark-style Japanese Japonesas
Softness Suavidad
Ambient Light Luz ambiental
Light behind the object Luz detrás del objeto
Move Light to Back Mover luz detrás
Move Light to Front Mover luz delante
Drag a light to move it. The arrow keys move the focused light; Shift steps 15°. Arrastre una luz para moverla. Las teclas de flecha mueven la luz con el foco; Mayús la mueve de 15° en 15°.
Shadows Sombras
Distance from Object Distancia del objeto
Shadow Bounds Límites de la sombra
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -5975,6 +5975,9 @@ mark-style Japanese Japanilainen
Softness Pehmeys
Ambient Light Ympäristövalo
Light behind the object Valo objektin takana
Move Light to Back Siirrä valo taakse
Move Light to Front Siirrä valo eteen
Drag a light to move it. The arrow keys move the focused light; Shift steps 15°. Siirrä valoa vetämällä. Nuolinäppäimet siirtävät kohdistettua valoa; Vaihto siirtää 15° kerrallaan.
Shadows Varjot
Distance from Object Etäisyys objektista
Shadow Bounds Varjon rajat
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -6091,6 +6091,9 @@ theme Appearance Apparence
Softness Douceur
Ambient Light Lumière ambiante
Light behind the object Lumière derrière l'objet
Move Light to Back Placer la lumière derrière
Move Light to Front Placer la lumière devant
Drag a light to move it. The arrow keys move the focused light; Shift steps 15°. Faites glisser une lumière pour la déplacer. Les touches fléchées déplacent la lumière active ; Maj par pas de 15°.
Shadows Ombres
Distance from Object Distance de l'objet
Shadow Bounds Limites de l'ombre
Can't render this file because it is too large.
+3
View File
@@ -1909,6 +1909,9 @@
Light Intensity લાઇટ તીવ્રતા
Light Rough લાઇટ રફ
Light behind the object ઑબ્જેક્ટની પાછળ લાઇટ
Move Light to Back લાઇટ પાછળ ખસેડો
Move Light to Front લાઇટ આગળ ખસેડો
Drag a light to move it. The arrow keys move the focused light; Shift steps 15°. લાઇટ ખસેડવા માટે તેને ખેંચો. ઍરો કી ફોકસ થયેલી લાઇટ ખસેડે છે; Shift સાથે 15° ના પગલાં.
Lighten હળવું કરો
Lighting લાઇટિંગ
Lights લાઇટ્સ
Can't render this file because it contains an unexpected character in line 72 and column 5.
+3
View File
@@ -2579,6 +2579,9 @@ antiAlias Sharp शार्प
Ligatures are off while the text is tracked. टेक्स्ट पर ट्रैकिंग लागू होने पर लिगेचर ऑफ़ रहते हैं।
Light लाइट
Light behind the object ऑब्जेक्ट के पीछे प्रकाश
Move Light to Back प्रकाश को पीछे ले जाएँ
Move Light to Front प्रकाश को आगे ले जाएँ
Drag a light to move it. The arrow keys move the focused light; Shift steps 15°. प्रकाश को हिलाने के लिए उसे खींचें। तीर कुंजियाँ फ़ोकस वाले प्रकाश को हिलाती हैं; Shift के साथ 15° के चरण।
Shadows छायाएँ
Distance from Object ऑब्जेक्ट से दूरी
Shadow Bounds छाया सीमाएँ
Can't render this file because it is too large.
+3
View File
@@ -6078,6 +6078,9 @@ imageTrace Outline Körvonal
Softness Lágyság
Ambient Light Környezeti fény
Light behind the object Fény az objektum mögött
Move Light to Back Fény hátra
Move Light to Front Fény előre
Drag a light to move it. The arrow keys move the focused light; Shift steps 15°. Húzzon egy fényt az áthelyezéséhez. A nyílbillentyűk a fókuszban lévő fényt mozgatják; Shifttel 15°-onként.
Shadows Árnyékok
Distance from Object Távolság az objektumtól
Shadow Bounds Árnyék határai
Can't render this file because it is too large.
+3
View File
@@ -5439,6 +5439,9 @@ mark-style Japanese Jepang
Softness Kelembutan
Ambient Light Cahaya ambient
Light behind the object Cahaya di belakang objek
Move Light to Back Pindahkan Cahaya ke Belakang
Move Light to Front Pindahkan Cahaya ke Depan
Drag a light to move it. The arrow keys move the focused light; Shift steps 15°. Seret cahaya untuk memindahkannya. Tombol panah memindahkan cahaya yang difokuskan; Shift memindahkannya 15°.
Shadows Bayangan
Distance from Object Jarak dari objek
Shadow Bounds Batas bayangan
Can't render this file because it contains an unexpected character in line 2451 and column 5.
+3
View File
@@ -5712,6 +5712,9 @@ lighting Light Luce
Softness Morbidezza
Ambient Light Luce ambientale
Light behind the object Luce dietro l'oggetto
Move Light to Back Sposta luce dietro
Move Light to Front Sposta luce davanti
Drag a light to move it. The arrow keys move the focused light; Shift steps 15°. Trascina una luce per spostarla. I tasti freccia spostano la luce attiva; Maiusc a passi di 15°.
Shadows Ombre
Distance from Object Distanza dall'oggetto
Shadow Bounds Limiti dell'ombra
Can't render this file because it is too large.
+3
View File
@@ -5755,6 +5755,9 @@ lighting Light ライト
Softness 柔らかさ
Ambient Light 環境光
Light behind the object オブジェクトの背後のライト
Move Light to Back ライトを背面へ
Move Light to Front ライトを前面へ
Drag a light to move it. The arrow keys move the focused light; Shift steps 15°. ライトをドラッグして移動します。矢印キーでフォーカスのあるライトを移動し、Shift キーで 15° ずつ移動します。
Shadows シャドウ
Distance from Object オブジェクトからの距離
Shadow Bounds シャドウの範囲
Can't render this file because it is too large.
+3
View File
@@ -5648,6 +5648,9 @@ imageTrace Outline კონტური
In the File ფაილში
Keys კლავიშები
Light behind the object სინათლე ობიექტის უკან
Move Light to Back სინათლის უკან გადატანა
Move Light to Front სინათლის წინ გადატანა
Drag a light to move it. The arrow keys move the focused light; Shift steps 15°. გადაათრიეთ სინათლე მის გადასაადგილებლად. ისრიანი ღილაკები ფოკუსირებულ სინათლეს ამოძრავებს; Shift-ით 15°-იანი ბიჯით.
Shadows ჩრდილები
Distance from Object მანძილი ობიექტიდან
Shadow Bounds ჩრდილის საზღვრები
Can't render this file because it is too large.
+3
View File
@@ -5673,6 +5673,9 @@ lighting Light 광원
Softness 부드러움
Ambient Light 주변광
Light behind the object 개체 뒤의 조명
Move Light to Back 조명을 뒤로 이동
Move Light to Front 조명을 앞으로 이동
Drag a light to move it. The arrow keys move the focused light; Shift steps 15°. 조명을 드래그하여 이동합니다. 화살표 키로 포커스된 조명을 이동하고, Shift 키를 누르면 15°씩 이동합니다.
Shadows 그림자
Distance from Object 개체로부터의 거리
Shadow Bounds 그림자 범위
Can't render this file because it is too large.
+3
View File
@@ -7841,6 +7841,9 @@ mark-style Japanese Japans
Softness Zachtheid
Ambient Light Omgevingslicht
Light behind the object Licht achter het object
Move Light to Back Licht naar achteren
Move Light to Front Licht naar voren
Drag a light to move it. The arrow keys move the focused light; Shift steps 15°. Sleep een licht om het te verplaatsen. De pijltoetsen verplaatsen het licht met de focus; Shift verplaatst het per 15°.
Shadows Schaduwen
Distance from Object Afstand tot object
Shadow Bounds Schaduwgrenzen
Can't render this file because it is too large.
+3
View File
@@ -5935,6 +5935,9 @@ mark-style Japanese Japońskie
Softness Miękkość
Ambient Light Światło otoczenia
Light behind the object Światło za obiektem
Move Light to Back Przenieś światło do tyłu
Move Light to Front Przenieś światło do przodu
Drag a light to move it. The arrow keys move the focused light; Shift steps 15°. Przeciągnij światło, aby je przesunąć. Klawisze strzałek przesuwają aktywne światło; z Shift o 15°.
Shadows Cienie
Distance from Object Odległość od obiektu
Shadow Bounds Granice cienia
Can't render this file because it is too large.
+3
View File
@@ -4798,6 +4798,9 @@ axis Both Ambos
Softness Suavidade
Ambient Light Luz ambiente
Light behind the object Luz atrás do objeto
Move Light to Back Mover luz para trás
Move Light to Front Mover luz para a frente
Drag a light to move it. The arrow keys move the focused light; Shift steps 15°. Arraste uma luz para movê-la. As teclas de seta movem a luz em foco; Shift a move de 15° em 15°.
Shadows Sombras
Distance from Object Distância do objeto
Shadow Bounds Limites da sombra
Can't render this file because it is too large.
+3
View File
@@ -5698,6 +5698,9 @@ lighting Light Свет
Softness Мягкость
Ambient Light Окружающий свет
Light behind the object Свет позади объекта
Move Light to Back Переместить свет назад
Move Light to Front Переместить свет вперёд
Drag a light to move it. The arrow keys move the focused light; Shift steps 15°. Перетащите источник света, чтобы переместить его. Клавиши со стрелками перемещают выбранный источник; с Shift — шагами по 15°.
Shadows Тени
Distance from Object Расстояние от объекта
Shadow Bounds Границы тени
Can't render this file because it is too large.
+3
View File
@@ -5988,6 +5988,9 @@ theme Appearance Utseende
Softness Mjukhet
Ambient Light Omgivande ljus
Light behind the object Ljus bakom objektet
Move Light to Back Flytta ljus bakåt
Move Light to Front Flytta ljus framåt
Drag a light to move it. The arrow keys move the focused light; Shift steps 15°. Dra ett ljus för att flytta det. Piltangenterna flyttar ljuset med fokus; Skift flyttar det 15° i taget.
Shadows Skuggor
Distance from Object Avstånd från objektet
Shadow Bounds Skuggans gränser
Can't render this file because it is too large.
+3
View File
@@ -5871,6 +5871,9 @@ theme Appearance Görünüm
Softness Yumuşaklık
Ambient Light Ortam Işığı
Light behind the object Nesnenin arkasındaki ışık
Move Light to Back Işığı Arkaya Taşı
Move Light to Front Işığı Öne Taşı
Drag a light to move it. The arrow keys move the focused light; Shift steps 15°. Işığı taşımak için sürükleyin. Ok tuşları odaktaki ışığı taşır; Shift ile 15° adımlarla.
Shadows Gölgeler
Distance from Object Nesneden uzaklık
Shadow Bounds Gölge sınırları
Can't render this file because it is too large.
+3
View File
@@ -5692,6 +5692,9 @@ lighting Light Світло
Softness М'якість
Ambient Light Навколишнє світло
Light behind the object Світло позаду об'єкта
Move Light to Back Перемістити світло назад
Move Light to Front Перемістити світло вперед
Drag a light to move it. The arrow keys move the focused light; Shift steps 15°. Перетягніть світло, щоб перемістити його. Клавіші зі стрілками переміщують вибране світло; із Shift — кроками по 15°.
Shadows Тіні
Distance from Object Відстань від об'єкта
Shadow Bounds Межі тіні
Can't render this file because it is too large.
+3
View File
@@ -5696,6 +5696,9 @@ theme Appearance Giao diện
Softness Độ mềm
Ambient Light Ánh sáng môi trường
Light behind the object Ánh sáng phía sau đối tượng
Move Light to Back Đưa ánh sáng ra sau
Move Light to Front Đưa ánh sáng ra trước
Drag a light to move it. The arrow keys move the focused light; Shift steps 15°. Kéo một nguồn sáng để di chuyển nó. Phím mũi tên di chuyển nguồn sáng đang có tiêu điểm; Shift di chuyển theo bước 15°.
Shadows Bóng đổ
Distance from Object Khoảng cách từ đối tượng
Shadow Bounds Giới hạn bóng
Can't render this file because it contains an unexpected character in line 204 and column 5.
+3
View File
@@ -5965,6 +5965,9 @@ lighting Light 光源
Softness 柔和度
Ambient Light 环境光
Light behind the object 光源位于对象后方
Move Light to Back 将光源移到后方
Move Light to Front 将光源移到前方
Drag a light to move it. The arrow keys move the focused light; Shift steps 15°. 拖动光源可移动它。方向键移动具有焦点的光源;按住 Shift 以 15° 为步长。
Shadows 阴影
Distance from Object 与对象的距离
Shadow Bounds 阴影边界
Can't render this file because it is too large.
+3
View File
@@ -5797,6 +5797,9 @@ lighting Light 光源
Softness 柔和度
Ambient Light 環境光
Light behind the object 光源位於物件後方
Move Light to Back 將光源移到後方
Move Light to Front 將光源移到前方
Drag a light to move it. The arrow keys move the focused light; Shift steps 15°. 拖曳光源即可移動。方向鍵會移動具有焦點的光源;按住 Shift 以 15° 為間距。
Shadows 陰影
Distance from Object 與物件的距離
Shadow Bounds 陰影邊界
Can't render this file because it is too large.
+171
View File
@@ -794,6 +794,177 @@ fn quick_actions_show_on_the_object_tab_only() {
assert!(super::quick_actions_shown(&d));
}
/// An app with an Extrude & Bevel square given `params`, and the panel on its Lighting tab with the
/// accessibility tree on.
fn lighting_app(params: Value) -> (VectorcraftApp, egui::Context) {
use crate::panels::tests_appearance::{click, frame_events, text_rect};
let mut app = app();
app.run("effect.apply", json!({"effect": "threeD.extrude", "item": null, "params": params})).unwrap();
let ctx = egui::Context::default();
crate::theme::install_fonts(&ctx);
ctx.enable_accesskit();
let texts = frame_events(&ctx, &mut app, vec![], show);
click(&ctx, &mut app, text_rect(&texts, "Lighting").center(), show);
(app, ctx)
}
/// The lighting widget's node for light `n` (from 1): its screen-reader name and its center.
fn light_node(app: &mut VectorcraftApp, ctx: &egui::Context, n: usize) -> (String, egui::Pos2) {
let nodes = controls(app, ctx);
let prefix = format!("Light {n}:");
let node = nodes
.iter()
.find(|x| x.role() == egui::accesskit::Role::Slider && x.label().is_some_and(|l| l.starts_with(&prefix)))
.unwrap_or_else(|| panic!("no lighting widget node for light {n}"));
let r = node.bounds().unwrap();
(node.label().unwrap_or_default().to_string(), egui::pos2(((r.x0 + r.x1) / 2.0) as f32, ((r.y0 + r.y1) / 2.0) as f32))
}
fn pointer(pos: egui::Pos2, pressed: Option<bool>) -> egui::Event {
match pressed {
Some(pressed) => egui::Event::PointerButton { pos, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() },
None => egui::Event::PointerMoved(pos),
}
}
fn merged_light(app: &VectorcraftApp) -> (f64, f64) {
let (id, params) = effect(app);
let merged = vectorcraft_effects::merged_params(&id, &params);
(merged["lightRotation"].as_f64().unwrap(), merged["lightHeight"].as_f64().unwrap())
}
/// Dragging a light in the lighting widget previews its new Rotation and Height while the pointer
/// is down and records one undo step when it is released, at the point of release; the rim of the
/// sphere is Height 0.
#[test]
fn the_lighting_widget_drags_a_light_in_one_undo_step() {
use crate::dialogs::revolve_lights::RADIUS;
use crate::panels::tests_appearance::frame_events;
let (mut app, ctx) = lighting_app(json!({}));
let (name, from) = light_node(&mut app, &ctx, 1);
assert_eq!(name, "Light 1: Rotation 125.3°, Height 30.0°");
let light = crate::dialogs::revolve_lights::lights(&crate::state::Dialog::new(
"x",
json!({"__effect": "threeD.extrude", "lightRotation": vectorcraft_three_d::DEFAULT_LIGHT.0, "lightHeight": 30.0}),
))[0];
let center = from - light.offset() * RADIUS;
let history = undo_len(&app);
frame_events(&ctx, &mut app, vec![pointer(from, None)], show);
frame_events(&ctx, &mut app, vec![pointer(from, Some(true))], show);
// Halfway out along the light's own direction, then onto the rim straight right of the center.
frame_events(&ctx, &mut app, vec![pointer(center + egui::vec2(0.0, -RADIUS * 0.5), None)], show);
assert_eq!(merged_light(&app), (90.0, 60.0), "the light follows the pointer while it is down");
let rim = center + egui::vec2(RADIUS, 0.0);
frame_events(&ctx, &mut app, vec![pointer(rim, None)], show);
assert_eq!(merged_light(&app), (0.0, 0.0));
assert_eq!(undo_len(&app), history, "nothing is recorded while the pointer is down");
// A frame that moves the pointer below the center and releases it there drops the light there.
let below = center + egui::vec2(0.0, RADIUS);
frame_events(&ctx, &mut app, vec![pointer(below, None), pointer(below, Some(false))], show);
frame_events(&ctx, &mut app, vec![], show);
assert_eq!(undo_len(&app), history + 1);
assert_eq!(merged_light(&app), (-90.0, 0.0));
app.run("edit.undo", json!({})).unwrap();
assert_eq!(merged_light(&app), (vectorcraft_three_d::DEFAULT_LIGHT.0, 30.0));
// A drag that comes back to the press drops the light there, not where it last was.
for event in [pointer(from, None), pointer(from, Some(true)), pointer(center + egui::vec2(0.0, -RADIUS * 0.5), None), pointer(from, None)] {
frame_events(&ctx, &mut app, vec![event], show);
}
frame_events(&ctx, &mut app, vec![pointer(from, Some(false))], show);
frame_events(&ctx, &mut app, vec![], show);
assert_eq!(merged_light(&app), (125.3, 30.0));
}
/// With objects whose lights differ in Height, an arrow key that turns the light changes only
/// the Rotation, and each object keeps its own Height.
#[test]
fn a_key_leaves_the_other_setting_as_each_selected_effect_has_it() {
use crate::panels::tests_appearance::{click, frame_events, text_rect};
let mut app = app();
let a = app.session.active().unwrap().selection.objects[0].0;
app.run("effect.apply", json!({"effect": "threeD.extrude", "item": null, "params": {"lightRotation": 0.0, "lightHeight": 20.0}})).unwrap();
let b = app.run("shape.rectangle", json!({"x": 250, "y": 100, "width": 100, "height": 100})).unwrap()["id"].as_u64().unwrap();
app.run("effect.apply", json!({"effect": "threeD.extrude", "item": null, "params": {"lightRotation": 0.0, "lightHeight": 40.0}})).unwrap();
app.run("select.set", json!({"ids": [a, b]})).unwrap();
let ctx = egui::Context::default();
crate::theme::install_fonts(&ctx);
ctx.enable_accesskit();
let texts = frame_events(&ctx, &mut app, vec![], show);
click(&ctx, &mut app, text_rect(&texts, "Lighting").center(), show);
let (_, at) = light_node(&mut app, &ctx, 1);
click(&ctx, &mut app, at, show);
let left = egui::Event::Key { key: egui::Key::ArrowLeft, physical_key: None, pressed: true, repeat: false, modifiers: egui::Modifiers::NONE };
frame_events(&ctx, &mut app, vec![left], show);
let light = |id: u64| {
let n = app.session.active().unwrap().doc.node(vectorcraft_doc::NodeId(id)).unwrap();
let merged = vectorcraft_effects::merged_params("threeD.extrude", &n.appearance.effects[0].params);
(merged["lightRotation"].as_f64().unwrap(), merged["lightHeight"].as_f64().unwrap())
};
assert_eq!((light(a), light(b)), ((1.0, 20.0), (1.0, 40.0)));
}
/// A press on a light selects it in the list without an undo step, and the button below the sphere
/// moves only the selected light to the back of the object, then back to the front.
#[test]
fn the_lighting_widget_selects_a_light_and_moves_it_behind_the_object() {
use crate::panels::tests_appearance::{click, frame_events, text_rect};
let light =
|rotation: f64| json!({"color": "#ffffff", "intensity": 80.0, "rotation": rotation, "height": 30.0, "softness": 0.0, "behind": false});
let (mut app, ctx) = lighting_app(json!({"lights": [light(0.0), light(180.0)]}));
let history = undo_len(&app);
let (_, second) = light_node(&mut app, &ctx, 2);
click(&ctx, &mut app, second, show);
assert_eq!(undo_len(&app), history, "a press on a light changes nothing");
let texts = frame_events(&ctx, &mut app, vec![], show);
assert!(texts.iter().any(|(s, _)| s == "Light 2"), "the list shows the pressed light: {texts:?}");
click(&ctx, &mut app, text_rect(&texts, "Move Light to Back").center(), show);
assert_eq!(undo_len(&app), history + 1);
let behind = |app: &VectorcraftApp| effect(app).1["lights"].as_array().unwrap().iter().map(|l| l["behind"].clone()).collect::<Vec<_>>();
assert_eq!(behind(&app), [json!(false), json!(true)]);
let (name, _) = light_node(&mut app, &ctx, 2);
assert_eq!(name, "Light 2: Rotation 180.0°, Height 30.0°, Light behind the object");
let texts = frame_events(&ctx, &mut app, vec![], show);
click(&ctx, &mut app, text_rect(&texts, "Move Light to Front").center(), show);
assert_eq!(behind(&app), [json!(false), json!(false)]);
assert_eq!(undo_len(&app), history + 2);
}
/// A light the pointer took has the keyboard focus: the arrow keys raise and lower it and turn it
/// around the object, 1° a press or 15° with Shift, changing only the setting each press moves, one
/// undo step a frame, and a press at a limit records nothing.
#[test]
fn the_arrow_keys_move_the_focused_light() {
use crate::panels::tests_appearance::{click, frame_events};
let (mut app, ctx) = lighting_app(json!({"lightRotation": 10.04, "lightHeight": 89.5}));
let (_, at) = light_node(&mut app, &ctx, 1);
click(&ctx, &mut app, at, show);
let history = undo_len(&app);
let key = |key: egui::Key, modifiers: egui::Modifiers| egui::Event::Key { key, physical_key: None, pressed: true, repeat: false, modifiers };
frame_events(&ctx, &mut app, vec![key(egui::Key::ArrowUp, egui::Modifiers::NONE)], show);
frame_events(&ctx, &mut app, vec![], show);
assert_eq!(merged_light(&app), (10.04, 90.0), "Up leaves the Rotation as it is");
assert_eq!(undo_len(&app), history + 1);
frame_events(&ctx, &mut app, vec![key(egui::Key::ArrowUp, egui::Modifiers::NONE)], show);
frame_events(&ctx, &mut app, vec![], show);
assert_eq!(merged_light(&app), (10.04, 90.0));
assert_eq!(undo_len(&app), history + 1, "Height stays at 90° and nothing is recorded");
// Down then Up in one frame, in that order: back at 90°.
frame_events(&ctx, &mut app, vec![key(egui::Key::ArrowDown, egui::Modifiers::NONE), key(egui::Key::ArrowUp, egui::Modifiers::NONE)], show);
frame_events(&ctx, &mut app, vec![], show);
assert_eq!(merged_light(&app), (10.04, 90.0));
assert_eq!(undo_len(&app), history + 1);
// Presses that arrive in one frame all move the light, as one undo step.
let presses = vec![
key(egui::Key::ArrowLeft, egui::Modifiers::SHIFT),
key(egui::Key::ArrowDown, egui::Modifiers::NONE),
key(egui::Key::ArrowDown, egui::Modifiers::NONE),
];
frame_events(&ctx, &mut app, presses, show);
frame_events(&ctx, &mut app, vec![], show);
assert_eq!(merged_light(&app), (25.0, 88.0));
assert_eq!(undo_len(&app), history + 2);
}
#[test]
fn changed_settings_lists_only_new_values() {
let before = json!({"depth": 50.0, "cap": true, "bevel": "none"});
+1
View File
@@ -583,6 +583,7 @@ since 2026-10-01.
- **Panel collapse controls (#5925, in part):** The small » in a floating tab-group header moves that group into the side icon rail, reusing the existing rail or creating one. An opened rail panel has the same control to fold its flyout back into the rail, including after a tab switch. Both controls preserve the tab group and its menu; other floating groups and full-width docked headers stay as they were. Pointer regressions in `crates/ui-egui/src/panel_docking/tests.rs` cover grouped tabs, reopening, separate groups, a missing rail, the menu and flyout closure after switching tabs; `native_tests.rs` covers the native-window click and removal of the empty palette. Scores and estimates unchanged.
- 3D lighting presets: `crates/effects/src/lighting_presets.rs`, `crates/engine/src/cmd/effectcmd/lighting_presets_tests.rs` and the pointer tests in `crates/ui-egui/src/dialogs/revolve/tests.rs` cover recognition, atomic targeting, native round trips, preview, Cancel, reset and Undo.
- 3D lighting widget: the Lighting tab of the 3D and Materials panel shows every light on a sphere at its Rotation and Height; a drag moves a light in one undo step, a press selects it, Move Light to Back and Move Light to Front change its side, and the arrow keys move the focused light ([three-d.md](three-d.md#lighting-widget)). `crates/ui-egui/src/panels/tests_three_d.rs` covers the drag, selection, side and keyboard.
- 3D shadows: Revolve, Extrude & Bevel, Inflate and Rotate take a Shadows switch with Position (Behind Object or Below Object), Distance from Object (0–100 %) and Shadow Bounds (10–400 %) on the Lighting tab ([three-d.md](three-d.md#shadows)); the first light casts one hard-edged vector shadow, drawn behind the solids, in exports and kept by Expand Appearance. Evidence: `crates/three-d/src/shadow/tests.rs`, `crates/effects/src/solids/tests_shadow.rs`, `effectcmd::tests::a_3d_shadow_is_one_undo_step_saved_exported_and_expanded`. Softness and the shadows of lights after the first are not built. Scores unchanged.
- 3D shadows: with Shadows on, Revolve, Extrude & Bevel, Inflate and Rotate cast the shadow from the faces kept by the build that draws each solid, so drawing an object builds each of its solids once. The art and the shadow are unchanged. Evidence: `crates/three-d/src/shadow/tests.rs` (`a_solid_and_its_shadow_are_built_once` and the tests that compare each solid and its shadow with the two built apart), `solids::tests_shadow::a_shadowed_3d_object_builds_each_solid_once`, `solids::tests_shadow::the_shadow_cast_from_the_solids_drawn_is_the_shadow_of_solids_built_for_it`, `revolve::tests::the_shadow_cast_from_the_surfaces_drawn_is_the_shadow_of_surfaces_swept_for_it`. Scores unchanged.
- Window › 3D and Materials panel: `crates/ui-egui/src/panels/three_d.rs` applies a 3D effect by object type (Plane, Extrude, Revolve, Inflate), changes an applied one in place (`effect.setParams` `threeDType`) and edits it with the options dialog's Object, Rotation and Lighting controls, one undo step per change; `crates/engine/src/cmd/effectcmd/three_d_type_tests.rs` and `crates/ui-egui/src/panels/tests_three_d.rs` cover it. No Materials tab.
+29 -1
View File
@@ -66,7 +66,8 @@ pages describe it.
when no selected object has a visible 3D effect.
- The Lighting tab also holds the Shadows switch and its settings ([Shadows](#shadows)). The Materials tab holds
the Graphics ([Graphics](#graphics)); base materials and ray-traced rendering are not built (see below). The
rotation and light rings on the artboard are part of the options dialog only.
rotation and light rings on the artboard are part of the options dialog only. The panel's Lighting tab has the
lighting widget instead ([Lighting widget](#lighting-widget)).
## Extrude & Bevel
@@ -302,6 +303,33 @@ applied 3D effect. Every target must have a 3D effect at that position; validati
the whole operation is one undo step. The numeric light settings are saved, not a preset name.
Existing documents keep their appearance unless a preset is chosen.
### Lighting widget
On the 3D and Materials panel's Lighting tab, above the list of lights, a sphere shows every light of the
effect where it shines from, as the public
[3D and Materials panel options](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/create-3d-graphics/3d-materials-panel-options.html)
page describes for dragging light sources around the object. The sphere is seen from the front: a light's
Rotation is its angle around the center, and its Height runs from the rim (0°) to the center (90°). A light in
front of the object is a sun filled with its color, and a light behind the object is hollow. The selected light
is drawn larger, above the others.
- Pressing a light selects it in the list of lights and records nothing. Dragging it moves it on its side of the
object, rounded to 0.1°; Shift snaps Rotation and Height to 15°. The drag is previewed while the pointer is
down and is one undo step when it is released.
- **Move Light to Back** moves the selected light behind the object, and **Move Light to Front** moves it back
in front, as the page's "Move selected light to the back/front of object" does. It sets the same
`lightBehind` (or a list light's `behind`) as the **Light behind the object** checkbox.
- Each light takes the keyboard focus. Left and Right turn the focused light around the object by 1°
(counterclockwise and clockwise), Up and Down raise and lower it by 1°, and Shift makes each step 15°. Each
press changes only the setting it moves and is one undo step. A
step past 90° or below 0° Height changes nothing. Screen readers name each light with its number, Rotation,
Height and, for a light behind the object, its side.
The widget sends the same settings as the Rotation, Height and Light behind the object controls
(`effect.setParams`); there is no command of its own. The sphere's look, the 0.1° rounding and the arrow keys
are VectorCraft's own. The options dialogs keep the light rings on the artboard instead, and the Lighting tab
of Extrude & Bevel (Classic), Revolve (Classic) and Rotate (Classic) has no lighting widget.
### Light settings
One to ten directional lights. **Lights** selects the light whose settings and artboard gizmo are edited. **Add Light** adds and selects a white front light; **Delete Light** removes the selected light while retaining at least one. Ambient Light is shared by all lights. The public panel options' Light Settings are kept in their order: