code wiki / (root) / nx_char_asset.nx

nx_char_asset.nx source

↩ module page · 43 lines · 2736 B

1// nx_char_asset.nx -- the CONSENT-GATED, LAYERED character pipeline (operator: "license a nude model, add layers 2// of armor/clothing/makeup, deliver into art-coaching / games"). A character = a licensed nude BASE (variant + 3// figure) + a LAYER STACK (nx_outfit clothing/armor, makeup, ...). The DELIVERED nudity tier is set by the layers: 4// a fully-covering outfit delivers CLOTHED (any licensed model), a bare base delivers ARTISTIC-nude (needs the 5// life-drawing license), explicit delivers EXPLICIT. Delivering as a game asset meshes the SDF (nx_meshgen) and 6// writes glTF (nx_gltf_export). Every delivery is GATED by nx_consent (tier + use-case), FAIL-CLOSED. This is the 7// wire-in that turns the consent primitive into real pipeline ENFORCEMENT. license_tier: ORIGINAL 8import "nx_syscalls.nx" 9import "nx_sdfrender.nx" 10import "nx_assetvariant.nx" 11import "nx_body_figure.nx" 12import "nx_outfit.nx" 13import "nx_consent.nx" 14import "nx_meshgen.nx" 15import "nx_gltf_export.nx" 16 17// build the licensed nude BASE, then layer the outfit on top (the standard base+layers pipeline). 18func char_build(base: i64, sp: i64, hv: i64, ev: i64, tv: i64, build: i64, figure: i64, outfit: i64) -> i64 { 19 av_build(base, sp, hv, ev, tv, build) 20 if figure > 0 { figure_apply(base, figure) } 21 if outfit > 0 { let np: *i64 = (base + O_NPART) as *i64; outfit_apply(base, np[0], outfit) } 22 return 0 23} 24// the delivered nudity tier, decided by the LAYERS: a covering outfit -> CLOTHED; bare base -> ARTISTIC nude; 25// explicit content -> EXPLICIT. (Layering DOWN is why a clothed-only-licensed model can still ship, dressed.) 26func char_delivery_tier(outfit: i64, explicit: i64) -> i64 { 27 if explicit == 1 { return LIC_EXPLICIT } 28 if outfit > 0 { return LIC_CLOTHED } 29 return LIC_ARTISTIC 30} 31// GAME-ASSET EXPORT, consent-gated. Returns glTF bytes, or -1 REFUSED (fail-closed -- nothing written) when the 32// model's license doesn't cover this delivery's tier+uses. Synthetic chars pass (record = PROV_SYNTH). 33func char_export_gltf_gated(base: i64, F: *i64, cubevi: *i64, vbuf: *i64, fbuf: *i64, out: *i64, 34 consent: *i64, now: i64, outfit: i64, explicit: i64, uses: i64, path: *u8) -> i64 { 35 let tier: i64 = char_delivery_tier(outfit, explicit) 36 if consent_allows(consent, tier, uses, now) == 0 { return 0 - 1 } 37 mg_build(base, F, cubevi, vbuf, fbuf, out) 38 return write_glb(vbuf, fbuf, out[0], out[1], path) 39} 40// non-export deliveries (a render for art-coaching reference, a distribute) share the same gate. Returns 1/0. 41func char_deliver_ok(consent: *i64, now: i64, outfit: i64, explicit: i64, uses: i64) -> i64 { 42 return consent_allows(consent, char_delivery_tier(outfit, explicit), uses, now) 43}