code wiki / (root) / nx_nxa_anim.nx

nx_nxa_anim.nx

buildroot/runtime/nx_nxa_anim.nx

67919 B1519 linesdepth 9pulls 14 transitivereach 1 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 6 imports · 1 importers

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

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

imported by: nx_nxa_anim_selection_gate_t33.nx

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

main aw sys_write sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ 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 a_u64 ↻ nxa_magic nxa_find nxa_section_entry nxa_magic ↻ nxa_check2

structs

none

consts

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

functions

59func 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 2: mainmain calls 1: sys_write
60func an(v: i64) -> i64
called by 2: mainmain calls 2: sys_mmapsys_write
72func a_u32(b: *u8, o: i64) -> i64
76func a_u64(b: *u8, o: i64) -> i64 { return a_u32(b, o) | (a_u32(b, o + 4) << 32) }
78func a_f64(b: *u8, o: i64, scale: i64) -> i64
called by 1: a_walk calls 1: a_u32
97func a_f32(b: *u8, o: i64, scale: i64) -> i64
called by 3: a_samplea_sample_angmain calls 1: a_u32
114func a_walk(b: *u8, flen: i64, off0: i64, big: i64, G: *i64, cctx: i64, mctx: i64) -> i64
288func a_arr(b: *u8, off: i64, alen: i64, enc: i64, clen: i64, esz: i64) -> *u8
called by 1: main
295func a_sample(kt: *u8, kv: *u8, nk: i64, tms: i64) -> i64
called by 1: main calls 2: a_u64a_f32
318func a_sample_ang(kt: *u8, kv: *u8, nk: i64, tms: i64) -> i64
called by 1: main calls 2: a_u64a_f32
344func a_wname(b: *u8, off: i64, len: i64) -> i64
called by 1: main calls 1: sys_write
357func a_namehas(b: *u8, off: i64, len: i64, pat: *u8) -> i64
called by 1: main
377func a_selected_layers(selection:*FbxClipSelection)->i64
called by 2: a_load_selectedmain
381func a_load_selected(fb:*u8,flen:i64,stack_id:i64,G:*i64,graph:*FbxClipGraph,selection:*FbxClipSelection)->i64
414func main(argc: i64, argv: *i64) -> i64