Skip to content

manual_character_shape_export

Jan Boon edited this page Nov 13, 2026 · 3 revisions

title: Exporting One Character Shape by Hand description: How to export one character .max file with the custom exporter tools and carry the shape through the shadow skin, CLodTex and install steps of the characters project by hand, with the tools to inspect the scene file and to check the result; worked example the Zorai leader haircut. published: true date: 2026-11-13T12:00:00.000Z tags: editor: markdown dateCreated: 2026-11-13T12:00:00.000Z

This is the exception. Normally a changed .max file is picked up by a rerun of the build pipeline, which detects what changed and rebuilds everything downstream. The .max export of the pipeline still goes through the modelling program; using the custom exporter tools in the pipeline is planned for the next version. Until then, this page is for exporting one file with the custom tools, without the modelling program, and placing the result by hand. {.is-warning}

The custom exporter tools

Built with the tools target of the Quick Start (build_win32\tools\bin\Release); run them with the externals on PATH (.nel\path_config.bat, or the console of cmd_tools.bat).

Tool Use
pipeline_max_export_shape [--db <graphics root>] [-v] <file.max> <out dir> Export the shapes of a .max file, as the pipeline export step would. --db is the root of the graphics checkout.
pipeline_max_export_shape --compare <a.shape> <b.shape> Compare two shapes: class, vertex buffers (count, format, largest difference per value), index buffers per LOD.
pipeline_max_export_shape --dump-skin <file.shape> Class, bones and skin weights of a skinned MRM shape; all vertices with PMB_SKIN_DUMP_ALL=1.
pipeline_max_export_shape --dump-mesh <file.shape> Every value of every vertex of the vertex buffer, one vertex per line, for a vertex-by-vertex comparison of two exports with a small script. For an MRM shape, the full-detail buffer: its first vertices are the geomorphs, filled at render time and zero in the file.
pipeline_max_dump <file.max> Dump the whole scene file: the class directory (the name of each class the file uses), every object with its references and chunks. Long output: write it to a file and search it.

Environment switches of the exporter: PMB_NO_SKIN=1 exports a Physique mesh rigid (to compare with a reference export that came out without its skin); PMB_STACK_DUMP=1 prints the vertex and face counts after each modifier.

The characters chain

The common/characters project (leveldesign/workspace/common/characters) takes a character shape through these steps; the folders are under pipeline/export/common/characters:

Step Pipeline By hand
Export shape 1_export: the .max files of ShapeSourceDirectories to shape_not_optimized, with a tag in shape_tag pipeline_max_export_shape --db <graphics> <file.max> <tmp dir>, then copy the shape to shape_not_optimized and write the date into shape_tag/<file>.max.tag
Shadow skin build_shadow_skin <in> <out> 35 2000 into shape_shadow_skin_build (BuildShadowSkinEnabled, ratio and max faces in process.py); skinned shapes only the same command on the one shape
CLodTex build_clodtex -d <cfg> clod_export <in dir> <out dir> into shape_clodtex_build; the cfg is stuff/lod_actors/lod_characters/clod_char_script.cfg of the graphics, whose clod_tex_shape_filters gives HOM_LOD to *_HOM*.shape and HOF_LOD to *_HOF*.shape the same command on a folder that holds only the one shape, then copy the result to shape_clodtex_build
Lightmap optimizer rebuilds the whole shape_optimized folder from shape_clodtex_build when anything changed copy the shape to shape_optimized: a character shape has no lightmap and comes through unchanged (check: in shape_optimized, the other shapes are byte-identical to their shape_clodtex_build copy)
Install shape 3_install: shape_optimized to pipeline/install/characters_shapes copy the shape there

Back up every stage of the shape before (shape_not_optimized, shape_clodtex_build, shape_optimized, the install, the tag), so the old one can go back. The development client reads pipeline/install directly and loads shapes at start: restart it to see the new one. A client from a patch needs a new patch.

This shortcut holds for character shapes. Shapes of other projects can carry lightmaps or coarse meshes, where the lightmap optimizer and the coarse mesh build do change them; rerun the pipeline for those.

Checking an export

  • Against an earlier export of the same file: --compare old new. Same class and vertex count with differences at the float rounding level means the same geometry.
  • Skinned or not: --dump-skin lists the bones; a rigid shape names none, and the client logs Cannot bind the skin <shape> to the skeleton in the slot for a rigid shape in a skinned slot such as a haircut.
  • Against a reference that came out rigid: export with PMB_NO_SKIN=1 and compare; the positions then line up vertex for vertex.
  • Warnings: unhandled modifier (<class id>) '<name>' [<plugin>] means the exporter evaluated the mesh without that modifier, so the shape differs from the scene wherever it acted. Class ids are shared between plugins: the plugin and the superclass tell them apart (Bend and an unrelated class can both be (0x10, 0)); the class directory of pipeline_max_dump lists them all (ClassId above Name).
  • Another file exporting the same shape: a shape is named after its node, and the project writes every shape of every .max file of its folders into one shape_not_optimized. When two files hold a node of the same name, the one exported first writes the shape; the shape was then often not rewritten from the other file. Node names are stored as UTF-16 and can be searched for: find <folder> -iname "*.max" -print0 | xargs -0 grep -laiP 'Z\x00O\x00_\x00H\x00O\x00M\x00_\x00' finds the files with a node starting with ZO_HOM_.
  • Selections: a deforming modifier (Bend, Twist, Taper) acts on the sub-object selection below it: the selection the Editable Mesh was saved with, or the one an Edit Mesh in between hands up. The Editable Mesh stores its selections at every level; its selection level is the geom-buffer chunk 0x092a (1 object, 2 vertex, 4 face, 8 edge). An Edit Mesh hands up its own level and the selection stored with it, or passes the selection below through when it was never edited on that object. Soft selection is not evaluated: the exporter warns and moves the selected vertices only. When the selection is not known (an Editable Poly base, an unhandled modifier below, an edge selection made in an Edit Mesh), the exporter warns and deforms the whole mesh.

Example: the Zorai leader haircut

Mabreka-Cho's haircut (stuff/zorai/agents/actors/visages/zo_hom_cheveux_lead.max) did not show in game: its 2020 export was a rigid CMeshMRM, although the source has its Physique skin, as the other leader haircuts do.

  1. The custom exporter exported it skinned (CMeshMRMSkinned on Bip01, Bip01 Head, Bip01 Neck), but warned about two unhandled modifiers.
  2. pipeline_max_dump named them: the modifier stack, bottom up, is Editable Mesh (saved at vertex selection level, with the little tree on the forehead selected), Bend (−19.5°, direction −11.5°, X), Bend (−23.5°, direction 130.5°, Y), Twist (−25°, bias 11.5, Y), Edit Mesh, Physique. Without Bend and Twist the tree came out straight.
  3. Bend and Twist went into the exporter, acting on the selection. The rigid export (PMB_NO_SKIN=1) then matched the 2020 export of the same file: 890 vertices, positions within 4.5e-8, same indices and UVs, normals within 0.5° (the mesh has six smoothing groups; a smoothing group handled wrong shows as tens of degrees).
  4. The skinned export went through the chain above by hand: shadow skin 67219 → 72094 bytes, CLodTex with HOM_LOD → 76203, then shape_optimized and the install.
  5. Why the 2020 export was rigid: the leader's outfit, stuff/zorai/agents/actors/male/zo_hom_civil01_lead.max, holds a copy of the haircut node, with the same Bends and Twist but no skin. The project exports male before visages, and the shape in shape_not_optimized carries the time of the outfit's export (2020-03-30 15:31), not that of the haircut's own file three minutes later; the outfit file alone exports exactly that rigid shape. A pipeline rerun over both files can write the rigid copy again, until the copy is removed from the outfit file.

Two tool faults turned up on the way, both fixed: the shape writer and pipeline_max_dump wrote their temporary files to /tmp, which does not exist on Windows (every shape export failed with cannot open temp file); and the exporter did not evaluate Bend and Twist.

Clone this wiki locally