builder.tree
tree
Classes
| Name | Description |
|---|---|
| DirectionalContext | Base class for directional socket contexts |
| InputInterfaceContext | |
| MaterialBuilder | |
| OutputInterfaceContext | |
| PanelContext | Context manager for grouping sockets into a panel. |
| SocketContext | |
| TreeBuilder | Builder for creating Blender node trees with a clean Python API. |
DirectionalContext
DirectionalContext(tree_builder)Base class for directional socket contexts
Attributes
| Name | Description |
|---|---|
builder |
|
interface |
|
tree |
Methods
| Name | Description |
|---|---|
| boolean | Add a Boolean socket to this input/output interface. |
| bundle | Add a Bundle socket to this input/output interface. |
| closure | Add a Closure socket to this input/output interface. |
| collection | Add a Collection socket to this input/output interface. |
| color | Add a Color socket to this input/output interface. |
| float | Add a Float socket to this input/output interface. |
| geometry | Add a Geometry socket to this input/output interface. |
| image | Add an Image socket to this input/output interface. |
| integer | Add an Integer socket to this input/output interface. |
| material | Add a Material socket to this input/output interface. |
| matrix | Add a Matrix socket to this input/output interface. |
| menu | Add a Menu socket to this input/output interface. |
| object | Add an Object socket to this input/output interface. |
| panel | Create a panel context for grouping sockets. |
| rotation | Add a Rotation socket to this input/output interface. |
| shader | Add a Shader socket to this input/output interface. |
| string | Add a String socket to this input/output interface. |
| vector | Add a Vector socket to this input/output interface. |
boolean
boolean(
name='Boolean',
default_value=False,
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
structure_type='AUTO',
layer_selection_field=False,
attribute_domain='POINT',
default_attribute=None,
is_panel_toggle=False,
)Add a Boolean socket to this input/output interface.
bundle
bundle(
name='Bundle',
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add a Bundle socket to this input/output interface.
closure
closure(
name='Closure',
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add a Closure socket to this input/output interface.
collection
collection(
name='Collection',
default_value=None,
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add a Collection socket to this input/output interface.
color
color(
name='Color',
default_value=(1.0, 1.0, 1.0, 1.0),
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
structure_type='AUTO',
attribute_domain='POINT',
default_attribute=None,
)Add a Color socket to this input/output interface.
float
float(
name='Value',
default_value=0.0,
description='',
*,
min_value=None,
max_value=None,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
structure_type='AUTO',
subtype='NONE',
attribute_domain='POINT',
default_attribute=None,
)Add a Float socket to this input/output interface.
geometry
geometry(
name='Geometry',
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add a Geometry socket to this input/output interface.
image
image(
name='Image',
default_value=None,
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add an Image socket to this input/output interface.
integer
integer(
name='Integer',
default_value=0,
description='',
*,
min_value=-2147483648,
max_value=2147483647,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
structure_type='AUTO',
default_input='VALUE',
subtype='NONE',
attribute_domain='POINT',
default_attribute=None,
)Add an Integer socket to this input/output interface.
material
material(
name='Material',
default_value=None,
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add a Material socket to this input/output interface.
matrix
matrix(
name='Matrix',
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
structure_type='AUTO',
default_input='VALUE',
attribute_domain='POINT',
default_attribute=None,
)Add a Matrix socket to this input/output interface.
object
object(
name='Object',
default_value=None,
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add an Object socket to this input/output interface.
panel
panel(name, *, default_closed=False)Create a panel context for grouping sockets.
rotation
rotation(
name='Rotation',
default_value=(0.0, 0.0, 0.0),
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
structure_type='AUTO',
attribute_domain='POINT',
default_attribute=None,
)Add a Rotation socket to this input/output interface.
shader
shader(
name='Shader',
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add a Shader socket to this input/output interface.
string
string(
name='String',
default_value='',
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
subtype='NONE',
)Add a String socket to this input/output interface.
vector
vector(
name='Vector',
default_value=(0.0, 0.0, 0.0),
description='',
*,
dimensions=3,
min_value=None,
max_value=None,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
structure_type='AUTO',
subtype='NONE',
default_attribute=None,
default_input='VALUE',
attribute_domain='POINT',
)Add a Vector socket to this input/output interface.
InputInterfaceContext
InputInterfaceContext(tree_builder)Attributes
| Name | Description |
|---|---|
builder |
|
interface |
|
tree |
Methods
| Name | Description |
|---|---|
| boolean | Add a Boolean socket to this input/output interface. |
| bundle | Add a Bundle socket to this input/output interface. |
| closure | Add a Closure socket to this input/output interface. |
| collection | Add a Collection socket to this input/output interface. |
| color | Add a Color socket to this input/output interface. |
| float | Add a Float socket to this input/output interface. |
| geometry | Add a Geometry socket to this input/output interface. |
| image | Add an Image socket to this input/output interface. |
| integer | Add an Integer socket to this input/output interface. |
| material | Add a Material socket to this input/output interface. |
| matrix | Add a Matrix socket to this input/output interface. |
| menu | Add a Menu socket to this input/output interface. |
| object | Add an Object socket to this input/output interface. |
| panel | Create a panel context for grouping sockets. |
| rotation | Add a Rotation socket to this input/output interface. |
| shader | Add a Shader socket to this input/output interface. |
| string | Add a String socket to this input/output interface. |
| vector | Add a Vector socket to this input/output interface. |
boolean
boolean(
name='Boolean',
default_value=False,
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
structure_type='AUTO',
layer_selection_field=False,
attribute_domain='POINT',
default_attribute=None,
is_panel_toggle=False,
)Add a Boolean socket to this input/output interface.
bundle
bundle(
name='Bundle',
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add a Bundle socket to this input/output interface.
closure
closure(
name='Closure',
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add a Closure socket to this input/output interface.
collection
collection(
name='Collection',
default_value=None,
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add a Collection socket to this input/output interface.
color
color(
name='Color',
default_value=(1.0, 1.0, 1.0, 1.0),
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
structure_type='AUTO',
attribute_domain='POINT',
default_attribute=None,
)Add a Color socket to this input/output interface.
float
float(
name='Value',
default_value=0.0,
description='',
*,
min_value=None,
max_value=None,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
structure_type='AUTO',
subtype='NONE',
attribute_domain='POINT',
default_attribute=None,
)Add a Float socket to this input/output interface.
geometry
geometry(
name='Geometry',
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add a Geometry socket to this input/output interface.
image
image(
name='Image',
default_value=None,
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add an Image socket to this input/output interface.
integer
integer(
name='Integer',
default_value=0,
description='',
*,
min_value=-2147483648,
max_value=2147483647,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
structure_type='AUTO',
default_input='VALUE',
subtype='NONE',
attribute_domain='POINT',
default_attribute=None,
)Add an Integer socket to this input/output interface.
material
material(
name='Material',
default_value=None,
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add a Material socket to this input/output interface.
matrix
matrix(
name='Matrix',
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
structure_type='AUTO',
default_input='VALUE',
attribute_domain='POINT',
default_attribute=None,
)Add a Matrix socket to this input/output interface.
object
object(
name='Object',
default_value=None,
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add an Object socket to this input/output interface.
panel
panel(name, *, default_closed=False)Create a panel context for grouping sockets.
rotation
rotation(
name='Rotation',
default_value=(0.0, 0.0, 0.0),
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
structure_type='AUTO',
attribute_domain='POINT',
default_attribute=None,
)Add a Rotation socket to this input/output interface.
shader
shader(
name='Shader',
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add a Shader socket to this input/output interface.
string
string(
name='String',
default_value='',
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
subtype='NONE',
)Add a String socket to this input/output interface.
vector
vector(
name='Vector',
default_value=(0.0, 0.0, 0.0),
description='',
*,
dimensions=3,
min_value=None,
max_value=None,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
structure_type='AUTO',
subtype='NONE',
default_attribute=None,
default_input='VALUE',
attribute_domain='POINT',
)Add a Vector socket to this input/output interface.
MaterialBuilder
MaterialBuilder(
name='New Material',
*,
collapse=False,
arrange='sugiyama',
fake_user=False,
ignore_visibility=False,
)Attributes
| Name | Description |
|---|---|
collapse |
|
fake_user |
|
ignore_visibility |
|
inputs |
|
material |
|
nodes |
|
outputs |
|
tree |
Methods
| Name | Description |
|---|---|
| activate_tree | Make this tree the active tree for all new node creation. |
| add | |
| arrange | |
| compositor | Create a compositor node tree. |
| deactivate_tree | Whatever tree was previously active is set to be the active one (or None if no previously active tree). |
| geometry | Create a geometry node tree. |
| link | |
| shader | Create a shader node tree. |
activate_tree
activate_tree()Make this tree the active tree for all new node creation.
add
add(name)arrange
arrange()compositor
compositor(
name='Compositor Nodes',
*,
collapse=False,
arrange='sugiyama',
fake_user=False,
)Create a compositor node tree.
deactivate_tree
deactivate_tree()Whatever tree was previously active is set to be the active one (or None if no previously active tree).
geometry
geometry(
name='Geometry Nodes',
*,
collapse=False,
arrange='sugiyama',
fake_user=False,
)Create a geometry node tree.
link
link(socket1, socket2)shader
shader(
name='Shader Nodes',
*,
collapse=False,
arrange='sugiyama',
fake_user=False,
)Create a shader node tree.
OutputInterfaceContext
OutputInterfaceContext(tree_builder)Attributes
| Name | Description |
|---|---|
builder |
|
interface |
|
tree |
Methods
| Name | Description |
|---|---|
| boolean | Add a Boolean socket to this input/output interface. |
| bundle | Add a Bundle socket to this input/output interface. |
| closure | Add a Closure socket to this input/output interface. |
| collection | Add a Collection socket to this input/output interface. |
| color | Add a Color socket to this input/output interface. |
| float | Add a Float socket to this input/output interface. |
| geometry | Add a Geometry socket to this input/output interface. |
| image | Add an Image socket to this input/output interface. |
| integer | Add an Integer socket to this input/output interface. |
| material | Add a Material socket to this input/output interface. |
| matrix | Add a Matrix socket to this input/output interface. |
| menu | Add a Menu socket to this input/output interface. |
| object | Add an Object socket to this input/output interface. |
| panel | Create a panel context for grouping sockets. |
| rotation | Add a Rotation socket to this input/output interface. |
| shader | Add a Shader socket to this input/output interface. |
| string | Add a String socket to this input/output interface. |
| vector | Add a Vector socket to this input/output interface. |
boolean
boolean(
name='Boolean',
default_value=False,
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
structure_type='AUTO',
layer_selection_field=False,
attribute_domain='POINT',
default_attribute=None,
is_panel_toggle=False,
)Add a Boolean socket to this input/output interface.
bundle
bundle(
name='Bundle',
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add a Bundle socket to this input/output interface.
closure
closure(
name='Closure',
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add a Closure socket to this input/output interface.
collection
collection(
name='Collection',
default_value=None,
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add a Collection socket to this input/output interface.
color
color(
name='Color',
default_value=(1.0, 1.0, 1.0, 1.0),
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
structure_type='AUTO',
attribute_domain='POINT',
default_attribute=None,
)Add a Color socket to this input/output interface.
float
float(
name='Value',
default_value=0.0,
description='',
*,
min_value=None,
max_value=None,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
structure_type='AUTO',
subtype='NONE',
attribute_domain='POINT',
default_attribute=None,
)Add a Float socket to this input/output interface.
geometry
geometry(
name='Geometry',
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add a Geometry socket to this input/output interface.
image
image(
name='Image',
default_value=None,
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add an Image socket to this input/output interface.
integer
integer(
name='Integer',
default_value=0,
description='',
*,
min_value=-2147483648,
max_value=2147483647,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
structure_type='AUTO',
default_input='VALUE',
subtype='NONE',
attribute_domain='POINT',
default_attribute=None,
)Add an Integer socket to this input/output interface.
material
material(
name='Material',
default_value=None,
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add a Material socket to this input/output interface.
matrix
matrix(
name='Matrix',
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
structure_type='AUTO',
default_input='VALUE',
attribute_domain='POINT',
default_attribute=None,
)Add a Matrix socket to this input/output interface.
object
object(
name='Object',
default_value=None,
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add an Object socket to this input/output interface.
panel
panel(name, *, default_closed=False)Create a panel context for grouping sockets.
rotation
rotation(
name='Rotation',
default_value=(0.0, 0.0, 0.0),
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
structure_type='AUTO',
attribute_domain='POINT',
default_attribute=None,
)Add a Rotation socket to this input/output interface.
shader
shader(
name='Shader',
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add a Shader socket to this input/output interface.
string
string(
name='String',
default_value='',
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
subtype='NONE',
)Add a String socket to this input/output interface.
vector
vector(
name='Vector',
default_value=(0.0, 0.0, 0.0),
description='',
*,
dimensions=3,
min_value=None,
max_value=None,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
structure_type='AUTO',
subtype='NONE',
default_attribute=None,
default_input='VALUE',
attribute_domain='POINT',
)Add a Vector socket to this input/output interface.
PanelContext
PanelContext(socket_context, name, *, default_closed=False)Context manager for grouping sockets into a panel.
SocketContext
SocketContext(tree_builder)Attributes
| Name | Description |
|---|---|
builder |
|
interface |
|
tree |
Methods
| Name | Description |
|---|---|
| boolean | Add a Boolean socket to this input/output interface. |
| bundle | Add a Bundle socket to this input/output interface. |
| closure | Add a Closure socket to this input/output interface. |
| collection | Add a Collection socket to this input/output interface. |
| color | Add a Color socket to this input/output interface. |
| float | Add a Float socket to this input/output interface. |
| geometry | Add a Geometry socket to this input/output interface. |
| image | Add an Image socket to this input/output interface. |
| integer | Add an Integer socket to this input/output interface. |
| material | Add a Material socket to this input/output interface. |
| matrix | Add a Matrix socket to this input/output interface. |
| menu | Add a Menu socket to this input/output interface. |
| object | Add an Object socket to this input/output interface. |
| panel | Create a panel context for grouping sockets. |
| rotation | Add a Rotation socket to this input/output interface. |
| shader | Add a Shader socket to this input/output interface. |
| string | Add a String socket to this input/output interface. |
| vector | Add a Vector socket to this input/output interface. |
boolean
boolean(
name='Boolean',
default_value=False,
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
structure_type='AUTO',
layer_selection_field=False,
attribute_domain='POINT',
default_attribute=None,
is_panel_toggle=False,
)Add a Boolean socket to this input/output interface.
bundle
bundle(
name='Bundle',
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add a Bundle socket to this input/output interface.
closure
closure(
name='Closure',
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add a Closure socket to this input/output interface.
collection
collection(
name='Collection',
default_value=None,
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add a Collection socket to this input/output interface.
color
color(
name='Color',
default_value=(1.0, 1.0, 1.0, 1.0),
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
structure_type='AUTO',
attribute_domain='POINT',
default_attribute=None,
)Add a Color socket to this input/output interface.
float
float(
name='Value',
default_value=0.0,
description='',
*,
min_value=None,
max_value=None,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
structure_type='AUTO',
subtype='NONE',
attribute_domain='POINT',
default_attribute=None,
)Add a Float socket to this input/output interface.
geometry
geometry(
name='Geometry',
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add a Geometry socket to this input/output interface.
image
image(
name='Image',
default_value=None,
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add an Image socket to this input/output interface.
integer
integer(
name='Integer',
default_value=0,
description='',
*,
min_value=-2147483648,
max_value=2147483647,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
structure_type='AUTO',
default_input='VALUE',
subtype='NONE',
attribute_domain='POINT',
default_attribute=None,
)Add an Integer socket to this input/output interface.
material
material(
name='Material',
default_value=None,
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add a Material socket to this input/output interface.
matrix
matrix(
name='Matrix',
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
structure_type='AUTO',
default_input='VALUE',
attribute_domain='POINT',
default_attribute=None,
)Add a Matrix socket to this input/output interface.
object
object(
name='Object',
default_value=None,
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add an Object socket to this input/output interface.
panel
panel(name, *, default_closed=False)Create a panel context for grouping sockets.
rotation
rotation(
name='Rotation',
default_value=(0.0, 0.0, 0.0),
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
structure_type='AUTO',
attribute_domain='POINT',
default_attribute=None,
)Add a Rotation socket to this input/output interface.
shader
shader(
name='Shader',
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
)Add a Shader socket to this input/output interface.
string
string(
name='String',
default_value='',
description='',
*,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
subtype='NONE',
)Add a String socket to this input/output interface.
vector
vector(
name='Vector',
default_value=(0.0, 0.0, 0.0),
description='',
*,
dimensions=3,
min_value=None,
max_value=None,
optional_label=False,
hide_value=False,
hide_in_modifier=False,
structure_type='AUTO',
subtype='NONE',
default_attribute=None,
default_input='VALUE',
attribute_domain='POINT',
)Add a Vector socket to this input/output interface.
TreeBuilder
TreeBuilder(
tree='Geometry Nodes',
*,
tree_type='GeometryNodeTree',
collapse=False,
arrange='sugiyama',
fake_user=False,
ignore_visibility=False,
)Builder for creating Blender node trees with a clean Python API.
Supports geometry, shader, and compositor node trees.
Attributes
| Name | Description |
|---|---|
collapse |
|
fake_user |
|
ignore_visibility |
|
inputs |
|
nodes |
|
outputs |
|
tree |
Methods
| Name | Description |
|---|---|
| activate_tree | Make this tree the active tree for all new node creation. |
| add | |
| arrange | |
| compositor | Create a compositor node tree. |
| deactivate_tree | Whatever tree was previously active is set to be the active one (or None if no previously active tree). |
| geometry | Create a geometry node tree. |
| link | |
| shader | Create a shader node tree. |
activate_tree
activate_tree()Make this tree the active tree for all new node creation.
add
add(name)arrange
arrange()compositor
compositor(
name='Compositor Nodes',
*,
collapse=False,
arrange='sugiyama',
fake_user=False,
)Create a compositor node tree.
deactivate_tree
deactivate_tree()Whatever tree was previously active is set to be the active one (or None if no previously active tree).
geometry
geometry(
name='Geometry Nodes',
*,
collapse=False,
arrange='sugiyama',
fake_user=False,
)Create a geometry node tree.
link
link(socket1, socket2)shader
shader(
name='Shader Nodes',
*,
collapse=False,
arrange='sugiyama',
fake_user=False,
)Create a shader node tree.