Nodes/Avatar Graph/Mesh Vert Connect Nonplanar
ComfyUI Node

Mesh Vert Connect Nonplanar

Flattening faces that warped out of plane

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Mesh Vert Connect Nonplanar
  • BPY_OBJ
  • BPY_OBJ
angle_limit0.09

Every face in a mesh is supposed to be flat - all its vertices sitting on one plane. Push a face around with a shape key, a smooth pass, or a symmetrize operation, and it's easy for a four-or-more-sided face to bend out of flat without you noticing, which is exactly the kind of thing that causes weird shading and rendering artifacts later. Mesh_VertConnectNonplanar is the automated fix.

What it is and why you'd reach for it

This wraps Blender's bpy.ops.mesh.vert_connect_nonplanar() directly - one of several specialized siblings of the plain Mesh_VertConnect node in this pack. Avatar Graph runs actual Blender via the bpy package inside ComfyUI, so this is another thin passthrough to a built-in operator: it looks at selected n-gons that have bent out of plane and splits them with new edges into smaller pieces that are each properly flat.

In an Avatar Graph pipeline, this is the kind of cleanup you'd reach for after deforming operations - running Mesh_VerticesSmooth, or after adding shape keys that push vertices around - where a face that started perfectly flat has warped. Rather than hunting for it by eye, this node finds and fixes every selected non-planar face automatically.

Inputs and outputs that matter

  • BPY_OBJ (optional) - the mesh coming in, with the potentially non-planar face(s) selected.
  • angle_limit (float, default ~0.087 radians / roughly 5°, 0–π) - the tolerance for how far out of flat a face can be before it's considered non-planar and gets split. Set it tighter (closer to 0) to catch even mild warping; loosen it if you're getting more splits than you actually need on faces that are close enough to flat to not matter visually.

Output: a single BPY_OBJ, with any selected non-planar faces divided into flat pieces.

As always in this family, it only processes the currently selected geometry - select the faces you suspect (or the whole mesh, to be safe) before running it.

Installing Avatar Graph

The whole pack runs on bpy, which only ships wheels for Python 3.10.x - pin that first, before touching anything else.

ComfyUI Manager: search avatar-graph-comfyui, install, restart. Or manually:

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

Restart with python main.py --enable-cors-header (--force-fp16 too on Mac). Windows has a prebuilt Python 3.10 environment linked from the README; macOS/Linux is pointed at conda create --name comfyui python=3.10.

Common issues

Nothing gets split, even on a face you're sure warped. Two likely causes: the face isn't selected, or angle_limit is set too loose to consider it non-planar. Tighten the angle and confirm selection before assuming the mesh is fine.

Too many faces get split. The opposite problem - a loose angle_limit combined with a wide selection catches faces that are only slightly (and harmlessly) out of flat. Tighten the angle back down if the extra geometry isn't buying you anything.

Nodes not appearing in ComfyUI. Check python --version is exactly 3.10.x; bpy fails to import outside that and the whole pack won't register.

No live avatar preview. Needs --enable-cors-header at launch to reach the embedded editor.avatech.ai panel. Without it, the graph still runs end to end - export via right-click → Save File on Avatar Main Output instead.

Categoryblender

Inputs (2)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
angle_limitoptFLOAT0.090–3.141592741012573

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ