Nodes/Avatar Graph/Object Select By Type
ComfyUI Node

Object Select By Type

Grab every mesh, every camera, every light — one type at a time

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Object Select By Type
  • BPY_OBJ
  • BPY_OBJ
extendfalse
type

Object Select By Type is the "find all the things that are the same kind of thing" node. It wraps bpy.ops.object.select_by_type, which selects every object of a given data type in the scene. When your avatar graph has accumulated a pile of meshes, a few empties, and a camera or two, this is the clean way to grab just the category you care about.

The inputs that matter

  • BPY_OBJ - becomes the active object; mostly for chaining.
  • type - the big one. A dropdown covering Blender's object types: MESH, CURVE, SURFACE, META, FONT, CURVES, POINTCLOUD, VOLUME, GPENCIL, ARMATURE, LATTICE, EMPTY, LIGHT, LIGHT_PROBE, CAMERA, SPEAKER. In avatar work you'll live in MESH (all the mesh layers you just created) and occasionally EMPTY (your anchors and parents) or CAMERA.
  • extend - off by default. When it's off, the selection is replaced; when it's on, the newly matched objects get added to whatever's already selected. Forgot to check this and it'll feel like the node is randomly losing your previous selection.

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

Where you'd reach for it

Classic move: you've generated a bunch of mesh layers from image segments, and you want to run a bulk operation across all of them - join, shade smooth, randomize, whatever. Select By Type with MESH gives you exactly the geometry and leaves the empties and cameras alone. Same trick works the other way: select all LIGHT objects to knock out stray lighting in one pass, or all CAMERA objects to find your view cams.

Like every selection node in this pack, it matters because most Blender ops act on the selection, and the headless scene resets between runs - so the "select all meshes" step has to happen fresh inside each graph execution, right before the operation that consumes it.

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 notes: bpy==3.6.0 requires Python 3.10, and first import auto-downloads the SAM checkpoint and mediapipe models. And if a selection op "skips" objects you're sure are there, double-check you picked the right type - MESH vs CURVES is an easy fumble when half your parts came out of curves.

Categoryblender

Inputs (3)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
extendoptBOOLEANfalse
typeoptCOMBO16 options: MESH, CURVE, SURFACE, META, FONT, CURVES, +10

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ