Export Substance Painter Textures for Unreal, Unity and Godot
Most export problems come from small mismatches: the wrong channel packing, the wrong normal convention, a 16-bit map where 8-bit was expected, or one texture set left at the wrong resolution. MCP Pro for Painter has an export tool for each major engine that chooses the matching Painter preset and sensible defaults, so an AI agent can export correctly with one call. This guide explains what each tool does, how to check what it picked, and how to batch, customize and validate exports.
The engine export tools at a glance
| Tool | Painter preset it tries first | Default format | Fallback |
|---|---|---|---|
export_for_unreal | Unreal Engine (Packed), or Unreal Engine with packed=false | TGA, 8-bit | Older "Unreal Engine 4/5" names |
export_for_unity_urp | Unity Universal Render Pipeline (Metallic Standard) | PNG, 8-bit | PBR Metallic Roughness |
export_for_unity_hdrp | Unity HD Render Pipeline (Metallic Standard) | PNG, 16-bit | PBR Metallic Roughness |
export_for_godot | glTF PBR Metal Roughness (Godot 4), then Unreal Engine (Packed) | PNG, 8-bit | PBR Metallic Roughness |
export_for_pbr_metalrough | PBR Metallic Roughness | PNG, 8-bit | - |
export_for_pbr_specgloss | PBR Specular Glossiness | PNG, 8-bit | - |
All engine tools take an absolute output_path, an optional texture_sets list (all sets when omitted), format and bit_depth. They use infinite padding and 16 px dilation, and return the standard export response with extra fields: engine, preset and preset_method.
Why "tries first"? Painter's built-in preset names have changed between releases. For example, Painter 12 ships "Unreal Engine (Packed)" with no version number, while older builds used "Unreal Engine 4 (Packed)". Each tool tries a list of known names and reports the one it resolved in preset. Always read that field after your first export on a new Painter version.
The engine export tools are in every mode except minimal. In minimal, use export_textures with a preset name.
Unreal Engine
export_for_unreal defaults to packed=true. That gives BaseColor, Normal and an ORM map with ambient occlusion in R, roughness in G and metallic in B, the layout Unreal material setups expect. Set packed=false for separate grayscale maps.
- Format: TGA 8-bit by default. PNG works too. Pass
format: "png"if your pipeline prefers it. - Normals: Unreal uses DirectX-style (Y-) normal maps. Painter's Unreal presets are built for that. If you export with a generic preset instead, check the normal convention.
- Import: in Unreal, turn off sRGB on the ORM texture and use a linear mask compression setting. BaseColor stays sRGB.
Export all texture sets for Unreal to D:/UE5/MyGame/Content/Textures/Crate/ using the packed ORM preset, TGA 8-bit. Show me the preset name Painter resolved and the list of files written.
With painter-cli, the same export from a terminal is:
painter-cli export for-unreal D:/UE5/MyGame/Content/Textures/Crate/
painter-cli export for-unreal D:/UE5/MyGame/Content/Textures/Crate/ --unpacked --format png
Unity: URP and HDRP
URP
export_for_unity_urp targets the Universal Render Pipeline's Lit shader. It tries several spellings of Painter's URP preset, then falls back to "PBR Metallic Roughness". The Unity metallic workflow keeps smoothness in the alpha of the metallic map, so make sure the resolved preset is the URP one if you rely on that.
HDRP
export_for_unity_hdrp defaults to 16-bit PNG, because HDRP's Mask Map packs metallic, ambient occlusion, detail mask and smoothness into one texture and benefits from the extra precision. If texture memory matters more than precision, pass bit_depth: "8".
- Normals: Unity uses OpenGL-style (Y+) normal maps. Mark the normal texture as Normal map in the import settings.
- Color space: keep Base Map sRGB. Turn sRGB off for mask and metallic maps.
Export the char_ texture sets for Unity HDRP into C:/UnityProjects/Game/Assets/Textures/Characters/, 16-bit PNG. Then export the prop_ sets for URP into the Props folder, 8-bit.
Godot 4
Painter has no native Godot preset, so export_for_godot with version: 4 uses "glTF PBR Metal Roughness" first. It writes an ORM-style packed map that StandardMaterial3D reads directly. "Unreal Engine (Packed)" is the backup because its ORM layout matches. Pass version: 3 for Godot 3 preset names.
- ORM: use an
ORMMaterial3Dand assign the packed texture to its ORM slot, or keepStandardMaterial3Dand assign the channels to the separate AO, roughness and metallic slots with the matching texture channel selected. - Normals: Godot uses OpenGL-style (Y+) normal maps, which matches Painter's default normal format.
- Import: Godot detects normal maps when they are assigned to a material and re-imports them with the right compression. If it does not, set Normal Map to Enable in the import dock.
Export every texture set for Godot 4 into D:/godot/my_game/assets/textures/ as 8-bit PNG and tell me which preset was used.
painter-cli export for-godot D:/godot/my_game/assets/textures/ --version 4
Format, bit depth, padding and dilation
You can override format and bit_depth on any export call. For project-wide settings, use the setters before exporting:
set_export_format: the output file format.set_export_padding: acceptsinfinite,color,transparent,passthroughandnone. Infinite padding is the safe default for real-time engines because it prevents seams when mipmaps sample past UV island edges.set_export_dilation: the dilation distance in pixels. The engine tools use 16.set_export_path: sets the default output folder.
Rules of thumb: use 8-bit for color and packed masks, and 16-bit for height and for HDRP mask maps where banding shows. TGA and PNG are both lossless. Your engine's import compression is what decides the final quality.
Custom export presets
If your studio uses its own packing, such as roughness in alpha or an emissive mask in a spare channel, describe it with create_custom_export_preset. Each output map lists which source channel goes into which destination channel:
{
"name": "Studio_ORM",
"maps": [
{"name": "BaseColor",
"channels": [{"src": "BaseColor.R", "dst": "R"},
{"src": "BaseColor.G", "dst": "G"},
{"src": "BaseColor.B", "dst": "B"}]},
{"name": "ORM",
"channels": [{"src": "AmbientOcclusion.gray", "dst": "R"},
{"src": "Roughness.gray", "dst": "G"},
{"src": "Metallic.gray", "dst": "B"}]}
]
}
Then export with export_with_preset using that name. The preset-saving API has changed across Painter releases, so the tool tries the known signatures and reports which method worked. Check created in the response. To see every preset Painter currently knows, including your own, call list_export_presets.
Batch and async exports
For one call that covers every set, use batch_export_all_sets. It takes output_path, preset, format, bit_depth, padding and dilation, and returns the written files grouped per set. It is in default and full modes.
Large projects can take minutes to export, longer than you want a single request to block. Use the async pair instead:
export_textures_async(output_path, preset, ...) -> {job_id, ...}
get_export_status(job_id) -> {status: "running" | "success" | "error", ...}
You can also block on Painter's own end-of-export event with wait_for_export_complete, which waits for ExportTexturesEnded up to timeout_seconds, 600 by default. From the shell, use painter-cli export run-async and painter-cli export status <job_id>.
Validate before you export
Exporting is cheap. Re-importing a wrong set of textures into an engine is not. Have the agent check the project first:
validate_resolution_budget: checks every set against{pattern, max_width, max_height}rules, matched case-insensitively with fnmatch patterns such asweapon_*. It suggests a size for each violation.check_texture_set_consistency: confirms every set has the same channels, so packed maps don't come out with an empty AO or metallic channel in one set.find_empty_channels: finds channels nothing writes to.set_texture_set_resolutionandbatch_set_resolution: fix sizes. Width and height must each be a power of two from 256 to 8192.
I'm shipping a level. For every texture set, check the resolution against our budget (prop_* 1024, weapon_* 2048, char_* 4096), fix any that are wrong, then export everything to D:/UE5/Project/Content/Textures/ with the packed Unreal preset, PNG, 8-bit. Summarize what you changed and what you exported.
This is close to the batch_export_for_unreal example prompt shipped with the package. Expect list_texture_sets, validate_resolution_budget, set_texture_set_resolution for mismatches, then export_for_unreal or batch_export_all_sets.
Troubleshooting exports
ValidationError about output_path
output_path must be absolute. Ask the agent for a full path such as D:/Game/Textures/, not ./textures.
The resolved preset is the generic fallback
Your Painter build names its engine preset differently. Run list_export_presets, find the exact name, and export with export_with_preset or export_textures using that preset.
TimeoutError on big projects
Switch to export_textures_async, or raise the server's global timeout with --timeout 120. If Painter has a modal dialog open, the export waits on it, so bring Painter to the front.
Files written somewhere unexpected
Export tools write wherever they are told, with no confirmation inside Painter. Tell the agent your output root up front, or put it in your project rules or CLAUDE.md, and keep tool approval on for export calls.