Nodes/Avatar Graph/Mesh Select Nth
ComfyUI Node

Mesh Select Nth

Checker-deselect, keep every Nth element

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Mesh Select Nth
  • BPY_OBJ
  • BPY_OBJ
skip1
nth1
offset0

Known in Blender's own UI as "Checker Deselect," this node thins a selection into a repeating pattern rather than an all-or-nothing block. It wraps bpy.ops.mesh.select_nth, 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.

How it works

Starting from whatever's currently selected - most usefully a full, ordered run like a complete edge loop - it walks through the selection and applies a repeating keep/skip cycle: keep a stretch, deselect a stretch, keep, deselect, over and over along the run. The result is a striped, alternating selection instead of the solid block you started with. It's exactly the kind of pattern-selection that's tedious to click out by hand but trivial to describe as a rule.

Inputs and outputs

  • BPY_OBJ - the mesh coming in, with an ordered selection already established upstream.
  • nth (default 1, min 1) - how many consecutive elements stay selected in each cycle.
  • skip (default 1, min 1) - how many consecutive elements get deselected in each cycle.
  • offset (default 0) - shifts where along the selection the pattern starts, which is the field to reach for if the resulting stripe is landing on the wrong parity (every other element instead of the ones you actually wanted).

Output is a single BPY_OBJ - the same object, selection now thinned to the keep/skip pattern.

Where it's actually useful

Anywhere you want a genuinely alternating result instead of a contiguous region - every other edge loop for a ribbed pattern, every other vertex for a scatter-style deformation, a striped selection to feed into a follow-up transform. Because it reads the selection in its internal order, it works best on geometry that's already selected as a coherent, ordered run (a loop, a ring) rather than a scattered, disconnected set of elements, where "every Nth" won't correspond to anything visually meaningful.

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. Restart with --enable-cors-header (macOS also wants --force-fp16) for the live 3D preview - without it, the graph still runs fine, you just save the model manually from the pack's Avatar Main Output node instead.

Common issues

Rule out the Python version first if this pack's nodes aren't loading. On this node specifically, a pattern that looks arbitrary or "wrong" is almost always a selection-ordering problem rather than a bug: it follows the mesh's internal element order, not visual left-to-right position, so a selection that isn't a single clean loop or ring can produce a striping pattern that doesn't match what you'd expect just looking at the geometry. If the stripe is offset from where you want it, adjust offset rather than fighting with nth/skip - that's exactly what it's there for.

Categoryblender

Inputs (4)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
skipoptINT11–2147483647
nthoptINT11–2147483647
offsetoptINT0-2147483648–2147483647

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ