diff --git a/godot/tools/list_animations.gd.uid b/godot/tools/list_animations.gd.uid new file mode 100644 index 0000000..cfbda94 --- /dev/null +++ b/godot/tools/list_animations.gd.uid @@ -0,0 +1 @@ +uid://ddg6weqfjv8i0 diff --git a/godot/tools/list_blendshapes.gd.uid b/godot/tools/list_blendshapes.gd.uid new file mode 100644 index 0000000..85d67f1 --- /dev/null +++ b/godot/tools/list_blendshapes.gd.uid @@ -0,0 +1 @@ +uid://dvlhhmfxt7pf0 diff --git a/godot/tools/screenshot.gd.uid b/godot/tools/screenshot.gd.uid new file mode 100644 index 0000000..99ee63a --- /dev/null +++ b/godot/tools/screenshot.gd.uid @@ -0,0 +1 @@ +uid://cdm6syy0x6t8b diff --git a/godot/tools/zoom_test.gd b/godot/tools/zoom_test.gd new file mode 100644 index 0000000..cbdd98b --- /dev/null +++ b/godot/tools/zoom_test.gd @@ -0,0 +1,59 @@ +extends Node3D +## Zoom test: cycles through zoom levels, captures screenshot at each. +## Attach to the companion scene temporarily for testing. + +const ZOOM_LEVELS: Array[float] = [0.15, 0.3, 0.5, 0.75, 1.0] +const ASPECT_RATIO: float = 2.0 / 3.0 + +var _current_idx: int = 0 +var _frame_wait: int = 0 +var _done: bool = false + + +func _ready() -> void: + _apply_zoom_level(ZOOM_LEVELS[0]) + + +func _process(_delta: float) -> void: + if _done: + return + + _frame_wait += 1 + if _frame_wait < 30: + return + + _capture_screenshot() + _current_idx += 1 + + if _current_idx >= ZOOM_LEVELS.size(): + print("Zoom test complete: %d screenshots" % ZOOM_LEVELS.size()) + _done = true + get_tree().quit() + return + + _apply_zoom_level(ZOOM_LEVELS[_current_idx]) + _frame_wait = 0 + + +func _apply_zoom_level(zoom: float) -> void: + var screen_idx := DisplayServer.window_get_current_screen() + var screen_rect := DisplayServer.screen_get_usable_rect(screen_idx) + var max_h := screen_rect.size.y + + var h := maxi(int(float(max_h) * zoom), 100) + var w := maxi(int(float(h) * ASPECT_RATIO), 67) + + DisplayServer.window_set_size(Vector2i(w, h)) + print("Zoom %.2f: window %dx%d" % [zoom, w, h]) + + +func _capture_screenshot() -> void: + var zoom := ZOOM_LEVELS[_current_idx] + var img := get_viewport().get_texture().get_image() + if img == null: + print("ERROR: no image at zoom %.2f" % zoom) + return + + var path := OS.get_user_data_dir() + "/zoom_test_%.0f.png" % (zoom * 100) + img.save_png(path) + print("Saved: %s" % path) diff --git a/godot/tools/zoom_test.gd.uid b/godot/tools/zoom_test.gd.uid new file mode 100644 index 0000000..10d2a3e --- /dev/null +++ b/godot/tools/zoom_test.gd.uid @@ -0,0 +1 @@ +uid://bumqqgmnl1lyb