Skip to content

blender-optimizer

Two near-identical renders of a dark treadmill from the same camera

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:

  1. the project and scene,
  2. the target objects (hierarchy paths) and their source asset paths,
  3. the closest distance players see them from,
  4. whether the objects are lightmapped, and by which bake system,
  5. which agent owns the Unity editor right now.

What it does, in order

  1. Inventory in Unity, read-only.
  2. Export the mesh Unity actually renders, with both UV sets.
  3. Clean, lossless first: merge by distance (about 0.1 mm), delete faces nobody can see, Limited Dissolve at 1 to 3°.
  4. Decimate, gated. Signed volume stays at 0.9 or more of the source for a mesh that replaces LOD0.
  5. Merge materials. Goal: one material per object.
  6. 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.
  7. Export as a drop-in replacement. A new file next to the source.
  8. Model gate. It writes the sidecar and reports the file for the asset-reviewer.
  9. Swap in Unity, only when the editor is its own and only after asset_gate.py check ends PASS.
  10. Scene gate. Z-fight scan and JointCheck on 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.