Files
IntoHole/playtest/captures/capture_iron_ball_surface.gd
T
Yanchen d1141b04c7 feat: 更新 IntoHole 的球体、滑槽和环境资产
- 为铁球、陶瓷球和木球制作风格化材质,归档 CC0 原始参考
- 更新方形球洞和实心滑槽,统一 90° 弯槽并兼容旧存档
- 用顺流泡沫表示水流方向,为冰块制作三种交错的裂纹
- 同步 Blender 源资产、Godot 加载、工坊和试玩预览
2026-11-19 16:18:41 +08:00

43 lines
1.8 KiB
GDScript

extends SceneTree
# Same tutorial lighting/camera before and after the authored material repair.
const OUTPUT = "res://playtest/artifacts/styled/iron_ball_surface/"
const Maps = preload("res://playtest/tutorial/scripts/maps.gd")
func _initialize() -> void:
call_deferred("run")
func picture() -> Image:
for i in range(4):await process_frame
RenderingServer.force_draw(false)
RenderingServer.force_sync()
return root.get_texture().get_image()
func run() -> void:
var phase := "after"
if "--before" in OS.get_cmdline_user_args():phase = "before"
var app = load("res://playtest/tutorial/scenes/tutorial.tscn").instantiate()
root.add_child(app)
for r in Maps.solution(app.lesson):
app.records.append({"id":r.id,"kind":r.kind,"position":app.lib.vector(r.position),"quarter":int(r.quarter)})
app.rebuild();app.reset_simulation();app.refresh_slots();app.refresh_ui()
var full: Image = await picture()
full.save_png(ProjectSettings.globalize_path(OUTPUT + phase + "_tutorial.png"))
for child in app.get_children():
if child is CanvasLayer:child.hide()
for tag in app.tags:tag.hide()
app.selection.hide();app.ball_marker.hide();app.preview_view.hide();app.slots_view.hide()
app.camera.h_offset=0;app.camera.v_offset=0
app.camera_size=1.65;app.target=app.balls[0].position;app.update_camera()
var views := Image.create(1024,1024,false,Image.FORMAT_RGB8)
for i in range(4):
app.balls[0].rotation=Vector3(i*PI/2,i*PI/4,0)
var frame: Image = await picture()
frame.convert(Image.FORMAT_RGB8)
var crop := Rect2i((frame.get_width()-512)/2,(frame.get_height()-512)/2,512,512)
views.blit_rect(frame,crop,Vector2i((i%2)*512,(i/2)*512))
views.save_png(ProjectSettings.globalize_path(OUTPUT + phase + "_rotations.png"))
app.balls[0].rotation=Vector3.ZERO
print("IRON_BALL_SURFACE_CAPTURE ",phase)
quit()