Object Gpencil Modifier Copy To Selected
Share one modifier across every grease pencil object at once
- BPY_OBJ
- BPY_OBJ
Object_GpencilModifierCopyToSelected copies a grease pencil modifier from your active object onto every other selected grease pencil object in the scene. Where Object_GpencilModifierCopy duplicates within a single object, this one broadcasts: one tuned modifier, applied to a whole set of drawing layers in one step. It wraps Blender's bpy.ops.object.gpencil_modifier_copy_to_selected.
Why you'd reach for it
Grease pencil work in an avatar scene is rarely a single object. You might have one grease pencil layer for the outline, another for shadows, a third for motion flourishes - and you often want the same treatment on all of them. Instead of copying a modifier onto each object individually, you set up the modifier once, select all the target grease pencil objects, and let this node distribute it. It's the "apply to many" move that keeps a multi-layer effect consistent.
How it works
Standard auto-generated wrapper over the Blender operator. The node makes your BPY_OBJ the active object and runs the copy-to-selected operator with the modifier name you supply. Inputs:
BPY_OBJ(optional) - the object holding the modifier you want to share.modifier(STRING, default empty) - the name of the modifier to copy out.
Output: BPY_OBJ, the source object, passed through. The copies land on the other selected objects in the shared Blender scene.
The selection caveat
Here's the part that trips people up, because it's invisible in the node UI: this operator depends on which other objects are selected in the scene at the moment it runs. The pack runs everything inside one headless Blender scene, and selection state is global and real. If the node "does nothing," the almost-certain cause is that no other grease pencil objects were selected when it fired. There's no selection input on the node itself - you have to ensure the targets are selected via whatever nodes precede this one in your graph. That makes it a node for people who understand the scene state, not a grab-and-go utility.
It's also worth remembering that copies land with Blender's .001 naming, and each copy is independent afterwards - editing the original won't retroactively update the copies. If you want a linked relationship, that's a different mechanism entirely.
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". Python 3.10 for bpy==3.6.0, ~2.5GB SAM checkpoint + mediapipe models on first load, scene resets each run, live preview needs --enable-cors-header.
Two honest notes. Because the scene resets to factory settings every run, your selection dance has to happen within the same run - you can't pre-select objects in a previous execution and expect them to persist. And if you only have one grease pencil object, this node has nothing to broadcast to; it'll pass your object through untouched. When you have a fleet of drawing layers that all need the same outline, though, this is the node that turns a chore into one click.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| BPY_OBJopt | BPY_OBJ | — | |
| modifieropt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BPY_OBJ | BPY_OBJ | — |