Rebuild the NPC hands and add a hand capture
This commit is contained in:
1 parent
48082c3dfa
commit
24c939d388
27 files changed
+107
-57
No files matched your search
@@ -30,6 +30,8 @@ const VARIANTS := [
|
||||
]
|
||||
## Camera orbits the subject at yaw 0 (front = Godot +Z). Portrait views keep
|
||||
## the eye/head in frame; the last two show the full body and crowd silhouette.
|
||||
const HAND_VIEW := {"name": "hand", "yaw": 15.0, "distance": 0.80, "height": 0.72,
|
||||
"target_x": 0.27, "target_y": 0.72, "fov": 32.0}
|
||||
const VIEWS := [
|
||||
{"name": "front", "yaw": 0.0, "distance": 1.85, "height": 1.55,
|
||||
"target_y": 1.52, "fov": 32.0},
|
||||
@@ -48,6 +50,8 @@ const SETTLE_FRAMES := 4
|
||||
const MAX_FRAMES := 4000
|
||||
|
||||
var out_dir := "user://screenshots/npc_baseline"
|
||||
var only_view := ""
|
||||
var _views: Array = VIEWS
|
||||
var frames := 0
|
||||
var _phase := "stage_variant"
|
||||
var _variant_i := 0
|
||||
@@ -61,6 +65,10 @@ func _initialize() -> void:
|
||||
for arg in OS.get_cmdline_user_args():
|
||||
if str(arg).begins_with("--out="):
|
||||
out_dir = str(arg).substr(6)
|
||||
elif str(arg).begins_with("--view="):
|
||||
only_view = str(arg).substr(7)
|
||||
if only_view == "hand":
|
||||
_views = [HAND_VIEW]
|
||||
root.size = Vector2i(1280, 720)
|
||||
_build_stage()
|
||||
|
||||
@@ -83,7 +91,7 @@ func _process(_delta: float) -> bool:
|
||||
"shoot":
|
||||
_shoot()
|
||||
_view_i += 1
|
||||
if _view_i >= VIEWS.size():
|
||||
if _view_i >= _views.size():
|
||||
_view_i = 0
|
||||
_variant_i += 1
|
||||
if _variant_i >= VARIANTS.size():
|
||||
@@ -169,10 +177,10 @@ func _stage_variant() -> void:
|
||||
func _frame_view() -> void:
|
||||
if _avatar == null or not is_instance_valid(_avatar):
|
||||
return
|
||||
var view: Dictionary = VIEWS[_view_i]
|
||||
var view: Dictionary = _views[_view_i]
|
||||
var yaw := deg_to_rad(float(view["yaw"]))
|
||||
var distance := float(view["distance"])
|
||||
var target := Vector3(0.0, float(view["target_y"]), 0.0)
|
||||
var target := Vector3(float(view.get("target_x", 0.0)), float(view["target_y"]), 0.0)
|
||||
_camera.position = target + Vector3(sin(yaw) * distance, float(view["height"]) - target.y,
|
||||
cos(yaw) * distance)
|
||||
_camera.fov = float(view["fov"])
|
||||
@@ -180,7 +188,7 @@ func _frame_view() -> void:
|
||||
|
||||
func _shoot() -> void:
|
||||
var variant: Dictionary = VARIANTS[_variant_i]
|
||||
var view: Dictionary = VIEWS[_view_i]
|
||||
var view: Dictionary = _views[_view_i]
|
||||
var dir := ProjectSettings.globalize_path(out_dir)
|
||||
DirAccess.make_dir_recursive_absolute(dir)
|
||||
var base := "%s__%s" % [variant["name"], view["name"]]
|
||||
|
||||
Reference in new issue
Block a user