Instances

class Instances(socket, node=None, label=None)

Data class Instances

classmethod FromCollection(collection=None, separate_children=None, reset_children=None, transform_space='ORIGINAL')

Get the geometry from a collection

Blender reference : GeometryNodeCollectionInfo, Node ‘Collection Info’

static FromGeometries(*geometry, node_label=None, node_color=None)

Geometry node [Geometry to Instance].

Parameters
  • geometry – <m>Geometry

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Instances

Node creation

Node GeometryToInstance

Blender reference : GeometryNodeGeometryToInstance, Node ‘Geometry to Instance’

from geonodes import nodes
nodes.GeometryToInstance(*geometry, label=node_label, node_color=node_color)
classmethod Input(name=None, description='')

Create a Geometry input socket in the Group Input Node

Parameters
  • name (Optional[str]) – The socket name

  • description (str) – User tip

Returns

The Geometry data socket

Return type

Geometry

Note

This method create a new input socket in the Group Input node. To get the default input geometry, use Tree.input_geometry.

static InstanceOnPoints(points=None, selection=None, instance=None, pick_instance=None, instance_index=None, rotation=None, scale=None, node_label=None, node_color=None)

Geometry node [Instance on Points].

Parameters
  • points – Points

  • selection – Boolean

  • instance – Geometry

  • pick_instance – Boolean

  • instance_index – Integer

  • rotation – Vector

  • scale – Vector

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Instances

Node creation

Node InstanceOnPoints

Blender reference : GeometryNodeInstanceOnPoints, Node ‘Instance on Points’

from geonodes import nodes
nodes.InstanceOnPoints(points=points, selection=selection, instance=instance, pick_instance=pick_instance, instance_index=instance_index, rotation=rotation, scale=scale, label=node_label, node_color=node_color)
property bl_idname

Shortcut for self.bsocket.bl_idname

property bnode

Shortcut for self.bsocket.node

property bound_box

Geometry node [Bounding Box].

Returns

Sockets [bounding_box (Geometry), min (Vector), max (Vector)]

Node creation

Node BoundingBox

Blender reference : GeometryNodeBoundBox, Node ‘Bounding Box’

from geonodes import nodes
nodes.BoundingBox(geometry=self, label=f"{self.node_chain_label}.bound_box")
property box

Geometry node [Bounding Box].

Returns

Sockets [bounding_box (Geometry), min (Vector), max (Vector)]

Node creation

Node BoundingBox

Blender reference : GeometryNodeBoundBox, Node ‘Bounding Box’

from geonodes import nodes
nodes.BoundingBox(geometry=self, label=f"{self.node_chain_label}.box")
property box_max

Geometry node [Bounding Box].

Returns

Sockets [bounding_box (Geometry), min (Vector), max (Vector)]

Node creation

Node BoundingBox

Blender reference : GeometryNodeBoundBox, Node ‘Bounding Box’

from geonodes import nodes
nodes.BoundingBox(geometry=self, label=f"{self.node_chain_label}.box_max")
property box_min

Geometry node [Bounding Box].

Returns

Sockets [bounding_box (Geometry), min (Vector), max (Vector)]

Node creation

Node BoundingBox

Blender reference : GeometryNodeBoundBox, Node ‘Bounding Box’

from geonodes import nodes
nodes.BoundingBox(geometry=self, label=f"{self.node_chain_label}.box_min")
bsocket

The wrapped geometry node socket

capture_attribute(value=None, data_type='FLOAT', domain='POINT', node_label=None, node_color=None)

Geometry node [Capture Attribute].

Parameters
  • value – Float

  • data_type (str) – ‘FLOAT’ in [FLOAT, INT, FLOAT_VECTOR, FLOAT_COLOR, BOOLEAN]

  • domain (str) – ‘POINT’ in [POINT, EDGE, FACE, CORNER, CURVE, INSTANCE]

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Sockets [geometry (Geometry), attribute (data_type dependant)]

Node creation

Node CaptureAttribute

Blender reference : GeometryNodeCaptureAttribute, Node ‘Capture Attribute’

from geonodes import nodes
nodes.CaptureAttribute(geometry=self, value=value, data_type=data_type, domain=domain, label=node_label, node_color=node_color)
property component_OLD

Component in (‘MESH’, ‘POINTCLOUD’, ‘CURVE’, ‘INSTANCES’, ‘VOLUME’)

return ‘GEOMETRY’ if not determined

components(selection=None, domain='POINT', node_label=None, node_color=None)

Geometry node [Separate Geometry].

Parameters
  • selection – Boolean

  • domain (str) – ‘POINT’ in [POINT, EDGE, FACE, CURVE, INSTANCE]

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Sockets [selection (Geometry), inverted (Geometry)]

Node creation

Node SeparateGeometry

Blender reference : GeometryNodeSeparateGeometry, Node ‘Separate Geometry’

from geonodes import nodes
nodes.SeparateGeometry(geometry=self, selection=selection, domain=domain, label=node_label, node_color=node_color)
connected_sockets()

Returns the list of Socket instances linked to this socket.

convex_hull(node_label=None, node_color=None)

Geometry node [Convex Hull].

Parameters
  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Geometry

Node creation

Node ConvexHull

Blender reference : GeometryNodeConvexHull, Node ‘Convex Hull’

from geonodes import nodes
nodes.ConvexHull(geometry=self, label=node_label, node_color=node_color)
property curve_component

Geometry node [Separate Components].

Returns

Sockets [mesh (Mesh), point_cloud (Geometry), curve (Curve), volume (Volume), instances (Instances)]

Node creation

Node SeparateComponents

Blender reference : GeometryNodeSeparateComponents, Node ‘Separate Components’

from geonodes import nodes
nodes.SeparateComponents(geometry=self, label=f"{self.node_chain_label}.curve_component")
data_socket

Used by domain

delete_geometry(selection=None, domain='POINT', mode='ALL', node_label=None, node_color=None)

Geometry node [Delete Geometry].

Parameters
  • selection – Boolean

  • domain (str) – ‘POINT’ in [POINT, EDGE, FACE, CURVE, INSTANCE]

  • mode (str) – ‘ALL’ in [ALL, EDGE_FACE, ONLY_FACE]

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Geometry

Node creation

Node DeleteGeometry

Blender reference : GeometryNodeDeleteGeometry, Node ‘Delete Geometry’

from geonodes import nodes
nodes.DeleteGeometry(geometry=self, selection=selection, domain=domain, mode=mode, label=node_label, node_color=node_color)
static domain_data_type(value)

Returns the domain to which the socket belongs

Parameters

value (bpy.types.NodeSocket, Socket) – The socket

Returns

Domain code in [‘BOOLEAN’, ‘INT’, ‘FLOAT’, ‘FLOAT_VECTOR’, ‘FLOAT_COLOR’]

Return type

str

Correspondance table

Socket bl_idname

Domain code

NodeSocketBool

‘BOOLEAN’

NodeSocketInt

‘INT’

NodeSocketIntUnsigned

‘INT’

NodeSocketFloat

‘FLOAT’

NodeSocketFloatFactor

‘FLOAT’

NodeSocketFloatAngle

‘FLOAT’

NodeSocketFloatDistance

‘FLOAT’

NodeSocketVector

‘FLOAT_VECTOR’

NodeSocketVectorEuler

‘FLOAT_VECTOR’

NodeSocketVectorXYZ

‘FLOAT_VECTOR’

NodeSocketVectorTranslation

‘FLOAT_VECTOR’

NodeSocketColor

‘FLOAT_COLOR’

NodeSocketString

‘FLOAT_COLOR’

property domain_size

Geometry node [Domain Size].

Returns

Integer

Node creation

Node DomainSize

  • component = ‘INSTANCES’

Blender reference : GeometryNodeAttributeDomainSize, Node ‘Domain Size’

from geonodes import nodes
nodes.DomainSize(geometry=self, component='INSTANCES', label=f"{self.node_chain_label}.domain_size")
duplicate(count=10, realize=True)

Duplicate the geometry

Parameters
  • count (int) – Number of instances to create

  • realize (bool) – True to realize the instances

Returns

Instances or Geometry

The duplication is performed by instantiating the geometry along the vertices of a Mesh Line initialized with count points.

The operator * can be used to operate this method with realize = True:

curves = curve * 10

# is equivalent to

curves = curve.duplicate(10, realize=True)
duplicate_elements(selection=None, amount=None, domain='POINT', node_label=None, node_color=None)

Geometry node [Duplicate Elements].

Parameters
  • selection – Boolean

  • amount – Integer

  • domain (str) – ‘POINT’ in [POINT, EDGE, FACE, SPLINE, INSTANCE]

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Sockets [geometry (Geometry), duplicate_index (Integer)]

Node creation

Node DuplicateElements

Blender reference : GeometryNodeDuplicateElements, Node ‘Duplicate Elements’

from geonodes import nodes
nodes.DuplicateElements(geometry=self, selection=selection, amount=amount, domain=domain, label=node_label, node_color=node_color)
duplicate_instances(selection=None, amount=None, node_label=None, node_color=None)

Geometry node [Duplicate Elements].

Parameters
  • selection – Boolean

  • amount – Integer

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Sockets [geometry (Geometry), duplicate_index (Integer)]

Node creation

Node DuplicateElements

  • domain = ‘INSTANCE’

Blender reference : GeometryNodeDuplicateElements, Node ‘Duplicate Elements’

from geonodes import nodes
nodes.DuplicateElements(geometry=self, selection=selection, amount=amount, domain='INSTANCE', label=node_label, node_color=node_color)
duplicate_points(selection=None, amount=None, node_label=None, node_color=None)

Geometry node [Duplicate Elements].

Parameters
  • selection – Boolean

  • amount – Integer

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Sockets [geometry (Geometry), duplicate_index (Integer)]

Node creation

Node DuplicateElements

  • domain = ‘POINT’

Blender reference : GeometryNodeDuplicateElements, Node ‘Duplicate Elements’

from geonodes import nodes
nodes.DuplicateElements(geometry=self, selection=selection, amount=amount, domain='POINT', label=node_label, node_color=node_color)
field_of

Used by field to implement transfer attribute mechanism. This property is set to all node output sockets.

static get_bl_idname(class_name)

Get the node socket bl_idname name from the Socket class

Parameters

class_name (str) – The class name

Returns

The bl_idname associated to this class name

Return type

str

Used to create a new group input socket. Called in DataClass.Input method to determine which socket type must be created.

Note that here the class_name argument accepts additional values which correspond to sub classes:

Unsigned

Integer sub class (NodeSocketIntUnsigned)

Factor

Float sub class (NodeSocketFloatFactor)

Angle

Float sub class (NodeSocketFloatAngle)

Distance

Float sub class (NodeSocketFloatDistance)

Rotation

Vector sub class (NodeSocketVectorEuler)

xyz

Vector sub class (NodeSocketVectorXYZ)

Translation

Vector sub class (NodeSocketVectorTranslation)

These additional values allow to enter angle, distance, factor… as group input values.

get_blender_socket()

Returns the property bsocket.

Returns

self.bsocket

Return type

bpy.types.NodeSocket

static get_class_name(socket, with_sub_class=False)

Get the DataSocket class name corresponding to the socket type and name.

Parameters
  • socket – The socket to determine the class of

  • with_sub_class (bool) – Return the sub class if True

Typ socket

bpy.types.NodeSocket, Socket

Returns

The name of the class associated to the bl_idname of the socket

Return type

str

Correspondance table

NodeSocket

class name

sub class name

NodeSocketBool

‘Boolean’

NodeSocketInt

‘Integer’

NodeSocketIntUnsigned

‘Integer’

‘Unsigned’

NodeSocketFloat

‘Float’

NodeSocketFloatFactor

‘Float’

‘Factor’

NodeSocketFloatAngle

‘Float’

‘Angle’

NodeSocketFloatDistance

‘Float’

‘Distance’

NodeSocketVector

‘Vector’

NodeSocketVectorEuler

‘Vector’

‘Rotation’

NodeSocketVectorXYZ

‘Vector’

‘xyz’

NodeSocketVectorTranslation

‘Vector’

‘Translation’

NodeSocketColor

‘Color’

NodeSocketString’

‘String’

NodeSocketCollection

‘Collection’

NodeSocketImage

‘Image’

NodeSocketMaterial

‘Material’

NodeSocketObject

‘Object’

NodeSocketTexture

‘Texture’

NodeSocketGeometry

‘Geometry’

If the name of the socket is in [‘Mesh’, ‘Points’, ‘Instances’, ‘Volume’, ‘Spline’, ‘Curve’], the name is chosen as the class name.

static gives_bsocket(value)

Test if the argument provides a valid output socket.

Parameters

value (any) – The value to test

Returns

True if value is or wraps a socket

Return type

bool

Returns True if value is:

  • A Blender Geometry Node Socket

  • An instance of Socket

init_domains()

Initialize the geometry domains

To be overloaded by sub classes.

init_socket()

Complementary init

Called at the end of initialization for further operations.

property instance_count

Geometry node [Domain Size].

Returns

Integer

Node creation

Node DomainSize

  • component = ‘INSTANCES’

Blender reference : GeometryNodeAttributeDomainSize, Node ‘Domain Size’

from geonodes import nodes
nodes.DomainSize(geometry=self, component='INSTANCES', label=f"{self.node_chain_label}.instance_count")
property instances_component

Geometry node [Separate Components].

Returns

Sockets [mesh (Mesh), point_cloud (Geometry), curve (Curve), volume (Volume), instances (Instances)]

Node creation

Node SeparateComponents

Blender reference : GeometryNodeSeparateComponents, Node ‘Separate Components’

from geonodes import nodes
nodes.SeparateComponents(geometry=self, label=f"{self.node_chain_label}.instances_component")
property is_multi_input

Shortcut for self.bsocket.is_multi_output

property is_output

Shortcut for self.bsocket.is_output

static is_socket(value)

An alternative to isinstance(value, Socket)

Parameters

value (any) – The value to test

Returns

True if value is an instance of Socket

Return type

bool

static is_viewport(node_label=None, node_color=None)

Geometry node [Is Viewport].

Parameters
  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Boolean

Node creation

Node IsViewport

Blender reference : GeometryNodeIsViewport, Node ‘Is Viewport’

from geonodes import nodes
nodes.IsViewport(label=node_label, node_color=node_color)
join(*geometry, node_label=None, node_color=None)

Geometry node [Join Geometry].

Parameters
  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Geometry

Node creation

Node JoinGeometry

Blender reference : GeometryNodeJoinGeometry, Node ‘Join Geometry’

from geonodes import nodes
nodes.JoinGeometry(self, *geometry, label=node_label, node_color=node_color)

Shortcut for self.bsocket.links

merge_by_distance(selection=None, distance=None, mode='ALL', node_label=None, node_color=None)

Geometry node [Merge by Distance].

Parameters
  • selection – Boolean

  • distance – Float

  • mode (str) – ‘ALL’ in [ALL, CONNECTED]

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Geometry

Node creation

Node MergeByDistance

Blender reference : GeometryNodeMergeByDistance, Node ‘Merge by Distance’

from geonodes import nodes
nodes.MergeByDistance(geometry=self, selection=selection, distance=distance, mode=mode, label=node_label, node_color=node_color)
property mesh_component

Geometry node [Separate Components].

Returns

Sockets [mesh (Mesh), point_cloud (Geometry), curve (Curve), volume (Volume), instances (Instances)]

Node creation

Node SeparateComponents

Blender reference : GeometryNodeSeparateComponents, Node ‘Separate Components’

from geonodes import nodes
nodes.SeparateComponents(geometry=self, label=f"{self.node_chain_label}.mesh_component")
property name

Shortcut for self.bsocket.name

node

The owning node

property node_chain_label

Shortcut for self.node.chain_label

plug(*values)

Plug values in the socket (input sockets only)

Parameters

values (array of bpy.types.NodeSocket, Socket, values) – The output sockets. More than one values can be passed if the input socket is multi input.

see plug_bsocket()

static plug_bsocket(bsocket, *values)

Plug the values to the input Blender socket.

Parameters
  • bsocket (bpy.types.NodeSocket, Socket) – The input socket to plug into

  • values (array of bpy.types.NodeSocket, Socket, values) – The output sockets. More than one values can be passed if the input socket is multi input.

Warning

bsocket must be an input socket and values must be output sockets-like.

This static method is called by the DataClass method plug().

This method is the one which links an output socket of a node to the input socket of another one.

If the socket is multi input, the plug method is called once per provided value. If a value is None, nothing happens.

A not None value can be:

  • either a valid value for the socket (eg: 123 for Integer socket)

  • or an output socket of another Node

When it is a socket, it can be a Blender socket or a DataSocket

property points_component

Geometry node [Separate Components].

Returns

Sockets [mesh (Mesh), point_cloud (Geometry), curve (Curve), volume (Volume), instances (Instances)]

Node creation

Node SeparateComponents

Blender reference : GeometryNodeSeparateComponents, Node ‘Separate Components’

from geonodes import nodes
nodes.SeparateComponents(geometry=self, label=f"{self.node_chain_label}.points_component")
proximity(source_position=None, target_element='FACES', node_label=None, node_color=None)

Geometry node [Geometry Proximity].

Parameters
  • source_position – Vector

  • target_element (str) – ‘FACES’ in [POINTS, EDGES, FACES]

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Sockets [position (Vector), distance (Float)]

Node creation

Node GeometryProximity

Blender reference : GeometryNodeProximity, Node ‘Geometry Proximity’

from geonodes import nodes
nodes.GeometryProximity(target=self, source_position=source_position, target_element=target_element, label=node_label, node_color=node_color)
realize(legacy_behavior=False, node_label=None, node_color=None)

Geometry node [Realize Instances].

Parameters
  • legacy_behavior (bool) – False

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Geometry

Node creation

Node RealizeInstances

Blender reference : GeometryNodeRealizeInstances, Node ‘Realize Instances’

from geonodes import nodes
nodes.RealizeInstances(geometry=self, legacy_behavior=legacy_behavior, label=node_label, node_color=node_color)
remove_named_attribute(name=None, node_label=None, node_color=None)

Geometry node [Remove Named Attribute].

Parameters
  • name – String

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Geometry

Node creation

Node RemoveNamedAttribute

Blender reference : GeometryNodeRemoveAttribute, Node ‘Remove Named Attribute’

from geonodes import nodes
nodes.RemoveNamedAttribute(geometry=self, name=name, label=node_label, node_color=node_color)
replace_material(old=None, new=None, node_label=None, node_color=None)

Geometry node [Replace Material].

Parameters
  • old – Material

  • new – Material

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Geometry

Node creation

Node ReplaceMaterial

Blender reference : GeometryNodeReplaceMaterial, Node ‘Replace Material’

from geonodes import nodes
nodes.ReplaceMaterial(geometry=self, old=old, new=new, label=node_label, node_color=node_color)
reroute()

Reroute all output links

reset_properties()

Reset the properties

Properties such as components are cached.

After a node is called, the wrapped socket changes and this makes the cache obsolete. After a change, the cache is erased.

Example

class Vector(...):
    def __init__(self, ...):
         ...
         self.reset_properties()
         ...

     def reset_properties(self):
         super().reset_properties()
         self.separate_ = None      # Created by property self.seperate() with node SeparateXyz
rotate(selection=None, rotation=None, pivot_point=None, local_space=None, node_label=None, node_color=None)

Geometry node [Rotate Instances].

Parameters
  • selection – Boolean

  • rotation – Vector

  • pivot_point – Vector

  • local_space – Boolean

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Instances

Node creation

Node RotateInstances

Blender reference : GeometryNodeRotateInstances, Node ‘Rotate Instances’

from geonodes import nodes
nodes.RotateInstances(instances=self, selection=selection, rotation=rotation, pivot_point=pivot_point, local_space=local_space, label=node_label, node_color=node_color)
scale(selection=None, scale=None, center=None, local_space=None, node_label=None, node_color=None)

Geometry node [Scale Instances].

Parameters
  • selection – Boolean

  • scale – Vector

  • center – Vector

  • local_space – Boolean

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Instances

Node creation

Node ScaleInstances

Blender reference : GeometryNodeScaleInstances, Node ‘Scale Instances’

from geonodes import nodes
nodes.ScaleInstances(instances=self, selection=selection, scale=scale, center=center, local_space=local_space, label=node_label, node_color=node_color)
scale_elements(selection=None, scale=None, center=None, axis=None, domain='FACE', scale_mode='UNIFORM', node_label=None, node_color=None)

Geometry node [Scale Elements].

Parameters
  • selection – Boolean

  • scale – Float

  • center – Vector

  • axis – Vector

  • domain (str) – ‘FACE’ in [FACE, EDGE]

  • scale_mode (str) – ‘UNIFORM’ in [UNIFORM, SINGLE_AXIS]

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Geometry

Node creation

Node ScaleElements

Blender reference : GeometryNodeScaleElements, Node ‘Scale Elements’

from geonodes import nodes
nodes.ScaleElements(geometry=self, selection=selection, scale=scale, center=center, axis=axis, domain=domain, scale_mode=scale_mode, label=node_label, node_color=node_color)
set_ID(selection=None, ID=None, node_label=None, node_color=None)

Geometry node [Set ID].

Parameters
  • selection – Boolean

  • ID – Integer

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Geometry

Node creation

Node SetID

Blender reference : GeometryNodeSetID, Node ‘Set ID’

from geonodes import nodes
nodes.SetID(geometry=self, selection=selection, ID=ID, label=node_label, node_color=node_color)
set_material(selection=None, material=None, node_label=None, node_color=None)

Geometry node [Set Material].

Parameters
  • selection – Boolean

  • material – Material

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Geometry

Node creation

Node SetMaterial

Blender reference : GeometryNodeSetMaterial, Node ‘Set Material’

from geonodes import nodes
nodes.SetMaterial(geometry=self, selection=selection, material=material, label=node_label, node_color=node_color)
set_material_index(selection=None, material_index=None, node_label=None, node_color=None)

Geometry node [Set Material Index].

Parameters
  • selection – Boolean

  • material_index – Integer

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Geometry

Node creation

Node SetMaterialIndex

Blender reference : GeometryNodeSetMaterialIndex, Node ‘Set Material Index’

from geonodes import nodes
nodes.SetMaterialIndex(geometry=self, selection=selection, material_index=material_index, label=node_label, node_color=node_color)
set_position(selection=None, position=None, offset=None, node_label=None, node_color=None)

Geometry node [Set Position].

Parameters
  • selection – Boolean

  • position – Vector

  • offset – Vector

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Geometry

Node creation

Node SetPosition

Blender reference : GeometryNodeSetPosition, Node ‘Set Position’

from geonodes import nodes
nodes.SetPosition(geometry=self, selection=selection, position=position, offset=offset, label=node_label, node_color=node_color)
set_shade_smooth(selection=None, shade_smooth=None, node_label=None, node_color=None)

Geometry node [Set Shade Smooth].

Parameters
  • selection – Boolean

  • shade_smooth – Boolean

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Geometry

Node creation

Node SetShadeSmooth

Blender reference : GeometryNodeSetShadeSmooth, Node ‘Set Shade Smooth’

from geonodes import nodes
nodes.SetShadeSmooth(geometry=self, selection=selection, shade_smooth=shade_smooth, label=node_label, node_color=node_color)
show_handles()

Generate a mesh and cloud points to visualize the control points and handles

Returns

The geometry can be joined to the output

Return type

Geometry

Example

curve = ... # Curve initialization

visu = curve.show_handles()

tree.output_geometry = curve + visu
property socket_index

Return the index of the socket within the list of node sockets.

Depending on the _is_output_ property, the socket belongs either to node.inputs or node.outputs.

stack(node)

Change the wrapped socket

Parameters

node (Node) – The new node owning the output socket to wrap

Returns

self

Methods are implemented in two modes:

  • Creation

  • Transformation

In creation mode, the node is considered as creating new data. The result is a new instance of DataSocket.

In transformation mode, the node is considered as transforming data which is kept in the result of the method. After the method returns, the calling DataSocket instance refers to a new Blender output socket. The stack method changes the socket the instance refers to and reinitialize properties

# 1. Creation mode
#
# to_mesh method creates a new mesh from a curve.
# The curve instance refers to the same output node socket
# We need to get the result of the method in a new variable

new_mesh = curve.to_mesh(profile_curve=circle)

# 2. Transformation mode
#
# set_shade_smooth method transforms the mesh.
# After the call, the mesh instance refers to the output socket of the
# newly created node "Set Shade Smooth". There is no need to get the result
# of the method.

mesh.set_shade_smooth()

# Note that a transformation method returns self and so, the following line
# is equivallent:

mesh = mesh.set_shade_smooth()
store_named_attribute(name=None, value=None, data_type='FLOAT', domain='POINT', node_label=None, node_color=None)

Geometry node [Store Named Attribute].

Parameters
  • name – String

  • value – Float

  • data_type (str) – ‘FLOAT’ in [FLOAT, INT, FLOAT_VECTOR, FLOAT_COLOR, BYTE_COLOR, BOOLEAN]

  • domain (str) – ‘POINT’ in [POINT, EDGE, FACE, CORNER, CURVE, INSTANCE]

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Geometry

Node creation

Node StoreNamedAttribute

Blender reference : GeometryNodeStoreNamedAttribute, Node ‘Store Named Attribute’

from geonodes import nodes
nodes.StoreNamedAttribute(geometry=self, name=name, value=value, data_type=data_type, domain=domain, label=node_label, node_color=node_color)
store_named_boolean(name=None, value=None, domain='POINT', node_label=None, node_color=None)

Geometry node [Store Named Attribute].

Parameters
  • name – String

  • value – Boolean

  • domain (str) – ‘POINT’ in [POINT, EDGE, FACE, CORNER, CURVE, INSTANCE]

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Geometry

Node creation

Node StoreNamedAttribute

  • data_type = ‘BOOLEAN’

Blender reference : GeometryNodeStoreNamedAttribute, Node ‘Store Named Attribute’

from geonodes import nodes
nodes.StoreNamedAttribute(geometry=self, name=name, value=value, data_type='BOOLEAN', domain=domain, label=node_label, node_color=node_color)
store_named_byte_color(name=None, value=None, domain='POINT', node_label=None, node_color=None)

Geometry node [Store Named Attribute].

Parameters
  • name – String

  • value – Color

  • domain (str) – ‘POINT’ in [POINT, EDGE, FACE, CORNER, CURVE, INSTANCE]

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Geometry

Node creation

Node StoreNamedAttribute

  • data_type = ‘BYTE_COLOR’

Blender reference : GeometryNodeStoreNamedAttribute, Node ‘Store Named Attribute’

from geonodes import nodes
nodes.StoreNamedAttribute(geometry=self, name=name, value=value, data_type='BYTE_COLOR', domain=domain, label=node_label, node_color=node_color)
store_named_color(name=None, value=None, domain='POINT', node_label=None, node_color=None)

Geometry node [Store Named Attribute].

Parameters
  • name – String

  • value – Color

  • domain (str) – ‘POINT’ in [POINT, EDGE, FACE, CORNER, CURVE, INSTANCE]

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Geometry

Node creation

Node StoreNamedAttribute

  • data_type = ‘FLOAT_COLOR’

Blender reference : GeometryNodeStoreNamedAttribute, Node ‘Store Named Attribute’

from geonodes import nodes
nodes.StoreNamedAttribute(geometry=self, name=name, value=value, data_type='FLOAT_COLOR', domain=domain, label=node_label, node_color=node_color)
store_named_float(name=None, value=None, domain='POINT', node_label=None, node_color=None)

Geometry node [Store Named Attribute].

Parameters
  • name – String

  • value – Float

  • domain (str) – ‘POINT’ in [POINT, EDGE, FACE, CORNER, CURVE, INSTANCE]

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Geometry

Node creation

Node StoreNamedAttribute

  • data_type = ‘FLOAT’

Blender reference : GeometryNodeStoreNamedAttribute, Node ‘Store Named Attribute’

from geonodes import nodes
nodes.StoreNamedAttribute(geometry=self, name=name, value=value, data_type='FLOAT', domain=domain, label=node_label, node_color=node_color)
store_named_integer(name=None, value=None, domain='POINT', node_label=None, node_color=None)

Geometry node [Store Named Attribute].

Parameters
  • name – String

  • value – Integer

  • domain (str) – ‘POINT’ in [POINT, EDGE, FACE, CORNER, CURVE, INSTANCE]

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Geometry

Node creation

Node StoreNamedAttribute

  • data_type = ‘INT’

Blender reference : GeometryNodeStoreNamedAttribute, Node ‘Store Named Attribute’

from geonodes import nodes
nodes.StoreNamedAttribute(geometry=self, name=name, value=value, data_type='INT', domain=domain, label=node_label, node_color=node_color)
store_named_vector(name=None, value=None, domain='POINT', node_label=None, node_color=None)

Geometry node [Store Named Attribute].

Parameters
  • name – String

  • value – Vector

  • domain (str) – ‘POINT’ in [POINT, EDGE, FACE, CORNER, CURVE, INSTANCE]

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Geometry

Node creation

Node StoreNamedAttribute

  • data_type = ‘FLOAT_VECTOR’

Blender reference : GeometryNodeStoreNamedAttribute, Node ‘Store Named Attribute’

from geonodes import nodes
nodes.StoreNamedAttribute(geometry=self, name=name, value=value, data_type='FLOAT_VECTOR', domain=domain, label=node_label, node_color=node_color)
switch(switch=None, true=None, node_label=None, node_color=None)

Geometry node [Switch].

Parameters
  • switch – Boolean

  • true – Geometry

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Geometry

Node creation

Node Switch

  • input_type = ‘GEOMETRY’

Blender reference : GeometryNodeSwitch, Node ‘Switch’

from geonodes import nodes
nodes.Switch(false=self, switch=switch, true=true, input_type='GEOMETRY', label=node_label, node_color=node_color)
to_instance(*geometry, node_label=None, node_color=None)

Geometry node [Geometry to Instance].

Parameters
  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Instances

Node creation

Node GeometryToInstance

Blender reference : GeometryNodeGeometryToInstance, Node ‘Geometry to Instance’

from geonodes import nodes
nodes.GeometryToInstance(self, *geometry, label=node_label, node_color=node_color)
to_output(name=None)

Plug the data socket to the group output

Parameters

name (str) – The name to give to the modifier output

The socket is added to the outputs of the geometry nodes tree.

Note

To define a data socket as the result geometry of the tree, use tree.output_geometry = my_geometry.

to_points(selection=None, position=None, radius=None, node_label=None, node_color=None)

Geometry node [Instances to Points].

Parameters
  • selection – Boolean

  • position – Vector

  • radius – Float

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Points

Node creation

Node InstancesToPoints

Blender reference : GeometryNodeInstancesToPoints, Node ‘Instances to Points’

from geonodes import nodes
nodes.InstancesToPoints(instances=self, selection=selection, position=position, radius=radius, label=node_label, node_color=node_color)
transfer_boolean(attribute=None, source_position=None, index=None, domain='POINT', mapping='NEAREST_FACE_INTERPOLATED', node_label=None, node_color=None)

Geometry node [Transfer Attribute].

Parameters
  • attribute – Boolean

  • source_position – Vector

  • index – Integer

  • domain (str) – ‘POINT’ in [POINT, EDGE, FACE, CORNER, CURVE, INSTANCE]

  • mapping (str) – ‘NEAREST_FACE_INTERPOLATED’ in [NEAREST_FACE_INTERPOLATED, NEAREST, INDEX]

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Boolean

Node creation

Node TransferAttribute

  • data_type = ‘BOOLEAN’

Blender reference : GeometryNodeAttributeTransfer, Node ‘Transfer Attribute’

from geonodes import nodes
nodes.TransferAttribute(source=self, attribute=attribute, source_position=source_position, index=index, data_type='BOOLEAN', domain=domain, mapping=mapping, label=node_label, node_color=node_color)
transfer_color(attribute=None, source_position=None, index=None, domain='POINT', mapping='NEAREST_FACE_INTERPOLATED', node_label=None, node_color=None)

Geometry node [Transfer Attribute].

Parameters
  • attribute – Color

  • source_position – Vector

  • index – Integer

  • domain (str) – ‘POINT’ in [POINT, EDGE, FACE, CORNER, CURVE, INSTANCE]

  • mapping (str) – ‘NEAREST_FACE_INTERPOLATED’ in [NEAREST_FACE_INTERPOLATED, NEAREST, INDEX]

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Color

Node creation

Node TransferAttribute

  • data_type = ‘FLOAT_COLOR’

Blender reference : GeometryNodeAttributeTransfer, Node ‘Transfer Attribute’

from geonodes import nodes
nodes.TransferAttribute(source=self, attribute=attribute, source_position=source_position, index=index, data_type='FLOAT_COLOR', domain=domain, mapping=mapping, label=node_label, node_color=node_color)
transfer_float(attribute=None, source_position=None, index=None, domain='POINT', mapping='NEAREST_FACE_INTERPOLATED', node_label=None, node_color=None)

Geometry node [Transfer Attribute].

Parameters
  • attribute – Float

  • source_position – Vector

  • index – Integer

  • domain (str) – ‘POINT’ in [POINT, EDGE, FACE, CORNER, CURVE, INSTANCE]

  • mapping (str) – ‘NEAREST_FACE_INTERPOLATED’ in [NEAREST_FACE_INTERPOLATED, NEAREST, INDEX]

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Float

Node creation

Node TransferAttribute

  • data_type = ‘FLOAT’

Blender reference : GeometryNodeAttributeTransfer, Node ‘Transfer Attribute’

from geonodes import nodes
nodes.TransferAttribute(source=self, attribute=attribute, source_position=source_position, index=index, data_type='FLOAT', domain=domain, mapping=mapping, label=node_label, node_color=node_color)
transfer_integer(attribute=None, source_position=None, index=None, domain='POINT', mapping='NEAREST_FACE_INTERPOLATED', node_label=None, node_color=None)

Geometry node [Transfer Attribute].

Parameters
  • attribute – Integer

  • source_position – Vector

  • index – Integer

  • domain (str) – ‘POINT’ in [POINT, EDGE, FACE, CORNER, CURVE, INSTANCE]

  • mapping (str) – ‘NEAREST_FACE_INTERPOLATED’ in [NEAREST_FACE_INTERPOLATED, NEAREST, INDEX]

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Integer

Node creation

Node TransferAttribute

  • data_type = ‘INT’

Blender reference : GeometryNodeAttributeTransfer, Node ‘Transfer Attribute’

from geonodes import nodes
nodes.TransferAttribute(source=self, attribute=attribute, source_position=source_position, index=index, data_type='INT', domain=domain, mapping=mapping, label=node_label, node_color=node_color)
transfer_vector(attribute=None, source_position=None, index=None, domain='POINT', mapping='NEAREST_FACE_INTERPOLATED', node_label=None, node_color=None)

Geometry node [Transfer Attribute].

Parameters
  • attribute – Vector

  • source_position – Vector

  • index – Integer

  • domain (str) – ‘POINT’ in [POINT, EDGE, FACE, CORNER, CURVE, INSTANCE]

  • mapping (str) – ‘NEAREST_FACE_INTERPOLATED’ in [NEAREST_FACE_INTERPOLATED, NEAREST, INDEX]

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Vector

Node creation

Node TransferAttribute

  • data_type = ‘FLOAT_VECTOR’

Blender reference : GeometryNodeAttributeTransfer, Node ‘Transfer Attribute’

from geonodes import nodes
nodes.TransferAttribute(source=self, attribute=attribute, source_position=source_position, index=index, data_type='FLOAT_VECTOR', domain=domain, mapping=mapping, label=node_label, node_color=node_color)
transform(translation=None, rotation=None, scale=None, node_label=None, node_color=None)

Geometry node [Transform].

Parameters
  • translation – Vector

  • rotation – Vector

  • scale – Vector

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Geometry

Node creation

Node Transform

Blender reference : GeometryNodeTransform, Node ‘Transform’

from geonodes import nodes
nodes.Transform(geometry=self, translation=translation, rotation=rotation, scale=scale, label=node_label, node_color=node_color)
translate(selection=None, translation=None, local_space=None, node_label=None, node_color=None)

Geometry node [Translate Instances].

Parameters
  • selection – Boolean

  • translation – Vector

  • local_space – Boolean

  • node_label (str) – Node label

  • node_color (color) – Node background color

Returns

Instances

Node creation

Node TranslateInstances

Blender reference : GeometryNodeTranslateInstances, Node ‘Translate Instances’

from geonodes import nodes
nodes.TranslateInstances(instances=self, selection=selection, translation=translation, local_space=local_space, label=node_label, node_color=node_color)
view()

Link the data socket to the viewer

If the data socket is a geometry (Curve, Mesh…) it is linked to the geometry input of the viewer.

If it ias a value (Integer, Float,…) it is linked to the value socket and the viewer is configured accordingly.

property volume_component

Geometry node [Separate Components].

Returns

Sockets [mesh (Mesh), point_cloud (Geometry), curve (Curve), volume (Volume), instances (Instances)]

Node creation

Node SeparateComponents

Blender reference : GeometryNodeSeparateComponents, Node ‘Separate Components’

from geonodes import nodes
nodes.SeparateComponents(geometry=self, label=f"{self.node_chain_label}.volume_component")