Object Modifier Apply
Bake a modifier into the mesh so it's finally real
- BPY_OBJ
- BPY_OBJ
Modifiers are non-destructive, and that's both their strength and their catch: the change only exists while the modifier is in the stack. Object_ModifierApply wraps bpy.ops.object.modifier_apply() - the operator that permanently bakes a modifier's effect into the mesh and removes the modifier. After this node runs, the geometry is genuinely changed, no strings attached.
In Avatar Graph, this is the node that makes the character real for export. The Avatech Shape Flow runtime and your .glb/.gltf output consume actual geometry, not modifier stacks. A SUBSURF you added for smoothing will be ignored (or look wrong) downstream if it's never applied; a MIRROR you relied on for symmetry will export as half a character. The pattern the demos use: Object_ModifierAdd to shape, tune, and then Object_ModifierApply to bake before the mesh heads into shape-key or export territory. If you want the same effect without destroying the base mesh, that's what Object_ModifierApplyAsShapekey is for.
The mechanism. The node sets BPY_OBJ as active and applies the named modifier. The critical input is modifier - a string, and it's the exact name of the modifier on the object (Blender auto-names them like "Subdivision Surface", "Mirror.001"). Empty or a typo means the operator can't find it and errors out.
Inputs that matter:
modifier- the exact modifier name to apply. This is the one beginners trip on; get it letter-for-letter right.merge_customdata- on by default; merges custom data (uvs, vertex colors) during apply, which is what you want for textured avatar meshes.single_user- off by default; turning it on makes the modifier apply to only this object even if the mesh is shared.report- toggle operator reporting.
Output. BPY_OBJ, passed through - now with the modifier baked in.
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. The #1 failure is the modifier name: it's a plain string that must match Blender's naming exactly, including the ".001" suffixes Blender adds to duplicates. Check the name in Blender or log the object's modifier list if you're guessing. Applying is destructive - there's no undo across graph runs - so apply at the end of the pipeline, not in the middle of tuning. And if an export still looks unmodified, you likely applied a different modifier than the one that mattered.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| BPY_OBJopt | BPY_OBJ | — | |
| modifieropt | STRING | — | |
| reportopt | BOOLEAN | false | — |
| merge_customdataopt | BOOLEAN | true | — |
| single_useropt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BPY_OBJ | BPY_OBJ | — |