code wiki / (root) / nx_fbx2nxa.nx

nx_fbx2nxa.nx

buildroot/runtime/nx_fbx2nxa.nx

11031 B224 linesdepth 8pulls 9 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_fbx2nxa.nx -- binary FBX GEOMETRY -> NXANIM01 (VERT + TRIS). The missing first half of the FBX rig ingest: nx_nxa_skin <in.fbx> <in.nxa> <out.nxa> fills SKEL+SKIN but requires an in.nxa that already carries the mesh, and NOTHING produced one from an FBX -- fbx_read (nx_fbx_import, the consolidated geometry reader) had exactly ONE caller and it was a probe that prints counts. This organ is the second caller the consolidation was built for: fbx_read -> NXA writer, in the exact section shapes nx_nxa_skin copies and nx_asset_floor_gate reads. usage: nx_fbx2nxa <in.fbx> <out.nxa> exit 0 OK | 2 usage | 3 unreadable/not-FBX | 4 no-geometry | 5 multi-geometry (refused BY NAME) | 6 write-failed UNITS, stated not guessed: fbxc_f64_fx returns value x 1024 (the lib's contract, its comment); the FBX native unit is the CENTIMETRE (FBX SDK convention; Fab/UE exports ship cm). NXA VERT is 0.01 mm (spec correction seq1285), so one cm = 1000 VERT units and the conversion is fx * NXA_UNITS_PER_CM / FBXC_FX_SCALE. The receipt prints the measured height in mm so a donor authored in some other unit is VISIBLE in one glance instead of silently wrong; and the axes the rig floor grades (counts and ratios) are unit-independent, so a mis-united donor still counts its joints correctly. UnitScaleFactor parsing is deliberately deferred until a donor measurably needs it -- deferring is stated here, not hidden. MULTI-GEOMETRY IS REFUSED BY NAME, not merged wrong: fbx_read keeps the LARGEST Vertices array but ACCUMULATES triangles across every Geometry node, and those indices reference each node's OWN vertex space -- concatenating them against one vertex array is a shredded mesh with plausible counts (the exact failure shape the import lane keeps meeting). One Geometry node is the honest v1; the refusal names the count so the donor can be re-exported merged. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_nxa.nx nx_fbx_import.nx nx_fbx2nxa.nx

imports: nx_syscalls.nxnx_nxa.nxnx_fbx_import.nx

imported by: nobody (leaf or entry point)

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

main f2_puts sys_write sys_exit 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_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close fbxc_unit_scale_micro fbxc_version fbxc_u32 fbxc_big fbxc_hdr fbxc_u64 fbxc_u32 ↻ fbxc_u32 ↻ fbxc_name_is fbxc_u32 ↻ fbxc_f64_p20 fbxc_u64 ↻ fbxc_prop_size fbxc_u32 ↻

structs

none

consts

31const F2_EXIT_OK: i64 = 0
32const F2_EXIT_USAGE: i64 = 2
33const F2_EXIT_UNREADABLE: i64 = 3
34const F2_EXIT_NOGEOM: i64 = 4
35const F2_EXIT_MULTIGEOM: i64 = 5
36const F2_EXIT_WRITEFAIL: i64 = 6
39const FBXC_FX_SCALE: i64 = 1024
41const NXA_UNITS_PER_CM: i64 = 1000
42const F2_MM_PER_CM: i64 = 10
46const F2_VERT_PAYLOAD_BYTES: i64 = 24
47const F2_IDX_PAYLOAD_BYTES: i64 = 4
48const F2_HDR_BYTES: i64 = 32
49const F2_TOCE_BYTES: i64 = 32
50const F2_SECTIONS: i64 = 2
51const F2_WORD: i64 = 8
52const F2_COUNTS: i64 = 8

functions

54func f2_puts(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
55func f2_putn(v: i64) -> i64
called by 1: main calls 2: sys_writesys_mmap
69func main(argc: i64, argv: *i64) -> i64