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.

3.2 KB
Raw Blame
# 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 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_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 Lit Spheres folder.
run new_sphere subdivisions=4
expect_value litsphere_files == 0
click "Material##palette.material"
expect "Material/Load Lit Sphere..."
key escape
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_litspheres == 2
expect_value litsphere_files == 1
camera 20 10
shot gold
click "Material##palette.material"
wait_idle 20
expect "Material/Gold"
expect "Material/Rose"
shot material-palette
click "Material/Soft Clay"
expect_value material_custom == 0
click "Material/Gold"
expect_status "Material: Gold"
expect_value material_custom == 1
key escape

# Loading the same file again replaces it rather than adding a second Gold.
run load_litsphere path=$SCRIPT_DIR/data/Gold.png
expect_value custom_litspheres == 2
expect_value litsphere_files == 1

# 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_litsphere.sfproj
run set_material name=studio
expect_value material_custom == 0
run open path=sf_ui_custom_litsphere.sfproj
expect_value material_custom == 1
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_litspheres == 2
click "Material##palette.material"
wait_idle 20
expect "Material/Pink"
expect_value custom_litspheres == 3
expect_value litsphere_files == 2

# 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##litsphere"
expect_status "Removed Gold"
expect_value custom_litspheres == 2
expect_value material_custom == 0
expect_value litsphere_files == 1
expect_not "Material/Gold"
key escape
click "Material##palette.material"
wait_idle 20
expect_not "Material/Gold"
expect "Material/Pink"
key escape

# Loading it again brings it back.
run load_litsphere path=$SCRIPT_DIR/data/Gold.png
expect_value custom_litspheres == 3
expect_value litsphere_files == 2