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.

UV Editor tests: box select, Python script lines; trim strips show in the view

islandmed3b2792b8fcae
diff --git a/tests/test_python.py b/tests/test_python.py
index cab9aba9..3d279891 100644
--- a/tests/test_python.py
+++ b/tests/test_python.py
@@ -67,6 +67,15 @@ with tempfile.TemporaryDirectory() as d:
sf.run(back, "open", path=out)
assert [s["name"] for s in back.subtools] == ["Sphere", "Box"], back.subtools
+# 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")
+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")
+assert info.startswith("6 islands") and "1001" in info, info
+assert "texels per unit" in sf.run(doc, "uv_density", op="match")
+
# Bring your own mesh in from a pipeline.
doc.set_mesh([[0, 0, 0], [1, 0, 0], [0, 1, 0], [0, 0, 1]], [[0, 2, 1], [0, 1, 3], [0, 3, 2], [1, 2, 3]])
assert doc.triangles.shape == (4, 3)
diff --git a/tests/ui/uv_editor.sfui b/tests/ui/uv_editor.sfui
index 154e2635..1d8c6632 100644
--- a/tests/ui/uv_editor.sfui
+++ b/tests/ui/uv_editor.sfui
@@ -81,6 +81,16 @@ shot moved
key ctrl+z
expect_value uv_max_u == $before_move
+# Box select in the view (islands touched by the box), then a click on empty space clears it.
+run uv_select op=none
+expect_value uv_selected == 0
+drag 0.33 0.45 0.45 0.62
+expect_value uv_selected > 0
+shot box-select
+drag 0.31 0.235 0.31 0.235
+expect_value uv_selected == 0
+run uv_select op=island face=20000
+
# Trim sheet: the selected island laid into the second of four strips.
click "UV Editor/Trim Sheet"
run uv_trim strip=2 strips=4 fit_width=true