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.7 KB
Raw Blame
# The view's background (#21): Gradient (the default) or Flat Colour with a colour picker, in Preferences > Display
# and the Render palette; saved automatically and in projects, and scriptable (set_background).
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
expect_value gradient_background == 1
shot gradient

# Preferences > Display: Gradient | Flat Colour and the colour.
click "Preferences##palette.preferences"
click "Display##preferences.display"
expect "Gradient##view.background_gradient"
expect "Flat Colour##view.background_flat"
expect_text "Background colour"
click "Flat Colour##view.background_flat"
expect_status "Background: Flat Colour"
expect_value gradient_background == 0
shot preferences-display
key escape
hover "Tool/Parts"
shot flat

# A colour of your own, from a script.
run set_background color=60,70,80
expect_value gradient_background == 0
expect_value background_r == 60
expect_value background_b == 80
hover "Tool/Parts"
shot flat-blue

# The Render palette has the same controls.
click "Render##palette.render"
expect "Gradient##view.background_gradient"
expect_text "Background colour"
click "Gradient##view.background_gradient"
expect_value gradient_background == 1
key escape

# It saves itself for the next session (#117).
run set_background mode=flat
restart
expect_value gradient_background == 0
expect_value background_r == 60

# Projects keep their own.
run save_project path=sf_ui_background.sfproj
run set_background mode=gradient
run open path=sf_ui_background.sfproj
expect_value gradient_background == 0
expect_value background_b == 80
run set_background mode=gradient