35 lines
1.1 KiB
GDScript
35 lines
1.1 KiB
GDScript
|
|
# Probes the UAL1 GLB loaded at runtime: animation names + sample track paths.
|
||
|
|
extends SceneTree
|
||
|
|
|
||
|
|
const UAL1 := "C:/Users/CAN/tinqs-ltd/ariki-game/assets/quaternius/anim-lib-1/Universal Animation Library[Standard]/Unreal-Godot/UAL1_Standard.glb"
|
||
|
|
|
||
|
|
func _init() -> void:
|
||
|
|
var doc := GLTFDocument.new()
|
||
|
|
var state := GLTFState.new()
|
||
|
|
if doc.append_from_file(UAL1, state) != OK:
|
||
|
|
push_error("UAL load failed")
|
||
|
|
quit(1)
|
||
|
|
return
|
||
|
|
var scene := doc.generate_scene(state)
|
||
|
|
var player: AnimationPlayer = null
|
||
|
|
var stack: Array = [scene]
|
||
|
|
while not stack.is_empty():
|
||
|
|
var n: Node = stack.pop_back()
|
||
|
|
print("node: ", n.get_class(), " '", n.name, "'")
|
||
|
|
if n is AnimationPlayer and player == null:
|
||
|
|
player = n
|
||
|
|
for c in n.get_children():
|
||
|
|
stack.push_back(c)
|
||
|
|
if player == null:
|
||
|
|
print("NO AnimationPlayer")
|
||
|
|
quit(1)
|
||
|
|
return
|
||
|
|
var names := player.get_animation_list()
|
||
|
|
print("clip count: ", names.size())
|
||
|
|
print("clips: ", ", ".join(names.slice(0, 40)))
|
||
|
|
var a := player.get_animation(names[0])
|
||
|
|
print("first clip '", names[0], "' tracks: ", a.get_track_count())
|
||
|
|
for i in mini(4, a.get_track_count()):
|
||
|
|
print(" track path: ", a.track_get_path(i))
|
||
|
|
quit()
|