Object Select Pattern
Select by name — the wildcard node that makes naming conventions pay off
- BPY_OBJ
- BPY_OBJ
Object Select Pattern is the name-based selection node, and it's quietly one of the most useful things in the pack. It wraps bpy.ops.object.select_pattern, which selects objects by matching their names against a wildcard pattern. Default pattern is * - which selects everything. Change it to eye* and you grab every object whose name starts with "eye". This is the node that makes consistent naming pay off.
The inputs that matter
- BPY_OBJ - becomes the active object; mostly for chaining.
- pattern - the wildcard string, default
*. Blender's wildcards:*matches any run of characters,?matches a single character. So*hair*catches every part with "hair" anywhere in the name. - case_sensitive - off by default. Flip it on and
EYEstops matchingeye. - extend - default true here, which is the opposite of most select nodes. With extend on, matching objects get added to the current selection; turn it off to replace.
Output is a single BPY_OBJ, the active object.
Why it's the one to learn
The other selection nodes pick by type, by grouping, by data-link. Pattern selection is the one that respects you: if you name your mesh layers consistently (eye_l, eye_r, brow_l, mouth, hair_back, hair_front), one pattern node can grab a logical set that no type or group selector can express. "All the hair parts" = *hair*. "All left-side parts" = *_l. That kind of power makes naming conventions feel like a feature instead of a chore - and in a workflow where the scene resets every run, a name pattern rebuilds the exact same selection reliably every time.
Like the rest of the pack's selection nodes, it exists because ops_mesh.py wraps Blender's operator list wholesale ('select_pattern' is in object_api), and it runs against the headless scene, so selection is fresh per execution.
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 SAM checkpoint and mediapipe models. And the one trap: * matches everything, so if you leave the default pattern in by accident, you've just selected the whole scene - usually not the plan when you were trying to isolate one part.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| BPY_OBJopt | BPY_OBJ | — | |
| patternopt | STRING | * | — |
| case_sensitiveopt | BOOLEAN | false | — |
| extendopt | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BPY_OBJ | BPY_OBJ | — |