Nodes/Avatar Graph/Mesh Beautify Fill
ComfyUI Node

Mesh Beautify Fill

Fixes ugly triangulation after a face fill

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Mesh Beautify Fill
  • BPY_OBJ
  • BPY_OBJ
angle_limit3.14

This is another of Avatar Graph's auto-generated nodes - the pack walks a list of Blender's real mesh operator names and produces a ComfyUI node for each one, and Mesh Beautify Fill is bpy.ops.mesh.beautify_fill unchanged. Worth knowing because it means Blender's own documentation is the real reference here, not this pack's README, which doesn't go operator-by-operator.

Why you'd reach for it

When you fill an n-gon or an irregular boundary with triangles - which is exactly what happens when Avatar Graph turns a traced outline (from something like Extract Boundary Points) into an actual mesh face - the naive triangulation can come out uneven: long, thin, sliver-shaped triangles instead of clean, roughly-even ones. That's a real problem for shading and for anything that later deforms the mesh (like a shape key blending toward a blink or a mouth shape), because thin slivers distort more visibly than even triangles. Beautify Fill re-triangulates the selected fill area to produce a nicer result without changing the outer boundary.

How it works

It only operates on the current selection, and only on face-fill regions - it's a cleanup pass, not a general remeshing tool. angle_limit sets the maximum angle Beautify Fill will consider "beautifying" across; at its default (180°, i.e. no limit) it'll re-triangulate freely, lower values restrict it from touching sharper features.

The inputs and output that matter

  • BPY_OBJ (optional) - the mesh object to operate on.
  • angle_limit (default ~180°/π radians) - usually fine left at default for a straightforward flat fill; lower it if Beautify Fill is smoothing over an edge you actually want to stay sharp.

Output is the same BPY_OBJ, passed through for further chaining.

How to install it

Via ComfyUI Manager: search "Avatar Graph" (avatar-graph-comfyui), install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/avatechai/avatar-graph-comfyui
cd avatar-graph-comfyui
pip install -r requirements.txt

The pack's hard blocker: bpy==3.6.0 is pinned in requirements.txt and only builds on Python 3.10.x. Windows users get a bundled Python 3.10 ComfyUI zip from the README; Mac/Linux users should build a dedicated conda environment (conda create --name comfyui python=3.10) instead of fighting an existing 3.11/3.12 setup. Budget extra install time and disk - segment-anything, mediapipe, and OpenCV all come along with it.

Common issues & troubleshooting

"Operator poll() failed, context is incorrect." Standard Blender complaint when the object handed in isn't a valid mesh, or there's no selection for the operator to act on - check what's feeding BPY_OBJ.

No visible change. This node only affects selected face-fill geometry - if nothing's selected (these nodes flip into Blender's Edit Mode automatically to run, then flip back, so selection state has to already be right when it gets there), or the mesh has no triangulated fill to improve, there's nothing for it to do.

Result still looks uneven. Beautify Fill improves triangulation quality within the existing boundary - it can't fix a fundamentally bad outline. If the underlying traced boundary (from an earlier boundary-extraction step) is itself jagged or oddly shaped, cleaning that up first will do more than tuning this node's one parameter.

Categoryblender

Inputs (2)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
angle_limitoptFLOAT3.140–3.141592741012573

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ