Object Modifier Apply As Shapekey
Turn a modifier's effect into an animatable shape key
- BPY_OBJ
- BPY_OBJ
Here's the most avatar-relevant modifier node in the pack. Object_ModifierApplyAsShapekey wraps bpy.ops.object.modifier_apply_as_shapekey(), and its trick is a good one: instead of baking a modifier's effect into the mesh (which destroys the original), it keeps the mesh intact and records the modifier's result as a shape key - an animatable deformation you can drive with a slider, a bone, or the Avatech Shape Flow runtime.
That matters, because shape keys are the currency of this whole pack. The entire avatar animation system works by moving shape keys - blink, mouth open/close, smile - and the README's demos are built on them. So when a modifier like SIMPLE_DEFORM, SHRINKWRAP, or CORRECTIVE_SMOOTH produces exactly the deformation you want, applying it as a shape key turns that one-time result into a live, mixable animation channel. keep_modifier even leaves the modifier on the stack so the effect keeps working after the shape key is captured.
The mechanism. The node sets BPY_OBJ as active and calls the operator with your settings. The modifier field is the exact modifier name to capture (same string-matching gotcha as Object_ModifierApply). With keep_modifier on, the modifier stays; with it off, the modifier is removed after capture, leaving you with a mesh plus a shape key that reproduces the effect.
Inputs.
modifier- exact name of the modifier to capture as a shape key.keep_modifier- keep the modifier in the stack (on) or remove it (off).report- toggle reporting.
Output. BPY_OBJ, passed through - now carrying an extra shape key you can feed into shape-key value setters and the Shape Flow graph.
Installing it. Part of Avatar Graph. ComfyUI Manager → "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
Restart with --enable-cors-header; pack requires Python 3.10.x (bpy==3.6.0).
Troubleshooting. Name matching strikes again - the modifier string must match Blender's exact modifier name. Also know the shape key lands as a relative key at its current deformation; if the modifier's effect is driven by parameters you later change, the captured key stays as captured. For face work specifically, this is the node that turns "I want the mouth to open" from a geometric edit into an animation control - which is the whole point of building avatars in this pack.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| BPY_OBJopt | BPY_OBJ | — | |
| keep_modifieropt | BOOLEAN | false | — |
| modifieropt | STRING | — | |
| reportopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BPY_OBJ | BPY_OBJ | — |