How to Set And Change Textures
To change material of a wall, you need to get surface override and when override it's properties.
@tool
class_name SurfacesStyle
extends RoommateStyle
func _build_rulesets() -> void:
var ruleset := create_ruleset()
ruleset.select_all_blocks()
var parts := ruleset.select_all_parts()
# getting surface overrides by surface id
var override_surface := parts.override_surface(0)
# overriding material of surface
var material := StandardMaterial3D.new()
material.albedo_color = Color.BLUE
override_surface.material.override(material)
If you want change all surfaces all at once, you can use next method.
or, more consise
Note, that changes made with explicitly called part surface has priority.
