35 lines
896 B
GDScript
35 lines
896 B
GDScript
extends SceneTree
|
|
|
|
func _init() -> void:
|
|
var lib = load("res://assets/characters/animations/animation-pack.res") as AnimationLibrary
|
|
if not lib:
|
|
print("Failed to load animation-pack.res")
|
|
quit(1)
|
|
return
|
|
|
|
var anim_name = "walk_forward"
|
|
if lib.has_animation(anim_name):
|
|
var anim = lib.get_animation(anim_name)
|
|
print("Animation: ", anim_name)
|
|
var has_pos = 0
|
|
var has_rot = 0
|
|
var has_scale = 0
|
|
var pos_bones = []
|
|
|
|
for i in anim.get_track_count():
|
|
var type = anim.track_get_type(i)
|
|
var path = anim.track_get_path(i)
|
|
if type == Animation.TYPE_POSITION_3D:
|
|
has_pos += 1
|
|
pos_bones.append(str(path))
|
|
elif type == Animation.TYPE_ROTATION_3D:
|
|
has_rot += 1
|
|
elif type == Animation.TYPE_SCALE_3D:
|
|
has_scale += 1
|
|
|
|
print(" Positions: ", has_pos, " (", pos_bones, ")")
|
|
print(" Rotations: ", has_rot)
|
|
print(" Scales: ", has_scale)
|
|
|
|
quit(0)
|