Object Set Parent Bone
Pin a mesh layer to a bone so it follows the armature
- BPY_OBJ
- BPY_OBJ
This is the setter you reach for when one of your avatar's parts should track a specific bone instead of the whole armature. In the Avatar Graph pipeline your character's head, hair, or hat might be separate mesh layers; when the head bone rotates for a nod or a look, Object Set Parent Bone tells that layer which bone it's glued to, so it moves with the rig rather than floating in place.
How it works
The ObjectSet_* family is auto-generated from Blender's bpy.types.Object property list, and each one is a single setattr call. This node sets parent_bone - the name of the bone an object is parented to. You give it a BPY_OBJ and a value string with the bone's exact name (like "head"), it writes that onto the object inside the embedded bpy instance, and returns the same BPY_OBJ so you can keep chaining.
Important nuance: parent_bone on its own does nothing. Blender only honors it when the object's parent is an armature and parent_type is set to BONE (or ARMATURE for an auto-located head bone). That's why in the pack's rigging templates you'll usually see Object Set Parent Type sitting right next to this node in the chain - set the type first, then the bone name, or nothing visibly changes. Wire order matters.
The default value is an empty string, which means "not parented to any bone." Type the bone name exactly as it exists in the armature - bone names are case-sensitive and don't get de-duplicated against each other the way object names do, so a typo just silently leaves the part unparented.
The inputs
- BPY_OBJ - the mesh layer from
Create Mesh Layeror aMesh_primitive. - value - the target bone's name, default
"".
Output: the same BPY_OBJ, ready for the next setter or the output node.
Install & gotchas
Comes with the Avatar Graph pack:
cd ComfyUI/custom_nodes
git clone https://github.com/avatechai/avatar-graph-comfyui
cd avatar-graph-comfyui && python -m pip install -r requirements.txt
or install via ComfyUI Manager (search "Avatar Graph"). Requirements are heavy: bpy==3.6.0 (needs Python 3.10 - nothing else), plus opencv, mediapipe, torchvision and segment-anything. First launch auto-downloads the ~2.5 GB SAM ViT-H model and landmarker files.
The failure modes here are all parent-related and worth knowing. Set parent_type to BONE in the same chain or the bone name is ignored. Keep the setter downstream of the armature creation node - the bpy scene resets each queue run. And if you export a glTF and the part still sits at the origin, check both the bone name and that the bone actually exists in your armature's skeleton. Also, the pack's live preview needs ComfyUI started with --enable-cors-header; without it the graph runs and exports fine, you just lose the realtime editor.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| BPY_OBJopt | BPY_OBJ | — | |
| valueopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BPY_OBJ | BPY_OBJ | — |