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
AI flow: dialogs centred from their first frame, guide re-centred on a UI scale change, no brush ring over a live-mode question, visible empty radios
islandmed3223ff25a20d
diff --git a/src/app/App.cpp b/src/app/App.cppindex d0809779..93cd592f 100644--- a/src/app/App.cpp+++ b/src/app/App.cpp@@ -2892,6 +2892,7 @@ void App::drawUi() {uvToolActive();if (((!ImGui::GetIO().WantCaptureMouse && canvasRect().contains(mouse.x, mouse.y)) || drag_ == Drag::Stroke) &&!hideBrushCursor_ && radial_.menu < 0 && !strokePopup_.open && drag_ != Drag::Select && drag_ != Drag::Guide && // (no ring under a pie or the stroke popup)+ aiLinkStateValue() != 2 && aiLinkStateValue() != 4 && // (nor over a live-mode question: it is drawn above windows)(!ringOff || drag_ == Drag::Stroke || ctrlDown(inputMods())))drawBrushCursor();drawSelectionOverlay();diff --git a/src/app/App.h b/src/app/App.hindex be13451f..7fd001df 100644--- a/src/app/App.h+++ b/src/app/App.h@@ -442,6 +442,7 @@ private:bool showAbout_ = false;bool showConnectAi_ = false; // Help > Connect an AI tool (PanelConnectAi.cpp; only while AI is on)std::string connectClient_ = "claude_code"; // its "Pick your tool" choice (a connect::Client id)+ float connectScale_ = 0.0f; // the UI scale it was last placed forvoid drawConnectAi();// Supporting SculptForge (Support.h): the app only ever opens the membership page or its Stripe checkout links in the// browser; nothing else changes.diff --git a/src/app/PanelAiLink.cpp b/src/app/PanelAiLink.cppindex d7e05789..37f74a2b 100644--- a/src/app/PanelAiLink.cpp+++ b/src/app/PanelAiLink.cpp@@ -45,7 +45,7 @@ double seconds() { return double(SDL_GetTicksNS()) * 1e-9; }// The dialogs look like the app's others (Save changes?, Delete brush): text wrapped at one width, the answer first// and the refusal second, both buttons one width (110 px, wider only if a translation needs it).-constexpr float kDialogWrap = 360.0f;+constexpr float kDialogWrap = 400.0f;float dialogButtonWidth(const char* const (&labels)[2], float scale) {float w = 110.0f * scale;for (const char* l : labels)@@ -640,7 +640,7 @@ void App::drawAiLink() {ImGuiWindowFlags_AlwaysAutoResize;if (s.approving && s.session->state() == link::AiLinkSession::State::Pairing) {- ImGui::SetNextWindowPos(centre, ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));+ ImGui::SetNextWindowPos(centre, ImGuiCond_Always, ImVec2(0.5f, 0.5f)); // (Appearing: an auto-sized window has no size yet)if (std::exchange(s.focusDialog, false)) ImGui::SetNextWindowFocus();bool open = true;if (ImGui::Begin(tr("Let an AI tool control this window?###ailinkapprove"), nullptr, dialog)) {@@ -705,7 +705,7 @@ void App::drawAiLink() {ImGui::PopStyleVar();if (!s.confirm) return;- ImGui::SetNextWindowPos(centre, ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));+ ImGui::SetNextWindowPos(centre, ImGuiCond_Always, ImVec2(0.5f, 0.5f)); // (Appearing: an auto-sized window has no size yet)if (std::exchange(s.focusDialog, false)) ImGui::SetNextWindowFocus();bool open = true;bool allow = false;diff --git a/src/app/PanelConnectAi.cpp b/src/app/PanelConnectAi.cppindex 3adc8b55..026bb7c6 100644--- a/src/app/PanelConnectAi.cpp+++ b/src/app/PanelConnectAi.cpp@@ -18,6 +18,7 @@#include <filesystem>#include <iterator>#include <string>+#include <utility>namespace sf {@@ -79,12 +80,15 @@ void codeBox(const std::string& text, const std::string& id, ImFont* mono) {void App::drawConnectAi() {if (!showConnectAi_) return;- if (aiLinkStateValue() == 2) return; // the Approve dialog takes its place (never two dialogs stacked)+ // The Approve or Allow dialog takes its place while it is open: never two dialogs stacked.+ if (const int live = aiLinkStateValue(); live == 2 || live == 4) return;const float s = uiScale_;const ImGuiViewport* vp = ImGui::GetMainViewport();const float w = std::min(640.0f * s, vp->WorkSize.x - 32.0f * s);ImGui::SetNextWindowSizeConstraints(ImVec2(w, 0), ImVec2(w, vp->WorkSize.y - 32.0f * s));- ImGui::SetNextWindowPos(vp->GetCenter(), ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));+ // Centred when it opens and again when the UI scale changes (it would hang off the window's edge).+ const bool rescaled = std::exchange(connectScale_, s) != s;+ ImGui::SetNextWindowPos(vp->GetCenter(), rescaled ? ImGuiCond_Always : ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));if (!ImGui::Begin((std::string(tr("Connect an AI tool")) + "###connect_ai").c_str(), &showConnectAi_,ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_AlwaysAutoResize)) {ImGui::End();@@ -95,6 +99,9 @@ void App::drawConnectAi() {launch.args.push_back("--attach"); // live mode: the tool works in this window (headless --mcp: the user guide)launch.name = "sculptforge-live";const std::vector<connect::Client> all = connect::clients(launch, os);+ // The radio buttons and the switch on the button colour: an empty one must not vanish into the window (Classic).+ ImGui::PushStyleColor(ImGuiCol_FrameBg, ImGui::GetStyleColorVec4(ImGuiCol_Button));+ ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImGui::GetStyleColorVec4(ImGuiCol_ButtonHovered));ImGui::TextWrapped("%s", tr("The AI blocks out a starting point and shows you options; you do the art."));// 1. The tool: the three most asked for as buttons, every other one in a list.@@ -148,7 +155,7 @@ void App::drawConnectAi() {if (ImGui::SmallButton((std::string(ICON_LC_BOOK_OPEN " ") + tr("Their documentation")).c_str())) SDL_OpenURL(c.docs);if (const std::vector<const char*> notes = connect::planNotes(c.plan); !notes.empty()) {ImGui::SameLine();- ImGui::TextDisabled("%s", tr("Plans and sign-in"));+ ImGui::TextDisabled(ICON_LC_INFO " %s", tr("Plans and sign-in"));if (ImGui::IsItemHovered()) {ImGui::BeginTooltip();ImGui::PushTextWrapPos(420.0f * s);@@ -192,6 +199,7 @@ void App::drawConnectAi() {ImGui::TextWrapped("%s", prompt.c_str());}+ ImGui::PopStyleColor(2);ImGui::Separator();if (ImGui::Button(tr("User guide: AI agents"))) guide_.open("scripting.md");ImGui::SameLine();