bake_maps
Bake a mesh's material into PNG texture maps (base color, normal, roughness, metallic, ao, orm) on its UV layout, enabling glTF export of procedural or layered materials.
Instructions
Bake the material of one mesh into PNG maps on its UV, so glTF can carry a procedural or layered material.
Uses Cycles on the CPU. maps: base_color (sRGB), normal (tangent space), roughness, metallic, ao, orm (one
image: R occlusion, G roughness, B metallic). Empty means base_color, normal, roughness, ao. For a metal ask
for base_color, normal, orm.
Files are _.png in out_dir (the work folder, bakes/, when empty). size is pixels, a power of
two: 512-1024 for props, 2048 for a hero asset. margin is the pixel padding around UV islands. samples: 16
is enough for colour and normal, raise it for a clean ao.
bevel_radius (metres, about 0.2-0.5% of the object size) rounds hard edges in the normal map only; it needs a
material without an image normal map.
The mesh needs a UV map without overlaps (check_mesh reports the UV); without one it is unwrapped with smart
project. uv_layer picks another layer. A material without bump gives a flat normal map and the answer says so.
replace_material=true builds the Principled material <object>_baked from the images and puts it on the mesh,
so export_glb writes the textures. ao alone stays a file; inside orm it becomes occlusionTexture.
One call bakes one object. Background job, one map per step (a 2048 px map takes 20-60 s): after wait seconds
the answer is a job id for job_status (cancel=true stops it). Do not edit the object while it runs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| maps | No | ||
| size | No | ||
| wait | No | ||
| margin | No | ||
| object | Yes | ||
| out_dir | No | ||
| samples | No | ||
| uv_layer | No | ||
| bevel_radius | No | ||
| replace_material | No |