This contains multiple free to use add-ons for blender. Just open one of the files and download it. You can also copy-paste the code into the blender text-editor to test out the script there. Feel free to report issues or to make pull requests.
Generate a fractal structure based on Lindenmayer systems. See https://en.wikipedia.org/wiki/L-system for some examples.
Generate a 3D model based on the "Superformula", useful to create some abstract objects.
Generate a nice pattern. Adapted from Mathologer's video: https://www.youtube.com/watch?v=qhbuKbxJsk8.
A helper add-on to speed up the process of finding the best values for your current node setup. Current features:
- Generate a 2D or 3D scene for comparing values.
- Generate a sequence of images for different values of a node input socket.
An add-on to speed up adding math nodes to your node tree. You can access the menu with SHIFT + F
(with attributes) or ALT +F
(normal math nodes).
This is the syntax with which you can build your formulas:
(
and)
can be used to give precedence in the order of operations, e.g(1 + 2) * 4
evaluates to12
and not9
.- Common operators which have a special symbol can be placed in between their operands. These operators are:
> < + - * / % ^ **
, These also have a priority level. The priorities are as follows:function call
>( )
>** ^
>* / %
>+ -
>< >
- The same operators can also be used as vector math operations by prefixing it with a
v
, if the respective vector math operation is part of the vector math node. So*
becomesv*
, for example. - All other functions have to be called in the normal way present in most programming languages:
function_name(arg1, arg2, arg3)
, with the arguments separated by comma's. It is possible that the same function has multiple aliases, e.g.sine
andsin
are the same function. The arguments can be expressions themselves., e.g.sin(4 * 5)
is valid syntax. - Creating a vector is done with
{ }
, with the components separated by comma's. So the vector with components4
5
and7
would be written as{4, 5, 7}
. If a vector contains inputs that aren't floats, aCombine XYZ
node is added instead. This means that{4, 5, 7*8}
will be aCombine XYZ
node, because the final component is an expression. - In blender, it is possible to type in mathematical equations in the float fields. The special function
!()
, evaluates the expression inside the parentheses with python. The expression must be a python expression that evaluates to a number. For convenience, the pythonmath
library will be imported so common constants and mathematical functions are available. Example:sin(!(pi/4)*x)
. - The semicolon,
;
, marks the end of every statement. Although it is not strictly necessary, it's recommended to place it in between statements, so that errors can be displayed correctly. - If a function takes in a vector as an argument, but a float is given, then it is automatically converted to a vector. So
vsin(10)
is treated asvsin({10,10,10})
. =
can be used to assign/declare variables. See below for specific rules. It is also an expression, i.e.sin(x=2)
is the same asx=2; sin(x)
.
- The
let
keyword can be used to declare variables without specifying a value. For examplelet x;
, is the same asx = 2
orlet x = 2
. Declaring a variable is the same as adding an input node, with the label set to the variable name. Later uses of that variable name will connect the output of that input node to the appropriate input socket. - To create a
Separate XYZ
node with specific variable names you can use the syntaxlet {name_1,name_2,name_3} = some_name;
. The right hand side can be an expression. Otherwise.
followed by any ofx
,y
orz
, will create aSeparate XYZ
node from the result of the left hand side. Example:vfract(scale(coords, 10)).xy
. - All other kinds of variables can be assigned a value without needing to use
let
. Example:z = sin(x);
, will store the output socket of the right hand side in the variablez
, which can then be used later. - Undeclared variables will be declared automatically when used. For example, the input
let {a,b,c}= var_name;
would be treated asvar_name = 0; let {a,b,c} = var_name
.
- Unlike with normal math nodes, in this case the leftover words will be treated as input attributes.
- The operator
=
can be used to set the name of the next attribute math operation. For example:z = sin(x);
would create an attribute math node with the operation set toSINE
, the input set to the attributex
, and the result set to the attributez
. So, continuing on the previous example, if we now wanted to multiplyz
withx
we'd have to do this:z = sin(x); z*x;
or(z=sin(x))*x
. - Appending
.
followed by any ofx
,y
orz
to an attribute, will create aSeparate XYZ
node with the input set to the attribute and the resulting components set if they appeared after the.
. For exampleposition.yz
creates aSeparate XYZ
node with the input attribute set toposition
, and the outputs:Result Y
andResult Z
set toy
andz
respectively. The attribute output,Result X
, is left empty. - Like with normal math nodes,
let {x_name, y_name, z_name}
followed by a vector of three names can be used to create aSeparate XYZ
node. The three components of the vector are treated as attribute names, and not as expressions to be evaluated. Example:let { ,pos_y, pos_z} = position;
, creates attributespos_y
andpos_z
, set to they
andz
components of the attributeposition
.
position.xy; position = {x, y, x**2+y**2};
position.xy; z = x^2+y^2; position = {x, y, z};
vfract(vscale(coords, 10)) v- 0.5;
vabs(coords v- 0.5).xy; smax(x,y,0.2) < 0.2
coords.xyz; r = length({x,y,0}); theta = atan2(y,x); {r,theta,z};