Object Gpencil Modifier Copy
Duplicate a grease pencil modifier without rebuilding it
- BPY_OBJ
- BPY_OBJ
Object_GpencilModifierCopy duplicates an existing grease pencil modifier on the same object. You name a modifier and the node creates an exact copy of it - same type, same settings - appended to the object's modifier stack. It wraps Blender's bpy.ops.object.gpencil_modifier_copy, and it's the lazy-person's way of getting a second copy of a setup you already tuned.
When you'd reach for it
Grease pencil modifiers are fiddly to configure, and getting one just right - say, a GP_NOISE jitter with exactly the wobble you like, or a GP_LINEART outline with the right edge selection - takes fiddling. Once it's perfect, you often want it again: a second outline pass at a different thickness, another build layer with the same easing, a mirrored duplicate. Recreating that from scratch through Object_GpencilModifierAdd means re-picking settings; copying the modifier you already have is one node. It's the classic "duplicate and tweak" move.
How it works
Plain auto-generated wrapper over the gpencil_modifier_copy operator. It makes your BPY_OBJ active, copies the modifier you name, and passes the object back through. Inputs:
BPY_OBJ(optional) - the grease pencil object.modifier(STRING, default empty) - the exact name of the modifier to copy.
Output: BPY_OBJ, the same object, now with an extra copy of the named modifier at the end of the stack.
The one nuance is stack position: the copy lands at the bottom of the stack, not next to the original. Modifier order changes the visual result, so after copying you'll often follow up with Object_GpencilModifierMoveUp or Object_GpencilModifierMoveToIndex to place the copy where it belongs. Since both take the modifier name as a string, you'll want a naming scheme - Blender appends a .001 suffix to copies, so know whether you're addressing the original or the duplicate.
Install and gotchas
Same pack, same 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". The house rules again: Python 3.10 for bpy==3.6.0; ~2.5GB SAM checkpoint + mediapipe models on first load; scene resets to factory settings every run, so this modifier copy - like everything else - is rebuilt fresh each execution; live preview needs --enable-cors-header.
The trap, same as the whole Object_GpencilModifier* family: everything is addressed by name, and the node won't tell you the names. If you copy GP_Noise and later try to move "GP_Noise" around, you might be moving the original while the copy (now GP_Noise.001) sits in the wrong place. Know your names or name things deliberately.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| BPY_OBJopt | BPY_OBJ | — | |
| modifieropt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BPY_OBJ | BPY_OBJ | — |