code wiki / (root) / nx_motion_rig.nx

nx_motion_rig.nx

buildroot/runtime/nx_motion_rig.nx

17244 B298 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic motion
docsdependenciesstructsconstsfunctions

about

nx_motion_rig.nx -- THE JOB BEHIND /motion (2026-09-06): one upload directory in; a rigged, rendered, exported result out, every composed organ's own report kept beside it, a sha256 of the rig, and a done marker written LAST. nx_motion_rig rig <jobdir> [cells] nx_motion_rig anim <jobdir> <donor.nxa> <pose_id> <clipkey> The jobdir holds in.<kind> and kind (written by the door, nx_motion_serve). Nothing here re-implements anything: the converters, the auto-rig, the UV unwrap, the rasteriser, the exporter, the retarget and the player are the estate's PROMOTED organs, forked with their stdout kept as log_<stage>.txt. A stage that refuses leaves its exit code in the status rows and the job still finishes with `done`, so the page reads FAILED at a named stage -- never green, never hung. MEASURED ON THE FIRST REAL JOB (house mesh, 2026-09-06, 16.9 s): the textured rasteriser REFUSES an asset without a TEXC section ("run nx_nxa_texc first"), so the render stage now composes nx_nxa_texc (a bone-anchored UV unwrap from the fresh SKEL+SKIN) before nx_nxa_texbake view; and nx_filehash lives at the serving root, not in _offc, so every fork resolves _offc/<name>.elf first and ./<name>.elf second -- a 127 from an absent twin is not a property of the organ. HONEST LIMIT, stated here and on the page: the promoted nx_autorig_mesh applies [cells] to the WEIGHT solve; its skeleton runs at the estate's conf resolution until the one-call organ takes the ladder for both stages (motion.plan MO12). license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_motion_lib.nx nx_motion_rig.nx

imports: nx_syscalls.nxnx_motion_lib.nx

imported by: nobody (leaf or entry point)

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

main mrw sys_write mo_slen mo_streq mo_atoi mo_slen ↻ mr_rig sys_clock_now_us sys_now_us 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 nxa_dump_sizes sys_clock_gettime_mono sys_mmap ↻ mo_read sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close mo_join sys_mmap ↻ mo_cat mo_kind_from_name mo_streq ↻ mr_status sys_mmap ↻

structs

none

consts

19const MR_EXIT_OK: i64 = 0
20const MR_EXIT_USAGE: i64 = 2
21const MR_EXIT_REFUSE: i64 = 3
22const MR_CELLS_DEFAULT: i64 = 192 // the referee-measured rung on the house rig (923 permil); a caller's cells wins
23const MR_STATUS_CAP: i64 = 8192
24const MR_RC_CONVERT: i64 = 0
25const MR_RC_RIG: i64 = 1
26const MR_RC_TEXC: i64 = 2
27const MR_RC_VIEW: i64 = 3
28const MR_RC_GLB: i64 = 4
29const MR_RC_HASH: i64 = 5
30const MR_RC_WORDS: i64 = 6
31const MR_N_VERTS: i64 = 0
32const MR_N_TRIS: i64 = 1
33const MR_N_LIMBS: i64 = 2
34const MR_N_JOINTS: i64 = 3
35const MR_N_BRANCHES: i64 = 4
36const MR_N_MIXED: i64 = 5
37const MR_N_WORDS: i64 = 6
38const MR_SHA_LEN: i64 = 64
39const MR_RC_KIND_REFUSED: i64 = 415 // the HTTP status the door would answer for the same refusal, kept as one vocabulary

functions

41func mrw(s: *u8) -> i64 { sys_write(1, s, mo_slen(s)); return 0 }
called by 3: mr_rigmr_animmain calls 2: sys_writemo_slen
43func mr_elf(name: *u8) -> *u8
50func mr_kv(b: *u8, o: i64, k: *u8, v: i64) -> i64 { var p: i64 = mo_cat(b, o, k); b[p] = 61 as u8; p = mo_num(b, p + 1, v); b[p] = 10 as u8; return p + 1 }
called by 1: mr_status calls 2: mo_catmo_num
51func mr_ks(b: *u8, o: i64, k: *u8, s: *u8) -> i64 { var p: i64 = mo_cat(b, o, k); b[p] = 61 as u8; p = mo_cat(b, p + 1, s); b[p] = 10 as u8; return p + 1 }
called by 1: mr_status calls 1: mo_cat
53func mr_status(jobdir: *u8, kind: *u8, cells: i64, stage: *u8, ok: i64, rcs: *i64, nums: *i64, sha: *u8, ms: i64) -> i64
78func mr_done(jobdir: *u8) -> i64 { return mo_write_all(mo_join(jobdir, "done" as *u8), "1\n" as *u8, 2) }
called by 1: mr_rig calls 2: mo_write_allmo_join
80func mr_logv(path: *u8, key: *u8) -> i64
87func mr_sha_from_log(path: *u8, out: *u8) -> i64
called by 1: mr_rig calls 3: sys_mmapmo_readmo_find
103func mr_render(jobdir: *u8, src: *u8, texp: *u8, png: *u8, logt: *u8, logv: *u8, rc_texc: *i64) -> i64
called by 2: mr_rigmr_anim calls 3: sys_mmapmo_runmr_elf
113func mr_rig(jobdir: *u8, cells: i64) -> i64
214func mr_anim(jobdir: *u8, donor: *u8, pose: *u8, key: *u8) -> i64
280func main(argc: i64, argv: *i64) -> i64