Nodes/Avatar Graph/Object Set Parent Type
ComfyUI Node

Object Set Parent Type

Object Set Parent Type — decide how a part attaches to its parent

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Object Set Parent Type
  • BPY_OBJ
  • BPY_OBJ
valueOBJECT

Blender objects can be parented to another object in several different ways, and parent_type is the switch that picks which one. Object Set Parent Type is the auto-generated setter for that switch: OBJECT (follow a parent object's full transform), ARMATURE (follow an armature's auto head bone), BONE (follow a specific named bone), or the vertex modes VERTEX / VERTEX_3 (stick to a vertex of the parent mesh). If you're rigging an avatar, this is the node that makes "hat follows head bone" actually work.

How it works

Like every ObjectSet_* node in the Avatar Graph pack, this one is a one-line setattr on the embedded Blender object: feed it a BPY_OBJ and a value, it writes parent_type, and returns the same BPY_OBJ for chaining. The value input is a STRING with default "OBJECT" - matching Blender's own default. You'd normally type one of:

  • OBJECT - the default; child copies the parent's transform.
  • ARMATURE - child gets auto-parented to the armature's head bone.
  • BONE - child follows the bone named in parent_bone.
  • VERTEX / VERTEX_3 - child is parented to one (or the average of three) vertices of a mesh parent.

The default "OBJECT" is a fine no-op in most graphs. This node earns its keep when you set it to BONE and then set parent_bone in the same chain - the two always travel together in the pack's rigging templates, and setting one without the other does nothing useful.

The inputs

  • BPY_OBJ - the mesh layer from Create Mesh Layer or a Mesh_ primitive.
  • value - the parent type string, default "OBJECT".

Output is the same BPY_OBJ. That's the whole node.

Install & gotchas

It ships with the Avatar Graph pack; install that once and all these setters appear together:

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 via ComfyUI Manager → search "Avatar Graph". The pack pins bpy==3.6.0, which requires Python 3.10 in your ComfyUI environment - bpy ships no wheels for 3.11+, so the pack simply won't import otherwise. Conda with python=3.10 is the README's stated approach. First launch pulls a ~2.5 GB SAM model and mediapipe landmarker files.

Real-world traps: parent_type only matters once there is a parent, so put this node downstream of the parenting step in the graph (scene state resets each run). If you set BONE but the part still drifts, double-check parent_bone is spelled exactly and comes later in the chain. And note the pack's live preview requires --enable-cors-header; skip it and you still get exports via Save File on Avatar Main Output, just no realtime editor.

Categoryblender

Inputs (2)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
valueoptSTRINGOBJECT

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ