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
Bottom shelf: bigger brush tiles (Medium by default) and a Shelf tiles setting (Small / Medium / Large)
islandmedbea390e46f0e
diff --git a/docs/ui-design.md b/docs/ui-design.mdindex 939cbb02..a5ece89a 100644--- a/docs/ui-design.md+++ b/docs/ui-design.md@@ -62,7 +62,7 @@ All sizes are logical px at `uiScale_ = 1` and get multiplied by `uiScale_`. She| Top shelf | h 64 (two rows of 26 + padding) | from left-tray edge to right-tray edge || Left shelf | w 88 (tiles 76x76 + 12 label) | between top and bottom shelf || Right shelf | w 52 (buttons 44x40, icon + 10 px label) | between top and bottom shelf |-| Bottom shelf | h 60 (tiles 40 icon + 12 label) | same span as top shelf |+| Bottom shelf | h 78 (Medium tiles; Small h 60, Large h 96 - Preferences > Interface > Shelf tiles) | same span as top shelf || Console (closed by default) | h 160, drag 100-400 | above bottom shelf, same span || Tray divider | w 8 each side, always visible | top of palette bar to bottom || Right tray | w 300 (1600 wide) / 320 (>=1920), drag 240-480 | palette bar bottom to window bottom |@@ -219,7 +219,7 @@ Icon + tiny label, 44x40 each. Groups are separated by 8 px.Toggles that are on get an accent background.-### 3.6 Bottom shelf (h 60): quick brushes (ZBrush Core / Blender asset shelf)+### 3.6 Bottom shelf (h 78, Medium tiles): quick brushes (ZBrush Core / Blender asset shelf)Default contents, in order: Standard, Clay, ClayBuildup, DamStandard, Move, Smooth, Inflate, Pinch, Flatten, Crease, Trim, SnakeHook, Layer, Nudge, Paint. Then any custom brushes the user adds, and a `[+]` tile that opens the brush picker in "add to shelf" mode.Tiles are 40 px brush thumbnails with the name under them. The active brush gets an accent outline. Hotkey digits (1-9, 0) are drawn small in the tile's top-left. Right-click a tile: "Remove from shelf", "Assign shortcut...". Right-click in the brush picker: "Add to bottom shelf".diff --git a/src/app/Config.cpp b/src/app/Config.cppindex 4d6512cb..6ee38d3d 100644--- a/src/app/Config.cpp+++ b/src/app/Config.cpp@@ -784,6 +784,18 @@ void drawInterfaceSection(App& app) {ImGui::Checkbox("Left-handed layout", &app.layout().leftHanded);ui::HelpText("Left-handed layout", nullptr, "Mirror the shelves and trays: tools on the left, navigation on the right.","Preferences > Interface");+ {+ static const char* kTiles[] = {"Small", "Medium", "Large"};+ int& tiles = app.layout().shelfTiles;+ ImGui::SetNextItemWidth(-FLT_MIN);+ if (ImGui::BeginCombo("##shelf_tiles", (std::string("Shelf tiles: ") + kTiles[std::clamp(tiles, 0, 2)]).c_str())) {+ for (int i = 0; i < 3; ++i)+ if (ImGui::Selectable(kTiles[i], tiles == i)) tiles = i;+ ImGui::EndCombo();+ }+ ui::HelpText("Shelf tiles", nullptr, "How big the brush tiles on the bottom shelf are. Small leaves the most room for the model.",+ "Preferences > Interface");+ }static const char* kScales[] = {"Automatic", "100%", "125%", "150%", "175%", "200%"};static const float kScaleValues[] = {0.0f, 1.0f, 1.25f, 1.5f, 1.75f, 2.0f};int current = 0;diff --git a/src/app/Shell.cpp b/src/app/Shell.cppindex fe794a01..4de2f723 100644--- a/src/app/Shell.cpp+++ b/src/app/Shell.cpp@@ -1110,7 +1110,8 @@ void App::drawShelf(int shelf, const CanvasRect& r) {if (shelf == kShelfBottom) {const int tiles = int(std::count_if(list.begin(), list.end(), [](const std::string& id) { return id != "sep" && id != "row"; }));const float avail = r.w - 2.0f * pad.x - 48.0f * s; // the [+] tile is narrower- bottomTileW_ = std::clamp(avail / float(std::max(tiles - 1, 1)) - 4.0f * s, 44.0f * s, 58.0f * s);+ const shell::BottomShelfSize size = shell::bottomShelfSize(layout_.shelfTiles);+ bottomTileW_ = std::clamp(avail / float(std::max(tiles - 1, 1)) - 4.0f * s, size.tileMinW * s, size.tileMaxW * s);}ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(4.0f * s, 4.0f * s));bool lineStart = true;@@ -1307,7 +1308,7 @@ void App::drawShelfItem(int shelf, int index, const std::string& item, bool vertmode == 0 ? ICON_LC_HAND : mode == 1 ? ICON_LC_ZOOM_IN : ICON_LC_ROTATE_3D,mode == 0 ? "Move" : mode == 1 ? "Zoom" : "Rotate", mode);} else if (item == "widget.add_brush") {- const ImVec2 size(48.0f * s, 54.0f * s);+ const ImVec2 size(48.0f * s, shell::bottomShelfSize(layout_.shelfTiles).tileH * s);if (ImGui::InvisibleButton("##addbrush", size)) // the brush picker in "add to shelf" mode (Pickers.cpp)openBrushPickerForShelf(ImVec2(ImGui::GetItemRectMin().x, ImGui::GetItemRectMin().y - 8.0f * s));const bool hovered = ImGui::IsItemHovered();@@ -1324,7 +1325,7 @@ void App::drawShelfItem(int shelf, int index, const std::string& item, bool vertint found = -1;for (int i = 0; i < int(doc_.brushes.size()); ++i)if (doc_.brushes[size_t(i)].name == name) found = i;- const ImVec2 size(bottomTileW_, 54.0f * s);+ const ImVec2 size(bottomTileW_, shell::bottomShelfSize(layout_.shelfTiles).tileH * s);const bool clicked = ImGui::InvisibleButton((name + "##" + item).c_str(), size);const ImVec2 a = ImGui::GetItemRectMin(), b = ImGui::GetItemRectMax();ImDrawList* dl = ImGui::GetWindowDrawList();@@ -1354,7 +1355,7 @@ void App::drawShelfItem(int shelf, int index, const std::string& item, bool vertconst ui::Look look = shelf != kShelfTop ? ui::Look::Tile : a->icon ? ui::Look::IconLabel : ui::Look::Label;const ImVec2 size = shelf == kShelfTop ? ImVec2(0.0f, rowH): shelf == kShelfRight ? ImVec2(44.0f * s, 40.0f * s)- : shelf == kShelfBottom ? ImVec2(bottomTileW_, 54.0f * s)+ : shelf == kShelfBottom ? ImVec2(bottomTileW_, shell::bottomShelfSize(layout_.shelfTiles).tileH * s): ImVec2(winW - 2.0f * padX, 60.0f * s);centre(size.x);// Top shelf hierarchy, by meaning (docs/ui-design.md §10). Every item is the full row height in the samediff --git a/src/app/ShellGeometry.cpp b/src/app/ShellGeometry.cppindex df4b403f..513297d7 100644--- a/src/app/ShellGeometry.cpp+++ b/src/app/ShellGeometry.cpp@@ -47,7 +47,7 @@ ShellGeometry computeShell(const UiLayout& l, float W, float H, float s, float tconst float span = std::max(0.0f, right - left);const float topH = g.shelves ? kTopShelfH * s : 0.0f;- const float bottomH = g.shelves ? kBottomShelfH * s : 0.0f;+ const float bottomH = g.shelves ? bottomShelfSize(l.shelfTiles).shelfH * s : 0.0f;g.topShelf = {left, top, span, topH};g.bottomShelf = {left, H - bottomH, span, bottomH};const float consoleH = l.consoleOpen ? std::clamp(l.consoleHeight, kConsoleMinH, kConsoleMaxH) * s : 0.0f;diff --git a/src/app/ShellGeometry.h b/src/app/ShellGeometry.hindex 3297aef2..65ccb122 100644--- a/src/app/ShellGeometry.h+++ b/src/app/ShellGeometry.h@@ -27,8 +27,17 @@ struct ShellGeometry {// Logical sizes at scale 1 (docs/ui-design.md §2.1).namespace shell {constexpr float kTitleH = 24, kPaletteBarH = 22, kTopShelfH = 64, kLeftShelfW = 88, kLeftShelfNarrowW = 72;-constexpr float kRightShelfW = 52, kBottomShelfH = 60, kDividerW = 8, kTrayMinW = 240, kTrayMaxW = 480;+constexpr float kRightShelfW = 52, kDividerW = 8, kTrayMinW = 240, kTrayMaxW = 480;constexpr float kConsoleMinH = 100, kConsoleMaxH = 400, kNarrowWidth = 1280, kWideWidth = 1920;++// The bottom shelf for a Shelf tiles setting (UiLayout::shelfTiles): its height and its brush tiles' height and+// width range (tiles shrink to the minimum, the same for every size, before the shelf scrolls), logical px.+struct BottomShelfSize {+ float shelfH, tileH, tileMinW, tileMaxW;+};+constexpr BottomShelfSize bottomShelfSize(int tiles) {+ return tiles <= 0 ? BottomShelfSize{60, 54, 44, 58} : tiles == 1 ? BottomShelfSize{78, 72, 44, 78} : BottomShelfSize{96, 90, 44, 96};+}} // namespace shell// Effective tray width in logical px: the stored width, except that the standard 300 grows to 320 ondiff --git a/src/app/UiLayout.cpp b/src/app/UiLayout.cppindex b42ee9ac..a1d00186 100644--- a/src/app/UiLayout.cpp+++ b/src/app/UiLayout.cpp@@ -69,6 +69,7 @@ Json toJson(const UiLayout& l) {j.set("lightboxRows", double(l.lightboxRows));j.set("lightboxTab", l.lightboxTab);j.set("lightboxBottom", l.lightboxBottom);+ j.set("shelfTiles", double(l.shelfTiles));return j;}@@ -106,6 +107,7 @@ bool fromJson(const Json& j, UiLayout& l, std::string& error) {out.lightboxRows = int(j["lightboxRows"].asNumber(out.lightboxRows));if (j["lightboxTab"].isString()) out.lightboxTab = j["lightboxTab"].asString();flag("lightboxBottom", out.lightboxBottom);+ out.shelfTiles = std::clamp(int(j["shelfTiles"].asNumber(out.shelfTiles)), 0, 2);l = std::move(out);return true;}diff --git a/src/app/UiLayout.h b/src/app/UiLayout.hindex 4e7fd459..ba573afa 100644--- a/src/app/UiLayout.h+++ b/src/app/UiLayout.h@@ -34,6 +34,7 @@ struct UiLayout {int lightboxRows = 1;std::string lightboxTab = "project";bool lightboxBottom = false;+ int shelfTiles = 1; // bottom shelf brush tiles: 0 small, 1 medium, 2 large (shell::bottomShelfSize)bool customize = false; // runtime only, never stored};diff --git a/tests/test_shell_layout.cpp b/tests/test_shell_layout.cppindex 775904d3..82a50e7f 100644--- a/tests/test_shell_layout.cpp+++ b/tests/test_shell_layout.cpp@@ -25,26 +25,38 @@ bool rectIs(const CanvasRect& r, float x, float y, float w, float h) {TEST(shell_standard_layout_1600x960) {const ShellGeometry g = computeShell(standardLayout(), 1600, 960, 1.0f);CHECK(!g.narrow);- CHECK(rectIs(g.canvas, 96, 110, 1144, 790)); // §2.2+ CHECK(rectIs(g.canvas, 96, 110, 1144, 772)); // §2.2 (medium shelf tiles)CHECK(rectIs(g.rightTray, 1300, 46, 300, 914));CHECK(rectIs(g.rightDivider, 1292, 46, 8, 914));- CHECK(rectIs(g.rightShelf, 1240, 110, 52, 790));- CHECK(rectIs(g.leftShelf, 8, 110, 88, 790));+ CHECK(rectIs(g.rightShelf, 1240, 110, 52, 772));+ CHECK(rectIs(g.leftShelf, 8, 110, 88, 772));CHECK(rectIs(g.topShelf, 8, 46, 1284, 64));- CHECK(rectIs(g.bottomShelf, 8, 900, 1284, 60));+ CHECK(rectIs(g.bottomShelf, 8, 882, 1284, 78));CHECK(near(g.leftTray.w, 0));}+TEST(shell_bottom_shelf_tile_sizes) {+ UiLayout l = standardLayout();+ l.shelfTiles = 0; // small: the canvas gets the height back+ CHECK(rectIs(computeShell(l, 1600, 960, 1.0f).bottomShelf, 8, 900, 1284, 60));+ CHECK(near(computeShell(l, 1600, 960, 1.0f).canvas.h, 790));+ l.shelfTiles = 2;+ CHECK(near(computeShell(l, 1600, 960, 1.0f).bottomShelf.h, 96));+ UiLayout back;+ std::string err;+ CHECK(fromJson(toJson(l), back, err) && back.shelfTiles == 2);+}+TEST(shell_standard_layout_1920x1080) {const ShellGeometry g = computeShell(standardLayout(), 1920, 1080, 1.0f);- CHECK(rectIs(g.canvas, 96, 110, 1444, 910)); // §2.3: the extra width goes to the canvas+ CHECK(rectIs(g.canvas, 96, 110, 1444, 892)); // §2.3: the extra width goes to the canvasCHECK(near(g.rightTray.w, 320));CHECK(near(g.rightDivider.x, 1592));}TEST(shell_scales_with_the_ui) {const ShellGeometry g = computeShell(standardLayout(), 3200, 1920, 2.0f);- CHECK(rectIs(g.canvas, 192, 220, 2288, 1580));+ CHECK(rectIs(g.canvas, 192, 220, 2288, 1544));}TEST(shell_hidden_shelves_console_and_trays) {@@ -57,8 +69,8 @@ TEST(shell_hidden_shelves_console_and_trays) {l.consoleOpen = true;l.consoleHeight = 160;g = computeShell(l, 1600, 960, 1.0f);- CHECK(near(g.canvas.y + g.canvas.h, 740)); // §2.2: the console pushes the canvas bottom up- CHECK(rectIs(g.console, 8, 740, 1284, 160));+ CHECK(near(g.canvas.y + g.canvas.h, 722)); // §2.2: the console pushes the canvas bottom up+ CHECK(rectIs(g.console, 8, 722, 1284, 160));l.consoleHeight = 9000;CHECK(near(computeShell(l, 1600, 960, 1.0f).console.h, 400)); // clamped@@ -84,7 +96,7 @@ TEST(shell_narrow_and_left_handed) {g = computeShell(l, 1600, 960, 1.0f);CHECK(rectIs(g.rightTray, 0, 46, 300, 914)); // the tray swaps sidesCHECK(near(g.rightShelf.x, 308));- CHECK(rectIs(g.canvas, 360, 110, 1144, 790));+ CHECK(rectIs(g.canvas, 360, 110, 1144, 772));}TEST(shell_tray_width_and_layout_json) {diff --git a/tests/ui/phone_link.sfui b/tests/ui/phone_link.sfuiindex 016d0e99..af043374 100644--- a/tests/ui/phone_link.sfui+++ b/tests/ui/phone_link.sfui@@ -61,7 +61,7 @@ phone_request GET /ar/model.usdz 200phone_request GET /ar/model.glb 200expect_text "On the phone:"wait 3-stroke 0.3 0.88 0.7 0.88 # (below the window)+stroke 0.3 0.93 0.7 0.93 # (below the window)wait 0.3wait_idle 120expect_value phone_ar_version == 2diff --git a/tests/ui/zbrush_feel.sfui b/tests/ui/zbrush_feel.sfuiindex 4acb897a..8bf23f35 100644--- a/tests/ui/zbrush_feel.sfui+++ b/tests/ui/zbrush_feel.sfui@@ -123,7 +123,7 @@ key ctrl+shift+a# --- Ctrl+click on the model blurs the mask, Ctrl+Alt+click sharpens it; a Ctrl+drag still paints ---hold ctrl-stroke 0.2 0.5 0.8 0.5+stroke 0.2 0.55 0.8 0.55 # a little off-centre: on a centred band, blurring can leave the masked count unchangedhold noneexpect_value masked > 100remember masked painted