Nodes/Avatar Graph/Mesh Select Prev Item
ComfyUI Node

Mesh Select Prev Item

Step the active element backward

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Mesh Select Prev Item
  • BPY_OBJ
  • BPY_OBJ

The mirror image of Mesh Select Next Item: same idea, opposite direction. It wraps bpy.ops.mesh.select_prev_item, 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. Like its sibling, this one is easy to misunderstand at a glance: it doesn't touch what's selected at all, only which element is currently "active."

How it works

Blender keeps track of selection order, and the most recently selected element is treated as "active" - a specific reference point distinct from the broader selection around it. Several operators in this pack key off that active element directly rather than the full selection: Shortest Path Pick's index target, or Select Axis's comparison vertex, for example. This node moves the active pointer backward one step through the selection's internal order, without adding or removing anything from the selection itself.

Inputs and outputs

The only input is BPY_OBJ - the mesh coming in, with a selection (and an active element) already established upstream. Nothing else to configure.

Output is a single BPY_OBJ - same object, same selection, active element moved back one step.

Where you'd use it

Paired with Mesh Select Next Item, this is how you walk through a set of already-selected elements one at a time in a headless graph, in place of Blender's own interactive step-through hotkeys. It's a genuinely niche node on its own - most workflows don't need to navigate an active element explicitly - but if you're building something that acts on selected elements in sequence rather than all at once, this and its counterpart are the mechanism for that.

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. The recurring confusion on this node is the same as its sibling: expecting the selection itself to change and being surprised when it doesn't. Nothing will look different in a preview unless something further downstream specifically reads the active element rather than the full selection - that's expected, not a failure. It also needs a selection with a meaningful active element to actually step backward through; run it on an empty or freshly-cleared selection and there's simply nothing to move.

Categoryblender

Inputs (1)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ