Nodes/Avatar Graph/Object Select Same Collection
ComfyUI Node

Object Select Same Collection

Select everything in a named collection — organization as a workflow tool

By avatechai·Created 3 years ago·Updated 2 years ago· 265
Object Select Same Collection
  • BPY_OBJ
  • BPY_OBJ
collection

Object Select Same Collection is the "grab the whole collection" node. It wraps bpy.ops.object.select_same_collection, which selects every object that lives in a given collection. In Blender, collections are folders for objects - you might have a "face" collection, a "hair" collection, a "props" collection. This node turns that organization into a selection tool: name a collection, get every object in it.

The inputs

The only meaningful input beyond BPY_OBJ is collection, a plain string - the name of the collection whose members you want selected. It defaults to empty, which in Blender's operator means the collection of the active object; fill in a name to target a specific one. Note there's no extend toggle here - selection gets replaced by the collection's contents.

Output is a single BPY_OBJ, the active object, unchanged.

Why collections matter in avatar graphs

Avatar Graph is built around parts - mesh layers created from image segments, joined, then rigged. If you've been throwing every part into the default scene collection, everything's in one giant bucket and collection selection is useless. If you've organized parts into named collections as you build, this node becomes a clean "select all of the mouth parts" or "select all of the hair" move - and because it's name-based, it survives the scene reset that wipes ordinary selection state between runs.

It's auto-generated from the pack's operator list ('select_same_collection' is in object_api in ops_mesh.py), which is also the giveaway that it targets Blender's operator as shipped in bpy 3.6. Keep the collection names exact - case-sensitive, no fuzzy matching - or you'll select an empty set and wonder why "nothing happened."

Installing it

Part of the Avatar Graph pack. ComfyUI Manager → search "Avatar Graph" → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/avatechai/avatar-graph-comfyui
cd avatar-graph-comfyui
python -m pip install -r requirements.txt

Pack-wide caveats: bpy==3.6.0 needs Python 3.10, and first import auto-downloads the ~2.5GB SAM checkpoint plus mediapipe models. And the recurring selection-node reminder: most Blender ops act on the selection, so place this right before the op that consumes it - the headless scene resets between runs, and selection doesn't survive the trip.

Categoryblender

Inputs (2)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
collectionoptSTRING

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ