Class ControlPoint#

Vertex is one of the two domains of Curve.

It uses the ‘POINT’ string domain.

Constructor#

ControlPoint(self, data_socket, selection=None)

Args:#

  • data_socket (DataSocket): the data class the domain belongs to

  • selection (any): the selection to use

Content#

Properties

ID | as_cloud_points | as_control_points | as_corners | as_edges | as_faces | as_insts | as_splines | as_verts | count | data_socket | domain | domain_index | index | left_handle_positions | normal | parameter | parameter_factor | parameter_index | parameter_length | position | radius | right_handle_positions | selection | selection_index | tangent | tilt

Class and static methods

random_boolean | random_float | random_integer | random_vector

Methods

accumulate_field | attribute_max | attribute_mean | attribute_median | attribute_min | attribute_node | attribute_range | attribute_statistic | attribute_std | attribute_sum | attribute_var | capture_attribute | curve | delete | duplicate | endpoint_selection | field_at_index | handle_positions | handle_type_selection | handle_type_selection_align | handle_type_selection_auto | handle_type_selection_free | handle_type_selection_node | handle_type_selection_vector | index_for_sample | instance_on_points | interpolate | material_selection | named_attribute | named_boolean | named_color | named_float | named_integer | named_vector | offset | proximity | remove_named_attribute | sample_index | select | separate | set_ID | set_handle_positions | set_handle_positions_left | set_handle_positions_right | set_handle_type | set_handle_type_node | set_position | set_radius | set_tilt | socket_stack | store_named_attribute | store_named_attribute_no_selection | store_named_boolean | store_named_color | store_named_float | store_named_integer | store_named_vector | view | viewer

Properties#

ID#

Returns:#

  • socket ID

Setter

Node implemented as property setter.

Args:#

  • attr_value: ID

Go to top - main - nodes - nodes menus

as_cloud_points#

Type cast to CloudPoint.

Go to top - main - nodes - nodes menus

as_control_points#

Type cast to ControlPoint.

Go to top - main - nodes - nodes menus

as_corners#

Type cast to Corner.

Go to top - main - nodes - nodes menus

as_edges#

Type cast to Edge.

Go to top - main - nodes - nodes menus

as_faces#

Type cast to Face.

Go to top - main - nodes - nodes menus

as_insts#

Type cast to Instance.

Go to top - main - nodes - nodes menus

as_splines#

Type cast to Spline.

Go to top - main - nodes - nodes menus

as_verts#

Type cast to Vertex.

Go to top - main - nodes - nodes menus

count#

Returns:#

  • socket point_count

Go to top - main - nodes - nodes menus

data_socket#

Returns the data socket it belongs to.

Returns:#

  • DataSocket

Go to top - main - nodes - nodes menus

domain#

Gives the Geometry Nodes domain string to use in the generated nodes.

  • Vertex : ‘POINT’,

  • Edge : ‘EDGE’,

  • Face : ‘FACE’,

  • Corner : ‘CORNER’,

  • ControlPoint : ‘POINT’,

  • Spline : ‘CURVE’,

  • CloudPoint : ‘POINT’,

  • Instance : ‘INSTANCE’,

Returns:#

  • domain string (str)

Go to top - main - nodes - nodes menus

domain_index#

Returns:#

  • socket index

Go to top - main - nodes - nodes menus

index#

Returns:#

  • socket index

Go to top - main - nodes - nodes menus

left_handle_positions#

Returns:#

  • socket left

Setter

Node implemented as property setter.

Args:#

  • attr_value: position

Go to top - main - nodes - nodes menus

normal#

Returns:#

  • socket normal

Go to top - main - nodes - nodes menus

parameter#

Node Image

Returns:#

  • tuple (’factor’, ‘length’, ‘index’)

Go to top - main - nodes - nodes menus

parameter_factor#

Returns:#

  • socket factor

Go to top - main - nodes - nodes menus

parameter_index#

Returns:#

  • socket index

Go to top - main - nodes - nodes menus

parameter_length#

Returns:#

  • socket length

Go to top - main - nodes - nodes menus

position#

Returns:#

  • socket position

Setter

Node implemented as property setter.

Args:#

  • attr_value: position

Go to top - main - nodes - nodes menus

radius#

Returns:#

  • socket radius

Setter

Node implemented as property setter.

Args:#

  • attr_value: radius

Go to top - main - nodes - nodes menus

right_handle_positions#

Returns:#

  • socket right

Setter

Node implemented as property setter.

Args:#

  • attr_value: position

Go to top - main - nodes - nodes menus

selection#

Returns the selection value to use in nodes with a Selection socket.

Returns:#

  • Boolean

Go to top - main - nodes - nodes menus

selection_index#

Returns the selection index.

CAUTION: raise an error if the selection is not a integer.

Returns:#

  • Integer

Go to top - main - nodes - nodes menus

tangent#

Returns:#

  • socket tangent

Go to top - main - nodes - nodes menus

tilt#

Returns:#

  • socket tilt

Setter

Node implemented as property setter.

Args:#

  • attr_value: tilt

Go to top - main - nodes - nodes menus

Class and static methods#

random_boolean#

@staticmethod
def random_boolean(probability=None, ID=None, seed=None)

Args:#

  • probability: Float

  • ID: Integer

  • seed: Integer

Returns:#

  • socket value

Go to top - main - nodes - nodes menus

random_float#

@staticmethod
def random_float(min=None, max=None, ID=None, seed=None)

Args:#

  • min: [‘Vector’, ‘Float’, ‘Integer’]

  • max: [‘Vector’, ‘Float’, ‘Integer’]

  • ID: Integer

  • seed: Integer

Returns:#

  • socket value

Go to top - main - nodes - nodes menus

random_integer#

@staticmethod
def random_integer(min=None, max=None, ID=None, seed=None)

Args:#

  • min: [‘Vector’, ‘Float’, ‘Integer’]

  • max: [‘Vector’, ‘Float’, ‘Integer’]

  • ID: Integer

  • seed: Integer

Returns:#

  • socket value

Go to top - main - nodes - nodes menus

random_vector#

@staticmethod
def random_vector(min=None, max=None, ID=None, seed=None)

Args:#

  • min: [‘Vector’, ‘Float’, ‘Integer’]

  • max: [‘Vector’, ‘Float’, ‘Integer’]

  • ID: Integer

  • seed: Integer

Returns:#

  • socket value

Go to top - main - nodes - nodes menus

Methods#

accumulate_field#

def accumulate_field(self, value=None, group_index=None)

Args:#

  • value: [‘Vector’, ‘Float’, ‘Integer’]

  • group_index: Integer

Node Image

Returns:#

  • tuple (’leading’, ‘trailing’, ‘total’)

Go to top - main - nodes - nodes menus

attribute_max#

def attribute_max(self, attribute=None)

Args:#

  • attribute: [‘Float’, ‘Vector’]

Returns:#

  • socket max

Go to top - main - nodes - nodes menus

attribute_mean#

def attribute_mean(self, attribute=None)

Args:#

  • attribute: [‘Float’, ‘Vector’]

Returns:#

  • socket mean

Go to top - main - nodes - nodes menus

attribute_median#

def attribute_median(self, attribute=None)

Args:#

  • attribute: [‘Float’, ‘Vector’]

Returns:#

  • socket median

Go to top - main - nodes - nodes menus

attribute_min#

def attribute_min(self, attribute=None)

Args:#

  • attribute: [‘Float’, ‘Vector’]

Returns:#

  • socket min

Go to top - main - nodes - nodes menus

attribute_node#

def attribute_node(self, node)

Define an input node as attribute

Called when creating an input node in a property getter. Performs two actions:

- Call the method :func:`Node.as_attribute` to tag the node as being an attribute.
  This will allow the :func:`Tree.check_attributes` to see if it is necessary to create
  a *Capture Attribute* for this field.
- Set the nde property :attr:`field_of` to self in order to implement the transfer attribute
  mechanism.

Args:#

  • node (Node): The node created by the domain

Returns:#

  • The node argument

Go to top - main - nodes - nodes menus

attribute_range#

def attribute_range(self, attribute=None)

Args:#

  • attribute: [‘Float’, ‘Vector’]

Returns:#

  • socket range

Go to top - main - nodes - nodes menus

attribute_statistic#

def attribute_statistic(self, attribute=None)

Args:#

  • attribute: [‘Float’, ‘Vector’]

Returns:#

  • node with sockets [‘mean’, ‘median’, ‘sum’, ‘min’, ‘max’, ‘range’, ‘standard_deviation’, ‘variance’]

Go to top - main - nodes - nodes menus

attribute_std#

def attribute_std(self, attribute=None)

Args:#

  • attribute: [‘Float’, ‘Vector’]

Returns:#

  • socket standard_deviation

Go to top - main - nodes - nodes menus

attribute_sum#

def attribute_sum(self, attribute=None)

Args:#

  • attribute: [‘Float’, ‘Vector’]

Returns:#

  • socket sum

Go to top - main - nodes - nodes menus

attribute_var#

def attribute_var(self, attribute=None)

Args:#

  • attribute: [‘Float’, ‘Vector’]

Returns:#

  • socket variance

Go to top - main - nodes - nodes menus

capture_attribute#

def capture_attribute(self, value=None)

Args:#

  • value: [‘Vector’, ‘Float’, ‘Color’, ‘Boolean’, ‘Integer’]

Returns:#

  • socket attribute

Go to top - main - nodes - nodes menus

curve#

def curve(self)

Node Image

Returns:#

  • tuple (’curve_index’, ‘index_in_curve’)

Go to top - main - nodes - nodes menus

delete#

def delete(self, mode='ALL')

Args:#

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

Returns:#

  • self

Go to top - main - nodes - nodes menus

duplicate#

def duplicate(self, amount=None)

Args:#

  • amount: Integer

Returns:#

  • socket duplicate_index

Go to top - main - nodes - nodes menus

endpoint_selection#

def endpoint_selection(self, start_size=None, end_size=None)

Args:#

  • start_size: Integer

  • end_size: Integer

Returns:#

  • socket selection

Go to top - main - nodes - nodes menus

field_at_index#

def field_at_index(self, index=None, value=None)

Args:#

  • index: Integer

  • value: [‘Float’, ‘Integer’, ‘Vector’, ‘Color’, ‘Boolean’]

Returns:#

  • socket value

Go to top - main - nodes - nodes menus

handle_positions#

def handle_positions(self, relative=None)

Args:#

  • relative: Boolean

Returns:#

  • node with sockets [‘left’, ‘right’]

Go to top - main - nodes - nodes menus

handle_type_selection#

def handle_type_selection(self, left=True, right=True, handle_type='AUTO')

Args:#

  • handle_type (str): ‘AUTO’ in [FREE, AUTO, VECTOR, ALIGN]

  • mode (set): {‘RIGHT’, ‘LEFT’}

Returns:#

  • node with sockets [‘selection’]

Go to top - main - nodes - nodes menus

handle_type_selection_align#

def handle_type_selection_align(self, left=True, right=True)

Args:#

  • handle_type (str): ‘AUTO’ in [FREE, AUTO, VECTOR, ALIGN]

  • mode (set): {‘RIGHT’, ‘LEFT’}

Returns:#

  • node with sockets [‘selection’]

Go to top - main - nodes - nodes menus

handle_type_selection_auto#

def handle_type_selection_auto(self, left=True, right=True)

Args:#

  • handle_type (str): ‘AUTO’ in [FREE, AUTO, VECTOR, ALIGN]

  • mode (set): {‘RIGHT’, ‘LEFT’}

Returns:#

  • node with sockets [‘selection’]

Go to top - main - nodes - nodes menus

handle_type_selection_free#

def handle_type_selection_free(self, left=True, right=True)

Args:#

  • handle_type (str): ‘AUTO’ in [FREE, AUTO, VECTOR, ALIGN]

  • mode (set): {‘RIGHT’, ‘LEFT’}

Returns:#

  • node with sockets [‘selection’]

Go to top - main - nodes - nodes menus

handle_type_selection_node#

def handle_type_selection_node(self, handle_type='AUTO', mode={'RIGHT', 'LEFT'})

Args:#

  • handle_type (str): ‘AUTO’ in [FREE, AUTO, VECTOR, ALIGN]

  • mode (set): {‘RIGHT’, ‘LEFT’}

Returns:#

  • socket selection

Go to top - main - nodes - nodes menus

handle_type_selection_vector#

def handle_type_selection_vector(self, left=True, right=True)

Args:#

  • handle_type (str): ‘AUTO’ in [FREE, AUTO, VECTOR, ALIGN]

  • mode (set): {‘RIGHT’, ‘LEFT’}

Returns:#

  • node with sockets [‘selection’]

Go to top - main - nodes - nodes menus

index_for_sample#

def index_for_sample(self, default=None)

Return default if not None or Input index socket.

The node ‘Sample Index’ has an input with default value to 0. If mehod argument is None, create a node ‘Input Index’ as input.

sample_index method is implemented:

def sample_index(self, value=None, index=None, clamp=False):
    return nodes.SampleIndex(..., index=self.index_for_sample(index), ...)

Returns:#

  • default or Input index

Go to top - main - nodes - nodes menus

instance_on_points#

def instance_on_points(self, instance=None, pick_instance=None, instance_index=None, rotation=None, scale=None)

Args:#

  • instance: Geometry

  • pick_instance: Boolean

  • instance_index: Integer

  • rotation: Vector

  • scale: Vector

Returns:#

  • socket instances of class Instances

Go to top - main - nodes - nodes menus

interpolate#

def interpolate(self, value=None)

Args:#

  • value: [‘Float’, ‘Integer’, ‘Vector’, ‘Color’, ‘Boolean’]

Returns:#

  • socket value

Go to top - main - nodes - nodes menus

material_selection#

def material_selection(self, material=None)

Args:#

  • material: Material

Returns:#

  • socket selection

Go to top - main - nodes - nodes menus

named_attribute#

def named_attribute(self, name=None, data_type='FLOAT')

Args:#

  • name: String

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

Returns:#

  • socket attribute

Go to top - main - nodes - nodes menus

named_boolean#

def named_boolean(self, name=None)

Args:#

  • name: String

Returns:#

  • socket attribute

Go to top - main - nodes - nodes menus

named_color#

def named_color(self, name=None)

Args:#

  • name: String

Returns:#

  • socket attribute

Go to top - main - nodes - nodes menus

named_float#

def named_float(self, name=None)

Args:#

  • name: String

Returns:#

  • socket attribute

Go to top - main - nodes - nodes menus

named_integer#

def named_integer(self, name=None)

Args:#

  • name: String

Returns:#

  • socket attribute

Go to top - main - nodes - nodes menus

named_vector#

def named_vector(self, name=None)

Args:#

  • name: String

Returns:#

  • socket attribute

Go to top - main - nodes - nodes menus

offset#

def offset(self, offset=None)

Args:#

  • offset: Integer

Node Image

Returns:#

  • tuple (’is_valid_offset’, ‘point_index’)

Go to top - main - nodes - nodes menus

proximity#

def proximity(self, target=None, source_position=None)

Args:#

  • target: Geometry

  • source_position: Vector

Returns:#

  • socket distance

Go to top - main - nodes - nodes menus

remove_named_attribute#

def remove_named_attribute(self, name=None)

Args:#

  • name: String

Returns:#

  • self

Go to top - main - nodes - nodes menus

sample_index#

def sample_index(self, value=None, index=None, clamp=False)

Args:#

  • value: [‘Float’, ‘Integer’, ‘Vector’, ‘Color’, ‘Boolean’]

  • index: Integer

  • clamp (bool): False

Returns:#

  • socket value

Go to top - main - nodes - nodes menus

select#

def select(self, selection)

Select the domain

If the method is called on a Domain which already has a selection, the two selections are combined:

verts = mesh.verts[10:20] # Selection of vertices from 10 to 20
v = verts.select((verts.index % 2).equal(0)) # Even indices in the previous selection

Args:#

  • selection (Boolean or Integer): The selection condition

Returns:#

  • Domain with the given selection (Domain)

If a selection is existing, the resulting selection is a logical and betwenn the two

Go to top - main - nodes - nodes menus

separate#

def separate(self)

Node Image

Returns:#

  • tuple (’selection’, ‘inverted’)

Go to top - main - nodes - nodes menus

set_ID#

def set_ID(self, ID=None)

Args:#

  • ID: Integer

Returns:#

  • self

Go to top - main - nodes - nodes menus

set_handle_positions#

def set_handle_positions(self, position=None, offset=None, mode='LEFT')

Args:#

  • position: Vector

  • offset: Vector

  • mode (str): ‘LEFT’ in [LEFT, RIGHT]

Returns:#

  • self

Go to top - main - nodes - nodes menus

set_handle_positions_left#

def set_handle_positions_left(self, position=None, offset=None)

Args:#

  • position: Vector

  • offset: Vector

Returns:#

  • self

Go to top - main - nodes - nodes menus

set_handle_positions_right#

def set_handle_positions_right(self, position=None, offset=None)

Args:#

  • position: Vector

  • offset: Vector

Returns:#

  • self

Go to top - main - nodes - nodes menus

set_handle_type#

def set_handle_type(self, left=True, right=True, handle_type='AUTO')

Args:#

  • curve: Curve

  • selection: Boolean

  • handle_type (str): ‘AUTO’ in [FREE, AUTO, VECTOR, ALIGN]

  • mode (set): {‘RIGHT’, ‘LEFT’}

Returns:#

  • node with sockets [‘curve’]

Go to top - main - nodes - nodes menus

set_handle_type_node#

def set_handle_type_node(self, handle_type='AUTO', mode={'RIGHT', 'LEFT'})

Args:#

  • handle_type (str): ‘AUTO’ in [FREE, AUTO, VECTOR, ALIGN]

  • mode (set): {‘RIGHT’, ‘LEFT’}

Returns:#

  • self

Go to top - main - nodes - nodes menus

set_position#

def set_position(self, position=None, offset=None)

Args:#

  • position: Vector

  • offset: Vector

Returns:#

  • self

Go to top - main - nodes - nodes menus

set_radius#

def set_radius(self, radius=None)

Args:#

  • radius: Float

Returns:#

  • self

Go to top - main - nodes - nodes menus

set_tilt#

def set_tilt(self, tilt=None)

Args:#

  • tilt: Float

Returns:#

  • self

Go to top - main - nodes - nodes menus

socket_stack#

def socket_stack(self, node, socket_name=None)

Make the owning socket jump to the output socket of the node passed in argumment.

Args:#

  • node (Node): The node to jump to

  • socket_name: The name of the output socket (first one if None)

Go to top - main - nodes - nodes menus

store_named_attribute#

def store_named_attribute(self, name=None, value=None, data_type=None)

Store a named attribute

If selection exists, create an intermediary cloud of points to update selectively the items.

Args:#

  • name (str): name of the attribute

  • value (any): value of the attribute

  • data_type (str): valeu data type

Returns:#

  • data socket (DataSocket)

Go to top - main - nodes - nodes menus

store_named_attribute_no_selection#

def store_named_attribute_no_selection(self, name=None, value=None)

Args:#

  • name: String

  • value: [‘Vector’, ‘Float’, ‘Color’, ‘Boolean’, ‘Integer’]

Returns:#

  • self

Go to top - main - nodes - nodes menus

store_named_boolean#

def store_named_boolean(self, name, value)

Store a named attribute of type Boolean

see store_named_attribute

Args:#

  • name (str): the attribute name

  • value (float): the value to store

Returns:#

  • Data socket (DataSocket)

Go to top - main - nodes - nodes menus

store_named_color#

def store_named_color(self, name, value)

Store a named attribute of type Color

Args:#

  • name (str): the attribute name

  • value (float): the value to store

see store_named_attribute

Returns:#

  • Data socket (DataSocket)

Go to top - main - nodes - nodes menus

store_named_float#

def store_named_float(self, name, value)

Store a named attribute of type Float

see store_named_attribute

Args:#

  • name (str): the attribute name

  • value (float): the value to store

Returns:#

  • Data socket (DataSocket)

Go to top - main - nodes - nodes menus

store_named_integer#

def store_named_integer(self, name, value)

Store a named attribute of type Integer

see store_named_attribute

Args:#

  • name (str): the attribute name

  • value (float): the value to store

Returns:#

  • Data socket (DataSocket)

Go to top - main - nodes - nodes menus

store_named_vector#

def store_named_vector(self, name, value)

Store a named attribute of type Vector

Args:#

  • name (str): the attribute name

  • value (float): the value to store

see store_named_attribute

Returns:#

  • Data socket (DataSocket)

Go to top - main - nodes - nodes menus

view#

def view(self, value=None)

Args:#

  • value: [‘Float’, ‘Vector’, ‘Color’, ‘Integer’, ‘Boolean’]

Returns:#

  • node with sockets []

Go to top - main - nodes - nodes menus

viewer#

def viewer(self, value=None)

Args:#

  • value: [‘Float’, ‘Vector’, ‘Color’, ‘Integer’, ‘Boolean’]

Returns:#

  • node with sockets []

Go to top - main - nodes - nodes menus