From b1748a3146e7a47bc88f4115b4885ea733afbb10 Mon Sep 17 00:00:00 2001 From: Mateo Kuruk Miccino Date: Mon, 20 Nov 2023 22:28:41 -0300 Subject: [PATCH] fix: format avatar renderer gdscript --- .../tool/avatar_renderer/avatar_renderer_helper.gd | 4 ++-- .../avatar_renderer/avatar_renderer_standalone.gd | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/godot/src/tool/avatar_renderer/avatar_renderer_helper.gd b/godot/src/tool/avatar_renderer/avatar_renderer_helper.gd index 3df0b188..8653082a 100644 --- a/godot/src/tool/avatar_renderer/avatar_renderer_helper.gd +++ b/godot/src/tool/avatar_renderer/avatar_renderer_helper.gd @@ -52,7 +52,7 @@ class AvatarEntry: var dest_path := "" var width := 2048 var height := 2048 - + var face_dest_path := "" var face_width := 256 var face_height := 256 @@ -68,7 +68,7 @@ class AvatarEntry: ret.dest_path = value.get("destPath", "") ret.width = value.get("width", 2048) ret.height = value.get("height", 2048) - ret.face_dest_path = value.get("faceDestPath", "") # optional + ret.face_dest_path = value.get("faceDestPath", "") # optional ret.face_width = value.get("faceWidth", 256) ret.face_height = value.get("faceHeight", 256) ret.face_zoom = value.get("faceZoom", 25) diff --git a/godot/src/tool/avatar_renderer/avatar_renderer_standalone.gd b/godot/src/tool/avatar_renderer/avatar_renderer_standalone.gd index 8da71096..510b0254 100644 --- a/godot/src/tool/avatar_renderer/avatar_renderer_standalone.gd +++ b/godot/src/tool/avatar_renderer/avatar_renderer_standalone.gd @@ -81,29 +81,29 @@ func update_avatar(index: int): func _on_avatar_avatar_loaded(): var payload = payload_to_process.payload[current_payload_index] RenderingServer.set_default_clear_color(Color(0, 0, 0, 0)) - + # full body fov 90, y=1 %SubViewport.size = Vector2(payload.width, payload.height) %Camera3D_Perpective.set_fov(90) %Camera3D_Perpective.position.y = 1.0 - + await get_tree().process_frame await get_tree().process_frame await get_tree().process_frame - + var img := sub_viewport.get_texture().get_image() img.save_png(payload.dest_path) - + if not payload.face_dest_path.is_empty(): # face = fov 20, y=1.7 %SubViewport.size = Vector2(payload.face_width, payload.face_height) %Camera3D_Perpective.set_fov(payload.face_zoom) %Camera3D_Perpective.position.y = 1.75 await get_tree().process_frame - + var face_img := sub_viewport.get_texture().get_image() face_img.save_png(payload.face_dest_path) - + if current_payload_index >= payload_to_process.payload.size() - 1: get_tree().quit(0) else: