(bind-func ai_build_animation
(lambda (scene:aiScene* root:XTMModel*)
(let ((numanims (convert (tref scene 6)))
(animations:aiAnimation** (tref scene 7))
(i:i64 0))
(dotimes (i numanims)
(let ((j:i32 0)
(animation (pref animations i))
(name (tref-ptr animation 0))
(duration:double (tref animation 1))
(tps:double (tref animation 2)) ;; ticks per second
(num_channels:i32 (tref animation 3))
(channels:aiNodeAnim** (tref animation 4))
(num_mesh_channels:i32 (tref animation 5))
(mesh_channels:aiMeshAnim** (tref animation 6)))
(println 'Animation: name 'dur: duration 'nodes: num_channels 'meshes: num_mesh_channels)
(dotimes (j num_channels)
(ai_build_anim_channel (pref channels j) scene root))
void)))))