Object Hook Remove
Untethering vertices from a hook, cleanly
- BPY_OBJ
- modifier
- BPY_OBJ
Rigging is as much about undoing as doing. You hook a ponytail to the head bone, test it, and decide the whole approach is wrong - you don't want a hook at all, you want weight painting, or a different target. Object_HookRemove is the "delete this hook modifier" operator, exposed as a node in the Avatar Graph pack. It strips a named Hook modifier off an object and frees the verts from its influence.
It's a boring node, and that's the point. In a graph-based workflow where the embedded Blender scene is rebuilt fresh every run, being able to surgically remove a modifier mid-graph is what lets you build, test, and rebuild rigs without the garbage accumulating in the scene.
How it works
It calls bpy.ops.object.hook_remove(). In the Blender UI, each Hook modifier has a delete button; this is that button. The modifier is removed, the object's vertices go back to being driven only by whatever else is in the modifier stack, and the hook target object (the empty or bone) stays in the scene - deleting the hook doesn't delete the target. If you want the empty gone too, that's a separate object-deletion step.
Inputs mirror the other hook nodes:
BPY_OBJ- the mesh to clean up; sets active, passes through unchanged on output.modifier- the name of the Hook modifier to remove, typed as aB_ENUMstring via the pack's ENUM (Blender) helper node.
The modifier string is where people stumble: it's not a dropdown, it must be the exact modifier name as created (Hook, Hook.001, ...). Get it wrong and the operator errors out or removes nothing.
When you'd use it in an avatar graph
Any restructure step. Common scenarios: you hooked the bangs but then switched to a different deformation strategy and need the hook gone before adding a shape key; or a generated mesh layer carries an unwanted hook from a previous template and you strip it before parenting. It's also handy as a safety valve - run Remove before re-running a hook-creation branch so you never stack duplicate modifiers on a rebuilt scene.
Inputs and outputs
BPY_OBJ- mesh whose hook you're deleting.modifier- hook modifier name (ENUM helper).BPY_OBJoutput - same object, so the graph can continue.
Installing it
Part of Avatar Graph (avatechai/avatar-graph-comfyui). Install 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
Remember the pack-level constraint: bpy==3.6.0 requires Python 3.10.x, and first launch auto-downloads the SAM ViT-H checkpoint (~2.5 GB) plus MediaPipe models. On Windows the README's bundled Python 3.10 ComfyUI archive is the smoothest path.
Common issues
Mostly the modifier-name problem again - the B_ENUM field wants a typed string, not a selection. And worth repeating: this removes the modifier, not the hook target object; people expect the empty to disappear too and then get confused when it lingers. The README warns the pack is still in active development, so give it a git pull if something behaves unexpectedly.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| BPY_OBJopt | BPY_OBJ | — | |
| modifieropt | B_ENUM | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BPY_OBJ | BPY_OBJ | — |