[Bf-committers] Blender 2.8 - the Workflow release

joe joeedh at gmail.com
Tue Jul 21 08:14:33 CEST 2015

I've used blender design concepts in three projects now; the All-Shape
WebGL modeller I demoed at SIGGRAPH a year or two back, a proprietary
product my company hired me to write, as well as, perhaps ironically, a 2D
vector graphics project of mine (https://github.com/joeedh/fairmotion).

I've put together a few notes on what I've learned:

1. Tool operators

I used Blender's tool operator system as a starting point in three large
projects.  The big change I made was making tool operators responsible for
undo.  This isn't as terrible as it sounds; most tools inherit their
handlers from parent classes.  The root tool operator class has a crude
implementation itself (it saves the entire application state), so there is
no danger of a tool "missing" undo callbacks.

2. RNA pointers

I ended up using full RNA paths instead of using something like the
PointerRNA struct.  I use RNA paths a lot; in JavaScript it's important to
avoid hanging references (it leaks memory), and RNA paths are a handy way
to store a "reference" to an object without actually referencing it.

3. Library block system

Interestingly, I found that Blender's Library block architecture is even
more suited for dynamic, garbage collected languages like JS than C.  The
kind of bugs it is designed to prevent do not produce crashes in JS; no no
no, they merely corrupt the application state in a fundamental, but
insidiously invisible manner.  Things seem perfectly fine and dandy, until
you try saving the file or executing an undo.

4. 3D manipulator objects / DAG Actors

Combining the Actor model with a DAG dependency graph is great for 3D
manipulator widgets.  It really opens a lot of cool 3D UI possibilities.
The basic idea that one has special, temporary DAG nodes, that insert
themselves into the scene in the right contexts (e.g. a move array if an
object is selected) then remove themselves when they are no longer needed
(or if they scene objects they refer to no longer exist).

5. Material Nodes

5.1 Multi channel mix node

I found this incredibly useful.  The basic idea is to have a mix node with
multiple channels, where you can add/remove/sort the channels.  It made my
shaders a lot simpler.

5.2 B-spline curve nodes

I found B-splines were much easier to work with than the normal piecewise
bezier splines.  It is a bit more complicated, since you have to compile
optimized GLSL code at runtime (de Boor's formula can be incredibly slow if
one implements it naively).

Anyway, I hope some of this is useful.


More information about the Bf-committers mailing list