Nodes/Avatar Graph/Object Set Use Grease Pencil Lights
ComfyUI Node

Object Set Use Grease Pencil Lights

When 2D strokes should react to 3D light

By avatechai·Created 3 years ago·Updated 2 years ago· 264
Object Set Use Grease Pencil Lights
  • BPY_OBJ
  • BPY_OBJ
valuefalse

Most of Avatar Graph's avatars are meshes - planes cut out of character images and rigged to blink and talk. But not all of them. The pack also runs emoji and cartoon avatars built from Grease Pencil strokes, and Object Set Use Grease Pencil Lights is the switch that decides whether those 2D strokes respond to the scene's 3D lights or stay flat. It's an Avatar Graph ObjectSet_ node: grab the Blender object off the BPY_OBJ input, set one property, pass the object back.

What it actually does

Grease Pencil objects are Blender's 2D-drawing tool: strokes that live in 3D space but render like flat art. By default they ignore lighting and just draw their stroke color, which is what you want for a crisp cartoon look. The use_grease_pencil_lights property flips that - with it on, the strokes get lit by the scene's lights and can pick up shading and tints from them.

That's a genuinely useful knob for the emoji-style avatars in this pack's demos. Flat strokes are clean and legible, but a stroke that catches the light can sit inside a 3D scene convincingly instead of floating on top of it. It's also an easy way to make the character read as "in the world" rather than "sticker on the world." Default is false - flat - and for most avatar work you'll leave it there; the switch exists for when you want the cartoon to start behaving like a solid object.

The inputs and outputs that matter

  • BPY_OBJ - the Grease Pencil object whose lighting behavior you're setting.
  • value - boolean, default false. true makes the strokes respond to scene lights.

Output is the same BPY_OBJ, handed on to the next Blender node.

One thing worth noting: this flag only does anything if the incoming object is actually a Grease Pencil object. Point it at a regular mesh and it's a no-op - the pack's setter nodes don't check your work for you.

How to install it

Part of the Avatar Graph pack, no standalone install. ComfyUI Manager → search "Avatar Graph", or:

cd ComfyUI/custom_nodes
git clone https://github.com/avatechai/avatar-graph-comfyui
cd avatar-graph-comfyui
pip install -r requirements.txt

restart ComfyUI. The install landmine is pack-wide: bpy==3.6.0 only ships wheels for Python 3.10.x, so the pip install fails on newer Python. Dedicated python=3.10 conda env on Linux/macOS, Avatech's prebuilt Python-3.10 ComfyUI zip on Windows.

Gotchas

If you toggle it on and the strokes don't visibly change, check that (a) the object is Grease Pencil, and (b) you actually have lights in the scene - flat-lit strokes look identical with the flag on or off when there's nothing to light them. And since this pack's runtime isn't Blender's full interactive viewport, the difference may be more visible in the exported .glb/.gltf than in the ComfyUI preview.

Categoryblender

Inputs (2)

NameTypeDefaultDescription
BPY_OBJoptBPY_OBJ
valueoptBOOLEANfalse

Outputs (1)

NameTypeDescription
BPY_OBJBPY_OBJ