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.
C++ 3d3d-sculptingcppdear-imguidigital-sculptingfbxgame-developmentgaussian-splattinggltfimage-to-3dmcpopenglopenusdsculptingtext-to-3dunreal-engine
Merge fix/windows-pen-ui (0.10.9, #95 #72)
islandmedef58bc10ac21
diff --cc CHANGELOG.mdindex 677ff60a,ec5425e0..c6867c20--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -106,26 -78,27 +106,40 @@@ All notable changes to SculptForge aresculpt keymap does, instead of turning the view (#77, reported by TheRedWaxPolice). Beside the model Alt+drag stillturns the view, and Alt+Shift+drag pans anywhere. Shift+F (Strength) sets the brush's Intensity instead of Smooth's.- UI test runs remove their temporary settings folder when they pass (thousands of runs had filled `/tmp`).+- Tablets (a Wacom Intuos 3 report): a tablet plugged in after launch works without a restart ("Tablet connected" /+ "Tablet disconnected" in the status bar), also through Wacom Bridge; on Windows, pressure now also comes from the+ Wacom driver with "Use Windows Ink" off (Wintab); a pen without pressure draws at full strength instead of not at+ all, and Preferences > Input and > Tablet say "Pressure: on" or "not detected" with a troubleshooting link. The+ view no longer jumps when the pen comes back into range elsewhere or leaves mid-drag. The active Part changes only+ with the keyboard's Alt and a quick click (not with a pen button set to Alt, a long pen press or quick pen taps),+ and the status bar says "Active Part: <name> (Alt+click)".+- The enlarged brush or alpha thumbnail you point at in a picker is drawn over its neighbours again, not+ under them (#86, thanks tristratos).+- The enlarged brush or alpha thumbnail you point at in a picker is drawn over its neighbours again, not+ under them (#86, thanks tristratos).+- The brush centre now sits exactly under the cursor at high zoom and on HiDPI screens: the brush's ray is worked+ out from the camera directly, and the view is drawn on whole pixels where the rays are cast (it could be up to+ half a pixel off). The surface point under the brush is lightly filtered, so strokes on dense meshes no longer+ wobble.+- Preferences > Interface > UI scale applies at once: text, controls and panels resize live, no restart (#87).+ Before, the choice waited for the next start and was lost unless Store Config saved it. Automatic now follows+ the monitor the window is on: on Windows (per-monitor DPI v2, now declared in the app's manifest) dragging the+ window between a 100 % and a 150 % monitor, or changing Settings > Display > Scale, rescales the UI right away.+ - The pen picks a brush, then stops clicking the panels and the canvas until the mouse is used (#95; Huion Kamvas,+ display tablets, Wacom with Windows Ink on or off): SDL 3.2 keeps one "a pen is touching" flag for all pens, and+ once Windows took a pen away while it touched (a drag capturing the mouse), it made no mouse events for any pen+ again. SculptForge now makes the pen tip's mouse events from the pen's own and ignores SDL's, lets go of the+ button whenever the pen leaves, and ignores the mouse presses some drivers (Huion) send beside the pen's, whose+ release may never come. A replay test covers Windows Ink, a Huion-style pen + mouse stream, SDL's stuck state and+ Wintab-style input.+ - Tablet Mouse mode (#72, 0.10.8): it followed the system cursor, which with the tablet driver in pen mode is where+ the pen is, so it felt the same as Pen mode. Now only the pen's movement moves the cursor, with no jump when the+ pen comes back elsewhere, and while the pen is in range the arrow is drawn at the brush (the system's, at the+ pen's place on the tablet, is hidden), so arrow, brush and clicks agree.+ - With two screens, moving the pointer to the other screen made SculptForge draw as if it were in the background+ until the pointer came back (Windows 11). It now keeps drawing after any input while its window has focus,+ wherever the pointer is, and rests only when it loses focus.-- Tablets (a Wacom Intuos 3 report): a tablet plugged in after launch works without a restart ("Tablet connected" /- "Tablet disconnected" in the status bar), also through Wacom Bridge; on Windows, pressure now also comes from the- Wacom driver with "Use Windows Ink" off (Wintab); a pen without pressure draws at full strength instead of not at- all, and Preferences > Input and > Tablet say "Pressure: on" or "not detected" with a troubleshooting link. The- view no longer jumps when the pen comes back into range elsewhere or leaves mid-drag. The active Part changes only- with the keyboard's Alt and a quick click (not with a pen button set to Alt, a long pen press or quick pen taps),- and the status bar says "Active Part: <name> (Alt+click)".+## [0.10.8] - 2026-11-02### Fixeddiff --cc docs/guide/whats-new.mdindex 2e4e5495,1274d4c3..74f9fe10--- a/docs/guide/whats-new.md+++ b/docs/guide/whats-new.md@@@ -79,28 -86,6 +79,35 @@@ action: guide:whats-new.mand the status line tells you. Your own model choice is kept. See [Image and text to 3D](generate-3d.md).- **Generated models arrive as clean quads**: Quad Remesh is now the default, with one subdivision level holdingthe detail, so you can sculpt and subdivide straight away. Voxel remesh and Off are still in **Remesh**.+- **Hover highlights that pop**: buttons, menus and shelves light up in your look's accent as you point at them,+ tiles lift a little, sliders show their exact value, and the keyboard focus gets the same ring. Prefer less+ movement? Turn on **Preferences > Interface > Reduce motion** ([Interface](interface.md)).+- **Picker thumbnails on top**: the enlarged thumbnail you point at in a picker is no longer hidden under its+ neighbours (#86).+- **Hover highlights that pop**: buttons, menus and shelves light up in your look's accent as you point at them,+ tiles lift a little, sliders show their exact value, and the keyboard focus gets the same ring. Prefer less+ movement? Turn on **Preferences > Interface > Reduce motion** ([Interface](interface.md)).+- **Picker thumbnails on top**: the enlarged thumbnail you point at in a picker is no longer hidden under its+ neighbours (#86).+- **Focus Detail (experimental)**: sculpt a head of a billion micro triangles from one compressed file. Detail+ loads where you look and where the brush is heading, and the rest shows a lighter version. Saving writes only+ what you changed. Try it with `sculptforge --benchmark standard-1b` (Linux and macOS for now).+- **Precision work** for pores, wrinkles, jewellery and trims: **Steady Stroke** (<kbd>L</kbd>) with every stroke+ type and a catch-up on release; **World Size**, so the brush keeps its size in mm on the surface as you zoom;+ Draw Size down to 0.5 px with <kbd>Shift</kbd>+<kbd>[</kbd> / <kbd>]</kbd> for 1 px steps; hold+ <kbd>Shift</kbd>+<kbd>Alt</kbd> while drawing to move the brush at a quarter of the pen's speed; and a pressure+ curve for each brush with a **Fine detail** preset. The brush centre now sits exactly under the cursor at any+ zoom. See [Precision work](sculpting.md#precision-work).+- **UI scale works live**: **Preferences > Interface > UI scale** (100% to 200%) resizes text and panels at once,+ no restart. **Automatic** follows the monitor the window is on, so on Windows moving it between a 100% and a+ 150% monitor rescales it right away (#87). See [The interface](interface.md#interface-preferences).++- **The pen keeps working the panels**: with some tablets (Huion, pen displays, Wacom with Windows Ink on or off)++ the pen picked one brush, then stopped clicking menus and the canvas until you used the mouse. SculptForge now++ makes the pen's clicks itself (#95). See [Troubleshooting](troubleshooting.md#pen-tablets).++- **Mouse mode is relative again**: with **Mouse mode** on (Preferences > Tablet) the pen moves the cursor by how++ far it moves, whatever the driver's mode, and the arrow is drawn right at the brush (#72).++- **Two screens**: SculptForge no longer slows down when the pointer is on your other screen; it rests only when++ its window loses focus.## Version 0.10.8diff --cc src/app/App.cppindex dca88bf2,84e9e8f0..ef4496b2--- a/src/app/App.cpp+++ b/src/app/App.cpp@@@ -606,9 -698,22 +608,23 @@@ void App::redrawIn(double seconds)redrawAt_ = redrawAt_ > 0.0 ? std::min(redrawAt_, at) : at;}+ // With two screens the pointer often rests on the other one while the keyboard works here: no pointer events+ // then, so nothing kept the frames coming and the app looked as if in the background until the pointer came back+ // (Discord, Windows 11). Whether the app is in use follows the window's focus, never the pointer: while focused,+ // it keeps drawing for a while after any input (keys included) and while a key is held.+ bool App::focusKeepsDrawing(double now) const {+ if (!windowFocused_) return false;+ if (now - lastInputAt_ < kFocusedActiveSeconds) return true;+ int n = 0;+ const bool* keys = SDL_GetKeyboardState(&n);+ for (int i = 0; keys && i < n; ++i)+ if (keys[i]) return true;+ return false;+ }+bool App::wantsFrames(double now) const {- return now < activeUntil_ || drag_ != Drag::None || ui::HoverAnimating() || // a hover ring easing in or out- return now < activeUntil_ || focusKeepsDrawing(now) || drag_ != Drag::None || doc_.sculptor.strokeActive() ||++ return now < activeUntil_ || focusKeepsDrawing(now) || drag_ != Drag::None || ui::HoverAnimating() || // a hover ring easing in or out+ doc_.sculptor.strokeActive() ||!dabQueue_.empty() || // a stroke's dabs still waiting (drainStrokeDabs) are placed a few each framestrokeFinishing_ || solverBusy() || // the solver thread is placing a stroke's dabs (AsyncStroke.cpp)backgroundBusy() || playingLayer_ >= 0 || faceTakePlaying_ ||diff --cc src/app/App.hindex 55e9ce58,c7df434d..368bd64e--- a/src/app/App.h+++ b/src/app/App.h@@@ -144,9 -142,10 +144,10 @@@ publicprivate:enum class Drag { None, Stroke, Orbit, Pan, Zoom, Roll, MaskCanvas, SubToolClick, Select, Gizmo, Guide, Sculptable, ZSphere, Insert, Capture,- AirStroke, UvTool }; // AirStroke: a stroke begun off the model, waiting to reach it (#62)+ AirStroke, UvTool, SizeScrub }; // AirStroke: a stroke begun off the model, waiting to reach it (#62)- void handleEvent(const SDL_Event& e);+ void handleEvent(const SDL_Event& e); // the pen's mouse events first (penMouseEvents), then dispatchEvent+ void dispatchEvent(const SDL_Event& e);void onMouseDown(float x, float y, Uint8 button);void onMouseMove(float x, float y, float dx, float dy, bool fromPen);void onMouseUp();@@@ -1855,15 -1777,18 +1860,18 @@@ publicvoid redrawIn(double seconds); // something on screen changes by itself later (an error colour fading)private:// ---- Tablet (Tablet.cpp, core/Tablet.h, docs/tablet.md) ----- // SDL turns pen tip contact into left mouse button events (SDL_PEN_MOUSEID); the pen's own events- // add pressure, tilt, the eraser end and the side buttons, which are mapped in Preferences > Tablet.- bool dropPenMouseEvent(const SDL_Event& e) const; // SDL's version-dependent clicks for pen buttons- bool strayMouseMotion(const SDL_Event& e) const; // a driver's mouse motion beside the pen's (Tablet.cpp)+ // The pen tip is a left mouse button (SDL_PEN_MOUSEID) for the canvas and the UI. The app makes those mouse+ // events from the pen's own (penMouseEvents), not SDL (#95); the pen's events add pressure, tilt, the eraser+ // end and the side buttons, which are mapped in Preferences > Tablet.+ bool dropPenMouseEvent(const SDL_Event& e) const; // SDL's own mouse events for the pen (Tablet.cpp)+ void penMouseEvents(const SDL_Event& pen, bool before); // the pen tip's mouse events, made from the pen's+ void sendPenMouse(SDL_EventType type, float x, float y, SDL_WindowID window);+ bool strayMouseMotion(const SDL_Event& e) const; // a driver's mouse events beside the pen's (Tablet.cpp)void keepImGuiOnPen(); // after ImGui_ImplSDL3_NewFrame (Tablet.cpp)- bool systemCursorInWindow(float& x, float& y) const; // mouse mode (#72): the system cursor, window pixels+ bool penSoftCursor() const; // mouse mode with the pen: the arrow is drawn at the brush (Tablet.cpp)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 --cc src/app/UiTest.cppindex 18fa3154,d189d24b..12ccff7e--- a/src/app/UiTest.cpp+++ b/src/app/UiTest.cpp@@@ -91,11 -90,9 +91,11 @@@// symmetry_pivot_x (local symmetry's centre), timeline_top (1: the strip at the top),// timeline_y / axis_gizmo_y (their tops / centre, fractions of the canvas from its top),// style_window_min (ImGui's minimum window height, unscaled px: 32 in every look),- // tablet_mouse_mode (Preferences > Tablet > Mouse mode), os_cursor_x / os_cursor_y,+ // tablet_mouse_mode (Preferences > Tablet > Mouse mode),// 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),@@@ -800,12 -751,11 +810,14 @@@ double Demo::query(const std::string& napp_.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_;+ if (name == "focus_frames") return app_.focusKeepsDrawing(double(SDL_GetTicksNS()) * 1e-9) ? 1.0 : 0.0;+ if (name == "pen_mouse_down") return app_.penMouseDown_ ? 1.0 : 0.0;+ if (name == "ui_left_down") return ImGui::IsMouseDown(ImGuiMouseButton_Left) ? 1.0 : 0.0;+ if (name == "soft_cursor") return app_.penSoftCursor() ? 1.0 : 0.0; // Mouse mode: the app draws the arrowif (name == "ui_mouse_x") return ImGui::GetIO().MousePos.x; // where the panels see the pointerif (name == "ui_mouse_y") return ImGui::GetIO().MousePos.y;if (name == "cursor_x") return app_.mouseX_;