code wiki / (root) / nx_nxa_anim.nx

nx_nxa_anim.nx

buildroot/runtime/nx_nxa_anim.nx

66141 B1479 linesdepth 7pulls 11 transitivereach 0 importersview sourcekind tooltopic nxa
docsdependenciesstructsconstsfunctions

about

nx_nxa_anim.nx -- ANIMATION IMPORTER v2: extracts the FBX's authored animation and BAKES it to the NXA's normative delta-LBS convention. v1 wrote raw Lcl-space Euler quats (channel 1) which are NOT drivable without the FBX local hierarchy (pre-rotations, parent chain); v2 evaluates full integer FK per 30Hz sample -- local = PreRotation x LclRotation(t) chained down the joint parents -- and emits per-joint WORLD-SPACE deltas about the bind pose (channel 2, packed 2-word keys), the exact form the LBS viewer consumes: M x = D(x-b)+b+dt. SELF-VALIDATING: the static FK must reproduce the SKEL bind translations (TransformLink ground truth) or the tool REFUSES (exit 7) -- pre-rotation/hierarchy math is proven against data already trusted, never assumed. usage: nx_nxa_anim <in.fbx> <in.nxa5> <out.nxa> rc: 0 ok, 2 usage, 3 fbx unreadable, 4 no animation, 5 in.nxa bad, 7 rig-mismatch, 9 io license_tier: ORIGINAL

dependencies 5 imports · 0 importers

nx_syscalls.nx nx_zlib_wrap.nx nx_nxa.nx nx_itrig.nx nx_nxa_fk.nx nx_nxa_anim.nx

imports: nx_syscalls.nxnx_zlib_wrap.nxnx_nxa.nxnx_itrig.nxnx_nxa_fk.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main aw sys_write sys_mmap sys_map_file sys_openat_rd sys_lseek sys_close a_u32 a_walk a_u64 a_u32 ↻ a_u32 ↻ a_f64 a_u32 ↻ a_walk ↻ an sys_mmap ↻ sys_write ↻ a_arr nx_zlib_inflate sys_mmap ↻ nx_deflate_inflate sys_mmap ↻ nx_bitstream_alloc sys_mmap ↻ _deflate_inflate_block nx_bitstream_read_lsb nx_bitstream_bits_remainin _bs_peek_byte nx_bitstream_byte_align nx_bitstream_read_byte_ali nx_bitstream_byte_align ↻ _deflate_build_static_litl sys_mmap ↻ nx_huffman_build _deflate_build_static_dist sys_mmap ↻ nx_huffman_build ↻ _deflate_decode_huffman_bl

structs

none

consts

18const A_MAGIC_1500: i64 = 1500
19const A_MAGIC_2047: i64 = 2047
20const A_MAGIC_1048575: i64 = 1048575
21const A_MAGIC_4503599627370496: i64 = 4503599627370496
22const A_MAGIC_8388607: i64 = 8388607
23const A_MAGIC_8388608: i64 = 8388608
24const A_MAGIC_4090: i64 = 4090
25const A_MAGIC_2040: i64 = 2040
26const A_MAGIC_119990: i64 = 119990
27const A_MAGIC_4096: i64 = 4096
28const A_MAGIC_46186158: i64 = 46186158
29const A_MAGIC_180000: i64 = 180000
30const A_MAGIC_360000: i64 = 360000
31const A_MAGIC_7500: i64 = 7500
32const A_MAGIC_500000: i64 = 500000
33const A_MAGIC_60000: i64 = 60000
34const A_MAGIC_20000: i64 = 20000
35const A_MAGIC_4611686018427387903: i64 = 4611686018427387903
36const A_MAGIC_2000: i64 = 2000
37const A_MAGIC_200000: i64 = 200000
38const A_MAGIC_32767: i64 = 32767
39const A_MAGIC_65535: i64 = 65535
40const A_MAGIC_1024: i64 = 1024
43const A_MO: i64 = 16 // model ids x4096
44const A_LO: i64 = 4112 // limb flags x4096
45const A_AN: i64 = 8208 // AnimationCurveNode ids x2048
46const A_CID: i64 = 10256 // curve ids x2048
47const A_CKT: i64 = 12304 // curve KeyTime meta (off,alen,enc,clen) x2048x4
48const A_CKV: i64 = 20496 // curve KeyValueFloat meta x2048x4
49const A_CONN: i64 = 28688 // conns (src,dst,ptag) x120000x3
50const A_PR: i64 = 388688 // per-model PreRotation millideg x3
51const A_LR: i64 = 400976 // per-model Lcl Rotation default millideg x3
52const A_LT: i64 = 413264 // per-model Lcl Translation default units x3
53const A_PF: i64 = 425552 // per-model flags: 1=pre 2=lclrot 4=lclt
54const A_NO: i64 = 430000 // per-model name byte offset (into the mapped fbx)
55const A_NL: i64 = 434096 // per-model name length
56const A_WORDS: i64 = 440000

functions

58func aw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main calls 1: sys_write
59func an(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
71func a_u32(b: *u8, o: i64) -> i64
75func a_u64(b: *u8, o: i64) -> i64 { return a_u32(b, o) | (a_u32(b, o + 4) << 32) }
77func a_f64(b: *u8, o: i64, scale: i64) -> i64
called by 1: a_walk calls 1: a_u32
96func a_f32(b: *u8, o: i64, scale: i64) -> i64
called by 3: a_samplea_sample_angmain calls 1: a_u32
113func a_walk(b: *u8, flen: i64, off0: i64, big: i64, G: *i64, cctx: i64, mctx: i64) -> i64
called by 2: a_walkmain calls 4: a_u64a_u32a_f64a_walk
287func a_arr(b: *u8, off: i64, alen: i64, enc: i64, clen: i64, esz: i64) -> *u8
called by 1: main calls 1: nx_zlib_inflate
294func a_sample(kt: *u8, kv: *u8, nk: i64, tms: i64) -> i64
called by 1: main calls 2: a_u64a_f32
317func a_sample_ang(kt: *u8, kv: *u8, nk: i64, tms: i64) -> i64
called by 1: main calls 2: a_u64a_f32
343func a_wname(b: *u8, off: i64, len: i64) -> i64
called by 1: main calls 1: sys_write
356func a_namehas(b: *u8, off: i64, len: i64, pat: *u8) -> i64
called by 1: main
374func main(argc: i64, argv: *i64) -> i64