Nodes/Avatar Graph/Mesh Select Similar
ComfyUI Node

Mesh Select Similar

Extend a selection to everything that matches

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Mesh Select Similar
  • BPY_OBJ
  • BPY_OBJ
type
compare
threshold0.00

This is one of the more genuinely powerful selection tools in the pack, and also one of the fiddlier ones to get right. It wraps Blender's real bpy.ops.mesh.select_similar operator, part of 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 - and this one inherits Blender's own reputation for being extremely capable and a little intimidating at the same time.

How it works

Start with a selection, pick a property to compare on - face area, normal direction, edge length, crease weight, seam status, material, vertex-group membership, and a long list of others - and this node grows the selection to include every other element in the mesh whose value for that property is close enough to what's already selected. Select one face, run this checking normal direction, and you can end up with every roughly-coplanar face on the mesh selected in one step, no manual clicking required.

The inputs that matter

  • BPY_OBJ - the mesh coming in, with a starting selection already established.
  • type - the property to compare. The schema exposes a genuinely large set of choices (over 20: NORMAL, FACE, VGROUP, EDGE, VCREASE, LENGTH, DIR, FACE_ANGLE, CREASE, BEVEL, SEAM, and more). Worth flagging honestly: in real Blender, which of these are even valid depends on the current select mode - vertex, edge, and face modes each expose a different subset of comparison properties, so picking one that doesn't apply to the active mode is a straightforward source of a "poll() failed" error rather than a silent no-op.
  • compare - EQUAL, GREATER, or LESS, relative to the selected reference value.
  • threshold (default 0, range 01) - how much tolerance counts as a match, mainly relevant to EQUAL since GREATER/LESS are already directional.

Output is a single BPY_OBJ, selection extended to everything that matched.

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 nail down 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) rather than 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 via Manager, which is worth doing carefully - this pack's dependency list (bpy, segment-anything, mediapipe, OpenCV) is heavier than most, and the wider ComfyUI custom-node ecosystem is known for version conflicts between packages sharing one Python environment with no isolation. Restart with --enable-cors-header (macOS also wants --force-fp16) for the live 3D preview.

Common issues

Rule out the Python version first if this pack's nodes aren't loading at all. On this node specifically, an operator error on a given type choice is very often a select-mode mismatch - run a Select Mode node first to pin vertex/edge/face mode explicitly rather than relying on whatever state the mesh was left in. If the resulting selection is way bigger or smaller than expected, threshold is the first dial to check; 0 under EQUAL demands an exact match, which on procedurally generated geometry can be stricter than you'd expect.

Categoryblender

Inputs (4)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
typeoptCOMBO23 options: NORMAL, FACE, VGROUP, EDGE, VCREASE, LENGTH, +17
compareoptCOMBO3 options: EQUAL, GREATER, LESS
thresholdoptFLOAT0.000–1

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ