code wiki / (root) / nx_xps.nx

nx_xps.nx

buildroot/runtime/nx_xps.nx

5490 B83 linesdepth 3pulls 5 transitivereach 0 importersview sourcekind orphan library
docsdependenciesstructsconstsfunctions

about

nx_xps.nx -- XPS / XNALara MODEL TO THE SOVEREIGN ASSET (/compare/modding MD2 xps_to_nxa, 2026-09-06). Reads either dialect through nx_xps_lib (the reference readers mirrored and read first) and writes NXANIM01 VERT, TRIS, SKEL and SKIN through nx_nxa_write_lib, the ONE container writer. Scale is DATA: units_per_xps names how many 0.01 mm units one XPS unit is (default 100000, i.e. one XPS unit read as one metre, announced on every run). Axes are carried as authored; the world derives the up axis from the asset's own extents, as it does for every other donor. Normals, colours, uvs and tangents are read and counted, not carried (TEXC is the texture rung). Every refusal is named and exits 3; nothing is written on refusal. usage: nx_xps <in.xps|in.mesh.ascii> <out.nxa> [units_per_xps=<n>] exits: 0 ok | 2 usage | 3 REFUSED (the reason is on the line) | 4 the container could not be written (the reason is on the line) license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_xps_lib.nx nx_nxa_write_lib.nx nx_xps.nx

imports: nx_syscalls.nxnx_xps_lib.nxnx_nxa_write_lib.nx

imported by: nobody (leaf or entry point)

structs

none

consts

14const XPS_EXIT_USAGE: i64 = 2
15const XPS_EXIT_REFUSE: i64 = 3
16const XPS_EXIT_WRITE: i64 = 4
17const XPS_UNITS_KEY: *u8 = "units_per_xps="
18const XPS_UNITS_KEY_LEN: i64 = 14

functions

20func xps_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
21func xps_puts(s: *u8) -> i64 { sys_write(1, s, xps_len(s)); return 0 }
22func xps_putn(v: i64) -> i64
36func xps_kv(k: *u8, v: i64) -> i64 { xps_puts(k); xps_putn(v); return 0 }
37func xps_prefix(s: *u8, p: *u8, n: i64) -> i64 { var i: i64 = 0; while i < n { if s[i] != p[i] { return 0 } i = i + 1 } return 1 }
38func xps_atoi(s: *u8) -> i64 { var v: i64 = 0; var i: i64 = 0; while s[i] != (0 as u8) { let c: i64 = s[i] as i64; if c < 48 { return v } if c > 57 { return v } v = v * 10 + (c - 48); i = i + 1 } return v }
40func xps_units_arg(argc: i64, argv: *i64) -> i64
45func xps_dialect_name(d: i64) -> *u8 { if d == XP_DIALECT_BIN { return "binary" as *u8 } return "ascii" as *u8 }
48func xps_to_nxa(inpath: *u8, outpath: *u8, units_per_xps: i64, m: *i64, wrc: *i64) -> i64
75func main(argc: i64, argv: *i64) -> i64