Skip to content

Vector

Bases: Vector

Vector Socket.

x, y, z components can be addressed individually using their properties. The xyz property returns the triplet of the components.

A Vector can be created using a triplet or even a single float or Float.

Use methods Percentage, Factor, Translation, Direction, Velocity, Acceleration, Euler or Xyz to create input sockets with a subtype.

``` python from geonodes import GeoNodes, Mesh, Layout, Rotation, Vector, G, Float, Input, pi

with GeoNodes("Vector Test") as tree:

with Layout("Base"):
    a = Vector()
    a += Vector((1, 2, 3))
    a *= Vector(7, name="Vector")
    a = a.mix(Vector.Translation(1, name="Translate"), factor=Input("Factor", subtype="Percentage", default=.5, min=0, max=100))

with Layout("Named Attribute"):
    g = Mesh()
    g.points.The_Vector = a

    a = Vector("The Vector")
    a += G().combine_cylindrical(r=10, phi=Input("Phi", subtype="Angle"), z=3)
    g.points.The_Vector = a

with Layout("Working with components"):

    # Getting one of the components
    cx = a.x

    # Alternative to separate_xyz
    x, y, z = a.xyz

    # Building from tripler
    a += (x**2, y + cx, z-1)

a.separate_xyz().out(panel="xyz")

g.out()
```
Source code in core/sock_vector.py
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
class Vector(generated.Vector):
    """ Vector Socket.

    `x`, `y`, `z` components can be addressed individually using their properties.
    The `xyz` property returns the triplet of the components.

    A Vector can be created using a triplet or even a single float or Float.

    Use methods Percentage, Factor, Translation, Direction, Velocity, Acceleration, Euler or Xyz
    to create input sockets with a subtype.

    ``` python
    from geonodes import GeoNodes, Mesh, Layout, Rotation, Vector, G, Float, Input, pi

    with GeoNodes("Vector Test") as tree:

        with Layout("Base"):
            a = Vector()
            a += Vector((1, 2, 3))
            a *= Vector(7, name="Vector")
            a = a.mix(Vector.Translation(1, name="Translate"), factor=Input("Factor", subtype="Percentage", default=.5, min=0, max=100))

        with Layout("Named Attribute"):
            g = Mesh()
            g.points.The_Vector = a

            a = Vector("The Vector")
            a += G().combine_cylindrical(r=10, phi=Input("Phi", subtype="Angle"), z=3)
            g.points.The_Vector = a

        with Layout("Working with components"):

            # Getting one of the components
            cx = a.x

            # Alternative to separate_xyz
            x, y, z = a.xyz

            # Building from tripler
            a += (x**2, y + cx, z-1)

        a.separate_xyz().out(panel="xyz")

        g.out()
        ```    
    """

    SOCKET_TYPE = 'VECTOR'

    @classmethod
    def FromRotation(cls, rotation=None):
        """ > Constructor node <&Rotation to Euler>

        Returns
        -------
        Vector
        """
        from .sock_rotation import Rotation
        return Rotation(rotation).to_euler()

    # ====================================================================================================
    # Mix

    def mix(self, b=None, factor=None, clamp_factor=True):
        """ > Method Mix

        > [NOTE]
        > Call mix_uniform or mix_non_uniform depending on the factor type

        Information
        -----------
        - Socket 'A' : self
        - Parameter 'blend_type' : 'MIX'
        - Parameter 'clamp_result' : False
        - Parameter 'data_type' : 'VECTOR'
        - Parameter 'factor_mode' : 'UNIFORM' or 'NON_UNIFORM' depending on factor argument

        Parameters
        ----------
        b : Vector
            socket 'B' (id: B_Vector)

        factor : Float or Vector
            socket 'Factor'

        clamp_factor : bool
            parameter 'clamp_factor'


        Returns
        -------
        Vector
        """
        if utils.is_vector_like(factor):
            return self.mix_non_uniform(b, factor=factor, clamp_factor=clamp_factor)
        else:
            return self.mix_uniform(b, factor=factor, clamp_factor=clamp_factor)

    # ====================================================================================================
    # Curves

    def curves(self, fac=None, curves=None):
        """ > Node Vector Curves

        A curve is defined by a list of 3-tuples (not list):

        - x (float) : x position
        - y (float) : y position
        - handle_type (str) : handle type in ('AUTO', 'AUTO_CLAMPED', 'VECTOR'), default='AUTO'

        **Fixed values**

        | Kind      | Name        | Value   |
        | --------- | ----------- | ------- |
        | Socket    | Vector      | `self`  |

        Parameters
        ----------
        fac : Float
            socket 'Fac' (id: Fac)

        curves : list[list[tuple[float, float, str]]]
            curves points

        Returns
        -------
        Vector
        """
        node = NodeCurves('Vector Curves', named_sockets={'Vector': self, 'Fac': fac})
        node.set_curves(curves)
        return node._out

    # ====================================================================================================
    # Operations

    # ----- Neg

    def __neg__(self):
        return self.scale(-1)

    def __abs__(self):
        return self.abs()

    # ----- Addition

    def __add__(self, other):
        return self.add(other)

    def __radd__(self, other):
        return self.add(other)

    def __iadd__(self, other):
        return self._jump(self.add(other))

    # ----- Subtraction

    def __sub__(self, other):
        return self.subtract(other)

    def __rsub__(self, other):
        return Vector(other).subtract(self)

    def __isub__(self, other):
        return self._jump(self.subtract(other))

    # ----- Multiplication

    def __mul__(self, other):
        if utils.is_value_like(other):
            return self.scale(other)
        return self.multiply(other)

    def __rmul__(self, other):
        if utils.is_value_like(other):
            return self.scale(other)
        return self.multiply(other)

    def __imul__(self, other):
        if utils.is_value_like(other):
            return self._jump(self.scale(other))
        return self._jump(self.multiply(other))

    # ----- Division

    def __truediv__(self, other):
        if utils.is_value_like(other):
            return self.scale(1/other)
        return self.divide(other)

    def __rtruediv__(self, other):
        return Vector(other).divide(self)

    def __itruediv__(self, other):
        if utils.is_value_like(other):
            return self._jump(self.scale(1/other))
        return self._jump(self.divide(other))

    # ----- Modulo

    def __mod__(self, other):
        return self.modulo(other)

    def __rmod__(self, other):
        return Vector(other).modulo(self)

    def __imod__(self, other):
        return self._jump(self.modulo(other))

    # ----- Mat mul -> dot product

    def __matmul__(self, other):
        return self.dot(other)

    # ----- Power -> cross product

    def __pow__(self, other):
        return self.power(other)

    def __rpow__(self, other):
        return Vector(other).power(self)

    def __ipow__(self, other):
        return self._jump(self.power(other))

    # ----- Functions

    def __floor__(self):
        return self.floor()

    def __ceil__(self):
        return self.ceil()

    # ====================================================================================================
    # Shader

    def out(self, name=None, **props):
        """ > Plug the Vector to the group output

        !!! note

            - GeoNodes : the Vector is plugged as group output
            - ShaderNodes : if **name** argument is None, the vecteur is plugged
              into the `Displacement` socket of &Material Output,
              otherwise it is plugged to a AOV Output node.

        """
        if self._tree._btree.bl_idname == 'ShaderNodeTree' and not self._tree._is_group:
            if name is None:
                self._tree.set_displacement(self)
            else:
                self._tree.aov_output(name=name, color=self)
        else:
            super().out(name=name, **props)

    def displacement_out(self, target='ALL'):
        """ > Plug the value to 'Displacement' socket of Material Output node

        > ShaderNodes only
        """
        self._tree.set_displacement(self, target=target)


    @classmethod
    def Tangent(cls, axis='Z', direction_type='RADIAL', uv_map=''):
        """ > Node Tangent

        > ShaderNodes only

        Parameters
        ----------
        axis : str
            Node.axis in ('X', 'Y', 'Z')

        direction_type : str
            Node.direction_type in ('RADIAL', 'UV_MAP')

        uv_map : str
            Node.uv_map


        Returns
        -------
        Vector
        """
        node = Node('Tangent', axis=axis, direction_type=direction_type, uv_map=uv_map)
        return node._out

    @classmethod
    def UVMap(cls, uv_map='', from_instancer=False):
        """ > Node UV Map

        > ShaderNodes only

        Parameters
        ----------
        uv_map : str
            Node.uv_map

        from_instancer : bool
            Node.from_instancer


        Returns
        -------
        Vector
        """
        node = Node('UV Map', from_instancer=from_instancer, uv_map=uv_map)
        return node._out

    # ----- Vector

    def bump(self, strength=None, distance=None, height=None, invert=False):
        """ > Node Bump

        > ShaderNodes only

        !!! note
            Self Vector is plugged to 'Normal' socket

        Parameters
        ----------
        strength : Float
            socket 'Strength' (Strength)

        distance : Float
            socket 'Distance' (Distance)

        height : Float
            socket 'Height' (Height)

        invert : bool
            Node.invert


        Returns
        -------
        Vector
        """
        node = Node('Bump', {'Strength': strength, 'Distance': distance, 'Height': height, 'Normal': self}, invert=invert)
        return node._out

    def displacement(self, height=None, midlevel=None, scale=None, space='OBJECT'):
        """ > Node Displacement

        > ShaderNodes only

        !!! note
            Self Vector is plugged to 'Normal' socket

        Parameters
        ----------
        height : Float
            socket 'Height' (Height)

        midlevel : Float
            socket 'Midlevel' (Midlevel)

        scale : Float
            socket 'Scale' (Scale)

        space : str
            Node.space in ('OBJECT', 'WORLD')


        Returns
        -------
        Vector
        """
        node = Node('Displacement', {'Height': height, 'Midlevel': midlevel, 'Scale': scale, 'Normal': self}, space=space)
        return node._out

    def mapping(self, location=None, rotation=None, scale=None, vector_type='POINT'):
        """ > Node Mapping

        > ShaderNodes only

        Parameters
        ----------
        location : Vector
            socket 'Location' (Location)

        rotation : Vector
            socket 'Rotation' (Rotation)

        scale : Vector
            socket 'Scale' (Scale)

        vector_type : str
            Node.vector_type in ('POINT', 'TEXTURE', 'VECTOR', 'NORMAL')


        Returns
        -------
        Vector
        """
        node = Node('Mapping', {'Vector': self, 'Location': location, 'Rotation': rotation, 'Scale': scale}, vector_type=vector_type)
        return node._out

    def normal(self):
        """ > Node Normal

        > ShaderNodes only

        Returns
        -------
        Vector
        """
        node = Node('Normal', {'Normal': self})
        return node._out

    @classmethod
    def NormalMap(cls, strength=None, color=None, space='TANGENT', uv_map=''):
        """ > Constructor node Normal Map

        > ShaderNodes only

        Parameters
        ----------
        strength : Float
            socket 'Strength' (Strength)

        color : Color
            socket 'Color' (Color)

        space : str
            Node.space in ('TANGENT', 'OBJECT', 'WORLD', 'BLENDER_OBJECT', 'BLENDER_WORLD')

        uv_map : str
            Node.uv_map


        Returns
        -------
        Vector
        """
        node = Node('Normal Map', {'Strength': strength, 'Color': color}, space=space, uv_map=uv_map)
        return node._out

    def vector_displacement(self, midlevel=None, scale=None, space='TANGENT'):
        """ > Node Vector Displacement

        > ShaderNodes only

        Parameters
        ----------
        midlevel : Float
            socket 'Midlevel' (Midlevel)

        scale : Float
            socket 'Scale' (Scale)

        space : str
            Node.space in ('TANGENT', 'OBJECT', 'WORLD')


        Returns
        -------
        Vector
        """
        node = Node('Vector Displacement', {'Vector': self, 'Midlevel': midlevel, 'Scale': scale}, space=space)
        return node._out

    def transform(self, convert_from='WORLD', convert_to='OBJECT', vector_type='NORMAL'):
        """ > Node Vector Transform

        > ShaderNodes only

        Parameters
        ----------
        convert_from : str
            Node.convert_from in ('WORLD', 'OBJECT', 'CAMERA')

        convert_to : str
            Node.convert_to in ('WORLD', 'OBJECT', 'CAMERA')

        vector_type : str
            Node.vector_type in ('POINT', 'VECTOR', 'NORMAL')


        Returns
        -------
        Vector
        """
        node = Node('Vector Transform', {'Vector': self}, convert_from=convert_from, convert_to=convert_to, vector_type=vector_type)
        return node._out


    # ====================================================================================================
    # Class test    
    # ====================================================================================================

    @classmethod
    def _class_test(cls):

        from geonodes import GeoNodes, Mesh, Layout, Rotation, Vector, G, Float, Input, pi

        with GeoNodes("Vector Test") as tree:

            with Layout("Base"):
                a = Vector()
                a += Vector((1, 2, 3))
                a *= Vector(7, name="Vector")
                a = a.mix(Vector.Translation(1, name="Translate"), factor=Input("Factor", subtype="Percentage", default=.5, min=0, max=100))

            with Layout("Named Attribute"):
                g = Mesh()
                g.points.The_Vector = a

                a = Vector("The Vector")
                a += G().combine_cylindrical(r=10, phi=Input("Phi", subtype="Angle"), z=3)
                g.points.The_Vector = a

            with Layout("Working with components"):

                # Getting one of the components
                cx = a.x

                # Alternative to separate_xyz
                x, y, z = a.xyz

                # Building from tripler
                a += (x**2, y + cx, z-1)

            a.separate_xyz().out(panel="xyz")

            g.out()

_interface_socket property

Return the interface socket if exists

An interface socket exists when the socket a tree input or output socket or when it is the socket of a group

Returns:

Type Description
Interface Socket

_name property

Return the name or the label

Returns:

Type Description
str

default is ""

_panel_name property

Return the name of the panel

Returns:

Type Description
str

default is ""

is_grid property

bool property

Returns True if socket is a grid (inferred_structure_type == 'GRID').

node_color property writable

Node color

Returns:

Type Description
SysColor

node_label property writable

Node Label

Returns:

Type Description
str

x property

Node Separate XYZ

Fixed values

Kind Name Value
Socket Vector self

Returns:

Type Description
x

xyz property

Node Separate XYZ

Fixed values

Kind Name Value
Socket Vector self

Returns:

Type Description
tuple(Float, Float, Float)

y property

Node Separate XYZ

Fixed values

Kind Name Value
Socket Vector self

Returns:

Type Description
y

z property

Node Separate XYZ

Fixed values

Kind Name Value
Socket Vector self

Returns:

Type Description
z

Acceleration(value=(0, 0, 0), name='Acceleration', min=-3.40282e+38, max=3.40282e+38, tip='', panel='', optional_label=False, hide_value=False, hide_in_modifier=False, dimensions=3, default_attribute='', default_input='VALUE', shape='AUTO') classmethod

Acceleration Input

New Vector input with subtype 'ACCELERATION'.

Parameters:

Name Type Description Default
value object

Default value

`(0, 0, 0)`
name str

Input socket name

`Acceleration`
min float

Property min_value

`-3.40282e+38`
max float

Property max_value

`3.40282e+38`
tip str

Property description

`''`
panel str

Panel name

``
optional_label bool

Property optional_label

`False`
hide_value bool

Property hide_value

`False`
hide_in_modifier bool

Property hide_in_modifier

`False`
dimensions int

Property dimensions

`3`
default_attribute str

Property default_attribute_name

`''`
default_input str

Property default_input in ('VALUE', 'NORMAL', 'POSITION', 'HANDLE_LEFT', 'HANDLE_RIGHT')

`'VALUE'`
shape str

Property structure_type in ('AUTO', 'SINGLE')

`'AUTO'`

Returns:

Type Description
Vector
Source code in core/generated/vector.py
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
@classmethod
def Acceleration(cls,
    value: object = (0, 0, 0),
    name: str = 'Acceleration',
    min: float = -3.40282e+38,
    max: float = 3.40282e+38,
    tip: str = '',
    panel: str = "",
    optional_label: bool = False,
    hide_value: bool = False,
    hide_in_modifier: bool = False,
    dimensions: int = 3,
    default_attribute: str = '',
    default_input: Literal['VALUE', 'NORMAL', 'POSITION', 'HANDLE_LEFT', 'HANDLE_RIGHT'] = 'VALUE',
    shape: Literal['AUTO', 'SINGLE'] = 'AUTO',
     ):
    """ > Acceleration Input

    New Vector input with subtype 'ACCELERATION'.

    Parameters
    ----------
    value : object, default=`(0, 0, 0)`
        Default value

    name : str, default=`Acceleration`
        Input socket name

    min : float, default=`-3.40282e+38`
        Property min_value

    max : float, default=`3.40282e+38`
        Property max_value

    tip : str, default=`''`
        Property description

    panel : str, default=``
        Panel name

    optional_label : bool, default=`False`
        Property optional_label

    hide_value : bool, default=`False`
        Property hide_value

    hide_in_modifier : bool, default=`False`
        Property hide_in_modifier

    dimensions : int, default=`3`
        Property dimensions

    default_attribute : str, default=`''`
        Property default_attribute_name

    default_input : str, default=`'VALUE'`
        Property default_input in ('VALUE', 'NORMAL', 'POSITION', 'HANDLE_LEFT', 'HANDLE_RIGHT')

    shape : str, default=`'AUTO'`
        Property structure_type in ('AUTO', 'SINGLE')


    Returns
    -------
    Vector
    """
    return cls(value=value, name=name, min=min, max=max, tip=tip, panel=panel,
        optional_label=optional_label, hide_value=hide_value, hide_in_modifier=hide_in_modifier,
        dimensions=dimensions, default_attribute=default_attribute, default_input=default_input,
        shape=shape, subtype='ACCELERATION')

CombineXYZ(x=None, y=None, z=None) classmethod

Node Combine XYZ

Parameters:

Name Type Description Default
x Float

socket 'X' (id: X)

None
y Float

socket 'Y' (id: Y)

None
z Float

socket 'Z' (id: Z)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
@classmethod
def CombineXYZ(cls, x: Float = None, y: Float = None, z: Float = None):
    """ > Node Combine XYZ

    Parameters
    ----------
    x : Float, optional
        socket 'X' (id: X)

    y : Float, optional
        socket 'Y' (id: Y)

    z : Float, optional
        socket 'Z' (id: Z)


    Returns
    -------
    Vector
    """
    node = Node('Combine XYZ', {'X': x, 'Y': y, 'Z': z})
    return cls(node._out)

Constant(value, user_label='') classmethod

Create an input socket from a constant Node.

Parameters:

Name Type Description Default
value Any

constant default value default=None.

required
user_label str

socket name (used to rename nodes if not None) default="".

''
Source code in core/socket_class.py
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
@classmethod
def Constant(cls, value: None, user_label: str = ""):
    """ Create an input socket from a constant Node.

    Parameters
    ----------
    value : Any, optional
        constant default value default=None.

    user_label : str, optional
        socket name (used to rename nodes if not None) default="".

    """

    # ---------------------------------------------------------------------------
    # Ensure array
    # ---------------------------------------------------------------------------

    def get_shaped(v, *shapes):
        r = np.ravel(v)
        shape = np.shape(r)
        if shape in shapes:
            return tuple(r)

        if shape == (1,):
            return tuple(np.resize(r, shapes[0]))

        raise NodeError(
            f"The value <{v}> can't be transformed in a valid initial value for {SocketType(cls.SOCKET_TYPE).class_name}."
        )

    # ---------------------------------------------------------------------------
    # Does the array contain sockets
    # ---------------------------------------------------------------------------

    def has_sockets(a):
        for v in a:
            if SocketType.get_bsocket(v) is not None:
                return True
        return False

    # ---------------------------------------------------------------------------
    # Default value
    # ---------------------------------------------------------------------------

    socket_type = SocketType(cls.SOCKET_TYPE)
    if cls.SOCKET_TYPE not in ['RGBA', 'VECTOR', 'ROTATION', 'MATRIX']:
        def_val = socket_type.get_default_from_value(value)

    # ---------------------------------------------------------------------------
    # Depending on the socket type
    # ---------------------------------------------------------------------------

    if cls.SOCKET_TYPE == 'BOOLEAN':
        return Node('Boolean', boolean=def_val)._out._ul(user_label)

    elif cls.SOCKET_TYPE == 'BUNDLE':
        return Node("Combine Bundle")._out._ul(user_label)

    elif cls.SOCKET_TYPE == 'CLOSURE':
        socket = ZoneNode.Closure().closure
        socket._use_layout = False
        return socket._ul(user_label)

    elif cls.SOCKET_TYPE == 'COLLECTION':
        return Node('Collection', collection=def_val)._out._ul(user_label)

    elif cls.SOCKET_TYPE == 'RGBA':

        if value is None:
            a = (0, 0, 0, 1)
        elif isinstance(value, str):
            #a = colors.to_color(value)
            a = SysColor(value).rgba
        else:
            a = get_shaped(value, (4,), (3,))

        if has_sockets(a):
            if Tree.is_geonodes():
                node = Node('Combine Color', {0: a[0], 1: a[1], 2:a[2]})
                if len(a) == 4:
                    node.alpha = a[3]
                return node._out._ul(user_label)
            else:
                return Node('Combine Color', {0: a[0], 1: a[1], 2:a[2]})._out._ul(user_label)

        else:
            def_val = SocketType('COLOR').get_default_from_value(a)
            if Tree.is_geonodes():
                return Node('Color', value=def_val)._out._ul(user_label)

            else:
                socket = Node('Color')._out
                socket._bsocket.default_value = def_val
                return socket._ul(user_label)

    elif cls.SOCKET_TYPE == 'IMAGE':
        return Node('Image', image=def_val)._out._ul(user_label)

    elif cls.SOCKET_TYPE == 'INT':
        return Node('Integer', integer=def_val)._out._ul(user_label)

    elif cls.SOCKET_TYPE == 'MATERIAL':
        return Node('Material', material=def_val)._out._ul(user_label)

    elif cls.SOCKET_TYPE == 'MATRIX':

        if value is None:
            a = (1, 0, 0, 0,   0, 1, 0, 0,   0, 0, 1, 0,   0, 0, 0, 1)
        else:
            a = get_shaped(value, (16,))

        return Node('Combine Matrix', named_sockets = {i: a[i] for i in range(16)})._out._ul(user_label)

    elif cls.SOCKET_TYPE == 'MENU':
        return Node('Menu Switch')._out._ul(user_label)

    elif cls.SOCKET_TYPE == 'OBJECT':
        return Node('Object', object=def_val)._out._ul(user_label)

    elif cls.SOCKET_TYPE == 'FONT':
        return cls.NewInput("Font", value)

    elif cls.SOCKET_TYPE == 'ROTATION':

        if value is None:
            a = (0, 0, 0)
        else:
            a = get_shaped(value, (3,))

        if has_sockets(a):
            return Node('Combine XYZ', x=a[0], y=a[1], z=a[2])._out.to_rotation()._ul(user_label)
        else:
            return Node('Rotation', rotation_euler=a)._out._ul(user_label)

    elif cls.SOCKET_TYPE == 'STRING':
        return Node('String', string=def_val)._out._ul(user_label)

    elif cls.SOCKET_TYPE == 'VALUE':
        node = Node('Value')
        node._bnode.outputs[0].default_value = def_val
        return node._out._ul(user_label)

    elif cls.SOCKET_TYPE == 'VECTOR':

        if value is None:
            a = (0, 0, 0)
        else:
            a = get_shaped(value, (3,))

        if has_sockets(a):
            return Node('Combine XYZ', x=a[0], y=a[1], z=a[2])._out._ul(user_label)
        else:
            return Node('Vector', vector=a)._out._ul(user_label)

    elif cls.SOCKET_TYPE == 'GEOMETRY':
        raise NodeError(f"There is no node to create a Geometry. Use explicit constructors such as 'Mesh.Cube()', 'Curve.Spiral()' or 'Cloud.Points().")

    else:
        assert False, f"Shouldn't happen {socket_type}"

Direction(value=(0, 0, 0), name='Direction', min=-3.40282e+38, max=3.40282e+38, tip='', panel='', optional_label=False, hide_value=False, hide_in_modifier=False, dimensions=3, default_attribute='', default_input='VALUE', shape='AUTO') classmethod

Direction Input

New Vector input with subtype 'DIRECTION'.

Parameters:

Name Type Description Default
value object

Default value

`(0, 0, 0)`
name str

Input socket name

`Direction`
min float

Property min_value

`-3.40282e+38`
max float

Property max_value

`3.40282e+38`
tip str

Property description

`''`
panel str

Panel name

``
optional_label bool

Property optional_label

`False`
hide_value bool

Property hide_value

`False`
hide_in_modifier bool

Property hide_in_modifier

`False`
dimensions int

Property dimensions

`3`
default_attribute str

Property default_attribute_name

`''`
default_input str

Property default_input in ('VALUE', 'NORMAL', 'POSITION', 'HANDLE_LEFT', 'HANDLE_RIGHT')

`'VALUE'`
shape str

Property structure_type in ('AUTO', 'SINGLE')

`'AUTO'`

Returns:

Type Description
Vector
Source code in core/generated/vector.py
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
@classmethod
def Direction(cls,
    value: object = (0, 0, 0),
    name: str = 'Direction',
    min: float = -3.40282e+38,
    max: float = 3.40282e+38,
    tip: str = '',
    panel: str = "",
    optional_label: bool = False,
    hide_value: bool = False,
    hide_in_modifier: bool = False,
    dimensions: int = 3,
    default_attribute: str = '',
    default_input: Literal['VALUE', 'NORMAL', 'POSITION', 'HANDLE_LEFT', 'HANDLE_RIGHT'] = 'VALUE',
    shape: Literal['AUTO', 'SINGLE'] = 'AUTO',
     ):
    """ > Direction Input

    New Vector input with subtype 'DIRECTION'.

    Parameters
    ----------
    value : object, default=`(0, 0, 0)`
        Default value

    name : str, default=`Direction`
        Input socket name

    min : float, default=`-3.40282e+38`
        Property min_value

    max : float, default=`3.40282e+38`
        Property max_value

    tip : str, default=`''`
        Property description

    panel : str, default=``
        Panel name

    optional_label : bool, default=`False`
        Property optional_label

    hide_value : bool, default=`False`
        Property hide_value

    hide_in_modifier : bool, default=`False`
        Property hide_in_modifier

    dimensions : int, default=`3`
        Property dimensions

    default_attribute : str, default=`''`
        Property default_attribute_name

    default_input : str, default=`'VALUE'`
        Property default_input in ('VALUE', 'NORMAL', 'POSITION', 'HANDLE_LEFT', 'HANDLE_RIGHT')

    shape : str, default=`'AUTO'`
        Property structure_type in ('AUTO', 'SINGLE')


    Returns
    -------
    Vector
    """
    return cls(value=value, name=name, min=min, max=max, tip=tip, panel=panel,
        optional_label=optional_label, hide_value=hide_value, hide_in_modifier=hide_in_modifier,
        dimensions=dimensions, default_attribute=default_attribute, default_input=default_input,
        shape=shape, subtype='DIRECTION')

Empty(value=None) classmethod

Create an empty socket.

An empty socket is used temporarily as an input for nodes with dynamic sockets:

Parameters:

Name Type Description Default
value Any

default value default=None.

None
Source code in core/socket_class.py
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
@classmethod
def Empty(cls, value = None):
    """ Create an empty socket.

    An empty socket is used temporarily as an input for nodes with dynamic sockets:

    Parameters
    ----------
    value : Any, optional
        default value default=None.

    """
    socket = cls(constants.EMPTY_SOCKET)
    socket._bsocket = SocketType(cls.SOCKET_TYPE).get_default_from_value(value)
    return socket

Euler(value=(0, 0, 0), name='Euler', min=-3.40282e+38, max=3.40282e+38, tip='', panel='', optional_label=False, hide_value=False, hide_in_modifier=False, dimensions=3, default_attribute='', default_input='VALUE', shape='AUTO') classmethod

Euler Input

New Vector input with subtype 'EULER'.

Parameters:

Name Type Description Default
value object

Default value

`(0, 0, 0)`
name str

Input socket name

`Euler`
min float

Property min_value

`-3.40282e+38`
max float

Property max_value

`3.40282e+38`
tip str

Property description

`''`
panel str

Panel name

``
optional_label bool

Property optional_label

`False`
hide_value bool

Property hide_value

`False`
hide_in_modifier bool

Property hide_in_modifier

`False`
dimensions int

Property dimensions

`3`
default_attribute str

Property default_attribute_name

`''`
default_input str

Property default_input in ('VALUE', 'NORMAL', 'POSITION', 'HANDLE_LEFT', 'HANDLE_RIGHT')

`'VALUE'`
shape str

Property structure_type in ('AUTO', 'SINGLE')

`'AUTO'`

Returns:

Type Description
Vector
Source code in core/generated/vector.py
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
@classmethod
def Euler(cls,
    value: object = (0, 0, 0),
    name: str = 'Euler',
    min: float = -3.40282e+38,
    max: float = 3.40282e+38,
    tip: str = '',
    panel: str = "",
    optional_label: bool = False,
    hide_value: bool = False,
    hide_in_modifier: bool = False,
    dimensions: int = 3,
    default_attribute: str = '',
    default_input: Literal['VALUE', 'NORMAL', 'POSITION', 'HANDLE_LEFT', 'HANDLE_RIGHT'] = 'VALUE',
    shape: Literal['AUTO', 'SINGLE'] = 'AUTO',
     ):
    """ > Euler Input

    New Vector input with subtype 'EULER'.

    Parameters
    ----------
    value : object, default=`(0, 0, 0)`
        Default value

    name : str, default=`Euler`
        Input socket name

    min : float, default=`-3.40282e+38`
        Property min_value

    max : float, default=`3.40282e+38`
        Property max_value

    tip : str, default=`''`
        Property description

    panel : str, default=``
        Panel name

    optional_label : bool, default=`False`
        Property optional_label

    hide_value : bool, default=`False`
        Property hide_value

    hide_in_modifier : bool, default=`False`
        Property hide_in_modifier

    dimensions : int, default=`3`
        Property dimensions

    default_attribute : str, default=`''`
        Property default_attribute_name

    default_input : str, default=`'VALUE'`
        Property default_input in ('VALUE', 'NORMAL', 'POSITION', 'HANDLE_LEFT', 'HANDLE_RIGHT')

    shape : str, default=`'AUTO'`
        Property structure_type in ('AUTO', 'SINGLE')


    Returns
    -------
    Vector
    """
    return cls(value=value, name=name, min=min, max=max, tip=tip, panel=panel,
        optional_label=optional_label, hide_value=hide_value, hide_in_modifier=hide_in_modifier,
        dimensions=dimensions, default_attribute=default_attribute, default_input=default_input,
        shape=shape, subtype='EULER')

Factor(value=(0, 0, 0), name='Factor', min=-3.40282e+38, max=3.40282e+38, tip='', panel='', optional_label=False, hide_value=False, hide_in_modifier=False, dimensions=3, default_attribute='', default_input='VALUE', shape='AUTO') classmethod

Factor Input

New Vector input with subtype 'FACTOR'.

Parameters:

Name Type Description Default
value object

Default value

`(0, 0, 0)`
name str

Input socket name

`Factor`
min float

Property min_value

`-3.40282e+38`
max float

Property max_value

`3.40282e+38`
tip str

Property description

`''`
panel str

Panel name

``
optional_label bool

Property optional_label

`False`
hide_value bool

Property hide_value

`False`
hide_in_modifier bool

Property hide_in_modifier

`False`
dimensions int

Property dimensions

`3`
default_attribute str

Property default_attribute_name

`''`
default_input str

Property default_input in ('VALUE', 'NORMAL', 'POSITION', 'HANDLE_LEFT', 'HANDLE_RIGHT')

`'VALUE'`
shape str

Property structure_type in ('AUTO', 'SINGLE')

`'AUTO'`

Returns:

Type Description
Vector
Source code in core/generated/vector.py
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
@classmethod
def Factor(cls,
    value: object = (0, 0, 0),
    name: str = 'Factor',
    min: float = -3.40282e+38,
    max: float = 3.40282e+38,
    tip: str = '',
    panel: str = "",
    optional_label: bool = False,
    hide_value: bool = False,
    hide_in_modifier: bool = False,
    dimensions: int = 3,
    default_attribute: str = '',
    default_input: Literal['VALUE', 'NORMAL', 'POSITION', 'HANDLE_LEFT', 'HANDLE_RIGHT'] = 'VALUE',
    shape: Literal['AUTO', 'SINGLE'] = 'AUTO',
     ):
    """ > Factor Input

    New Vector input with subtype 'FACTOR'.

    Parameters
    ----------
    value : object, default=`(0, 0, 0)`
        Default value

    name : str, default=`Factor`
        Input socket name

    min : float, default=`-3.40282e+38`
        Property min_value

    max : float, default=`3.40282e+38`
        Property max_value

    tip : str, default=`''`
        Property description

    panel : str, default=``
        Panel name

    optional_label : bool, default=`False`
        Property optional_label

    hide_value : bool, default=`False`
        Property hide_value

    hide_in_modifier : bool, default=`False`
        Property hide_in_modifier

    dimensions : int, default=`3`
        Property dimensions

    default_attribute : str, default=`''`
        Property default_attribute_name

    default_input : str, default=`'VALUE'`
        Property default_input in ('VALUE', 'NORMAL', 'POSITION', 'HANDLE_LEFT', 'HANDLE_RIGHT')

    shape : str, default=`'AUTO'`
        Property structure_type in ('AUTO', 'SINGLE')


    Returns
    -------
    Vector
    """
    return cls(value=value, name=name, min=min, max=max, tip=tip, panel=panel,
        optional_label=optional_label, hide_value=hide_value, hide_in_modifier=hide_in_modifier,
        dimensions=dimensions, default_attribute=default_attribute, default_input=default_input,
        shape=shape, subtype='FACTOR')

FromRotation(rotation=None) classmethod

Constructor node <&Rotation to Euler>

Returns:

Type Description
Vector
Source code in core/sock_vector.py
 99
100
101
102
103
104
105
106
107
108
@classmethod
def FromRotation(cls, rotation=None):
    """ > Constructor node <&Rotation to Euler>

    Returns
    -------
    Vector
    """
    from .sock_rotation import Rotation
    return Rotation(rotation).to_euler()

IndexSwitch(*values, index=None, default_index=0) classmethod

Node Index Switch

with GeoNodes("IndexSwitch demo"):

    # Create some geometries
    geo    = Geometry()
    cube   = Mesh.Cube()
    sphere = Mesh.IcoSphere()
    cone   = Mesh.Cone()

    # Pick in this list
    pick_geo = Geometry.IndexSwitch(geo, cube, sphere, cone, index=tree.new_input("Geometry index", default_value=2))

    # Plug the result to the output
    pick_geo.out()

Parameters:

Name Type Description Default
*values Any

List of Sockets to select into

()
index Integer

socket 'Index' (Index) default=None.

None
default_index int

default idex default=0.

0

Returns:

Type Description
Socket
Source code in core/socket_class.py
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
@classmethod
def IndexSwitch(cls, *values, index = None, default_index: int = 0):
    """ > Node Index Switch

    ``` python
    with GeoNodes("IndexSwitch demo"):

        # Create some geometries
        geo    = Geometry()
        cube   = Mesh.Cube()
        sphere = Mesh.IcoSphere()
        cone   = Mesh.Cone()

        # Pick in this list
        pick_geo = Geometry.IndexSwitch(geo, cube, sphere, cone, index=tree.new_input("Geometry index", default_value=2))

        # Plug the result to the output
        pick_geo.out()
    ```

    Parameters
    ----------
    *values : Any
        List of Sockets to select into

    index : Integer, optional
        socket 'Index' (Index) default=None.

    default_index : int, optional
        default idex default=0.


    Returns
    -------
    Socket
    """
    #return IndexSwitchNode(*values, index=index, data_type=cls.input_type())._out
    return MenuNode('Index Switch', 
                    {str(i): value for i, value in enumerate(values)}, 
                    data_type=cls.SOCKET_TYPE, 
                    Index=index,
                    default_menu = default_index)._out

Input(name, panel='', halt=True) classmethod

Get an exist input socket from its name and panel.

Note

The "input" socket here is an "output" socket of the current input node

To create a input socket use NewInput.

If the 'name' argument is None, the first socket of the proper type is returned.

Raises:

Type Description
- NodeError if socket is not found and halt is requested

Parameters:

Name Type Description Default
name str | None

socket name

required
panel str

panel name default="".

''
halt bool

raises an error if not found default=True.

True

Returns:

Type Description
Socket
Source code in core/socket_class.py
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
@classmethod
def Input(cls, name: str, panel: str = "", halt: bool = True):
    """ Get an exist input socket from its name and panel.

    !!! note
        The "input" socket here is an "output" socket of the current input node

    To create a input socket use NewInput.

    If the 'name' argument is None, the first socket of the proper type is returned.

    Raises
    ------
    - NodeError if socket is not found and halt is requested

    Parameters
    ----------
    name : str | None
        socket name

    panel : str, optional
        panel name default="".

    halt : bool, optional
        raises an error if not found default=True.


    Returns
    -------
    Socket
    """
    in_node = Tree.current_tree().get_input_node()

    include = None if name is None else [name]
    bsockets = in_node.get_sockets('OUTPUT', include=include, panel=panel)

    for _, bsock in bsockets:
        if SocketType(bsock).type == cls.SOCKET_TYPE: # and utils.snake_case(sock_name) == utils.snake_case(name):
            return cls(bsock._bsocket)._ul(name)

    if halt:
        sname = "" if name is None else f" named '{name}'"
        raise NodeError(
            f"There is no {SocketType(cls.SOCKET_TYPE).class_name} input socket{sname}.\n"
            f"Available sockets are : {[bsock[0] for bsock in in_node.get_sockets('OUTPUT')]}.")

    return None

MenuSwitch(named_sockets={}, default_menu=None, **sockets) classmethod

Node Menu Switch

The items of the Menu Switch node are provided in the 'items' dict.

Parameters:

Name Type Description Default
named_sockets dict

sockets to create default={}.

{}
default_menu str

default menu value default=None.

None
sockets dict

items

{}

Returns:

Type Description
Socket
Source code in core/socket_class.py
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
@classmethod
def MenuSwitch(cls, 
               named_sockets    : dict = {},
               default_menu     : str = None,
               **sockets):
    """ > Node Menu Switch

    The items of the Menu Switch node are provided in the 'items' dict.

    Parameters
    ----------
    named_sockets : dict, optional
        sockets to create default={}.

    default_menu : str, optional
        default menu value default=None.

    sockets : dict
        items


    Returns
    -------
    Socket
    """
    node = MenuNode('Menu Switch',
            named_sockets = named_sockets,
            data_type = SocketType(cls.SOCKET_TYPE).type,
            default_menu = default_menu,
            **sockets)

    return cls(node._out)

Named(name=None) classmethod

Node Named Attribute

Fixed values

Kind Name Value
Parameter data_type 'FLOAT_VECTOR'

Parameters:

Name Type Description Default
name String

socket 'Name' (id: Name)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
@classmethod
def Named(cls, name: String = None):
    """ > Node Named Attribute

    **Fixed values**

    | Kind      | Name        | Value            |
    | --------- | ----------- | ---------------- |
    | Parameter | `data_type` | `'FLOAT_VECTOR'` |

    Parameters
    ----------
    name : String, optional
        socket 'Name' (id: Name)


    Returns
    -------
    Vector
    """
    node = Node('Named Attribute', {'Name': name}, data_type='FLOAT_VECTOR')
    return cls(node._out)

NamedAttribute(name=None) classmethod

Node Named Attribute

Fixed values

Kind Name Value
Parameter data_type 'FLOAT_VECTOR'

Parameters:

Name Type Description Default
name String

socket 'Name' (id: Name)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
@classmethod
def NamedAttribute(cls, name: String = None):
    """ > Node Named Attribute

    **Fixed values**

    | Kind      | Name        | Value            |
    | --------- | ----------- | ---------------- |
    | Parameter | `data_type` | `'FLOAT_VECTOR'` |

    Parameters
    ----------
    name : String, optional
        socket 'Name' (id: Name)


    Returns
    -------
    Vector
    """
    node = Node('Named Attribute', {'Name': name}, data_type='FLOAT_VECTOR')
    return cls(node._out)

NewInput(name, value=None, tip='', panel='', **props) classmethod

Create an new input socket

Note

The "input" socket here is an "output" socket of the current input node

To get an existing input socket use Input.

Raises:

Type Description
- NodeError if socket is not found

Parameters:

Name Type Description Default
name str

socket name

required
value Any

default_value default=None.

None
tip str

description default="".

''
panel str: None

panel name

''

Returns:

Type Description
Socket
Source code in core/socket_class.py
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
@classmethod
def NewInput(cls,
        name: str, 
        value       = None, 
        tip: str    = "", 
        panel: str  = "", 
        **props):
    """ Create an new input socket

    !!! note
        The "input" socket here is an "output" socket of the current input node

    To get an existing input socket use Input.

    Raises
    ------
    - NodeError if socket is not found

    Parameters
    ----------
    name : str
        socket name

    value : Any, optional
        default_value default=None.

    tip : str, optional
        description default="".

    panel : str: None
        panel name


    Returns
    -------
    Socket
    """
    if value is None:
        defval = None
    else:
        defval = SocketType(cls.SOCKET_TYPE).get_default_from_value(value)
        new_props = {**props}

        if 'default' in new_props:
            new_props['default'] = defval

        elif 'default_value' in new_props:
            new_props['default_value'] = defval

        else:
            if 'default' not in constants.SOCKETS[cls.SOCKET_TYPE]['props']:
                raise NodeError(f"The {SocketType(cls.SOCKET_TYPE).class_name} socket doesn't accept a default value. Value argument <{value}> is invalid.")

            new_props['default_value'] = defval

        props = new_props

    return cls(Tree.current_tree().create_input_socket(
        SocketType(cls.SOCKET_TYPE).socket_id,
        name         = name,
        tip          = tip,
        panel        = panel,
        **props))

NormalMap(strength=None, color=None, space='TANGENT', uv_map='') classmethod

Constructor node Normal Map

ShaderNodes only

Parameters:

Name Type Description Default
strength Float

socket 'Strength' (Strength)

None
color Color

socket 'Color' (Color)

None
space str

Node.space in ('TANGENT', 'OBJECT', 'WORLD', 'BLENDER_OBJECT', 'BLENDER_WORLD')

'TANGENT'
uv_map str

Node.uv_map

''

Returns:

Type Description
Vector
Source code in core/sock_vector.py
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
@classmethod
def NormalMap(cls, strength=None, color=None, space='TANGENT', uv_map=''):
    """ > Constructor node Normal Map

    > ShaderNodes only

    Parameters
    ----------
    strength : Float
        socket 'Strength' (Strength)

    color : Color
        socket 'Color' (Color)

    space : str
        Node.space in ('TANGENT', 'OBJECT', 'WORLD', 'BLENDER_OBJECT', 'BLENDER_WORLD')

    uv_map : str
        Node.uv_map


    Returns
    -------
    Vector
    """
    node = Node('Normal Map', {'Strength': strength, 'Color': color}, space=space, uv_map=uv_map)
    return node._out

Percentage(value=(0, 0, 0), name='Percentage', min=-3.40282e+38, max=3.40282e+38, tip='', panel='', optional_label=False, hide_value=False, hide_in_modifier=False, dimensions=3, default_attribute='', default_input='VALUE', shape='AUTO') classmethod

Percentage Input

New Vector input with subtype 'PERCENTAGE'.

Parameters:

Name Type Description Default
value object

Default value

`(0, 0, 0)`
name str

Input socket name

`Percentage`
min float

Property min_value

`-3.40282e+38`
max float

Property max_value

`3.40282e+38`
tip str

Property description

`''`
panel str

Panel name

``
optional_label bool

Property optional_label

`False`
hide_value bool

Property hide_value

`False`
hide_in_modifier bool

Property hide_in_modifier

`False`
dimensions int

Property dimensions

`3`
default_attribute str

Property default_attribute_name

`''`
default_input str

Property default_input in ('VALUE', 'NORMAL', 'POSITION', 'HANDLE_LEFT', 'HANDLE_RIGHT')

`'VALUE'`
shape str

Property structure_type in ('AUTO', 'SINGLE')

`'AUTO'`

Returns:

Type Description
Vector
Source code in core/generated/vector.py
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
@classmethod
def Percentage(cls,
    value: object = (0, 0, 0),
    name: str = 'Percentage',
    min: float = -3.40282e+38,
    max: float = 3.40282e+38,
    tip: str = '',
    panel: str = "",
    optional_label: bool = False,
    hide_value: bool = False,
    hide_in_modifier: bool = False,
    dimensions: int = 3,
    default_attribute: str = '',
    default_input: Literal['VALUE', 'NORMAL', 'POSITION', 'HANDLE_LEFT', 'HANDLE_RIGHT'] = 'VALUE',
    shape: Literal['AUTO', 'SINGLE'] = 'AUTO',
     ):
    """ > Percentage Input

    New Vector input with subtype 'PERCENTAGE'.

    Parameters
    ----------
    value : object, default=`(0, 0, 0)`
        Default value

    name : str, default=`Percentage`
        Input socket name

    min : float, default=`-3.40282e+38`
        Property min_value

    max : float, default=`3.40282e+38`
        Property max_value

    tip : str, default=`''`
        Property description

    panel : str, default=``
        Panel name

    optional_label : bool, default=`False`
        Property optional_label

    hide_value : bool, default=`False`
        Property hide_value

    hide_in_modifier : bool, default=`False`
        Property hide_in_modifier

    dimensions : int, default=`3`
        Property dimensions

    default_attribute : str, default=`''`
        Property default_attribute_name

    default_input : str, default=`'VALUE'`
        Property default_input in ('VALUE', 'NORMAL', 'POSITION', 'HANDLE_LEFT', 'HANDLE_RIGHT')

    shape : str, default=`'AUTO'`
        Property structure_type in ('AUTO', 'SINGLE')


    Returns
    -------
    Vector
    """
    return cls(value=value, name=name, min=min, max=max, tip=tip, panel=panel,
        optional_label=optional_label, hide_value=hide_value, hide_in_modifier=hide_in_modifier,
        dimensions=dimensions, default_attribute=default_attribute, default_input=default_input,
        shape=shape, subtype='PERCENTAGE')

Random(min=None, max=None, id=None, seed=None) classmethod

Node Random Value

Fixed values

Kind Name Value
Parameter data_type 'FLOAT_VECTOR'

Parameters:

Name Type Description Default
min Vector

socket 'Min' (id: Min)

None
max Vector

socket 'Max' (id: Max)

None
id Integer

socket 'ID' (id: ID)

None
seed Integer

socket 'Seed' (id: Seed)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
@classmethod
def Random(cls,
                min: Vector = None,
                max: Vector = None,
                id: Integer = None,
                seed: Integer = None):
    """ > Node Random Value

    **Fixed values**

    | Kind      | Name        | Value            |
    | --------- | ----------- | ---------------- |
    | Parameter | `data_type` | `'FLOAT_VECTOR'` |

    Parameters
    ----------
    min : Vector, optional
        socket 'Min' (id: Min)

    max : Vector, optional
        socket 'Max' (id: Max)

    id : Integer, optional
        socket 'ID' (id: ID)

    seed : Integer, optional
        socket 'Seed' (id: Seed)


    Returns
    -------
    Vector
    """
    node = Node('Random Value', {'Min': min, 'Max': max, 'ID': id, 'Seed': seed}, data_type='FLOAT_VECTOR')
    return cls(node._out)

Switch(condition=None, false=None, true=None) classmethod

Node Switch

with GeoNodes("Switch demo"):

    # Two possible geometries
    cube   = Mesh.Cube()
    sphere = Mesh.IcoSphere()

    # Select
    geo = Geometry.Switch(Boolean(True, "Use Sphere"), cube, sphere)

    # To group output
    geo.out()

Parameters:

Name Type Description Default
condition Boolean

socket 'Switch' (Switch)

None
false

socket 'False' (False)

None
true

socket 'True' (True)

None

Returns:

Type Description
Socket
Source code in core/socket_class.py
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
@classmethod
def Switch(cls, condition=None, false=None, true=None):
    """ > Node Switch

    ``` python
    with GeoNodes("Switch demo"):

        # Two possible geometries
        cube   = Mesh.Cube()
        sphere = Mesh.IcoSphere()

        # Select
        geo = Geometry.Switch(Boolean(True, "Use Sphere"), cube, sphere)

        # To group output
        geo.out()
    ```

    Parameters
    ----------
    condition : Boolean
        socket 'Switch' (Switch)

    false
        socket 'False' (False)

    true
        socket 'True' (True)


    Returns
    -------
    Socket
    """
    input_type = SocketType(cls.SOCKET_TYPE).items_type
    return Node('Switch', {'Switch': condition, 'False': false, 'True': true}, input_type=input_type)._out

Tangent(axis='Z', direction_type='RADIAL', uv_map='') classmethod

Node Tangent

ShaderNodes only

Parameters:

Name Type Description Default
axis str

Node.axis in ('X', 'Y', 'Z')

'Z'
direction_type str

Node.direction_type in ('RADIAL', 'UV_MAP')

'RADIAL'
uv_map str

Node.uv_map

''

Returns:

Type Description
Vector
Source code in core/sock_vector.py
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
@classmethod
def Tangent(cls, axis='Z', direction_type='RADIAL', uv_map=''):
    """ > Node Tangent

    > ShaderNodes only

    Parameters
    ----------
    axis : str
        Node.axis in ('X', 'Y', 'Z')

    direction_type : str
        Node.direction_type in ('RADIAL', 'UV_MAP')

    uv_map : str
        Node.uv_map


    Returns
    -------
    Vector
    """
    node = Node('Tangent', axis=axis, direction_type=direction_type, uv_map=uv_map)
    return node._out

Translation(value=(0, 0, 0), name='Translation', min=-3.40282e+38, max=3.40282e+38, tip='', panel='', optional_label=False, hide_value=False, hide_in_modifier=False, dimensions=3, default_attribute='', default_input='VALUE', shape='AUTO') classmethod

Translation Input

New Vector input with subtype 'TRANSLATION'.

Parameters:

Name Type Description Default
value object

Default value

`(0, 0, 0)`
name str

Input socket name

`Translation`
min float

Property min_value

`-3.40282e+38`
max float

Property max_value

`3.40282e+38`
tip str

Property description

`''`
panel str

Panel name

``
optional_label bool

Property optional_label

`False`
hide_value bool

Property hide_value

`False`
hide_in_modifier bool

Property hide_in_modifier

`False`
dimensions int

Property dimensions

`3`
default_attribute str

Property default_attribute_name

`''`
default_input str

Property default_input in ('VALUE', 'NORMAL', 'POSITION', 'HANDLE_LEFT', 'HANDLE_RIGHT')

`'VALUE'`
shape str

Property structure_type in ('AUTO', 'SINGLE')

`'AUTO'`

Returns:

Type Description
Vector
Source code in core/generated/vector.py
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
@classmethod
def Translation(cls,
    value: object = (0, 0, 0),
    name: str = 'Translation',
    min: float = -3.40282e+38,
    max: float = 3.40282e+38,
    tip: str = '',
    panel: str = "",
    optional_label: bool = False,
    hide_value: bool = False,
    hide_in_modifier: bool = False,
    dimensions: int = 3,
    default_attribute: str = '',
    default_input: Literal['VALUE', 'NORMAL', 'POSITION', 'HANDLE_LEFT', 'HANDLE_RIGHT'] = 'VALUE',
    shape: Literal['AUTO', 'SINGLE'] = 'AUTO',
     ):
    """ > Translation Input

    New Vector input with subtype 'TRANSLATION'.

    Parameters
    ----------
    value : object, default=`(0, 0, 0)`
        Default value

    name : str, default=`Translation`
        Input socket name

    min : float, default=`-3.40282e+38`
        Property min_value

    max : float, default=`3.40282e+38`
        Property max_value

    tip : str, default=`''`
        Property description

    panel : str, default=``
        Panel name

    optional_label : bool, default=`False`
        Property optional_label

    hide_value : bool, default=`False`
        Property hide_value

    hide_in_modifier : bool, default=`False`
        Property hide_in_modifier

    dimensions : int, default=`3`
        Property dimensions

    default_attribute : str, default=`''`
        Property default_attribute_name

    default_input : str, default=`'VALUE'`
        Property default_input in ('VALUE', 'NORMAL', 'POSITION', 'HANDLE_LEFT', 'HANDLE_RIGHT')

    shape : str, default=`'AUTO'`
        Property structure_type in ('AUTO', 'SINGLE')


    Returns
    -------
    Vector
    """
    return cls(value=value, name=name, min=min, max=max, tip=tip, panel=panel,
        optional_label=optional_label, hide_value=hide_value, hide_in_modifier=hide_in_modifier,
        dimensions=dimensions, default_attribute=default_attribute, default_input=default_input,
        shape=shape, subtype='TRANSLATION')

UVMap(uv_map='', from_instancer=False) classmethod

Node UV Map

ShaderNodes only

Parameters:

Name Type Description Default
uv_map str

Node.uv_map

''
from_instancer bool

Node.from_instancer

False

Returns:

Type Description
Vector
Source code in core/sock_vector.py
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
@classmethod
def UVMap(cls, uv_map='', from_instancer=False):
    """ > Node UV Map

    > ShaderNodes only

    Parameters
    ----------
    uv_map : str
        Node.uv_map

    from_instancer : bool
        Node.from_instancer


    Returns
    -------
    Vector
    """
    node = Node('UV Map', from_instancer=from_instancer, uv_map=uv_map)
    return node._out

UvMap(from_instancer=False, uv_map='') classmethod

Node UV Map

Parameters:

Name Type Description Default
from_instancer bool

parameter from_instancer

False
uv_map str

parameter uv_map

''

Returns:

Type Description
Vector
Source code in core/generated/vector.py
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
@classmethod
def UvMap(cls, from_instancer = False, uv_map = ''):
    """ > Node UV Map

    Parameters
    ----------
    from_instancer : bool
        parameter `from_instancer`

    uv_map : str
        parameter `uv_map`


    Returns
    -------
    Vector
    """
    node = Node('UV Map', from_instancer=from_instancer, uv_map=uv_map)
    return cls(node._out)

Velocity(value=(0, 0, 0), name='Velocity', min=-3.40282e+38, max=3.40282e+38, tip='', panel='', optional_label=False, hide_value=False, hide_in_modifier=False, dimensions=3, default_attribute='', default_input='VALUE', shape='AUTO') classmethod

Velocity Input

New Vector input with subtype 'VELOCITY'.

Parameters:

Name Type Description Default
value object

Default value

`(0, 0, 0)`
name str

Input socket name

`Velocity`
min float

Property min_value

`-3.40282e+38`
max float

Property max_value

`3.40282e+38`
tip str

Property description

`''`
panel str

Panel name

``
optional_label bool

Property optional_label

`False`
hide_value bool

Property hide_value

`False`
hide_in_modifier bool

Property hide_in_modifier

`False`
dimensions int

Property dimensions

`3`
default_attribute str

Property default_attribute_name

`''`
default_input str

Property default_input in ('VALUE', 'NORMAL', 'POSITION', 'HANDLE_LEFT', 'HANDLE_RIGHT')

`'VALUE'`
shape str

Property structure_type in ('AUTO', 'SINGLE')

`'AUTO'`

Returns:

Type Description
Vector
Source code in core/generated/vector.py
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
@classmethod
def Velocity(cls,
    value: object = (0, 0, 0),
    name: str = 'Velocity',
    min: float = -3.40282e+38,
    max: float = 3.40282e+38,
    tip: str = '',
    panel: str = "",
    optional_label: bool = False,
    hide_value: bool = False,
    hide_in_modifier: bool = False,
    dimensions: int = 3,
    default_attribute: str = '',
    default_input: Literal['VALUE', 'NORMAL', 'POSITION', 'HANDLE_LEFT', 'HANDLE_RIGHT'] = 'VALUE',
    shape: Literal['AUTO', 'SINGLE'] = 'AUTO',
     ):
    """ > Velocity Input

    New Vector input with subtype 'VELOCITY'.

    Parameters
    ----------
    value : object, default=`(0, 0, 0)`
        Default value

    name : str, default=`Velocity`
        Input socket name

    min : float, default=`-3.40282e+38`
        Property min_value

    max : float, default=`3.40282e+38`
        Property max_value

    tip : str, default=`''`
        Property description

    panel : str, default=``
        Panel name

    optional_label : bool, default=`False`
        Property optional_label

    hide_value : bool, default=`False`
        Property hide_value

    hide_in_modifier : bool, default=`False`
        Property hide_in_modifier

    dimensions : int, default=`3`
        Property dimensions

    default_attribute : str, default=`''`
        Property default_attribute_name

    default_input : str, default=`'VALUE'`
        Property default_input in ('VALUE', 'NORMAL', 'POSITION', 'HANDLE_LEFT', 'HANDLE_RIGHT')

    shape : str, default=`'AUTO'`
        Property structure_type in ('AUTO', 'SINGLE')


    Returns
    -------
    Vector
    """
    return cls(value=value, name=name, min=min, max=max, tip=tip, panel=panel,
        optional_label=optional_label, hide_value=hide_value, hide_in_modifier=hide_in_modifier,
        dimensions=dimensions, default_attribute=default_attribute, default_input=default_input,
        shape=shape, subtype='VELOCITY')

Xyz(value=(0, 0, 0), name='Xyz', min=-3.40282e+38, max=3.40282e+38, tip='', panel='', optional_label=False, hide_value=False, hide_in_modifier=False, dimensions=3, default_attribute='', default_input='VALUE', shape='AUTO') classmethod

Xyz Input

New Vector input with subtype 'XYZ'.

Parameters:

Name Type Description Default
value object

Default value

`(0, 0, 0)`
name str

Input socket name

`Xyz`
min float

Property min_value

`-3.40282e+38`
max float

Property max_value

`3.40282e+38`
tip str

Property description

`''`
panel str

Panel name

``
optional_label bool

Property optional_label

`False`
hide_value bool

Property hide_value

`False`
hide_in_modifier bool

Property hide_in_modifier

`False`
dimensions int

Property dimensions

`3`
default_attribute str

Property default_attribute_name

`''`
default_input str

Property default_input in ('VALUE', 'NORMAL', 'POSITION', 'HANDLE_LEFT', 'HANDLE_RIGHT')

`'VALUE'`
shape str

Property structure_type in ('AUTO', 'SINGLE')

`'AUTO'`

Returns:

Type Description
Vector
Source code in core/generated/vector.py
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
@classmethod
def Xyz(cls,
    value: object = (0, 0, 0),
    name: str = 'Xyz',
    min: float = -3.40282e+38,
    max: float = 3.40282e+38,
    tip: str = '',
    panel: str = "",
    optional_label: bool = False,
    hide_value: bool = False,
    hide_in_modifier: bool = False,
    dimensions: int = 3,
    default_attribute: str = '',
    default_input: Literal['VALUE', 'NORMAL', 'POSITION', 'HANDLE_LEFT', 'HANDLE_RIGHT'] = 'VALUE',
    shape: Literal['AUTO', 'SINGLE'] = 'AUTO',
     ):
    """ > Xyz Input

    New Vector input with subtype 'XYZ'.

    Parameters
    ----------
    value : object, default=`(0, 0, 0)`
        Default value

    name : str, default=`Xyz`
        Input socket name

    min : float, default=`-3.40282e+38`
        Property min_value

    max : float, default=`3.40282e+38`
        Property max_value

    tip : str, default=`''`
        Property description

    panel : str, default=``
        Panel name

    optional_label : bool, default=`False`
        Property optional_label

    hide_value : bool, default=`False`
        Property hide_value

    hide_in_modifier : bool, default=`False`
        Property hide_in_modifier

    dimensions : int, default=`3`
        Property dimensions

    default_attribute : str, default=`''`
        Property default_attribute_name

    default_input : str, default=`'VALUE'`
        Property default_input in ('VALUE', 'NORMAL', 'POSITION', 'HANDLE_LEFT', 'HANDLE_RIGHT')

    shape : str, default=`'AUTO'`
        Property structure_type in ('AUTO', 'SINGLE')


    Returns
    -------
    Vector
    """
    return cls(value=value, name=name, min=min, max=max, tip=tip, panel=panel,
        optional_label=optional_label, hide_value=hide_value, hide_in_modifier=hide_in_modifier,
        dimensions=dimensions, default_attribute=default_attribute, default_input=default_input,
        shape=shape, subtype='XYZ')

__init__(socket=None, name=None, tip='', panel='', user_label=None, **props)

Parameters:

Name Type Description Default
socket NodeSocket

the output socket to wrap default=None.

None
name str

input name if not None default=None.

None
tip str

description default="".

''
panel str

panel name default="".

''
user_label str

user label default=None.

None
Source code in core/socket_class.py
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
def __init__(self, 
        socket  = None, 
        name         : str = None, 
        tip          : str = "",
        panel        : str = "",
        user_label   : str = None,
        **props):
    """

    Parameters
    ----------
    socket : NodeSocket, optional
        the output socket to wrap default=None.

    name : str, optional
        input name if not None default=None.

    tip : str, optional
        description default="".

    panel : str, optional
        panel name default="".

    user_label : str, optional
        user label default=None.

    """

    # ---------------------------------------------------------------------------
    # Attributes
    # ---------------------------------------------------------------------------

    self._layout      = None
    self._use_layout  = True
    self._tree        = Tree.current_tree()
    self._bsocket     = None

    self._reset()

    # ---------------------------------------------------------------------------
    # Socket is a Node
    # ---------------------------------------------------------------------------

    if isinstance(socket, Node):
        socket = socket._out

    # ---------------------------------------------------------------------------
    # Empty socket
    # ---------------------------------------------------------------------------

    if utils.request_empty(socket):
        return

    # ---------------------------------------------------------------------------
    # Socket is a string
    # ---------------------------------------------------------------------------

    socktype = self._socket_type
    cname = socktype.class_name

    if isinstance(socket, str):

        # Named attribute (but colors because the string can be the name of a color)
        if (cname in constants.ATTRIBUTE_CLASSES) and (cname != 'Color'):
            self._bsocket = self.Named(socket)._bsocket
            return

    # ---------------------------------------------------------------------------
    # Let's get the socket
    # ---------------------------------------------------------------------------

    self._bsocket = utils.get_bsocket(socket)
    if self._bsocket is not None:

        if self._bsocket.type != self.SOCKET_TYPE:

            # "Bundle Get Item" like nodes : we change the data_type
            node = self.node

            blid = node._bnode.bl_idname
            if blid == 'NodeGetBundleItem'and self.SOCKET_TYPE in utils.get_node_param_enum(blid, 'socket_type'):
                node._bnode.socket_type = self.SOCKET_TYPE
                self._bsocket = utils.get_enabled_bsocket(node, 'Item')

        return

    # ---------------------------------------------------------------------------
    # No name: we create from a constant Node
    # The socket argument is the value to set
    # ---------------------------------------------------------------------------

    if name is None:
        if socktype == 'GEOMETRY':
            new_socket = self.Input(None, halt=False)
            if new_socket is None:
                new_socket = self.NewInput(type(self).__name__)
            self._bsocket = new_socket._bsocket
        else:
            self._bsocket = self.Constant(socket, user_label=user_label)._bsocket

    # ---------------------------------------------------------------------------
    # With a name, we request the creation from current input
    # ---------------------------------------------------------------------------

    else:
        # Font : make sure it is a font 
        if self.SOCKET_TYPE == 'FONT':
            socket = blender.get_font(socket)

        # Socket can be the default value
        if socket is not None:

            if 'default' not in constants.SOCKETS[self._socket_type.type]['props']:
                raise NodeError(f"The {self._socket_type()} socket doesn't accept default value. <{socket}> is not valid.")

            # Perhaps it is given in the props
            def_key = 'default' if 'default' in props else None
            if def_key is None:
                def_key = 'default_value' if 'default_value' in props else None

            if def_key is None:
                props = {'value': socket, **props}

        new_socket = self.NewInput(name, tip=tip, panel=panel, **props)
        self._bsocket = new_socket._bsocket
        self._use_layout = new_socket._use_layout

_create_input_socket(value=(0, 0, 0), name='Vector', min=-3.40282e+38, max=3.40282e+38, tip='', panel='', optional_label=False, hide_value=False, hide_in_modifier=False, dimensions=3, default_attribute='', default_input='VALUE', shape='AUTO', subtype='NONE') classmethod

Vector Input

New Vector input with subtype 'NONE'.

Parameters:

Name Type Description Default
value object

Default value

`(0, 0, 0)`
name str

Input socket name

`Vector`
min float

Property min_value

`-3.40282e+38`
max float

Property max_value

`3.40282e+38`
tip str

Property description

`''`
panel str

Panel name

``
optional_label bool

Property optional_label

`False`
hide_value bool

Property hide_value

`False`
hide_in_modifier bool

Property hide_in_modifier

`False`
dimensions int

Property dimensions

`3`
default_attribute str

Property default_attribute_name

`''`
default_input str

Property default_input in ('VALUE', 'NORMAL', 'POSITION', 'HANDLE_LEFT', 'HANDLE_RIGHT')

`'VALUE'`
shape str

Property structure_type in ('AUTO', 'SINGLE')

`'AUTO'`
subtype str

Socket sub type in ('NONE', 'PERCENTAGE', 'FACTOR', 'TRANSLATION', 'DIRECTION', 'VELOCITY', 'ACCELERATION', 'EULER', 'XYZ')

`NONE`

Returns:

Type Description
Vector
Source code in core/generated/vector.py
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
@classmethod
def _create_input_socket(cls,
    value: object = (0, 0, 0),
    name: str = 'Vector',
    min: float = -3.40282e+38,
    max: float = 3.40282e+38,
    tip: str = '',
    panel: str = "",
    optional_label: bool = False,
    hide_value: bool = False,
    hide_in_modifier: bool = False,
    dimensions: int = 3,
    default_attribute: str = '',
    default_input: Literal['VALUE', 'NORMAL', 'POSITION', 'HANDLE_LEFT', 'HANDLE_RIGHT'] = 'VALUE',
    shape: Literal['AUTO', 'SINGLE'] = 'AUTO',
    subtype: str = 'NONE',
     ):
    """ > Vector Input

    New Vector input with subtype 'NONE'.

    Parameters
    ----------
    value : object, default=`(0, 0, 0)`
        Default value

    name : str, default=`Vector`
        Input socket name

    min : float, default=`-3.40282e+38`
        Property min_value

    max : float, default=`3.40282e+38`
        Property max_value

    tip : str, default=`''`
        Property description

    panel : str, default=``
        Panel name

    optional_label : bool, default=`False`
        Property optional_label

    hide_value : bool, default=`False`
        Property hide_value

    hide_in_modifier : bool, default=`False`
        Property hide_in_modifier

    dimensions : int, default=`3`
        Property dimensions

    default_attribute : str, default=`''`
        Property default_attribute_name

    default_input : str, default=`'VALUE'`
        Property default_input in ('VALUE', 'NORMAL', 'POSITION', 'HANDLE_LEFT', 'HANDLE_RIGHT')

    shape : str, default=`'AUTO'`
        Property structure_type in ('AUTO', 'SINGLE')

    subtype : str, default=`NONE`
        Socket sub type in ('NONE', 'PERCENTAGE', 'FACTOR', 'TRANSLATION', 'DIRECTION', 'VELOCITY', 'ACCELERATION', 'EULER', 'XYZ')


    Returns
    -------
    Vector
    """
    from ..treeclass import Tree

    defval = utils.python_value_for_socket(value, cls.SOCKET_TYPE)

    return Tree.current_tree().create_input_socket('NodeSocketVector', default_value = defval,
        name=name, min=min, max=max, tip=tip, panel=panel, optional_label=optional_label,
        hide_value=hide_value, hide_in_modifier=hide_in_modifier, dimensions=dimensions,
        default_attribute=default_attribute, default_input=default_input, shape=shape, subtype=subtype)

_get_bsocket_from_input(name=None)

Get the availble input socket if any.

The socket is get a an OUTPUT socket of the current input.

Parameters:

Name Type Description Default
name str

name filter default=None.

None

Returns:

Type Description
Socket

or None if not found

Source code in core/socket_class.py
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
def _get_bsocket_from_input(self, name: str = None) -> bpy.types.NodeSocket:
    """ Get the availble input socket if any.

    The socket is get a an OUTPUT socket of the current input.

    Parameters
    ----------
    name : str, optional
        name filter default=None.


    Returns
    -------
    Socket
        or None if not found

    """
    in_node = self._tree.get_input_node()

    include = None if name is None else [name]

    bsockets = in_node.get_sockets('OUTPUT', include=include)
    for _, bsock in bsockets:
        if SocketType(bsock).type == self.SOCKET_TYPE:
            return bsock._bsocket
    else:
        return None

_jump(socket, reset=True)

Change the wrapped output socket

When changing the socket, the description is copied to the new socket. The node color, if any, is also propagated.

Parameters:

Name Type Description Default
socket NodeSocket

the new output socket to jump to

required
reset bool

reset the cache default=True.

True

Returns:

Type Description
self
Source code in core/socket_class.py
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
def _jump(self, socket: bpy.types.NodeSocket, reset: bool = True):
    """ Change the wrapped output socket

    When changing the socket, the description is copied to the new socket.
    The node color, if any, is also propagated.

    Parameters
    ----------
    socket : bpy.types.NodeSocket
        the new output socket to jump to

    reset : bool, optional
        reset the cache default=True.


    Returns
    -------
    self
    """

    # Keep user label stored in socket description
    user_label = self.user_label

    bsocket = utils.get_bsocket(socket)
    if bsocket is None:
        raise NodeError(f"Socket error: Impossible to jump to socket {socket}")

    self._bsocket = bsocket
    if reset:
        self._reset()

    # Restore user label
    self.user_label = user_label


    return self

_lc(label=None, color=None)

Set node label and color.

This method returns self to be chained to as socket:

with GeoNodes("Node label and color"):
    Geometry().out()

    a = Float(10)._lc("Var a")
    b = Float(10)._lc("Var b")
    c = (a + b)._lc("a + b", (1, 0, 0))

Parameters:

Name Type Description Default
label str

node label default=None.

None
color SysColor

node color default=None.

None

Returns:

Type Description
self
Source code in core/socket_class.py
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
def _lc(self, label: str = None, color: SysColor = None):
    """ Set node label and color.

    This method returns self to be chained to as socket:

    ``` python
    with GeoNodes("Node label and color"):
        Geometry().out()

        a = Float(10)._lc("Var a")
        b = Float(10)._lc("Var b")
        c = (a + b)._lc("a + b", (1, 0, 0))
    ```

    Parameters
    ----------
    label : str, optional
        node label default=None.

    color : SysColor, optional
        node color default=None.


    Returns
    -------
    self
    """

    if self.node._bnode.bl_idname == 'NodeGroupInput':
        return self

    self.node_label = label
    self.node_color = color
    self.user_label = label

    return self

_ul(label)

Set the user label

Parameters:

Name Type Description Default
label str

the label to append

required

Returns:

Type Description
self
Source code in core/socket_class.py
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
def _ul(self, label : str):
    """ Set the user label

    Parameters
    ----------
    label : str
        the label to append


    Returns
    -------
    self
    """
    self.user_label = label
    return self

abs()

Node Vector Math

Fixed values

Kind Name Value
Socket Vector self
Parameter operation 'ABSOLUTE'

Returns:

Type Description
Vector
Source code in core/generated/vector.py
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
def abs(self):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value        |
    | --------- | ----------- | ------------ |
    | Socket    | Vector      | `self`       |
    | Parameter | `operation` | `'ABSOLUTE'` |

    Returns
    -------
    Vector
    """
    node = Node('Vector Math', {'Vector': self}, operation='ABSOLUTE')
    return node._out

add(vector=None)

Node Vector Math

Fixed values

Kind Name Value
Socket Vector self
Parameter operation 'ADD'

Parameters:

Name Type Description Default
vector Vector

socket 'Vector' (id: Vector_001)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
def add(self, vector: Vector = None):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value   |
    | --------- | ----------- | ------- |
    | Socket    | Vector      | `self`  |
    | Parameter | `operation` | `'ADD'` |

    Parameters
    ----------
    vector : Vector, optional
        socket 'Vector' (id: Vector_001)


    Returns
    -------
    Vector
    """
    node = Node('Vector Math', {'Vector': self, 'Vector_001': vector}, operation='ADD')
    return node._out

add_method(name=None, jump=False, ret_class=None, **fixed)

Add the current tree as a method of the Socket class.

Important

The socket instance must be an input socket of the Tree. This input plays the role of self argument.

with GeoNodes("Translate"):
    geo = Geometry()
    v = Vector(0, "Translation)
    geo.transform(translation=v)

    geo.add_method(jump=True)

Once the modifier completed, it can be called as a method of geometry geo.translate(translation=(1, 2, 3))

Parameters:

Name Type Description Default
name str

replace the default name which is the snake case version of the group name default=None.

None
ret_class type

transtype the default node output default=None.

None
jump bool

the calling socket jumps to the node outpus after the call default=False.

False
ret_class type

transtype the result with this class if not None default=None.

None
Source code in core/socket_class.py
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
def add_method(self, name: str = None, jump: bool = False, ret_class: type = None, **fixed):
    """ Add the current tree as a method of the Socket class.

    !!! important

        The socket instance must be an input socket of the Tree. This input plays the role of
        self argument.

    ``` python
    with GeoNodes("Translate"):
        geo = Geometry()
        v = Vector(0, "Translation)
        geo.transform(translation=v)

        geo.add_method(jump=True)
    ```

    Once the modifier completed, it can be called as a method of geometry ```geo.translate(translation=(1, 2, 3))```

    Parameters
    ----------
    name : str, optional
        replace the default name which is the snake case version of the group name default=None.

    ret_class : type, optional
        transtype the default node output default=None.

    jump : bool, optional
        the calling socket jumps to the node outpus after the call default=False.

    ret_class : type, optional
        transtype the result with this class if not None default=None.

    """

    if self.node._bnode.bl_idname != 'NodeGroupInput':
        raise NodeError(
            f"'add_method' can be called only from a 'Group Input' socket. "
            "This socket is used a 'self' argument when calling the method of {type(self).__name__}.")

    tree = Tree.current_tree()

    # ---------------------------------------------------------------------------
    # Method Body
    # ---------------------------------------------------------------------------

    socket_rank = self.node._outputs.get_socket_rank(self)
    socket_name = utils.snake_case(self._bsocket.name)


    def call(self_, *args, **kwargs):
        node = Group(tree._btree.name)
        if socket_rank >= len(args):
            new_args = args
            new_kwargs = {socket_name: self_, **kwargs}
        else:
            new_args = args[:socket_rank] + (self_,) + args[socket_rank:]
            new_kwargs = kwargs

        res = node.method_call(*new_args, ret_class=ret_class, **new_kwargs, **fixed)

        if jump:
            return self_._jump(res)
        else:
            return res

    # ---------------------------------------------------------------------------
    # Add the method to the class
    # ---------------------------------------------------------------------------

    if name is None:
        name = tree._btree.name[len(tree._prefix):].strip()
        name = utils.snake_case(name)

    class_ = type(self)
    if name in dir(class_):
        print(f"CAUTION: the method '{name}' (implementing group '{tree._btree.name}') already exists in class {class_}.")

    setattr(class_, name, call)

advect_grid(velocity=None, time_step=None, integration_scheme=None, limiter=None)

Node Advect Grid

Fixed values

Kind Name Value
Socket Grid self
Parameter data_type 'VECTOR'

Parameters:

Name Type Description Default
velocity Vector

socket 'Velocity' (id: Velocity)

None
time_step Float

socket 'Time Step' (id: Time Step)

None
integration_scheme menu='Runge-Kutta 3'

('Semi-Lagrangian', 'Midpoint', 'Runge-Kutta 3', 'Runge-Kutta 4', 'MacCormack', 'BFECC')

None
limiter menu='Clamp'

('None', 'Clamp', 'Revert')

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
def advect_grid(self,
                velocity: Vector = None,
                time_step: Float = None,
                integration_scheme: Literal['Semi-Lagrangian', 'Midpoint', 'Runge-Kutta 3', 'Runge-Kutta 4', 'MacCormack', 'BFECC'] = None,
                limiter: Literal['None', 'Clamp', 'Revert'] = None):
    """ > Node Advect Grid

    **Fixed values**

    | Kind      | Name        | Value      |
    | --------- | ----------- | ---------- |
    | Socket    | Grid        | `self`     |
    | Parameter | `data_type` | `'VECTOR'` |

    Parameters
    ----------
    velocity : Vector, optional
        socket 'Velocity' (id: Velocity)

    time_step : Float, optional
        socket 'Time Step' (id: Time Step)

    integration_scheme : menu='Runge-Kutta 3', optional
        ('Semi-Lagrangian', 'Midpoint', 'Runge-Kutta 3', 'Runge-Kutta 4', 'MacCormack', 'BFECC')

    limiter : menu='Clamp', optional
        ('None', 'Clamp', 'Revert')


    Returns
    -------
    Vector
    """
    node = Node('Advect Grid', {'Grid': self, 'Velocity': velocity, 'Time Step': time_step, 'Integration Scheme': integration_scheme, 'Limiter': limiter}, data_type='VECTOR')
    return node._out

blur(iterations=None, weight=None)

Node Blur Attribute

Fixed values

Kind Name Value
Socket Value self
Parameter data_type 'FLOAT_VECTOR'

Parameters:

Name Type Description Default
iterations Integer

socket 'Iterations' (id: Iterations)

None
weight Float

socket 'Weight' (id: Weight)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
def blur(self, iterations: Integer = None, weight: Float = None):
    """ > Node Blur Attribute

    **Fixed values**

    | Kind      | Name        | Value            |
    | --------- | ----------- | ---------------- |
    | Socket    | Value       | `self`           |
    | Parameter | `data_type` | `'FLOAT_VECTOR'` |

    Parameters
    ----------
    iterations : Integer, optional
        socket 'Iterations' (id: Iterations)

    weight : Float, optional
        socket 'Weight' (id: Weight)


    Returns
    -------
    Vector
    """
    node = Node('Blur Attribute', {'Value': self, 'Iterations': iterations, 'Weight': weight}, data_type='FLOAT_VECTOR')
    return node._out

bump(strength=None, distance=None, height=None, invert=False)

Node Bump

ShaderNodes only

Note

Self Vector is plugged to 'Normal' socket

Parameters:

Name Type Description Default
strength Float

socket 'Strength' (Strength)

None
distance Float

socket 'Distance' (Distance)

None
height Float

socket 'Height' (Height)

None
invert bool

Node.invert

False

Returns:

Type Description
Vector
Source code in core/sock_vector.py
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
def bump(self, strength=None, distance=None, height=None, invert=False):
    """ > Node Bump

    > ShaderNodes only

    !!! note
        Self Vector is plugged to 'Normal' socket

    Parameters
    ----------
    strength : Float
        socket 'Strength' (Strength)

    distance : Float
        socket 'Distance' (Distance)

    height : Float
        socket 'Height' (Height)

    invert : bool
        Node.invert


    Returns
    -------
    Vector
    """
    node = Node('Bump', {'Strength': strength, 'Distance': distance, 'Height': height, 'Normal': self}, invert=invert)
    return node._out

ceil()

Node Vector Math

Fixed values

Kind Name Value
Socket Vector self
Parameter operation 'CEIL'

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
def ceil(self):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value    |
    | --------- | ----------- | -------- |
    | Socket    | Vector      | `self`   |
    | Parameter | `operation` | `'CEIL'` |

    Returns
    -------
    Vector
    """
    node = Node('Vector Math', {'Vector': self}, operation='CEIL')
    return node._out

clip_grid(min_x=None, min_y=None, min_z=None, max_x=None, max_y=None, max_z=None)

Node Clip Grid

Fixed values

Kind Name Value
Socket Grid self
Parameter data_type 'VECTOR'

Parameters:

Name Type Description Default
min_x Integer

socket 'Min X' (id: Min X)

None
min_y Integer

socket 'Min Y' (id: Min Y)

None
min_z Integer

socket 'Min Z' (id: Min Z)

None
max_x Integer

socket 'Max X' (id: Max X)

None
max_y Integer

socket 'Max Y' (id: Max Y)

None
max_z Integer

socket 'Max Z' (id: Max Z)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
def clip_grid(self,
                min_x: Integer = None,
                min_y: Integer = None,
                min_z: Integer = None,
                max_x: Integer = None,
                max_y: Integer = None,
                max_z: Integer = None):
    """ > Node Clip Grid

    **Fixed values**

    | Kind      | Name        | Value      |
    | --------- | ----------- | ---------- |
    | Socket    | Grid        | `self`     |
    | Parameter | `data_type` | `'VECTOR'` |

    Parameters
    ----------
    min_x : Integer, optional
        socket 'Min X' (id: Min X)

    min_y : Integer, optional
        socket 'Min Y' (id: Min Y)

    min_z : Integer, optional
        socket 'Min Z' (id: Min Z)

    max_x : Integer, optional
        socket 'Max X' (id: Max X)

    max_y : Integer, optional
        socket 'Max Y' (id: Max Y)

    max_z : Integer, optional
        socket 'Max Z' (id: Max Z)


    Returns
    -------
    Vector
    """
    node = Node('Clip Grid', {'Grid': self, 'Min X': min_x, 'Min Y': min_y, 'Min Z': min_z, 'Max X': max_x, 'Max Y': max_y, 'Max Z': max_z}, data_type='VECTOR')
    return node._out

cos()

Node Vector Math

Fixed values

Kind Name Value
Socket Vector self
Parameter operation 'COSINE'

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
def cos(self):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value      |
    | --------- | ----------- | ---------- |
    | Socket    | Vector      | `self`     |
    | Parameter | `operation` | `'COSINE'` |

    Returns
    -------
    Vector
    """
    node = Node('Vector Math', {'Vector': self}, operation='COSINE')
    return node._out

cross(vector=None)

Node Vector Math

Fixed values

Kind Name Value
Socket Vector self
Parameter operation 'CROSS_PRODUCT'

Parameters:

Name Type Description Default
vector Vector

socket 'Vector' (id: Vector_001)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
def cross(self, vector: Vector = None):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value             |
    | --------- | ----------- | ----------------- |
    | Socket    | Vector      | `self`            |
    | Parameter | `operation` | `'CROSS_PRODUCT'` |

    Parameters
    ----------
    vector : Vector, optional
        socket 'Vector' (id: Vector_001)


    Returns
    -------
    Vector
    """
    node = Node('Vector Math', {'Vector': self, 'Vector_001': vector}, operation='CROSS_PRODUCT')
    return node._out

curves(fac=None, curves=None)

Node Vector Curves

A curve is defined by a list of 3-tuples (not list):

  • x (float) : x position
  • y (float) : y position
  • handle_type (str) : handle type in ('AUTO', 'AUTO_CLAMPED', 'VECTOR'), default='AUTO'

Fixed values

Kind Name Value
Socket Vector self

Parameters:

Name Type Description Default
fac Float

socket 'Fac' (id: Fac)

None
curves list[list[tuple[float, float, str]]]

curves points

None

Returns:

Type Description
Vector
Source code in core/sock_vector.py
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
def curves(self, fac=None, curves=None):
    """ > Node Vector Curves

    A curve is defined by a list of 3-tuples (not list):

    - x (float) : x position
    - y (float) : y position
    - handle_type (str) : handle type in ('AUTO', 'AUTO_CLAMPED', 'VECTOR'), default='AUTO'

    **Fixed values**

    | Kind      | Name        | Value   |
    | --------- | ----------- | ------- |
    | Socket    | Vector      | `self`  |

    Parameters
    ----------
    fac : Float
        socket 'Fac' (id: Fac)

    curves : list[list[tuple[float, float, str]]]
        curves points

    Returns
    -------
    Vector
    """
    node = NodeCurves('Vector Curves', named_sockets={'Vector': self, 'Fac': fac})
    node.set_curves(curves)
    return node._out

displacement(height=None, midlevel=None, scale=None, space='OBJECT')

Node Displacement

ShaderNodes only

Note

Self Vector is plugged to 'Normal' socket

Parameters:

Name Type Description Default
height Float

socket 'Height' (Height)

None
midlevel Float

socket 'Midlevel' (Midlevel)

None
scale Float

socket 'Scale' (Scale)

None
space str

Node.space in ('OBJECT', 'WORLD')

'OBJECT'

Returns:

Type Description
Vector
Source code in core/sock_vector.py
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
def displacement(self, height=None, midlevel=None, scale=None, space='OBJECT'):
    """ > Node Displacement

    > ShaderNodes only

    !!! note
        Self Vector is plugged to 'Normal' socket

    Parameters
    ----------
    height : Float
        socket 'Height' (Height)

    midlevel : Float
        socket 'Midlevel' (Midlevel)

    scale : Float
        socket 'Scale' (Scale)

    space : str
        Node.space in ('OBJECT', 'WORLD')


    Returns
    -------
    Vector
    """
    node = Node('Displacement', {'Height': height, 'Midlevel': midlevel, 'Scale': scale, 'Normal': self}, space=space)
    return node._out

displacement_out(target='ALL')

Plug the value to 'Displacement' socket of Material Output node

ShaderNodes only

Source code in core/sock_vector.py
304
305
306
307
308
309
def displacement_out(self, target='ALL'):
    """ > Plug the value to 'Displacement' socket of Material Output node

    > ShaderNodes only
    """
    self._tree.set_displacement(self, target=target)

distance(vector=None)

Node Vector Math

Fixed values

Kind Name Value
Socket Vector self
Parameter operation 'DISTANCE'

Parameters:

Name Type Description Default
vector Vector

socket 'Vector' (id: Vector_001)

None

Returns:

Type Description
Float
Source code in core/generated/vector.py
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
def distance(self, vector: Vector = None):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value        |
    | --------- | ----------- | ------------ |
    | Socket    | Vector      | `self`       |
    | Parameter | `operation` | `'DISTANCE'` |

    Parameters
    ----------
    vector : Vector, optional
        socket 'Vector' (id: Vector_001)


    Returns
    -------
    Float
    """
    node = Node('Vector Math', {'Vector': self, 'Vector_001': vector}, operation='DISTANCE')
    return node._out

divide(vector=None)

Node Vector Math

Fixed values

Kind Name Value
Socket Vector self
Parameter operation 'DIVIDE'

Parameters:

Name Type Description Default
vector Vector

socket 'Vector' (id: Vector_001)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
def divide(self, vector: Vector = None):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value      |
    | --------- | ----------- | ---------- |
    | Socket    | Vector      | `self`     |
    | Parameter | `operation` | `'DIVIDE'` |

    Parameters
    ----------
    vector : Vector, optional
        socket 'Vector' (id: Vector_001)


    Returns
    -------
    Vector
    """
    node = Node('Vector Math', {'Vector': self, 'Vector_001': vector}, operation='DIVIDE')
    return node._out

dot(vector=None)

Node Vector Math

Fixed values

Kind Name Value
Socket Vector self
Parameter operation 'DOT_PRODUCT'

Parameters:

Name Type Description Default
vector Vector

socket 'Vector' (id: Vector_001)

None

Returns:

Type Description
Float
Source code in core/generated/vector.py
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
def dot(self, vector: Vector = None):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value           |
    | --------- | ----------- | --------------- |
    | Socket    | Vector      | `self`          |
    | Parameter | `operation` | `'DOT_PRODUCT'` |

    Parameters
    ----------
    vector : Vector, optional
        socket 'Vector' (id: Vector_001)


    Returns
    -------
    Float
    """
    node = Node('Vector Math', {'Vector': self, 'Vector_001': vector}, operation='DOT_PRODUCT')
    return node._out

enable_output(enable=None)

Node Enable Output

Fixed values

Kind Name Value
Socket Value self
Parameter data_type 'VECTOR'

Parameters:

Name Type Description Default
enable Boolean

socket 'Enable' (id: Enable)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
def enable_output(self, enable: Boolean = None):
    """ > Node Enable Output

    **Fixed values**

    | Kind      | Name        | Value      |
    | --------- | ----------- | ---------- |
    | Socket    | Value       | `self`     |
    | Parameter | `data_type` | `'VECTOR'` |

    Parameters
    ----------
    enable : Boolean, optional
        socket 'Enable' (id: Enable)


    Returns
    -------
    Vector
    """
    node = Node('Enable Output', {'Enable': enable, 'Value': self}, data_type='VECTOR')
    return node._out

environment_texture(image=None, interpolation='Linear', projection='EQUIRECTANGULAR')

Node Environment Texture

Fixed values

Kind Name Value
Socket Vector self

Parameters:

Name Type Description Default
image NoneType

parameter image

None
interpolation Literal['Linear', 'Closest', 'Cubic', 'Smart']

parameter interpolation

'Linear'
projection Literal['Equirectangular', 'Mirror Ball']

parameter projection

'EQUIRECTANGULAR'

Returns:

Type Description
Color
Source code in core/generated/vector.py
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
def environment_texture(self,
                image = None,
                interpolation: Literal['Linear', 'Closest', 'Cubic', 'Smart'] = 'Linear',
                projection: Literal['EQUIRECTANGULAR', 'MIRROR_BALL'] = 'EQUIRECTANGULAR'):
    """ > Node Environment Texture

    **Fixed values**

    | Kind   | Name   | Value  |
    | ------ | ------ | ------ |
    | Socket | Vector | `self` |

    Parameters
    ----------
    image : NoneType
        parameter `image`

    interpolation : Literal['Linear', 'Closest', 'Cubic', 'Smart']
        parameter `interpolation`

    projection : Literal['Equirectangular', 'Mirror Ball']
        parameter `projection`


    Returns
    -------
    Color
    """
    utils.check_enum_arg('Environment Texture', 'interpolation', interpolation, 'environment_texture', ('Linear', 'Closest', 'Cubic', 'Smart'))
    utils.check_enum_arg('Environment Texture', 'projection', projection, 'environment_texture', ('EQUIRECTANGULAR', 'MIRROR_BALL'))
    node = Node('Environment Texture', {'Vector': self}, image=image, interpolation=interpolation, projection=projection)
    return node._out

equal(b=None, epsilon=None)

Node Compare

Fixed values

Kind Name Value
Socket A self
Parameter data_type 'VECTOR'
Parameter mode 'ELEMENT'
Parameter operation 'EQUAL'

Parameters:

Name Type Description Default
b Vector

socket 'B' (id: B_VEC3)

None
epsilon Float

socket 'Epsilon' (id: Epsilon)

None

Returns:

Type Description
Boolean
Source code in core/generated/vector.py
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
def equal(self, b: Vector = None, epsilon: Float = None):
    """ > Node Compare

    **Fixed values**

    | Kind      | Name        | Value       |
    | --------- | ----------- | ----------- |
    | Socket    | A           | `self`      |
    | Parameter | `data_type` | `'VECTOR'`  |
    | Parameter | `mode`      | `'ELEMENT'` |
    | Parameter | `operation` | `'EQUAL'`   |

    Parameters
    ----------
    b : Vector, optional
        socket 'B' (id: B_VEC3)

    epsilon : Float, optional
        socket 'Epsilon' (id: Epsilon)


    Returns
    -------
    Boolean
    """
    node = Node('Compare', {'A_VEC3': self, 'B_VEC3': b, 'Epsilon': epsilon}, data_type='VECTOR', mode='ELEMENT', operation='EQUAL')
    return node._out

faceforward(incident=None, reference=None)

Node Vector Math

Fixed values

Kind Name Value
Socket Vector self
Parameter operation 'FACEFORWARD'

Parameters:

Name Type Description Default
incident Vector

socket 'Incident' (id: Vector_001)

None
reference Vector

socket 'Reference' (id: Vector_002)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
def faceforward(self, incident: Vector = None, reference: Vector = None):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value           |
    | --------- | ----------- | --------------- |
    | Socket    | Vector      | `self`          |
    | Parameter | `operation` | `'FACEFORWARD'` |

    Parameters
    ----------
    incident : Vector, optional
        socket 'Incident' (id: Vector_001)

    reference : Vector, optional
        socket 'Reference' (id: Vector_002)


    Returns
    -------
    Vector
    """
    node = Node('Vector Math', {'Vector': self, 'Vector_001': incident, 'Vector_002': reference}, operation='FACEFORWARD')
    return node._out

field_to_grid(named_sockets={}, **sockets)

Node Field to Grid

Fixed values

Kind Name Value
Socket Topology self
Parameter data_type 'VECTOR'

Parameters:

Name Type Description Default
named_sockets dict

Sockets created with string names

{}
sockets dict

Socket created with python name attributes

{}

Returns:

Type Description
None
Source code in core/generated/vector.py
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
def field_to_grid(self, named_sockets: dict = {}, **sockets):
    """ > Node Field to Grid

    **Fixed values**

    | Kind      | Name        | Value      |
    | --------- | ----------- | ---------- |
    | Socket    | Topology    | `self`     |
    | Parameter | `data_type` | `'VECTOR'` |

    Parameters
    ----------
    named_sockets : dict, default={}
        Sockets created with string names

    sockets : dict, default={}
        Socket created with python name attributes

    Returns
    -------
    None
    """
    node = Node('Field to Grid', {'Topology': self, **named_sockets}, data_type='VECTOR', **sockets)
    return node._out

floor()

Node Vector Math

Fixed values

Kind Name Value
Socket Vector self
Parameter operation 'FLOOR'

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
def floor(self):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value     |
    | --------- | ----------- | --------- |
    | Socket    | Vector      | `self`    |
    | Parameter | `operation` | `'FLOOR'` |

    Returns
    -------
    Vector
    """
    node = Node('Vector Math', {'Vector': self}, operation='FLOOR')
    return node._out

fraction()

Node Vector Math

Fixed values

Kind Name Value
Socket Vector self
Parameter operation 'FRACTION'

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
def fraction(self):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value        |
    | --------- | ----------- | ------------ |
    | Socket    | Vector      | `self`       |
    | Parameter | `operation` | `'FRACTION'` |

    Returns
    -------
    Vector
    """
    node = Node('Vector Math', {'Vector': self}, operation='FRACTION')
    return node._out

greater_equal(b=None)

Node Compare

Fixed values

Kind Name Value
Socket A self
Parameter data_type 'VECTOR'
Parameter mode 'ELEMENT'
Parameter operation 'GREATER_EQUAL'

Parameters:

Name Type Description Default
b Vector

socket 'B' (id: B_VEC3)

None

Returns:

Type Description
Boolean
Source code in core/generated/vector.py
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
def greater_equal(self, b: Vector = None):
    """ > Node Compare

    **Fixed values**

    | Kind      | Name        | Value             |
    | --------- | ----------- | ----------------- |
    | Socket    | A           | `self`            |
    | Parameter | `data_type` | `'VECTOR'`        |
    | Parameter | `mode`      | `'ELEMENT'`       |
    | Parameter | `operation` | `'GREATER_EQUAL'` |

    Parameters
    ----------
    b : Vector, optional
        socket 'B' (id: B_VEC3)


    Returns
    -------
    Boolean
    """
    node = Node('Compare', {'A_VEC3': self, 'B_VEC3': b}, data_type='VECTOR', mode='ELEMENT', operation='GREATER_EQUAL')
    return node._out

greater_than(b=None)

Node Compare

Fixed values

Kind Name Value
Socket A self
Parameter data_type 'VECTOR'
Parameter mode 'ELEMENT'
Parameter operation 'GREATER_THAN'

Parameters:

Name Type Description Default
b Vector

socket 'B' (id: B_VEC3)

None

Returns:

Type Description
Boolean
Source code in core/generated/vector.py
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
def greater_than(self, b: Vector = None):
    """ > Node Compare

    **Fixed values**

    | Kind      | Name        | Value            |
    | --------- | ----------- | ---------------- |
    | Socket    | A           | `self`           |
    | Parameter | `data_type` | `'VECTOR'`       |
    | Parameter | `mode`      | `'ELEMENT'`      |
    | Parameter | `operation` | `'GREATER_THAN'` |

    Parameters
    ----------
    b : Vector, optional
        socket 'B' (id: B_VEC3)


    Returns
    -------
    Boolean
    """
    node = Node('Compare', {'A_VEC3': self, 'B_VEC3': b}, data_type='VECTOR', mode='ELEMENT', operation='GREATER_THAN')
    return node._out

grid_curl()

Node Grid Curl

Fixed values

Kind Name Value
Socket Grid self

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
def grid_curl(self):
    """ > Node Grid Curl

    **Fixed values**

    | Kind   | Name | Value  |
    | ------ | ---- | ------ |
    | Socket | Grid | `self` |

    Returns
    -------
    Vector
    """
    node = Node('Grid Curl', {'Grid': self})
    return node._out

grid_dilate_erode(connectivity=None, tiles=None, steps=None)

Node Grid Dilate & Erode

Fixed values

Kind Name Value
Socket Grid self
Parameter data_type 'VECTOR'

Parameters:

Name Type Description Default
connectivity menu='Face'

('Face', 'Edge', 'Vertex')

None
tiles menu='Preserve'

('Ignore', 'Expand', 'Preserve')

None
steps Integer

socket 'Steps' (id: Steps)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
def grid_dilate_erode(self,
                connectivity: Literal['Face', 'Edge', 'Vertex'] = None,
                tiles: Literal['Ignore', 'Expand', 'Preserve'] = None,
                steps: Integer = None):
    """ > Node Grid Dilate & Erode

    **Fixed values**

    | Kind      | Name        | Value      |
    | --------- | ----------- | ---------- |
    | Socket    | Grid        | `self`     |
    | Parameter | `data_type` | `'VECTOR'` |

    Parameters
    ----------
    connectivity : menu='Face', optional
        ('Face', 'Edge', 'Vertex')

    tiles : menu='Preserve', optional
        ('Ignore', 'Expand', 'Preserve')

    steps : Integer, optional
        socket 'Steps' (id: Steps)


    Returns
    -------
    Vector
    """
    node = Node('Grid Dilate & Erode', {'Grid': self, 'Connectivity': connectivity, 'Tiles': tiles, 'Steps': steps}, data_type='VECTOR')
    return node._out

grid_divergence()

Node Grid Divergence

Fixed values

Kind Name Value
Socket Grid self

Returns:

Type Description
Float
Source code in core/generated/vector.py
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
def grid_divergence(self):
    """ > Node Grid Divergence

    **Fixed values**

    | Kind   | Name | Value  |
    | ------ | ---- | ------ |
    | Socket | Grid | `self` |

    Returns
    -------
    Float
    """
    node = Node('Grid Divergence', {'Grid': self})
    return node._out

grid_info()

Node Grid Info

Fixed values

Kind Name Value
Socket Grid self
Parameter data_type 'VECTOR'

Returns:

Type Description
Matrix

peer sockets: background_value_ (Vector)

Source code in core/generated/vector.py
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
def grid_info(self):
    """ > Node Grid Info

    **Fixed values**

    | Kind      | Name        | Value      |
    | --------- | ----------- | ---------- |
    | Socket    | Grid        | `self`     |
    | Parameter | `data_type` | `'VECTOR'` |

    Returns
    -------
    Matrix
        peer sockets: background_value_ (Vector)

    """
    node = Node('Grid Info', {'Grid': self}, data_type='VECTOR')
    return node._out

grid_mean(width=None, iterations=None)

Node Grid Mean

Fixed values

Kind Name Value
Socket Grid self
Parameter data_type 'VECTOR'

Parameters:

Name Type Description Default
width Integer

socket 'Width' (id: Width)

None
iterations Integer

socket 'Iterations' (id: Iterations)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
def grid_mean(self, width: Integer = None, iterations: Integer = None):
    """ > Node Grid Mean

    **Fixed values**

    | Kind      | Name        | Value      |
    | --------- | ----------- | ---------- |
    | Socket    | Grid        | `self`     |
    | Parameter | `data_type` | `'VECTOR'` |

    Parameters
    ----------
    width : Integer, optional
        socket 'Width' (id: Width)

    iterations : Integer, optional
        socket 'Iterations' (id: Iterations)


    Returns
    -------
    Vector
    """
    node = Node('Grid Mean', {'Grid': self, 'Width': width, 'Iterations': iterations}, data_type='VECTOR')
    return node._out

grid_median(width=None, iterations=None)

Node Grid Median

Fixed values

Kind Name Value
Socket Grid self
Parameter data_type 'VECTOR'

Parameters:

Name Type Description Default
width Integer

socket 'Width' (id: Width)

None
iterations Integer

socket 'Iterations' (id: Iterations)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
def grid_median(self, width: Integer = None, iterations: Integer = None):
    """ > Node Grid Median

    **Fixed values**

    | Kind      | Name        | Value      |
    | --------- | ----------- | ---------- |
    | Socket    | Grid        | `self`     |
    | Parameter | `data_type` | `'VECTOR'` |

    Parameters
    ----------
    width : Integer, optional
        socket 'Width' (id: Width)

    iterations : Integer, optional
        socket 'Iterations' (id: Iterations)


    Returns
    -------
    Vector
    """
    node = Node('Grid Median', {'Grid': self, 'Width': width, 'Iterations': iterations}, data_type='VECTOR')
    return node._out

grid_to_points()

Node Grid to Points

Fixed values

Kind Name Value
Socket Grid self
Parameter data_type 'VECTOR'

Returns:

Type Description
Cloud

peer sockets: value_ (Vector), x_ (Integer), y_ (Integer), z_ (Integer), is_tile_ (Boolean), extent_ (Integer)

Source code in core/generated/vector.py
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
def grid_to_points(self):
    """ > Node Grid to Points

    **Fixed values**

    | Kind      | Name        | Value      |
    | --------- | ----------- | ---------- |
    | Socket    | Grid        | `self`     |
    | Parameter | `data_type` | `'VECTOR'` |

    Returns
    -------
    Cloud
        peer sockets: value_ (Vector), x_ (Integer), y_ (Integer), z_ (Integer), is_tile_ (Boolean), extent_ (Integer)

    """
    node = Node('Grid to Points', {'Grid': self}, data_type='VECTOR')
    return node._out

hash_value(seed=None)

Node Hash Value

Fixed values

Kind Name Value
Socket Value self
Parameter data_type 'VECTOR'

Parameters:

Name Type Description Default
seed Integer

socket 'Seed' (id: Seed)

None

Returns:

Type Description
Integer
Source code in core/generated/vector.py
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
def hash_value(self, seed: Integer = None):
    """ > Node Hash Value

    **Fixed values**

    | Kind      | Name        | Value      |
    | --------- | ----------- | ---------- |
    | Socket    | Value       | `self`     |
    | Parameter | `data_type` | `'VECTOR'` |

    Parameters
    ----------
    seed : Integer, optional
        socket 'Seed' (id: Seed)


    Returns
    -------
    Integer
    """
    node = Node('Hash Value', {'Value': self, 'Seed': seed}, data_type='VECTOR')
    return node._out

ies_texture(strength=None, filepath='', ies=None, mode='INTERNAL')

Node IES Texture

Fixed values

Kind Name Value
Socket Vector self

Parameters:

Name Type Description Default
strength Float

socket 'Strength' (id: Strength)

None
filepath str

parameter filepath

''
ies NoneType

parameter ies

None
mode Literal['Internal', 'External']

parameter mode

'INTERNAL'

Returns:

Type Description
Float
Source code in core/generated/vector.py
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
def ies_texture(self,
                strength: Float = None,
                filepath = '',
                ies = None,
                mode: Literal['INTERNAL', 'EXTERNAL'] = 'INTERNAL'):
    """ > Node IES Texture

    **Fixed values**

    | Kind   | Name   | Value  |
    | ------ | ------ | ------ |
    | Socket | Vector | `self` |

    Parameters
    ----------
    strength : Float, optional
        socket 'Strength' (id: Strength)

    filepath : str
        parameter `filepath`

    ies : NoneType
        parameter `ies`

    mode : Literal['Internal', 'External']
        parameter `mode`


    Returns
    -------
    Float
    """
    utils.check_enum_arg('IES Texture', 'mode', mode, 'ies_texture', ('INTERNAL', 'EXTERNAL'))
    node = Node('IES Texture', {'Vector': self, 'Strength': strength}, filepath=filepath, ies=ies, mode=mode)
    return node._out

ies_texture_external(strength=None, filepath='', ies=None)

Node IES Texture

Fixed values

Kind Name Value
Socket Vector self
Parameter mode 'EXTERNAL'

Parameters:

Name Type Description Default
strength Float

socket 'Strength' (id: Strength)

None
filepath str

parameter filepath

''
ies NoneType

parameter ies

None

Returns:

Type Description
Float
Source code in core/generated/vector.py
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
def ies_texture_external(self, strength: Float = None, filepath = '', ies = None):
    """ > Node IES Texture

    **Fixed values**

    | Kind      | Name   | Value        |
    | --------- | ------ | ------------ |
    | Socket    | Vector | `self`       |
    | Parameter | `mode` | `'EXTERNAL'` |

    Parameters
    ----------
    strength : Float, optional
        socket 'Strength' (id: Strength)

    filepath : str
        parameter `filepath`

    ies : NoneType
        parameter `ies`


    Returns
    -------
    Float
    """
    node = Node('IES Texture', {'Vector': self, 'Strength': strength}, filepath=filepath, ies=ies, mode='EXTERNAL')
    return node._out

ies_texture_internal(strength=None, filepath='', ies=None)

Node IES Texture

Fixed values

Kind Name Value
Socket Vector self
Parameter mode 'INTERNAL'

Parameters:

Name Type Description Default
strength Float

socket 'Strength' (id: Strength)

None
filepath str

parameter filepath

''
ies NoneType

parameter ies

None

Returns:

Type Description
Float
Source code in core/generated/vector.py
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
def ies_texture_internal(self, strength: Float = None, filepath = '', ies = None):
    """ > Node IES Texture

    **Fixed values**

    | Kind      | Name   | Value        |
    | --------- | ------ | ------------ |
    | Socket    | Vector | `self`       |
    | Parameter | `mode` | `'INTERNAL'` |

    Parameters
    ----------
    strength : Float, optional
        socket 'Strength' (id: Strength)

    filepath : str
        parameter `filepath`

    ies : NoneType
        parameter `ies`


    Returns
    -------
    Float
    """
    node = Node('IES Texture', {'Vector': self, 'Strength': strength}, filepath=filepath, ies=ies, mode='INTERNAL')
    return node._out

image_texture(extension='REPEAT', image=None, interpolation='Linear', projection='FLAT', projection_blend=0.0)

Node Image Texture

Fixed values

Kind Name Value
Socket Vector self

Parameters:

Name Type Description Default
extension Literal['Repeat', 'Extend', 'Clip', 'Mirror']

parameter extension

'REPEAT'
image NoneType

parameter image

None
interpolation Literal['Linear', 'Closest', 'Cubic', 'Smart']

parameter interpolation

'Linear'
projection Literal['Flat', 'Box', 'Sphere', 'Tube']

parameter projection

'FLAT'
projection_blend float

parameter projection_blend

0.0

Returns:

Type Description
Color

peer sockets: alpha_ (Float)

Source code in core/generated/vector.py
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
def image_texture(self,
                extension: Literal['REPEAT', 'EXTEND', 'CLIP', 'MIRROR'] = 'REPEAT',
                image = None,
                interpolation: Literal['Linear', 'Closest', 'Cubic', 'Smart'] = 'Linear',
                projection: Literal['FLAT', 'BOX', 'SPHERE', 'TUBE'] = 'FLAT',
                projection_blend = 0.0):
    """ > Node Image Texture

    **Fixed values**

    | Kind   | Name   | Value  |
    | ------ | ------ | ------ |
    | Socket | Vector | `self` |

    Parameters
    ----------
    extension : Literal['Repeat', 'Extend', 'Clip', 'Mirror']
        parameter `extension`

    image : NoneType
        parameter `image`

    interpolation : Literal['Linear', 'Closest', 'Cubic', 'Smart']
        parameter `interpolation`

    projection : Literal['Flat', 'Box', 'Sphere', 'Tube']
        parameter `projection`

    projection_blend : float
        parameter `projection_blend`


    Returns
    -------
    Color
        peer sockets: alpha_ (Float)

    """
    utils.check_enum_arg('Image Texture', 'extension', extension, 'image_texture', ('REPEAT', 'EXTEND', 'CLIP', 'MIRROR'))
    utils.check_enum_arg('Image Texture', 'interpolation', interpolation, 'image_texture', ('Linear', 'Closest', 'Cubic', 'Smart'))
    utils.check_enum_arg('Image Texture', 'projection', projection, 'image_texture', ('FLAT', 'BOX', 'SPHERE', 'TUBE'))
    node = Node('Image Texture', {'Vector': self}, extension=extension, image=image, interpolation=interpolation, projection=projection, projection_blend=projection_blend)
    return node._out

index_switch(*values, index=None, default_index=0)

Node Index Switch

with GeoNodes("index_switch demo") as tree:

    # Create some geometries
    geo    = Geometry()
    cube   = Mesh.Cube()
    sphere = Mesh.IcoSphere()
    cone   = Mesh.Cone()

    # Pick in this list
    pick_geo = geo.index_switch(cube, sphere, cone, index=tree.new_input("Geometry index", default_value=2))

    # Plug the result to the output
    pick_geo.out()

Parameters:

Name Type Description Default
*values Any

List of Sockets to select into

()
index Integer

socket 'Index' (Index)

None
default_index int

default idex

0

Returns:

Type Description
Socket
Source code in core/socket_class.py
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
def index_switch(self, *values, index = None, default_index: int = 0):
    """ > Node Index Switch

    ``` python
    with GeoNodes("index_switch demo") as tree:

        # Create some geometries
        geo    = Geometry()
        cube   = Mesh.Cube()
        sphere = Mesh.IcoSphere()
        cone   = Mesh.Cone()

        # Pick in this list
        pick_geo = geo.index_switch(cube, sphere, cone, index=tree.new_input("Geometry index", default_value=2))

        # Plug the result to the output
        pick_geo.out()
    ```

    Parameters
    ----------
    *values : Any
        List of Sockets to select into

    index : Integer, optional
        socket 'Index' (Index)

    default_index : int, default=0
        default idex

    Returns
    -------
    Socket
    """
    return self.IndexSwitch(self, *values, index=index, default_index=default_index)

length()

Node Vector Math

Fixed values

Kind Name Value
Socket Vector self
Parameter operation 'LENGTH'

Returns:

Type Description
Float
Source code in core/generated/vector.py
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
def length(self):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value      |
    | --------- | ----------- | ---------- |
    | Socket    | Vector      | `self`     |
    | Parameter | `operation` | `'LENGTH'` |

    Returns
    -------
    Float
    """
    node = Node('Vector Math', {'Vector': self}, operation='LENGTH')
    return node._out

less_equal(b=None)

Node Compare

Fixed values

Kind Name Value
Socket A self
Parameter data_type 'VECTOR'
Parameter mode 'ELEMENT'
Parameter operation 'LESS_EQUAL'

Parameters:

Name Type Description Default
b Vector

socket 'B' (id: B_VEC3)

None

Returns:

Type Description
Boolean
Source code in core/generated/vector.py
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
def less_equal(self, b: Vector = None):
    """ > Node Compare

    **Fixed values**

    | Kind      | Name        | Value          |
    | --------- | ----------- | -------------- |
    | Socket    | A           | `self`         |
    | Parameter | `data_type` | `'VECTOR'`     |
    | Parameter | `mode`      | `'ELEMENT'`    |
    | Parameter | `operation` | `'LESS_EQUAL'` |

    Parameters
    ----------
    b : Vector, optional
        socket 'B' (id: B_VEC3)


    Returns
    -------
    Boolean
    """
    node = Node('Compare', {'A_VEC3': self, 'B_VEC3': b}, data_type='VECTOR', mode='ELEMENT', operation='LESS_EQUAL')
    return node._out

less_than(b=None)

Node Compare

Fixed values

Kind Name Value
Socket A self
Parameter data_type 'VECTOR'
Parameter mode 'ELEMENT'
Parameter operation 'LESS_THAN'

Parameters:

Name Type Description Default
b Vector

socket 'B' (id: B_VEC3)

None

Returns:

Type Description
Boolean
Source code in core/generated/vector.py
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
def less_than(self, b: Vector = None):
    """ > Node Compare

    **Fixed values**

    | Kind      | Name        | Value         |
    | --------- | ----------- | ------------- |
    | Socket    | A           | `self`        |
    | Parameter | `data_type` | `'VECTOR'`    |
    | Parameter | `mode`      | `'ELEMENT'`   |
    | Parameter | `operation` | `'LESS_THAN'` |

    Parameters
    ----------
    b : Vector, optional
        socket 'B' (id: B_VEC3)


    Returns
    -------
    Boolean
    """
    node = Node('Compare', {'A_VEC3': self, 'B_VEC3': b}, data_type='VECTOR', mode='ELEMENT', operation='LESS_THAN')
    return node._out

Link input sockets of the node

Allow to chain input sockets linking.

Source code in core/socket_class.py
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
def link_inputs(self,
    from_node   : Node = None,
    from_panel  : str = "",
    *,
    include     : list =  None,
    exclude     : list  = [],
    panel       : str = "",
    ):
    """ Link input sockets of the node

    Allow to chain input sockets linking.
    """
    self.node.link_inputs(from_node, from_panel=from_panel, include=include, exclude=exclude, panel=panel)
    return self

Link panel input sockets of the node

Allow to chain input sockets linking.

Source code in core/socket_class.py
1021
1022
1023
1024
1025
1026
1027
def link_panel(self, panel: str, from_node : Node = None):
    """ Link panel input sockets of the node

    Allow to chain input sockets linking.
    """
    self.node.link_panel(panel, from_node=from_node)
    return self

map_range(from_min=None, from_max=None, to_min=None, to_max=None, clamp=True, interpolation_type='LINEAR')

Node Map Range

Fixed values

Kind Name Value
Socket Vector self
Parameter data_type 'FLOAT_VECTOR'

Parameters:

Name Type Description Default
from_min Vector

socket 'From Min' (id: From_Min_FLOAT3)

None
from_max Vector

socket 'From Max' (id: From_Max_FLOAT3)

None
to_min Vector

socket 'To Min' (id: To_Min_FLOAT3)

None
to_max Vector

socket 'To Max' (id: To_Max_FLOAT3)

None
clamp bool

parameter clamp

True
interpolation_type Literal['Linear', 'Stepped Linear', 'Smooth Step', 'Smoother Step']

parameter interpolation_type

'LINEAR'

Returns:

Type Description
Vector
Source code in core/generated/vector.py
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
def map_range(self,
                from_min: Vector = None,
                from_max: Vector = None,
                to_min: Vector = None,
                to_max: Vector = None,
                clamp = True,
                interpolation_type: Literal['LINEAR', 'STEPPED', 'SMOOTHSTEP', 'SMOOTHERSTEP'] = 'LINEAR'):
    """ > Node Map Range

    **Fixed values**

    | Kind      | Name        | Value            |
    | --------- | ----------- | ---------------- |
    | Socket    | Vector      | `self`           |
    | Parameter | `data_type` | `'FLOAT_VECTOR'` |

    Parameters
    ----------
    from_min : Vector, optional
        socket 'From Min' (id: From_Min_FLOAT3)

    from_max : Vector, optional
        socket 'From Max' (id: From_Max_FLOAT3)

    to_min : Vector, optional
        socket 'To Min' (id: To_Min_FLOAT3)

    to_max : Vector, optional
        socket 'To Max' (id: To_Max_FLOAT3)

    clamp : bool
        parameter `clamp`

    interpolation_type : Literal['Linear', 'Stepped Linear', 'Smooth Step', 'Smoother Step']
        parameter `interpolation_type`


    Returns
    -------
    Vector
    """
    utils.check_enum_arg('Map Range', 'interpolation_type', interpolation_type, 'map_range', ('LINEAR', 'STEPPED', 'SMOOTHSTEP', 'SMOOTHERSTEP'))
    node = Node('Map Range', {'Vector': self, 'From_Min_FLOAT3': from_min, 'From_Max_FLOAT3': from_max, 'To_Min_FLOAT3': to_min, 'To_Max_FLOAT3': to_max}, clamp=clamp, data_type='FLOAT_VECTOR', interpolation_type=interpolation_type)
    return node._out

mapping(location=None, rotation=None, scale=None, vector_type='POINT')

Node Mapping

ShaderNodes only

Parameters:

Name Type Description Default
location Vector

socket 'Location' (Location)

None
rotation Vector

socket 'Rotation' (Rotation)

None
scale Vector

socket 'Scale' (Scale)

None
vector_type str

Node.vector_type in ('POINT', 'TEXTURE', 'VECTOR', 'NORMAL')

'POINT'

Returns:

Type Description
Vector
Source code in core/sock_vector.py
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
def mapping(self, location=None, rotation=None, scale=None, vector_type='POINT'):
    """ > Node Mapping

    > ShaderNodes only

    Parameters
    ----------
    location : Vector
        socket 'Location' (Location)

    rotation : Vector
        socket 'Rotation' (Rotation)

    scale : Vector
        socket 'Scale' (Scale)

    vector_type : str
        Node.vector_type in ('POINT', 'TEXTURE', 'VECTOR', 'NORMAL')


    Returns
    -------
    Vector
    """
    node = Node('Mapping', {'Vector': self, 'Location': location, 'Rotation': rotation, 'Scale': scale}, vector_type=vector_type)
    return node._out

max(vector=None)

Node Vector Math

Fixed values

Kind Name Value
Socket Vector self
Parameter operation 'MAXIMUM'

Parameters:

Name Type Description Default
vector Vector

socket 'Vector' (id: Vector_001)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
def max(self, vector: Vector = None):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value       |
    | --------- | ----------- | ----------- |
    | Socket    | Vector      | `self`      |
    | Parameter | `operation` | `'MAXIMUM'` |

    Parameters
    ----------
    vector : Vector, optional
        socket 'Vector' (id: Vector_001)


    Returns
    -------
    Vector
    """
    node = Node('Vector Math', {'Vector': self, 'Vector_001': vector}, operation='MAXIMUM')
    return node._out

menu_switch(self_name='Self', named_sockets={}, default_menu=None, **sockets)

Node Menu Switch

[&NO_JUMP]

Self is connected to the first menu item with the name provided as argument.

The items of the Menu Switch node are provided in the 'items' dict. An group input socket named after the 'name' argument is linked to menu selector.

Parameters:

Name Type Description Default
named_sockets dict

sockets to create default={}.

{}
default_menu str

default menu value default=None.

None
sockets dict

items

{}

Returns:

Type Description
Socket
Source code in core/socket_class.py
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
def menu_switch(self,
            self_name       : str = 'Self', 
            named_sockets   : dict = {},
            default_menu    : str = None,
            **sockets):
    """ > Node Menu Switch

    [&NO_JUMP]

    Self is connected to the first menu item with the name provided as argument.

    The items of the Menu Switch node are provided in the 'items' dict.
    An group input socket named after the 'name' argument is linked to menu selector.

    Parameters
    ----------
    named_sockets : dict, optional
        sockets to create default={}.

    default_menu : str, optional
        default menu value default=None.

    sockets : dict
        items


    Returns
    -------
    Socket
    """        
    return self.MenuSwitch(named_sockets = {self_name: self, **named_sockets}, default_menu=default_menu, **sockets)

min(vector=None)

Node Vector Math

Fixed values

Kind Name Value
Socket Vector self
Parameter operation 'MINIMUM'

Parameters:

Name Type Description Default
vector Vector

socket 'Vector' (id: Vector_001)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
def min(self, vector: Vector = None):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value       |
    | --------- | ----------- | ----------- |
    | Socket    | Vector      | `self`      |
    | Parameter | `operation` | `'MINIMUM'` |

    Parameters
    ----------
    vector : Vector, optional
        socket 'Vector' (id: Vector_001)


    Returns
    -------
    Vector
    """
    node = Node('Vector Math', {'Vector': self, 'Vector_001': vector}, operation='MINIMUM')
    return node._out

mix(b=None, factor=None, clamp_factor=True)

Method Mix

[NOTE] Call mix_uniform or mix_non_uniform depending on the factor type

Information
  • Socket 'A' : self
  • Parameter 'blend_type' : 'MIX'
  • Parameter 'clamp_result' : False
  • Parameter 'data_type' : 'VECTOR'
  • Parameter 'factor_mode' : 'UNIFORM' or 'NON_UNIFORM' depending on factor argument

Parameters:

Name Type Description Default
b Vector

socket 'B' (id: B_Vector)

None
factor Float or Vector

socket 'Factor'

None
clamp_factor bool

parameter 'clamp_factor'

True

Returns:

Type Description
Vector
Source code in core/sock_vector.py
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
def mix(self, b=None, factor=None, clamp_factor=True):
    """ > Method Mix

    > [NOTE]
    > Call mix_uniform or mix_non_uniform depending on the factor type

    Information
    -----------
    - Socket 'A' : self
    - Parameter 'blend_type' : 'MIX'
    - Parameter 'clamp_result' : False
    - Parameter 'data_type' : 'VECTOR'
    - Parameter 'factor_mode' : 'UNIFORM' or 'NON_UNIFORM' depending on factor argument

    Parameters
    ----------
    b : Vector
        socket 'B' (id: B_Vector)

    factor : Float or Vector
        socket 'Factor'

    clamp_factor : bool
        parameter 'clamp_factor'


    Returns
    -------
    Vector
    """
    if utils.is_vector_like(factor):
        return self.mix_non_uniform(b, factor=factor, clamp_factor=clamp_factor)
    else:
        return self.mix_uniform(b, factor=factor, clamp_factor=clamp_factor)

mix_non_uniform(b=None, factor=None, clamp_factor=True)

Node Mix

Fixed values

Kind Name Value
Socket A self
Parameter blend_type 'MIX'
Parameter clamp_result False
Parameter data_type 'VECTOR'
Parameter factor_mode 'NON_UNIFORM'

Parameters:

Name Type Description Default
b Vector

socket 'B' (id: B_Vector)

None
factor Vector

socket 'Factor' (id: Factor_Vector)

None
clamp_factor bool

parameter clamp_factor

True

Returns:

Type Description
Vector
Source code in core/generated/vector.py
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
def mix_non_uniform(self, b: Vector = None, factor: Vector = None, clamp_factor = True):
    """ > Node Mix

    **Fixed values**

    | Kind      | Name           | Value           |
    | --------- | -------------- | --------------- |
    | Socket    | A              | `self`          |
    | Parameter | `blend_type`   | `'MIX'`         |
    | Parameter | `clamp_result` | `False`         |
    | Parameter | `data_type`    | `'VECTOR'`      |
    | Parameter | `factor_mode`  | `'NON_UNIFORM'` |

    Parameters
    ----------
    b : Vector, optional
        socket 'B' (id: B_Vector)

    factor : Vector, optional
        socket 'Factor' (id: Factor_Vector)

    clamp_factor : bool
        parameter `clamp_factor`


    Returns
    -------
    Vector
    """
    node = Node('Mix', {'A_Vector': self, 'B_Vector': b, 'Factor_Vector': factor}, blend_type='MIX', clamp_factor=clamp_factor, clamp_result=False, data_type='VECTOR', factor_mode='NON_UNIFORM')
    return node._out

mix_uniform(b=None, factor=None, clamp_factor=True)

Node Mix

Fixed values

Kind Name Value
Socket A self
Parameter blend_type 'MIX'
Parameter clamp_result False
Parameter data_type 'VECTOR'
Parameter factor_mode 'UNIFORM'

Parameters:

Name Type Description Default
b Vector

socket 'B' (id: B_Vector)

None
factor Float

socket 'Factor' (id: Factor_Float)

None
clamp_factor bool

parameter clamp_factor

True

Returns:

Type Description
Vector
Source code in core/generated/vector.py
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
def mix_uniform(self, b: Vector = None, factor: Float = None, clamp_factor = True):
    """ > Node Mix

    **Fixed values**

    | Kind      | Name           | Value       |
    | --------- | -------------- | ----------- |
    | Socket    | A              | `self`      |
    | Parameter | `blend_type`   | `'MIX'`     |
    | Parameter | `clamp_result` | `False`     |
    | Parameter | `data_type`    | `'VECTOR'`  |
    | Parameter | `factor_mode`  | `'UNIFORM'` |

    Parameters
    ----------
    b : Vector, optional
        socket 'B' (id: B_Vector)

    factor : Float, optional
        socket 'Factor' (id: Factor_Float)

    clamp_factor : bool
        parameter `clamp_factor`


    Returns
    -------
    Vector
    """
    node = Node('Mix', {'A_Vector': self, 'B_Vector': b, 'Factor_Float': factor}, blend_type='MIX', clamp_factor=clamp_factor, clamp_result=False, data_type='VECTOR', factor_mode='UNIFORM')
    return node._out

modulo(vector=None)

Node Vector Math

Fixed values

Kind Name Value
Socket Vector self
Parameter operation 'MODULO'

Parameters:

Name Type Description Default
vector Vector

socket 'Vector' (id: Vector_001)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
def modulo(self, vector: Vector = None):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value      |
    | --------- | ----------- | ---------- |
    | Socket    | Vector      | `self`     |
    | Parameter | `operation` | `'MODULO'` |

    Parameters
    ----------
    vector : Vector, optional
        socket 'Vector' (id: Vector_001)


    Returns
    -------
    Vector
    """
    node = Node('Vector Math', {'Vector': self, 'Vector_001': vector}, operation='MODULO')
    return node._out

multiply(vector=None)

Node Vector Math

Fixed values

Kind Name Value
Socket Vector self
Parameter operation 'MULTIPLY'

Parameters:

Name Type Description Default
vector Vector

socket 'Vector' (id: Vector_001)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
def multiply(self, vector: Vector = None):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value        |
    | --------- | ----------- | ------------ |
    | Socket    | Vector      | `self`       |
    | Parameter | `operation` | `'MULTIPLY'` |

    Parameters
    ----------
    vector : Vector, optional
        socket 'Vector' (id: Vector_001)


    Returns
    -------
    Vector
    """
    node = Node('Vector Math', {'Vector': self, 'Vector_001': vector}, operation='MULTIPLY')
    return node._out

multiply_add(multiplier=None, addend=None)

Node Vector Math

Fixed values

Kind Name Value
Socket Vector self
Parameter operation 'MULTIPLY_ADD'

Parameters:

Name Type Description Default
multiplier Vector

socket 'Multiplier' (id: Vector_001)

None
addend Vector

socket 'Addend' (id: Vector_002)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
def multiply_add(self, multiplier: Vector = None, addend: Vector = None):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value            |
    | --------- | ----------- | ---------------- |
    | Socket    | Vector      | `self`           |
    | Parameter | `operation` | `'MULTIPLY_ADD'` |

    Parameters
    ----------
    multiplier : Vector, optional
        socket 'Multiplier' (id: Vector_001)

    addend : Vector, optional
        socket 'Addend' (id: Vector_002)


    Returns
    -------
    Vector
    """
    node = Node('Vector Math', {'Vector': self, 'Vector_001': multiplier, 'Vector_002': addend}, operation='MULTIPLY_ADD')
    return node._out

normal()

Node Normal

ShaderNodes only

Returns:

Type Description
Vector
Source code in core/sock_vector.py
448
449
450
451
452
453
454
455
456
457
458
def normal(self):
    """ > Node Normal

    > ShaderNodes only

    Returns
    -------
    Vector
    """
    node = Node('Normal', {'Normal': self})
    return node._out

normalize()

Node Vector Math

Fixed values

Kind Name Value
Socket Vector self
Parameter operation 'NORMALIZE'

Returns:

Type Description
Vector
Source code in core/generated/vector.py
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
def normalize(self):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value         |
    | --------- | ----------- | ------------- |
    | Socket    | Vector      | `self`        |
    | Parameter | `operation` | `'NORMALIZE'` |

    Returns
    -------
    Vector
    """
    node = Node('Vector Math', {'Vector': self}, operation='NORMALIZE')
    return node._out

not_equal(b=None, epsilon=None)

Node Compare

Fixed values

Kind Name Value
Socket A self
Parameter data_type 'VECTOR'
Parameter mode 'ELEMENT'
Parameter operation 'NOT_EQUAL'

Parameters:

Name Type Description Default
b Vector

socket 'B' (id: B_VEC3)

None
epsilon Float

socket 'Epsilon' (id: Epsilon)

None

Returns:

Type Description
Boolean
Source code in core/generated/vector.py
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
def not_equal(self, b: Vector = None, epsilon: Float = None):
    """ > Node Compare

    **Fixed values**

    | Kind      | Name        | Value         |
    | --------- | ----------- | ------------- |
    | Socket    | A           | `self`        |
    | Parameter | `data_type` | `'VECTOR'`    |
    | Parameter | `mode`      | `'ELEMENT'`   |
    | Parameter | `operation` | `'NOT_EQUAL'` |

    Parameters
    ----------
    b : Vector, optional
        socket 'B' (id: B_VEC3)

    epsilon : Float, optional
        socket 'Epsilon' (id: Epsilon)


    Returns
    -------
    Boolean
    """
    node = Node('Compare', {'A_VEC3': self, 'B_VEC3': b, 'Epsilon': epsilon}, data_type='VECTOR', mode='ELEMENT', operation='NOT_EQUAL')
    return node._out

out(name=None, **props)

Plug the Vector to the group output

Note

Source code in core/sock_vector.py
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
def out(self, name=None, **props):
    """ > Plug the Vector to the group output

    !!! note

        - GeoNodes : the Vector is plugged as group output
        - ShaderNodes : if **name** argument is None, the vecteur is plugged
          into the `Displacement` socket of &Material Output,
          otherwise it is plugged to a AOV Output node.

    """
    if self._tree._btree.bl_idname == 'ShaderNodeTree' and not self._tree._is_group:
        if name is None:
            self._tree.set_displacement(self)
        else:
            self._tree.aov_output(name=name, color=self)
    else:
        super().out(name=name, **props)

pack_uv_islands(margin=None, rotate=None, method=None, bottom_left=None, top_right=None)

Node Pack UV Islands

Fixed values

Kind Name Value
Socket UV self
Socket Selection self[selection]

Parameters:

Name Type Description Default
margin Float

socket 'Margin' (id: Margin)

None
rotate Boolean

socket 'Rotate' (id: Rotate)

None
method menu='Bounding Box'

('Bounding Box', 'Convex Hull', 'Exact Shape')

None
bottom_left Vector

socket 'Bottom Left' (id: Bottom Left)

None
top_right Vector

socket 'Top Right' (id: Top Right)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
def pack_uv_islands(self,
                margin: Float = None,
                rotate: Boolean = None,
                method: Literal['Bounding Box', 'Convex Hull', 'Exact Shape'] = None,
                bottom_left: Vector = None,
                top_right: Vector = None):
    """ > Node Pack UV Islands

    **Fixed values**

    | Kind   | Name      | Value             |
    | ------ | --------- | ----------------- |
    | Socket | UV        | `self`            |
    | Socket | Selection | `self[selection]` |

    Parameters
    ----------
    margin : Float, optional
        socket 'Margin' (id: Margin)

    rotate : Boolean, optional
        socket 'Rotate' (id: Rotate)

    method : menu='Bounding Box', optional
        ('Bounding Box', 'Convex Hull', 'Exact Shape')

    bottom_left : Vector, optional
        socket 'Bottom Left' (id: Bottom Left)

    top_right : Vector, optional
        socket 'Top Right' (id: Top Right)


    Returns
    -------
    Vector
    """
    node = Node('Pack UV Islands', {'UV': self, 'Selection': self.get_selection(), 'Margin': margin, 'Rotate': rotate, 'Method': method, 'Bottom Left': bottom_left, 'Top Right': top_right})
    return node._out

power(exponent=None)

Node Vector Math

Fixed values

Kind Name Value
Socket Base self
Parameter operation 'POWER'

Parameters:

Name Type Description Default
exponent Vector

socket 'Exponent' (id: Vector_001)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
def power(self, exponent: Vector = None):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value     |
    | --------- | ----------- | --------- |
    | Socket    | Base        | `self`    |
    | Parameter | `operation` | `'POWER'` |

    Parameters
    ----------
    exponent : Vector, optional
        socket 'Exponent' (id: Vector_001)


    Returns
    -------
    Vector
    """
    node = Node('Vector Math', {'Vector': self, 'Vector_001': exponent}, operation='POWER')
    return node._out

project(vector=None)

Node Vector Math

Fixed values

Kind Name Value
Socket Vector self
Parameter operation 'PROJECT'

Parameters:

Name Type Description Default
vector Vector

socket 'Vector' (id: Vector_001)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
def project(self, vector: Vector = None):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value       |
    | --------- | ----------- | ----------- |
    | Socket    | Vector      | `self`      |
    | Parameter | `operation` | `'PROJECT'` |

    Parameters
    ----------
    vector : Vector, optional
        socket 'Vector' (id: Vector_001)


    Returns
    -------
    Vector
    """
    node = Node('Vector Math', {'Vector': self, 'Vector_001': vector}, operation='PROJECT')
    return node._out

prune_grid(mode=None, threshold=None)

Node Prune Grid

Fixed values

Kind Name Value
Socket Grid self
Parameter data_type 'VECTOR'

Parameters:

Name Type Description Default
mode menu='Threshold'

('Inactive', 'Threshold', 'SDF')

None
threshold Vector

socket 'Threshold' (id: Threshold)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
def prune_grid(self,
                mode: Literal['Inactive', 'Threshold', 'SDF'] = None,
                threshold: Vector = None):
    """ > Node Prune Grid

    **Fixed values**

    | Kind      | Name        | Value      |
    | --------- | ----------- | ---------- |
    | Socket    | Grid        | `self`     |
    | Parameter | `data_type` | `'VECTOR'` |

    Parameters
    ----------
    mode : menu='Threshold', optional
        ('Inactive', 'Threshold', 'SDF')

    threshold : Vector, optional
        socket 'Threshold' (id: Threshold)


    Returns
    -------
    Vector
    """
    node = Node('Prune Grid', {'Grid': self, 'Mode': mode, 'Threshold': threshold}, data_type='VECTOR')
    return node._out

radial_tiling(sides=None, roundness=None, normalize=False)

Node Radial Tiling

Fixed values

Kind Name Value
Socket Vector self

Parameters:

Name Type Description Default
sides Float

socket 'Sides' (id: Sides)

None
roundness Float

socket 'Roundness' (id: Roundness)

None
normalize bool

parameter normalize

False

Returns:

Type Description
Vector

peer sockets: segment_id_ (Float), segment_width_ (Float), segment_rotation_ (Float)

Source code in core/generated/vector.py
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
def radial_tiling(self, sides: Float = None, roundness: Float = None, normalize = False):
    """ > Node Radial Tiling

    **Fixed values**

    | Kind   | Name   | Value  |
    | ------ | ------ | ------ |
    | Socket | Vector | `self` |

    Parameters
    ----------
    sides : Float, optional
        socket 'Sides' (id: Sides)

    roundness : Float, optional
        socket 'Roundness' (id: Roundness)

    normalize : bool
        parameter `normalize`


    Returns
    -------
    Vector
        peer sockets: segment_id_ (Float), segment_width_ (Float), segment_rotation_ (Float)

    """
    node = Node('Radial Tiling', {'Vector': self, 'Sides': sides, 'Roundness': roundness}, normalize=normalize)
    return node._out

raycast(direction=None, length=None, only_local=False)

Node Raycast

Fixed values

Kind Name Value
Socket Position self

Parameters:

Name Type Description Default
direction Vector

socket 'Direction' (id: Direction)

None
length Float

socket 'Length' (id: Length)

None
only_local bool

parameter only_local

False

Returns:

Type Description
Float

peer sockets: self_hit_ (Float), hit_distance_ (Float), hit_position_ (Vector), hit_normal_ (Vector)

Source code in core/generated/vector.py
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
def raycast(self, direction: Vector = None, length: Float = None, only_local = False):
    """ > Node Raycast

    **Fixed values**

    | Kind   | Name     | Value  |
    | ------ | -------- | ------ |
    | Socket | Position | `self` |

    Parameters
    ----------
    direction : Vector, optional
        socket 'Direction' (id: Direction)

    length : Float, optional
        socket 'Length' (id: Length)

    only_local : bool
        parameter `only_local`


    Returns
    -------
    Float
        peer sockets: self_hit_ (Float), hit_distance_ (Float), hit_position_ (Vector), hit_normal_ (Vector)

    """
    node = Node('Raycast', {'Position': self, 'Direction': direction, 'Length': length}, only_local=only_local)
    return node._out

reflect(vector=None)

Node Vector Math

Fixed values

Kind Name Value
Socket Vector self
Parameter operation 'REFLECT'

Parameters:

Name Type Description Default
vector Vector

socket 'Vector' (id: Vector_001)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
def reflect(self, vector: Vector = None):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value       |
    | --------- | ----------- | ----------- |
    | Socket    | Vector      | `self`      |
    | Parameter | `operation` | `'REFLECT'` |

    Parameters
    ----------
    vector : Vector, optional
        socket 'Vector' (id: Vector_001)


    Returns
    -------
    Vector
    """
    node = Node('Vector Math', {'Vector': self, 'Vector_001': vector}, operation='REFLECT')
    return node._out

refract(vector=None, ior=None)

Node Vector Math

Fixed values

Kind Name Value
Socket Vector self
Parameter operation 'REFRACT'

Parameters:

Name Type Description Default
vector Vector

socket 'Vector' (id: Vector_001)

None
ior Float

socket 'IOR' (id: Scale)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
def refract(self, vector: Vector = None, ior: Float = None):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value       |
    | --------- | ----------- | ----------- |
    | Socket    | Vector      | `self`      |
    | Parameter | `operation` | `'REFRACT'` |

    Parameters
    ----------
    vector : Vector, optional
        socket 'Vector' (id: Vector_001)

    ior : Float, optional
        socket 'IOR' (id: Scale)


    Returns
    -------
    Vector
    """
    node = Node('Vector Math', {'Vector': self, 'Vector_001': vector, 'Scale': ior}, operation='REFRACT')
    return node._out

repeat(iterations=1, named_sockets={}, **sockets)

Repeat zone

Parameters:

Name Type Description Default
iterations Integer

iteration socket

1
named_sockets dict

named sockets

{}
sockets dict

other sockets

{}

Returns:

Type Description
ZoneIterator
Source code in core/socket_class.py
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
def repeat(self, iterations=1, named_sockets: dict={}, **sockets):
    """ Repeat zone

    Parameters
    ----------
    iterations : Integer, default=1
        iteration socket

    named_sockets : dict, default={}
        named sockets

    sockets : dict, optional
        other sockets


    Returns
    -------
    ZoneIterator
    """
    class_name = type(self).__name__
    node = ZoneNode("Repeat", named_sockets={class_name: self, **named_sockets}, Iterations=iterations, **sockets)
    return ZoneIterator(self, node)

rotate(center=None, axis=None, angle=None, invert=False, rotation_type='AXIS_ANGLE')

Node Vector Rotate

Fixed values

Kind Name Value
Socket Vector self

Parameters:

Name Type Description Default
center Vector

socket 'Center' (id: Center)

None
axis Vector

socket 'Axis' (id: Axis)

None
angle Float

socket 'Angle' (id: Angle)

None
invert bool

parameter invert

False
rotation_type Literal['Axis Angle', 'X Axis', 'Y Axis', 'Z Axis', 'Euler']

parameter rotation_type

'AXIS_ANGLE'

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
def rotate(self,
                center: Vector = None,
                axis: Vector = None,
                angle: Float = None,
                invert = False,
                rotation_type: Literal['AXIS_ANGLE', 'X_AXIS', 'Y_AXIS', 'Z_AXIS', 'EULER_XYZ'] = 'AXIS_ANGLE'):
    """ > Node Vector Rotate

    **Fixed values**

    | Kind   | Name   | Value  |
    | ------ | ------ | ------ |
    | Socket | Vector | `self` |

    Parameters
    ----------
    center : Vector, optional
        socket 'Center' (id: Center)

    axis : Vector, optional
        socket 'Axis' (id: Axis)

    angle : Float, optional
        socket 'Angle' (id: Angle)

    invert : bool
        parameter `invert`

    rotation_type : Literal['Axis Angle', 'X Axis', 'Y Axis', 'Z Axis', 'Euler']
        parameter `rotation_type`


    Returns
    -------
    Vector
    """
    utils.check_enum_arg('Vector Rotate', 'rotation_type', rotation_type, 'rotate', ('AXIS_ANGLE', 'X_AXIS', 'Y_AXIS', 'Z_AXIS', 'EULER_XYZ'))
    node = Node('Vector Rotate', {'Vector': self, 'Center': center, 'Axis': axis, 'Angle': angle}, invert=invert, rotation_type=rotation_type)
    return node._out

rotate_axis_angle(center=None, axis=None, angle=None, invert=False)

Node Vector Rotate

Fixed values

Kind Name Value
Socket Vector self
Parameter rotation_type 'AXIS_ANGLE'

Parameters:

Name Type Description Default
center Vector

socket 'Center' (id: Center)

None
axis Vector

socket 'Axis' (id: Axis)

None
angle Float

socket 'Angle' (id: Angle)

None
invert bool

parameter invert

False

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
def rotate_axis_angle(self,
                center: Vector = None,
                axis: Vector = None,
                angle: Float = None,
                invert = False):
    """ > Node Vector Rotate

    **Fixed values**

    | Kind      | Name            | Value          |
    | --------- | --------------- | -------------- |
    | Socket    | Vector          | `self`         |
    | Parameter | `rotation_type` | `'AXIS_ANGLE'` |

    Parameters
    ----------
    center : Vector, optional
        socket 'Center' (id: Center)

    axis : Vector, optional
        socket 'Axis' (id: Axis)

    angle : Float, optional
        socket 'Angle' (id: Angle)

    invert : bool
        parameter `invert`


    Returns
    -------
    Vector
    """
    node = Node('Vector Rotate', {'Vector': self, 'Center': center, 'Axis': axis, 'Angle': angle}, invert=invert, rotation_type='AXIS_ANGLE')
    return node._out

rotate_euler_xyz(center=None, rotation=None, invert=False)

Node Vector Rotate

Fixed values

Kind Name Value
Socket Vector self
Parameter rotation_type 'EULER_XYZ'

Parameters:

Name Type Description Default
center Vector

socket 'Center' (id: Center)

None
rotation Vector

socket 'Rotation' (id: Rotation)

None
invert bool

parameter invert

False

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
def rotate_euler_xyz(self, center: Vector = None, rotation: Vector = None, invert = False):
    """ > Node Vector Rotate

    **Fixed values**

    | Kind      | Name            | Value         |
    | --------- | --------------- | ------------- |
    | Socket    | Vector          | `self`        |
    | Parameter | `rotation_type` | `'EULER_XYZ'` |

    Parameters
    ----------
    center : Vector, optional
        socket 'Center' (id: Center)

    rotation : Vector, optional
        socket 'Rotation' (id: Rotation)

    invert : bool
        parameter `invert`


    Returns
    -------
    Vector
    """
    node = Node('Vector Rotate', {'Vector': self, 'Center': center, 'Rotation': rotation}, invert=invert, rotation_type='EULER_XYZ')
    return node._out

rotate_x_axis(center=None, angle=None, invert=False)

Node Vector Rotate

Fixed values

Kind Name Value
Socket Vector self
Parameter rotation_type 'X_AXIS'

Parameters:

Name Type Description Default
center Vector

socket 'Center' (id: Center)

None
angle Float

socket 'Angle' (id: Angle)

None
invert bool

parameter invert

False

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
def rotate_x_axis(self, center: Vector = None, angle: Float = None, invert = False):
    """ > Node Vector Rotate

    **Fixed values**

    | Kind      | Name            | Value      |
    | --------- | --------------- | ---------- |
    | Socket    | Vector          | `self`     |
    | Parameter | `rotation_type` | `'X_AXIS'` |

    Parameters
    ----------
    center : Vector, optional
        socket 'Center' (id: Center)

    angle : Float, optional
        socket 'Angle' (id: Angle)

    invert : bool
        parameter `invert`


    Returns
    -------
    Vector
    """
    node = Node('Vector Rotate', {'Vector': self, 'Center': center, 'Angle': angle}, invert=invert, rotation_type='X_AXIS')
    return node._out

rotate_y_axis(center=None, angle=None, invert=False)

Node Vector Rotate

Fixed values

Kind Name Value
Socket Vector self
Parameter rotation_type 'Y_AXIS'

Parameters:

Name Type Description Default
center Vector

socket 'Center' (id: Center)

None
angle Float

socket 'Angle' (id: Angle)

None
invert bool

parameter invert

False

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
def rotate_y_axis(self, center: Vector = None, angle: Float = None, invert = False):
    """ > Node Vector Rotate

    **Fixed values**

    | Kind      | Name            | Value      |
    | --------- | --------------- | ---------- |
    | Socket    | Vector          | `self`     |
    | Parameter | `rotation_type` | `'Y_AXIS'` |

    Parameters
    ----------
    center : Vector, optional
        socket 'Center' (id: Center)

    angle : Float, optional
        socket 'Angle' (id: Angle)

    invert : bool
        parameter `invert`


    Returns
    -------
    Vector
    """
    node = Node('Vector Rotate', {'Vector': self, 'Center': center, 'Angle': angle}, invert=invert, rotation_type='Y_AXIS')
    return node._out

rotate_z_axis(center=None, angle=None, invert=False)

Node Vector Rotate

Fixed values

Kind Name Value
Socket Vector self
Parameter rotation_type 'Z_AXIS'

Parameters:

Name Type Description Default
center Vector

socket 'Center' (id: Center)

None
angle Float

socket 'Angle' (id: Angle)

None
invert bool

parameter invert

False

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
def rotate_z_axis(self, center: Vector = None, angle: Float = None, invert = False):
    """ > Node Vector Rotate

    **Fixed values**

    | Kind      | Name            | Value      |
    | --------- | --------------- | ---------- |
    | Socket    | Vector          | `self`     |
    | Parameter | `rotation_type` | `'Z_AXIS'` |

    Parameters
    ----------
    center : Vector, optional
        socket 'Center' (id: Center)

    angle : Float, optional
        socket 'Angle' (id: Angle)

    invert : bool
        parameter `invert`


    Returns
    -------
    Vector
    """
    node = Node('Vector Rotate', {'Vector': self, 'Center': center, 'Angle': angle}, invert=invert, rotation_type='Z_AXIS')
    return node._out

round()

Node Vector Math

Fixed values

Kind Name Value
Socket Vector self
Parameter operation 'ROUND'

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
def round(self):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value     |
    | --------- | ----------- | --------- |
    | Socket    | Vector      | `self`    |
    | Parameter | `operation` | `'ROUND'` |

    Returns
    -------
    Vector
    """
    node = Node('Vector Math', {'Vector': self}, operation='ROUND')
    return node._out

sample_grid(position=None, interpolation=None)

Node Sample Grid

Fixed values

Kind Name Value
Socket Grid self
Parameter data_type 'VECTOR'

Parameters:

Name Type Description Default
position Vector

socket 'Position' (id: Position)

None
interpolation menu='Trilinear'

('Nearest Neighbor', 'Trilinear', 'Triquadratic')

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
def sample_grid(self,
                position: Vector = None,
                interpolation: Literal['Nearest Neighbor', 'Trilinear', 'Triquadratic'] = None):
    """ > Node Sample Grid

    **Fixed values**

    | Kind      | Name        | Value      |
    | --------- | ----------- | ---------- |
    | Socket    | Grid        | `self`     |
    | Parameter | `data_type` | `'VECTOR'` |

    Parameters
    ----------
    position : Vector, optional
        socket 'Position' (id: Position)

    interpolation : menu='Trilinear', optional
        ('Nearest Neighbor', 'Trilinear', 'Triquadratic')


    Returns
    -------
    Vector
    """
    node = Node('Sample Grid', {'Grid': self, 'Position': position, 'Interpolation': interpolation}, data_type='VECTOR')
    return node._out

sample_grid_index(x=None, y=None, z=None)

Node Sample Grid Index

Fixed values

Kind Name Value
Socket Grid self
Parameter data_type 'VECTOR'

Parameters:

Name Type Description Default
x Integer

socket 'X' (id: X)

None
y Integer

socket 'Y' (id: Y)

None
z Integer

socket 'Z' (id: Z)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
def sample_grid_index(self, x: Integer = None, y: Integer = None, z: Integer = None):
    """ > Node Sample Grid Index

    **Fixed values**

    | Kind      | Name        | Value      |
    | --------- | ----------- | ---------- |
    | Socket    | Grid        | `self`     |
    | Parameter | `data_type` | `'VECTOR'` |

    Parameters
    ----------
    x : Integer, optional
        socket 'X' (id: X)

    y : Integer, optional
        socket 'Y' (id: Y)

    z : Integer, optional
        socket 'Z' (id: Z)


    Returns
    -------
    Vector
    """
    node = Node('Sample Grid Index', {'Grid': self, 'X': x, 'Y': y, 'Z': z}, data_type='VECTOR')
    return node._out

scale(scale=None)

Node Vector Math

Fixed values

Kind Name Value
Socket Vector self
Parameter operation 'SCALE'

Parameters:

Name Type Description Default
scale Float

socket 'Scale' (id: Scale)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
def scale(self, scale: Float = None):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value     |
    | --------- | ----------- | --------- |
    | Socket    | Vector      | `self`    |
    | Parameter | `operation` | `'SCALE'` |

    Parameters
    ----------
    scale : Float, optional
        socket 'Scale' (id: Scale)


    Returns
    -------
    Vector
    """
    node = Node('Vector Math', {'Vector': self, 'Scale': scale}, operation='SCALE')
    return node._out

separate_xyz()

Node Separate XYZ

Fixed values

Kind Name Value
Socket Vector self

Returns:

Type Description
node[x(Float), y(Float), z(Float)]
Source code in core/generated/vector.py
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
def separate_xyz(self):
    """ > Node Separate XYZ

    **Fixed values**

    | Kind   | Name   | Value  |
    | ------ | ------ | ------ |
    | Socket | Vector | `self` |

    Returns
    -------
    node [x (Float), y (Float), z (Float)]
    """
    node = self._cache('Separate XYZ', {'Vector': self})
    return node

set_grid_background(background=None, update_inactive=None)

Node Set Grid Background

Fixed values

Kind Name Value
Socket Grid self
Parameter data_type 'VECTOR'

Parameters:

Name Type Description Default
background Vector

socket 'Background' (id: Background)

None
update_inactive Boolean

socket 'Update Inactive' (id: Update Inactive)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
def set_grid_background(self, background: Vector = None, update_inactive: Boolean = None):
    """ > Node Set Grid Background

    **Fixed values**

    | Kind      | Name        | Value      |
    | --------- | ----------- | ---------- |
    | Socket    | Grid        | `self`     |
    | Parameter | `data_type` | `'VECTOR'` |

    Parameters
    ----------
    background : Vector, optional
        socket 'Background' (id: Background)

    update_inactive : Boolean, optional
        socket 'Update Inactive' (id: Update Inactive)


    Returns
    -------
    Vector
    """
    node = Node('Set Grid Background', {'Grid': self, 'Background': background, 'Update Inactive': update_inactive}, data_type='VECTOR')
    return node._out

set_grid_transform(transform=None)

Node Set Grid Transform

Fixed values

Kind Name Value
Socket Grid self
Parameter data_type 'VECTOR'

Parameters:

Name Type Description Default
transform Matrix

socket 'Transform' (id: Transform)

None

Returns:

Type Description
Boolean

peer sockets: grid_ (Vector)

Source code in core/generated/vector.py
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
def set_grid_transform(self, transform: Matrix = None):
    """ > Node Set Grid Transform

    **Fixed values**

    | Kind      | Name        | Value      |
    | --------- | ----------- | ---------- |
    | Socket    | Grid        | `self`     |
    | Parameter | `data_type` | `'VECTOR'` |

    Parameters
    ----------
    transform : Matrix, optional
        socket 'Transform' (id: Transform)


    Returns
    -------
    Boolean
        peer sockets: grid_ (Vector)

    """
    node = Node('Set Grid Transform', {'Grid': self, 'Transform': transform}, data_type='VECTOR')
    return node._out

sign()

Node Vector Math

Fixed values

Kind Name Value
Socket Vector self
Parameter operation 'SIGN'

Returns:

Type Description
Vector
Source code in core/generated/vector.py
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
def sign(self):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value    |
    | --------- | ----------- | -------- |
    | Socket    | Vector      | `self`   |
    | Parameter | `operation` | `'SIGN'` |

    Returns
    -------
    Vector
    """
    node = Node('Vector Math', {'Vector': self}, operation='SIGN')
    return node._out

simulation(named_sockets={}, **sockets)

Simulation zone

Parameters:

Name Type Description Default
named_sockets dict

named sockets

{}
sockets dict

other sockets

{}

Returns:

Type Description
ZoneIterator
Source code in core/socket_class.py
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
def simulation(self, named_sockets: dict={}, **sockets):
    """ Simulation zone

    Parameters
    ----------
    named_sockets : dict, default={}
        named sockets

    sockets : dict, optional
        other sockets

    Returns
    -------
    ZoneIterator
    """
    class_name = type(self).__name__
    node = ZoneNode("Simulation", named_sockets={class_name: self, **named_sockets}, **sockets)
    return ZoneIterator(self, node)

sin()

Node Vector Math

Fixed values

Kind Name Value
Socket Vector self
Parameter operation 'SINE'

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
def sin(self):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value    |
    | --------- | ----------- | -------- |
    | Socket    | Vector      | `self`   |
    | Parameter | `operation` | `'SINE'` |

    Returns
    -------
    Vector
    """
    node = Node('Vector Math', {'Vector': self}, operation='SINE')
    return node._out

snap(increment=None)

Node Vector Math

Fixed values

Kind Name Value
Socket Vector self
Parameter operation 'SNAP'

Parameters:

Name Type Description Default
increment Vector

socket 'Increment' (id: Vector_001)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
def snap(self, increment: Vector = None):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value    |
    | --------- | ----------- | -------- |
    | Socket    | Vector      | `self`   |
    | Parameter | `operation` | `'SNAP'` |

    Parameters
    ----------
    increment : Vector, optional
        socket 'Increment' (id: Vector_001)


    Returns
    -------
    Vector
    """
    node = Node('Vector Math', {'Vector': self, 'Vector_001': increment}, operation='SNAP')
    return node._out

subtract(vector=None)

Node Vector Math

Fixed values

Kind Name Value
Socket Vector self
Parameter operation 'SUBTRACT'

Parameters:

Name Type Description Default
vector Vector

socket 'Vector' (id: Vector_001)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
def subtract(self, vector: Vector = None):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value        |
    | --------- | ----------- | ------------ |
    | Socket    | Vector      | `self`       |
    | Parameter | `operation` | `'SUBTRACT'` |

    Parameters
    ----------
    vector : Vector, optional
        socket 'Vector' (id: Vector_001)


    Returns
    -------
    Vector
    """
    node = Node('Vector Math', {'Vector': self, 'Vector_001': vector}, operation='SUBTRACT')
    return node._out

switch(condition=None, true=None)

Node Switch

Self is connected to 'false' socket.

Note

switch returns self if global constant SWITCH_JUMP = True (default) set SWITCH_JUMP = False for legacy behavior

with GeoNodes("Switch demo"):

    from geonodes.core import constants
    # Legacy behavior (default is True)
    constants.SWITCH_JUMP = False

    choice = Boolean(True, "Use Sphere")

    # Two possible geometries
    cube   = Mesh.Cube()
    sphere = Mesh.IcoSphere()

    # Select
    # Legacy behavior: cube is unchanged otherwise cube
    geo = cube.switch(choice, sphere)

    # To group output
    geo.out()
Information
  • Socket 'False' : self

Parameters:

Name Type Description Default
condition Boolean

socket 'Switch' (Switch)

None
true

socket 'True' (True)

None

Returns:

Type Description
Socket(self)
Source code in core/socket_class.py
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
def switch(self, condition=None, true=None):
    """ > Node Switch

    Self is connected to 'false' socket.

    !!! note
        switch returns self if global constant SWITCH_JUMP = True (default)
        set SWITCH_JUMP = False for legacy behavior

    ``` python
    with GeoNodes("Switch demo"):

        from geonodes.core import constants
        # Legacy behavior (default is True)
        constants.SWITCH_JUMP = False

        choice = Boolean(True, "Use Sphere")

        # Two possible geometries
        cube   = Mesh.Cube()
        sphere = Mesh.IcoSphere()

        # Select
        # Legacy behavior: cube is unchanged otherwise cube
        geo = cube.switch(choice, sphere)

        # To group output
        geo.out()
    ```

    Information
    -----------
    - Socket 'False' : self

    Parameters
    ----------
    condition : Boolean
        socket 'Switch' (Switch)

    true
        socket 'True' (True)


    Returns
    -------
    Socket (self)
    """
    res = self.Switch(condition=condition, false=self, true=true)
    if constants.SWITCH_JUMP:
        return self._jump(res)
    else:
        return res

switch_false(condition=None, false=None)

Node Switch

[&JUMP]

Self is connected to 'true' socket.

Important

This methods behaves the inverse of switch : self is connected to "True" socket and the argument to "False", socket

Note

This method is mainly provided to cover the case when 'False' socket is None

with GeoNodes("Switch demo"):

    geo = Geometry()

    show_geometry = Boolean(False, "Merge with Cube")

    cube = Mesh.Cube()

    geo += cube.switch_false(show_geometry)

    # Is equivalent to
    geo += Geometry.Switch(show_geometry, None, cube)

    # To group output
    geo.out()

Note

This method let self socket unchanged. To set self socket to the result

Information
  • Socket 'True' : self

Parameters:

Name Type Description Default
condition Boolean

socket 'Switch' (Switch)

None
false

socket 'False' (False)

None

Returns:

Type Description
Socket
Source code in core/socket_class.py
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
def switch_false(self, condition=None, false=None):
    """ > Node Switch

    [&JUMP]

    Self is connected to 'true' socket.

    !!! important
        This methods behaves the inverse of switch : self is connected to "True" socket and  the argument to "False", socket

    !!! note
        This method is mainly provided to cover the case when 'False' socket is None

    ``` python
    with GeoNodes("Switch demo"):

        geo = Geometry()

        show_geometry = Boolean(False, "Merge with Cube")

        cube = Mesh.Cube()

        geo += cube.switch_false(show_geometry)

        # Is equivalent to
        geo += Geometry.Switch(show_geometry, None, cube)

        # To group output
        geo.out()
    ```

    !!! note
        This method let self socket unchanged. To set self socket to the result

    Information
    -----------
    - Socket 'True' : self

    Parameters
    ----------
    condition : Boolean
        socket 'Switch' (Switch)

    false
        socket 'False' (False)


    Returns
    -------
    Socket
    """
    res = self.Switch(condition=condition, false=false, true=self)
    if constants.SWITCH_JUMP:
        return self._jump(res)
    else:
        return res

tan()

Node Vector Math

Fixed values

Kind Name Value
Socket Vector self
Parameter operation 'TANGENT'

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
def tan(self):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value       |
    | --------- | ----------- | ----------- |
    | Socket    | Vector      | `self`      |
    | Parameter | `operation` | `'TANGENT'` |

    Returns
    -------
    Vector
    """
    node = Node('Vector Math', {'Vector': self}, operation='TANGENT')
    return node._out

to_rotation()

Node Euler to Rotation

Fixed values

Kind Name Value
Socket Euler self

Returns:

Type Description
Rotation
Source code in core/generated/vector.py
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
def to_rotation(self):
    """ > Node Euler to Rotation

    **Fixed values**

    | Kind   | Name  | Value  |
    | ------ | ----- | ------ |
    | Socket | Euler | `self` |

    Returns
    -------
    Rotation
    """
    node = Node('Euler to Rotation', {'Euler': self})
    return node._out

transform(convert_from='WORLD', convert_to='OBJECT', vector_type='NORMAL')

Node Vector Transform

ShaderNodes only

Parameters:

Name Type Description Default
convert_from str

Node.convert_from in ('WORLD', 'OBJECT', 'CAMERA')

'WORLD'
convert_to str

Node.convert_to in ('WORLD', 'OBJECT', 'CAMERA')

'OBJECT'
vector_type str

Node.vector_type in ('POINT', 'VECTOR', 'NORMAL')

'NORMAL'

Returns:

Type Description
Vector
Source code in core/sock_vector.py
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
def transform(self, convert_from='WORLD', convert_to='OBJECT', vector_type='NORMAL'):
    """ > Node Vector Transform

    > ShaderNodes only

    Parameters
    ----------
    convert_from : str
        Node.convert_from in ('WORLD', 'OBJECT', 'CAMERA')

    convert_to : str
        Node.convert_to in ('WORLD', 'OBJECT', 'CAMERA')

    vector_type : str
        Node.vector_type in ('POINT', 'VECTOR', 'NORMAL')


    Returns
    -------
    Vector
    """
    node = Node('Vector Transform', {'Vector': self}, convert_from=convert_from, convert_to=convert_to, vector_type=vector_type)
    return node._out

uv_tangent(method=None)

Node UV Tangent

Fixed values

Kind Name Value
Socket UV self

Parameters:

Name Type Description Default
method menu='Exact'

('Exact', 'Fast')

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
def uv_tangent(self, method: Literal['Exact', 'Fast'] = None):
    """ > Node UV Tangent

    **Fixed values**

    | Kind   | Name | Value  |
    | ------ | ---- | ------ |
    | Socket | UV   | `self` |

    Parameters
    ----------
    method : menu='Exact', optional
        ('Exact', 'Fast')


    Returns
    -------
    Vector
    """
    node = Node('UV Tangent', {'Method': method, 'UV': self})
    return node._out

vector_displacement(midlevel=None, scale=None, space='TANGENT')

Node Vector Displacement

ShaderNodes only

Parameters:

Name Type Description Default
midlevel Float

socket 'Midlevel' (Midlevel)

None
scale Float

socket 'Scale' (Scale)

None
space str

Node.space in ('TANGENT', 'OBJECT', 'WORLD')

'TANGENT'

Returns:

Type Description
Vector
Source code in core/sock_vector.py
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
def vector_displacement(self, midlevel=None, scale=None, space='TANGENT'):
    """ > Node Vector Displacement

    > ShaderNodes only

    Parameters
    ----------
    midlevel : Float
        socket 'Midlevel' (Midlevel)

    scale : Float
        socket 'Scale' (Scale)

    space : str
        Node.space in ('TANGENT', 'OBJECT', 'WORLD')


    Returns
    -------
    Vector
    """
    node = Node('Vector Displacement', {'Vector': self, 'Midlevel': midlevel, 'Scale': scale}, space=space)
    return node._out

vector_transform(convert_from='WORLD', convert_to='OBJECT', vector_type='VECTOR')

Node Vector Transform

Fixed values

Kind Name Value
Socket Vector self

Parameters:

Name Type Description Default
convert_from Literal['World', 'Object', 'Camera']

parameter convert_from

'WORLD'
convert_to Literal['World', 'Object', 'Camera']

parameter convert_to

'OBJECT'
vector_type Literal['Point', 'Vector', 'Normal']

parameter vector_type

'VECTOR'

Returns:

Type Description
Vector
Source code in core/generated/vector.py
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
def vector_transform(self,
                convert_from: Literal['WORLD', 'OBJECT', 'CAMERA'] = 'WORLD',
                convert_to: Literal['WORLD', 'OBJECT', 'CAMERA'] = 'OBJECT',
                vector_type: Literal['POINT', 'VECTOR', 'NORMAL'] = 'VECTOR'):
    """ > Node Vector Transform

    **Fixed values**

    | Kind   | Name   | Value  |
    | ------ | ------ | ------ |
    | Socket | Vector | `self` |

    Parameters
    ----------
    convert_from : Literal['World', 'Object', 'Camera']
        parameter `convert_from`

    convert_to : Literal['World', 'Object', 'Camera']
        parameter `convert_to`

    vector_type : Literal['Point', 'Vector', 'Normal']
        parameter `vector_type`


    Returns
    -------
    Vector
    """
    utils.check_enum_arg('Vector Transform', 'convert_from', convert_from, 'vector_transform', ('WORLD', 'OBJECT', 'CAMERA'))
    utils.check_enum_arg('Vector Transform', 'convert_to', convert_to, 'vector_transform', ('WORLD', 'OBJECT', 'CAMERA'))
    utils.check_enum_arg('Vector Transform', 'vector_type', vector_type, 'vector_transform', ('POINT', 'VECTOR', 'NORMAL'))
    node = Node('Vector Transform', {'Vector': self}, convert_from=convert_from, convert_to=convert_to, vector_type=vector_type)
    return node._out

voxel_index() classmethod

Node Voxel Index

Returns:

Type Description
Integer

peer sockets: y_ (Integer), z_ (Integer), is_tile_ (Boolean), extent_x_ (Integer), extent_y_ (Integer), extent_z_ (Integer)

Source code in core/generated/vector.py
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
@classmethod
def voxel_index(cls):
    """ > Node Voxel Index

    Returns
    -------
    Integer
        peer sockets: y_ (Integer), z_ (Integer), is_tile_ (Boolean), extent_x_ (Integer), extent_y_ (Integer), extent_z_ (Integer)

    """
    node = Node('Voxel Index', )
    return node._out

voxelize_grid()

Node Voxelize Grid

Fixed values

Kind Name Value
Socket Grid self
Parameter data_type 'VECTOR'

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
def voxelize_grid(self):
    """ > Node Voxelize Grid

    **Fixed values**

    | Kind      | Name        | Value      |
    | --------- | ----------- | ---------- |
    | Socket    | Grid        | `self`     |
    | Parameter | `data_type` | `'VECTOR'` |

    Returns
    -------
    Vector
    """
    node = Node('Voxelize Grid', {'Grid': self}, data_type='VECTOR')
    return node._out

wrap(max=None, min=None)

Node Vector Math

Fixed values

Kind Name Value
Socket Vector self
Parameter operation 'WRAP'

Parameters:

Name Type Description Default
max Vector

socket 'Max' (id: Vector_001)

None
min Vector

socket 'Min' (id: Vector_002)

None

Returns:

Type Description
Vector
Source code in core/generated/vector.py
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
def wrap(self, max: Vector = None, min: Vector = None):
    """ > Node Vector Math

    **Fixed values**

    | Kind      | Name        | Value    |
    | --------- | ----------- | -------- |
    | Socket    | Vector      | `self`   |
    | Parameter | `operation` | `'WRAP'` |

    Parameters
    ----------
    max : Vector, optional
        socket 'Max' (id: Vector_001)

    min : Vector, optional
        socket 'Min' (id: Vector_002)


    Returns
    -------
    Vector
    """
    node = Node('Vector Math', {'Vector': self, 'Vector_001': max, 'Vector_002': min}, operation='WRAP')
    return node._out