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.

SpaceMouse echo: read the cap as it is now (the first push's echo comes before the frame reads it); pen_press hovers a frame first; guide: suspended 3DxWare for Mac still emulates

islandmed1a5ad5e80148
diff --git a/docs/guide/navigation.md b/docs/guide/navigation.md
index 1d21016d..86a14d4c 100644
--- a/docs/guide/navigation.md
+++ b/docs/guide/navigation.md
@@ -176,6 +176,7 @@ These settings save themselves.
a game controller, which is how SculptForge reads it. If SculptForge sees the SpaceMouse with 3DxWare running,
give the buttons a job in only one of the two places, or one press does two things.
- **macOS:** the same applies to 3DxWare for Mac: quit it (or uninstall it) and plug the SpaceMouse in again.
+ Suspending it isn't enough: suspended, it can still move the pointer and scroll while you push the cap.
- **Linux:** if **spacenavd** is running, it normally opens the device exclusively. SculptForge may still list
the SpaceMouse but get no motion from it. Stop it while you sculpt (`sudo systemctl stop spacenavd`). SculptForge
reads the device through `/dev/input` as a joystick: that works when the kernel reports the cap's axes as
diff --git a/src/app/SpaceMouse.cpp b/src/app/SpaceMouse.cpp
index b3ac1b9d..3b7519c9 100644
--- a/src/app/SpaceMouse.cpp
+++ b/src/app/SpaceMouse.cpp
@@ -221,12 +221,14 @@ void App::regrabAfterViewMove() {
// toward it (fenix, Discord 11-06). While the cap moves the view, only the pen and touch move the cursor; a mouse's
// buttons still click.
bool App::spaceMouseEcho(const SDL_Event& e) const {
- if (!spaceMousePushed_) return false;
SDL_MouseID which = 0;
if (e.type == SDL_EVENT_MOUSE_MOTION) which = e.motion.which;
else if (e.type == SDL_EVENT_MOUSE_WHEEL) which = e.wheel.which;
else return false;
- return which != SDL_PEN_MOUSEID && which != SDL_TOUCH_MOUSEID;
+ if (which == SDL_PEN_MOUSEID || which == SDL_TOUCH_MOUSEID) return false;
+ // (The cap as it is now, too: the echo of its first push comes in the same batch of events as the push, before
+ // the frame reads the axes.)
+ return spaceMousePushed_ || spaceMouseDeflected();
}
bool App::sixDofPointerEvent(const SDL_Event& e) {
diff --git a/src/app/UiTest.cpp b/src/app/UiTest.cpp
index 59a507d5..9ffa6868 100644
--- a/src/app/UiTest.cpp
+++ b/src/app/UiTest.cpp
@@ -2747,10 +2747,13 @@ bool Demo::parseStep(int line, const std::vector<std::string>& w, std::string& e
} else if (verb == "pen_press") {
if (!need(2)) return false;
const float u = num(1, 0.5f), v = num(2, 0.5f), pressure = num(3, 0.5f);
- run([this, u, v, pressure] {
+ run([this, u, v] {
if (!penIn_) penProximity(true);
const ImVec2 p = onModel(u, v);
penMove(p.x, p.y);
+ });
+ wait(0.05f); // (the panels let go of the pointer first: ImGui's WantCaptureMouse is a frame behind)
+ run([this, pressure] {
penTouch(true, false);
penPressure(pressure);
penPressed_ = true;