Nodes/Avatar Graph/Mesh Region To Loop
ComfyUI Node

Mesh Region To Loop

Trace the outline of whatever you've got selected

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

Select a patch of faces on a mesh and you often don't actually want the faces - you want the edge loop tracing their boundary, so you can inset it, extrude it, bevel it, or use it as a seam. That conversion is exactly what this node does. It's Blender's real bpy.ops.mesh.region_to_loop operator, exposed as a ComfyUI node because it's part of Avatar Graph, the pack that builds interactive 2D-to-3D avatars by running actual Blender inside ComfyUI's process via the bpy Python package. The pack auto-generates a node for every mesh operator Blender has, and this one - a small, specific selection-conversion tool - is one of the more useful ones to actually reach for if you're hand-building mesh logic on top of the pack's higher-level rigging nodes.

How it works

Feed it a mesh with a region of faces already selected (from a Mesh Select node earlier in the chain, or built up manually), and it replaces that face selection with an edge selection: just the boundary loop that outlines the region, nothing inside it. It's a one-way conversion with no parameters to tune - the operator either finds a clean boundary loop or it doesn't, depending on whether your selected region is contiguous. A ragged or disconnected face selection won't give you a clean single loop out the other end.

Inputs and outputs

There's exactly one input worth knowing about:

  • BPY_OBJ - the mesh coming in, with a face region already selected upstream. This node reads that selection and mutates the object's selection state to the boundary loop instead.

Output is a single BPY_OBJ - same live object, now with an edge-loop selection instead of a face-region one, ready to feed into whatever operates on that selection next (a bevel, an extrude, an inset, or further selection logic elsewhere in this pack's node set).

Installing it

ComfyUI Manager: search "avatar-graph-comfyui", install, restart. Manual route: cd ComfyUI/custom_nodes && git clone https://github.com/avatechai/avatar-graph-comfyui, then cd avatar-graph-comfyui && python -m pip install -r requirements.txt, then restart ComfyUI.

Sort out the Python version before anything else - this pack needs 3.10.x specifically, because that's what the bpy package it's built on requires. The README steers macOS/Linux installs toward a dedicated conda environment (conda create --name comfyui python=3.10) rather than trusting whatever's already installed, and Windows gets a prebuilt ComfyUI + Python 3.10 zip linked right in the README to unzip over an existing ComfyUI folder before adding the pack via Manager. Restart with --enable-cors-header (add --force-fp16 on macOS) - that's what lets the live 3D preview talk to Avatech's web viewer; skip it and the graph still runs, you just save the model manually from the pack's Avatar Main Output node instead of previewing it live.

Common issues

If nodes from this pack aren't showing up at all, check your Python version first - anything other than 3.10.x means bpy has no compatible build and the whole pack fails to load. Specific to this node: if the output selection looks wrong or empty, it's almost never the node itself misbehaving - it's that the incoming face selection wasn't a single clean contiguous region. Run a proper Mesh Select operation (or verify your manual selection logic) before this node, not after. Beyond that, treat any error here the same as with the rest of this pack's mesh tools: feeding it something other than a real mesh-holding BPY_OBJ from earlier in the same graph will surface as a Blender-side error, because these nodes are designed to chain off each other, not run standalone. And this pack is a heavier dependency than most custom nodes - it's embedding actual Blender - so a conflict with another pack's pinned Python requirements is a real, if unglamorous, possibility if things go sideways during install.

Categoryblender

Inputs (1)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ