Add unique identifier for test_phase3c_walk_recovery.gd
This commit is contained in:
@@ -9,7 +9,7 @@ extends EditorScript
|
||||
## pose (a fixed first keyframe can never match an arbitrary rest pose). The
|
||||
## baked stand_up is kept as an authored reference / manual-play animation.
|
||||
|
||||
const STAND_UP_DURATION := 0.8
|
||||
const STAND_UP_DURATION := 2.0
|
||||
|
||||
## IK target marker node paths (relative to the rig root), keyed by marker name.
|
||||
const POSE_PATHS: Dictionary = {
|
||||
@@ -58,24 +58,18 @@ func _run() -> void:
|
||||
push_error("EditorScript: AnimationPlayer node not found under root.")
|
||||
return
|
||||
|
||||
_generate_walk_animation(anim_player, "walk_right", 1, false) # FacingProfile.RIGHT (1)
|
||||
_generate_walk_animation(anim_player, "walk_left", 0, true) # FacingProfile.LEFT (0)
|
||||
_generate_walk_animation(anim_player, "walk_right", false)
|
||||
_generate_walk_animation(anim_player, "walk_left", true)
|
||||
_generate_pose_animation(anim_player, "stand_up", STAND_UP_DURATION, POSE_DOWN, POSE_STANDING)
|
||||
|
||||
|
||||
func _generate_walk_animation(anim_player: AnimationPlayer, anim_name: String, profile_enum: int, flip_x: bool) -> void:
|
||||
func _generate_walk_animation(anim_player: AnimationPlayer, anim_name: String, flip_x: bool) -> void:
|
||||
var anim = Animation.new()
|
||||
anim.length = 0.8
|
||||
anim.loop_mode = Animation.LOOP_LINEAR
|
||||
var dir_mult: float = -1.0 if flip_x else 1.0
|
||||
|
||||
# 1. Profile Track (0 = LEFT, 1 = RIGHT)
|
||||
var profile_track = anim.add_track(Animation.TYPE_VALUE)
|
||||
anim.track_set_path(profile_track, ".:facing_profile")
|
||||
anim.value_track_set_update_mode(profile_track, Animation.UPDATE_DISCRETE)
|
||||
anim.track_insert_key(profile_track, 0.0, profile_enum)
|
||||
|
||||
# 2. Keyframe positions
|
||||
# Keyframe positions
|
||||
var raw_tracks = {
|
||||
"IK_Targets/Torso:position": [Vector2(0, 10), Vector2(0, -15), Vector2(0, 10), Vector2(0, -15), Vector2(0, 10)],
|
||||
"IK_Targets/Head:position": [Vector2(100, -614), Vector2(100, -639), Vector2(100, -614), Vector2(100, -639), Vector2(100, -614)],
|
||||
|
||||
Reference in New Issue
Block a user