Nodes/Avatar Graph/Mesh Select Linked
ComfyUI Node

Mesh Select Linked

Grab everything connected to what you've already got

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Mesh Select Linked
  • BPY_OBJ
  • delimit
  • BPY_OBJ

Select one vertex on a mesh and you often actually want the whole connected chunk it belongs to - the entire island, not just that one point. That's what this node does: it flood-fills outward from whatever's currently selected, grabbing everything that's geometrically connected to it, and stopping at whatever boundaries you tell it to respect. It's Blender's real bpy.ops.mesh.select_linked operator, exposed as a ComfyUI node inside Avatar Graph, the pack that runs actual Blender inside ComfyUI's process (via the bpy Python package) to build interactive 2D-to-3D avatars, auto-generating a node for every mesh operator Blender has.

How it works

Starting from the current selection, it walks outward across shared edges and vertices, adding connected geometry until it hits a boundary it's been told not to cross - or, if you haven't set any boundaries, until it's swept up the entire connected island the starting selection belongs to. It's the fast way to select "everything that belongs to this piece" without manually box-selecting or clicking every vertex.

Inputs and outputs

  • BPY_OBJ - the mesh coming in, with a starting selection already established upstream (this is what the flood-fill expands from).
  • delimit - a set of boundary types the flood-fill won't cross: things like material boundaries, UV seams, sharp edges, or marked seams, depending on what you configure. Leave it empty and the selection just expands across all connected geometry with nothing stopping it short of a physical gap in the mesh; set it to respect, say, material boundaries, and the flood-fill stops at the edge of each material island instead of spreading across the whole connected mesh.

Output is a single BPY_OBJ - the same object, selection expanded to everything connected within the boundaries you set.

Installing it

ComfyUI Manager: search "avatar-graph-comfyui", install, restart. Manually: 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.

Python 3.10.x is the requirement to get right first - the bpy package this pack is built on needs that exact minor version, and the README recommends a dedicated conda environment on macOS/Linux (conda create --name comfyui python=3.10) instead of trusting an existing Python install. Windows users get a prebuilt ComfyUI + Python 3.10 zip linked in the README to unzip over their install before adding the pack through Manager. Restart with --enable-cors-header (macOS also wants --force-fp16) for the live 3D preview - without it, the graph still runs, you just save the model manually via the pack's Avatar Main Output node instead.

Common issues

Check the Python version first if this pack's nodes aren't loading - 3.10.x is required for bpy to have a working build at all. On this node, the surprise people run into most is selecting way more than they meant to - if a mesh is fully connected with no real seams or gaps, an empty delimit set means the flood-fill just keeps going until it's grabbed the entire mesh, not the one small region you were expecting. If that happens, add appropriate boundaries to delimit rather than assuming the node is broken - it's doing exactly what it was told, which was "don't stop." And, as usual for a flood-fill, it needs something selected to start from; run it on an empty selection and there's nothing to expand outward from. As with every mesh node in this pack, feeding it something other than a real mesh BPY_OBJ from earlier in the same graph surfaces as a Blender-side error.

Categoryblender

Inputs (2)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
delimitoptB_ENUM_SET

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ