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.

1.9 KB
Raw Blame
# 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=classic        # written for the Classic look and the classic palette bar and shelves
run new_sphere subdivisions=2
run part_append type=sphere size=0.6
expect_value parts == 2
expect_value flat_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 Part.
click "Material##palette.material"
expect "Smooth##material.smooth"
expect "Flat##material.flat"
expect "Scene##part.shading_default"
click "Flat##material.flat"
expect_status "Shading: Flat"
expect_value flat_shading == 1
shot material-palette
key escape
shot flat

# The appended sphere (active) keeps smooth whatever the scene says.
click "Material##palette.material"
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-part

# Back to a smooth scene with the other Part flat (scripted, as a Python or MCP client would).
run set_shading mode=smooth
run part_shading index=0 mode=flat
expect_value flat_shading == 0
shot smooth-scene-flat-part

# Tool > Display has the same controls.
click "Display##tool.display"
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 part_shading == 0
run set_shading mode=flat
run open path=sf_ui_flat_shading.sfproj
expect_value flat_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