Creative Coding in Blender 2.92: A Primer

Dots arranged on a distorted Fibonnaci sphere.

Configure Blender for Scripting

Read The Manual

System Console

Toggle System Console
Read error messages when a script fails to execute.

Editor Layout

Switch Editors.
The Scripting Preset.
Externally modified notice.

Visual Diagnostic Aides

Preferences
Location of Python Tooltips & Developer Extras checkboxes.
Show mesh indices.
Blender DNA.

Hotkeys

Keymap in Preferences.
Auto complete hot key.
Auto complete feature in console.

Add-Ons

Add-ons.

Python Syntax

Static Composition

Cartesian Grid

Cube Grid Version 1.

Cartesian Grid, Refactored

Cube Grid, Version 2.

Sidebar: Color

Color Management.
Blender’s Color Picker.
A SVG containing two linear gradients from blue to magenta.
In blue, x to the power of 2.2. In green, x to the power of 1.0/2.2. Graph from Desmos Graphing Calculator.
Result from turning off color management.

Spherical Grid

Sphere version 1.
Sphere version 2.

Animated Composition

The graph editor, top, and dope sheet, bottom.

A Sine Wave

Cube Sine Wave inspired by Dave Bees & Bombs via Daniel Shiffman.
Custom object properties.
Constant vs. linear extrapolation.
Output Color Depth.

Translation

Translated cubes.

Rotation

Rotation mode.
Gimbal lock illustration.

The mathutils Module

Cubes rotating with various rotation modes.

Scale

Cubes scaling according to custom interpolation methods.
The graph editor for the above three cubes.

Drivers

A cube orbiting in a circle according to drivers.
The drivers panel.
A synthesis of previous examples.

Modifiers

A shape made with array, deform, boolean and bevel modifiers.

Constraints

Rodin’s The Thinker, lit in blue and magenta area lights.
The track to constraint as it appears on the constraints stack.

Changing Geometry

A Suzanne (monkey head) mesh’s vertices are distorted.

Shape Keys

Suzanne distorted by shape keys.

Displacement With Modifiers and Textures

Texture noise Suzanne.
A cloud texture as viewed in the properties editor.

Geometry Nodes

Geometry Nodes

Materials

A shader node creating checkered patterns.
Enable Open Shading Language.

A Circle Shader

OSL circle shape.
OSL Script Node.
The Vector Transform node.

Noise Circle

Quantized color mix in linear RGB space.
Four levels. Signed quantization in blue. An unsigned alternative in red. Graph from Desmos Graphing Calculator.

Quantized CIE LAB Gradient

A linar gradient quantized at 10 levels.

Math Operations & Debugging

Blender’s Fraction Math Operation.
Testing modulo results.
Floor mod definition.
Three ping-pong methods. Graph from Desmos Graphing Calculator.
Ping-ponging colors.
Mix, Oscillate, Bounce and Zig-Zag nodes.

Closures

A voronoi surface pattern made with closures.

Grease Pencil

Flat design created with grease pencil.

Conclusion

Creative coder from Wisconsin, USA.