nx_fbx2nxa.nx
buildroot/runtime/nx_fbx2nxa.nx
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
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
structs
| none |
consts
| 31 | const F2_EXIT_OK: i64 = 0 |
| 32 | const F2_EXIT_USAGE: i64 = 2 |
| 33 | const F2_EXIT_UNREADABLE: i64 = 3 |
| 34 | const F2_EXIT_NOGEOM: i64 = 4 |
| 35 | const F2_EXIT_MULTIGEOM: i64 = 5 |
| 36 | const F2_EXIT_WRITEFAIL: i64 = 6 |
| 39 | const FBXC_FX_SCALE: i64 = 1024 |
| 41 | const NXA_UNITS_PER_CM: i64 = 1000 |
| 42 | const F2_MM_PER_CM: i64 = 10 |
| 46 | const F2_VERT_PAYLOAD_BYTES: i64 = 24 |
| 47 | const F2_IDX_PAYLOAD_BYTES: i64 = 4 |
| 48 | const F2_HDR_BYTES: i64 = 32 |
| 49 | const F2_TOCE_BYTES: i64 = 32 |
| 50 | const F2_SECTIONS: i64 = 2 |
| 51 | const F2_WORD: i64 = 8 |
| 52 | const F2_COUNTS: i64 = 8 |
functions
| 54 | func 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 } |
| 55 | func f2_putn(v: i64) -> i64 |
| 69 | func main(argc: i64, argv: *i64) -> i64 |