ComfyUI Node

Mesh Fill

Closing an open boundary loop with triangles

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Mesh Fill
  • BPY_OBJ
  • BPY_OBJ
use_beautytrue

Select an open boundary loop - an edge or vertex ring with no faces across it - and this node closes the gap with triangles. It's the general-purpose "cap this hole" operator, the one you reach for when you've selected exactly the loop you want filled rather than letting the mesh get scanned automatically.

How it works

This wraps Blender's mesh.fill operator. It takes the currently selected boundary loop and triangulates across it, connecting the open edges into a solid patch. That's a meaningfully different tool from its two siblings in this pack: Mesh Fill Holes scans the whole mesh automatically for small gaps and patches anything under a size limit, while Mesh Fill Grid fills a loop with clean quads instead of triangles (and needs an even-sided loop to do it). Plain Fill is the manual, general case - you pick the loop, it triangulates it, no size limit and no quad requirement.

The inputs and outputs that matter

  • BPY_OBJ (optional) - the mesh, with the boundary loop you want filled already selected.
  • use_beauty (default true) - controls the triangulation method. On, Blender uses its "beauty fill" heuristic, which tries to produce reasonably even, non-sliver triangles across the patch. Off, it does a faster but cruder fan-style fill from a single point, which can leave long, thin triangles on an irregular loop. Leave it on unless you have a specific reason to want the simpler fan pattern - or unless beauty fill is producing an odd result on an oddly shaped hole, in which case toggling it off is worth a try.

Output is a single BPY_OBJ, the mesh with the loop now filled.

How to install it

ComfyUI Manager: search "Avatar Graph" and install. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/avatechai/avatar-graph-comfyui

then pip install -r requirements.txt and restart. Needs Blender's bpy module, pinned to Python 3.10.x - a dedicated conda environment on macOS/Linux, or Avatech's prebuilt Python-3.10 ComfyUI zip on Windows with the pack installed through Manager afterward.

Common issues & troubleshooting

If nothing gets filled, the usual cause is nothing (or the wrong thing) selected going in - this node fills whatever loop is currently selected, it doesn't search the mesh for holes the way Mesh Fill Holes does. Confirm the selection upstream is actually a clean, closed boundary loop.

If the fill produces an ugly, twisted, or self-crossing patch, that's usually a non-planar or overly irregular loop - Fill triangulates in 2D across whatever boundary it's given, and a loop that dips and bows in 3D can produce a result that's technically valid but visually wrong. For those cases, Mesh Fill Grid (if the loop has an even edge count) or hand-adjusting the loop's shape first tends to give a cleaner result than fighting use_beauty.

A bpy import failure at ComfyUI startup is the pack's Python-version pin, not this operator - check for a clean Python 3.10.x environment with requirements.txt installed without errors.

Categoryblender

Inputs (2)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
use_beautyoptBOOLEANtrue

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ