Nodes/BrainDead Nodes/BD Transfer Colors (Pymeshlab)
ComfyUI Node

BD Transfer Colors (Pymeshlab)

The reliable way to get TRELLIS2 colors onto the mesh

By BizaNator·Created 8 months ago·Updated 3 days ago· 15
BD Transfer Colors (Pymeshlab)
  • mesh
  • pointcloud
  • mesh
  • status
max_distance0.000

TRELLIS.2 gives you two things out of its textured pipeline: a trimesh and a pbr_pointcloud - and the color you want lives on the pointcloud, not the mesh. Getting it onto the mesh is a color-transfer problem, and the BrainDead pack offers two solutions. This is the one the author calls the reliable approach: it hands the job to PyMeshLab, whose point-cloud-to-mesh transfer algorithms have been battle-tested in a real DCC tool for a decade and a half.

What it is

TRIMESH + pointcloud in, colored TRIMESH out. You connect trimesh from a TRELLIS.2 Shape to Textured Mesh node to mesh, its pbr_pointcloud to pointcloud, and the node transfers the pointcloud's vertex colors onto the mesh using MeshLab's proven machinery. The result is a mesh with vertex colors ready for export or decimation.

How it works

Instead of rolling its own KD-tree nearest-neighbor and hoping, this node shells out to pymeshlab - the Python binding for MeshLab - and runs its established point-cloud-to-mesh color transfer. The one knob is max_distance (default 0 = automatic): the search radius for finding nearby points, in mesh units. Leave it at 0 and let MeshLab decide; only set it if you're getting transfer holes (mesh areas left uncolored because the nearest point is too far away) or bleed (points from the wrong region getting sampled).

Outputs: the colored mesh (TRIMESH) and a status string.

Why "reliable" matters

The pack has three color-transfer nodes, and it's worth understanding why there are three:

  • BD Transfer Pointcloud Colors - the original KD-tree nearest-neighbor implementation, now deprecated. It had to work around the TRELLIS2 Y-up mesh / Z-up pointcloud axis mismatch itself.
  • BD Transfer Colors (Pymeshlab) - this node. The author's label for it: "This is the RELIABLE approach - uses MeshLab's proven algorithms for point cloud to mesh color transfer."
  • BD Transfer Vertex Colors - a different job entirely: transferring colors from a high-poly mesh to a decimated mesh (mesh-to-mesh, not pointcloud-to-mesh).

So when you're going from a TRELLIS.2 pointcloud onto a mesh, this is the one to reach for.

Where it fits

It's the vertex-color path into the low-poly chain: get colors onto the mesh here, decimate with BD Smart Decimate if you need lower density, then feed the result to BD Export Mesh With Colors for a GLB/PLY/OBJ that actually carries its color. If you want textured PBR output instead of vertex colors, BD OVoxel Bake is the all-in-one bake - different delivery, same source data.

Gotchas

The dependency is the whole gotcha: PyMeshLab is not in the pack's requirements.txt. pip install pymeshlab yourself or the node fails at import. It's a sizable wheel but it's the standard tool for mesh processing in Python, so it's a one-time cost. Also note this node's pointcloud input is typed as TRIMESH (the pack carries pointclouds in the TRIMESH type), and it needs the ComfyUI-TRELLIS2 sibling pack installed to have produced the input in the first place.

Installing it

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
pip install pymeshlab   # required by this node

Restart, find it under 🧠BrainDead/Mesh. Wire it as described, start with max_distance=0, and check the mesh in a viewer - if patches come through uncolored, raise the distance in small steps until the coverage fills in without bleeding.

Category🧠BrainDead/Mesh

Inputs (3)

NameTypeDefaultDescription
meshTRIMESH
pointcloudTRIMESHpbr_pointcloud from TRELLIS2
max_distanceoptFLOAT0.0000–1Max distance for color transfer. 0 = automatic

Outputs (2)

NameTypeDescription
meshTRIMESH
statusSTRING