Skip to content

Free, open-source 3D sculpting for Linux, macOS and Windows: dense meshes, remeshing, painting, built-in AI (image/text to 3D), Send to Unreal, game-ready LODs, Gaussian splats and OpenUSD.

Cursor, look and panels (0.10.9): true-circle surface ring, Neutral default, Outlines, Strokes ring, drag scroll, hints

islandmed593d85d6cfa0
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a5607791..56f504b9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,26 @@ All notable changes to SculptForge are listed here. The format follows
## [Unreleased]
+### Changed
+- Brush cursor (#88): the ring is a true circle in the surface's tangent plane (its normal averaged over the brush
+ area) instead of being pressed onto the mesh point by point, so it no longer wobbles or breaks up on bumpy
+ surfaces; symmetry and radial copies show as dots, not rings; the crosshair stays while the view turns, pans or
+ zooms. New Preferences > Cursor (Viewport cursor and Cursor follows surface moved there) with Hide ring while
+ stroking (off by default).
+- Looks: new installs default to the new Neutral scheme (pure grey, the orange accent only), and the first-run
+ welcome offers three look cards (Neutral, Forge Terminal, ZBrush-style layout); Coming from now sets the keys and
+ the layout together. The Classic look's greys, the viewport gradient and the default background are now exactly
+ neutral (they had a slight blue cast). Existing installs keep their look.
+- Forge Terminal, Phosphor and Blueprint: Preferences > Interface > Look > Outlines (Off / Subtle / On, default
+ Subtle) and Outline opacity (0-100%) (#98). The panel under the pointer no longer gets an accent border (at most a faint step, with Outlines On);
+ shelf thumbnails get a faint fill on hover instead of an accent outline.
+
+### Added
+- A Strokes radial menu on J: the five stroke types on one ring (single ring, like every radial menu), and a
+ stroke.type.* action for each.
+- Panels scroll with a left-drag on empty space or a middle-drag anywhere on them, for pens and small screens (#100).
+- Viewport hints have Don't show again; Preferences > Hints shows, hides or restores them all.
+
## [0.10.8] - 2026-11-02
### Fixed
diff --git a/docs/guide/coming-from-zbrush.md b/docs/guide/coming-from-zbrush.md
index a5a7f26a..f2bcb78e 100644
--- a/docs/guide/coming-from-zbrush.md
+++ b/docs/guide/coming-from-zbrush.md
@@ -6,7 +6,7 @@ of relearning. SculptForge has its own keymap and offers ZBrush-style, Blender a
**ZBrush-style** keys first (see [ZBrush-style keys](#zbrush-style-keys)) and your hands will feel at home.
New installs start in SculptForge's own layout, with menus by task. For the alphabetical palette bar and the
-two-row top shelf you know, click **Coming from ZBrush? Use the ZBrush-style layout** in the welcome, or pick
+two-row top shelf you know, pick **Coming from: ZBrush** (keys and layout) or the **ZBrush-style layout** card in the welcome, or pick
**Preferences > Interface > Look > Layout > ZBrush-style** (see [Looks and layouts](interface.md#looks-and-layouts)).
The palette paths in this guide (**Tool > Parts**) work in both: in the SculptForge layout the palettes are
sections of the menus, and <kbd>F3</kbd> finds any of them.
diff --git a/docs/guide/interface.md b/docs/guide/interface.md
index b2d5d8e9..7bdbbff5 100644
--- a/docs/guide/interface.md
+++ b/docs/guide/interface.md
@@ -41,32 +41,45 @@ models, brushes or shortcuts.
a section to a tray as you would a palette. Brush Lab, Front and the pressure options are under **Sculpt**, the
Library and the console under **View > Display**, and <kbd>F3</kbd> finds everything.
- **ZBrush-style**: the alphabetical palette bar and the two-row top shelf described in the rest of this chapter.
- Coming from ZBrush? The welcome shown at the first start has **Coming from ZBrush? Use the ZBrush-style layout**,
- one click.
+ Coming from ZBrush? In the welcome shown at the first start, pick the **ZBrush-style layout** card or **Coming
+ from: ZBrush** (which also sets the ZBrush-style keys).
Switching the layout swaps the shelves for that layout's standard ones; the trays and what is in them stay.
**Look** (the colours and style):
-- **Forge Terminal** (the default): tiles with small gaps and thin borders, the panel under the pointer
- highlighted, JetBrains Mono for labels and numbers. **Colours** picks the scheme: **Tokyo Night** (the default),
- Catppuccin Mocha, Gruvbox Dark, Nord, Rosé Pine, Kanagawa or Everforest. **Match my desktop theme** uses your
- Omarchy theme's colours when Omarchy is installed (Linux; the option shows only then). SculptForge never changes
- the theme; toggle it again after switching themes.
-- **Classic**: the dark grey interface with the orange accent that SculptForge had before 0.10.7.
+- **Forge Terminal** (the default): tiles with small gaps and thin borders, JetBrains Mono for labels and numbers.
+ **Colours** picks the scheme: **Neutral** (the default since 0.10.9: pure grey panels and the orange accent, so
+ your model's colours read true), Tokyo Night (the default in 0.10.7 and 0.10.8), Catppuccin Mocha, Gruvbox Dark,
+ Nord, Rosé Pine, Kanagawa or Everforest. **Match my desktop theme** uses your Omarchy theme's colours when Omarchy
+ is installed (Linux; the option shows only then). SculptForge never changes the theme; toggle it again after
+ switching themes.
+- **Classic**: the dark grey interface with the orange accent that SculptForge had before 0.10.7, now exactly
+ neutral grey (red, green and blue equal in every background, panel and frame colour).
- **Phosphor**: green or amber on black, monospace, with optional scanlines and glow on the interface (never on
the 3D view).
- **Blueprint**: deep blue with cyan and white line work.
+**Outlines** (Forge Terminal, Phosphor and Blueprint) sets the panels' borders: **Subtle** (the default: faint
+borders, and nothing lights up under the pointer), **Off** (no borders; the gaps alone separate the panels) or
+**On** (clear borders, the panel under the pointer a faint step lighter). **Outline opacity** (0-100%, default
+100%) fades the borders further into the panels. Hovering a control only gives that control a faint fill, never a
+bright border.
+
+**The first start** shows three looks to pick from in the welcome: **Neutral**, **Forge Terminal** (Tokyo Night)
+and **ZBrush-style layout** (Classic with the palette bar). **Coming from** sets the keys and the layout together:
+ZBrush (ZBrush-style keys and layout), Blender, Maya or New to sculpting (their keys, the SculptForge layout).
+Help > Welcome shows it again.
+
Choosing Forge Terminal, Phosphor or Blueprint also switches to the SculptForge layout; you can pick the
ZBrush-style layout again right after. The look and layout are remembered for the next start without
[Store Config](#store-config-and-friends) (Store Config keeps them in your UI configuration too).
**Updating from an older version** keeps the look and layout you had. A card, **SculptForge has a new look**,
-shows once: **Try it** switches to Forge Terminal with Tokyo Night and the SculptForge layout; **Keep my layout**
+shows once: **Try it** switches to Forge Terminal with the Neutral colours and the SculptForge layout; **Keep my layout**
changes nothing. Either way, Preferences > Interface > Look changes it later.
-In scripts: `ui_look look=forge scheme=tokyo_night layout=sculptforge` (or `look=classic layout=zbrush`).
+In scripts: `ui_look look=forge scheme=neutral outlines=subtle layout=sculptforge` (or `look=classic layout=zbrush`).
## The title strip
@@ -470,9 +483,8 @@ Config keeps it.
| Setting | Default | What it does |
|---|---|---|
-| **Look** and **Layout** | Forge Terminal, Tokyo Night, SculptForge | See [Looks and layouts](#looks-and-layouts) |
+| **Look**, **Outlines** and **Layout** | Forge Terminal, Neutral, Subtle, SculptForge | See [Looks and layouts](#looks-and-layouts) |
| **Language** | English | The interface language: **English** or **Español** (see below) |
-| **Viewport cursor** | Crosshair | The pointer over the 3D view: a crosshair, or the arrow (#73). Panels, menus and popups always show the arrow |
| **Popup Info (Ctrl+hover help)** | On | Ctrl-hover help boxes |
| **Popup Info opacity** | 0.97 | How solid the help box is |
| **Tooltip delay** | 0.5 s | How long to point at an icon-only button before its name appears |
@@ -490,6 +502,22 @@ Quad Remesh, Forge Spheres, Library, Lit Sphere, Clay Block, Add). The command p
English name. Anything not translated yet (most Ctrl-help descriptions, this guide) shows in English. Scripts and
`sculptforge-cli` commands are the same in every language.
+**Preferences > Cursor**:
+
+| Setting | Default | What it does |
+|---|---|---|
+| **Viewport cursor** | Crosshair | The pointer over the 3D view: a crosshair, or the arrow (#73). The crosshair stays while the view turns, pans or zooms. Panels, menus and popups always show the arrow |
+| **Cursor follows surface** | On | The brush ring lies on the model: a true circle at the brush's real size, in the plane of the surface (averaged over the brush, so bumps don't bend it), with a short line along the surface's direction. Symmetry and radial copies show as dots where their dabs land. Off: a flat ring on the screen |
+| **Hide ring while stroking** | Off | While a stroke runs, only the dot where the brush touches (and the symmetry dots) shows, not the ring |
+
+**Preferences > Hints**: **Show hints in the viewport** (on) and one box per hint (Strokes start off the model,
+Previewing an LOD, Face landmark steps). Each hint over the 3D view also has its own **Don't show again**; **Show
+all hints again** brings them all back. Store Config keeps them.
+
+**Scrolling panels with a pen**: on small screens a palette or tray that doesn't fit scrolls with the mouse wheel,
+and also with a **left-drag on empty space** in it (between and beside the controls) or a **middle-drag anywhere**
+on it, as you would scroll a list with a finger (#100).
+
**Preferences > Input** sets the key **Style** (the first start sets it from your **Coming from** answer):
**SculptForge** (the default for new installs): <kbd>1</kbd> to <kbd>9</kbd> and <kbd>0</kbd> pick the first ten
brushes, <kbd>I</kbd> opens Intensity like <kbd>U</kbd>, and <kbd>Ctrl</kbd>+drag on the background zooms when
diff --git a/docs/guide/sculpting.md b/docs/guide/sculpting.md
index 70824b17..4616342a 100644
--- a/docs/guide/sculpting.md
+++ b/docs/guide/sculpting.md
@@ -149,10 +149,13 @@ With an [alpha](#alphas), Falloff works as in ZBrush: the alpha is multiplied by
the whole alpha shows, hard to its edges (a Square alpha stamps the full square); at 0 the falloff softens it and
rounds a square's corners; at +100 only a soft point in the middle is left.
-Over the model, the rings lie on the surface, as in SculptGL: they turn with the surface under the pointer, bend
-over its bumps and curves, and show the brush's real size there, with a short line pointing out of the surface.
-With symmetry on, a fainter ring shows where the mirrored brush lands. Off the model the rings are flat circles.
-**Preferences > Input > Cursor follows surface** (on by default) switches back to flat rings everywhere.
+Over the model, the rings lie on the surface: true circles in the plane of the surface under the pointer, at the
+brush's real size there, with a short line pointing out of the surface. The plane follows the form averaged over
+the whole brush, so the rings stay round and steady over fine bumps and detail. With symmetry on (mirror or
+radial), a dot shows where each copy of the brush lands. Off the model the rings are flat circles.
+**Preferences > Cursor**: **Cursor follows surface** (on by default) switches back to flat rings everywhere, and
+**Hide ring while stroking** (off by default) shows only the dot while a stroke runs. The crosshair pointer stays
+while you turn the view.
The <kbd>S</kbd>, <kbd>U</kbd>, <kbd>I</kbd> and <kbd>O</kbd> pop-ups take the mouse or the keyboard: drag the
slider and release to close it, or type a number and press <kbd>Enter</kbd> (a minus first for a negative Falloff). <kbd>Esc</kbd> closes the pop-up without typing anything new.
@@ -245,15 +248,18 @@ works the same way. Turn it off with **Preferences > Input > Right click opens t
Radial (pie) menus put the tools you use most around the cursor. Hold a menu's key, flick the pointer toward an
item and let go: it runs. Let go in the middle and nothing happens. Tap the key instead and the pie stays open:
-click an item, or click in the middle or press <kbd>Esc</kbd> to close it. Two menus are built in:
+click an item, or click in the middle or press <kbd>Esc</kbd> to close it. Three menus are built in:
| Key | Menu | Items |
|---|---|---|
| <kbd>T</kbd> | **Brushes** | Standard, Clay Block, Move, Sharp Crease, Inflate, Pinch, Flatten, Tendril |
| <kbd>Y</kbd> | **Masking** | Invert Mask, Mask Lasso, Clear Mask, Mask Rectangle, Mask All, Mask Pen, View Mask, Group Masked |
+| <kbd>J</kbd> | **Strokes** | Dots, Drag Stamp, Slide Stamp, Spray, Lazy Stroke (see [Strokes](#strokes)) |
-Both keys are free in every input style. Make your own in **Preferences > Input > Radial Menus** (up to 8 menus of
-8 items each):
+All three keys are free in every input style. Installs that stored their radial menus before 0.10.9 get the
+Strokes menu from **Restore default menus** in Preferences > Input > Radial Menus.
+
+Make your own in **Preferences > Input > Radial Menus** (up to 8 menus of 8 items each):
- **+** adds a menu and opens a search for its first item. An item can be anything the command palette
(<kbd>F3</kbd>) finds: a brush, a tool, a command or a toggle.
diff --git a/docs/guide/shortcuts.md b/docs/guide/shortcuts.md
index 55e3d1b9..9d597e4b 100644
--- a/docs/guide/shortcuts.md
+++ b/docs/guide/shortcuts.md
@@ -108,6 +108,7 @@ generated from SculptForge's action registry, the same source as the Controls wi
| Load UI... | <kbd>Ctrl</kbd>+<kbd>L</kbd> | Load a layout file someone shared (or you saved with Save UI). |
| Radial menu 1: Brushes | <kbd>T</kbd> | Hold the key, flick toward an item and let go to run it; or tap the key and click one. Edit it in Preferences > Input > Radial Menus. |
| Radial menu 2: Masking | <kbd>Y</kbd> | Hold the key, flick toward an item and let go to run it; or tap the key and click one. Edit it in Preferences > Input > Radial Menus. |
+| Radial menu 3: Strokes | <kbd>J</kbd> | Hold the key, flick toward an item and let go to run it; or tap the key and click one. Edit it in Preferences > Input > Radial Menus. |
| Save UI... | <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>Shift</kbd>+<kbd>I</kbd> | Save the layout, shortcuts and interface preferences to a file you can share. |
| Shelves | <kbd>Tab</kbd> | Hide or show the shelves and trays around the canvas. |
| Store Config | <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>I</kbd> | Keep the current layout, shortcuts and interface preferences for future sessions. Like ZBrush, SculptForge never saves them on its own. |
diff --git a/docs/guide/whats-new.md b/docs/guide/whats-new.md
index d8920df6..7ba05208 100644
--- a/docs/guide/whats-new.md
+++ b/docs/guide/whats-new.md
@@ -5,6 +5,23 @@ chapter opens by itself the first time you start a new version; you can always f
**Help > What's New**. Every detail is in the
[changelog](https://github.com/islandmed/SculptForge/blob/main/CHANGELOG.md).
+## Version 0.10.9
+
+- **A calmer brush cursor**: the ring is a true circle lying in the plane of the surface, so bumps no longer bend
+ or break it; symmetry copies show as dots instead of extra rings; the crosshair stays while you turn the view; and
+ **Preferences > Cursor > Hide ring while stroking** leaves only a dot while you sculpt (off by default) (#88).
+- **Neutral grey by default**: new installs start in **Neutral** (grey panels, one orange accent), and the first
+ start offers three looks: Neutral, Forge Terminal and the ZBrush-style layout. **Classic** is now truly neutral
+ grey too. Your current look stays as it is. See [Looks and layouts](interface.md#looks-and-layouts).
+- **Calmer panels**: **Preferences > Interface > Look > Outlines** (Off, Subtle, On) and **Outline opacity** for
+ Forge Terminal, Phosphor and Blueprint (#98). Subtle is the default, and the panel under the pointer no longer lights up.
+- **Strokes ring on J**: hold <kbd>J</kbd>, flick toward Dots, Drag Stamp, Slide Stamp, Spray or Lazy Stroke, let
+ go. See [Radial menus](sculpting.md#radial-menus).
+- **Drag to scroll panels**: on small screens and with a pen, drag empty space in a panel (or middle-drag anywhere
+ on it) to scroll it (#100).
+- **Hints you can turn off**: every note over the 3D view has **Don't show again**, and **Preferences > Hints**
+ turns them on and off.
+
## Version 0.10.8
- **Tablets in mouse mode work again**: on some Windows tablets with **Mouse mode** on (Preferences > Tablet) the
diff --git a/src/app/App.cpp b/src/app/App.cpp
index 08c6194c..6bdc2052 100644
--- a/src/app/App.cpp
+++ b/src/app/App.cpp
@@ -1233,12 +1233,14 @@ bool App::frontRaycast(const glm::vec3& origin, const glm::vec3& dir, RayHit& hi
return glm::dot(hit.normal, dir) <= 0.0f;
}
-// The crosshair (#73): over the 3D view, where a click sculpts, paints or masks, or while a stroke runs (it may
-// drag over a panel). Not over the panels or windows floating above the view (ImGui has the pointer), a gizmo
-// handle, while the view turns or pans, or where ImGui asks for a cursor of its own (a resize handle on the edge).
+// The crosshair (#73): over the 3D view, where a click sculpts, paints or masks, while a stroke runs (it may
+// drag over a panel) and while the view turns, pans or zooms (#88: the arrow flashing in for every orbit was
+// distracting). Not over the panels or windows floating above the view (ImGui has the pointer), a gizmo handle,
+// or where ImGui asks for a cursor of its own (a resize handle on the edge).
bool App::viewportCursorWanted() const {
if (uiPrefs_.viewportCursor != 0) return false;
if (drag_ == Drag::Stroke || drag_ == Drag::MaskCanvas || drag_ == Drag::AirStroke) return true;
+ if (drag_ == Drag::Orbit || drag_ == Drag::Pan || drag_ == Drag::Zoom || drag_ == Drag::Roll) return true;
if (drag_ != Drag::None) return false;
if (ImGui::GetIO().WantCaptureMouse || !canvasRect().contains(mouseX_, mouseY_)) return false;
if (ImGui::GetMouseCursor() != ImGuiMouseCursor_Arrow) return false;
@@ -2284,9 +2286,8 @@ void App::drawUi() {
const CanvasRect c = canvasRect();
std::string banner = "Previewing LOD" + std::to_string(previewLod_) + " - " +
std::to_string(lods_[previewLod_].triangleCount()) + " tris (sculpting paused)";
- ImVec2 size = ImGui::CalcTextSize(banner.c_str());
- ImGui::GetForegroundDrawList()->AddText(ImVec2(c.x + (c.w - size.x) * 0.5f, c.y + c.h - size.y - 16.0f * uiScale_),
- IM_COL32(255, 190, 120, 255), banner.c_str());
+ drawViewportHint("lod_preview", banner.c_str(), IM_COL32(255, 190, 120, 255),
+ c.y + c.h - ImGui::GetFrameHeight() - 20.0f * uiScale_);
}
const ImVec2 mouse(mouseX_, mouseY_);
drawGizmo(); // Gizmo 3D handles and panel (Gizmo.cpp)
@@ -3241,7 +3242,7 @@ void App::drawPalette_Splats() {
drawSculptableSection(); // Make sculptable (PanelSculptable.cpp)
}
-bool App::drawSurfaceCursor(ImDrawList* dl, float radiusPx, ImU32 col) {
+bool App::drawSurfaceCursor(ImDrawList* dl, float radiusPx, ImU32 col, bool ring) {
// Only what brushes work on: the active, visible SubTool with an up-to-date BVH (a stale one, after a
// whole-mesh change, is rebuilt at the next press; until then the flat ring shows), not an LOD preview.
if (previewLod_ >= 0 || doc_.bvhDirty) return false;
@@ -3252,56 +3253,52 @@ bool App::drawSurfaceCursor(ImDrawList* dl, float radiusPx, ImU32 col) {
// The world radius a dab here gets (App::firstDab / the brushes: Draw Size times world size of a pixel).
const float radius = radiusPx * camera_.worldPerPixel(hit.position, canvasHeight());
if (!(radius > 0.0f) || !std::isfinite(radius)) return false;
- // A steady normal (8 rays), the ring pressed onto the surface (48) and the Focal Shift ring (32): a few dozen
- // BVH ray casts, only on frames that are drawn anyway, never a pass over the mesh.
+ // A steady normal over the brush's area (16 rays), then the ring and the Focal Shift ring as true circles in
+ // that plane (#88): no per-point pressing, so bumps can't bend or break the ring. Never a pass over the mesh.
const glm::vec3 n = surfaceCursorNormal(doc_.mesh, doc_.bvh, hit, radius);
- surfaceCursorRing(doc_.mesh, doc_.bvh, hit.position, n, radius, 48, cursorRing_);
- const float focal = focalRingFraction(focalShift_);
- surfaceCursorRing(doc_.mesh, doc_.bvh, hit.position, n, radius * focal, 32, cursorInner_);
+ surfaceCursorCircle(hit.position, n, radius, 64, cursorRing_);
+ surfaceCursorCircle(hit.position, n, radius * focalRingFraction(focalShift_), 48, cursorInner_);
const glm::vec3 eye = camera_.position(), forward = camera_.forward();
const bool ortho = camera_.ortho;
auto facing = [&](const glm::vec3& p, const glm::vec3& pn) {
return glm::dot(pn, ortho ? -forward : eye - p) > 0.0f;
};
- const ImU32 inner = IM_COL32(255, 255, 255, 90);
- // Closed polyline through the points facing the camera; a point on the far side of a curve breaks the line.
- auto drawRing = [&](const std::vector<SurfaceRingPoint>& ring, const SymCopy& m, ImU32 colour, float width) {
- const size_t count = std::min<size_t>(ring.size(), 64);
+ auto drawRing = [&](const std::vector<glm::vec3>& points, ImU32 colour, float width) {
ImVec2 sp[64];
- bool ok[64];
- for (size_t i = 0; i < count; ++i) {
- const glm::vec3 q = m.point(ring[i].position);
- ok[i] = facing(q, m.dir(ring[i].normal)) && gizmoProject(q, sp[i]);
- }
- for (size_t i = 0; i < count; ++i) {
- const size_t j = (i + 1) % count;
- if (ok[i] && ok[j]) dl->AddLine(sp[i], sp[j], colour, width);
- }
+ const size_t count = std::min<size_t>(points.size(), 64);
+ for (size_t i = 0; i < count; ++i)
+ if (!gizmoProject(points[i], sp[i])) return; // (behind the camera: a huge brush close up)
+ dl->AddPolyline(sp, int(count), colour, ImDrawFlags_Closed, width);
};
auto fade = [](ImU32 colour, float k) {
const ImU32 a = ImU32(float((colour >> IM_COL32_A_SHIFT) & 0xFF) * k);
return (colour & ~IM_COL32_A_MASK) | (a << IM_COL32_A_SHIFT);
};
- // The mirrored and radial rings first (fainter), as the brush copies its dabs (Sculptor::copies; the first is
- // this one): every copy's cursor shows.
+ // The mirrored and radial copies (Sculptor::copies; the first is this one) as dots where their dabs land
+ // (#88): one ring per copy crowded the view. A copy that lands on the cursor itself (hovering on the plane or
+ // the axis) or faces away adds nothing.
refreshSymmetryPivot();
const std::vector<SymCopy> mirrors = Sculptor::copies(symmetry_);
- symmetryCopiesDrawn_ = 0;
- for (size_t k = mirrors.size(); k-- > 0;) {
+ symmetryCopiesDrawn_ = 1; // this one
+ for (size_t k = 1; k < mirrors.size(); ++k) {
const SymCopy& m = mirrors[k];
- const bool self = k == 0;
- // A copy that lands on the cursor's own ring (hovering on the plane or the axis) adds nothing.
- if (!self && glm::length(m.point(hit.position) - hit.position) < radius * 0.05f) continue;
- if (!self && !facing(m.point(hit.position), m.dir(n))) continue;
+ const glm::vec3 q = m.point(hit.position);
+ if (glm::length(q - hit.position) < radius * 0.05f || !facing(q, m.dir(n))) continue;
+ ImVec2 at;
+ if (!gizmoProject(q, at)) continue;
++symmetryCopiesDrawn_;
- drawRing(cursorRing_, m, self ? col : fade(col, 0.45f), self ? 2.0f : 1.25f);
- drawRing(cursorInner_, m, self ? inner : fade(inner, 0.6f), 1.0f);
+ dl->AddCircleFilled(at, 3.0f * uiScale_, IM_COL32(0, 0, 0, 110));
+ dl->AddCircleFilled(at, 2.25f * uiScale_, fade(col, 0.8f));
+ }
+ if (ring) {
+ drawRing(cursorRing_, col, 2.0f);
+ drawRing(cursorInner_, IM_COL32(255, 255, 255, 90), 1.0f);
}
// The surface's direction: a short line out of the centre (with a dot where the brush touches).
ImVec2 c0, c1;
- if (gizmoProject(hit.position, c0) && gizmoProject(hit.position + n * (radius * 0.4f), c1)) {
- dl->AddLine(c0, c1, fade(col, 0.85f), 1.5f);
+ if (gizmoProject(hit.position, c0)) {
+ if (ring && gizmoProject(hit.position + n * (radius * 0.4f), c1)) dl->AddLine(c0, c1, fade(col, 0.85f), 1.5f);
dl->AddCircleFilled(c0, 2.0f * uiScale_, col);
}
return true;
@@ -3383,11 +3380,18 @@ void App::drawBrushCursor() {
const glm::vec3 pc = linearToSrgb(inverted ? glm::vec3(1.0f) : doc_.paintColor);
col = ImGui::GetColorU32(ImVec4(pc.x, pc.y, pc.z, 0.9f));
}
- surfaceCursorShown_ = uiPrefs_.cursorFollowsSurface && drawSurfaceCursor(dl, r, col);
+ // Preferences > Cursor > Hide ring while stroking (#88): the dot and the symmetry dots stay.
+ const bool ring = !(uiPrefs_.hideRingWhileStroking && drag_ == Drag::Stroke);
+ surfaceCursorShown_ = uiPrefs_.cursorFollowsSurface && drawSurfaceCursor(dl, r, col, ring);
+ ringShown_ = ring;
if (!surfaceCursorShown_) {
- dl->AddCircle(c, r, col, 64, 1.5f);
- // The inner ring is Focal Shift, as in ZBrush: where the falloff drops to half.
- dl->AddCircle(c, r * focalRingFraction(focalShift_), IM_COL32(255, 255, 255, 90), 48, 1.0f);
+ if (ring) {
+ dl->AddCircle(c, r, col, 64, 1.5f);
+ // The inner ring is Focal Shift, as in ZBrush: where the falloff drops to half.
+ dl->AddCircle(c, r * focalRingFraction(focalShift_), IM_COL32(255, 255, 255, 90), 48, 1.0f);
+ } else {
+ dl->AddCircleFilled(c, 2.0f * uiScale_, col);
+ }
}
if (strokeType_ == StrokeType::LazyMouse && drag_ == Drag::Stroke) {
// The string from the cursor to the lagging brush point.
diff --git a/src/app/App.h b/src/app/App.h
index 34fbdfa2..2d7c5abe 100644
--- a/src/app/App.h
+++ b/src/app/App.h
@@ -202,11 +202,13 @@ private:
void pollBrushRequest();
const BrushRecipe* activeRecipe() const;
void drawBrushCursor();
- // The brush ring lying on the surface under the pointer (#25, Preferences > Input > Cursor follows surface);
- // false when the pointer is off the model (the flat screen ring is drawn instead).
- bool drawSurfaceCursor(ImDrawList* dl, float radiusPx, ImU32 col);
- std::vector<SurfaceRingPoint> cursorRing_, cursorInner_; // scratch, kept to avoid allocating per frame
+ // The brush ring lying on the surface under the pointer (#25, Preferences > Cursor > Cursor follows surface);
+ // false when the pointer is off the model (the flat screen ring is drawn instead). `ring` false: only the
+ // centre and the symmetry copies' dots (Hide ring while stroking).
+ bool drawSurfaceCursor(ImDrawList* dl, float radiusPx, ImU32 col, bool ring);
+ std::vector<glm::vec3> cursorRing_, cursorInner_; // scratch, kept to avoid allocating per frame
bool surfaceCursorShown_ = false; // the last cursor drawn lay on the surface (UI tests: surface_cursor)
+ bool ringShown_ = true; // the last cursor drawn had its ring (UI tests: cursor_ring)
void updateTitle();
int runRecording(); // also runs UI tests (options_.uiTest)
@@ -239,7 +241,7 @@ private:
// The symmetry arguments of the commands that follow the brushes' symmetry (symmetry, radial, radial_axis,
// local), added to `args`.
Args withSymmetryArgs(Args args);
- int symmetryCopiesDrawn_ = 0; // brush cursors the last drawSurfaceCursor drew (UI tests: cursor_copies)
+ int symmetryCopiesDrawn_ = 0; // the cursor and its symmetry dots the last drawSurfaceCursor drew (UI tests: cursor_copies)
bool invertToggle_ = false;
bool frontFacesOnly_ = false;
bool pressureStrength_ = true;
@@ -1149,6 +1151,7 @@ public:
// Preferences > Interface > Look: applies uiPrefs_.look (colours, style, fonts, the viewport background).
void applyLook();
void drawLookSection(); // Preferences > Interface > Look (Config.cpp)
+ void drawLookPicker(); // the first-run welcome's three look cards (PanelSupport.cpp)
ImFont* smallFont() const { return fontSmall_; } // 12 px captions (shelf labels, tiles)
ImFont* boldFont() const { return fontBold_; } // SemiBold 15 (help titles)
@@ -1512,6 +1515,12 @@ private:
bool drawHeldBrushGrid(HeldBrush held, bool strokes); // the picker's grid; true when one was picked
void drawHeldBrushIcon(ImDrawList* dl, ImVec2 a, ImVec2 b, const char* icon, bool select); // shelf tiles (Shell.cpp)
void drawInputSection(); // Preferences > Input
+ void drawCursorSection(); // Preferences > Cursor (Input.cpp)
+ // Viewport hints (U11, Config.cpp): a note over the 3D view with Don't show again, `top` its top edge in
+ // pixels; Preferences > Hints lists them. hintShown: not hidden by either.
+ bool hintShown(const char* id) const;
+ void drawViewportHint(const char* id, const char* text, ImU32 colour, float top);
+ void drawHintsSection();
// Z Intensity (0-100 on screen): Smooth's own while Shift is held or Smooth is the brush, as in ZBrush.
void drawZIntensitySlider(const char* id);
void openQuickMenu();
@@ -1712,7 +1721,7 @@ private:
bool systemCursorInWindow(float& x, float& y) const; // mouse mode (#72): the system cursor, window pixels
void mapPenPosition(SDL_Event& e); // mouse mode: the pen moves the cursor relatively (Tablet.cpp)
// The system cursor (#73): ImGui's (resize handles, text fields, links) over the panels, a crosshair over the
- // 3D view where a brush acts (Preferences > Interface > Viewport cursor). Called after each ImGui::Render.
+ // 3D view where a brush acts (Preferences > Cursor > Viewport cursor). Called after each ImGui::Render.
void updateMouseCursor();
bool viewportCursorWanted() const;
bool frontRaycast(const glm::vec3& origin, const glm::vec3& dir, RayHit& hit) const; // as drawn (#68)
diff --git a/src/app/Config.cpp b/src/app/Config.cpp
index 7174c9cf..25c1f38f 100644
--- a/src/app/Config.cpp
+++ b/src/app/Config.cpp
@@ -46,6 +46,8 @@ void lookToJson(const UiPrefs& p, Json& j) {
look.set("matchOmarchy", p.look.matchOmarchy);
look.set("phosphor", std::string(p.look.amber ? "amber" : "green"));
look.set("effects", p.look.effects);
+ look.set("outlines", std::string(p.look.outlines == 0 ? "off" : p.look.outlines == 2 ? "on" : "subtle"));
+ look.set("outlineOpacity", double(p.look.outlineOpacity));
j.set("look", std::move(look));
j.set("layout", std::string(p.shellLayout == 1 ? "sculptforge" : "zbrush"));
}
@@ -58,6 +60,11 @@ bool lookFromJson(const Json& j, UiPrefs& p) {
p.look.matchOmarchy = look["matchOmarchy"].asBool(p.look.matchOmarchy);
if (look["phosphor"].isString()) p.look.amber = look["phosphor"].asString() == "amber";
p.look.effects = look["effects"].asBool(p.look.effects);
+ if (look["outlines"].isString()) {
+ const std::string o = look["outlines"].asString();
+ p.look.outlines = o == "off" ? 0 : o == "on" ? 2 : 1;
+ }
+ p.look.outlineOpacity = std::clamp(float(look["outlineOpacity"].asNumber(p.look.outlineOpacity)), 0.0f, 1.0f);
}
if (j["layout"].isString()) p.shellLayout = j["layout"].asString() == "sculptforge" ? 1 : 0;
return j["look"].isObject() || j["layout"].isString();
@@ -88,6 +95,7 @@ Json toJson(const UiPrefs& p) {
j.set("dyntopoSmoothRemesh", double(p.dyntopoSmoothRemesh));
j.set("airStrokes", p.airStrokes);
j.set("cursorFollowsSurface", p.cursorFollowsSurface);
+ j.set("hideRingWhileStroking", p.hideRingWhileStroking);
j.set("timelinePosition", std::string(p.timelineTop ? "top" : "bottom"));
j.set("showAxes", p.showAxes);
j.set("alphabeticalPalettes", p.alphabeticalPalettes);
@@ -108,6 +116,10 @@ Json toJson(const UiPrefs& p) {
Json bg = Json::array();
for (int i = 0; i < 3; ++i) bg.push(double(p.backgroundColor[i]));
j.set("backgroundColor", std::move(bg));
+ j.set("showHints", p.showHints);
+ Json hints = Json::array();
+ for (const std::string& h : p.hiddenHints) hints.push(h);
+ j.set("hiddenHints", std::move(hints));
return j;
}
@@ -143,6 +155,7 @@ void fromJson(const Json& j, UiPrefs& p) {
p.dyntopoSmoothRemesh = std::clamp(float(j["dyntopoSmoothRemesh"].asNumber(p.dyntopoSmoothRemesh)), 0.0f, 1.0f);
p.airStrokes = j["airStrokes"].asBool(p.airStrokes);
p.cursorFollowsSurface = j["cursorFollowsSurface"].asBool(p.cursorFollowsSurface);
+ p.hideRingWhileStroking = j["hideRingWhileStroking"].asBool(p.hideRingWhileStroking);
if (j["timelinePosition"].isString()) p.timelineTop = j["timelinePosition"].asString() != "bottom";
p.showAxes = j["showAxes"].asBool(p.showAxes);
p.alphabeticalPalettes = j["alphabeticalPalettes"].asBool(p.alphabeticalPalettes);
@@ -167,6 +180,12 @@ void fromJson(const Json& j, UiPrefs& p) {
p.viewportCursor = std::clamp(int(j["viewportCursor"].asNumber(p.viewportCursor)), 0, 1);
p.backfaceCulling = j["backfaceCulling"].asBool(p.backfaceCulling);
if (j["background"].isString()) p.gradientBackground = j["background"].asString() != "flat";
+ p.showHints = j["showHints"].asBool(p.showHints);
+ if (const Json& hints = j["hiddenHints"]; hints.size() > 0) {
+ p.hiddenHints.clear();
+ for (size_t i = 0; i < hints.size() && i < 64; ++i)
+ if (hints[i].isString() && hints[i].asString().size() < 64) p.hiddenHints.insert(hints[i].asString());
+ }
if (const Json& bg = j["backgroundColor"]; bg.size() == 3)
for (int i = 0; i < 3; ++i) p.backgroundColor[i] = std::clamp(float(bg[size_t(i)].asNumber(p.backgroundColor[i])), 0.0f, 1.0f);
}
@@ -855,6 +874,76 @@ std::string App::layoutKey() const {
return toJson(l).dump();
}
+// ---------------------------------------------------------------------------
+// Viewport hints (U11): every note shown over the 3D view goes through here, with its Don't show again
+// ---------------------------------------------------------------------------
+
+namespace {
+struct HintInfo {
+ const char* id;
+ const char* name; // as Preferences > Hints lists it
+};
+constexpr HintInfo kHints[] = {
+ {"air_strokes", "Strokes start off the model"},
+ {"lod_preview", "Previewing an LOD"},
+ {"face_landmarks", "Face landmark steps"},
+};
+} // namespace
+
+bool App::hintShown(const char* id) const {
+ return uiPrefs_.showHints && !uiPrefs_.hiddenHints.count(id);
+}
+
+void App::drawViewportHint(const char* id, const char* text, ImU32 colour, float top) {
+ if (!hintShown(id)) return;
+ const CanvasRect c = canvasRect();
+ const float s = uiScale_;
+ ImGui::SetNextWindowPos(ImVec2(c.x + c.w * 0.5f, top), ImGuiCond_Always, ImVec2(0.5f, 0.0f));
+ ImGui::SetNextWindowBgAlpha(0.72f);
+ ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(8.0f * s, 4.0f * s));
+ ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f);
+ ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, theme::rounding(4.0f * s));
+ const ImGuiWindowFlags flags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings |
+ ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoMove;
+ const std::string window = std::string("##hint.") + id;
+ if (ImGui::Begin(window.c_str(), nullptr, flags)) {
+ ImGui::AlignTextToFramePadding();
+ ImGui::PushStyleColor(ImGuiCol_Text, ImGui::ColorConvertU32ToFloat4(colour));
+ ImGui::TextUnformatted(text);
+ ImGui::PopStyleColor();
+ ImGui::SameLine(0.0f, 12.0f * s);
+ const std::string button = std::string(tr("Don't show again")) + "##hint." + id;
+ if (ImGui::SmallButton(button.c_str())) {
+ uiPrefs_.hiddenHints.insert(id);
+ status_ = "Hint hidden (Preferences > Hints shows it again; Store Config keeps it)";
+ }
+ }
+ ImGui::End();
+ ImGui::PopStyleVar(3);
+}
+
+void App::drawHintsSection() {
+ ui::Checkbox("Show hints in the viewport##hints.show", &uiPrefs_.showHints);
+ ui::HelpText("Show hints in the viewport", nullptr,
+ "The short notes SculptForge shows over the 3D view (a mode that is on, the next step of a tool). Off "
+ "hides them all; each also has its own Don't show again. Store Config keeps it.",
+ "Preferences > Hints");
+ ImGui::BeginDisabled(!uiPrefs_.showHints);
+ for (const HintInfo& h : kHints) {
+ bool on = !uiPrefs_.hiddenHints.count(h.id);
+ const std::string label = std::string(tr(h.name)) + "##hints." + h.id;
+ if (ui::Checkbox(label.c_str(), &on)) {
+ if (on) uiPrefs_.hiddenHints.erase(h.id);
+ else uiPrefs_.hiddenHints.insert(h.id);
+ }
+ }
+ ImGui::EndDisabled();
+ if (ImGui::Button(tr("Show all hints again##hints.reset"), ImVec2(-FLT_MIN, 0))) {
+ uiPrefs_.showHints = true;
+ uiPrefs_.hiddenHints.clear();
+ }
+}
+
void App::watchLayoutChanges() {
if (layoutHintShown_ || uiConfigDeterministic_ || ++layoutCheckFrame_ % 20 != 0) return;
if (layoutKey() == layoutBaseline_) return;
@@ -1001,6 +1090,7 @@ void App::drawHelpConsoleUi() {
ImGui::PopStyleVar(3);
}
watchLayoutChanges();
+ ui::DragScrollPanels(); // #100: pen and middle drags scroll panels (after every window)
ui::DrawHelp(*this); // last: on top of everything
}
@@ -1134,19 +1224,6 @@ void drawInterfaceSection(App& app) {
"Clay Block...) stay as they are. Store Config keeps it for the next start.",
"Preferences > Interface");
}
- // Viewport cursor (#73).
- ImGui::AlignTextToFramePadding();
- ImGui::TextUnformatted(tr("Viewport cursor"));
- const char* const kCursors[] = {"Crosshair##viewport_cursor", "Arrow##viewport_cursor"};
- for (int i = 0; i < 2; ++i) {
- ImGui::SameLine();
- if (ImGui::RadioButton(tr(kCursors[i]), p.viewportCursor == i)) p.viewportCursor = i;
- ui::HelpText("Viewport cursor", nullptr,
- "The pointer over the 3D view: a crosshair (the default, as in most sculpting apps) or the arrow. "
- "Panels, menus and popups always show the arrow (or their own resize and text cursors). Store "
- "Config keeps it.",
- "Preferences > Interface");
- }
ImGui::Checkbox(tr("Popup Info (Ctrl+hover help)"), &p.popupInfo);
ui::HelpText("Popup Info", nullptr,
"Hold Ctrl and point at any control to see what it does and its shortcut. Ctrl+Alt shows a command's "
@@ -1321,6 +1398,48 @@ void drawLightBoxSection(App& app) {
} // namespace config
+namespace config {
+
+looks::Palette classicPalette() {
+ return {0x121212, 0x1c1c1c, 0x232323, 0x2c2c2c, 0x393939, 0x505050, 0x8d8d8d, 0xb6b6b6, 0xd8d8d8, 0xf2f2f2, 0xf0882e,
+ 0xf0882e, 0xe5604a, 0x9ece6a, 0xe0af68, false};
+}
+
+void drawLookMiniature(ImDrawList* dl, ImVec2 a, ImVec2 b, const looks::Palette& pal, const char* name, ImFont* font,
+ float s, int layout) {
+ auto col = [](unsigned hex) { return theme::u32(theme::rgb(hex)); };
+ dl->AddRectFilled(a, b, col(pal.crust));
+ const float g = 3.0f * s;
+ float top = a.y + g;
+ if (layout == 0) { // the palette bar: a row of short words
+ for (float x = a.x + g + 2.0f * s; x < b.x - g - 14.0f * s; x += 13.0f * s)
+ dl->AddRectFilled(ImVec2(x, top + 2.0f * s), ImVec2(x + 9.0f * s, top + 4.0f * s), col(pal.overlay));
+ top += 7.0f * s;
+ }
+ // The bar (the status bar with its menus, or the top shelf), its accent marking the current tool.
+ const float barH = (layout == 0 ? 14.0f : 8.0f) * s;
+ dl->AddRectFilled(ImVec2(a.x + g, top), ImVec2(b.x - g, top + barH), col(pal.mantle));
+ dl->AddRectFilled(ImVec2(a.x + g + 2.0f * s, top + 2.0f * s), ImVec2(a.x + g + 16.0f * s, top + 6.0f * s), col(pal.accent));
+ if (layout >= 0) // the shelf's tiles: one row, or two in the ZBrush-style layout
+ for (int row = 0; row < (layout == 0 ? 2 : 1); ++row)
+ for (float x = a.x + g + 22.0f * s; x < b.x - g - 8.0f * s; x += 9.0f * s)
+ dl->AddRectFilled(ImVec2(x, top + 2.0f * s + float(row) * 6.0f * s), ImVec2(x + 6.0f * s, top + 6.0f * s + float(row) * 6.0f * s),
+ col(pal.surface1));
+ top += barH + g;
+ dl->AddRectFilled(ImVec2(a.x + g, top), ImVec2(b.x - g - 30.0f * s, b.y - g), col(pal.base));
+ dl->AddRectFilled(ImVec2(b.x - g - 26.0f * s, top), ImVec2(b.x - g, b.y - g), col(pal.base));
+ dl->AddRectFilled(ImVec2(b.x - g - 22.0f * s, b.y - g - 8.0f * s), ImVec2(b.x - g - 4.0f * s, b.y - g - 4.0f * s), col(pal.accent2));
+ if (layout >= 0) { // a sphere in the view, so the colours read around a model
+ const ImVec2 c((a.x + b.x - 30.0f * s) * 0.5f, (top + b.y) * 0.5f);
+ const float r = std::min(b.x - a.x, b.y - top) * 0.2f;
+ dl->AddCircleFilled(c, r, col(0x8a8a8e));
+ dl->AddCircleFilled(ImVec2(c.x - r * 0.3f, c.y - r * 0.3f), r * 0.55f, col(0xb0b0b4));
+ }
+ if (!font) font = ImGui::GetFont();
+ dl->AddText(font, font->FontSize, ImVec2(a.x + g + 6.0f * s, b.y - g - font->FontSize - 3.0f * s), col(pal.text), name);
+}
+
+} // namespace config
// Preferences > Interface > Look: four looks as swatch cards, the look's own options, and the layout.
void App::drawLookSection() {
@@ -1342,26 +1461,14 @@ void App::drawLookSection() {
} else if (id == looks::LookId::Blueprint) {
pal = looks::blueprintPalette();
} else {
- pal = {0x111113, 0x1b1b1d, 0x222225, 0x2b2b2f, 0x37373c, 0x4e4e55, 0x8c8c90, 0xb4b4b9, 0xd8d8d8, 0xf2f2f2, 0xf0882e,
- 0xf0882e, 0xe5604a, 0x9ece6a, 0xe0af68, false};
+ pal = config::classicPalette();
}
const std::string label = std::string(looks::lookName(id)) + "##look." + looks::lookKey(id);
const bool clicked = ImGui::InvisibleButton(label.c_str(), ImVec2(cardW, cardH));
const bool hovered = ImGui::IsItemHovered(), current = l.look == i;
const ImVec2 a = ImGui::GetItemRectMin(), b = ImGui::GetItemRectMax();
ImDrawList* dl = ImGui::GetWindowDrawList();
- auto col = [](unsigned hex) { return theme::u32(theme::rgb(hex)); };
- // A miniature of the look: its wallpaper, a bar with its accent, two tiles, its name in its text colour.
- dl->AddRectFilled(a, b, col(pal.crust));
- const float g = 3.0f * s;
- dl->AddRectFilled(ImVec2(a.x + g, a.y + g), ImVec2(b.x - g, a.y + g + 8.0f * s), col(pal.mantle));
- dl->AddRectFilled(ImVec2(a.x + g + 2.0f * s, a.y + g + 2.0f * s), ImVec2(a.x + g + 16.0f * s, a.y + g + 6.0f * s), col(pal.accent));
- dl->AddRectFilled(ImVec2(a.x + g, a.y + 2.0f * g + 8.0f * s), ImVec2(b.x - g - 30.0f * s, b.y - g), col(pal.base));
- dl->AddRectFilled(ImVec2(b.x - g - 26.0f * s, a.y + 2.0f * g + 8.0f * s), ImVec2(b.x - g, b.y - g), col(pal.base));
- dl->AddRectFilled(ImVec2(b.x - g - 22.0f * s, b.y - g - 8.0f * s), ImVec2(b.x - g - 4.0f * s, b.y - g - 4.0f * s), col(pal.accent2));
- ImFont* f = i == int(looks::LookId::Classic) ? fontInterSmall_ : fontMonoSmall_;
- if (!f) f = ImGui::GetFont();
- dl->AddText(f, f->FontSize, ImVec2(a.x + g + 6.0f * s, b.y - g - f->FontSize - 3.0f * s), col(pal.text), looks::lookName(id));
+ config::drawLookMiniature(dl, a, b, pal, looks::lookName(id), i == int(looks::LookId::Classic) ? fontInterSmall_ : fontMonoSmall_, s);
dl->AddRect(a, b, theme::u32(current ? theme::accent : hovered ? theme::textDim : theme::tileBorder), 0.0f, 0,
current ? 2.0f * s : 1.0f * s);
ImGui::LogText("%s", looks::lookName(id));
@@ -1429,6 +1536,35 @@ void App::drawLookSection() {
"Faint scanlines and a glow around the focused panel, on the interface only (never on the 3D view). Off by default.",
"Preferences > Interface > Look");
}
+ if (l.look != int(looks::LookId::Classic)) { // the tiled looks' panel borders (Classic has none to speak of)
+ ImGui::AlignTextToFramePadding();
+ ImGui::TextUnformatted(tr("Outlines"));
+ const char* const kOutlines[] = {"Off##look.outlines", "Subtle##look.outlines", "On##look.outlines"};
+ for (int i = 0; i < 3; ++i) {
+ ImGui::SameLine();
+ if (ImGui::RadioButton(tr(kOutlines[i]), l.outlines == i)) {
+ l.outlines = i;
+ lookDirty_ = true;
+ }
+ ui::HelpText("Outlines", nullptr,
+ "The borders around the panels in Forge Terminal, Phosphor and Blueprint. Subtle (the default): "
+ "faint, and nothing lights up under the pointer. Off: no borders, the gaps alone separate the "
+ "panels. On: clear borders, the panel under the pointer a faint step lighter.",
+ "Preferences > Interface > Look");
+ }
+ ImGui::BeginDisabled(l.outlines == 0);
+ float opacity = l.outlineOpacity * 100.0f;
+ ImGui::SetNextItemWidth(-FLT_MIN);
+ if (ui::SliderInside("##look.outline_opacity", &opacity, 0.0f, 100.0f, "Outline opacity %.0f%%")) {
+ l.outlineOpacity = std::clamp(opacity / 100.0f, 0.0f, 1.0f);
+ lookDirty_ = true;
+ }
+ ImGui::EndDisabled();
+ ui::HelpText("Outline opacity", nullptr,
+ "How strong the panel borders are (0-100%), on top of Outlines: 100% draws them as Subtle or On "
+ "does, lower fades them into the panels (#98). Ctrl+click to type.",
+ "Preferences > Interface > Look");
+ }
ImGui::AlignTextToFramePadding();
ImGui::TextUnformatted(tr("Layout"));
ImGui::SameLine();
diff --git a/src/app/Config.h b/src/app/Config.h
index 72e0a278..7fa99094 100644
--- a/src/app/Config.h
+++ b/src/app/Config.h
@@ -8,11 +8,13 @@
// Load UI (Ctrl+L) share a layout as a file.
#pragma once
+#include "app/LookSchemes.h"
#include "app/Theme.h"
#include "core/Json.h"
#include "core/SpaceMouse.h"
#include "core/Tablet.h"
+#include <set>
#include <string>
namespace sf {
@@ -56,6 +58,11 @@ struct UiPrefs {
// reaches the surface instead of turning the view (off: it turns the view, ZBrush)
bool showAxes = true; // Draw > Camera > Axes: the X / Y / Z gizmo in the canvas corner (#31)
bool cursorFollowsSurface = true; // the brush ring lies on the surface under the pointer, as in SculptGL (#25)
+ bool hideRingWhileStroking = false; // Preferences > Cursor (#88): only the centre dot while a stroke runs
+ // Preferences > Hints (U11): the notes SculptForge shows over the 3D view. Each has Don't show again, which
+ // adds its id here; showHints off hides them all.
+ bool showHints = true;
+ std::set<std::string> hiddenHints;
// Preferences > Interface > Timeline position (#63): the Sculpt Timeline strip along the top of the viewport
// (true, the default: clear of the brush shelf below it) or its bottom.
bool timelineTop = true;
@@ -66,7 +73,7 @@ struct UiPrefs {
theme::LookSettings look;
int shellLayout = 1;
bool lookSaved = false; // ui.json named the look or layout (not saved itself); one from before 0.10.7 didn't
- // Preferences > Interface > Viewport cursor (#73): the system cursor over the 3D view, 0 = crosshair (the
+ // Preferences > Cursor > Viewport cursor (#73): the system cursor over the 3D view, 0 = crosshair (the
// default, as most sculpting apps), 1 = the arrow. Panels, menus and popups always show their own.
int viewportCursor = 0;
// Tool > Display > Backface culling (#68): skip the back faces of every Part (faster on dense meshes; see
@@ -91,7 +98,7 @@ struct UiPrefs {
bool flatShading = false; // Material palette: the scene's shading at startup (false = Smooth, the default)
// Preferences > Display: the view's background (#21), a gradient or a flat display (sRGB) colour.
bool gradientBackground = true;
- glm::vec3 backgroundColor{0.165f, 0.165f, 0.173f};
+ glm::vec3 backgroundColor{0.168f, 0.168f, 0.168f};
// File > Maya (#42). Kept in <prefs>/maya.json, never in ui.json, so a shared UI layout can't point the bridge
// at a folder: it is set only by the user's own pick (App::setMayaFolder).
std::string mayaFolder; // "" = the bridge is off
@@ -111,6 +118,13 @@ void drawConfigSection(App& app); // Enable Customize, Store / Restore / Save
void drawInterfaceSection(App& app); // UI scale, Popup Info, tooltips, sub-palettes, left-handed layout
void drawHotkeysSection(App& app); // every action's shortcut, click to reassign
void drawLightBoxSection(App& app); // show at startup, rows, placement, library folder
+// The Classic look's colours as a Palette (for its card; the look itself uses Theme.h's tokens).
+looks::Palette classicPalette();
+// A miniature of a look on its card, from a to b: its wallpaper, a bar with its accent, two tiles and `name` in its
+// text colour. `layout` 0 adds the ZBrush-style palette bar and two-row shelf, 1 the SculptForge menus and one-row
+// shelf (the first-run look picker); -1 neither (Preferences > Interface > Look).
+void drawLookMiniature(ImDrawList* dl, ImVec2 a, ImVec2 b, const looks::Palette& pal, const char* name, ImFont* font,
+ float s, int layout = -1);
} // namespace config
} // namespace sf
diff --git a/src/app/Demo.h b/src/app/Demo.h
index 075ab826..95c79b25 100644
--- a/src/app/Demo.h
+++ b/src/app/Demo.h
@@ -134,6 +134,7 @@ private:
ImVec2 mouse_{960, 540};
bool buttonDown_ = false;
bool buttonHeld_ = false; // orbit: right button pressed
+ int dragCursor_ = -1; // the system cursor at the end of the last button_drag, before letting go
struct Caption {
std::string title, subtitle;
diff --git a/src/app/I18nSpanish.cpp b/src/app/I18nSpanish.cpp
index 64f74029..b3253fb4 100644
--- a/src/app/I18nSpanish.cpp
+++ b/src/app/I18nSpanish.cpp
@@ -576,6 +576,19 @@ constexpr Entry kSpanish[] = {
{"Strokes start off the model", "Los trazos empiezan fuera del modelo"},
{"Toggle strokes off the model", "Activar trazos fuera del modelo"},
{"Cursor follows surface", "El cursor sigue la superficie"},
+ {"Hide ring while stroking", "Ocultar el anillo al trazar"},
+ {"Outlines", "Contornos"},
+ {"Don't show again", "No volver a mostrar"},
+ {"Hints", "Pistas"},
+ {"Show hints in the viewport", "Mostrar pistas en el visor"},
+ {"Show all hints again", "Volver a mostrar todas las pistas"},
+ {"Previewing an LOD", "Vista previa de un LOD"},
+ {"Face landmark steps", "Pasos de los puntos de la cara"},
+ {"Subtle", "Sutil"},
+ {"Outline opacity", "Opacidad de los contornos"},
+ {"Viewport cursor", "Cursor del visor"},
+ {"Crosshair", "Cruz"},
+ {"Arrow", "Flecha"},
{"Import Blender keymap", "Importar atajos de Blender"},
{"Quick Menu", "Menú rápido"},
diff --git a/src/app/Input.cpp b/src/app/Input.cpp
index 2ab4aec6..9c89b904 100644
--- a/src/app/Input.cpp
+++ b/src/app/Input.cpp
@@ -92,6 +92,30 @@ void App::registerInputActions() {
"Lazy Stroke on or off: the brush trails the cursor on a string, for steady lines.",
[this] { strokeType_ = strokeType_ == StrokeType::LazyMouse ? StrokeType::Dots : StrokeType::LazyMouse; },
[this] { return strokeType_ == StrokeType::LazyMouse; });
+ // One action per stroke type (U13): the Strokes radial menu (J) and the command palette pick them directly.
+ {
+ static const char* const keys[] = {"dots", "drag_stamp", "slide_stamp", "spray", "lazy"};
+ static const char* const glyphs[] = {ICON_LC_ELLIPSIS, ICON_LC_SQUARE_DASHED_MOUSE_POINTER, ICON_LC_MOUSE_POINTER_2,
+ ICON_LC_SPRAY_CAN, ICON_LC_SPLINE_POINTER};
+ static const char* const help[] = {
+ "Stroke type Dots: even dabs along the path, the classic brush stroke.",
+ "Stroke type Drag Stamp: click and drag one stamp; the drag sets its size and rotation.",
+ "Stroke type Slide Stamp: drag one stamp of the brush's Draw Size over the surface; it lands where you let go.",
+ "Stroke type Spray: scattered dabs of random size and strength, for organic texture.",
+ "Stroke type Lazy Stroke: the brush trails the cursor on a string, for smooth, steady lines.",
+ };
+ static_assert(std::size(keys) == size_t(StrokeType::Count));
+ for (int i = 0; i < int(StrokeType::Count); ++i) {
+ const StrokeType type = StrokeType(i);
+ const std::string id = std::string("stroke.type.") + keys[i];
+ add(id.c_str(), strokeTypeName(type), glyphs[i], "Stroke", "", help[i],
+ [this, type] {
+ strokeType_ = type;
+ status_ = std::string("Stroke: ") + strokeTypeName(type);
+ },
+ [this, type] { return strokeType_ == type; });
+ }
+ }
add("stroke.continuous", "Continuous", ICON_LC_REPEAT, "Stroke", "",
"Continuous on or off: while you hold the brush still on the model it keeps adding, 30 dabs a second "
"(build up a bump without moving). Not for Move, Tendril or the drag strokes.",
@@ -171,13 +195,19 @@ void App::registerInputActions() {
: "Strokes off the model: off (a drag on the background turns the view)";
},
[this] { return uiPrefs_.airStrokes; });
- add("input.surface_cursor", "Cursor follows surface", nullptr, "Preferences > Input", "",
- "The brush ring lies on the model under the pointer, turned to the surface and pressed onto its bumps, at "
- "the brush's real size there (as in SculptGL), with a short line along the surface's direction. With "
- "symmetry on, the mirrored ring shows too. Off the model, and with this off, the ring is a flat circle on "
- "the screen.",
+ add("input.surface_cursor", "Cursor follows surface", nullptr, "Preferences > Cursor", "",
+ "The brush ring lies on the model under the pointer: a circle at the brush's real size there, turned to the "
+ "form of the surface (averaged over the brush, so fine bumps don't make it wobble), with a short line along "
+ "the surface's direction. With symmetry on, a dot shows where each mirrored or radial copy lands. Off the "
+ "model, and with this off, the ring is a flat circle on the screen.",
[this] { uiPrefs_.cursorFollowsSurface = !uiPrefs_.cursorFollowsSurface; },
[this] { return uiPrefs_.cursorFollowsSurface; });
+ add("cursor.hide_ring_stroking", "Hide ring while stroking", nullptr, "Preferences > Cursor", "",
+ "While a stroke runs, show only the dot where the brush touches (and the symmetry dots), not the ring: "
+ "nothing between you and the surface you are shaping. Off by default: the ring shows the brush size "
+ "throughout.",
+ [this] { uiPrefs_.hideRingWhileStroking = !uiPrefs_.hideRingWhileStroking; },
+ [this] { return uiPrefs_.hideRingWhileStroking; });
add("input.import_blender", "Import Blender keymap...", ICON_LC_FILE_INPUT, "Preferences > Input", "",
"Use the keys from a keymap you exported in Blender (Preferences > Keymap > Export, a .py file). Switches "
"to the Blender style, then takes the navigation and sculpt keys SculptForge has an equivalent for. The "
@@ -474,10 +504,6 @@ void App::drawInputSection() {
bool airStrokes = uiPrefs_.airStrokes;
if (ui::Checkbox("Start strokes off the model##input.air_strokes", &airStrokes)) uiPrefs_.airStrokes = airStrokes;
ui::HelpAction(*this, "input.air_strokes");
- bool surfaceCursor = uiPrefs_.cursorFollowsSurface;
- if (ui::Checkbox("Cursor follows surface##input.surface_cursor", &surfaceCursor))
- uiPrefs_.cursorFollowsSurface = surfaceCursor;
- ui::HelpAction(*this, "input.surface_cursor");
ui::ActionButton(*this, "input.import_blender", ImVec2(-FLT_MIN, 0), ui::Look::IconLabel);
drawPackKeymapRows(); // keymaps from installed packs (PanelPacks.cpp)
ImGui::TextDisabled("%s", tr("Rotation"));
@@ -494,6 +520,29 @@ void App::drawInputSection() {
drawSpaceMouseSection(); // SpaceMouse.cpp
}
+// Preferences > Cursor (#88): the system cursor over the view and the brush ring.
+void App::drawCursorSection() {
+ ImGui::AlignTextToFramePadding();
+ ImGui::TextUnformatted(tr("Viewport cursor"));
+ const char* const kCursors[] = {"Crosshair##viewport_cursor", "Arrow##viewport_cursor"};
+ for (int i = 0; i < 2; ++i) {
+ ImGui::SameLine();
+ if (ImGui::RadioButton(tr(kCursors[i]), uiPrefs_.viewportCursor == i)) uiPrefs_.viewportCursor = i;
+ ui::HelpText("Viewport cursor", nullptr,
+ "The pointer over the 3D view: a crosshair (the default, as in most sculpting apps; it stays "
+ "while the view turns) or the arrow. Panels, menus and popups always show the arrow (or their "
+ "own resize and text cursors). Store Config keeps it.",
+ "Preferences > Cursor");
+ }
+ bool surfaceCursor = uiPrefs_.cursorFollowsSurface;
+ if (ui::Checkbox("Cursor follows surface##input.surface_cursor", &surfaceCursor))
+ uiPrefs_.cursorFollowsSurface = surfaceCursor;
+ ui::HelpAction(*this, "input.surface_cursor");
+ bool hideRing = uiPrefs_.hideRingWhileStroking;
+ if (ui::Checkbox("Hide ring while stroking##cursor.hide_ring_stroking", &hideRing)) uiPrefs_.hideRingWhileStroking = hideRing;
+ ui::HelpAction(*this, "cursor.hide_ring_stroking");
+}
+
void App::drawZIntensitySlider(const char* id) {
const bool smooth = activeBrush() == BrushType::Smooth && drag_ != Drag::Stroke;
float& value = smooth ? smoothStrength_ : strength_;
@@ -709,15 +758,9 @@ void App::airStrokeRelease() {
void App::drawAirStrokeIndicator() {
if (!uiPrefs_.airStrokes) return;
- const CanvasRect c = canvasRect();
- const char* text = tr("Strokes start off the model");
- const ImVec2 size = ImGui::CalcTextSize(text);
- const float pad = 6.0f * uiScale_;
- const ImVec2 at(c.x + (c.w - size.x) * 0.5f, c.y + timelineTopInset_ + 10.0f * uiScale_); // (below a top timeline)
- ImDrawList* dl = ImGui::GetForegroundDrawList();
- dl->AddRectFilled(ImVec2(at.x - pad, at.y - pad * 0.5f), ImVec2(at.x + size.x + pad, at.y + size.y + pad * 0.5f),
- IM_COL32(0, 0, 0, 110), 4.0f * uiScale_);
- dl->AddText(at, theme::u32(theme::accent), text);
+ // (below a top timeline; Don't show again and Preferences > Hints hide it, U11)
+ drawViewportHint("air_strokes", tr("Strokes start off the model"), theme::u32(theme::accent),
+ canvasRect().y + timelineTopInset_ + 8.0f * uiScale_);
}
} // namespace sf
diff --git a/src/app/LookSchemes.cpp b/src/app/LookSchemes.cpp
index 5ac72746..f433070d 100644
--- a/src/app/LookSchemes.cpp
+++ b/src/app/LookSchemes.cpp
@@ -20,6 +20,11 @@ constexpr const char* kLookNames[] = {"Classic", "Forge Terminal", "Phosphor", "
// yellow. Values from each scheme's published palette; crust and mantle are darkened from its background where the
// scheme has fewer background steps.
const SchemeInfo kSchemes[] = {
+ // SculptForge's own (0.10.9, the default): neutral greys, so the model's colours read true, and one accent,
+ // the logo's orange. accent2 stays grey: one hue in the whole interface.
+ {"neutral", "Neutral", "SculptForge (original)", "GPL-3.0-or-later",
+ {0x111111, 0x191919, 0x202020, 0x2b2b2b, 0x363636, 0x494949, 0x777777, 0xaaaaaa, 0xd7d7d7, 0xf2f2f2, 0xf0882e,
+ 0xaaaaaa, 0xe5604a, 0x8cbf6a, 0xe0b050, false}},
{"tokyo_night", "Tokyo Night", "github.com/enkia/tokyo-night-vscode-theme", "MIT",
{0x101118, 0x16161e, 0x1a1b26, 0x232535, 0x292e42, 0x414868, 0x6a73a0, 0xa9b1d6, 0xc0caf5, 0xdfe5ff, 0x7aa2f7,
0xbb9af7, 0xf7768e, 0x9ece6a, 0xe0af68, false}},
diff --git a/src/app/LookSchemes.h b/src/app/LookSchemes.h
index 9657195e..55b47fa3 100644
--- a/src/app/LookSchemes.h
+++ b/src/app/LookSchemes.h
@@ -30,14 +30,14 @@ struct Palette {
};
struct SchemeInfo {
- const char* key; // "tokyo_night"
+ const char* key; // "neutral", "tokyo_night"
const char* name; // "Tokyo Night"
const char* source; // where the colours come from
const char* license; // its licence (THIRD_PARTY_NOTICES.md)
Palette palette;
};
-// Forge Terminal's schemes, Tokyo Night first (the default).
+// Forge Terminal's schemes, Neutral first (the default since 0.10.9; Tokyo Night was before).
const SchemeInfo* schemes(int& count);
const SchemeInfo* findScheme(std::string_view key); // nullptr when unknown
diff --git a/src/app/Palettes.cpp b/src/app/Palettes.cpp
index 36025693..bf8ecbe8 100644
--- a/src/app/Palettes.cpp
+++ b/src/app/Palettes.cpp
@@ -560,6 +560,14 @@ void App::drawPalette_Preferences() {
tray::Section section;
drawInputSection();
}
+ if (subpalette("preferences.cursor", "Cursor")) {
+ tray::Section section;
+ drawCursorSection();
+ }
+ if (subpalette("preferences.hints", "Hints")) {
+ tray::Section section;
+ drawHintsSection();
+ }
if (subpalette("preferences.hotkeys", "Hotkeys")) {
tray::Section section;
config::drawHotkeysSection(*this);
diff --git a/src/app/PanelFace.cpp b/src/app/PanelFace.cpp
index a1bcd1db..8205421b 100644
--- a/src/app/PanelFace.cpp
+++ b/src/app/PanelFace.cpp
@@ -274,11 +274,7 @@ void App::drawFaceOverlay() {
std::snprintf(banner, sizeof banner, "Landmark %d/8: click the %s (the character's own side; its right is on "
"your left from the front)",
facePlaceIndex_ + 1, faceLandmarkLabel(facePlaceIndex_));
- const ImVec2 size = ImGui::CalcTextSize(banner);
- const ImVec2 at(cr.x + (cr.w - size.x) * 0.5f, cr.y + timelineTopInset_ + 12.0f * s);
- dl->AddRectFilled(ImVec2(at.x - 8 * s, at.y - 4 * s), ImVec2(at.x + size.x + 8 * s, at.y + size.y + 4 * s),
- IM_COL32(20, 20, 24, 210), 4.0f * s);
- dl->AddText(at, IM_COL32(255, 196, 64, 255), banner);
+ drawViewportHint("face_landmarks", banner, IM_COL32(255, 196, 64, 255), cr.y + timelineTopInset_ + 8.0f * s);
}
dl->PopClipRect();
}
diff --git a/src/app/PanelSupport.cpp b/src/app/PanelSupport.cpp
index 4ebbbcd4..653cbd1c 100644
--- a/src/app/PanelSupport.cpp
+++ b/src/app/PanelSupport.cpp
@@ -5,12 +5,14 @@
// the one optional reminder after ten hours of sculpting. Each only opens kSupportUrl in the browser (Support.h);
// the app is the same for everyone, so nothing here checks, sends or stores anything else.
#include "app/App.h"
+#include "app/Config.h"
#include "app/LookSchemes.h"
#include "app/Theme.h"
#include <imgui.h>
#include <algorithm>
+#include <cmath>
#include <string>
#include <string_view>
#include <vector>
@@ -79,72 +81,115 @@ void App::chooseNewLook(bool tryIt) {
newLookCardDone_ = true;
if (tryIt) {
uiPrefs_.look.look = int(looks::LookId::ForgeTerminal);
- uiPrefs_.look.scheme = "tokyo_night";
+ uiPrefs_.look.scheme = "neutral";
uiPrefs_.look.matchOmarchy = false;
setShellLayout(1);
lookDirty_ = true;
- status_ = "The new look: Forge Terminal, SculptForge layout (Preferences > Interface > Look changes it)";
+ status_ = "The new look: Neutral, SculptForge layout (Preferences > Interface > Look changes it)";
} else {
status_ = "Kept your layout (Preferences > Interface > Look has the new look)";
}
saveProjectPrefs();
}
+// The first-run look picker (the welcome): Neutral (the default), Forge Terminal with Tokyo Night (0.10.7's
+// default), or the Classic look with the ZBrush-style layout. A click applies it at once and remembers it.
+void App::drawLookPicker() {
+ struct Choice {
+ const char* label;
+ const char* name;
+ int look;
+ const char* scheme;
+ int layout;
+ const char* help;
+ };
+ static const Choice kChoices[] = {
+ {"##welcome.look.neutral", "Neutral", int(looks::LookId::ForgeTerminal), "neutral", 1,
+ "Neutral grey panels, so your model's colours read true, with one orange accent. The SculptForge layout."},
+ {"##welcome.look.forge", "Forge Terminal", int(looks::LookId::ForgeTerminal), "tokyo_night", 1,
+ "Terminal-style tiles in the Tokyo Night colours (blue-grey). Preferences > Interface > Look has more schemes."},
+ {"##welcome.look.zbrush", "ZBrush-style layout", int(looks::LookId::Classic), "neutral", 0,
+ "The Classic grey look with the alphabetical palette bar and the two-row top shelf, for ZBrush users."},
+ };
+ const float s = uiScale_, spacing = ImGui::GetStyle().ItemSpacing.x;
+ const float w = std::floor((ImGui::GetContentRegionAvail().x - 2.0f * spacing) / 3.0f), h = 92.0f * s;
+ for (int i = 0; i < 3; ++i) {
+ const Choice& c = kChoices[i];
+ if (i) ImGui::SameLine();
+ const bool current = uiPrefs_.look.look == c.look && uiPrefs_.shellLayout == c.layout &&
+ (c.look != int(looks::LookId::ForgeTerminal) || uiPrefs_.look.scheme == c.scheme);
+ const bool clicked = ImGui::InvisibleButton(c.label, ImVec2(w, h));
+ const bool hovered = ImGui::IsItemHovered();
+ const ImVec2 a = ImGui::GetItemRectMin(), b = ImGui::GetItemRectMax();
+ ImDrawList* dl = ImGui::GetWindowDrawList();
+ const looks::SchemeInfo* scheme = looks::findScheme(c.scheme);
+ const looks::Palette pal = c.look == int(looks::LookId::Classic) || !scheme ? config::classicPalette() : scheme->palette;
+ config::drawLookMiniature(dl, a, b, pal, c.name, c.look == int(looks::LookId::Classic) ? fontInterSmall_ : fontMonoSmall_, s,
+ c.layout);
+ if (hovered && !current) dl->AddRectFilled(a, b, theme::u32(theme::textHover, 0.05f)); // (a faint lift, no border)
+ if (current) dl->AddRect(a, b, theme::u32(theme::accent), 0.0f, 0, 2.0f * s);
+ ImGui::LogText("%s", c.name);
+ if (hovered) ImGui::SetTooltip("%s", c.help);
+ if (clicked && !current) {
+ uiPrefs_.look.look = c.look;
+ uiPrefs_.look.scheme = c.scheme;
+ uiPrefs_.look.matchOmarchy = false;
+ setShellLayout(c.layout);
+ lookDirty_ = true;
+ saveProjectPrefs(); // remembered for the next start, also without Store Config
+ status_ = std::string("Look: ") + c.name + " (Preferences > Interface > Look changes it)";
+ }
+ }
+}
+
void App::drawSupportUi() {
const float s = uiScale_;
const CanvasRect c = canvasRect();
if (showWelcome_) {
// Not modal: the app works around it, and it doesn't come back once closed.
ImGui::SetNextWindowPos(ImVec2(c.x + c.w * 0.5f, c.y + c.h * 0.3f), ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));
- ImGui::SetNextWindowSize(ImVec2(440.0f * s, 0.0f), ImGuiCond_Appearing);
+ ImGui::SetNextWindowSize(ImVec2(500.0f * s, 0.0f), ImGuiCond_Appearing);
const ImGuiWindowFlags flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoResize;
if (ImGui::Begin("Welcome to SculptForge", &showWelcome_, flags)) {
ImGui::TextWrapped("Hold Ctrl over any control to see what it does. The User Guide (Shift+F1) explains every "
"tool, and Coming from ZBrush lists what is where.");
- // The keys to start with (Preferences > Input changes them later; Store Config keeps them).
+ // The look (0.10.9, #U6): three cards, the first the default. Existing installs never see this window
+ // unless they open Help > Welcome, so nobody's look changes by itself.
+ ImGui::Spacing();
+ ImGui::TextUnformatted("Pick a look:");
+ drawLookPicker();
+ // Where you come from sets the keys and the layout together (Preferences > Input and > Interface > Look
+ // change them later; both are remembered without Store Config).
ImGui::Spacing();
ImGui::AlignTextToFramePadding();
ImGui::TextUnformatted("Coming from:");
struct Origin {
const char* label;
- int style;
+ int style, layout;
const char* help;
};
static const Origin kOrigins[] = {
- {"ZBrush##welcome.from", 0, "ZBrush-style keys and gestures."},
- {"Blender##welcome.from", 2, "Blender's navigation and sculpt-mode keys."},
- {"Maya##welcome.from", 3, "Maya's Alt+drag view controls."},
- {"New to sculpting##welcome.from", 1, "SculptForge's own keys (the default)."},
+ {"ZBrush##welcome.from", 0, 0, "ZBrush-style keys and gestures, and the ZBrush-style layout."},
+ {"Blender##welcome.from", 2, 1, "Blender's navigation and sculpt-mode keys, the SculptForge layout."},
+ {"Maya##welcome.from", 3, 1, "Maya's Alt+drag view controls, the SculptForge layout."},
+ {"New to sculpting##welcome.from", 1, 1, "SculptForge's own keys and layout (the default)."},
};
for (const Origin& o : kOrigins) {
ImGui::SameLine();
- const bool on = uiPrefs_.inputStyle == o.style;
+ const bool on = uiPrefs_.inputStyle == o.style && uiPrefs_.shellLayout == o.layout;
if (on) ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyleColorVec4(ImGuiCol_ButtonActive));
if (ImGui::Button(o.label)) {
setInputStyle(o.style);
startInputStyle_ = o.style; // kept for the next start, also without Store Config
+ setShellLayout(o.layout);
+ lookDirty_ = true;
saveProjectPrefs();
status_ = std::string("Keys: ") + (o.style == 0 ? "ZBrush-style" : o.style == 2 ? "Blender" : o.style == 3 ? "Maya" : "SculptForge") +
- " (Preferences > Input changes them)";
+ (o.layout == 0 ? ", ZBrush-style layout" : ", SculptForge layout") + " (Preferences changes them)";
}
if (on) ImGui::PopStyleColor();
if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", o.help);
}
- // The layout (Preferences > Interface > Look): new installs start in the SculptForge layout.
- ImGui::Spacing();
- const bool zbrushLayout = uiPrefs_.shellLayout == 0;
- ImGui::BeginDisabled(zbrushLayout);
- if (ImGui::Button(zbrushLayout ? "Using the ZBrush-style layout##welcome.layout"
- : "Coming from ZBrush? Use the ZBrush-style layout##welcome.layout")) {
- setShellLayout(0);
- lookDirty_ = true;
- saveProjectPrefs(); // remembered for the next start, also without Store Config
- status_ = "ZBrush-style layout (Preferences > Interface > Look switches back)";
- }
- ImGui::EndDisabled();
- if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled))
- ImGui::SetTooltip("The alphabetical palette bar and the two-row top shelf. Preferences > Interface > Look "
- "switches back to the SculptForge layout.");
ImGui::Spacing();
if (ImGui::Button("Open the User Guide##welcome")) {
guide_.open();
@@ -172,7 +217,7 @@ void App::drawSupportUi() {
ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoFocusOnAppearing;
bool open = true;
if (ImGui::Begin("SculptForge has a new look##newlook", &open, flags)) {
- ImGui::TextWrapped("Forge Terminal with the Tokyo Night colours, and the SculptForge layout: menus by task, a "
+ ImGui::TextWrapped("Neutral grey panels with one orange accent, and the SculptForge layout: menus by task, a "
"status bar and a one-row tool shelf. Your layout stays as it is unless you try it.");
ImGui::Spacing();
if (ImGui::Button("Try it##newlook")) chooseNewLook(true);
diff --git a/src/app/RadialMenu.cpp b/src/app/RadialMenu.cpp
index 35ab0836..fb5cc545 100644
--- a/src/app/RadialMenu.cpp
+++ b/src/app/RadialMenu.cpp
@@ -61,7 +61,7 @@ std::string radialActionId(int menu) { return "radial.menu" + std::to_string(men
ImVec4 col(ImU32 c) { return ImGui::ColorConvertU32ToFloat4(c); }
-const char* const kDefaultKeys[] = {"T", "Y"}; // free in every input style (tests/ui/radial_menu.sfui checks)
+const char* const kDefaultKeys[] = {"T", "Y", "J"}; // free in every input style (tests/ui/radial_menu.sfui checks)
} // namespace
@@ -76,7 +76,13 @@ std::vector<RadialMenu> App::defaultRadialMenus() {
for (const char* id : {"mask.invert", "mask.lasso", "mask.clear", "mask.rect", "mask.all", "mask.pen",
"view.mask", "polygroup.group_masked"})
masking.slots.push_back({id, std::string_view(id) == "view.mask" ? "View Mask" : "", ""}); // (its own: "Mask")
- return {brushes, masking};
+ // The stroke types on one ring (U13, as 3D-Coat's stroke pop-up; single ring, as every radial menu here).
+ RadialMenu strokes;
+ strokes.name = "Strokes";
+ for (const char* id : {"stroke.type.dots", "stroke.type.drag_stamp", "stroke.type.slide_stamp", "stroke.type.spray",
+ "stroke.type.lazy"})
+ strokes.slots.push_back({id, "", ""});
+ return {brushes, masking, strokes};
}
bool App::radialSlotAction(std::string_view id) const {
@@ -654,7 +660,7 @@ void App::drawRadialMenusSection() {
radialEdit_ = RadialEdit();
status_ = "Default radial menus restored - Store Config (Ctrl+Shift+I) keeps them";
}
- ui::HelpText("Restore default menus", nullptr, "Back to the two built-in menus: Brushes (T) and Masking (Y).", path);
+ ui::HelpText("Restore default menus", nullptr, "Back to the three built-in menus: Brushes (T), Masking (Y) and Strokes (J).", path);
ImGui::TextColored(col(ui::color::textDim), "Store Config keeps them");
}
diff --git a/src/app/Shell.cpp b/src/app/Shell.cpp
index e947616f..b51a4a2b 100644
--- a/src/app/Shell.cpp
+++ b/src/app/Shell.cpp
@@ -41,26 +41,29 @@ constexpr ImGuiWindowFlags kShellFlags = ImGuiWindowFlags_NoDecoration | ImGuiWi
const char* const kShelfWindows[kShelfCount] = {"##TopShelf", "##LeftShelf", "##RightShelf", "##BottomShelf"};
-CanvasRect g_focus; // the tile under the pointer this frame (tiled looks draw its border in the accent)
+CanvasRect g_focus; // the tile under the pointer this frame (Outlines on: its border a faint step lighter)
bool sameRect(const CanvasRect& a, const CanvasRect& b) {
return a.w > 0.0f && a.h > 0.0f && std::abs(a.x - b.x) < 0.5f && std::abs(a.y - b.y) < 0.5f && std::abs(a.w - b.w) < 0.5f &&
std::abs(a.h - b.h) < 0.5f;
}
-// A tiled look's frame around one region: a thin border (the accent on the focused tile), Blueprint's corner marks.
+// A tiled look's frame around one region: a thin border, Blueprint's corner marks.
void tileFrame(ImDrawList* dl, const CanvasRect& r, bool focused) {
- if (!theme::look.tiled || r.w <= 0.0f || r.h <= 0.0f) return;
+ // Outlines (Preferences > Interface > Look): off draws nothing; only on marks the tile under the pointer, and
+ // only with a faint step (applyLook's focusBorder), never a thicker or accent border.
+ if (!theme::look.tiled || theme::look.outlines == 0 || r.w <= 0.0f || r.h <= 0.0f) return;
+ focused = focused && theme::look.outlines == 2;
const ImFontAtlas* atlas = ImGui::GetIO().Fonts;
const float s = atlas && !atlas->Fonts.empty() ? atlas->Fonts[0]->FontSize / 15.0f : 1.0f; // the UI scale
- const float t = std::max(1.0f, std::floor(s + 0.25f)) * (focused ? 2.0f : 1.0f); // 2 px on the focused tile
+ const float t = std::max(1.0f, std::floor(s + 0.25f));
const ImVec2 a(r.x, r.y), b(r.x + r.w, r.y + r.h);
dl->PushClipRect(a, b, false);
dl->AddRect(ImVec2(a.x + t * 0.5f, a.y + t * 0.5f), ImVec2(b.x - t * 0.5f, b.y - t * 0.5f),
theme::u32(focused ? theme::focusBorder : theme::tileBorder), 0.0f, 0, t);
if (theme::look.headers == theme::LookStyle::Headers::Grid) { // registration marks at the corners
const float k = std::min(9.0f, std::min(r.w, r.h) * 0.3f);
- const ImU32 c = theme::u32(theme::accent, focused ? 1.0f : 0.75f);
+ const ImU32 c = theme::u32(theme::accent, theme::look.outlines == 2 ? 0.75f : 0.35f);
const float w = 2.0f * t;
for (int i = 0; i < 4; ++i) {
const float x = i & 1 ? b.x - w * 0.5f : a.x + w * 0.5f, y = i & 2 ? b.y - w * 0.5f : a.y + w * 0.5f;
@@ -641,11 +644,13 @@ void App::registerShellActions() {
"Interface look and layout (Preferences > Interface > Look). Only changes how the interface looks.",
{{"look", ParamSpec::Type::String, "classic, forge, phosphor or blueprint (default: unchanged).", false},
{"scheme", ParamSpec::Type::String,
- "Forge Terminal's colours: tokyo_night, catppuccin_mocha, gruvbox_dark, nord, rose_pine, kanagawa or everforest.",
+ "Forge Terminal's colours: neutral, tokyo_night, catppuccin_mocha, gruvbox_dark, nord, rose_pine, kanagawa or everforest.",
false},
{"match_omarchy", ParamSpec::Type::Bool, "Forge Terminal: match the desktop theme (the current Omarchy theme's colours, Linux).", false},
{"phosphor", ParamSpec::Type::String, "Phosphor's colour: green or amber.", false},
{"effects", ParamSpec::Type::Bool, "Phosphor's scanlines and glow (on the interface only).", false},
+ {"outlines", ParamSpec::Type::String, "The tiled looks' panel borders: off, subtle (the default) or on.", false},
+ {"outline_opacity", ParamSpec::Type::Number, "How strong those borders are, 0-100 (default 100).", false},
{"layout", ParamSpec::Type::String, "sculptforge or zbrush (default: the look's, else unchanged).", false},
{"card", ParamSpec::Type::Bool, "Show the one-time \"SculptForge has a new look\" card (for tests).", false}},
[this](Document&, const Args& a) -> CommandResult {
@@ -666,6 +671,13 @@ void App::registerShellActions() {
if (a.contains("match_omarchy")) l.matchOmarchy = argBool(a, "match_omarchy", false);
if (a.contains("phosphor")) l.amber = argString(a, "phosphor") == "amber";
if (a.contains("effects")) l.effects = argBool(a, "effects", false);
+ if (a.contains("outlines")) {
+ const std::string o = argString(a, "outlines");
+ if (o != "off" && o != "subtle" && o != "on") return {false, "outlines must be off, subtle or on"};
+ l.outlines = o == "off" ? 0 : o == "on" ? 2 : 1;
+ }
+ if (a.contains("outline_opacity"))
+ l.outlineOpacity = std::clamp(float(argNumber(a, "outline_opacity", 100.0)) / 100.0f, 0.0f, 1.0f);
if (a.contains("layout")) {
const std::string k = argString(a, "layout");
if (k != "sculptforge" && k != "zbrush") return {false, "layout must be sculptforge or zbrush"};
@@ -1227,7 +1239,7 @@ void App::drawLookChrome() {
}
}
}
- if (theme::look.glow && g_focus.w > 0.0f) { // a soft phosphor bloom around the focused tile, in the gap
+ if (theme::look.glow && theme::look.outlines == 2 && g_focus.w > 0.0f) { // a soft phosphor bloom around the focused tile, in the gap
for (int k = 1; k <= 4; ++k) {
const float d = float(k) * s;
bg->AddRect(ImVec2(g_focus.x - d, g_focus.y - d), ImVec2(g_focus.x + g_focus.w + d, g_focus.y + g_focus.h + d),
@@ -2281,7 +2293,7 @@ bool tileFrame(const char* id, ImVec2 size, ImFont* font, const std::string& cap
pic0 = a;
pic1 = ImVec2(b.x, b.y - capH);
dl->AddRectFilled(pic0, pic1, theme::u32(theme::tile), theme::rounding(4.0f * s));
- if (hovered) dl->AddRect(pic0, pic1, theme::u32(theme::accent, 0.8f), theme::rounding(4.0f * s), 0, 1.5f * s);
+ if (hovered) dl->AddRectFilled(pic0, pic1, theme::u32(theme::buttonHover, 0.45f), theme::rounding(4.0f * s)); // (a faint fill, no border)
centredText(dl, font, ImVec2(a.x, b.y - capH), b, theme::u32(hovered ? theme::text : theme::textDim),
elide(font ? font : ImGui::GetFont(), caption, size.x).c_str());
ImGui::LogText("%s", caption.c_str());
diff --git a/src/app/Theme.cpp b/src/app/Theme.cpp
index 97878afe..2a5ab67d 100644
--- a/src/app/Theme.cpp
+++ b/src/app/Theme.cpp
@@ -41,18 +41,18 @@ void applyStyle() {
c[ImGuiCol_WindowBg] = ImVec4(panelBg.x, panelBg.y, panelBg.z, 0.98f);
c[ImGuiCol_ChildBg] = ImVec4(0, 0, 0, 0);
c[ImGuiCol_PopupBg] = ImVec4(panelBg.x, panelBg.y, panelBg.z, 0.98f);
- c[ImGuiCol_Border] = rgb(0x3a3a3f, 0.9f);
+ c[ImGuiCol_Border] = rgb(0x3c3c3c, 0.9f);
c[ImGuiCol_BorderShadow] = ImVec4(0, 0, 0, 0);
c[ImGuiCol_FrameBg] = frame;
c[ImGuiCol_FrameBgHovered] = frameHover;
- c[ImGuiCol_FrameBgActive] = rgb(0x3e3e44);
+ c[ImGuiCol_FrameBgActive] = rgb(0x404040);
c[ImGuiCol_TitleBg] = header;
- c[ImGuiCol_TitleBgActive] = rgb(0x333338);
+ c[ImGuiCol_TitleBgActive] = rgb(0x353535);
c[ImGuiCol_TitleBgCollapsed] = header;
c[ImGuiCol_MenuBarBg] = shellBg;
- c[ImGuiCol_ScrollbarBg] = rgb(0x1a1a1c, 0.6f);
- c[ImGuiCol_ScrollbarGrab] = rgb(0x48484e);
- c[ImGuiCol_ScrollbarGrabHovered] = rgb(0x58585f);
+ c[ImGuiCol_ScrollbarBg] = rgb(0x1b1b1b, 0.6f);
+ c[ImGuiCol_ScrollbarGrab] = rgb(0x4a4a4a);
+ c[ImGuiCol_ScrollbarGrabHovered] = rgb(0x5a5a5a);
c[ImGuiCol_ScrollbarGrabActive] = accent;
c[ImGuiCol_CheckMark] = checkMark; // neutral: the accent marks the current mode, not every option that is on
c[ImGuiCol_SliderGrab] = sliderBar;
@@ -63,23 +63,23 @@ void applyStyle() {
c[ImGuiCol_Header] = selection; // selected rows: a lighter neutral row (the accent is for the current tool)
c[ImGuiCol_HeaderHovered] = headerHover;
c[ImGuiCol_HeaderActive] = selectionActive;
- c[ImGuiCol_Separator] = rgb(0x3a3a3f);
+ c[ImGuiCol_Separator] = rgb(0x3c3c3c);
c[ImGuiCol_SeparatorHovered] = accentHover;
c[ImGuiCol_SeparatorActive] = accent;
- c[ImGuiCol_ResizeGrip] = rgb(0x48484e, 0.5f);
+ c[ImGuiCol_ResizeGrip] = rgb(0x4a4a4a, 0.5f);
c[ImGuiCol_ResizeGripHovered] = accentHover;
c[ImGuiCol_ResizeGripActive] = accent;
c[ImGuiCol_Tab] = header;
c[ImGuiCol_TabHovered] = headerHover;
- c[ImGuiCol_TabSelected] = rgb(0x45454b);
+ c[ImGuiCol_TabSelected] = rgb(0x474747);
c[ImGuiCol_TabSelectedOverline] = accent;
c[ImGuiCol_TabDimmed] = header;
- c[ImGuiCol_TabDimmedSelected] = rgb(0x3a3a3f);
+ c[ImGuiCol_TabDimmedSelected] = rgb(0x3c3c3c);
c[ImGuiCol_PlotHistogram] = accent;
c[ImGuiCol_PlotHistogramHovered] = accentHover;
c[ImGuiCol_TableHeaderBg] = header;
- c[ImGuiCol_TableBorderStrong] = rgb(0x3a3a3f);
- c[ImGuiCol_TableBorderLight] = rgb(0x323236);
+ c[ImGuiCol_TableBorderStrong] = rgb(0x3c3c3c);
+ c[ImGuiCol_TableBorderLight] = rgb(0x333333);
c[ImGuiCol_TableRowBg] = ImVec4(0, 0, 0, 0);
c[ImGuiCol_TableRowBgAlt] = rgb(0xffffff, 0.025f);
c[ImGuiCol_TextSelectedBg] = rgb(0xf0882e, 0.30f);
@@ -110,7 +110,7 @@ ImVec4 mixc(const ImVec4& a, const ImVec4& b, float t, float alpha = 1.0f) {
return ImVec4(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t, a.z + (b.z - a.z) * t, alpha);
}
-ImVec4 g_gradCentre(0.215f, 0.215f, 0.222f, 1.0f), g_gradEdge(0.106f, 0.106f, 0.114f, 1.0f);
+ImVec4 g_gradCentre(0.217f, 0.217f, 0.217f, 1.0f), g_gradEdge(0.109f, 0.109f, 0.109f, 1.0f);
void syncUiColors() {
ui::color::accent = u32(accent);
@@ -181,8 +181,8 @@ void applyLook(const LookSettings& settings, std::string* status) {
look.id = int(id);
if (id == looks::LookId::Classic) {
for (size_t i = 0; i < std::size(kTokens); ++i) *kTokens[i] = classic[i];
- g_gradCentre = ImVec4(0.215f, 0.215f, 0.222f, 1.0f);
- g_gradEdge = ImVec4(0.106f, 0.106f, 0.114f, 1.0f);
+ g_gradCentre = ImVec4(0.217f, 0.217f, 0.217f, 1.0f);
+ g_gradEdge = ImVec4(0.109f, 0.109f, 0.109f, 1.0f);
applyStyle();
syncUiColors();
return;
@@ -227,6 +227,14 @@ void applyLook(const LookSettings& settings, std::string* status) {
}
for (size_t i = 0; i < std::size(kTokens); ++i) *kTokens[i] = classic[i];
setTokens(palette, id);
+ // Outlines: on keeps the scheme's borders, subtle fades them most of the way into the panels, off hides them.
+ // The panel under the pointer never gets the accent: on lifts its border a faint step, the others not at all.
+ look.outlines = std::clamp(settings.outlines, 0, 2);
+ const ImVec4 strong = tileBorder;
+ // Outline opacity (#98) scales the border's step from the panel colour: 0 hides it, 1 is the setting's own.
+ const float opacity = std::clamp(settings.outlineOpacity, 0.0f, 1.0f);
+ tileBorder = look.outlines == 0 ? panelBg : mixc(panelBg, strong, (look.outlines == 1 ? 0.4f : 1.0f) * opacity);
+ focusBorder = look.outlines == 2 ? mixc(tileBorder, textDim, 0.35f * opacity) : tileBorder;
applyStyle();
ImGuiStyle& s = ImGui::GetStyle();
s.WindowRounding = s.ChildRounding = s.PopupRounding = s.FrameRounding = s.GrabRounding = s.TabRounding = 0.0f;
@@ -237,7 +245,7 @@ void applyLook(const LookSettings& settings, std::string* status) {
const ImVec4 s1 = rgb(palette.surface1), s2 = rgb(palette.surface2);
c[ImGuiCol_WindowBg] = ImVec4(panelBg.x, panelBg.y, panelBg.z, 0.99f);
c[ImGuiCol_PopupBg] = ImVec4(panelBg.x, panelBg.y, panelBg.z, 0.99f);
- c[ImGuiCol_Border] = tileBorder;
+ c[ImGuiCol_Border] = look.outlines == 0 ? mixc(panelBg, strong, 0.3f) : tileBorder; // (popups keep an edge)
c[ImGuiCol_FrameBgActive] = s1;
c[ImGuiCol_TitleBgActive] = s1;
c[ImGuiCol_ScrollbarBg] = ImVec4(0, 0, 0, 0);
diff --git a/src/app/Theme.h b/src/app/Theme.h
index cc3d4408..812adf67 100644
--- a/src/app/Theme.h
+++ b/src/app/Theme.h
@@ -15,52 +15,52 @@ constexpr ImVec4 rgb(unsigned hex, float a = 1.0f) {
return ImVec4(float((hex >> 16) & 0xff) / 255.0f, float((hex >> 8) & 0xff) / 255.0f, float(hex & 0xff) / 255.0f, a);
}
-inline ImVec4 shellBg = rgb(0x1b1b1d); // shelves, trays, title strip, around the canvas
-inline ImVec4 panelBg = rgb(0x222225); // palette drop-downs, tray contents, pop-ups
-inline ImVec4 header = rgb(0x2b2b2f); // palette and sub-palette headers
-inline ImVec4 headerHover = rgb(0x37373c);
-inline ImVec4 frame = rgb(0x28282c); // slider and input frames
-inline ImVec4 frameHover = rgb(0x323237);
-inline ImVec4 button = rgb(0x333337);
-inline ImVec4 buttonHover = rgb(0x414146);
-inline ImVec4 buttonPressed = rgb(0x4e4e55);
+inline ImVec4 shellBg = rgb(0x1c1c1c); // shelves, trays, title strip, around the canvas
+inline ImVec4 panelBg = rgb(0x232323); // palette drop-downs, tray contents, pop-ups
+inline ImVec4 header = rgb(0x2c2c2c); // palette and sub-palette headers
+inline ImVec4 headerHover = rgb(0x393939);
+inline ImVec4 frame = rgb(0x292929); // slider and input frames
+inline ImVec4 frameHover = rgb(0x343434);
+inline ImVec4 button = rgb(0x343434);
+inline ImVec4 buttonHover = rgb(0x434343);
+inline ImVec4 buttonPressed = rgb(0x505050);
// The accent marks one thing per group: the current tool or mode (Draw, Sculpt, the brush), plus grabs and checks.
inline ImVec4 accent = rgb(0xf0882e);
inline ImVec4 accentHover = rgb(0xff9a45);
// Options (X, Rgb, Pressure > Strength, Mask, Menus...): off is a dark chip with a readable label (not dim, so it
// doesn't look disabled); on is a raised grey with a bright label and a thin accent underline.
-inline ImVec4 toggleOff = rgb(0x29292e);
-inline ImVec4 toggleOffHover = rgb(0x36363c);
-inline ImVec4 toggleOn = rgb(0x4c4c53);
-inline ImVec4 toggleOnHover = rgb(0x58585f);
+inline ImVec4 toggleOff = rgb(0x2b2b2b);
+inline ImVec4 toggleOffHover = rgb(0x383838);
+inline ImVec4 toggleOn = rgb(0x4e4e4e);
+inline ImVec4 toggleOnHover = rgb(0x5a5a5a);
// The unselected segments of a mode or choice group (Draw | Move | Scale | Rotate, Zadd | Zsub): a step above the
// shelf, so the group reads as one control.
-inline ImVec4 trough = rgb(0x2c2c31);
-inline ImVec4 selection = rgb(0x3a3a41); // selected list rows: a lighter neutral row, with a 2 px accent bar on the left
-inline ImVec4 selectionActive = rgb(0x45454c);
+inline ImVec4 trough = rgb(0x2e2e2e);
+inline ImVec4 selection = rgb(0x3c3c3c); // selected list rows: a lighter neutral row, with a 2 px accent bar on the left
+inline ImVec4 selectionActive = rgb(0x474747);
inline ImVec4 sliderFill = rgb(0xffffff, 0.09f); // the filled part of a SliderInside
-inline ImVec4 sliderBar = rgb(0x85858c); // the thin bar along its bottom (the accent only while dragging)
-inline ImVec4 checkMark = rgb(0xe6e6e8); // check marks and plain slider grabs: neutral, the accent is for modes
-inline ImVec4 checkBorder = rgb(0x55555c); // the outline of an unchecked box, so it stays visible on panelBg
-inline ImVec4 sectionRule = rgb(0x3a3a3f, 0.63f); // the hairline under a section header in a palette
+inline ImVec4 sliderBar = rgb(0x878787); // the thin bar along its bottom (the accent only while dragging)
+inline ImVec4 checkMark = rgb(0xe7e7e7); // check marks and plain slider grabs: neutral, the accent is for modes
+inline ImVec4 checkBorder = rgb(0x575757); // the outline of an unchecked box, so it stays visible on panelBg
+inline ImVec4 sectionRule = rgb(0x3c3c3c, 0.63f); // the hairline under a section header in a palette
inline ImVec4 text = rgb(0xd8d8d8);
inline ImVec4 textBright = rgb(0xf2f2f2); // labels of options that are on
-inline ImVec4 textOff = rgb(0xb4b4b9); // labels of options that are off: 6.9:1 on toggleOff
-inline ImVec4 textDim = rgb(0x8c8c90); // secondary text and disabled labels
+inline ImVec4 textOff = rgb(0xb6b6b6); // labels of options that are off: 6.9:1 on toggleOff
+inline ImVec4 textDim = rgb(0x8d8d8d); // secondary text and disabled labels
inline ImVec4 textOnAccent = rgb(0xffffff);
inline ImVec4 textHover = rgb(0xffffff); // hovered or open labels on a header (not on the accent)
-inline ImVec4 border = rgb(0x111113); // 1 px between regions
+inline ImVec4 border = rgb(0x121212); // 1 px between regions
inline ImVec4 danger = rgb(0xe5604a); // errors
-inline ImVec4 canvasBorder = rgb(0x0c0c0e);
-inline ImVec4 tile = rgb(0x2a2a2e); // thumbnail placeholders
+inline ImVec4 canvasBorder = rgb(0x0d0d0d);
+inline ImVec4 tile = rgb(0x2b2b2b); // thumbnail placeholders
inline float markWidth = 2.0f; // the accent underline / side bar, unscaled pixels
// The SculptForge orange of the cube logo: the brand mark only, the same in every look.
constexpr ImVec4 brand = rgb(0xf0882e);
// Tiled looks (Preferences > Interface > Look): the wallpaper showing in the gaps between the tiles, a tile's thin
// border and the focused tile's border.
-inline ImVec4 gapBg = rgb(0x0c0c0e);
-inline ImVec4 tileBorder = rgb(0x2a2a2e);
+inline ImVec4 gapBg = rgb(0x0d0d0d);
+inline ImVec4 tileBorder = rgb(0x2b2b2b);
inline ImVec4 focusBorder = rgb(0xf0882e);
inline ImU32 u32(const ImVec4& c, float alpha = 1.0f) { return ImGui::ColorConvertFloat4ToU32(ImVec4(c.x, c.y, c.z, c.w * alpha)); }
@@ -78,6 +78,7 @@ struct LookStyle {
bool scanlines = false; // Phosphor's effects (off by default): scanlines and a glow, on the chrome only
bool glow = false;
bool upperHeaders = false; // palette headers in capitals
+ int outlines = 1; // tiled looks' panel borders: 0 off, 1 subtle (the default), 2 on (LookSettings)
};
inline LookStyle look;
@@ -101,10 +102,15 @@ void applyStyle();
// What Preferences > Interface > Look holds (UiPrefs::look).
struct LookSettings {
int look = 1; // looks::LookId: 0 Classic, 1 Forge Terminal (the default), Phosphor, Blueprint
- std::string scheme = "tokyo_night"; // Forge Terminal's colour scheme (looks::schemes)
+ std::string scheme = "neutral"; // Forge Terminal's colour scheme (looks::schemes); Tokyo Night before 0.10.9
bool matchOmarchy = false; // Forge Terminal: the colours of the current Omarchy theme (Linux, read-only)
bool amber = false; // Phosphor: amber instead of green
bool effects = false; // Phosphor: scanlines and glow on the chrome (never on the 3D view)
+ // The tiled looks' panel borders (0.10.9, user feedback: "the outlines are distracting"): 0 off, 1 subtle (the
+ // default: faint, and nothing lights up under the pointer), 2 on (clear borders, a faint step on the panel
+ // under the pointer). Never the accent on hover.
+ int outlines = 1;
+ float outlineOpacity = 1.0f; // #98: how strong the borders are, 0-1, on top of Outlines (100%: as the setting draws them)
};
// Sets the look's colour tokens, LookStyle and ImGui style (unscaled, like applyStyle). `status` gets a message
diff --git a/src/app/Ui.cpp b/src/app/Ui.cpp
index d4948557..85f91af3 100644
--- a/src/app/Ui.cpp
+++ b/src/app/Ui.cpp
@@ -411,6 +411,57 @@ bool SliderInside(const char* id, float* v, float lo, float hi, const char* form
return changed;
}
+namespace {
+ImGuiID g_dragScrollWindow = 0; // the panel a drag is scrolling (0: none)
+ImGuiMouseButton g_dragScrollButton = ImGuiMouseButton_Left;
+bool g_dragScrollMoved = false;
+int g_dragScrolls = 0;
+float g_dragScrollY = 0.0f;
+} // namespace
+
+void DragScrollPanels() {
+ ImGuiContext& g = *GImGui;
+ const ImGuiIO& io = g.IO;
+ if (g_dragScrollWindow) {
+ ImGuiWindow* w = ImGui::FindWindowByID(g_dragScrollWindow);
+ const ImGuiID id = w ? w->GetID("##dragscroll") : 0;
+ if (!w || !io.MouseDown[g_dragScrollButton] || (g.ActiveId != 0 && g.ActiveId != id)) {
+ if (w && g.ActiveId == id) ImGui::ClearActiveID();
+ if (g_dragScrollMoved) ++g_dragScrolls;
+ g_dragScrollWindow = 0;
+ return;
+ }
+ ImGui::KeepAliveID(id); // holds the press: nothing under the pointer reacts, the window doesn't move
+ if (io.MouseDelta.x != 0.0f || io.MouseDelta.y != 0.0f) {
+ if (w->ScrollMax.y > 0.0f) ImGui::SetScrollY(w, std::clamp(w->Scroll.y - io.MouseDelta.y, 0.0f, w->ScrollMax.y));
+ if (w->ScrollMax.x > 0.0f) ImGui::SetScrollX(w, std::clamp(w->Scroll.x - io.MouseDelta.x, 0.0f, w->ScrollMax.x));
+ g_dragScrollMoved = true;
+ g_dragScrollY = w->ScrollTarget.y < FLT_MAX ? w->ScrollTarget.y : w->Scroll.y;
+ }
+ return;
+ }
+ // A press this frame: left only on empty space (nothing hovered or pressed), middle anywhere on the panel. The
+ // nearest window that scrolls, from the one under the pointer out through its parents (a tray's sections are
+ // child windows).
+ for (const ImGuiMouseButton b : {ImGuiMouseButton_Left, ImGuiMouseButton_Middle}) {
+ if (!ImGui::IsMouseClicked(b) || !g.HoveredWindow) continue;
+ if (b == ImGuiMouseButton_Left && (g.HoveredId != 0 || g.ActiveId != 0)) continue;
+ if (b == ImGuiMouseButton_Middle && g.ActiveId != 0) continue;
+ ImGuiWindow* w = g.HoveredWindow;
+ while (w && !(w->ScrollMax.y > 0.0f || w->ScrollMax.x > 0.0f) && (w->Flags & ImGuiWindowFlags_ChildWindow)) w = w->ParentWindow;
+ if (!w || !(w->ScrollMax.y > 0.0f || w->ScrollMax.x > 0.0f)) continue;
+ if (w->ScrollbarY && io.MousePos.x >= w->InnerRect.Max.x) continue; // on its scroll bar: ImGui's own
+ g_dragScrollWindow = w->ID;
+ g_dragScrollButton = b;
+ g_dragScrollMoved = false;
+ ImGui::SetActiveID(w->GetID("##dragscroll"), w);
+ return;
+ }
+}
+
+int DragScrolls() { return g_dragScrolls; }
+float DragScrollY() { return g_dragScrollY; }
+
void DrawHelp(App& app) {
const UiPrefs& prefs = app.uiPrefs();
g_popupInfo = prefs.popupInfo;
diff --git a/src/app/Ui.h b/src/app/Ui.h
index 651d72de..218bff1e 100644
--- a/src/app/Ui.h
+++ b/src/app/Ui.h
@@ -65,6 +65,13 @@ void DelayedTooltip(const char* text);
bool CtrlHeld();
bool AltHeld();
+// #100 (small screens, pens): a left-drag on a panel's empty space, or a middle-drag anywhere on it, scrolls it, as a
+// finger scrolls a list. Call once a frame, after every window (before ImGui ends the frame).
+void DragScrollPanels();
+// For UI tests: drags that scrolled a panel so far, and that panel's scroll after the last one (pixels).
+int DragScrolls();
+float DragScrollY();
+
// Draws this frame's Ctrl-help box; call once, after every other window.
void DrawHelp(App& app);
// What the Ctrl-help box showed in the last frame ("" if none), for UI tests.
diff --git a/src/app/UiTest.cpp b/src/app/UiTest.cpp
index fcef8be5..0e666678 100644
--- a/src/app/UiTest.cpp
+++ b/src/app/UiTest.cpp
@@ -90,6 +90,8 @@
// tablet_mouse_mode (Preferences > Tablet > Mouse mode), os_cursor_x / os_cursor_y,
// ui_mouse_x / ui_mouse_y (where ImGui sees the pointer), backface_culling, drawn_triangles,
// viewport_cursor (the system cursor: 0 arrow, 1 text, 7 hand, 100 crosshair; #73),
+// panel_drag_scrolls (left / middle drags that scrolled a panel, #100), panel_drag_scroll_y,
+// drag_cursor (the same, at the end of the last button_drag, before letting go; #88),
// smooth_keep_volume (Brush > Smooth keeps volume), stroke_keep_volume (1 when Smooth
// dabs keep the volume now: the option, flipped by letting go of Shift mid-stroke),
// moved_out (summed movement along the snapshot's normals: > 0 out, < 0 in),
@@ -97,6 +99,8 @@
// stroke_continuous (Stroke > Continuous, 1 on),
// stroking (1 while a stroke is open), cursor_x / cursor_y (the brush cursor, pixels),
// surface_cursor (1 when the brush ring last drawn lay on the surface, #25),
+// cursor_ring (1 when the last brush cursor drawn had its ring; 0: the dot only, #88),
+// hide_ring_while_stroking (Preferences > Cursor, 1 on),
// cursor_follows_surface (Preferences > Input, 1 on),
// camera_yaw / camera_pitch / camera_roll (degrees),
// camera_up (the view's up vector . world Y), camera_aligned (1 when looking along a world
@@ -462,6 +466,9 @@ double Demo::query(const std::string& name, bool& known) const {
if (name == "quickmenu_open") return app_.quickMenu_.open ? 1.0 : 0.0;
if (name == "right_click_menu") return app_.uiPrefs_.rightClickQuickMenu ? 1.0 : 0.0;
if (name == "space_camera") return app_.uiPrefs_.spaceCamera ? 1.0 : 0.0;
+ if (name == "look_outline_opacity") return double(std::lround(app_.uiPrefs_.look.outlineOpacity * 100.0f)); // percent
+ if (name == "look_outlines") return double(app_.uiPrefs_.look.outlines); // 0 off, 1 subtle, 2 on
+ if (name == "look_neutral") return app_.uiPrefs_.look.scheme == "neutral" ? 1.0 : 0.0; // Forge Terminal's Neutral colours
if (name == "look") return double(app_.uiPrefs_.look.look); // 0 Classic, 1 Forge Terminal, 2 Phosphor, 3 Blueprint
if (name == "shell_layout") return double(app_.uiPrefs_.shellLayout); // 0 ZBrush-style, 1 SculptForge
if (name == "air_strokes") return app_.uiPrefs_.airStrokes ? 1.0 : 0.0;
@@ -706,6 +713,9 @@ double Demo::query(const std::string& name, bool& known) const {
app_.benchmarkDrawMs(0);
return double(app_.renderer_.lastDrawnTriangles());
}
+ if (name == "panel_drag_scrolls") return double(ui::DragScrolls()); // #100: drags that scrolled a panel
+ if (name == "panel_drag_scroll_y") return double(ui::DragScrollY()); // that panel's scroll after the last one
+ if (name == "drag_cursor") return double(dragCursor_); // the system cursor during the last button_drag (#88)
if (name == "viewport_cursor") return app_.cursorKind_; // the system cursor: 0 arrow, 100 crosshair (#73)
if (name == "os_cursor_x") return app_.testSystemCursorX_;
if (name == "os_cursor_y") return app_.testSystemCursorY_;
@@ -714,6 +724,8 @@ double Demo::query(const std::string& name, bool& known) const {
if (name == "cursor_x") return app_.mouseX_;
if (name == "cursor_y") return app_.mouseY_;
if (name == "surface_cursor") return app_.surfaceCursorShown_ ? 1.0 : 0.0;
+ if (name == "cursor_ring") return app_.ringShown_ ? 1.0 : 0.0;
+ if (name == "hide_ring_while_stroking") return app_.uiPrefs_.hideRingWhileStroking ? 1.0 : 0.0;
if (name == "cursor_follows_surface") return app_.uiPrefs_.cursorFollowsSurface ? 1.0 : 0.0;
if (name == "camera_yaw") return glm::degrees(app_.camera_.yaw);
if (name == "camera_pitch") return glm::degrees(app_.camera_.pitch);
@@ -1083,6 +1095,7 @@ bool Demo::parseStep(int line, const std::vector<std::string>& w, std::string& e
const float u = std::min(t / seconds, 1.0f);
mouseMotion(a.x + (b.x - a.x) * u, a.y + (b.y - a.y) * u);
if (t < seconds) return false;
+ dragCursor_ = app_.cursorKind_; // (what the view showed while the drag ran)
mouseButton(false, button);
return true;
});
diff --git a/src/core/SurfaceCursor.cpp b/src/core/SurfaceCursor.cpp
index 8269f247..1bd96bb3 100644
--- a/src/core/SurfaceCursor.cpp
+++ b/src/core/SurfaceCursor.cpp
@@ -55,39 +55,30 @@ glm::vec3 surfaceCursorNormal(const Mesh& mesh, const BVH& bvh, const RayHit& hi
if (!(radius > 0.0f) || samples <= 0) return n0;
glm::vec3 u, v;
tangentBasis(n0, u, v);
- const float r = radius * 0.5f;
glm::vec3 sum = n0 * 2.0f; // the centre counts double: the cursor sits there
- for (int i = 0; i < samples; ++i) {
- const float a = 6.28318531f * float(i) / float(samples);
- const glm::vec3 p = hit.position + (u * std::cos(a) + v * std::sin(a)) * r;
- RayHit h;
- if (!pressOnto(mesh, bvh, p, n0, r, h)) continue;
- const glm::vec3 n = interpolatedNormal(mesh, h);
- if (glm::dot(n, n0) > 0.0f) sum += n;
+ for (const float r : {radius * 0.5f, radius}) {
+ for (int i = 0; i < samples; ++i) {
+ const float a = 6.28318531f * (float(i) + (r < radius ? 0.0f : 0.5f)) / float(samples); // (staggered rings)
+ const glm::vec3 p = hit.position + (u * std::cos(a) + v * std::sin(a)) * r;
+ RayHit h;
+ if (!pressOnto(mesh, bvh, p, n0, r, h)) continue;
+ const glm::vec3 n = interpolatedNormal(mesh, h);
+ if (glm::dot(n, n0) > 0.0f) sum += n;
+ }
}
return safeNormalize(sum, n0);
}
-void surfaceCursorRing(const Mesh& mesh, const BVH& bvh, const glm::vec3& center, const glm::vec3& normal, float radius,
- int count, std::vector<SurfaceRingPoint>& out) {
+void surfaceCursorCircle(const glm::vec3& center, const glm::vec3& normal, float radius, int count,
+ std::vector<glm::vec3>& out) {
out.clear();
if (count <= 0 || !(radius > 0.0f)) return;
- const glm::vec3 n = safeNormalize(normal, glm::vec3(0, 0, 1));
glm::vec3 u, v;
- tangentBasis(n, u, v);
+ tangentBasis(safeNormalize(normal, glm::vec3(0, 0, 1)), u, v);
out.reserve(size_t(count));
for (int i = 0; i < count; ++i) {
const float a = 6.28318531f * float(i) / float(count);
- SurfaceRingPoint p;
- p.position = center + (u * std::cos(a) + v * std::sin(a)) * radius;
- p.normal = n;
- RayHit h;
- if (pressOnto(mesh, bvh, p.position, n, radius, h)) {
- p.position = h.position;
- p.normal = interpolatedNormal(mesh, h);
- p.onSurface = true;
- }
- out.push_back(p);
+ out.push_back(center + (u * std::cos(a) + v * std::sin(a)) * radius);
}
}
diff --git a/src/core/SurfaceCursor.h b/src/core/SurfaceCursor.h
index 7c37637a..96e02f69 100644
--- a/src/core/SurfaceCursor.h
+++ b/src/core/SurfaceCursor.h
@@ -1,11 +1,12 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// The brush cursor lying on the surface (#25), as in SculptGL: a circle of the brush's world radius around the
-// point under the pointer, in the plane of the surface there, each point pressed onto the mesh so the ring follows
-// bumps and curves instead of floating flat in screen space.
+// The brush cursor lying on the surface (#25): a true circle of the brush's world radius around the point under
+// the pointer, in the tangent plane of the surface there (#88: not pressed onto the mesh point by point, which
+// made the ring wobble and break up on bumpy surfaces). The plane's normal is averaged over the brush's area, so
+// it turns smoothly with the form and ignores fine detail.
//
-// Cost: a few dozen BVH ray casts (each O(log n)) per cursor update, nothing that walks the whole mesh, so it stays
+// Cost: under twenty BVH ray casts (each O(log n)) per cursor update, nothing that walks the whole mesh, so it stays
// cheap at tens of millions of triangles. The app only calls it on frames it draws anyway (pointer moved, stroke,
// view change), so the idle view stays at 0 fps.
#pragma once
@@ -19,25 +20,19 @@
namespace sf {
-struct SurfaceRingPoint {
- glm::vec3 position{0.0f};
- glm::vec3 normal{0.0f}; // the surface's there (the ring's own where nothing was hit)
- bool onSurface = false; // pressed onto the mesh; false: left in the ring's plane (over a hole or an edge)
-};
-
// The shading normal at a ray hit: the vertex normals blended across the hit triangle (smoother than the
// triangle's own normal on a coarse mesh); the triangle's normal if the mesh has no usable vertex normals.
glm::vec3 interpolatedNormal(const Mesh& mesh, const RayHit& hit);
// A steady normal for the cursor at `hit`: the shading normal there averaged with the normals at `samples` points
-// of a ring of half the brush radius pressed onto the surface (an area normal, so the ring doesn't wobble from
-// triangle to triangle as the pointer moves over fine detail). Points facing away from the centre's normal (the
-// far side of a thin part) are left out.
+// on each of two rings (half the brush radius and the full radius) pressed onto the surface: an area normal, so the
+// ring doesn't wobble from triangle to triangle as the pointer moves over fine detail. Points facing away from the
+// centre's normal (the far side of a thin part) are left out.
glm::vec3 surfaceCursorNormal(const Mesh& mesh, const BVH& bvh, const RayHit& hit, float radius, int samples = 8);
-// `count` points of the circle of `radius` about `center` in the plane through it with `normal`, each pressed
-// onto the mesh along -normal (from up to `radius` above the plane to `radius` below it). Clears `out` first.
-void surfaceCursorRing(const Mesh& mesh, const BVH& bvh, const glm::vec3& center, const glm::vec3& normal, float radius,
- int count, std::vector<SurfaceRingPoint>& out);
+// `count` points of the circle of `radius` about `center` in the plane through it with `normal` (a true circle:
+// nothing is pressed onto the mesh). Clears `out` first.
+void surfaceCursorCircle(const glm::vec3& center, const glm::vec3& normal, float radius, int count,
+ std::vector<glm::vec3>& out);
} // namespace sf
diff --git a/src/render/Renderer.h b/src/render/Renderer.h
index 50a1e27c..5a8f2340 100644
--- a/src/render/Renderer.h
+++ b/src/render/Renderer.h
@@ -42,7 +42,7 @@ struct RenderSettings {
bool backfaceCulling = false;
// The view's background: the charcoal radial gradient (default) or one flat display (sRGB) colour (#21).
bool gradientBackground = true;
- glm::vec3 backgroundColor{0.165f, 0.165f, 0.173f};
+ glm::vec3 backgroundColor{0.168f, 0.168f, 0.168f};
// The gradient's colours (display sRGB): behind the model and at the edges. The interface look sets them
// (Preferences > Interface > Look); these are the Classic look's charcoal.
glm::vec3 gradientCentre{0.215f, 0.215f, 0.222f};
diff --git a/tests/test_looks.cpp b/tests/test_looks.cpp
index c29558e7..5b899285 100644
--- a/tests/test_looks.cpp
+++ b/tests/test_looks.cpp
@@ -35,8 +35,8 @@ TEST(looks_keys_round_trip) {
TEST(looks_schemes_complete_and_readable) {
int count = 0;
const looks::SchemeInfo* list = looks::schemes(count);
- CHECK(count == 7);
- CHECK(std::string(list[0].key) == "tokyo_night"); // the default comes first
+ CHECK(count == 8);
+ CHECK(std::string(list[0].key) == "neutral"); // the default comes first (0.10.9)
std::set<std::string> keys;
auto lum = [](unsigned c) { return 0.2126f * float((c >> 16) & 0xff) + 0.7152f * float((c >> 8) & 0xff) + 0.0722f * float(c & 0xff); };
for (int i = 0; i < count; ++i) {
diff --git a/tests/test_surface_cursor.cpp b/tests/test_surface_cursor.cpp
index 321bfbd9..9245f5b0 100644
--- a/tests/test_surface_cursor.cpp
+++ b/tests/test_surface_cursor.cpp
@@ -8,6 +8,7 @@
#include "core/Primitives.h"
#include "core/SurfaceCursor.h"
+#include <algorithm>
#include <chrono>
#include <cmath>
#include <cstdio>
@@ -15,7 +16,7 @@
using namespace sf;
-TEST(surface_cursor_ring_lies_on_sphere) {
+TEST(surface_cursor_circle_on_sphere) {
Mesh m = makeIcosphere(5, 1.0f);
BVH bvh;
bvh.build(m);
@@ -24,54 +25,85 @@ TEST(surface_cursor_ring_lies_on_sphere) {
// The steady normal is the sphere's (radial) there, not just the hit triangle's.
const glm::vec3 n = surfaceCursorNormal(m, bvh, hit, 0.3f);
CHECK(glm::dot(n, glm::normalize(hit.position)) > 0.999f);
- std::vector<SurfaceRingPoint> ring;
- surfaceCursorRing(m, bvh, hit.position, n, 0.3f, 48, ring);
+ // A true circle (#88): every point exactly the brush radius from the centre, in the tangent plane.
+ std::vector<glm::vec3> ring;
+ surfaceCursorCircle(hit.position, n, 0.3f, 48, ring);
CHECK(ring.size() == 48);
- for (const SurfaceRingPoint& p : ring) {
- CHECK(p.onSurface);
- // On the (faceted) sphere, not in the flat plane touching it.
- CHECK(std::abs(glm::length(p.position) - 1.0f) < 0.01f);
- // About the brush radius from the centre (pressed down onto the curve, a little further).
- const float d = glm::length(p.position - hit.position);
- CHECK(d > 0.299f && d < 0.31f);
- CHECK(glm::dot(p.normal, glm::normalize(p.position)) > 0.99f);
+ for (const glm::vec3& p : ring) {
+ CHECK(std::abs(glm::length(p - hit.position) - 0.3f) < 1e-4f);
+ CHECK(std::abs(glm::dot(p - hit.position, n)) < 1e-4f);
}
}
-TEST(surface_cursor_ring_flat_off_edge) {
- // Near the edge of a plane: points past the edge stay in the ring's plane, marked off the surface.
- Mesh m = makePlane(16, 2.0f);
+namespace {
+
+// A plane with fine bumps all over it (a rough, detailed surface), its flat axis Y.
+Mesh bumpyPlane() {
+ Mesh m = makePlane(160, 2.0f);
+ const AABB b = m.bounds();
+ const glm::vec3 ext = b.max - b.min;
+ const int up = ext.x < ext.y && ext.x < ext.z ? 0 : ext.y < ext.z ? 1 : 2;
+ for (glm::vec3& p : m.positions) {
+ const int a = (up + 1) % 3, c = (up + 2) % 3;
+ p[up] += 0.012f * std::sin(p[a] * 157.0f) * std::cos(p[c] * 131.0f);
+ }
+ m.recomputeAllNormals();
+ return m;
+}
+
+float degreesBetween(const glm::vec3& a, const glm::vec3& b) {
+ return glm::degrees(std::acos(std::clamp(glm::dot(glm::normalize(a), glm::normalize(b)), -1.0f, 1.0f)));
+}
+
+} // namespace
+
+TEST(surface_cursor_steady_on_bumps) {
+ // #88: gliding over fine bumps, the ring's plane barely turns, though the surface right under the pointer
+ // tilts a lot from one step to the next.
+ Mesh m = bumpyPlane();
BVH bvh;
bvh.build(m);
const AABB b = m.bounds();
- glm::vec3 up(0.0f);
const glm::vec3 ext = b.max - b.min;
- up[ext.x < ext.y && ext.x < ext.z ? 0 : ext.y < ext.z ? 1 : 2] = 1.0f; // the plane's flat axis
- const glm::vec3 c = (b.min + b.max) * 0.5f + ext * 0.45f * (glm::vec3(1.0f) - up);
- RayHit hit;
- CHECK(bvh.raycast(m, c + up * 3.0f, -up, hit));
- std::vector<SurfaceRingPoint> ring;
- surfaceCursorRing(m, bvh, hit.position, interpolatedNormal(m, hit), 0.5f, 32, ring);
- int on = 0, off = 0;
- for (const SurfaceRingPoint& p : ring) (p.onSurface ? on : off)++;
- CHECK(on > 0 && off > 0);
+ glm::vec3 up(0.0f);
+ up[ext.x < ext.y && ext.x < ext.z ? 0 : ext.y < ext.z ? 1 : 2] = 1.0f;
+ const glm::vec3 side = glm::normalize(glm::vec3(1.0f) - up);
+ float worstCursor = 0.0f, worstPoint = 0.0f;
+ glm::vec3 prevCursor(0.0f), prevPoint(0.0f);
+ for (int i = 0; i < 40; ++i) {
+ const glm::vec3 at = (b.min + b.max) * 0.5f + side * (-0.3f + 0.015f * float(i)) + up * 2.0f;
+ RayHit hit;
+ CHECK(bvh.raycast(m, at, -up, hit));
+ const glm::vec3 cursor = surfaceCursorNormal(m, bvh, hit, 0.25f), point = interpolatedNormal(m, hit);
+ if (i > 0) {
+ worstCursor = std::max(worstCursor, degreesBetween(cursor, prevCursor));
+ worstPoint = std::max(worstPoint, degreesBetween(point, prevPoint));
+ }
+ CHECK(degreesBetween(cursor, up) < 6.0f); // the form's direction, not the bump's
+ prevCursor = cursor;
+ prevPoint = point;
+ }
+ std::printf(" bumps: cursor plane turns at most %.2f deg per step, the surface under it %.2f deg\n", worstCursor,
+ worstPoint);
+ CHECK(worstPoint > 10.0f);
+ CHECK(worstCursor < 3.0f);
}
TEST(surface_cursor_cost_is_rays_not_mesh_passes) {
- // A cursor update is ~90 ray casts: on a 5M-triangle sphere it stays well under a millisecond (it walks the
+ // A cursor update is 17 ray casts: on a 5M-triangle sphere it stays well under a millisecond (it walks the
// BVH, never the mesh). Generous bound so slow CI machines and debug builds pass.
Mesh m = makeIcosphere(9, 1.0f);
BVH bvh;
bvh.build(m);
- std::vector<SurfaceRingPoint> ring, inner;
+ std::vector<glm::vec3> ring, inner;
const int n = 200;
const auto t0 = std::chrono::steady_clock::now();
for (int i = 0; i < n; ++i) {
RayHit hit;
CHECK(bvh.raycast(m, glm::vec3(-0.5f + float(i) / float(n), 0.2f, 5.0f), glm::vec3(0, 0, -1), hit));
const glm::vec3 nn = surfaceCursorNormal(m, bvh, hit, 0.3f);
- surfaceCursorRing(m, bvh, hit.position, nn, 0.3f, 48, ring);
- surfaceCursorRing(m, bvh, hit.position, nn, 0.15f, 32, inner);
+ surfaceCursorCircle(hit.position, nn, 0.3f, 48, ring);
+ surfaceCursorCircle(hit.position, nn, 0.15f, 32, inner);
}
const double ms = std::chrono::duration<double, std::milli>(std::chrono::steady_clock::now() - t0).count() / n;
std::printf(" surface cursor on %zu triangles: %.3f ms per update\n", m.triangles.size(), ms);
diff --git a/tests/ui/hints.sfui b/tests/ui/hints.sfui
new file mode 100644
index 00000000..5e57429a
--- /dev/null
+++ b/tests/ui/hints.sfui
@@ -0,0 +1,33 @@
+# Viewport hints (U11): every note SculptForge shows over the 3D view has Don't show again, and Preferences > Hints
+# lists them, turns them all off, or shows them all again.
+run ui_look look=forge scheme=neutral layout=sculptforge
+run new_sphere subdivisions=3
+key f3
+type "##Command palette" "Start strokes off the model"
+key enter
+expect_value air_strokes == 1
+expect_text Strokes start off the model
+expect "Don't show again##hint.air_strokes"
+shot hint
+
+# Don't show again: gone, and the mode stays on.
+click "Don't show again##hint.air_strokes"
+expect_not "Don't show again##hint.air_strokes"
+expect_no_text Strokes start off the model
+expect_value air_strokes == 1
+
+# Preferences > Hints: the hint unticked; ticking it brings it back.
+click "Edit##menu.edit"
+click "Preferences##section.preferences"
+click "Hints##preferences.hints"
+expect "Show hints in the viewport##hints.show"
+click "Strokes start off the model##hints.air_strokes"
+expect "Don't show again##hint.air_strokes"
+shot hints-prefs
+
+# All off hides every hint; Show all hints again brings them back.
+click "Show hints in the viewport##hints.show"
+expect_not "Don't show again##hint.air_strokes"
+click "Show all hints again##hints.reset"
+expect "Don't show again##hint.air_strokes"
+key escape
diff --git a/tests/ui/looks.sfui b/tests/ui/looks.sfui
index b08a692a..884a9ff3 100644
--- a/tests/ui/looks.sfui
+++ b/tests/ui/looks.sfui
@@ -1,8 +1,11 @@
# The interface looks and the SculptForge layout (Preferences > Interface > Look): the task menus hold every palette
# as a section, the ZBrush-style layout stays one setting away, and switching looks keeps everything working.
run new_sphere subdivisions=3
-expect_value look == 1 # the default (0.10.7): Forge Terminal, Tokyo Night, SculptForge layout
+expect_value look == 1 # the default: Forge Terminal, Neutral colours (0.10.9), SculptForge layout
+expect_value look_neutral == 1
+expect_value look_outlines == 1 # subtle panel borders, nothing lights up under the pointer
expect_value shell_layout == 1
+shot neutral-default
expect "Sculpt##menu.sculpt"
expect_not "Tool##palette.tool"
@@ -93,6 +96,29 @@ expect_value look == 3
shot blueprint
run ui_look look=forge scheme=everforest
wait 0.2
+# Outlines: off, subtle (the default) and on; the screenshots show each with the pointer over a panel.
+run ui_look look=forge scheme=neutral outlines=off
+wait 0.2
+expect_value look_outlines == 0
+hover "Clay##brush.clay"
+shot outlines-off
+run ui_look outlines=on
+wait 0.2
+expect_value look_outlines == 2
+hover "Clay##brush.clay"
+shot outlines-on
+run ui_look outlines=on outline_opacity=40
+wait 0.2
+expect_value look_outline_opacity == 40
+hover "Clay##brush.clay"
+shot outlines-on-40
+run ui_look outlines=subtle outline_opacity=100
+wait 0.2
+expect_value look_outlines == 1
+expect_value look_outline_opacity == 100
+hover "Clay##brush.clay"
+shot outlines-subtle
+run_fails ui_look outlines=loud
run_fails ui_look scheme=solarized
run_fails ui_look look=neon
run_fails ui_look layout=tabs
@@ -142,12 +168,31 @@ expect_value look == 1
expect_value shell_layout == 1
expect "Sculpt##menu.sculpt"
-# The welcome offers the ZBrush-style layout in one click.
+# The welcome's look picker: three cards (Neutral, Forge Terminal, ZBrush-style layout), and Coming from sets the
+# keys and the layout together.
key f3
type "##Command palette" "welcome"
key enter
expect_value welcome_open == 1
-click "Coming from ZBrush? Use the ZBrush-style layout##welcome.layout"
+shot welcome-look-picker
+click "##welcome.look.zbrush"
+wait 0.2
+expect_value look == 0
+expect_value shell_layout == 0
+expect "Tool##palette.tool"
+click "##welcome.look.forge"
+wait 0.2
+expect_value look == 1
+expect_value look_neutral == 0
+expect_value shell_layout == 1
+click "##welcome.look.neutral"
+wait 0.2
+expect_value look_neutral == 1
+shot welcome-neutral
+click "ZBrush##welcome.from"
wait 0.2
expect_value shell_layout == 0
expect "Tool##palette.tool"
+click "New to sculpting##welcome.from"
+wait 0.2
+expect_value shell_layout == 1
diff --git a/tests/ui/packs.sfui b/tests/ui/packs.sfui
index cfe66dd5..936d6584 100644
--- a/tests/ui/packs.sfui
+++ b/tests/ui/packs.sfui
@@ -57,8 +57,8 @@ click "Library/Apply keymap Demo Keys##km.demo-pack.Demo Keys"
expect_shortcut mask.invert Ctrl+Shift+K
expect_status Keymap Demo Keys: 1 keys
click "Library/Add pie menu Demo Pie##pie.demo-pack.Demo Pie"
-expect_value radial_menus == 3
-expect_value radial_slots_3 == 2
+expect_value radial_menus == 4
+expect_value radial_slots_4 == 2
# Off: its items leave the lists; on again: back.
click "Library/##ondemo-pack"
diff --git a/tests/ui/panel_drag_scroll.sfui b/tests/ui/panel_drag_scroll.sfui
new file mode 100644
index 00000000..f07c69ec
--- /dev/null
+++ b/tests/ui/panel_drag_scroll.sfui
@@ -0,0 +1,26 @@
+# #100 (small screens, pens): a palette that doesn't fit scrolls with a middle-drag anywhere on it, or a left-drag
+# on its empty space (text and gaps), as a finger scrolls a list. A drag that starts on a control still works the
+# control and never scrolls.
+run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run new_sphere subdivisions=3
+expect_value panel_drag_scrolls == 0
+click "Deformation##tool.deformation" # long sub-palettes (Shift+click keeps more open): the tray overflows
+hold shift
+click "Parts##tool.subtool"
+click "Geometry##tool.geometry"
+hold none
+
+# Middle-drag up over the Tool palette in the right tray: it scrolls down.
+button_drag middle 0.9 0.8 0.9 0.5 0.3
+expect_value panel_drag_scrolls == 1
+expect_value panel_drag_scroll_y > 50
+shot middle-drag
+
+# Back down with a left-drag on empty space (beside the section titles): it scrolls back to the top.
+drag 0.975 0.3 0.975 0.9 0.3
+expect_value panel_drag_scrolls == 2
+expect_value panel_drag_scroll_y == 0
+
+# A left-drag that starts on a button presses the button, no scroll.
+drag_item "Append" 0 -200
+expect_value panel_drag_scrolls == 2
diff --git a/tests/ui/radial_buttons.sfui b/tests/ui/radial_buttons.sfui
index 46891dac..a313abe7 100644
--- a/tests/ui/radial_buttons.sfui
+++ b/tests/ui/radial_buttons.sfui
@@ -6,7 +6,7 @@ run new_sphere subdivisions=4
# The middle button (sculpting.json): a plain press opens the pie, a right flick runs Inflate.
radial_import data/radial/sculpting.json
-expect_value radial_menus == 3
+expect_value radial_menus == 4
button_drag middle 0.5 0.5 0.57 0.5 0.3
expect_value radial_open == 0
expect_value radial_ran == 1
@@ -23,7 +23,7 @@ expect_value camera_pan > $pan0+0.01
# The right button (right_button.json): a plain right-drag opens the pie and runs the flicked item (a left flick:
# Pinch), and the view doesn't turn.
radial_import data/radial/right_button.json
-expect_value radial_menus == 4
+expect_value radial_menus == 5
remember camera_yaw yaw0
button_drag right 0.5 0.5 0.43 0.5 0.3
expect_value radial_open == 0
diff --git a/tests/ui/radial_menu.sfui b/tests/ui/radial_menu.sfui
index 65857d4a..308d92c4 100644
--- a/tests/ui/radial_menu.sfui
+++ b/tests/ui/radial_menu.sfui
@@ -1,5 +1,5 @@
-# Radial (pie) menus (#45). Two built in: Brushes on T and Masking on Y, keys no other action has in any input
-# style. Hold the key, flick toward an item, let go: it runs. Let go in the middle after a moment: nothing. Tap
+# Radial (pie) menus (#45). Three built in: Brushes on T, Masking on Y and Strokes on J (U13: the stroke types on
+# one ring, as 3D-Coat's stroke pop-up), keys no other action has in any input style. Hold the key, flick toward an item, let go: it runs. Let go in the middle after a moment: nothing. Tap
# the key: the pie stays open; a click on an item runs it, a click in the middle or Esc closes it, and the click
# never reaches the model. A pen or mouse button set on a menu does the same as its key. Preferences > Input >
# Radial Menus: a new menu, an item picked with the palette's search, a key; import and export of one menu (only
@@ -7,11 +7,13 @@
run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
run new_sphere subdivisions=3
camera 0 0
-expect_value radial_menus == 2
+expect_value radial_menus == 3
expect_value radial_slots_1 == 8
expect_value radial_slots_2 == 8
+expect_value radial_slots_3 == 5
expect_shortcut radial.menu1 T
expect_shortcut radial.menu2 Y
+expect_shortcut radial.menu3 J
expect_value radial_ran == -1
expect_value shortcut_conflicts == 0
@@ -31,6 +33,25 @@ expect_value radial_open == 0
expect_value radial_ran == 2
expect_value brush_type == 3
+# Hold J, flick right: the Strokes ring's second item (clockwise from the top), Drag Stamp; flick up: Dots.
+expect_value stroke_type == 0
+hover_window 0.5 0.5
+key_down j
+expect_value radial_menu == 2
+shot strokes_open
+hover_window 0.57 0.47 0.15
+expect_value radial_hover == 1
+shot strokes_flick
+key_up j
+expect_value radial_open == 0
+expect_value stroke_type == 1
+hover_window 0.5 0.5
+key_down j
+hover_window 0.5 0.4 0.1
+expect_value radial_hover == 0
+key_up j
+expect_value stroke_type == 0
+
# Flick up: Standard.
hover_window 0.5 0.5
key_down t
@@ -114,48 +135,48 @@ expect_value radial_open == 1
key escape
pen_out
-# A new menu: its first item picked with the palette's search (Smooth), then a key (J).
+# A new menu: its first item picked with the palette's search (Smooth), then a key (N).
click "Preferences##palette.preferences"
click "###radial.add_menu"
-expect_value radial_menus == 3
+expect_value radial_menus == 4
type "##radial.search" smooth
click "###radial.pick.brush.smooth"
-expect_value radial_slots_3 == 1
+expect_value radial_slots_4 == 1
click "###radial.key"
-key j
-expect_shortcut radial.menu3 J
+key n
+expect_shortcut radial.menu4 N
expect_value shortcut_conflicts == 0
key escape
hover_window 0.5 0.5
-key_down j
-expect_value radial_menu == 2
+key_down n
+expect_value radial_menu == 3
hover_window 0.5 0.4 0.1
-key_up j
+key_up n
expect_value brush_type == 2
# Import a menu file: unknown actions, a command that needs a path, a bad icon and a wrong type are left out; its
# middle mouse button opens it (a right flick: Inflate of Smooth / Inflate / Pinch).
radial_import data/radial/sculpting.json
-expect_value radial_menus == 4
-expect_value radial_slots_4 == 3
+expect_value radial_menus == 5
+expect_value radial_slots_5 == 3
button_drag middle 0.5 0.5 0.57 0.5 0.3
expect_value radial_open == 0
expect_value radial_ran == 1
expect_value brush_type == 4
# Export it, clear it, import it back into the same (now empty) menu.
-radial_export 4 sculpting_out.json
+radial_export 5 sculpting_out.json
click "Preferences##palette.preferences"
click "Clear##radial.clear"
-expect_value radial_menus == 3
-radial_import sculpting_out.json
expect_value radial_menus == 4
-expect_value radial_slots_4 == 3
+radial_import sculpting_out.json
+expect_value radial_menus == 5
+expect_value radial_slots_5 == 3
key escape
button_drag middle 0.5 0.5 0.5 0.4 0.3
expect_value brush_type == 2
-# Every style keeps T, Y and J free of other actions.
+# Every style keeps T, Y, J (and the N set above) free of other actions.
click "Preferences##palette.preferences"
click "SculptForge##input.style_sculptforge"
expect_value shortcut_conflicts == 0
@@ -167,9 +188,9 @@ click "ZBrush-style##input.style_zbrush"
expect_value shortcut_conflicts == 0
key escape
-# Restore default menus: Brushes and Masking again.
+# Restore default menus: Brushes, Masking and Strokes again.
click "Preferences##palette.preferences"
click "Restore default menus##radial.defaults"
-expect_value radial_menus == 2
+expect_value radial_menus == 3
expect_value radial_slots_1 == 8
key escape
diff --git a/tests/ui/surface_cursor.sfui b/tests/ui/surface_cursor.sfui
index f9e04c3d..994d0bdf 100644
--- a/tests/ui/surface_cursor.sfui
+++ b/tests/ui/surface_cursor.sfui
@@ -1,6 +1,7 @@
-# The brush cursor follows the surface (#25): over the model the ring lies on it, turned to the surface and
-# pressed onto its shape, at the brush's real size there; off the model it is the flat screen ring. A preference
-# in Preferences > Input (on by default), kept by Store Config.
+# The brush cursor follows the surface (#25): over the model the ring lies on it, a true circle in the plane of the
+# surface there (#88: not bent over each bump), at the brush's real size; off the model it is the flat screen ring.
+# Symmetry copies show as dots, not rings (#88). Preferences > Cursor: Cursor follows surface (on by default) and
+# Hide ring while stroking (off by default), kept by Store Config.
run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
run new_head
camera 35 10
@@ -12,11 +13,12 @@ hover_model 0.62 0.55
expect_value surface_cursor == 1
shot on-surface
-# From the front with X symmetry (on by default): the mirrored ring shows, fainter, on the other cheek.
+# From the front with X symmetry (on by default): a dot shows where the mirrored dab lands on the other cheek.
camera 0 0
key f
hover_model 0.3 0.55
expect_value surface_cursor == 1
+expect_value cursor_copies == 2
shot symmetry
camera 35 10
key f
@@ -40,9 +42,31 @@ hover_window 0.68 0.5
expect_value surface_cursor == 0
shot off-surface
-# Preferences > Input turns it off.
+# While stroking the ring stays by default...
+drag_path 0.4 0.4 0.7 0.5 keep
+expect_value cursor_ring == 1
+release
+# ...Preferences > Cursor > Hide ring while stroking leaves only the dot during a stroke.
+click "Preferences##palette.preferences"
+click "Cursor##preferences.cursor"
+expect "Hide ring while stroking##cursor.hide_ring_stroking"
+expect_value hide_ring_while_stroking == 0
+click "Hide ring while stroking##cursor.hide_ring_stroking"
+expect_value hide_ring_while_stroking == 1
+key escape
+drag_path 0.4 0.4 0.7 0.5 keep
+expect_value cursor_ring == 0
+shot hidden-ring-stroking
+release
+hover_model 0.6 0.4
+expect_value cursor_ring == 1
+click "Preferences##palette.preferences"
+click "Hide ring while stroking##cursor.hide_ring_stroking"
+expect_value hide_ring_while_stroking == 0
+key escape
+
+# Preferences > Cursor turns it off.
click "Preferences##palette.preferences"
-click "Input##preferences.input"
expect "Cursor follows surface##input.surface_cursor"
click "Cursor follows surface##input.surface_cursor"
expect_value cursor_follows_surface == 0
diff --git a/tests/ui/viewport_cursor.sfui b/tests/ui/viewport_cursor.sfui
index c010e23f..82984736 100644
--- a/tests/ui/viewport_cursor.sfui
+++ b/tests/ui/viewport_cursor.sfui
@@ -1,6 +1,6 @@
# The viewport cursor (#73): a crosshair over the 3D view where brushes act, the arrow over panels, menus and
-# popups (and their own resize and text cursors there). Preferences > Interface > Viewport cursor: Crosshair (the
-# default) or Arrow.
+# popups (and their own resize and text cursors there). It stays while the view turns (#88: no arrow flashing in
+# for each orbit). Preferences > Cursor > Viewport cursor: Crosshair (the default) or Arrow.
run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
run new_sphere subdivisions=3
hover_model 0.5 0.5
@@ -17,9 +17,15 @@ wait 0.1
expect_value viewport_cursor == 100
pen_out
+# Turning the view (right-drag on the background): still the crosshair, not the arrow.
+remember camera_yaw yaw0
+button_drag right 0.2 0.5 0.3 0.45
+expect_value camera_yaw != $yaw0
+expect_value drag_cursor == 100
+
# A window floating over the view (Preferences) has the arrow; the view beside it the crosshair.
click "Preferences##palette.preferences"
-click "Interface##preferences.interface"
+click "Cursor##preferences.cursor"
expect "Crosshair##viewport_cursor"
hover "Arrow##viewport_cursor"
expect_value viewport_cursor == 0
diff --git a/tests/ui/whats_new.sfui b/tests/ui/whats_new.sfui
index 0e5cf4b3..cf204251 100644
--- a/tests/ui/whats_new.sfui
+++ b/tests/ui/whats_new.sfui
@@ -5,8 +5,9 @@ click "Help##palette.help"
click "What's New##help.whats_new"
expect_value guide_open == 1
expect_guide whats-new.md
+expect_text "Version 0.10.9"
+expect_text "A calmer brush cursor"
expect_text "Version 0.10.8"
-expect_text "Tablets in mouse mode work again"
expect_text "Version 0.10.7"
expect_text "Version 0.10.6"
expect_text "Version 0.10.5"