Nodes/Avatar Graph/Mesh Loop To Region
ComfyUI Node

Mesh Loop To Region

Turning an outline into the faces it encloses

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Mesh Loop To Region
  • BPY_OBJ
  • BPY_OBJ
select_biggerfalse

You've traced or selected a boundary loop - say, an eye-shaped outline cut in by Mesh Knife Project or bounded by Mesh Mark Seam - and now you actually want the faces inside that outline selected, not the edges tracing its border. This node does exactly that conversion.

How it works

It wraps Blender's mesh.loop_to_region operator. It reads the currently selected edge loop as a closed boundary and selects the face region that loop encloses, dropping the edge selection in favor of a face selection covering the interior. It's the reverse direction of selecting a region's boundary - instead of "here are the faces, show me their outline," it's "here's an outline, show me what's inside it."

A closed loop on a mesh can, geometrically, enclose two different regions depending on how you look at it (think of a loop running around a sphere's equator - either hemisphere is a valid "enclosed" answer). That ambiguity is what select_bigger resolves.

The inputs and outputs that matter

  • BPY_OBJ (optional) - the mesh, with a closed boundary edge loop already selected.
  • select_bigger (default false) - when the loop could enclose either of two regions, this picks the larger one instead of the smaller (default). If the result selects the wrong side of an ambiguous loop, this is the first thing to flip.

Output is a single BPY_OBJ, now with the enclosed face region selected instead of the boundary edges - ready for a delete (to punch a hole matching the outline), an extrude, or a material/UV assignment scoped to just that region.

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

No faces get selected. The input loop needs to actually be closed - a boundary with a gap or break in it doesn't define an enclosed region, and this operator has nothing valid to convert. Check whatever built the loop upstream (a knife cut, marked seam, or manual selection) actually produced a fully connected ring.

The wrong side of the mesh got selected. Toggle select_bigger - on any loop that divides the mesh into two plausible regions rather than one obvious "inside," this is the setting that decides which one you get.

Result includes more or less than expected on a complex mesh. This operator works purely off topology, not visual intent - on a mesh with unusual connectivity (common after several boolean or fill operations earlier in the graph), the "enclosed region" it finds can be topologically correct but not what you had in mind. Worth a quick visual check before chaining a destructive operation like delete onto the result.

Categoryblender

Inputs (2)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
select_biggeroptBOOLEANfalse

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ