extends SceneTree ## Headless load check: verify garment GLB scenes load and their albedo ## texture resolves. Usage: ## godot4 --path client --headless --script res://tools/garment_preview/load_check.gd ## Temporary tool script — safe to delete after wave-2 integration. const ITEMS := [ "res://assets/characters/clothing/jeans_modern/average_m.glb", "res://assets/characters/clothing/swim_trunks/average_m.glb", "res://assets/characters/clothing/swim_trunks/heavy_m.glb", ] func _init() -> void: for path in ITEMS: _check(path) quit(0) func _check(path: String) -> void: if not ResourceLoader.exists(path): print("loadcheck: MISSING ", path) return var ps := load(path) as PackedScene if ps == null: print("loadcheck: LOAD FAILED ", path) return var inst := ps.instantiate() var found := false var stack: Array[Node] = [inst] while not stack.is_empty(): var n: Node = stack.pop_back() for c in n.get_children(): stack.append(c) if n is MeshInstance3D: var mi := n as MeshInstance3D if mi.mesh == null: continue for surf in range(mi.mesh.get_surface_count()): var m := mi.mesh.surface_get_material(surf) if m is BaseMaterial3D: var tex := (m as BaseMaterial3D).albedo_texture if tex != null: print("loadcheck: OK ", path, " albedo=", tex.get_class(), " ", tex.get_width(), "x", tex.get_height()) found = true if not found: print("loadcheck: NO ALBEDO ", path) inst.free()