Object Set Active Shape Key Index
The node that picks which shape key you're driving — core to the whole rig
- BPY_OBJ
- BPY_OBJ
Object Set Active Shape Key Index is the quiet linchpin of the whole Avatar Graph rigging pipeline - and the most deceptive-looking node in the batch, because all it does is set one number. It sets the active_shape_key_index property on the object, which tells Blender which shape key is the one being edited. When the pack's "Mesh Modify Shape Key" node goes to deform vertices, it works on whichever shape key is active. This node is how you aim it.
How the avatar rig uses shape keys
Turn a static character into an interactive avatar, and the magic is shape keys: stored mesh deformations. Index 0 is the basis (the original mesh), and each key after that is a saved deformation - a blink, an open mouth, a smile. The standard Avatar Graph template builds keys for the eyes and mouth, and the Shape Flow runtime drives those keys in real time to make the character blink and lipsync.
To modify one of those keys - widen the mouth shape, fix a blink that crushes the eyelid - you need that key active. That's this node's job: feed it the object and the index, and the next shape-key operation lands on the key you meant instead of the basis.
The input that matters
- BPY_OBJ - the rigged mesh object.
- value - the shape key index, default
2. The default is a hint about the pack's template:0is the basis,1is typically the first blink/eye key,2the mouth - so the node starts you aimed at index 2 (the mouth) out of the box.
Output is a single BPY_OBJ, the same object, now with the active shape key set.
A note on how this node is made
Unlike the Object_* operator wrappers, this one is a property setter. The pack's ops_mesh.py contains a list of bpy object properties, and active_shape_key_index (with default 2) is in it; the generator builds a tiny node that just assigns the value to the object. That's why it's named ObjectSet_ instead of Object_. It's the same auto-generation machinery, just aimed at a property instead of an operator - and in this case the generated result happens to be genuinely central to the workflow.
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 practical gotcha: if your Mesh Modify Shape Key edits end up warping the wrong thing, the active index is the first suspect - count your shape keys from 0 (basis) and confirm the index before you blame the modifier.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| BPY_OBJopt | BPY_OBJ | — | |
| valueopt | INT | 2 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BPY_OBJ | BPY_OBJ | — |