Skip to content

Commit

Permalink
fix: viewport size for avatar rendering (#524)
Browse files Browse the repository at this point in the history
* fix: viewport size for avatar rendering

* update snapshots
  • Loading branch information
kuruk-mm authored Jan 17, 2025
1 parent a5736ef commit 72e023e
Show file tree
Hide file tree
Showing 11 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions godot/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ gdscript/warnings/redundant_await=false
window/size/viewport_width=1280
window/size/viewport_height=720

[editor]

run/main_run_args="--avatar-renderer --avatars ../tests/avatars-test-input.json"

[editor_plugins]

enabled=PackedStringArray("res://addons/dcl_build_plugin/plugin.cfg", "res://addons/godot-xr-tools/plugin.cfg", "res://addons/resource_tracker/plugin.cfg", "res://addons/webview-godot-android/plugin.cfg")
Expand Down
2 changes: 2 additions & 0 deletions godot/src/ui/components/backpack/avatar_preview.gd
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ func async_get_viewport_image(face: bool, dest_size: Vector2i, fov: Variant = nu
camera_3d.fov = fov

set_deferred("size", dest_size)
set_size(dest_size)
subviewport.set_size(dest_size)

await get_tree().process_frame
await get_tree().process_frame
Expand Down
1 change: 1 addition & 0 deletions godot/src/ui/components/backpack/backpack.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,7 @@ anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 1280.0
offset_top = 720.0
offset_right = 0.0
offset_bottom = 256.0
grow_horizontal = 2
grow_vertical = 2
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/avatar-image-generation/mati_avatar_test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 72e023e

Please sign in to comment.