Object Track Set
Making an eye follow the camera in ComfyUI
- BPY_OBJ
- BPY_OBJ
The whole appeal of the Avatar Graph pack is that your character isn't a static image - it's a rigged mesh that can react in real time. A big chunk of "reacts" is just tracking: the eyes aim at the camera, the head pivots toward a viewer, an accessory stays pointed at something. Object Track Set is the node that creates that constraint. It wraps bpy.ops.object.track_set(), a genuine Blender 3.6 operator, and the pack's auto-generated wrapper turns your graph wires into a direct call on the headless Blender running inside your ComfyUI process.
The type enum picks which flavor of tracking constraint gets created:
TRACKTO- the classic aim-at: one axis of the object is locked onto the target. Your go-to for "eye looks at camera."DAMPTRACK- the softer version with a damper, so the object eases toward the target instead of snapping. Nice for natural head motion.LOCKTRACK- locks the object's axis to the target, keeping its other rotation free.
Here's the gotcha that trips people up, and it's worth understanding because it comes straight from Blender's semantics: track_set gives the tracking constraint to the selected objects, with the active object as their target. The pack's base node sets your BPY_OBJ as the active object and - importantly - deselects everything else before running. So on a bare graph where your only object is the one on the wire, there's nothing to receive the constraint and the op does nothing visible. In the Avatar Graph flow this works when you've built a scene with multiple meshes and a selection already exists in the Blender scene; it's one of the pack's genuinely fiddly auto-generated nodes rather than a purpose-built one.
The output is your BPY_OBJ passed through - the active object, which in Blender's model is the target. So wire the target (the camera, or the thing being looked at) into BPY_OBJ and make sure the follower objects are selected in the scene.
Install is pack-wide: ComfyUI Manager → "Avatar Graph", or git clone https://github.com/avatechai/avatar-graph-comfyui into ComfyUI/custom_nodes, then pip install -r requirements.txt under Python 3.10 (bpy==3.6.0 won't build on newer). First startup downloads the ~2.4 GB SAM model. Restart with --enable-cors-header to see the live editor preview.
Troubleshooting: the classic failure is "nothing happened" - that's the selection problem above, not a crash. Pair this with Object Track Clear (use CLEAR_KEEP_TRANSFORM) to freeze a tracked pose, and remember the scene resets each run, so re-run the whole graph to rebuild the constraint. If all you want is "look at the viewer," also check whether the pack's shape-flow editor can drive the same effect without a constraint at all - sometimes the node exists because the registry generated it, not because it's the best tool for the job.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| BPY_OBJopt | BPY_OBJ | — | |
| typeopt | COMBO | 3 options: DAMPTRACK, TRACKTO, LOCKTRACK |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BPY_OBJ | BPY_OBJ | — |