blender-optimizer¶
Before (left) and after (right) from the same camera at 1.5 m: a gym treadmill from the kit's first optimizer run (Penthouse). The whole run took 9 machines from 212 k to 80 k triangles and from 36 to 9 material slots.
The blender-optimizer makes existing rigid, hard-surface models cheaper: fewer triangles and fewer materials, with nothing a player would notice. It keeps the pivot, scale, orientation and the baked lightmap UVs, so the world needs no re-bake.
When it runs¶
When a rigid model costs too much. Two usual triggers: the asset-reviewer sends an over-budget model here, or D.2 performance work finds a heavy one. It replaces LOD0, the mesh every player sees up close.
What you give it¶
The orchestrator passes:
- the project and scene,
- the target objects (hierarchy paths) and their source asset paths,
- the closest distance players see them from,
- whether the objects are lightmapped, and by which bake system,
- which agent owns the Unity editor right now.
What it does, in order¶
- Inventory in Unity, read-only.
- Export the mesh Unity actually renders, with both UV sets.
- Clean, lossless first: merge by distance (about 0.1 mm), delete faces nobody can see, Limited Dissolve at 1 to 3°.
- Decimate, gated. Signed volume stays at 0.9 or more of the source for a mesh that replaces LOD0.
- Merge materials. Goal: one material per object.
- Prove it looks the same. Same camera, before and after, from the closest player distance and from 2× and 4× that distance, 4 yaw angles.
- Export as a drop-in replacement. A new file next to the source.
- Model gate. It writes the sidecar and reports the file for the asset-reviewer.
- Swap in Unity, only when the editor is its own and only after
asset_gate.py checkends PASS. - Scene gate. Z-fight scan and
JointCheckon the touched roots, then the stage reviewer.
What it returns¶
Per object:
- triangles and materials, before and after,
- the volume ratio and texture sizes,
- diff numbers and image paths, and anything that changed visibly,
- export and sidecar paths, and the model-gate state,
- a rollback path, and whether the lightmap was preserved.
What it never does¶
- Never touches avatars or anything skinned. Those go to blender-modeler.
- Never models new assets.
- Never builds LOD levels or billboards. Those are built in Unity by perf-optimizer.
- Never overwrites the source file.
- Never touches the second UV set when merging materials.
- Never "solves" a broken lightmap with a new bake, unless the owner gave fresh bake permission.
- Never opens the interactive Blender window.
Who judges its work: asset-reviewer on the new file, then final-reviewer for the visual regression in D.2. Its own renders are evidence, not acceptance.
Source: agents/blender-optimizer.md.
