Export Textured Mesh
Export Hunyuan3D meshes with textures that survive Blender
- trimesh
- albedo_texture
- mr_texture
- normal_texture
- mesh_path
- albedo_path
- mr_path
- normal_path
3D in ComfyUI is still mostly a Hunyuan3D story, and the pain point everyone hits is the last step: you generated a mesh and a texture, and exporting something that actually opens correctly in Blender - with materials, not as a gray lump - is fiddly. Export Textured Mesh is that last step, written to reuse Hunyuan3D's own export logic so normals and PBR materials come out right.
It takes a TRIMESH (the mesh object type from the Hunyuan3D wrapper packs) plus up to three textures and writes either a GLB with embedded PBR materials or an OBJ + MTL + texture files.
How it works
For GLB it goes: export the mesh to OBJ (which preserves the original normals), write the textures out to a temp folder, then use pygltflib to build a proper glTF with PBR materials - albedo as base color, metallic/roughness packed into the right channels (metallic in B, roughness in G), all embedded as base64 data URIs so the .glb is self-contained. For OBJ it writes the mesh, the texture PNGs, and a hand-written MTL file, then patches the OBJ to reference it.
The trap to know about first
The source file has a warning that the author clearly learned the hard way, and it's the single most important thing about this node: leave normal_texture empty. The Hunyuan3D MultiViews Generator's "normals" output is a multi-view normal map, not a usable normal texture for export. If you connect it, you'll get shading artifacts in Blender that are a nightmare to debug. Don't wire that output into this node just because the name matches.
Inputs and outputs
- trimesh - required,
TRIMESHtype. This can only come from a Hunyuan3D wrapper pipeline; this node creates nothing itself. If you don't have the wrapper installed, the input type won't even exist. - albedo_texture / mr_texture - optional IMAGE tensors.
mris assumed to be metallic-in-blue, roughness-in-green and gets split accordingly. - file_format -
glborobj. - filename_prefix - default
3D/textured_model, saved underComfyUI/output/3D/. - save_file - flip off to skip writing entirely (returns empty paths).
Outputs: mesh_path, albedo_path, mr_path, normal_path - the paths to whatever got written, which you can feed to a display node or use to locate the file.
Install and dependencies
Pack install is the usual:
cd ComfyUI/custom_nodes
git clone https://github.com/ZXL-Xinram/ComfyUI-AutoFlow
restart. But this node pulls in two libraries the pack doesn't declare anywhere: trimesh and pygltflib, imported lazily when the node runs. If the ComfyUI-Hunyuan3DWrapper pack is installed, it already brought trimesh; pygltflib you may need to add yourself:
pip install pygltflib
And again - the TRIMESH type itself comes from the Hunyuan3D wrapper, not from this pack. Install that first or this node is useless.
Where people get burned
- Shading artifacts in Blender → almost always the
normal_texturemistake above. Disconnect it. - Missing
pygltflib/trimeshimport error on first run → the lazy imports mean you only find out at execution time. Install them. - Textures not showing in GLB viewers → make sure you're feeding IMAGE tensors with the channels the node expects; an RGB albedo is fine, but a 4-channel one from an alpha pipeline may confuse the material writer.
It's a niche node for a niche pipeline in a brand-new pack, but it's the only one here with a real opinionated take on a hard problem - and the warning comment about normal maps is worth its weight in Blender debugging time.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| trimesh | TRIMESH | — | |
| filename_prefix | STRING | 3D/textured_model | — |
| file_format | COMBO | 2 options: glb, obj | |
| albedo_textureopt | IMAGE | — | |
| mr_textureopt | IMAGE | — | |
| normal_textureopt | IMAGE | — | |
| save_fileopt | BOOLEAN | true | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| mesh_path | STRING | — |
| albedo_path | STRING | — |
| mr_path | STRING | — |
| normal_path | STRING | — |