nel_gltf_extras - ryzom/ryzomcore GitHub Wiki


title: NeL-Specific glTF Extras (nel_* keys) description: Catalogue of custom keys the NeL toolchain writes into and reads from glTF nodes' "extras" objects โ€” used to preserve information the standard glTF properties can't carry losslessly (float32 bit-exact TRS, NeL-specific flags) published: true date: 2026-07-05T00:00:00.000Z tags: editor: markdown dateCreated: 2026-07-05T00:00:00.000Z

The NeL pipeline uses glTF 2.0 as a lossless intermediate between authoring tools and the runtime asset formats (.skel, .shape, .anim, โ€ฆ). Standard glTF properties (translation, rotation, scale, matrix) get lossily transformed by import/export layers โ€” assimp, in particular, combines per-node TRS into a single aiNode::mTransformation on read and requires the consumer to Decompose() it back, introducing precision loss on near-identity rotations and non-uniform scales.

To make the intermediate byte-lossless where it matters, tools that generate glTF for the NeL runtime write duplicate values in extras, and NeL's assimp-based readers prefer the extras when present, falling back to standard glTF properties otherwise. This preserves interop โ€” Blender, three.js, and every other glTF consumer sees the standard fields and works correctly โ€” while our roundtrip through the pipeline stays bit-exact.

The extras are scoped: per-node (aiNode::mMetaData after assimp import), per-mesh, per-primitive, per-material and asset.extras for the whole file. If a future asset class needs extras on another structure, add a new section here and note the type mapping.

The extras represent the source truth as the writer saw it, not a suggestion. A reader that respects the extras must not renormalise, quantise, or re-decompose the values behind them โ€” that's the whole point. If a reader wants to normalise (e.g., a runtime that requires unit quaternions), it should either normalise the standard rotation field or normalise a copy, keeping the extras semantics unchanged for downstream tools.

Per-node extras

Aimed at aiNode. Assimp's glTF loader surfaces JSON extras as aiMetadata entries keyed by the JSON property name. Type mapping (assimp 5.x observed):

JSON value form aiMetadataType Notes
true / false AI_BOOL Direct
123 (integer literal, no . or e) AI_UINT64 (or AI_INT32) Writer must force decimal notation for floats
1.5 (with . or e) AI_DOUBLE 9 decimal digits round-trip float32 exactly
"foo" AI_AISTRING
[a, b, c] version-dependent Not used in NeL extras โ€” separate scalar keys instead
{ ... } AI_AIMETADATA (nested) Not used

Skeleton-related keys (pipeline_max_export_skel โ†’ mesh_utils/assimp_skel)

Written by pipeline_max_export_skel --gltf โ€ฆ; read by mesh_utils's exportSkels() when the source is a glTF file. If any of the T/R/S triples is incomplete, the reader falls back to decomposing mTransformation โ€” so an artist-authored glTF without our extras still works.

Local transform (bit-exact TRS preservation)

Key Type Format Meaning
nel_tx, nel_ty, nel_tz float %.9g with forced decimal Local translation. Byte-identical to what the writer had before conversion.
nel_rx, nel_ry, nel_rz, nel_rw float %.9g with forced decimal Local rotation quaternion. Component order is XYZW to match glTF standard. Not pre-normalised โ€” writer must preserve the source's exact bits, including tiny deviations from unit length.
nel_sx, nel_sy, nel_sz float %.9g with forced decimal Local scale (per-axis).

Rationale for individual scalar keys instead of nel_translation: [x, y, z]: assimp's glTF-to-metadata mapping for JSON arrays has varied across versions. Scalar numbers map cleanly to typed aiMetadataEntry in every 5.x release; arrays are inconsistent. Ten extra keys per node is a small cost compared to a fragile array roundtrip.

Rationale for decimal-forced encoding: assimp's JSON parser picks the smallest integer type when the token has no . or e, so "nel_lodDisableDistance": 0 came through as AI_UINT64. The writer post-processes %.9g output and appends .0 if neither . nor e[E] appears, guaranteeing AI_DOUBLE.

Rationale for %.9g not %.17g: the source values are float32. 9 decimal digits are sufficient to round-trip float32 exactly through a double parser and back; 17 digits (needed for double bit-exactness) would just add noise-looking trailing digits with no information gain.

What about the standard translation/rotation/scale fields? The writer emits both. The standard fields make the glTF viewable in Blender, three.js, glTF-Validator etc. โ€” where slight precision loss doesn't matter. The extras make our internal roundtrip bit-exact.

NeL-specific flags (not representable in standard glTF)

Key Type Default when absent Meaning
nel_unheritScale bool false NeL bone's UnheritScale flag (see CBoneBase). true means the bone's scale is applied without inheriting from the parent โ€” matches the Max exporter's read of `INHERIT_SCL_X
nel_lodDisableDistance float 0.0 NeL bone's LodDisableDistance (from NEL3D_APPDATA_BONE_LOD_DISTANCE). Bone is disabled from skeleton evaluation when distance to camera exceeds this. 0 = never disable.

Standard glTF has no concept of either โ€” they're NeL-runtime-specific and would be silently lost by a round-trip through a stock glTF pipeline. Preserving them in extras is what makes the mesh_export roundtrip carry a full skeleton.

max2gltf whole-file extras (2026-07-14, stage 1)

pipeline_max_export_gltf (max2gltf, see max2gltf plan) writes one glTF per .max with the full node hierarchy and the evaluated shape-process meshes. Its extras are read by mesh_utils/gltf_nel_scene.cpp โ€” directly from the glTF JSON, never through assimp โ€” and reconstruct the exact pre-build state (CMeshBuild/CMeshBaseBuild/CMaterial), so the replayed NL3D build yields a byte-identical .shape on the same host (gated by ctest pipeline_max_gltf_corpus). The exact-tier import triggers on asset.extras.nel_source (the source .max basename); --no-nel-extras forces the generic assimp route.

Per-node (max2gltf)

Every scene node carries the bit-exact TRS set above (nel_t*/r*/s* โ€” values identical to the standard translation/rotation/scale fields, from decompMatrix(getLocalMatrix)). Shape-process nodes add:

Key Type Meaning
nel_shape bool The direct route would export this node as a .shape
nel_shape_name string Output basename (lowercased node name)
nel_shape_class, nel_shape_blob string + hex Special IShape classes (water/remanence/flare): the exact serialized .shape stream (version-patched), built by the same class builders the direct route uses. The importer emits it verbatim โ€” dual representation; structural extras when Blender authoring needs them
nel_coarse bool Routes to the with-coarse-mesh output directory
nel_cast_shadows, nel_rcv_shadows bool CMeshBaseBuild shadow flags (node render-control dword)
nel_lighting_local_atten bool UseLightingLocalAttenuation
nel_collision_mesh_gen int TCameraCollisionGenerate
nel_lod_dist_max, nel_lod_blend_length float LOD slot appdata (defaults 1000 / 0)
nel_lod_blend_in/out, nel_lod_coarse_mesh bool LOD slot flags (present when set)
nel_lod_mrm + nel_mrm_nlods/divisor/skin_reduction/dist_finest/dist_middle/dist_coarsest bool + ints/floats MRM build parameters (appdata)
nel_lod_count, nel_lod_name_<i>, nel_lod_dynamic_mesh int/string/bool Multi-lod parent slot list โ€” the importer assembles the CMeshMultiLod from these: LOD 0 = this node's mesh, LOD 1..count resolved by node name (case-insensitive); each slot's DistMax/BlendLength/flags/MRM come from that slot node's own nel_lod_*/nel_mrm_* keys; StaticLod = NOT nel_lod_dynamic_mesh
nel_lod_slave bool Node is another node's LOD slave (mesh built in the PARENT's material context; produces no standalone .shape)
nel_animated_materials, nel_auto_anim bool setAnimatedMaterial names / setAutoAnim replay
nel_has_morpher, nel_bs_names, nel_bs_factors bool + arrays Morpher channel defaults (BSNames/DefaultBSFactors)
nel_skip_class string Node the glTF carries nothing for, bucketed like the direct route's skips: builder-NULL water/flare/remanence (the direct route skips the same nodes), wavemaker, skinned-skin, skinned-physique, material/encode/shape-serial, mesh-eval. A meshless slot node with mesh-eval or skinned-physique (or an unselected node) just drops its multilod slot โ€” direct parity; any other class on a slot stages the whole multilod out. A multilod PARENT keeps its nel_shape even when its own mesh is missing (the direct route still exports from the surviving slave slots) โ€” except after a failed Physique decode, which kills the whole shape on the direct route too
nel_mapext, nel_lightmap, nel_interface bool Harness bucket tags (Map Extender UVs, LightMap-shader materials, interface weld applied)

Per-mesh / per-primitive (max2gltf)

CMeshGeom::build's VB dedups corners on (original vertex id, attributes) in global face order, and its bbox spans the full original vertex array โ€” the extras carry exactly those three things the standard primitives lose:

Key Where Type Meaning
nel_vertices mesh accessor (VEC3 float) The full original CMeshBuild::Vertices, verbatim (unreferenced verts included โ€” the bbox spans them)
nel_vertex_flags mesh int CMeshBuild::VertexFlags
nel_uv_routing mesh array[8] int CMeshBuild::UVRouting
nel_uv_stages mesh array int NeL UV stage per consecutive TEXCOORD_<i> set (sparse stage usage)
nel_materials mesh array int glTF material index per local material id (CMeshBaseBuild::Materials order, unreferenced materials included โ€” optimizeMaterialUsage runs after the build)
nel_iface_counts/_pos/_norm/_links mesh array + accessors Interface-weld polygons + per-vertex weld links (Interfaces/InterfaceLinks/InterfaceVertexFlag)
nel_skin_weights mesh accessor (VEC4 float) Per-ORIGINAL-vertex Physique weights (parallel to nel_vertices; present iff PaletteSkinFlag in nel_vertex_flags)
nel_skin_joints mesh accessor (u32, 4/vertex) Per-original-vertex bone matrix ids (indices into nel_bones_names)
nel_bones_names mesh array string Full skeleton bone list from the Physique decode (the geom build remaps to the used subset itself)
nel_bs_geoms mesh int Number of MRM morph-target builds (the direct route's bsList; consumed by the CMeshMRM branch only)
nel_bs_<i>_vertices mesh accessor (VEC3 float) Morph target i's full vertex array (count == base)
nel_bs_<i>_normals, nel_bs_<i>_colors, nel_bs_<i>_uvw<stage> mesh accessors (per corner) Morph target i's corner attribute streams in GLOBAL face order (index 3*face+corner) โ€” exactly the fields CMRMBuilder::buildBlendShapes reads; the target's own topology is never consulted
nel_material_id primitive int Local material id of this primitive's faces
nel_vertex_ids primitive accessor (u32) Original CCorner::Vertex per glTF vertex (the dedup key half the standard attributes lose)
nel_faces primitive accessor (u32/tri) Original GLOBAL face index per triangle (VB order + rdrpass fill order)
nel_smgroups primitive accessor (u32/tri) CFace::SmoothGroup per triangle

Primitive corners are deduped with the same key CCornerTmp::operator< uses under the build's vertex flags; UVW W components must be zero at this stage (asserted by the writer; TEXCOORD stays VEC2) and NumCoords must be 2.

Per-material (max2gltf)

Standard glTF carries a PBR interop view (baseColorFactor/-Texture from the diffuse + slot-0 texture, alphaMode, doubleSided). The nel_* extras carry the semantic field set of the built export CMaterial; the reader reconstructs through the same public setter sequence the exporter's material builder used and verifies the reconstructed _Flags dword against nel_flags โ€” a codec gap fails loudly instead of shipping a silently-different material. Keys (see nel_gltf/gltf_material.cpp, schema version nel_mtl: 1): nel_flags, nel_lighted, nel_shader, nel_blend, nel_src_blend, nel_dst_blend, nel_alpha_test, nel_alpha_test_thr, nel_zwrite, nel_zfunc, nel_zbias, nel_color/emissive/ambient/ diffuse/specular (hex rrggbbaa; diffuse alpha = opacity), nel_shininess, nel_double_sided, nel_lighted_vcolor, nel_stained_glass, and per stage i: nel_tex<i>_class (file/multi/cube) + file/files/sel/degrade + upload/wrap_s/wrap_t/min_filter/mag_filter/gray_alpha (ITexture base; cube inner texture under nel_tex<i>_cube_*), nel_tex<i>_gen/gen_mode (TexCoordGen), nel_tex<i>_env (canonical 32-bit CTexEnv pack โ€” bitfield order defined in the codec, not compiler layout) + env_color, nel_tex<i>_addr (texture-addressing mode), and nel_tex<i>_usermat (16 floats, artist-visible) + nel_tex<i>_usermat_blob (exact CMatrix::serial stream hex โ€” StateBit- conditional layout; the blob is authoritative, the floats are the view โ€” same dual- representation rule as animation tracks).

Materials are never lightmapped at this stage (1_export is unmapped; the standalone lightmapper adds _LightMaps downstream) โ€” the codec refuses materials carrying lightmaps.

A UserColor material holds the same texture in stages 0 and 1: NL3D sets the stage 0 texture into both stages and refuses a stage 1 texture of its own. The writer therefore emits the nel_tex1_* texture keys as a copy of the nel_tex0_* ones, and the reader requires them to be identical and sets the texture once; texture keys of stage 1 that differ fail the reconstruction.

The NeL sidecar of a model and NeL data in a glTF model (assimp route)

For artist-provided model files on the assimp route, the per-material extras above and the per-node keys of this page travel in two places (no new metadata format):

  • The NeL sidecar of the model, a glTF file beside it that holds all the NeL metadata of the model: materials matched to the scene materials by name, nodes matched to the scene nodes by name (see Node properties below), and asset.extras. It is valid glTF (asset and the arrays it has, no meshes needed). File name: the model's full file name plus .nel.gltf, except that a model whose name ends in .gltf drops that extension first (matched ignoring ASCII case): tree.obj โ†’ tree.obj.nel.gltf, tree.glb โ†’ tree.glb.nel.gltf, tree.gltf โ†’ tree.nel.gltf (nel_gltf/nel_sidecar_name.*; the shape process has a copy of the rule). A file whose name ends in .nel.gltf is a sidecar and never a model. There is no other metadata file beside a model.
  • The glTF model itself: a .gltf or .glb may carry the same keys in the extras of its own materials and nodes, and nel_* keys in asset.extras (mesh_utils/model_extras.*), read from the glTF JSON directly, never through assimp's metadata. They are bound by their place in the file, so no name is needed: the nodes of the assimp scene are paired with the nodes of the file along the tree, and each scene material with the material of the file through the primitives of the paired nodes, because assimp makes a scene material only of a material that a primitive uses (and adds a default material for a primitive without one), so a scene material index is not a file material index. Both pairings check the names and the counts; a file whose NeL data cannot be bound to the scene assimp reads stops the export.

Where a material comes from (meshUtilsMaterialSource in mesh_utils/mesh_utils.h, the one rule of precedence, which the material editor follows): the entry of its name in the model's own sidecar; else its own extras in the glTF model file; else the entry of its name in a materials library given with mesh_export --materials <file.gltf> (repeatable: of several, the last given wins); else the scene material converted (assimp_material). mesh_export reads the model's own sidecar by itself and writes it to the depend log; the shape process skips *.nel.gltf files as models and exports a model again when its sidecar is newer than the model's tag. --no-nel-extras turns off reading the NeL data of the model file (the validation route of artist files without our data); the sidecar is still read.

Names bind exactly as written, as glTF names are case-sensitive: the entry Wood binds to the material Wood only, and scene materials Wood and wood are two materials. Two entries whose names differ only by letter case are refused as ambiguous, in one sidecar and across the materials libraries of one import, as two entries of one name in one sidecar are. The nodes of a sidecar follow the same rule (mesh_utils/nel_sidecar.h, mesh_utils/material_sidecar.h).

Reading the JSON. A sidecar and the NeL data of a glTF model are read by a parser strict to RFC 8259 (NLGLTF::CJsonValue::parse, nel_gltf/json_value.*): it refuses an object that has a key twice (which of the two counts would be left to the reader), an unescaped control character in a string, a string that is not valid UTF-8, a \u escape of a surrogate that is not the pair of one character, a number that does not fit a finite double, nesting deeper than 128, a UTF-8 byte order mark before the value, and anything but white space after it, with the reason and the place (line, column and byte).

How deep a glTF model nests. Before assimp reads a .gltf or .glb, the import counts how deep its JSON nests arrays and objects (NLGLTF::jsonNestingDepth) and refuses a file deeper than 20 levels (MeshUtilsMaxGltfNesting in mesh_utils/mesh_utils.h), with the place: assimp's reader of glTF extras takes a time that doubles with each level of nesting. A file whose JSON text cannot be found (a damaged .glb container, a byte order mark) is refused the same way, as its depth cannot be counted. The deepest file of the sample of the .max converter (297 files) nests 7.

The scene root node (the one node at the top of a file's scene, or the node assimp makes above several) is a node for every node rule: the entries of the sidecar, the skeleton root and its one-root check, the keys of a bone. It goes by its own name, or by the model's file stem when it has none and holds meshes (its shape is named so); when nothing names it, only its own extras in the model file bind to it, by their place.

A node that gives no shape fails the export. A node with meshes gives no shape when its name cannot name its shape file (empty, not valid UTF-8, a control character, one of / \ : * ? " < > |, or a device name of Windows such as CON or COM1, with any extension), when an earlier node has its name or one that differs from it only by letter case, or when its meshes are not ones a NeL mesh can hold (more vertex colour or texture coordinate sets than it holds, no normals). The build goes on without it, so that a viewer shows the rest, but the export writes nothing of the model: mesh_export prints the reasons as ERROR lines and exits with a non-zero code. The skeleton, <file stem>.skel, follows the same rule of file names. Each file mesh_export writes goes through a temporary file beside it that takes its place once all of it is written; a file that cannot be written is left as it was. The shape process logs a model that mesh_export fails on, writes no tag for it (a tag left from an earlier run is removed) and exports it again on the next run.

The semantics of material entries, in the sidecar and in a library (mesh_utils/material_sidecar.cpp, tested by ctest pipeline_max_materials_sidecar), bound by material NAME, never positionally (aiProcess stays zero, so assimp preserves source names):

  • named scene material with an entry โ†’ the exact reconstructed CMaterial (flag-dword-verified by the codec);
  • named scene material without NeL data in any place โ†’ fallback to assimp_material conversion, with a warning when a sidecar or a library holds materials;
  • named scene material with NeL data both in the model's sidecar and in the model file โ†’ the sidecar's entry, with a warning;
  • unnamed materials (reported as errors of the log) โ†’ they can never bind by name: their own extras in a glTF model file give them their material, otherwise they are converted;
  • a name used by several scene materials, exactly as written (reported as an error of the log) โ†’ a later material of that name takes its own extras in the glTF model file when it has some, otherwise it shares the material of the first one; scene materials whose names differ only by letter case are different materials;
  • entries without a name, or whose extras have no nel_flags (an entry that has only a nel_material_script object counts as having none) โ†’ warned and ignored; two entries of one name in one file, two whose names differ only by letter case in one file or across the libraries of one import, and a codec reconstruction failure (missing keys, nel_flags mismatch), fail the export โ€” a corrupt or outdated sidecar never silently ships different materials;
  • unused entries are fine (shared material libraries are expected to over-cover);
  • a sidecar without materials is fine: the NeL sidecar of a model may hold only nodes;
  • a nel-extras (max2gltf) input ignores --materials and the model's sidecar with a warning โ€” its materials and nodes ride in-file and are byte-gated.

The material extras of a glTF model file follow the same rules: an extras with nel_* keys and no nel_flags is warned and gives nothing; built keys that do not reconstruct, or a nel_flags that is not an integer, stop the export with the place and the remedy; an extras that is not an object is data of another tool and carries no NeL key.

What the Material Editor writes (nl_material_editor)

The NeL Material Editor is the writer of the materials of the NeL sidecar for artist-provided models, and of the same data in the extras of a glTF model. It edits the materials of a model file that assimp reads and saves them in the sidecar; a model file of another format is never changed. A glTF model keeps its data where it is, in its own material extras or in the sidecar (the sidecar when both hold data), and one without data yet keeps it where the editor's setting says, the sidecar by default; a glTF of the .max converter keeps it in the file. What follows is what its code reads and writes. The parameters themselves, with their names, defaults and effects, are on NeL Material Parameters.

File name. The NeL sidecar of the model, named by the rule above (tree.obj.nel.gltf for tree.obj). A file whose name ends in .nel.gltf is not a model, and the editor refuses to open it as one.

Layout of the file. A sidecar the editor makes has two members, asset (version "2.0", generator "NeL Material Editor") and materials: no nodes, meshes, images or textures. The editor owns the materials array and the version and generator of asset; everything else of an existing sidecar is kept with its value and in its place: the other top-level members (the nodes with the node properties, the members of other tools), the other members of asset (its extras among them). The materials array holds the entries the editor writes, in the model's order, then the entries of the file that match no material of the model, kept exactly as they were. The editor writes an entry for a material that was edited, and again for one whose entry has a nel_material_script object already; an entry with built keys only that nobody edited is written back as it was, and a material without NeL data that nobody edited gets no entry. The text is written the same way every time: two spaces of indentation, one key per line, arrays of plain values on one line, floats as %.9g with a forced decimal marker, LF line ends, UTF-8 without a byte order mark (the shape process's loader does not read one). A second save of what a save wrote gives the same bytes.

An entry holds, in this order: name; the members of other tools that the entry had, in their order; pbrMetallicRoughness; alphaMode and alphaCutoff when they apply; doubleSided when true; extras. The editor writes name, alphaMode, alphaCutoff, doubleSided, the three factors of pbrMetallicRoughness (followed by the other members that pbrMetallicRoughness had) and every key of extras that starts with nel_. extras holds the keys of other tools that it had, then the built nel_* keys of the entry's material (the keys listed under Per-material above, in the order the example below shows), followed by one more key, nel_material_script.

In a glTF model file the editor writes the same nel_* keys, the built keys and nel_material_script, into the extras of the material itself, after its other keys, which stay byte for byte; a material without extras gets one. The file is edited in place (nel_gltf/gltf_json_patch.*): only the extras of the written materials change (and the material of an assigned primitive, below), the standard members of the materials (their PBR view) are not touched, every other byte stays, and what is inserted follows the layout of the text. A .glb gets its JSON chunk written again, padded with spaces to a multiple of four bytes, with the chunk length and the total length fixed, and every byte after the JSON chunk copied as it was. When the data of a material moves to the sidecar, its nel_* keys leave the file, and an extras left empty goes with them. In a file of the .max converter the built keys keep the LightMap shader, as its exact route replays the shape exporter's build, and the materials of its lightmapped nodes are not edited.

The material of a primitive. A material the editor assigns to a node of a glTF model is the material index of the primitive in the glTF file itself, plain glTF with no nel_* key, whether the NeL data of the materials is in the file or in the sidecar: the patcher replaces the integer, or inserts the member, and every other byte stays (a .glb gets its chunk lengths written again); the save reads the meshes back and compares them. The primitives of one mesh of the file that several nodes show take the material together. A primitive does not lose its material (the importer would give it a default material of its own), and it takes only a material that a primitive of the file uses, since the import holds no other. A glTF of the .max converter takes no assignment: its meshes carry what the converter built from their materials (COLOR_0 modulated by the diffuse and opacity, nel_uv_routing, nel_uv_stages, nel_vertex_flags) and its lightmap scene holds the materials of the receivers, so the material is assigned in the .max file, which is converted again. A model of another format takes none either: the materials of its primitives are part of the model file, which the editor does not write.

The PBR interop view is what a glTF viewer shows: baseColorFactor is the diffuse colour of the built material with its opacity as alpha (the colour of an unlit material); metallicFactor is 0 and roughnessFactor is 1; alphaMode is BLEND when the material blends, else MASK with alphaCutoff (the alpha test threshold) when it alpha tests, else absent; doubleSided is true for a two-sided material. It is the view the .max converter writes, without baseColorTexture. The sidecar has no images and no textures, because an image URI has to be relative to the glTF file, while the project finds textures by its own path rules (not by a file layout a glTF viewer knows). A viewer shows the colours and the blend mode, and no textures.

The built nel_* keys are the output of the codec for the material that the exporters' build makes from the script object, with the texture names reduced to bare file names and the lightmap shader off: a script object with the LightMap shader gives a built Normal material. They are derived on save and are never edited. The shape process's loader reads them, and verifies the reconstructed material with nel_flags.

The nel_material_script object is the authoring truth: the script-level parameters of the NeL Material as the artist set them. The built keys cannot hold them, because the build loses information (a water material builds a water shape, not a material; the combiner is built only under the Normal shader; the derived flags, the names of texmaps, the directories of texture files, the crop and angles baked into the mesh UVs, and the drop-down choices that the build collapses are not in the material). Nothing outside the editor and the nel_material library reads this object today: the shape process reads the built keys only. A hand edit of the object has no effect on an export until the editor saves the file again.

The object is a JSON object whose members are, in this order, version, then every parameter of the catalogue under its script name: the ten of the nlbp block, the main block, the bEnableSlot_1 to bEnableSlot_8, the bTexGen_1 to bTexGen_8 and the tTexture_1 to tTexture_8 of the textures block, then the nineteen parameters of each of the four slot blocks with their _1 to _4 suffix, 153 members in all (see the lists on NeL Material Parameters). The material's name is the entry's name and is not part of the object.

Parameter type JSON value written What the reader accepts
boolean true or false A JSON boolean only. A number is an error.
integer An integer Any number with a whole value within the 32-bit range (2.0 is read as 2); anything else is an error.
drop-down (an integer parameter) The stored 1-based index of the item As an integer. The range of the list is not checked when reading; a value outside it fails the build when the material is used.
float A number with %.9g digits and a forced decimal marker: 0.01 is written 0.00999999978, 1 is written 1.0 Any number.
percent The stored fraction, as a float: 10 % is 0.100000001, 100 % is 1.0 Any number, as a fraction.
color A string of six lower-case hex digits, rrggbb, 8 bits per channel; there is no alpha Exactly six hex digits, either case, no #. The writer takes the 8-bit value with the build's rounding (value x 255 + 0.5) and refuses to save a colour that is not a whole number of 255ths per channel; the user picks the colour again.
tTexture_N An object, the texmap (below) An object, or null for an empty slot.
version 14 or 15, the script version of the material 14 or 15; another value is an error. A missing version reads as 15, with a warning.

The texmap object has these members, in this order, whatever the kind:

Key Type Default Meaning
kind string "none" "none", "bitmap", "multi_bitmap", "cube" or "unsupported". A texmap object without a kind reads as "none", whatever else it holds.
className string "" The class of an unsupported texmap. Read-only information.
name string "" The texmap's name.
file string "" The bitmap's file as authored (see below). For a multi bitmap, the preview file, which is not exported.
multiFile1 to multiFile8 string "" The files of a multi bitmap, one per texture set.
cubeFilePosX, cubeFileNegX, cubeFilePosY, cubeFileNegY, cubeFilePosZ, cubeFileNegZ string "" The six files of a cube map.
uOffset, vOffset, uTiling, vTiling number 0, 0, 1, 1 The placement.
uAngle, vAngle, wAngle number 0 The angles, in radians.
wrapU, wrapV boolean true The tiling flags; off clamps.
mapChannel integer 1 The map channel of the mesh.
cropApply, cropU, cropV, cropW, cropH boolean, then numbers false, 0, 0, 1, 1 The bitmap's crop.
tracks object absent The animation of the placement, only when the texmap has any (below).

The strings of file, multiFile* and cubeFile* are the authored strings: for a texture chosen in the editor R:\graphics\<path relative to the graphics folder>, with its backslashes escaped in JSON, in the case of the file on disk. The built keys carry the bare file name (nel_tex0_file). Reading resolves an authored string by the project's path rules and, for a bare name or a path that does not resolve, through the model's own folder and the texture folders of graphics/nel.cfg; a string that does not resolve is an error value on the slot, never a silent substitution.

Animation keys (tracks) hold the keys of the five texture matrix coordinates of the slot. The members are named by the texmap field they animate: uOffset, vOffset, uTiling, vTiling, wAngle; a coordinate with no animation has no member. Each member is an object with, in this order: interpolation ("linear", "bezier" or "other"), range ([begin, end] in ticks, only when the controller has one), controllerClass (a string, only for "other") and keys, an array of [ticks, value] pairs with the time as an integer in ticks (4800 per second) and the value as a number. Only linear tracks are editable; the keys of a Bezier controller are the values at the key times, and the tangents are not represented. The runtime track names these coordinates become are on NeL Material Parameters. No tool of the pipeline turns these tracks into an .anim yet.

What the reader does with a problem. A value of the wrong type, a malformed colour, an unknown kind or interpolation keyword, a version other than 14 or 15, and a malformed range or key are errors: the entry then opens read-only in the editor, with the place and the remedy ("repair the entry"), and the editor does not write over the file. A key that is not a parameter name is a warning: it is not read and is not written back. A parameter without a key keeps the catalogue default, with a warning that lists the keys. The derived flags (bNormalShader, bWater and the others) are read as stored and not recomputed from iShaderType; the editor writes them consistent with it.

An entry as the editor writes it. For a material Bark, as a new material (script version 15, the Normal shader, the "Single Texture" preset), with one bitmap in slot 1. Lines that start with // ... stand for lines left out of this page, and are not JSON: the real file has no comments and no left-out lines.

{
  "asset": {
    "version": "2.0",
    "generator": "NeL Material Editor"
  },
  "materials": [
    {
      "name": "Bark",
      "pbrMetallicRoughness": {
        "baseColorFactor": [0.498039216, 0.498039216, 0.498039216, 1.0],
        "metallicFactor": 0.0,
        "roughnessFactor": 1.0
      },
      "extras": {
        "nel_mtl": 1,
        "nel_flags": 20,
        "nel_lighted": true,
        "nel_shader": 0,
        "nel_blend": false,
        "nel_src_blend": 0,
        "nel_dst_blend": 0,
        "nel_alpha_test": false,
        "nel_alpha_test_thr": 0.5,
        "nel_zwrite": true,
        "nel_zfunc": 5,
        "nel_zbias": 0.0,
        "nel_color": "ffffffff",
        "nel_emissive": "000000ff",
        "nel_ambient": "3f3f3fff",
        "nel_diffuse": "7f7f7fff",
        "nel_specular": "00000000",
        "nel_shininess": 8.0,
        "nel_double_sided": false,
        "nel_lighted_vcolor": false,
        "nel_stained_glass": false,
        "nel_tex0_class": "file",
        "nel_tex0_file": "bark.tga",
        "nel_tex0_degrade": true,
        "nel_tex0_upload": 0,
        "nel_tex0_wrap_s": 0,
        "nel_tex0_wrap_t": 0,
        "nel_tex0_min_filter": 5,
        "nel_tex0_mag_filter": 1,
        "nel_tex0_gray_alpha": true,
        "nel_tex0_env": 2592150017,
        "nel_tex0_env_color": "ffffffff",
        "nel_tex1_env": 2575307008,
        "nel_tex1_env_color": "ffffffff",
        "nel_tex2_env": 2575307008,
        "nel_tex2_env_color": "ffffffff",
        "nel_tex3_env": 2575307008,
        "nel_tex3_env_color": "ffffffff",
        "nel_material_script": {
          "version": 15,
          "bTwoSided": false,
          "cAmbient": "3f3f3f",
          "cDiffuse": "7f7f7f",
          "pOpacity": 1.0,
          "cSpecular": "ffffff",
          "pSpecularLevel": 0.0,
          "pGlossiness": 0.100000001,
          // ... cSelfIllumColor to bExportTextureMatrix: the 42 members of the main block, each at its
          // catalogue default, with iShaderType 1 and bNormalShader true, for example:
          "iShaderType": 1,
          "bUserColor": false,
          "bSpecular": false,
          "bNormalShader": true,
          "bPerPixelLightingShader": false,
          "cUserColor": "ff00ff",
          "bExportTextureMatrix": false,
          "bEnableSlot_1": true,
          "bEnableSlot_2": false,
          // ... bEnableSlot_3 to bEnableSlot_8, then bTexGen_1 to bTexGen_8, all false
          "tTexture_1": {
            "kind": "bitmap",
            "className": "",
            "name": "",
            "file": "R:\\graphics\\stuff\\generic\\bark.tga",
            "multiFile1": "",
            // ... multiFile2 to multiFile8 and the six cubeFile members, all ""
            "uOffset": 0.0,
            "vOffset": 0.0,
            "uTiling": 1.0,
            "vTiling": 1.0,
            "uAngle": 0.0,
            "vAngle": 0.0,
            "wAngle": 0.0,
            "wrapU": true,
            "wrapV": true,
            "mapChannel": 1,
            "cropApply": false,
            "cropU": 0.0,
            "cropV": 0.0,
            "cropW": 1.0,
            "cropH": 1.0
          },
          "tTexture_2": {
            "kind": "none",
            // ... the same members at their defaults
          },
          // ... tTexture_3 to tTexture_8 likewise, then the four slot blocks
          "cConstant_1": "ffffff",
          "iRgbOperation_1": 2,
          "iRgbBlendSource_1": 1,
          "iRgbArg0_1": 1,
          "iRgbArg1_1": 2,
          "iRgbArg2_1": 1,
          "iRgbArg0Operand_1": 1,
          "iRgbArg1Operand_1": 1,
          "iRgbArg2Operand_1": 1,
          "iAlphaOperation_1": 2,
          "iAlphaBlendSource_1": 1,
          "iAlphaArg0_1": 1,
          "iAlphaArg1_1": 2,
          "iAlphaArg2_1": 1,
          "iAlphaArg0Operand_1": 3,
          "iAlphaArg1Operand_1": 3,
          "iAlphaArg2Operand_1": 3,
          "iTextureShader_1": 1,
          "iConstantAlpha_1": 255
          // ... the slot blocks 2 to 4 (cConstant_2 to iConstantAlpha_4), every member at its default
        }
      }
    }
  ]
}

How the built keys follow from the script object: the Normal shader is nel_shader 0, the material is lit, the glossiness 10 % gives a shininess of 2^(10 x 0.1) x 4 = 8, the specular colour is the colour times the level 0 (alpha included, hence 00000000), the blend factors are the stored values minus 1 (the default 1 is one), and nel_zfunc 5 is lessequal. nel_flags 20 is the Z write flag (4) plus the lighting flag (16). nel_tex0_env and the three following env values are the combiner of the four stages in the canonical 32-bit packing of the codec: stage 1 of the "Single Texture" preset is Modulate of the texture and the diffuse colour for RGB and alpha, and the untouched stages 2 to 4 are Replace, which is not the default environment, so they have keys too. The nel_tex0_* texture keys are those of a bitmap texture with NeL's defaults.

A minimal entry that the editor reads. A hand-written entry needs only the members it sets; everything else takes the catalogue default, and the editor lists the missing keys in a warning. This file is complete and valid:

{
  "asset": { "version": "2.0" },
  "materials": [
    {
      "name": "Bark",
      "extras": {
        "nel_material_script": {
          "version": 15,
          "cDiffuse": "808080",
          "pOpacity": 1.0,
          "iShaderType": 1,
          "bNormalShader": true,
          "bEnableSlot_1": true,
          "tTexture_1": {
            "kind": "bitmap",
            "file": "R:\\graphics\\stuff\\generic\\bark.tga",
            "tracks": {
              "vOffset": {
                "interpolation": "linear",
                "range": [0, 4800],
                "keys": [
                  [0, 0.0],
                  [4800, 1.0]
                ]
              }
            }
          }
        }
      }
    }
  ]
}

The editor reads this as a lit Normal material, grey diffuse (128), one bitmap in slot 1 with its V offset animated from 0 to 1 over one second (the tracks member, a track of the vOffset coordinate), and the stage combiner at its catalogue default (Replace). It has no nel_flags, so the shape process's loader warns that it has no built keys and ignores it; it builds the material from the model. Saving from the editor writes the full entry, with its built keys.

NeL data that has only built keys. A material of a glTF written by the .max converter, or a sidecar entry or a material written by another tool or by hand, holds the nel_* keys and no nel_material_script object.

  • The shape process's loader reconstructs the material from the built keys, verified with nel_flags, as before. It never reads nel_material_script.
  • The editor imports the parameters from the built material as far as the build determines them and marks the material "imported" until it is saved; saving writes the full record. What the built material does not determine has the values of a new material, and the editor lists it:
Parameters From the built material
the shader type and its derived flags nel_shader. A built Normal material may have been a water sub-material, or a LightMap material built without lighting; the LightMap shader forces bUnlighted and the blend factors
bUnlighted, bStainedGlassWindow, bTwoSided, bColorVertex nel_lighted, nel_stained_glass, nel_double_sided, nel_lighted_vcolor (an unlit material keeps no colour vertex flag)
bAlphaBlend, bAlphaTest, the blend factors, fZBias nel_blend, nel_alpha_test, nel_src_blend and nel_dst_blend plus 1, nel_zbias
bForceZWrite, bForceNoZWrite nel_zwrite: only the one that the blend state makes meaningful (a blended material stores bForceZWrite, an opaque one stores bForceNoZWrite)
the colours and the opacity nel_diffuse (nel_color when unlit) and nel_ambient, 8 bits per channel. The emissive colour becomes cSelfIllumColor with bUseSelfIllumColor, and the specular colour becomes cSpecular at a level of 100 %: only their products are stored
pGlossiness from nel_shininess: log2(shininess / 4) / 10
cUserColor only for the UserColor shader
the texture slots bitmap, multi bitmap and cube classes with their bare file names; the enable flag from the presence of the texture; the wrap flags from the wrap modes; bTexGen_N from nel_tex<i>_gen; under the Specular shader the cube of stage 2 turns back into its 2D texture
the placement from nel_tex<i>_usermat when present: tiling, W angle and offset; the U and V angles come out 0 and a negative tiling positive. bExportTextureMatrix is set when a stage has a user matrix
the combiner (Normal shader only) from nel_tex<i>_env, env_color and addr: the operations, the argument sources and operands, the constant colour and alpha, the texture shader. A blend source is read only for the Alpha Blend operation. A stage on "Disable" reads as TextureOff once another stage has a texture shader
not determined the map channels, the crop and the U and V angles (baked into the mesh UVs), the texmap names and directories, bAlphaVertex, iAlphaVertexChannel, iLightMapChannel, iShader, the water parameters, and under a shader other than Normal the combiner

Where NeL data has both a nel_material_script object and built keys, the editor builds the material from the object; when that differs from the built keys (the file was changed by hand or by another tool) it says so, and a save of the material writes the built keys again from the object.

Matching. Sidecar entries are bound to the materials of the model by name, exactly as written, as the loader binds them. Two entries of one name, or whose names differ only by letter case, make the editor treat the file as damaged and open the model read-only, as the loader refuses them. Two materials of the model whose names differ only by letter case are two materials, but a sidecar cannot hold the NeL data of both: the editor says so at the load and refuses a save of both into the sidecar; a glTF can keep their data in the file. An entry whose name differs from a material's only by letter case binds to nothing: the editor warns, keeps the entry as it is, and refuses a save of that material into the sidecar while both are there. The NeL data in a glTF model file is bound by the place of the material (see above), so two materials of one name are no error of the file. The editor edits only materials with a name of their own: a material without a name, or whose name another material of the model repeats exactly, is read-only and gets no entry. A glTF that carries asset.extras.nel_source was written by the .max converter: its exact route reads the data in the file and no sidecar, so the editor writes its materials into the file; the materials of its lightmapped nodes (nel_lightmap) are read-only, since the lightmapper builds those shapes from the lightmap scene stored in the file (asset.extras.nel_lmscene).

Node properties (assimp route)

The NeL export properties of a node (the per-node appdata of the reference exporter plugin: export gates, collision flags, LOD/MRM configuration, lightmap lumel-size and LMC colors, shadow flags, instance naming, accelerator type, ...) travel for artist-provided scenes in the nodes array of the model's NeL sidecar: empty dummy nodes matched to the scene's nodes by exact NAME, each carrying the standard per-node nel_* extras vocabulary of this document (mesh_utils/nel_sidecar.*). A glTF model may carry the same keys in the extras of its own nodes, bound by the place of the node (mesh_utils/model_extras.*). Dummy nodes are legal glTF: nodes need not be referenced by any scene and carry no mesh, children or TRS โ€” they exist purely as named extras anchors.

The node keys the assimp route reads:

Key Type Default when absent Meaning
nel_shape bool true The meshes of the node build a shape; false builds none.
nel_instance_name string absent The node is an instance placed by that name, not a shape of its own: its meshes build no shape.
nel_skeleton_root bool false The skeleton is this node and every node under it. Without one, the skeleton starts at the node named Bip01 (any case). Two skeleton roots, in the sidecar or in the file or between them, are an error.
nel_unheritScale bool false The bone's UnheritScale, as under Skeleton-related keys above.
nel_lodDisableDistance float 0.0 The bone's LodDisableDistance, as under Skeleton-related keys above.
  • Precedence mirrors materials: every key the sidecar entry of a node gives replaces that key of the node's own extras in the model file; a key neither gives has its default.
  • A sidecar node without a name is warned and ignored. Two sidecar nodes of one name or whose names differ only by letter case, a key of the wrong type and a second skeleton root are errors: the export stops, and an ambiguous or malformed sidecar never builds silently. A sidecar node binds to the scene node of its name exactly as written, the scene root node included (see The scene root node above); one that matches no node of the scene is warned (over-coverage is tolerated: a sidecar may serve versions of a model); scene nodes without an entry use the defaults. When the scene has several nodes of one name, or whose names differ only by letter case, only the first one is built, and the export of the model fails (see A node that gives no shape fails the export above).
  • One vocabulary: the keys are the SAME nel_* node-extras keys the max2gltf writer emits. The other node keys of that vocabulary are not read by the assimp route yet; a sidecar or a model file that has them gets a warning that lists them, and they are left as they are.
  • Scene-level export properties (default instance-group name, skeleton mode, tag-protocol fields) are designed to ride asset.extras of the sidecar under the same rule; the assimp route reads none yet, and warns about the nel_* keys it finds there.
  • Authoring tool (designed, not implemented): a dedicated NeL scene-properties editor that loads the artist file visually through assimp (the same route mesh_export uses), presents the node tree, and saves ONLY the sidecar โ€” it never rewrites the artist's source file. It is a separate tool from the material editor (different editing scope); both write the same file, and the material editor keeps the nodes of a sidecar as they are when it saves.

This closes the assimp-route parity story structurally: geometry from the artist file, materials and NeL export semantics from the model's NeL sidecar (or from the glTF model itself) โ€” everything 1_export needs (including the .lmscene producer for artist scenes: receivers/occluders from assimp geometry + sidecar flags, lights from KHR_lights_punctual + nel_* light extras) without any information living in a format only the modelling program can read.

Instance groups (max2gltf)

Dual representation, the same rule as animation tracks:

  • nel_ig_name (per node, string): the node's NEL3D_APPDATA_IGNAME appdata โ€” the artist-visible IG membership tag (the node's TRS is its placement).
  • asset.extras.nel_igs (array of {name, data}): per distinct ig name, the exact CInstanceGroup::serial stream (hex) as built by the ig process's full flow โ€” pipeline_max_export_ig's selection/XRef/clusterize/light code compiled into the writer (pmbExportIgsForGltf, guarded main). mesh_export re-emits <name>.ig from the blob (--ig-dst), byte-identical to the direct route (gated in pipeline_max_gltf_corpus). Editing instance placements in Blender does NOT update the blob yet โ€” rebuilding an edited ig from the structural tags is future work; the blob is authoritative until then.

Ligo brick igs (zonematerial-*/zonetransition-* sources) stay direct-route with the rest of the zone pipeline (plan non-goal).

Ligo zones (max2gltf)

PatchMesh has no faithful glTF form โ€” dual representation, blob + baked viewing proxy:

  • asset.extras.nel_zones (array of {name, data}): every file the NeLLigoExportZone flow produces (zones/<name>.zone, zoneligos/<name>.ligozone โ€” the name carries the subdir), bytes verbatim as pipeline_max_export_zone writes them (pmbExportZonesForGltf, guarded main; per-ecosystem --zone-bank). mesh_export --zone-dst re-emits the tree byte-identical (gated in pipeline_max_gltf_corpus over the ligo zone corpus).
  • nel_proxy (per node, bool): a tessellated viewing mesh of the AUTHORED patches (bicubic bezier eval at 2ร— tile density, world space, root-level identity node named <rpo-node>.zoneproxy) โ€” any glTF consumer renders the brick; the exact-tier importer ignores these nodes (no nel_shape). nel_proxy_frozen marks the neighbor-reference context bricks so viewers can dim them. Editing the proxy does NOT edit the zone โ€” the blob is authoritative (importing a proxy through the no-nel-extras emulation route just yields a plain static mesh, which is the honest limit of foreign-tool authoring for patch landscape).

Animations (max2gltf)

Dual representation โ€” the blob first, sampled interop channels as a later additive tier:

  • asset.extras.nel_anim ({name, data}): the exact CAnimation::serial stream (hex) as built by the anim process's whole-file flow โ€” pipeline_max_export_anim's $Bip01-first + EXPORT_NODE_ANIMATION selection, biped COM decode and track build compiled into the writer (pmbExportAnimForGltf, guarded main). name is the lowercased .max stem; mesh_export re-emits <name>.anim from the blob (--anim-dst), byte-identical to the direct route (gated in pipeline_max_gltf_corpus over the 4524-file anim corpus unioned into the sweep).
  • Standard glTF animation channels (sampled viewing tier, 2026-07-14): the blob is deserialized back into a CAnimation in the writer and every <node>.pos/rotquat/scale track is LINEAR-sampled at 30 fps into animations[0] channels targeting the node whose glTF name matches the track prefix (rig rest poses landed with the skins tier; _Second names match). Rotation samples are hemisphere-aligned so viewer slerp never takes the long way. This is a lossy interop VIEW โ€” DCC edits do not flow back; the blob stays authoritative. Bare track names ("pos", not "Node.pos" โ€” the Ryzom per-node convention for the selection root) map to the empty-prefix selection node reported by the anim flow. Non-TRS tracks (materials, note tracks, camera) are not sampled yet. Ctest pipeline_max_gltf_anim_channels.

Standard morph targets (max2gltf viewing tier)

Meshes with MRM morph targets additionally emit per-primitive glTF targets (POSITION deltas per original vertex id โ€” float-exact against nel_bs_<i>_vertices โˆ’ nel_vertices โ€” plus NORMAL deltas from the first-occurrence corner; per-corner target normals collapse to per-vertex, the nel_bs_* corner streams stay authoritative), mesh.weights defaults (NeL percents / 100) and the Blender-convention extras.targetNames (= nel_bs_names). Morph factor tracks (<node>.<target>MorphFactor, or bare for the selection root) sample into "weights" animation channels โ€” no shipped corpus animation carries them (facial emotes are bone-driven; the visage morphs are character-customization sliders), so that path is exercised by future content, not the corpus. Ctest pipeline_max_gltf_morph_targets.

glTF skins (max2gltf viewing tier)

Skinned meshes (Physique) additionally carry the standard glTF skinning form so any viewer can pose them โ€” an interop VIEW; the exact tier reconstructs from nel_skin_* only:

  • JOINTS_0/WEIGHTS_0 per primitive (u16/float VEC4): the CSkinWeight values gathered per deduped glTF vertex. JOINTS_0 indexes skin.joints, which follows nel_bones_names order. Zero-weight slots emit joint 0 / weight 0 (the NeL side leaves their MatrixIds uninitialized โ€” the geom build never reads them; the exact-tier nel_skin_joints carries them verbatim).
  • skins[] per skinned mesh node: joints are the exact scene nodes behind BonesNames (resolved from the physique decode's own skeleton walk โ€” duplicate bone names stay unambiguous), inverseBindMatrices = inverses of the joints' composed world matrices from the same TRS floats the glTF nodes carry, so world(joint) @ IBM cancels at bind pose exactly the way a viewer composes it. The mesh vertices are world-space bind pose (the direct exporter's convention), so rendering with or without the skin agrees. Duplicate scene node names get the skeleton walk's _Second suffix in the glTF too โ€” node names stay unique (assimp refuses duplicate bone names) and match nel_bones_names exactly.
  • Biped rig rest pose: biped TM controllers are not PRS, so the plain node path would leave the whole rig at identity โ€” rig nodes instead decode through the skel exporter's figure-mode reconstruction (biped_rig: COM record, getBipedLocal, and walkNode's PRS-child-of-COM world-frame-rotation rule). Verified: rest-pose skinning identity holds to ~3e-7 m on the fixture (ctest pipeline_max_gltf_skins) โ€” figure pose and the .max bind pose agree to float precision. Non-biped nodes keep the established getLocalMatrix path (non-biped files' output is byte-unchanged).

Editing weights/skeleton in a DCC does NOT update nel_skin_* โ€” the extras stay authoritative for the exact tier (same dual-representation rule as everything else).

Single-output process blobs (max2gltf)

asset.extras.nel_swt / asset.extras.nel_pacs_prim / asset.extras.nel_skel ({name, data}): the skeleton-weight (.swt), PACS-primitives (.pacs_prim XML) and skeleton (.skel, the Bip01-rooted skel-process output โ€” the separate pipeline_max_export_skel --gltf skeleton-glTF route is unchanged) whole-file outputs, bytes verbatim. The flows are SHARED with the standalone tools (PMB_SWT_NO_MAIN / PMB_PACS_PRIM_NO_MAIN guard the mains, which now delegate to the same function) โ€” the blob and the tool's file cannot drift. mesh_export re-emits <name>.swt / <name>.pacs_prim next to the shapes; gated in pipeline_max_gltf_corpus (swt + pacs_prim source sets unioned into the sweep).

asset.extras.nel_vegets / asset.extras.nel_clods / asset.extras.nel_cmbs (arrays of {name, data}): the veget, clod and cmb processes' per-node/per-igname outputs (PMB_VEGET_NO_MAIN/PMB_CLOD_NO_MAIN/PMB_CMB_NO_MAIN, same delegating-main pattern โ€” the microveget, lod_actors and interior-cmb corpora ride the gate plus the ligo bricks through the cmb --ligo XRef path, selected by the zone filename protocol; mesh_export re-emits <name>.veget/<name>.clod/<igname>.cmb).

asset.extras.nel_lmscene ({name, data}): the standalone lightmapper's 1_export intermediate (.lmscene, design doc ยง11-lm โ€” receivers as pre-build CMeshBuild/ CMeshBaseBuild + shape-build recipe, occluder meshes, source-fidelity lights), bytes verbatim as a direct pipeline_max_export_shape --lm-scene run writes them. The stream is version 1 (NL3D::CLightmapScene::serial): after the receivers, the state of the materials of each occluder and receiver that CMaterial::serial does not store (the stained glass flag), in a block of its own version; version 0 streams still read. A stream that holds anything after the scene is refused, as a damaged file or a later version read with an earlier header. The flow IS the shape exporter's whole per-file flow (PMB_SHAPE_NO_MAIN guards its main; the writer's own node loop keeps feeding the glTF encoder) run in lightmap-scene-only mode: nodes that can't collect as receivers skip the mesh build, receiver nodes take the full build path so the collected pre-build data is bit-for-bit the direct run's. Blob rather than structural: the pre-build intermediate is its own versioned NeL serial contract, and the glTF mesh accessors feed the shape build โ€” the lightmapper's UV2 unwrap consumes the pre-build receivers, which carry state (per-geom appdata, LOD exclusion sets, light exclusion lists) that the rendering-oriented extras deliberately don't duplicate. mesh_export re-emits <name>.lmscene; rides the singles tier of pipeline_max_gltf_corpus.

Structural special shapes (water / remanence / flare)

Full parity: every field the class builders set rides as artist-visible extras (gltf_special_shape.cpp), and the reader reconstructs the shape through the same setter sequence, serializing with the direct exporter's patches (CWaterShape v7โ†’v4 + truncation). Completeness is enforced by construction: the writer rebuilds the shape from its own extras and byte-compares against the directly-built serialization before dropping the opaque blob; a mismatch warns and falls back to nel_shape_blob (which the reader still emits verbatim when present โ€” never silent loss). nel_shape_class selects the codec.

  • Water (nel_water_*): env / env_under (1 file, or 2 = day/night CTextureBlend), displace_file/bump_file + per-map scale_u/v + speed_u/v, optional color_file + color_mat (6 floats), poly (2D convex hull, x/y pairs), height_factor, pool_id, transition_ratio, splash, scene_env_above/under, def_pos/scale/rot.
  • Remanence (nel_rem_*): num_slices, slice_time, rollup_ratio, texture_shifting, material (nested object, the standard nel_* material codec โ€” flag-dword verified), corners (x/y/z triplets), optional anim_material, def_pos/scale/rot.
  • Flare (nel_flare_*): color/dazzle_color (hex rrggbbaa), persistence, spacing, attenuable + atten_range, first_keep_size, dazzle_atten_range, max_view_dist + _ratio, infinite_dist, scale_disappear/size_disappear/angle_disappear, look_at, optional occlusion_mesh + occlusion_inherit_scale_rot, per-slot arrays sizes/rel_pos/ textures (10 slots, empty string = unused), def_pos.

Reader semantics

Consumer code should read extras and prefer them over the standard fields when both are present and the extras form a complete set:

float tx, ty, tz, rx, ry, rz, rw, sx, sy, sz;
bool haveTrans = getNelFloat(node, "nel_tx", tx) & getNelFloat(node, "nel_ty", ty) & getNelFloat(node, "nel_tz", tz);
bool haveRot   = getNelFloat(node, "nel_rx", rx) & /* ...ry, rz, rw */;
bool haveScl   = /* nel_sx, sy, sz */;
if (haveTrans && haveRot && haveScl) {
    // use nel_* extras verbatim
} else {
    // fall back to assimp's Decompose(mTransformation)
}

All-or-nothing per triple: if a writer emits only two of three translation components, the reader treats the whole triple as missing rather than mixing extras with decomposed values. Cleaner failure mode, avoids partial-noise cases.

Validation flag: --no-nel-extras

mesh_export exposes a --no-nel-extras flag that makes the reader ignore every nel_* per-node key and reconstruct transforms via Decompose(mTransformation) even when the extras are present. It also turns off the exact route of a max2gltf file and the reading of the NeL data a glTF model carries in its own materials and nodes; the model's NeL sidecar is still read. This is the same code path an artist-authored glTF without our extras hits, so with the flag we can:

  • confirm the fallback is functionally correct (semantic content preserved end-to-end),
  • measure the fallback's byte-accuracy floor against our extras-based path,
  • catch regressions in the fallback that would otherwise be hidden by the extras always winning.

On the 9-file non-biped skeleton corpus, A vs B parity is:

with extras (default) with --no-nel-extras
A-vs-B match 100.0% on every file 90.7% โ€“ 97.2%

The residual delta with the flag on is float noise in InvBindPos rotation cells from Decompose's row-magnitude renormalisation of the 3ร—3 โ€” same class of noise Max's own arithmetic produces in the reference outputs (T3-epsilon per pipeline_max_design ยง9). Semantic correctness โ€” bone hierarchy, names, in-engine animation appearance โ€” is unaffected.

Use this flag in CI as a regression gate on the fallback path: it must always produce a valid .skel, and the byte-parity against the extras-based .skel should stay โ‰ฅ90% on the corpus.

Conformance

The current writer is nel/tools/3d/pipeline_max_export_skel/main.cpp::writeGltf(). The current reader is nel/tools/3d/mesh_utils/assimp_skel.cpp::walkSkelNode(). Both track this spec; a change to either without updating the other is a bug.

When adding a new extras key:

  1. Update this page (add a row in the appropriate table).
  2. Update both writer and reader in the same commit if both sides need to change.
  3. Add a compile-time or CI check that reader knows about all keys writer emits (nice-to-have, not currently enforced).

Future work

Under consideration but not implemented:

  • Mesh/shape extras for nel_material_flags, nel_lightmap_group, etc. Would carry more NeL-specific material data in the glTF itself.
  • Animation extras for nel_track_default, nel_loop_mode etc.
  • Scene extras for nel_scene_version, nel_tag_time โ€” for the tag-file roundtrip protocol from build_gamedata.
  • Deprecation path if the standard glTF KHR_* extensions ever cover our needs (e.g., a glTF extension for non-uniform bone scale semantics). Extras are cheap to add and remove; extensions are conservative.

See also: Pipeline Max Design for the .max-side context, and mesh_utils/nel_sidecar.h and mesh_utils/model_extras.h for the readers of the NeL sidecar of a model and of the NeL data in a glTF model.

The writer of the materials of the NeL sidecar, and of the NeL data in a glTF model, is the NeL Material Editor: see NeL Material Editor: Design and NeL Material Parameters.

โš ๏ธ **GitHub.com Fallback** โš ๏ธ