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 origin/main into feat/perf-news (support reminder gone: the tip no longer waits on it)
islandmed20814df7b550
diff --cc src/app/App.hindex 35a1298a,84eb2be6..01277bcc--- a/src/app/App.h+++ b/src/app/App.h@@@ -452,19 -454,11 +454,17 @@@ privatebool quickTourOffersInTests_ = false; // UI tests: the offer only after the script's quick_tour_offersstd::string flashSubpalette_; // a Tool sub-palette "Show me" opened: scrolled to and flashed (Palettes.cpp)double flashSubpaletteStart_ = 0.0;- double sculptSeconds_ = 0.0; // cumulative time in strokes (project.json)- bool supportReminderDone_ = false; // the reminder was shown (or turned off) once: never again (project.json)- bool supportReminderOpen_ = false;+ // The one big-mesh tip (BigMeshTip.h): the first scene over ~20M triangles; shown once, never again (project.json).+ bool bigMeshTipDone_ = false;+ bool bigMeshTipOpen_ = false;+ size_t sceneTrianglesWithMicro() const; // visible base triangles, micro levels counted in full+ void openPerformancePrefs(); // Preferences > Performance, opened and flashed+ void tickBigMeshTip(); // every frame (drawSupportUi): shows the tip when dueint discordRequests_ = 0; // UI tests: how often the Discord invite was asked forint supportPageRequests_ = 0; // UI tests: how often the page was asked for (only opened when interactive)- // The support card at launch (PanelSupportCard.cpp): decided once while starting, never mid-session.- struct SupportCard; // its animation state and the background picture (loaded on a worker thread)+ // The membership cards (Support.h, PanelSupportCard.cpp): the full card on the first start (and from Help >+ // Support), and the small card at good moments, at most once a week, until someone becomes a member.+ struct SupportCard; // the full card's animation statestruct SupportCardDelete { void operator()(SupportCard* c) const; }; // (defined where SupportCard is)std::unique_ptr<SupportCard, SupportCardDelete> supportCard_;SupportCardPrefs supportCardPrefs_; // project.jsondiff --cc src/app/BigMeshTip.hindex 4e781543,00000000..db05f054mode 100644,000000..100644--- a/src/app/BigMeshTip.h+++ b/src/app/BigMeshTip.h@@@ -1,31 -1,0 +1,31 @@@+// SculptForge - open source digital sculpting+// SPDX-License-Identifier: GPL-3.0-or-later+//+// The one big-mesh tip (PanelSupport.cpp draws it, PanelProject.cpp decides): the first time the scene holds more+// than about 20 million triangles (base meshes plus micro levels), a quiet note along the bottom of the view says+// dense meshes got faster and names the settings that matter for them. Shown once per install, never again after+// (project.json "big_mesh_tip_done", written the moment it shows).+#pragma once++#include <cstddef>+#include <cstdlib>++namespace sf {++inline constexpr size_t kBigMeshTipTriangles = 20'000'000;++// The threshold: kBigMeshTipTriangles, or SF_BIG_MESH_TIP_TRIANGLES (UI tests use a small sphere).+inline size_t bigMeshTipTriangles() {+ const char* env = std::getenv("SF_BIG_MESH_TIP_TRIANGLES");+ if (!env || !*env) return kBigMeshTipTriangles;+ const long long v = std::atoll(env);+ return v > 0 ? size_t(v) : kBigMeshTipTriangles;+}++// Whether the tip shows now: a scene over the threshold, never shown before, and nothing else on screen or in hand- // (a stroke, the welcome, What's New, the membership card, the quick tour, a benchmark): it waits for those.++// (a stroke, the welcome, What's New, a membership card, the quick tour, a benchmark): it waits for those.+inline bool bigMeshTipDue(size_t sceneTriangles, size_t threshold, bool alreadyShown, bool busy) {+ return !alreadyShown && !busy && threshold > 0 && sceneTriangles >= threshold;+}++} // namespace sfdiff --cc src/app/PanelProject.cppindex 92e72431,138d452c..8fe517cd--- a/src/app/PanelProject.cpp+++ b/src/app/PanelProject.cpp@@@ -113,14 -114,13 +115,14 @@@ void App::initProject()if (prefs["member_login"].isString()) memberLogin_ = prefs["member_login"].asString().substr(0, 39);if (prefs["update_channel"].isString())updateChannel_ = prefs["update_channel"].asString() == "preview" ? UpdateChannel::Preview : UpdateChannel::Stable;- sculptSeconds_ = addSculptTime(prefs["sculpt_seconds"].asNumber(0.0), 0.0);- supportReminderDone_ = prefs["support_reminder_done"].asBool(false);+ // The membership cards (Support.h). ("support_card": false, the old switch, and "supporter" from before+ // 0.11.1 are honoured as they were: a member said so.)+ supportCardPrefs_.supporter = prefs["supporter"].asBool(false) || !prefs["support_card"].asBool(true);+ bigMeshTipDone_ = prefs["big_mesh_tip_done"].asBool(false);- supportCardPrefs_.enabled = prefs["support_card"].asBool(true);- supportCardPrefs_.supporter = prefs["supporter"].asBool(false);supportCardPrefs_.shownAt = int64_t(prefs["support_card_shown_at"].asNumber(0));- supportCardPrefs_.laterAt = int64_t(prefs["support_card_later_at"].asNumber(0));- if (prefs["support_card_version"].isString()) supportCardPrefs_.shownVersion = prefs["support_card_version"].asString();+ supportCardPrefs_.hiddenUntil = int64_t(prefs["member_card_hidden_until"].asNumber(0));+ if (prefs["member_card_challenge"].isString())+ supportCardPrefs_.challengeSeen = prefs["member_card_challenge"].asString().substr(0, 32);discordPrefs_.enabled = prefs["discord_presence"].asBool(false); // Preferences > Integrations (PanelIntegrations.cpp)discordPrefs_.showChallenge = prefs["discord_challenge_shown"].asBool(false);discordPrefs_.showFileName = prefs["discord_file_name_shown"].asBool(false);@@@ -197,14 -197,10 +199,11 @@@ void App::saveProjectPrefs()prefs.set("update_channel", std::string(updateChannel_ == UpdateChannel::Preview ? "preview" : "stable"));prefs.set("member_builds", memberBuilds_ && !memberSessionOnly_);if (memberBuilds_ && !memberSessionOnly_ && !memberLogin_.empty()) prefs.set("member_login", memberLogin_);- prefs.set("sculpt_seconds", std::floor(sculptSeconds_)); // for the one support reminder (Support.h); stays here- prefs.set("support_reminder_done", supportReminderDone_);+ prefs.set("supporter", supportCardPrefs_.supporter); // the membership cards (Support.h)+ prefs.set("big_mesh_tip_done", bigMeshTipDone_); // the one big-mesh tip (BigMeshTip.h)- prefs.set("support_card", supportCardPrefs_.enabled); // the support card at launch (Support.h)- prefs.set("supporter", supportCardPrefs_.supporter);prefs.set("support_card_shown_at", double(supportCardPrefs_.shownAt));- prefs.set("support_card_later_at", double(supportCardPrefs_.laterAt));- if (!supportCardPrefs_.shownVersion.empty()) prefs.set("support_card_version", supportCardPrefs_.shownVersion);+ prefs.set("member_card_hidden_until", double(supportCardPrefs_.hiddenUntil));+ if (!supportCardPrefs_.challengeSeen.empty()) prefs.set("member_card_challenge", supportCardPrefs_.challengeSeen);prefs.set("discord_presence", discordPrefs_.enabled); // Preferences > Integrations (PanelIntegrations.cpp)prefs.set("discord_challenge_shown", discordPrefs_.showChallenge);prefs.set("discord_file_name_shown", discordPrefs_.showFileName);@@@ -229,25 -225,6 +228,25 @@@ void App::rememberRecent(const std::strsaveProjectPrefs();}+void App::tickBigMeshTip() {+ // Not in renders, recordings, demos or benchmarks; UI tests (a demo script) only when they set the threshold+ // (tests/ui/big_mesh_tip.sfui), so it never sits over another test's clicks.+ const char* testThreshold = std::getenv("SF_BIG_MESH_TIP_TRIANGLES");+ const bool uiTest = !options_.uiTest.empty();+ if (!options_.renderPath.empty() || !options_.recordPath.empty() || (demo_ && !uiTest) ||+ (uiTest && !(testThreshold && *testThreshold)) || options_.benchmark || proof_)+ return;- // It waits for a quiet moment (no stroke, no card, tour or reminder), then shows once.++ // It waits for a quiet moment (no stroke, no card or tour), then shows once.+ const bool busy = doc_.sculptor.strokeActive() || showWelcome_ || showWhatsNew_ || whatsNewOpen() || supportCardOpen() ||- quickTourOpen_ || supportReminderOpen_;++ quickTourOpen_;+ if (bigMeshTipDue(sceneTrianglesWithMicro(), bigMeshTipTriangles(), bigMeshTipDone_, busy)) {+ bigMeshTipDone_ = true; // once only, written now: a crash or a forced quit doesn't bring it back+ bigMeshTipOpen_ = true;+ saveProjectPrefs();+ redrawAt_ = double(SDL_GetTicksNS()) * 1e-9; // (a frame to show it, asleep or not)+ }+}+void App::tickProject(float dt) {updateTitle();if (!interactive() || prefDir_.empty()) return;diff --cc src/app/PanelSupport.cppindex 0438aeff,1e45863b..2df6c830--- a/src/app/PanelSupport.cpp+++ b/src/app/PanelSupport.cpp@@@ -144,9 -158,12 +158,13 @@@ void App::drawLookPicker()}void App::drawSupportUi() {+ tickBigMeshTip(); // (here, not in tickProject: this runs every frame, UI tests included)const float s = uiScale_;const CanvasRect c = canvasRect();+ // The small membership card (PanelSupportCard.cpp): the sculpting moment, and the card once the frame is calm.+ // (Here, not in tickProject: this runs every frame, UI tests included.)+ tickMemberCard(ImGui::GetIO().DeltaTime);+ drawMemberCard();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));@@@ -282,55 -299,6 +300,34 @@@ImGui::End();if (!open) chooseNewLook(false);}+ if (bigMeshTipOpen_ && !showWelcome_ && !supportCardOpen() && !whatsNew_ && !quickTourOpen_) {+ // The one big-mesh tip (BigMeshTip.h): a note along the bottom of the canvas, no focus taken, shown once.+ ImGui::SetNextWindowPos(ImVec2(c.x + c.w * 0.5f, c.y + c.h - 12.0f * s), ImGuiCond_Always, ImVec2(0.5f, 1.0f));+ ImGui::SetNextWindowSize(ImVec2(std::min(500.0f * s, c.w - 32.0f * s), 0.0f), ImGuiCond_Always);+ ImGui::SetNextWindowBgAlpha(0.96f);+ const ImGuiWindowFlags flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoResize |+ ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav;+ bool open = true;+ if (ImGui::Begin("Big meshes are faster now##bigmesh", &open, flags)) {+ ImGui::TextWrapped("On a dense scan with micro levels, big brushes now keep up with the pen and the view turns "+ "smoothly right after a stroke.");+ ImGui::Spacing();+ ImGui::TextWrapped("Two settings in Preferences > Performance help most on big meshes:");+ ImGui::Bullet();+ ImGui::TextWrapped("Background Preview (experimental): a big brush shows under the pen while it's still being worked out.");+ ImGui::Bullet();+ ImGui::TextWrapped("View resolution 75%%: draws about half the pixels, for integrated graphics and big screens.");+ ImGui::Spacing();+ if (ImGui::Button("Performance settings##bigmesh")) {+ openPerformancePrefs();+ open = false;+ }+ ImGui::SameLine();+ if (ImGui::Button("Got it##bigmesh")) open = false;+ }+ ImGui::End();+ if (!open) bigMeshTipOpen_ = false;+ }- if (supportReminderOpen_) {- // The one reminder: a small note along the bottom of the canvas, no focus taken, closed for good by any button.- ImGui::SetNextWindowPos(ImVec2(c.x + c.w * 0.5f, c.y + c.h - 12.0f * s), ImGuiCond_Always, ImVec2(0.5f, 1.0f));- ImGui::SetNextWindowBgAlpha(0.94f);- const ImGuiWindowFlags flags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize |- ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing |- ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoMove;- if (ImGui::Begin("##support_reminder", nullptr, flags)) {- ImGui::AlignTextToFramePadding();- ImGui::TextUnformatted("You've sculpted over ten hours in SculptForge. Members get betas early, a monthly "- "brush pack and a vote on what we build next.");- ImGui::SameLine();- if (ImGui::SmallButton("Membership...##reminder")) {- showSupportCard(SupportCardReason::Weekly); // the memberships, each a click from its checkout- supportReminderOpen_ = false;- }- ImGui::SameLine();- if (ImGui::SmallButton("Don't show again##reminder")) supportReminderOpen_ = false;- }- ImGui::End();- }}} // namespace sf