Files
Bullosseum/tools/preview_crowd_scene.gd
T
richard 09d4a60f43 Reorganize into role-based folders and consolidate art
Move every script and scene into role-based directories (actors/, systems/, ui/,
levels/, props/) and all raw art under art/ (grouped by role, snake_case,
Extract-Textures GLBs), dropping Blender version-suffix noise. Filenames are
snake_case (PascalCase reserved for class_name) to avoid case-insensitive
filesystem aliasing on the web/macOS targets. Routes the bull's hits through the
typed DamageEvent pipeline and wires the bull's abilities to the Fx library.
Updates CLAUDE.md's folder-layout overview to match.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CCyaJPTHCH9EDthpf4A5Sj
2026-09-08 14:56:22 +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)