- 为铁球、陶瓷球和木球制作风格化材质,归档 CC0 原始参考 - 更新方形球洞和实心滑槽,统一 90° 弯槽并兼容旧存档 - 用顺流泡沫表示水流方向,为冰块制作三种交错的裂纹 - 同步 Blender 源资产、Godot 加载、工坊和试玩预览
37 lines
1.1 KiB
GDScript
37 lines
1.1 KiB
GDScript
extends SceneTree
|
|
|
|
func _initialize() -> void:
|
|
call_deferred("capture")
|
|
|
|
func capture() -> void:
|
|
var args := OS.get_cmdline_user_args()
|
|
if args.size() != 1 or args[0] not in ["before", "after", "variants"]:
|
|
push_error("Pass before, after, or variants.")
|
|
quit(1)
|
|
return
|
|
var app = load("res://playtest/ice/scenes/01.tscn").instantiate()
|
|
root.add_child(app)
|
|
for child in app.get_children():
|
|
if child is CanvasLayer:
|
|
child.hide()
|
|
for tag in app.tags:
|
|
tag.hide()
|
|
app.slots_view.hide()
|
|
app.preview_view.hide()
|
|
app.camera.v_offset = 0
|
|
app.camera_size = 6.2
|
|
app.target = Vector3(-2.1, 2.65, 0)
|
|
app.update_camera()
|
|
for i in range(8):
|
|
await process_frame
|
|
RenderingServer.force_draw(false)
|
|
RenderingServer.force_sync()
|
|
var output := "res://playtest/artifacts/styled/ice_material/%s.png" % args[0]
|
|
var frame := root.get_texture().get_image()
|
|
if args[0] == "variants":
|
|
frame = frame.get_region(Rect2i(365, 130, 620, 560))
|
|
var result := frame.save_png(ProjectSettings.globalize_path(output))
|
|
if result != OK:
|
|
push_error("Could not save " + output)
|
|
quit(0 if result == OK else 1)
|