retopologize_mesh
Retopologize a textured GLB into a game-ready mesh with new topology, fresh UVs, and baked PBR textures, plus optional LODs for engines.
Instructions
Make a game weight copy of a textured GLB: new topology, new UVs, and baked PBR textures.
method "quad" (default): an all quad mesh with even edge flow (Instant Meshes), suited to rigging, deformation and further modelling. "decimate": triangles, closest silhouette. The new mesh gets a fresh UV layout, and base color, roughness, metallic and a tangent space normal map baked from the original (target_faces 200 to 500000, texture_size 256 to 8192). Where the faces go (method "decimate" only): detail "auto" (default) keeps more faces where the surface bends sharply (fingers, joints, face features) and fewer on flat panels; "paint" reads the mesh's vertex colours as a detail map you painted in Blender (white = most detail, black = least; export as GLB); "none" is uniform. detail_strength 0 to 1 sets how strongly (default 1, the most that keeps the shape intact). The quad method always uses one density everywhere. Runs in headless Blender on the CPU, about 10 to 30 s at 10k faces; the GPU is not used. Output: <output_dir or the input's folder>/retopo_.glb, plus an .fbx with embedded textures that keeps real quads (glTF stores only triangles). Returns the path, face and vertex counts before and after, the method that ran and timings. lods (for example [10000, 3000, 800]): a LOD chain for a game engine instead of one mesh. lods[0] replaces target_faces and is LOD0, the retopology above with its baked textures; each further entry is a triangle budget for a decimation of LOD0 that keeps LOD0's UVs, so every LOD uses the same textures and one material. Entries must be strictly decreasing (1 to 8 of them). Output: retopolods.glb and .fbx holding objects _LOD0, _LOD1, ... (Unity's FBX importer builds a LOD Group from that suffix). The report's "lods" lists each LOD's face and triangle counts and texture_fit: uv_drift_texels_median (how far its UVs sit from LOD0's at the same place; a few texels is right, hundreds means broken mapping) and colour_mismatch_share (share of its triangles whose base colour differs from LOD0's there; it grows as small features collapse). With method "decimate", the detail map also steers the LOD decimations.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"input_mesh": "<input_mesh>"
},
"name": "retopologize_mesh"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lods | No | ||
| detail | No | ||
| method | No | quad | |
| input_mesh | Yes | ||
| output_dir | No | ||
| target_faces | No | ||
| texture_size | No | ||
| detail_strength | No |