Nodes/BrainDead Nodes/BD MESH → Trimesh
ComfyUI Node

BD MESH → Trimesh

The adapter that pulls ComfyUI's native meshes into the BD pipeline

By BizaNator·Created 8 months ago·Updated 3 days ago· 15
BD MESH → Trimesh
  • MESH
  • mesh
  • status
batch_index0

BD MESH → Trimesh converts ComfyUI's native MESH type into the BrainDead pack's TRIMESH type. It's an adapter, nothing more - and adapters are exactly what you need when two data models can't talk to each other.

This pack makes the distinction loudly, and it's worth repeating because it trips people up: BD nodes pass meshes as TRIMESH - a full trimesh.Trimesh carrying vertex colors, UVs, materials, and processing metadata - the same type TRELLIS2 and Hunyuan3D-2-1 use. ComfyUI's built-in 3D nodes use the native MESH type: a thin batched (vertices, faces) tensor container with no colors, no UVs, no materials. They are different data models, not interchangeable. When you want to pull a mesh out of a built-in 3D node and push it into the BD pipeline, this node is the bridge.

When you actually need it

The concrete case: a built-in 3D node like Hunyuan3D's VAE-decode or a Voxel To Mesh node emits a native MESH. You want to run that mesh through the BD tooling - BD CuMesh Simplify, BD Blender Decimate, UV unwrap, color sampling, or export with BD Export Mesh With Colors. Native MESH can't feed those nodes directly, because it doesn't carry the attributes BD expects. This converter is the handoff.

The inputs are minimal: MESH (required) and batch_index (default 0). That second one matters because native MESH is batched - when the input holds more than one mesh, batch_index picks which one to convert. Outputs are the mesh (TRIMESH) and a status string.

The flip side

The pack also ships the reverse - BD Trimesh → MESH - because you sometimes want to go the other way, feeding a BD mesh into ComfyUI's built-in Save 3D Model / SaveGLB. The README's advice is the rule of thumb: keep work inside TRIMESH (and BD Export Mesh With Colors) whenever colors and UVs must survive, since native MESH literally cannot represent them. Convert to native MESH only when you specifically need a built-in 3D node on the other side.

So the mental model: this node is for importing into the BD world. If you're generating geometry in the built-in ecosystem and want BD-grade processing and exports, this is your first hop. Expect to lose nothing in the conversion - the direction you're going (native → trimesh) is the direction where no attributes are dropped, because native MESH has none to carry.

Installing

Standard BrainDead install - ComfyUI Manager search "BrainDead" or clone + pip install -r requirements.txt, restart. Needs trimesh and a current ComfyUI (V3 API).

One tip: if you convert a batched mesh and get the wrong part, you've hit the classic off-by-one - native MESH batches are 0-indexed, so mesh 1 of 2 is batch_index 0. Check status or the count before assuming the index.

Category🧠BrainDead/Mesh

Inputs (2)

NameTypeDefaultDescription
MESHMESH
batch_indexoptINT00–4096Which mesh to extract when the native MESH is batched.

Outputs (2)

NameTypeDescription
meshTRIMESH
statusSTRING