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.

Masking (#48, #51): Ctrl+drag rectangle from the background, lasso / rectangle follow symmetry, Ctrl+click blurs

islandmed81addf00427d
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3225fc37..1c9d8bc3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,10 +9,15 @@ All notable changes to SculptForge are listed here. The format follows
### Added
- Preferences > Tablet > Mouse mode (relative) (#54): for tablets whose driver is set to mouse mode, the pen moves
the cursor by how far it moves, like a mouse.
+- Ctrl+drag on the background with MaskPen draws a mask rectangle while dragging (#48) and masks what it covers;
+ one that covers none of the model clears the mask, as before (and as in ZBrush, without DynaMesh's remesh).
### Fixed
- Pen tablets in mouse (relative) mode (#54): lifting the pen and putting it down elsewhere made the cursor jump
back to where the pen was on the tablet. Turn on Preferences > Tablet > Mouse mode.
+- MaskLasso and MaskRect ignored symmetry (#51): the mirror image of the shape is masked too now, as with mask
+ strokes. A Ctrl+click on the model with MaskLasso or MaskRect blurs the mask (Ctrl+Alt+click sharpens it), as
+ with MaskPen; it did nothing. A lasso or rectangle that covers none of the model clears the mask.
## [0.10.2] - 2026-11-01
diff --git a/docs/guide/coming-from-zbrush.md b/docs/guide/coming-from-zbrush.md
index b18bc95e..4a67e416 100644
--- a/docs/guide/coming-from-zbrush.md
+++ b/docs/guide/coming-from-zbrush.md
@@ -28,8 +28,8 @@ keys and gestures by default; where it has habits of its own, they are kept as a
Size, the inner ring the Focal Shift. See [Sculpting and brushes](sculpting.md).
- **Masking.** <kbd>Ctrl</kbd> paints a mask and <kbd>Ctrl</kbd>+<kbd>Alt</kbd> erases it; <kbd>Ctrl</kbd>+click
the model blurs it and <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+click sharpens it; <kbd>Ctrl</kbd>+click the background
- inverts it and <kbd>Ctrl</kbd>+drag there clears it. MaskLasso and MaskRect: with <kbd>Ctrl</kbd> held the shelf
- shows the mask brush, and the Brush (<kbd>B</kbd>) and Stroke pickers pick it. See [Masking](masking.md).
+ inverts it and <kbd>Ctrl</kbd>+drag there draws a mask rectangle (one that misses the model clears the mask).
+ MaskLasso and MaskRect follow the symmetry: with <kbd>Ctrl</kbd> held the shelf shows the mask brush, and the Brush (<kbd>B</kbd>) and Stroke pickers pick it. See [Masking](masking.md).
- **Visibility and polygroups.** <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+drag keeps the inside (press <kbd>Alt</kbd> to
hide it instead), <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+click a group to isolate it (on a partly hidden mesh: to hide
it), <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+click the background to show everything, <kbd>Ctrl</kbd>+<kbd>W</kbd> to
@@ -92,7 +92,7 @@ Style** switches between:
|---|---|---|
| <kbd>1</kbd> to <kbd>9</kbd>, <kbd>0</kbd> | Free (<kbd>9</kbd> is QuickSave) | Pick the ten first brushes (Standard, Clay, Smooth, Move ...) |
| <kbd>I</kbd> | RGB Intensity at the cursor | Z Intensity at the cursor (as <kbd>U</kbd>) |
-| <kbd>Ctrl</kbd>+drag on the background with nothing masked | Nothing | Zooms |
+| <kbd>Ctrl</kbd>+drag on the background with nothing masked | Draws a mask rectangle | Zooms |
| Zoom drags (<kbd>Ctrl</kbd>+right-drag, <kbd>Alt</kbd> then release) | Up zooms out | Up zooms in |
**Preferences > Input > Rotation** chooses free rotation (ZBrush) or a turntable that keeps the model upright, as
diff --git a/docs/guide/masking.md b/docs/guide/masking.md
index 123283f5..2a109f7e 100644
--- a/docs/guide/masking.md
+++ b/docs/guide/masking.md
@@ -58,6 +58,8 @@ With **MaskLasso** or **MaskRect**:
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 (as in ZBrush).
**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.
@@ -76,10 +78,14 @@ With <kbd>Ctrl</kbd> held, clicks and drags on the empty background act on the w
| Gesture | Effect |
|---|---|
| <kbd>Ctrl</kbd> + click the background | Invert the mask |
-| <kbd>Ctrl</kbd> + drag on the background | Clear the mask (MaskPen) |
-| <kbd>Ctrl</kbd> + drag on the background, with nothing masked | Nothing, as in ZBrush (the SculptForge input style zooms the view, see [Coming from ZBrush](coming-from-zbrush.md)) |
+| <kbd>Ctrl</kbd> + drag on the background | Draw a mask rectangle (MaskPen; MaskLasso draws a lasso): what it covers is masked, mirrored by the symmetry. A shape that covers none of the model clears the mask. |
+| <kbd>Ctrl</kbd> + drag on the background, with nothing masked, in the SculptForge input style | Zoom the view (see [Coming from ZBrush](coming-from-zbrush.md)) |
-On the model, a <kbd>Ctrl</kbd> + click that doesn't drag works on the mask's edges, as in ZBrush:
+> **ZBrush:** with DynaMesh, ZBrush also remeshes when a <kbd>Ctrl</kbd> + drag on the background misses the
+> model. SculptForge doesn't: remesh with **Tool > Remesh** instead.
+
+On the model, a <kbd>Ctrl</kbd> + click that doesn't drag works on the mask's edges, as in ZBrush, whichever
+mask shape is picked:
| Gesture | Effect |
|---|---|
@@ -97,8 +103,8 @@ On the model, a <kbd>Ctrl</kbd> + click that doesn't drag works on the mask's ed
| <kbd>Ctrl</kbd>+<kbd>W</kbd> | Group Masked: the masked part becomes a new polygroup and the mask is cleared (see [Polygroups](polygroups.md)) |
A drag starts after the cursor moves a few pixels, so a slightly shaky click still inverts. With **MaskLasso**
-or **MaskRect**, a <kbd>Ctrl</kbd> + drag on the background draws the shape instead; clear the mask with
-**Clear**, or <kbd>Ctrl</kbd>+<kbd>Alt</kbd> + drag a shape around the whole model.
+or **MaskRect**, a <kbd>Ctrl</kbd> + drag on the background draws that shape; to clear the mask, draw it away
+from the model, or use **Clear**.
## The Masking sub-palette
diff --git a/docs/guide/shortcuts.md b/docs/guide/shortcuts.md
index 3b1e1bb2..74421227 100644
--- a/docs/guide/shortcuts.md
+++ b/docs/guide/shortcuts.md
@@ -119,7 +119,7 @@ action registry, the same source as the Controls window.
| Action | Keys | What it does |
|---|---|---|
-| Clear Mask | <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>A</kbd> | Unmask everything (also: Ctrl+drag on the background). |
+| Clear Mask | <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>A</kbd> | Unmask everything (also: Ctrl+drag on the background, away from the model). |
| Divide | <kbd>Ctrl</kbd>+<kbd>D</kbd> | 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. |
| Group Masked | <kbd>Ctrl</kbd>+<kbd>W</kbd> | Turn the masked part into a new polygroup and clear the mask (ZBrush Ctrl+W). With nothing masked, everything visible becomes one group. |
| Higher Res | <kbd>D</kbd> | Step one subdivision level up (more polygons, for detail). Edits made below carry the detail along. |
diff --git a/src/app/App.cpp b/src/app/App.cpp
index acb40de1..02b6f5e5 100644
--- a/src/app/App.cpp
+++ b/src/app/App.cpp
@@ -1175,7 +1175,7 @@ void App::onMouseDown(float x, float y, Uint8 button) {
const SDL_Keymod keys = SDL_GetModState();
drag_ = (keys & SDL_KMOD_SHIFT) ? Drag::Pan : ctrlDown(keys) ? Drag::Zoom : Drag::Orbit;
} else if (maskMod && !(mod & SDL_KMOD_ALT) && previewLod_ < 0) {
- drag_ = Drag::MaskCanvas; // click inverts, drag clears (or zooms without a mask)
+ drag_ = Drag::MaskCanvas; // click inverts, drag draws a mask rectangle (PanelMasking.cpp)
maskCanvasX_ = x;
maskCanvasY_ = y;
maskCanvasMoved_ = false;
diff --git a/src/app/Input.cpp b/src/app/Input.cpp
index 7cfe0fcf..0f5da332 100644
--- a/src/app/Input.cpp
+++ b/src/app/Input.cpp
@@ -98,7 +98,7 @@ void App::registerInputActions() {
add("mask.all", "Mask All", ICON_LC_SQUARE, "Tool > Masking", "Ctrl+A", "Mask the whole visible SubTool.",
[this] { runCommand("mask_all"); });
add("mask.clear", "Clear Mask", ICON_LC_ERASER, "Tool > Masking", "Ctrl+Shift+A",
- "Unmask everything (also: Ctrl+drag on the background).", [this] { runCommand("mask_clear"); });
+ "Unmask everything (also: Ctrl+drag on the background, away from the model).", [this] { runCommand("mask_clear"); });
add("mask.invert", "Invert Mask", ICON_LC_FLIP_HORIZONTAL_2, "Tool > Masking", "Ctrl+I",
"Mask what is unmasked and unmask what is masked (also: Ctrl+click the background).",
[this] { runCommand("mask_invert"); });
diff --git a/src/app/PanelMasking.cpp b/src/app/PanelMasking.cpp
index 211b70d9..75462131 100644
--- a/src/app/PanelMasking.cpp
+++ b/src/app/PanelMasking.cpp
@@ -14,6 +14,7 @@
#include <algorithm>
#include <cmath>
+#include <string>
namespace sf {
@@ -27,6 +28,8 @@ bool anyMasked(const Mesh& mesh) {
return std::any_of(mesh.mask.begin(), mesh.mask.end(), [](float m) { return m > 0.0f; });
}
+std::string symmetryAxes(const Symmetry& s) { return std::string(s.x ? "x" : "") + (s.y ? "y" : "") + (s.z ? "z" : ""); }
+
} // namespace
void App::beginMaskStroke(float x, float y) {
@@ -62,14 +65,20 @@ void App::maskClickRelease() {
if (anyMasked(doc_.mesh)) runCommand(sharpen ? "mask_sharpen" : "mask_blur");
}
-// ZBrush convention: Ctrl+drag on the background clears the mask. With nothing masked the SculptForge input
-// style zooms instead, as it did before masking existed; the ZBrush style does nothing.
+// ZBrush 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) {
if (maskCanvasMoved_) return;
if (std::hypot(x - maskCanvasX_, y - maskCanvasY_) < kMaskDragThresholdPx) return;
maskCanvasMoved_ = true;
- if (anyMasked(doc_.mesh)) runCommand("mask_clear");
- else if (uiPrefs_.inputStyle == 1) drag_ = Drag::Zoom;
+ if (uiPrefs_.inputStyle == 1 && !anyMasked(doc_.mesh)) {
+ drag_ = Drag::Zoom;
+ return;
+ }
+ // (MaskLasso and MaskRect draw their own shape from the press on: maskSelectMouseDown.)
+ beginSelection(maskCanvasX_, maskCanvasY_, SelectTarget::Mask, SelectShape::Rect);
+ selectionMove(x, y);
}
void App::maskCanvasRelease() {
@@ -87,14 +96,22 @@ bool App::maskSelectMouseDown(float x, float y, SDL_Keymod mod) {
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 does nothing.
+ // 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).
doc_.syncBvh();
RayHit hit;
- if (!alt && !pick(selectPath_.front().x, selectPath_.front().y, hit)) runCommand("mask_invert");
+ if (!pick(selectPath_.front().x, selectPath_.front().y, hit)) {
+ if (!alt) runCommand("mask_invert");
+ } else if (anyMasked(doc_.mesh) && !blenderStyle()) {
+ runCommand(alt ? "mask_sharpen" : "mask_blur");
+ }
return;
}
- // Mask the inside, or unmask it with Alt (Mask Strength sets how much).
- runSelection("mask_rect", "mask_lasso", {{"unmask", alt}, {"strength", double(maskStrength_)}});
+ // 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).
+ runSelection("mask_rect", "mask_lasso",
+ {{"unmask", alt}, {"strength", double(maskStrength_)}, {"symmetry", symmetryAxes(symmetry_)},
+ {"clear_outside", !alt}});
}
App::HeldBrush App::heldBrush() const {
diff --git a/src/app/UiTest.cpp b/src/app/UiTest.cpp
index 6caf1bf6..a3514c4b 100644
--- a/src/app/UiTest.cpp
+++ b/src/app/UiTest.cpp
@@ -559,6 +559,13 @@ double Demo::query(const std::string& name, bool& known) const {
for (float v : m.mask) n += v > 0.5f;
return double(n);
}
+ if (name == "mask_soft") { // vertices partly masked (a blurred edge)
+ size_t n = 0;
+ for (float v : m.mask) n += v > 0.01f && v < 0.99f;
+ return double(n);
+ }
+ if (name == "selection_shown") return app_.drag_ == App::Drag::Select && app_.selectMoved_ ? 1.0 : 0.0;
+ if (name == "symmetry_x") return app_.symmetry_.x ? 1.0 : 0.0;
if (name == "hidden") {
size_t n = 0;
for (uint8_t h : m.hidden) n += h != 0;
diff --git a/src/core/Masking.cpp b/src/core/Masking.cpp
index 4575fc91..812a5d8b 100644
--- a/src/core/Masking.cpp
+++ b/src/core/Masking.cpp
@@ -8,6 +8,7 @@
#include "core/ThreadPool.h"
#include <algorithm>
+#include <cctype>
#include <cmath>
#include <functional>
@@ -57,6 +58,23 @@ bool repeatPass(Mesh& mesh, int iterations, F next) {
return changed;
}
+// The "symmetry" argument ("x", "xz" ...) as mirror sign vectors (Sculptor::mirrors); none without it.
+bool symmetryArg(const Args& a, std::vector<glm::vec3>& mirrors, std::string& error) {
+ Symmetry sym{false, false, false};
+ for (char c : argString(a, "symmetry")) {
+ const char l = char(std::tolower(static_cast<unsigned char>(c)));
+ if (l == 'x') sym.x = true;
+ else if (l == 'y') sym.y = true;
+ else if (l == 'z') sym.z = true;
+ else {
+ error = "symmetry takes the axes x, y and z";
+ return false;
+ }
+ }
+ mirrors = Sculptor::mirrors(sym);
+ return true;
+}
+
float smoothstep01(float e0, float e1, float x) {
float t = std::clamp((x - e0) / std::max(e1 - e0, 1e-6f), 0.0f, 1.0f);
return t * t * (3.0f - 2.0f * t);
@@ -161,16 +179,39 @@ bool maskByPolygroup(Mesh& mesh, uint32_t group, bool add) {
});
}
-bool maskInShape(Mesh& mesh, const glm::mat4& viewProj, const ScreenPolygon& shape, float strength, bool unmask) {
+namespace {
+
+// Vertex v, or one of its mirror images, projects inside the shape.
+bool inShape(const Mesh& mesh, const glm::mat4& viewProj, const ScreenPolygon& shape,
+ const std::vector<glm::vec3>& mirrors, uint32_t v) {
+ glm::vec2 ndc;
+ if (projectToNdc(viewProj, mesh.positions[v], ndc) && shape.contains(ndc)) return true;
+ for (const glm::vec3& m : mirrors)
+ if (m != glm::vec3(1.0f) && projectToNdc(viewProj, mesh.positions[v] * m, ndc) && shape.contains(ndc)) return true;
+ return false;
+}
+
+} // namespace
+
+bool maskInShape(Mesh& mesh, const glm::mat4& viewProj, const ScreenPolygon& shape, float strength, bool unmask,
+ const std::vector<glm::vec3>& mirrors) {
if (mesh.vertexCount() == 0 || !shape.valid()) return false;
const float s = std::clamp(strength, 0.0f, 1.0f);
return maskPass(mesh, [&](const std::vector<float>& m, uint32_t v) {
- glm::vec2 ndc;
- if (!projectToNdc(viewProj, mesh.positions[v], ndc) || !shape.contains(ndc)) return m[v];
+ if (!inShape(mesh, viewProj, shape, mirrors, v)) return m[v];
return unmask ? m[v] * (1.0f - s) : m[v] + (1.0f - m[v]) * s;
});
}
+bool shapeCoversMesh(const Mesh& mesh, const glm::mat4& viewProj, const ScreenPolygon& shape,
+ const std::vector<glm::vec3>& mirrors) {
+ if (!shape.valid()) return false;
+ const bool anyHidden = mesh.hasHidden();
+ for (uint32_t v = 0; v < uint32_t(mesh.vertexCount()); ++v)
+ if (!(anyHidden && mesh.vertexHidden(v)) && inShape(mesh, viewProj, shape, mirrors, v)) return true;
+ return false;
+}
+
void Sculptor::dabMask(Mesh& mesh, const BVH& bvh, const DabParams& p, Symmetry sym) {
if (!active_) return;
const float s = std::clamp(p.strength, 0.0f, 1.0f) * std::clamp(p.pressure, 0.0f, 1.0f);
@@ -271,6 +312,14 @@ void registerMaskingCommands(CommandRegistry& registry) {
const ParamSpec strength{"strength", T::Number, "How much to mask or unmask (0-1). Default 1.", false};
const ParamSpec viewProj{"view_proj", T::String, "Optional 16 numbers: column-major view-projection matrix.",
false};
+ const ParamSpec symmetry{"symmetry", T::String,
+ "Mirror axes, e.g. \"x\" or \"xz\": the mirror image of the shape is selected too, as the "
+ "brushes mirror (default none).",
+ false};
+ const ParamSpec clearOutside{"clear_outside", T::Bool,
+ "When the shape covers none of the model, clear the mask instead (ZBrush: Ctrl+drag on "
+ "the background). Default false.",
+ false};
auto selection = [&registry](std::string name, std::string description, std::vector<ParamSpec> params,
std::function<bool(const Args&, std::vector<glm::vec2>&, std::string&)> shape) {
registry.add(
@@ -281,10 +330,20 @@ void registerMaskingCommands(CommandRegistry& registry) {
std::vector<glm::vec2> points;
std::string error;
if (!viewProjArg(doc.mesh, a, vp, error) || !shape(a, points, error)) return {false, error};
+ std::vector<glm::vec3> mirrors;
+ if (!symmetryArg(a, mirrors, error)) return {false, error};
+ const ScreenPolygon polygon(points);
const bool unmask = argBool(a, "unmask", false);
+ if (argBool(a, "clear_outside", false) && !shapeCoversMesh(doc.mesh, vp, polygon, mirrors)) {
+ UndoRecord record = UndoRecord::captureMask(doc.mesh, "Clear Mask");
+ if (!maskClear(doc.mesh)) return {true, "Clear Mask: mask unchanged"};
+ doc.undo.push(std::move(record));
+ doc.modified = true;
+ return {true, "Clear Mask"};
+ }
const std::string label = unmask ? "Unmask" : "Mask";
UndoRecord record = UndoRecord::captureMask(doc.mesh, label);
- if (!maskInShape(doc.mesh, vp, ScreenPolygon(points), float(argNumber(a, "strength", 1.0)), unmask))
+ if (!maskInShape(doc.mesh, vp, polygon, float(argNumber(a, "strength", 1.0)), unmask, mirrors))
return {true, label + ": mask unchanged"};
doc.undo.push(std::move(record));
doc.modified = true;
@@ -302,7 +361,9 @@ void registerMaskingCommands(CommandRegistry& registry) {
{"y1", T::Number, "Rectangle top (-1..1). Default 1.", false},
unmask,
strength,
- viewProj},
+ viewProj,
+ symmetry,
+ clearOutside},
[](const Args& a, std::vector<glm::vec2>& points, std::string&) {
const float x0 = float(argNumber(a, "x0", -1)), y0 = float(argNumber(a, "y0", -1));
const float x1 = float(argNumber(a, "x1", 1)), y1 = float(argNumber(a, "y1", 1));
@@ -317,7 +378,9 @@ void registerMaskingCommands(CommandRegistry& registry) {
{{"points", T::String, "The lasso: at least 3 points as \"x0 y0 x1 y1 ...\" (-1..1, y up).", true},
unmask,
strength,
- viewProj},
+ viewProj,
+ symmetry,
+ clearOutside},
lassoArg);
}
diff --git a/src/core/Masking.h b/src/core/Masking.h
index b4839f6f..336795fe 100644
--- a/src/core/Masking.h
+++ b/src/core/Masking.h
@@ -13,6 +13,7 @@
#include <glm/glm.hpp>
#include <cstdint>
+#include <vector>
namespace sf {
@@ -44,7 +45,15 @@ bool maskByPolygroup(Mesh& mesh, uint32_t group, bool add);
// 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.
-bool maskInShape(Mesh& mesh, const glm::mat4& viewProj, const ScreenPolygon& shape, float strength, bool unmask);
+// `mirrors` (Sculptor::mirrors of the symmetry) also selects each vertex whose
+// mirror image projects inside, as the brushes mirror (#51); empty = none.
+bool maskInShape(Mesh& mesh, const glm::mat4& viewProj, const ScreenPolygon& shape, float strength, bool unmask,
+ const std::vector<glm::vec3>& mirrors = {});
+// 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).
+bool shapeCoversMesh(const Mesh& mesh, const glm::mat4& viewProj, const ScreenPolygon& shape,
+ const std::vector<glm::vec3>& mirrors = {});
// Registers mask_clear, mask_all, mask_invert, mask_blur, mask_sharpen,
// mask_grow, mask_shrink, mask_by_cavity, mask_by_polygroup, mask_rect and
diff --git a/tests/ui/mask_lasso.sfui b/tests/ui/mask_lasso.sfui
index 43262d16..ba19b2dc 100644
--- a/tests/ui/mask_lasso.sfui
+++ b/tests/ui/mask_lasso.sfui
@@ -1,7 +1,11 @@
# MaskLasso, MaskRect and SelectLasso on the real UI: Ctrl+drag selections mask and unmask,
-# Ctrl+Shift+drag lassos hide, and every selection is one undo step.
+# 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
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
+expect_value symmetry_x == 0
# The shapes sit at the top of Tool > Masking, with Ctrl-hover help.
click "Masking"
@@ -42,6 +46,14 @@ 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.
+hold ctrl
+drag_path 1.3 -0.3 1.6 0.0
+hold none
+expect_value masked == 0
+key ctrl+z
+expect_value masked == $unmasked
+
# Ctrl+click on the background still inverts the mask with MaskLasso / MaskRect.
hold ctrl
drag_path 1.4 0.5 1.4 0.5
@@ -50,6 +62,37 @@ expect_value masked > $unmasked
key ctrl+z
expect_value masked == $unmasked
+# Symmetry X (#51): the lasso around the left half masks the right half too, as a mask stroke would.
+click "MaskLasso##mask.lasso"
+click "Clear##mask"
+key x
+expect_value symmetry_x == 1
+hold ctrl
+drag_path -0.2 -0.2 0.45 -0.2 0.55 0.5 0.45 1.2 -0.2 1.2
+hold none
+expect_value masked > $lasso*1.6
+remember masked lasso_mirrored
+shot lasso_symmetry
+
+# Ctrl+click on the model with MaskLasso blurs the mask, Ctrl+Alt+click sharpens it, as with MaskPen (#51).
+expect_value mask_soft == 0
+hold ctrl
+drag_path 0.5 0.3 0.5 0.3
+hold none
+expect_value mask_soft > 20
+remember mask_soft blurred
+hold ctrl+alt
+drag_path 0.5 0.3 0.5 0.3
+hold none
+expect_value mask_soft < $blurred
+key ctrl+z
+key ctrl+z
+expect_value mask_soft == 0
+expect_value masked == $lasso_mirrored
+click "Clear##mask"
+key x
+expect_value symmetry_x == 0
+
# MaskPen again: Ctrl+drag on the model paints with the brush.
click "MaskPen##mask.pen"
click "Clear##mask"
@@ -60,6 +103,34 @@ expect_value masked > 50
expect_value masked < $lasso
click "Clear##mask"
+# MaskPen, Ctrl+drag starting on the background (#48): a mask rectangle is drawn while dragging and masks what it
+# covers (the left half); one that covers none of the model clears the mask, as before.
+hold ctrl
+drag_path -0.3 -0.3 0.45 1.3 keep
+expect_value selection_shown == 1
+shot pen_rect_drawing
+release
+hold none
+expect_value selection_shown == 0
+expect_value masked > 2000
+expect_value masked < 7000
+remember masked pen_rect
+hold ctrl
+drag_path 1.3 -0.3 1.6 0.0 keep
+expect_value selection_shown == 1
+release
+hold none
+expect_value masked == 0
+key ctrl+z
+expect_value masked == $pen_rect
+# A Ctrl+click on the background still inverts.
+hold ctrl
+drag_path 1.4 0.5 1.4 0.5
+hold none
+expect_value masked > $pen_rect
+key ctrl+z
+click "Clear##mask"
+
# SelectLasso in Tool > Visibility: Ctrl+Shift+drag keeps the inside, Ctrl+Shift+Alt+drag hides it.
click "Visibility"
click "SelectLasso##select.lasso"