Nodes/BrainDead Nodes/BD Export Mesh With Colors
ComfyUI Node

BD Export Mesh With Colors

Get your mesh out the door with its texture intact

By BizaNator·Created 8 months ago·Updated 3 days ago· 15
BD Export Mesh With Colors
  • mesh
  • diffuse
  • normal
  • file_path
  • status
filenamemesh_colored
formatglb
name_prefix
auto_incrementtrue
context_id
suffix
context_custom_vars

Every 3D pipeline ends the same way: get the thing off disk, with the colors on it. BD Export Mesh With Colors is the BrainDead exit door - it writes a TRIMESH to GLB, PLY, or OBJ and, critically, can embed your baked PBR textures into the GLB so the file isn't a white placeholder. The pack keeps telling you to keep everything inside TRIMESH until this moment, and this is why.

It's the node at the end of the chain: load a mesh (or CubePart part) → sample vertex colors / bake PBR → export. Pair it with a BD Save Context for template-based filenames if you're doing batch output.

Inputs that matter

  • mesh (TRIMESH) - required.
  • format - glb, ply, or obj (default glb). GLB is the one that can carry embedded textures.
  • diffuse and normal (optional IMAGEs) - your baked atlas maps, e.g. from BD_OVoxelBake. Embedding diffuse as the GLB's baseColorTexture (and normal as its normalTexture) is what turns the export from a gray shell into an actually-textured asset. GLB only, and the mesh needs UVs - which any bake already gave it.
  • filename, name_prefix (supports Project/Name subdirs), auto_increment (on by default so you don't clobber previous exports).
  • context_id / suffix / context_custom_vars - if you've registered a BD Save Context, leave context_id empty and it auto-picks (when exactly one is registered); the template then drives the path and %suffix%. The suffix input is wirable - connect BD CubePart Get Part's name output so each part exports as _body, _head, etc. automatically.

Outputs: file_path (STRING, wire it into a text preview or downstream) and status.

Installing

ComfyUI Manager → search "BrainDead" → install. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/BizaNator/ComfyUI-BrainDead
cd ComfyUI-BrainDead
pip install -r requirements.txt

Restart ComfyUI after cloning. It needs trimesh (a normal ComfyUI dependency) and PIL; no extra model downloads.

Where people get burned

The most common complaint is "my GLB is white" - that's the mesh having vertex colors but no material, and it's exactly why diffuse exists. If you skip wiring diffuse, you get vertex colors at best (which GLB carries fine) and nothing at all if the mesh is material-only. Second: don't reach for OBJ when you need the texture embedded - OBJ/PLY are for vertex-colored or pure-geometry output; GLB is the only one of the three that takes diffuse/normal. And remember the pack's TRIMESH-vs-MESH rule: if the colors are on a native ComfyUI MESH, convert to TRIMESH first - native MESH can't hold colors or UVs at all.

Category🧠BrainDead/Mesh

Inputs (10)

NameTypeDefaultDescription
meshTRIMESH
filenameSTRINGmesh_colored
formatCOMBOglb3 options: glb, ply, obj
name_prefixoptSTRINGPrepended to filename. Supports subdirs (e.g., 'Project/Name')
auto_incrementoptBOOLEANtrueAuto-increment filename to avoid overwriting
context_idoptSTRINGBD_SaveContext id for template-based naming + foldering. Empty + exactly one registered context = auto-pick. When it resolves, the template (with %suffix%) drives the path; filename/name_prefix pass through as %filename%/%name_prefix%.
suffixoptSTRINGPer-save suffix → %suffix% in the template (e.g. '_body', '_combined'). Wirable — e.g. connect BD CubePart Get Part's `name` output. Only used when context_id resolves.
context_custom_varsoptSTRINGExtra key=value template vars (one per line), layered on top of the context (e.g. subfolder=parts). Only used when context_id resolves.
diffuseoptIMAGEBaked diffuse/base-color atlas (e.g. from BD_OVoxelBake) to embed as the glb baseColorTexture, so the exported file is textured (not a white placeholder). GLB only; needs the mesh to carry UVs.
normaloptIMAGEBaked tangent-space normal atlas to embed as the glb normalTexture. GLB only.

Outputs (2)

NameTypeDescription
file_pathSTRING
statusSTRING