Nodes/Avatar Graph/Object Hook Reset
ComfyUI Node

Object Hook Reset

Returning a hook to rest position after you've yanked it around

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Object Hook Reset
  • BPY_OBJ
  • modifier
  • BPY_OBJ

A hook is a leash: the empty on the other end drags the vertices wherever you move it. Fine when you're animating - that's the point. Not fine when you've dragged the empty around for testing and now the mesh is stuck in a weird pose and you just want everything back at rest. Object_HookReset is the "snap this hook back to where it started" operator, exposed as a node in the Avatar Graph pack.

It answers a specific, very common rigging frustration: you test the head bone, the hooked hair flies sideways, and now your avatar's resting pose is broken. Reset returns the hook to its original position - the rest state it had when the hook was applied - so the mesh settles back where it belongs.

How it works

It calls bpy.ops.object.hook_reset(). In Blender's UI this is the "Reset" button on a Hook modifier: it restores the hook target to the location it had when the modifier was created, neutralizing whatever offset accumulated from moving the empty. The verts stay hooked - Reset doesn't remove the leash, it just stops the yanking.

Inputs are the standard hook-node trio:

  • BPY_OBJ - the mesh with the hook; sets active in the embedded scene and passes through unchanged on output.
  • modifier - the name of the Hook modifier, typed as a B_ENUM string via the pack's ENUM (Blender) helper node.

That modifier field is the same trap across all the hook nodes: it's not a dropdown, it's an exact name you have to type. Feed it Hook when the modifier was created as Hook, Hook.001 when it was Hook.001, or the operator finds nothing.

When you'd use it in an avatar graph

After any test motion. A tidy Avatar Graph pattern: drive the hook empty, render or preview, then run Object_HookReset before the graph hands the scene to the next stage - so downstream nodes (shape keys, light probing, export) always see a neutral pose rather than a mangled one. Given the pack resets the whole embedded scene between runs, this matters less for state cleanliness and more for ordering within a single run where you do move-then-settle.

Inputs and outputs

  • BPY_OBJ - mesh whose hook you're resetting.
  • modifier - hook modifier name (ENUM helper).
  • BPY_OBJ output - same object, pass-through for chaining.

Installing it

Ships in Avatar Graph (avatechai/avatar-graph-comfyui). Easiest via ComfyUI Manager (search "Avatar Graph"), 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-level requirements to remember: bpy==3.6.0 pins you to Python 3.10.x (3.11+ won't build bpy and the pack vanishes), and first startup auto-downloads the SAM ViT-H checkpoint (~2.5 GB) and MediaPipe landmarkers.

Common issues

The modifier-name string is the usual failure point - type it slightly wrong and nothing resets. Also worth knowing Reset restores the hook target, not the mesh's shape; if the mesh itself got deformed by other modifiers, Reset won't fix that. And as ever with this pack, the README says it's a work-in-progress, so check the repo if behavior looks off.

Categoryblender

Inputs (2)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
modifieroptB_ENUM

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ