0
$\begingroup$

Searching through the bpy hierarchy in Blender 3.3.3 I've found that objects in Blender have shader_effects attribute. It has new() method which takes 2 arguments - name (of type string) and type (of type Shaderfx Type Items). It seems quite similar to other bpy.types.Object's classes, e.g. modifiers, constraints, material_slots etc. In those classes new() method increments the len of the class and you can access each instance by its int index or str id. But after using new() method in bpy.context.object.shader_effects nothing happens: its len remains 0 and no items are being added to the array.

The list of Shaderfx Type Items looks pretty intriguing: Blur, Colorize, Flip, Glow, Pixelate, Rim, Shadow, Swirl, Wave Distortion. But documentation doesn't tell much about where and how it is supposed to be used. Can anyone help with this?

$\endgroup$

1 Answer 1

1
$\begingroup$

Those are the visual effects used by grease pencil objects. They are under the magic wand tab when you have a grease pencil object selected.

Showing the available effect types in a menu in the visual effects panel for a grease pencil object

Manual: Grease Pencil / Visual Effects

The reason nothing happens when you used shader_effects.new is probably because you tried it on (eg) a mesh, not a grease pencil object. The same thing happens if you try to add a modifier to an empty for example.

If you want to try them, note that AFAICT the effects only show up in "Rendered" viewport shading, not in "Material Preview".

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .