Files
Bullosseum/tools/preview_crowd_scene.gd
T
richard 7b6a141767 Reorganize the codebase into role-based folders (snake_case)
Move the 40-odd root-level scripts and scenes into a tree that groups by role,
per the approved roadmap (WS2/WS3): actors/{player,matador,bear}, systems/{combat,
fx,input,debug,render,crowd,config}, ui/, props/ (was tscn_s/). Rename the shell
scene.tscn -> levels/game_shell.tscn and every PascalCase scene to snake_case
(Player.tscn -> player.tscn, MainMenu.tscn -> main_menu.tscn, etc.) so the
case-insensitive web/macOS filesystems can't alias two files together.

Done as a scripted move: each file travels with its .uid; every quoted res:// path
across scenes, scripts, .tres, and project.godot's 9 autoloads is rewritten; the
.godot uid/class cache is rebuilt from scratch. Scenes still resolve by uid, so the
rewrite is belt-and-suspenders. Lint globs (run_tests.sh + both CI workflows) now
walk the new dirs; an orphan animation_tree.gd.uid and 7 pre-existing trailing-
whitespace lints (barrel/torch, never covered by the old root-only glob) are cleaned.

Full suite green on both sides. Asset consolidation (Assets/Animations/fonts ->
art/) is deferred — moving imported .glb/.png/.ttf is safer done in the editor.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017KoYBYQgRyY1zDHXMsXY3V
2026-09-06 00:04:41 +03:00

43 lines
1.4 KiB
GDScript

extends SceneTree
## Renders the real arena (scene.tscn) with the billboard crowd wired in, from a camera
## near the arena centre, to confirm the stands populate and face inward in-game.
## godot --script tools/preview_crowd_scene.gd
## Output: tools/preview/scene_crowd.png
const OUT := "res://tools/preview"
func _init() -> void:
_run.call_deferred()
func _run() -> void:
DirAccess.make_dir_recursive_absolute(OUT)
var ps := load("res://levels/game_shell.tscn") as PackedScene
var scene := ps.instantiate()
root.add_child(scene)
current_scene = scene
await create_timer(0.4).timeout
var cam := Camera3D.new()
cam.fov = 74.0
scene.add_child(cam)
# Out past one stand looking across the arena: the near crowd has its back to us,
# the far crowd faces us — the case the front/back sheet must get right.
cam.look_at_from_position(Vector3(0.0, 9.0, -22.0), Vector3(0.0, 4.0, 6.0), Vector3.UP)
cam.current = true
await create_timer(0.3).timeout
var crowd := scene.get_node_or_null(^"CrowdBillboards") as MultiMeshInstance3D
if crowd != null and crowd.multimesh != null:
print("crowd instances = ", crowd.multimesh.instance_count)
else:
print("crowd node/multimesh missing")
var img := root.get_viewport().get_texture().get_image()
if img != null:
img.save_png(OUT + "/scene_crowd.png")
print("captured scene_crowd.png ", img.get_width(), "x", img.get_height())
quit(0)