Object Gpencil Modifier Remove
Delete a grease pencil modifier by name
- BPY_OBJ
- BPY_OBJ
Object_GpencilModifierRemove deletes a grease pencil modifier from an object, addressing it by name. It wraps Blender's bpy.ops.object.gpencil_modifier_remove, and it's the cleanup end of the modifier family - the node you use when a GP_NOISE that was helping is now fighting you, or when a copy experiment didn't pan out and the stack needs to shrink.
When you'd reach for it
Modifiers are cheap to add and easy to pile on, which is exactly how you end up with a stack of three things doing the same job. Removal is the natural inverse. In the avatar workflow it shows up in two places: cleaning up a branch you tried and abandoned, and making a graph idempotent. Because the pack's headless Blender resets the scene to factory settings every run, every execution rebuilds the world from scratch - so a "remove the outline before applying" step keeps your final output from accumulating whatever you stacked experimentally upstream.
How it works
Auto-generated wrapper over the gpencil_modifier_remove operator. It makes your BPY_OBJ active, removes the modifier you name, and passes the object back. Inputs:
BPY_OBJ(optional) - the grease pencil object.modifier(STRING, default empty) - the exact name of the modifier to remove.report(BOOLEAN, default false) - print feedback to the ComfyUI console when the removal happens. Genuinely useful, because this operator can fail silently.
Output: BPY_OBJ, the same object, minus the named modifier.
The naming problem is a footgun here
Of all the Object_GpencilModifier* nodes, this one punishes a wrong name the hardest: you ask for GP_Noise to be removed and Blender removes... the first modifier matching that name, which may not be the one you meant, or nothing at all. Blender's auto-suffixing makes it worse - copies become Name.001, Name.002, and typing the wrong variant deletes the wrong thing. There's no dropdown of names in the pack, so report is your friend: turn it on, read the console, and confirm the removal actually hit the modifier you intended. When in doubt, remove by the exact name you know you created.
Install and gotchas
Standard pack install:
cd ComfyUI/custom_nodes
git clone https://github.com/avatechai/avatar-graph-comfyui.git
cd avatar-graph-comfyui && python -m pip install -r requirements.txt
or ComfyUI Manager → "Avatar Graph". House rules: Python 3.10 for bpy==3.6.0, ~2.5GB SAM checkpoint + mediapipe models on first load, scene resets every run, live preview needs --enable-cors-header.
Removal is destructive with no undo across runs - the scene reset wipes your undo history, so double-check the name before wiring this in. And remember: the modifier being removed has to exist in this run's freshly reset scene, which means anything it's cleaning up also has to be rebuilt upstream. It's a simple node with a sharp edge, which is to say it does exactly what it says and punishes carelessness.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| BPY_OBJopt | BPY_OBJ | — | |
| modifieropt | STRING | — | |
| reportopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BPY_OBJ | BPY_OBJ | — |