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.

Stroke popup: Z in the Blender style (J and N are taken there), a tap near the canvas edge stays a tap

islandmed42fd13e12e8b
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bb6bfcf1..febf07f3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,7 +7,7 @@ All notable changes to SculptForge are listed here. The format follows
## [Unreleased]
### Added
-- Stroke popup: press G (N in the Blender style; any key in Edit > Preferences > Hotkeys) or the new button under the Stroke
+- Stroke popup: press G (Z in the Blender style; any key in Edit > Preferences > Hotkeys) or the new button under the Stroke
tile for a grid at the cursor with the stroke types and the modifiers Add / Sub, Smooth, Mask and Select. Hold the
key, point and let go (a hovering pen works too), or tap it and click. Smooth, Mask and Select stay on without
holding Shift or Ctrl until you pick them again or another brush; a label at the cursor shows which. A plain grid,
diff --git a/REPLY.md b/REPLY.md
index cc392b57..48f19fde 100644
--- a/REPLY.md
+++ b/REPLY.md
@@ -1,4 +1,4 @@
-Thanks for the idea, it's in 0.10.9: **the stroke popup**. Press **G** (N in the Blender keys) or the new button under the Stroke tile and a plain grid opens right at the cursor: Dots, Drag Stamp, Slide Stamp, Spray and Lazy Stroke on top, and Add / Sub, Smooth, Mask and Select below, with big icons and labels.
+Thanks for the idea, it's in 0.10.9: **the stroke popup**. Press **G** (Z in the Blender keys) or the new button under the Stroke tile and a plain grid opens right at the cursor: Dots, Drag Stamp, Slide Stamp, Spray and Lazy Stroke on top, and Add / Sub, Smooth, Mask and Select below, with big icons and labels.
- Hold G, point, let go: picked. Or tap G and click. Works with a hovering pen too.
- Smooth, Mask and Select **stay on** without holding Shift or Ctrl, until you pick them again or pick another brush. A small label by the cursor shows which one is on, so no more Ctrl+Shift / Alt juggling mid-stroke.
diff --git a/REPORT.md b/REPORT.md
index 2efea608..dd36668b 100644
--- a/REPORT.md
+++ b/REPORT.md
@@ -1,7 +1,7 @@
# REPORT: feat/stroke-popup (Discord 11-02 stroke-type popup), 0.10.9
## What
-- **Stroke popup**: action `stroke.popup`. Key G in the ZBrush, SculptForge and Maya styles, J in Blender (its G is the Move brush). Also a new left-shelf button under the Stroke tile; layout version 4 adds it to stored layouts.
+- **Stroke popup**: action `stroke.popup`. Key G in the ZBrush, SculptForge and Maya styles, Z in Blender (its G is the Move brush; J is cursor-look's Strokes radial menu, N is bound to a user menu in ui_radial_menu). Also a new left-shelf button under the Stroke tile; layout version 4 adds it to stored layouts.
- A plain 5x2 grid at the cursor (not a pie ring). It opens with the current stroke under the pointer. Top row: the 5 stroke types. Bottom row: Add, Sub, Smooth, Mask, Select, with key hints (Alt / Shift / Ctrl / Ctrl+Shift) and a help line on hover.
- Hold the key, point, let go: picked (a hovering pen works the same). Tap the key: the grid stays open; clicking a stroke picks it and closes, clicking a modifier toggles it and stays open. Esc or a click beside the grid closes it. The click is swallowed and never reaches the model.
- Smooth, Mask and Select latch: `inputMods()` adds Shift / Ctrl / Ctrl+Shift until the same item is picked again or another brush is picked. A "Mask" etc. label shows next to the cursor. Navigation uses the new `inputMods(false)`, so a background drag still orbits: the onMouseDown `nav` branches, orbit snap / roll / alt-pan, Gizmo snap and hover, Kelvinlet capture.
@@ -10,15 +10,14 @@
- Docs: CHANGELOG [Unreleased], whats-new.md "## Version 0.10.9" bullet (rename as needed when merging), sculpting.md "The stroke popup" section, shortcuts.md regenerated (ui_guide_shortcuts passed locally).
## Tests
-- New: tests/test_stroke_popup.cpp, tests/test_shell_layout.cpp `shell_left_shelf_stroke_popup`, tests/ui/stroke_popup.sfui, plus `ui_stroke_popup_scaled` (2400x1350, 1.5x UI). New UI-test verb `stroke_popup_item ITEM [click] [pen]` and probes stroke_popup_*, stroke_latch, invert_toggle.
-- Ran locally: build green; ui_guide_shortcuts passed. ui_stroke_popup and ui_stroke_popup_scaled passed through line 78: hold/let go, beside/cancel, tap+click, modifiers, the latched Mask stroke masking with moved == 0, and a background drag not inverting the mask.
-- The rest of the UI script has NOT run locally. The failure at 79/84 was the test's `drag` verb (a UI drag, so ImGui kept the mouse and swallowed the next key); it's now `view_drag`. The full ctest and the new unit tests have not run locally (queue stopped by the new plan). CI and the merger's combined ctest are the check.
-- Screenshots checked at 1x and 1.5x (build/ui-shots/stroke_popup*/). Fixed after looking: the brush ring drew over the popup; it's now hidden while the popup is open.
+- New: tests/test_stroke_popup.cpp, test_shell_layout `shell_left_shelf_stroke_popup`, tests/ui/stroke_popup.sfui and `ui_stroke_popup_scaled` (2400x1350, 1.5x). New UI-test verb `stroke_popup_item ITEM [click] [pen]`, probes stroke_popup_*, stroke_latch, invert_toggle.
+- After merging origin/merge/0.10.9 (ea476e3), locally via heavy.sh: build green; all 8 sculptforge_tests shards passed; ui_stroke_popup, ui_stroke_popup_scaled, ui_radial_menu, ui_shell_layout, ui_shell_layout_1080, ui_whats_new, ui_guide_shortcuts passed. The full ctest has not run (the merger runs it on the combined tree).
+- Bug fixed from the tests: near the canvas edge the grid shifts to stay on screen, and a quick tap used to pick the item that landed under the pointer. A tap is now judged against the item under the pointer when the grid opened.
+- Screenshots checked at 1x and 1.5x. The brush ring no longer draws over the grid.
## Merge notes
-- fix/windows-pen-ui conflicts in App.h / Tablet.cpp: it splits `keyMods()` out of `inputMods()`. Resolve as `inputMods(bool latch)` = keyMods() + pen buttons + my latch block at the end; keep both declarations.
-- fix/inbox-0107 and feat/view-gizmo-size: no conflicts with this branch (their whats_new.sfui conflict is with main). No branch binds G or J.
-- UiLayout version 4: if another branch also bumps the layout version, take the higher number and keep both migrations.
+- Merged origin/merge/0.10.9 (ea476e3). The latch now sits on top of inbox-0107's keyMods(): inputMods(bool latch) = keyMods() + pen buttons + latch. It coexists with cursor-look's Strokes ring (J) and stroke.type.* actions, and with precision's Steady Stroke (L). Guide text uses Edit > Preferences paths.
+- UiLayout version 4 (the stroke popup's left-shelf button).
## Files for Tony
REPLY.md: Discord reply draft, no signature. TESTERS.md: #testers checklist (Windows tablets first).
diff --git a/TESTERS.md b/TESTERS.md
index 6fca4df1..ad0cfc10 100644
--- a/TESTERS.md
+++ b/TESTERS.md
@@ -6,4 +6,4 @@
- **Pen tablets (Windows first)**: hover the pen (tip up) while holding G, move onto an item, let go of G. Then tap G and tap an item with the pen tip. Does the tip tap ever sculpt the model under the grid? Tell us your tablet model and driver.
- Click the grid button under the **Stroke** tile on the left shelf: does the grid open next to it?
- At 150% / 200% Windows scaling, are the icons, labels and the key hints (Alt, Shift, Ctrl) sharp and not cut off? Send a screenshot.
-- Blender input style: is it **N** there (G stays the Move brush)?
+- Blender input style: is it **Z** there (G stays the Move brush)?
diff --git a/docs/guide/sculpting.md b/docs/guide/sculpting.md
index bb5f3c10..e1443641 100644
--- a/docs/guide/sculpting.md
+++ b/docs/guide/sculpting.md
@@ -353,7 +353,7 @@ Notes:
### The stroke popup
-Press <kbd>G</kbd> (<kbd>N</kbd> in the Blender style) for a grid under the cursor, or click the grid button under
+Press <kbd>G</kbd> (<kbd>Z</kbd> in the Blender style) for a grid under the cursor, or click the grid button under
the **Stroke** tile on the left shelf. The top row holds the stroke types, the bottom row the modifiers:
| Modifier | What it does | Instead of holding |
diff --git a/docs/guide/shortcuts.md b/docs/guide/shortcuts.md
index fe6b6f7d..4eefd4c0 100644
--- a/docs/guide/shortcuts.md
+++ b/docs/guide/shortcuts.md
@@ -134,6 +134,7 @@ generated from SculptForge's action registry, the same source as the Controls wi
| Action | Keys | What it does |
|---|---|---|
| Steady Stroke | <kbd>L</kbd> | Steady Stroke on or off, with every stroke type (Dots, Drag Stamp, Slide Stamp, Spray): the brush trails the cursor on a string and only moves once the string is taut, for steady lines without hand shake. |
+| Stroke popup | <kbd>G</kbd> | A grid at the cursor with the stroke types and the modifiers (Add / Sub, Smooth, Mask, Select). Hold the key, point at one and let go; or tap the key and click. Smooth, Mask and Select stay on without holding Shift or Ctrl, until you pick them again or another brush. |
### Tool
@@ -141,6 +142,7 @@ generated from SculptForge's action registry, the same source as the Controls wi
|---|---|---|
| Clear Mask | <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>A</kbd> | Unmask everything (also: Ctrl+drag on the background, away from the model). |
| Divide | <kbd>Ctrl</kbd>+<kbd>D</kbd> | Add a subdivision level: four times the polygons, and the lower levels are kept, so you can step down to shape big forms and back up to the detail. Quads stay quads (Catmull-Clark). Smt off divides without smoothing. |
+| Duplicate Part | <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>D</kbd> | Copy the active Part, with its layers and attributes, and make the copy active (also in the Parts list's right-click menu). |
| Group Masked | <kbd>Ctrl</kbd>+<kbd>W</kbd> | Turn the masked part into a new face group and clear the mask (ZBrush Ctrl+W). With nothing masked, everything visible becomes one group. |
| Higher Res | <kbd>D</kbd> | Step one subdivision level up (more polygons, for detail). Edits made below carry the detail along. |
| Invert Mask | <kbd>Ctrl</kbd>+<kbd>I</kbd> | Mask what is unmasked and unmask what is masked (also: Ctrl+click the background). |
diff --git a/docs/guide/whats-new.md b/docs/guide/whats-new.md
index 343bc28f..629718f7 100644
--- a/docs/guide/whats-new.md
+++ b/docs/guide/whats-new.md
@@ -35,7 +35,7 @@ image: images/wn-whats-new.jpg
action: guide:whats-new.md
```
-- **Stroke popup**: press <kbd>G</kbd> (<kbd>N</kbd> in the Blender style) or the button under the **Stroke**
+- **Stroke popup**: press <kbd>G</kbd> (<kbd>Z</kbd> in the Blender style) or the button under the **Stroke**
tile for a grid at the cursor: the stroke types plus **Add**, **Sub**, **Smooth**, **Mask** and **Select**. Hold
the key, point and let go, or tap it and click. Smooth, Mask and Select stay on without holding
<kbd>Shift</kbd> or <kbd>Ctrl</kbd>. See [Strokes](sculpting.md#the-stroke-popup).
diff --git a/src/app/App.h b/src/app/App.h
index ae472964..fcddf2b9 100644
--- a/src/app/App.h
+++ b/src/app/App.h
@@ -1856,7 +1856,7 @@ private:
int ran = -1; // the slot run last (UI tests)
} radial_;
// ---- The stroke popup (StrokePopup.cpp, core/StrokePopup.h; Discord 11-02) ----
- // One key (stroke.popup, G; N in the Blender style) or the left shelf's button opens a grid at the cursor: the
+ // One key (stroke.popup, G; Z in the Blender style) or the left shelf's button opens a grid at the cursor: the
// stroke types and the modifiers Add / Sub, Smooth, Mask, Select. Hold the key, point, let go: picked. Tap it:
// the grid stays open for a click (a stroke closes it, a modifier toggles and leaves it open). Esc cancels.
// Smooth, Mask and Select latch: strokes act as if Shift, Ctrl or Ctrl+Shift were held until the same item is
@@ -1878,6 +1878,7 @@ private:
bool held = false; // its key holds it open; false: tapped open, stays until a click or Esc
int key = 0; // the held key (SDL_Keycode)
int hover = -1; // the item under the pointer
+ int start = -1; // the item under the pointer when it opened (the current stroke, unless clamped)
int picked = -1; // the item picked last (UI tests)
} strokePopup_;
struct StrokeLatchState {
diff --git a/src/app/Input.cpp b/src/app/Input.cpp
index f79989f1..87660c52 100644
--- a/src/app/Input.cpp
+++ b/src/app/Input.cpp
@@ -364,7 +364,7 @@ void App::applyInputStyle() {
{"draw.paint", {"P", "P", ""}},
{"ui.picker.material", {"M", "M", ""}},
{"stroke.lazy", {"L", "L", "L / Shift+S"}},
- {"stroke.popup", {"G", "G", "N"}}, // (Blender's G is its Move brush; J opens the Strokes radial menu)
+ {"stroke.popup", {"G", "G", "Z"}}, // (Blender's G is its Move brush; J opens the Strokes radial menu)
{"mask.clear", {"Ctrl+Shift+A", "Ctrl+Shift+A", "Alt+M / Ctrl+Shift+A"}},
{"geometry.lower_res", {"Shift+D", "Shift+D", "Alt+1 / Shift+D"}},
{"geometry.higher_res", {"D", "D", "Alt+2 / D"}},
diff --git a/src/app/StrokePopup.cpp b/src/app/StrokePopup.cpp
index adc83d57..5ad141a7 100644
--- a/src/app/StrokePopup.cpp
+++ b/src/app/StrokePopup.cpp
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
// The stroke popup (Discord 11-02: "a popup for stroke type selection; the constant Ctrl+Shift / Alt combinations
-// interrupt the thought process"). One key (stroke.popup: G, N in the Blender style) or the left shelf's button
+// interrupt the thought process"). One key (stroke.popup: G, Z in the Blender style) or the left shelf's button
// opens a plain grid at the cursor, the current stroke under the pointer: the stroke types, then Add / Sub and
// the latched modifiers Smooth, Mask and Select. Hold the key, point, let go: picked (a pen hovering works the
// same). Tap the key: the grid stays open; a click on a stroke picks it and closes, a click on a modifier toggles
@@ -106,6 +106,7 @@ void App::openStrokePopup(bool held, int key) {
strokePopup_.held = held;
strokePopup_.key = key;
strokePopup_.hover = -1;
+ strokePopup_.start = g.itemAt({mouseX_ - at.x, mouseY_ - at.y});
}
void App::pickStrokePopupItem(int item, bool close) {
@@ -133,9 +134,10 @@ void App::strokePopupKeyUp(SDL_Keycode key) {
const StrokePopupGeometry g = popupGeometry(uiScale_);
const int item = g.itemAt({mouseX_ - strokePopup_.at.x, mouseY_ - strokePopup_.at.y});
const bool tap = ImGui::GetTime() - strokePopup_.openedAt < kStrokePopupTapSeconds;
- // It opens with the current stroke under the pointer: let go there quickly and it was a tap (stays open for a
- // click); pointed at another item, or held a moment, and let go: that item.
- if (item >= 0 && (!tap || item != int(strokeType_))) {
+ // Let go quickly over the item it opened under (the current stroke, or another one where the grid had to move
+ // to stay on the canvas) and it was a tap: it stays open for a click. Pointed at another item, or held a
+ // moment, and let go: that item.
+ if (item >= 0 && (!tap || item != strokePopup_.start)) {
pickStrokePopupItem(item, true);
return;
}
diff --git a/tests/ui/stroke_popup.sfui b/tests/ui/stroke_popup.sfui
index afb023e0..29e982f6 100644
--- a/tests/ui/stroke_popup.sfui
+++ b/tests/ui/stroke_popup.sfui
@@ -1,4 +1,4 @@
-# The stroke popup (Discord 11-02): G (N in the Blender style) opens a grid at the cursor with the stroke types and
+# The stroke popup (Discord 11-02): G (Z in the Blender style) opens a grid at the cursor with the stroke types and
# the modifiers Add / Sub, Smooth, Mask, Select, the current stroke under the pointer. Hold G, point, let go:
# picked. Tap G: it stays open; a click on a stroke picks it and closes, a click on a modifier toggles it and stays
# open, Esc or a click beside it closes it; the click never reaches the model. Smooth, Mask and Select latch:
@@ -79,8 +79,11 @@ expect_value masked == $m
expect_value camera_aligned == 0
camera 0 0
-# Picked again: off. Add back on; a stroke sculpts again.
+# Tapped near the canvas edge (the grid moves left to stay on the canvas, so another item is under the pointer):
+# still a tap, it stays open and picks nothing. Then Mask picked again: off. Add back on.
key g
+expect_value stroke_popup_open == 1
+expect_value stroke_type == 0
stroke_popup_item mask click
expect_value stroke_latch == 0
stroke_popup_item add click
@@ -119,10 +122,10 @@ stroke_popup_item dots click
expect_value stroke_popup_open == 0
expect_value stroke_type == 0
-# The ZBrush style: G too. The Blender style: N (its G is the Move brush, J the Strokes radial menu).
+# The ZBrush style: G too. The Blender style: Z (its G is the Move brush, J the Strokes radial menu).
input_style zbrush
expect_shortcut stroke.popup G
expect_value shortcut_conflicts == 0
input_style blender
-expect_shortcut stroke.popup N
+expect_shortcut stroke.popup Z
expect_value shortcut_conflicts == 0