Skip to content

Color

Bases: Color

Color Socket.

A Color can be created in various ways: - using a triplet : col = Color((0.1, 0.2, 0.8)) - using a Combine method : col = Color.CombineHSV(hue=0.6, saturation=0.7, value=0.3) - using a color name :col = Color("red")- using an hexa value :col = Color("#0F4C8E")`

Note that because a string is interpreted as a color name, you can use the syntax Color(name) to created a named attribute. Use Color.Named(name) instead.

Note that Alpha chanel is ignored when you create a Color in a Shader.

from geonodes import GeoNodes, Mesh, Layout, Color, Texture

with GeoNodes("Color Test"):

    with Layout("Base"):
        a = Color()
        a = a.mix_darken(Color((1, 1, 1)))
        a = a.mix_multiply(Color(name="Defaut"))
        a = a.mix_burn((1, 0, 0), Color(name="Red"))
        a = a.mix(Color.CombineHSV(hue=.5, saturation=.5, value=.5))

    a.hue.out()

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

        g.points._Mixed = a.mix(Color.Named("Color"))

    with Layout("Textures"):
        c = Texture.Brick()
        c = c.mix(Texture.Checker())
        c = c.mix(Texture.Gabor())
        c = c.mix(Texture.Gradient())
        c = c.mix(Texture.Magic())
        c = c.mix(Texture.Noise())
        c = c.mix(Texture.Voronoi())
        c = c.mix(Texture.Wave())
        c = c.mix(Texture.WhiteNoise())

        g.edges._Textures = c

    g.out()
Source code in core/sock_color.py
 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
class Color(generated.Color):
    """ Color Socket.

    A Color can be created in various ways:
    - using a triplet : `col = Color((0.1, 0.2, 0.8))`
    - using a Combine method : `col = Color.CombineHSV(hue=0.6, saturation=0.7, value=0.3)
    - using a color name : `col = Color("red")`
    - using an hexa value : `col = Color("#0F4C8E")`

    Note that because a string is interpreted as a color name, you can use the syntax `Color(name)` to created
    a named attribute. Use `Color.Named(name)` instead.

    Note that Alpha chanel is ignored when you create a Color in a Shader.

    ``` python
    from geonodes import GeoNodes, Mesh, Layout, Color, Texture

    with GeoNodes("Color Test"):

        with Layout("Base"):
            a = Color()
            a = a.mix_darken(Color((1, 1, 1)))
            a = a.mix_multiply(Color(name="Defaut"))
            a = a.mix_burn((1, 0, 0), Color(name="Red"))
            a = a.mix(Color.CombineHSV(hue=.5, saturation=.5, value=.5))

        a.hue.out()

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

            g.points._Mixed = a.mix(Color.Named("Color"))

        with Layout("Textures"):
            c = Texture.Brick()
            c = c.mix(Texture.Checker())
            c = c.mix(Texture.Gabor())
            c = c.mix(Texture.Gradient())
            c = c.mix(Texture.Magic())
            c = c.mix(Texture.Noise())
            c = c.mix(Texture.Voronoi())
            c = c.mix(Texture.Wave())
            c = c.mix(Texture.WhiteNoise())

            g.edges._Textures = c

        g.out()
    ```
    """

    SOCKET_TYPE = 'RGBA'

    # ====================================================================================================
    # Constructors
    # ====================================================================================================

    @classmethod
    def ColorRamp(cls, fac=None, stops=None):
        """ Constructor : Color Ramp

        > Node Color Ramp

        Parameters
        ----------
        fac : Float

        stops : list[tuple[float, tuple]]
            Stops made of (float, color as tuple of floats)

        Returns
        -------
        Color
        """
        return ColorRamp(fac=fac, stops=stops)._out

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

    def out(self, name=None, panel: str = ""):
        """ > Connect to output

        !!! important "Behavior"

            - Geometry Nodes : create a group output socket with the provided name
            - Shader : create a node AOV Output
        """
        if self._tree._btree.bl_idname == 'ShaderNodeTree' and not self._tree._is_group:
            if name is None:
                name = 'Color'
            self._tree.aov_output(name=name, color=self)
        else:
            super().out(name=name, panel=panel)

    # ----- Input

    @classmethod
    def Attribute(cls, name):
        """ Shader node Color Attribute.

        [&SHADER]
        > Node Color Attribute

        Parameters
        ----------
        name : str
            Name of the attribute

        Returns
        -------
        Color
            'Color' socket, [alpha_]


        """
        return Node('Color Attribute', layer_name=name)._out

    def ambient_occlusion(self, distance=None, normal=None, inside=False, only_local=False, samples=16):
        """ Shader node Ambient Occlusion.

        [&SHADER]
        > Node Color Attribute

        Parameters
        ----------
        distance : Float
            socket

        inside : Vector
            socket

        inside : bool
            parameter

        only_local : bool
            parameter

        samples : int
            parameter


        Returns
        -------
        Color
            'Color' socket, [ao_]


        """
        return Node('Ambient Occlusion', {'Color': self, 'Distance': distance, 'Normal': normal}, inside=inside, only_local=only_local, samples=samples)._out

    # ----- Converter

    @classmethod
    def Blackbody(cls, temperature=None):
        """ Constructor : Black body.

        [&SHADER]
        > Node Blackbody

        Parameters
        ----------
        temperature : Float
            socket


        Returns
        -------
        Color
            'Color' socket

        """
        return Node('Blackbody', {'Temperature': temperature})._out

    @classmethod
    def FromShader(cls, shader):
        """ Constructor : Shader to RGB.

        [&SHADER]
        > Node Shader to RGB

        Parameters
        ----------
        shader : Shader
            socket


        Returns
        -------
        Color
            'Color' socket, [alpha_]

        """
        return Node('Shader to RGB', {'Shader': shader})._out

    @classmethod
    def Wavelength(cls, wavelength=None):
        """ Constructor : Wave Length.

        [&SHADER]
        > Node Wavelength

        Parameters
        ----------
        wavelength : Float
            socket


        Returns
        -------
        Color
            'Color' socket

        """
        return Node('Wavelength', {'Wavelength': wavelength})._out

    @property
    def to_bw(self):
        """ Conversion to black and white.

        [&SHADER]
        > Node RGB to BW

        Returns
        -------
        Float
            'Val' socket

        """
        return Node('RGB to BW', {'Color': self})._out

    # ----- Color

    def brightness_contrast(self, bright=None, contrast=None):
        """ Brightness and contrast.

        [&SHADER]
        > Node Brightness/Contrast

        Parameters
        ----------
        bright : Float
            socket

        contrast : Float
            socket


        Returns
        -------
        Color
            'Color' socket

        """
        return Node('Brightness/Contrast', {'Color': self, 'Bright': bright, 'Contrast': contrast})._out

    def gamma(self, gamma=None):
        """ Gamma.

        [&SHADER]
        > Node Gamma

        Parameters
        ----------
        gamma : Float
            socket


        Returns
        -------
        Color
            'Gamma' socket

        """
        node = Node('Gamma', {'Color': self, 'Gamma': gamma})
        return node._out

    def hue_saturation_value(self, hue=None, saturation=None, value=None, fac=None):
        """ Hue / saturation / value.

        [&SHADER]
        > Node Hue/Saturation/Value

        Parameters
        ----------
        hue : Float
            socket

        saturation : Float
            socket

        value : Float
            socket

        fac : Float
            socket


        Returns
        -------
        Color
            'Color' socket

        """
        node = Node('Hue/Saturation/Value', {'Hue': hue, 'Saturation': saturation, 'Value': value, 'Fac': fac, 'Color': self})
        return node._out

    def invert(self, fac=None):
        """ Invert.

        [&SHADER]
        > Node Invert Color

        Parameters
        ----------
        fac : Float
            socket


        Returns
        -------
        Color
            'Color' socket

        """
        node = Node('Invert Color', {'Fac': fac, 'Color': self})
        return node._out

    def normal_map(self, strength=None, space='TANGENT', uv_map=''):
        """ Normal map.

        [&SHADER]
        > Node Normal Map

        Parameters
        ----------
        strength : Float
            socket

        space : str, optional
            str in ('TANGENT', 'OBJECT', 'WORLD', 'BLENDER_OBJECT', 'BLENDER_WORLD') default='TANGENT'.


        Returns
        -------
        Color
            'Color' socket

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

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

        [&SHADER]
        > Node Vector Displacement

        Parameters
        ----------
        midlevel : Float
            socket

        scale : Float
            socket

        space : str, optional
            str in ('TANGENT', 'OBJECT', 'WORLD') default='TANGENT'.


        Returns
        -------
        Vector
            'Displacement' socket

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

    def curves(self, fac=None, curves=None):
        """ > Node RGB 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'

        Information
        -----------
        - Socket 'Color' : self

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

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

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

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

    @classmethod
    def _class_test(cls):

        from geonodes import GeoNodes, Mesh, Layout, Color, Texture

        with GeoNodes("Color Test"):

            with Layout("Base"):
                a = Color()
                a = a.mix_darken(Color((1, 1, 1)))
                a = a.mix_multiply(Color(name="Defaut"))
                a = a.mix_burn((1, 0, 0), Color(name="Red"))
                a = a.mix(Color.CombineHSV(hue=.5, saturation=.5, value=.5))

            a.hue.out()

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

                g.points._Mixed = a.mix(Color.Named("Color"))

            with Layout("Textures"):
                c = Texture.Brick()
                c = c.mix(Texture.Checker())
                c = c.mix(Texture.Gabor())
                c = c.mix(Texture.Gradient())
                c = c.mix(Texture.Magic())
                c = c.mix(Texture.Noise())
                c = c.mix(Texture.Voronoi())
                c = c.mix(Texture.Wave())
                c = c.mix(Texture.WhiteNoise())

                g.edges._Textures = c

            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 ""

alpha property

Node Separate Color

Fixed values

Kind Name Value
Socket Color self
Parameter mode 'RGB'

Returns:

Type Description
alpha

blue property

Node Separate Color

Fixed values

Kind Name Value
Socket Color self
Parameter mode 'RGB'

Returns:

Type Description
blue

green property

Node Separate Color

Fixed values

Kind Name Value
Socket Color self
Parameter mode 'RGB'

Returns:

Type Description
green

hsv property

Node Separate Color

Fixed values

Kind Name Value
Socket Color self
Parameter mode 'HSL'

Returns:

Type Description
tuple(Float, Float, Float, Float)

hue property

Node Separate Color

Fixed values

Kind Name Value
Socket Color self
Parameter mode 'HSV'

Returns:

Type Description
hue

is_grid property

bool property

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

lightness property

Node Separate Color

Fixed values

Kind Name Value
Socket Color self
Parameter mode 'HSL'

Returns:

Type Description
lightness

node_color property writable

Node color

Returns:

Type Description
SysColor

node_label property writable

Node Label

Returns:

Type Description
str

red property

Node Separate Color

Fixed values

Kind Name Value
Socket Color self
Parameter mode 'RGB'

Returns:

Type Description
red

rgb property

Node Separate Color

Fixed values

Kind Name Value
Socket Color self
Parameter mode 'RGB'

Returns:

Type Description
tuple(Float, Float, Float, Float)

saturation property

Node Separate Color

Fixed values

Kind Name Value
Socket Color self
Parameter mode 'HSV'

Returns:

Type Description
saturation

to_bw property

Conversion to black and white.

[&SHADER]

Node RGB to BW

Returns:

Type Description
Float

'Val' socket

value property

Node Separate Color

Fixed values

Kind Name Value
Socket Color self
Parameter mode 'HSV'

Returns:

Type Description
value

Attribute(name) classmethod

Shader node Color Attribute.

[&SHADER]

Node Color Attribute

Parameters:

Name Type Description Default
name str

Name of the attribute

required

Returns:

Type Description
Color

'Color' socket, [alpha_]

Source code in core/sock_color.py
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
@classmethod
def Attribute(cls, name):
    """ Shader node Color Attribute.

    [&SHADER]
    > Node Color Attribute

    Parameters
    ----------
    name : str
        Name of the attribute

    Returns
    -------
    Color
        'Color' socket, [alpha_]


    """
    return Node('Color Attribute', layer_name=name)._out

Blackbody(temperature=None) classmethod

Constructor : Black body.

[&SHADER]

Node Blackbody

Parameters:

Name Type Description Default
temperature Float

socket

None

Returns:

Type Description
Color

'Color' socket

Source code in core/sock_color.py
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
@classmethod
def Blackbody(cls, temperature=None):
    """ Constructor : Black body.

    [&SHADER]
    > Node Blackbody

    Parameters
    ----------
    temperature : Float
        socket


    Returns
    -------
    Color
        'Color' socket

    """
    return Node('Blackbody', {'Temperature': temperature})._out

Brick(vector=None, color1=None, color2=None, mortar=None, scale=None, mortar_size=None, mortar_smooth=None, bias=None, brick_width=None, row_height=None, offset=0.5, offset_frequency=2, squash=1.0, squash_frequency=2) classmethod

Node Brick Texture

Parameters:

Name Type Description Default
vector Vector

socket 'Vector' (id: Vector)

None
color1 Color

socket 'Color1' (id: Color1)

None
color2 Color

socket 'Color2' (id: Color2)

None
mortar Color

socket 'Mortar' (id: Mortar)

None
scale Float

socket 'Scale' (id: Scale)

None
mortar_size Float

socket 'Mortar Size' (id: Mortar Size)

None
mortar_smooth Float

socket 'Mortar Smooth' (id: Mortar Smooth)

None
bias Float

socket 'Bias' (id: Bias)

None
brick_width Float

socket 'Brick Width' (id: Brick Width)

None
row_height Float

socket 'Row Height' (id: Row Height)

None
offset float

parameter offset

0.5
offset_frequency int

parameter offset_frequency

2
squash float

parameter squash

1.0
squash_frequency int

parameter squash_frequency

2

Returns:

Type Description
Color
Source code in core/generated/color.py
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
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
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
@classmethod
def Brick(cls,
                vector: Vector = None,
                color1: Color = None,
                color2: Color = None,
                mortar: Color = None,
                scale: Float = None,
                mortar_size: Float = None,
                mortar_smooth: Float = None,
                bias: Float = None,
                brick_width: Float = None,
                row_height: Float = None,
                offset = 0.5,
                offset_frequency = 2,
                squash = 1.0,
                squash_frequency = 2):
    """ > Node Brick Texture

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

    color1 : Color, optional
        socket 'Color1' (id: Color1)

    color2 : Color, optional
        socket 'Color2' (id: Color2)

    mortar : Color, optional
        socket 'Mortar' (id: Mortar)

    scale : Float, optional
        socket 'Scale' (id: Scale)

    mortar_size : Float, optional
        socket 'Mortar Size' (id: Mortar Size)

    mortar_smooth : Float, optional
        socket 'Mortar Smooth' (id: Mortar Smooth)

    bias : Float, optional
        socket 'Bias' (id: Bias)

    brick_width : Float, optional
        socket 'Brick Width' (id: Brick Width)

    row_height : Float, optional
        socket 'Row Height' (id: Row Height)

    offset : float
        parameter `offset`

    offset_frequency : int
        parameter `offset_frequency`

    squash : float
        parameter `squash`

    squash_frequency : int
        parameter `squash_frequency`


    Returns
    -------
    Color
    """
    node = Node('Brick Texture', {'Vector': vector, 'Color1': color1, 'Color2': color2, 'Mortar': mortar, 'Scale': scale, 'Mortar Size': mortar_size, 'Mortar Smooth': mortar_smooth, 'Bias': bias, 'Brick Width': brick_width, 'Row Height': row_height}, offset=offset, offset_frequency=offset_frequency, squash=squash, squash_frequency=squash_frequency)
    return cls(node._out)

Checker(vector=None, color1=None, color2=None, scale=None) classmethod

Node Checker Texture

Parameters:

Name Type Description Default
vector Vector

socket 'Vector' (id: Vector)

None
color1 Color

socket 'Color1' (id: Color1)

None
color2 Color

socket 'Color2' (id: Color2)

None
scale Float

socket 'Scale' (id: Scale)

None

Returns:

Type Description
Color
Source code in core/generated/color.py
1502
1503
1504
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
@classmethod
def Checker(cls,
                vector: Vector = None,
                color1: Color = None,
                color2: Color = None,
                scale: Float = None):
    """ > Node Checker Texture

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

    color1 : Color, optional
        socket 'Color1' (id: Color1)

    color2 : Color, optional
        socket 'Color2' (id: Color2)

    scale : Float, optional
        socket 'Scale' (id: Scale)


    Returns
    -------
    Color
    """
    node = Node('Checker Texture', {'Vector': vector, 'Color1': color1, 'Color2': color2, 'Scale': scale})
    return cls(node._out)

ColorAttribute(layer_name='') classmethod

Node Color Attribute

Parameters:

Name Type Description Default
layer_name str

parameter layer_name

''

Returns:

Type Description
Color
Source code in core/generated/color.py
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
@classmethod
def ColorAttribute(cls, layer_name = ''):
    """ > Node Color Attribute

    Parameters
    ----------
    layer_name : str
        parameter `layer_name`


    Returns
    -------
    Color
    """
    node = Node('Color Attribute', layer_name=layer_name)
    return cls(node._out)

ColorRamp(fac=None, stops=None) classmethod

Constructor : Color Ramp

Node Color Ramp

Parameters:

Name Type Description Default
fac Float
None
stops list[tuple[float, tuple]]

Stops made of (float, color as tuple of floats)

None

Returns:

Type Description
Color
Source code in core/sock_color.py
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
@classmethod
def ColorRamp(cls, fac=None, stops=None):
    """ Constructor : Color Ramp

    > Node Color Ramp

    Parameters
    ----------
    fac : Float

    stops : list[tuple[float, tuple]]
        Stops made of (float, color as tuple of floats)

    Returns
    -------
    Color
    """
    return ColorRamp(fac=fac, stops=stops)._out

Combine(red=None, green=None, blue=None, alpha=None, mode='RGB') classmethod

Node Combine Color

Parameters:

Name Type Description Default
red Float

socket 'Red' (id: Red)

None
green Float

socket 'Green' (id: Green)

None
blue Float

socket 'Blue' (id: Blue)

None
alpha Float

socket 'Alpha' (id: Alpha)

None
mode Literal['RGB', 'HSV', 'HSL']

parameter mode

'RGB'

Returns:

Type Description
Color
Source code in core/generated/color.py
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
@classmethod
def Combine(cls,
                red: Float = None,
                green: Float = None,
                blue: Float = None,
                alpha: Float = None,
                mode: Literal['RGB', 'HSV', 'HSL'] = 'RGB'):
    """ > Node Combine Color

    Parameters
    ----------
    red : Float, optional
        socket 'Red' (id: Red)

    green : Float, optional
        socket 'Green' (id: Green)

    blue : Float, optional
        socket 'Blue' (id: Blue)

    alpha : Float, optional
        socket 'Alpha' (id: Alpha)

    mode : Literal['RGB', 'HSV', 'HSL']
        parameter `mode`


    Returns
    -------
    Color
    """
    utils.check_enum_arg('Combine Color', 'mode', mode, 'Combine', ('RGB', 'HSV', 'HSL'))
    node = Node('Combine Color', {'Red': red, 'Green': green, 'Blue': blue, 'Alpha': alpha}, mode=mode)
    return cls(node._out)

CombineHSL(hue=None, saturation=None, lightness=None, alpha=None) classmethod

Node Combine Color

Fixed values

Kind Name Value
Parameter mode 'HSL'

Parameters:

Name Type Description Default
hue Float

socket 'Hue' (id: Red)

None
saturation Float

socket 'Saturation' (id: Green)

None
lightness Float

socket 'Lightness' (id: Blue)

None
alpha Float

socket 'Alpha' (id: Alpha)

None

Returns:

Type Description
Color
Source code in core/generated/color.py
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
@classmethod
def CombineHSL(cls,
                hue: Float = None,
                saturation: Float = None,
                lightness: Float = None,
                alpha: Float = None):
    """ > Node Combine Color

    **Fixed values**

    | Kind      | Name   | Value   |
    | --------- | ------ | ------- |
    | Parameter | `mode` | `'HSL'` |

    Parameters
    ----------
    hue : Float, optional
        socket 'Hue' (id: Red)

    saturation : Float, optional
        socket 'Saturation' (id: Green)

    lightness : Float, optional
        socket 'Lightness' (id: Blue)

    alpha : Float, optional
        socket 'Alpha' (id: Alpha)


    Returns
    -------
    Color
    """
    node = Node('Combine Color', {'Red': hue, 'Green': saturation, 'Blue': lightness, 'Alpha': alpha}, mode='HSL')
    return cls(node._out)

CombineHSV(hue=None, saturation=None, value=None, alpha=None) classmethod

Node Combine Color

Fixed values

Kind Name Value
Parameter mode 'HSV'

Parameters:

Name Type Description Default
hue Float

socket 'Hue' (id: Red)

None
saturation Float

socket 'Saturation' (id: Green)

None
value Float

socket 'Value' (id: Blue)

None
alpha Float

socket 'Alpha' (id: Alpha)

None

Returns:

Type Description
Color
Source code in core/generated/color.py
 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
@classmethod
def CombineHSV(cls,
                hue: Float = None,
                saturation: Float = None,
                value: Float = None,
                alpha: Float = None):
    """ > Node Combine Color

    **Fixed values**

    | Kind      | Name   | Value   |
    | --------- | ------ | ------- |
    | Parameter | `mode` | `'HSV'` |

    Parameters
    ----------
    hue : Float, optional
        socket 'Hue' (id: Red)

    saturation : Float, optional
        socket 'Saturation' (id: Green)

    value : Float, optional
        socket 'Value' (id: Blue)

    alpha : Float, optional
        socket 'Alpha' (id: Alpha)


    Returns
    -------
    Color
    """
    node = Node('Combine Color', {'Red': hue, 'Green': saturation, 'Blue': value, 'Alpha': alpha}, mode='HSV')
    return cls(node._out)

CombineRGB(red=None, green=None, blue=None, alpha=None) classmethod

Node Combine Color

Fixed values

Kind Name Value
Parameter mode 'RGB'

Parameters:

Name Type Description Default
red Float

socket 'Red' (id: Red)

None
green Float

socket 'Green' (id: Green)

None
blue Float

socket 'Blue' (id: Blue)

None
alpha Float

socket 'Alpha' (id: Alpha)

None

Returns:

Type Description
Color
Source code in core/generated/color.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
60
61
62
63
64
65
66
67
68
69
70
@classmethod
def CombineRGB(cls,
                red: Float = None,
                green: Float = None,
                blue: Float = None,
                alpha: Float = None):
    """ > Node Combine Color

    **Fixed values**

    | Kind      | Name   | Value   |
    | --------- | ------ | ------- |
    | Parameter | `mode` | `'RGB'` |

    Parameters
    ----------
    red : Float, optional
        socket 'Red' (id: Red)

    green : Float, optional
        socket 'Green' (id: Green)

    blue : Float, optional
        socket 'Blue' (id: Blue)

    alpha : Float, optional
        socket 'Alpha' (id: Alpha)


    Returns
    -------
    Color
    """
    node = Node('Combine Color', {'Red': red, 'Green': green, 'Blue': blue, 'Alpha': alpha}, mode='RGB')
    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}"

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

FromShader(shader) classmethod

Constructor : Shader to RGB.

[&SHADER]

Node Shader to RGB

Parameters:

Name Type Description Default
shader Shader

socket

required

Returns:

Type Description
Color

'Color' socket, [alpha_]

Source code in core/sock_color.py
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
@classmethod
def FromShader(cls, shader):
    """ Constructor : Shader to RGB.

    [&SHADER]
    > Node Shader to RGB

    Parameters
    ----------
    shader : Shader
        socket


    Returns
    -------
    Color
        'Color' socket, [alpha_]

    """
    return Node('Shader to RGB', {'Shader': shader})._out

Gradient(vector=None, gradient_type='LINEAR') classmethod

Node Gradient Texture

Parameters:

Name Type Description Default
vector Vector

socket 'Vector' (id: Vector)

None
gradient_type Literal['Linear', 'Quadratic', 'Easing', 'Diagonal', 'Spherical', 'Quadratic Sphere', 'Radial']

parameter gradient_type

'LINEAR'

Returns:

Type Description
Color
Source code in core/generated/color.py
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
@classmethod
def Gradient(cls,
                vector: Vector = None,
                gradient_type: Literal['LINEAR', 'QUADRATIC', 'EASING', 'DIAGONAL', 'SPHERICAL', 'QUADRATIC_SPHERE', 'RADIAL'] = 'LINEAR'):
    """ > Node Gradient Texture

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

    gradient_type : Literal['Linear', 'Quadratic', 'Easing', 'Diagonal', 'Spherical', 'Quadratic Sphere', 'Radial']
        parameter `gradient_type`


    Returns
    -------
    Color
    """
    utils.check_enum_arg('Gradient Texture', 'gradient_type', gradient_type, 'Gradient', ('LINEAR', 'QUADRATIC', 'EASING', 'DIAGONAL', 'SPHERICAL', 'QUADRATIC_SPHERE', 'RADIAL'))
    node = Node('Gradient Texture', {'Vector': vector}, gradient_type=gradient_type)
    return cls(node._out)

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

Magic(vector=None, scale=None, distortion=None, turbulence_depth=2) classmethod

Node Magic Texture

Parameters:

Name Type Description Default
vector Vector

socket 'Vector' (id: Vector)

None
scale Float

socket 'Scale' (id: Scale)

None
distortion Float

socket 'Distortion' (id: Distortion)

None
turbulence_depth int

parameter turbulence_depth

2

Returns:

Type Description
Color
Source code in core/generated/color.py
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
@classmethod
def Magic(cls,
                vector: Vector = None,
                scale: Float = None,
                distortion: Float = None,
                turbulence_depth = 2):
    """ > Node Magic Texture

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

    scale : Float, optional
        socket 'Scale' (id: Scale)

    distortion : Float, optional
        socket 'Distortion' (id: Distortion)

    turbulence_depth : int
        parameter `turbulence_depth`


    Returns
    -------
    Color
    """
    node = Node('Magic Texture', {'Vector': vector, 'Scale': scale, 'Distortion': distortion}, turbulence_depth=turbulence_depth)
    return cls(node._out)

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_COLOR'

Parameters:

Name Type Description Default
name String

socket 'Name' (id: Name)

None

Returns:

Type Description
Color
Source code in core/generated/color.py
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
@classmethod
def Named(cls, name: String = None):
    """ > Node Named Attribute

    **Fixed values**

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

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


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

NamedAttribute(name=None) classmethod

Node Named Attribute

Fixed values

Kind Name Value
Parameter data_type 'FLOAT_COLOR'

Parameters:

Name Type Description Default
name String

socket 'Name' (id: Name)

None

Returns:

Type Description
Color
Source code in core/generated/color.py
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
@classmethod
def NamedAttribute(cls, name: String = None):
    """ > Node Named Attribute

    **Fixed values**

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

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


    Returns
    -------
    Color
    """
    node = Node('Named Attribute', {'Name': name}, data_type='FLOAT_COLOR')
    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))

SkyTexture(aerosol_density=1.0, air_density=1.0, altitude=100.0, ground_albedo=0.30000001192092896, ozone_density=1.0, sky_type='MULTIPLE_SCATTERING', sun_disc=True, sun_elevation=0.2617993950843811, sun_intensity=1.0, sun_rotation=0.0, sun_size=0.009512044489383698, turbidity=2.200000047683716) classmethod

Node Sky Texture

Parameters:

Name Type Description Default
aerosol_density float

parameter aerosol_density

1.0
air_density float

parameter air_density

1.0
altitude float

parameter altitude

100.0
ground_albedo float

parameter ground_albedo

0.30000001192092896
ozone_density float

parameter ozone_density

1.0
sky_type Literal['Single Scattering', 'Multiple Scattering', 'Preetham', 'Hosek / Wilkie']

parameter sky_type

'MULTIPLE_SCATTERING'
sun_disc bool

parameter sun_disc

True
sun_elevation float

parameter sun_elevation

0.2617993950843811
sun_intensity float

parameter sun_intensity

1.0
sun_rotation float

parameter sun_rotation

0.0
sun_size float

parameter sun_size

0.009512044489383698
turbidity float

parameter turbidity

2.200000047683716

Returns:

Type Description
Color
Source code in core/generated/color.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
2037
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
2066
@classmethod
def SkyTexture(cls,
                aerosol_density = 1.0,
                air_density = 1.0,
                altitude = 100.0,
                ground_albedo = 0.30000001192092896,
                ozone_density = 1.0,
                sky_type: Literal['SINGLE_SCATTERING', 'MULTIPLE_SCATTERING', 'PREETHAM', 'HOSEK_WILKIE'] = 'MULTIPLE_SCATTERING',
                sun_disc = True,
                sun_elevation = 0.2617993950843811,
                sun_intensity = 1.0,
                sun_rotation = 0.0,
                sun_size = 0.009512044489383698,
                turbidity = 2.200000047683716):
    """ > Node Sky Texture

    Parameters
    ----------
    aerosol_density : float
        parameter `aerosol_density`

    air_density : float
        parameter `air_density`

    altitude : float
        parameter `altitude`

    ground_albedo : float
        parameter `ground_albedo`

    ozone_density : float
        parameter `ozone_density`

    sky_type : Literal['Single Scattering', 'Multiple Scattering', 'Preetham', 'Hosek / Wilkie']
        parameter `sky_type`

    sun_disc : bool
        parameter `sun_disc`

    sun_elevation : float
        parameter `sun_elevation`

    sun_intensity : float
        parameter `sun_intensity`

    sun_rotation : float
        parameter `sun_rotation`

    sun_size : float
        parameter `sun_size`

    turbidity : float
        parameter `turbidity`


    Returns
    -------
    Color
    """
    utils.check_enum_arg('Sky Texture', 'sky_type', sky_type, 'SkyTexture', ('SINGLE_SCATTERING', 'MULTIPLE_SCATTERING', 'PREETHAM', 'HOSEK_WILKIE'))
    node = Node('Sky Texture', aerosol_density=aerosol_density, air_density=air_density, altitude=altitude, ground_albedo=ground_albedo, ozone_density=ozone_density, sky_type=sky_type, sun_disc=sun_disc, sun_elevation=sun_elevation, sun_intensity=sun_intensity, sun_rotation=sun_rotation, sun_size=sun_size, turbidity=turbidity)
    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

Wave(vector=None, scale=None, distortion=None, detail=None, detail_scale=None, detail_roughness=None, phase_offset=None, bands_direction='X', rings_direction='X', wave_profile='SIN', wave_type='BANDS') classmethod

Node Wave Texture

Parameters:

Name Type Description Default
vector Vector

socket 'Vector' (id: Vector)

None
scale Float

socket 'Scale' (id: Scale)

None
distortion Float

socket 'Distortion' (id: Distortion)

None
detail Float

socket 'Detail' (id: Detail)

None
detail_scale Float

socket 'Detail Scale' (id: Detail Scale)

None
detail_roughness Float

socket 'Detail Roughness' (id: Detail Roughness)

None
phase_offset Float

socket 'Phase Offset' (id: Phase Offset)

None
bands_direction Literal['X', 'Y', 'Z', 'Diagonal']

parameter bands_direction

'X'
rings_direction Literal['X', 'Y', 'Z', 'Spherical']

parameter rings_direction

'X'
wave_profile Literal['Sine', 'Saw', 'Triangle']

parameter wave_profile

'SIN'
wave_type Literal['Bands', 'Rings']

parameter wave_type

'BANDS'

Returns:

Type Description
Color
Source code in core/generated/color.py
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
@classmethod
def Wave(cls,
                vector: Vector = None,
                scale: Float = None,
                distortion: Float = None,
                detail: Float = None,
                detail_scale: Float = None,
                detail_roughness: Float = None,
                phase_offset: Float = None,
                bands_direction: Literal['X', 'Y', 'Z', 'DIAGONAL'] = 'X',
                rings_direction: Literal['X', 'Y', 'Z', 'SPHERICAL'] = 'X',
                wave_profile: Literal['SIN', 'SAW', 'TRI'] = 'SIN',
                wave_type: Literal['BANDS', 'RINGS'] = 'BANDS'):
    """ > Node Wave Texture

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

    scale : Float, optional
        socket 'Scale' (id: Scale)

    distortion : Float, optional
        socket 'Distortion' (id: Distortion)

    detail : Float, optional
        socket 'Detail' (id: Detail)

    detail_scale : Float, optional
        socket 'Detail Scale' (id: Detail Scale)

    detail_roughness : Float, optional
        socket 'Detail Roughness' (id: Detail Roughness)

    phase_offset : Float, optional
        socket 'Phase Offset' (id: Phase Offset)

    bands_direction : Literal['X', 'Y', 'Z', 'Diagonal']
        parameter `bands_direction`

    rings_direction : Literal['X', 'Y', 'Z', 'Spherical']
        parameter `rings_direction`

    wave_profile : Literal['Sine', 'Saw', 'Triangle']
        parameter `wave_profile`

    wave_type : Literal['Bands', 'Rings']
        parameter `wave_type`


    Returns
    -------
    Color
    """
    utils.check_enum_arg('Wave Texture', 'bands_direction', bands_direction, 'Wave', ('X', 'Y', 'Z', 'DIAGONAL'))
    utils.check_enum_arg('Wave Texture', 'rings_direction', rings_direction, 'Wave', ('X', 'Y', 'Z', 'SPHERICAL'))
    utils.check_enum_arg('Wave Texture', 'wave_profile', wave_profile, 'Wave', ('SIN', 'SAW', 'TRI'))
    utils.check_enum_arg('Wave Texture', 'wave_type', wave_type, 'Wave', ('BANDS', 'RINGS'))
    node = Node('Wave Texture', {'Vector': vector, 'Scale': scale, 'Distortion': distortion, 'Detail': detail, 'Detail Scale': detail_scale, 'Detail Roughness': detail_roughness, 'Phase Offset': phase_offset}, bands_direction=bands_direction, rings_direction=rings_direction, wave_profile=wave_profile, wave_type=wave_type)
    return cls(node._out)

Wavelength(wavelength=None) classmethod

Constructor : Wave Length.

[&SHADER]

Node Wavelength

Parameters:

Name Type Description Default
wavelength Float

socket

None

Returns:

Type Description
Color

'Color' socket

Source code in core/sock_color.py
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
@classmethod
def Wavelength(cls, wavelength=None):
    """ Constructor : Wave Length.

    [&SHADER]
    > Node Wavelength

    Parameters
    ----------
    wavelength : Float
        socket


    Returns
    -------
    Color
        'Color' socket

    """
    return Node('Wavelength', {'Wavelength': wavelength})._out

__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=(1, 1, 1), name='Color', tip='', panel='', optional_label=False, hide_value=False, hide_in_modifier=False, default_attribute='', shape='AUTO') classmethod

Color Input

New Color input with subtype 'NONE'.

Parameters:

Name Type Description Default
value object

Default value

`(1, 1, 1)`
name str

Input socket name

`Color`
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`
default_attribute str

Property default_attribute_name

`''`
shape str

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

`'AUTO'`

Returns:

Type Description
Color
Source code in core/generated/color.py
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
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
@classmethod
def _create_input_socket(cls,
    value: object = (1, 1, 1),
    name: str = 'Color',
    tip: str = '',
    panel: str = "",
    optional_label: bool = False,
    hide_value: bool = False,
    hide_in_modifier: bool = False,
    default_attribute: str = '',
    shape: Literal['AUTO', 'SINGLE'] = 'AUTO',
     ):
    """ > Color Input

    New Color input with subtype 'NONE'.

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

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

    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

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

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


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

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

    return Tree.current_tree().create_input_socket('NodeSocketColor', default_value = defval, name=name,
        tip=tip, panel=panel, optional_label=optional_label, hide_value=hide_value,
        hide_in_modifier=hide_in_modifier, default_attribute=default_attribute, shape=shape)

_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

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)

ambient_occlusion(distance=None, normal=None, inside=False, only_local=False, samples=16)

Shader node Ambient Occlusion.

[&SHADER]

Node Color Attribute

Parameters:

Name Type Description Default
distance Float

socket

None
inside Vector

socket

False
inside bool

parameter

False
only_local bool

parameter

False
samples int

parameter

16

Returns:

Type Description
Color

'Color' socket, [ao_]

Source code in core/sock_color.py
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
def ambient_occlusion(self, distance=None, normal=None, inside=False, only_local=False, samples=16):
    """ Shader node Ambient Occlusion.

    [&SHADER]
    > Node Color Attribute

    Parameters
    ----------
    distance : Float
        socket

    inside : Vector
        socket

    inside : bool
        parameter

    only_local : bool
        parameter

    samples : int
        parameter


    Returns
    -------
    Color
        'Color' socket, [ao_]


    """
    return Node('Ambient Occlusion', {'Color': self, 'Distance': distance, 'Normal': normal}, inside=inside, only_local=only_local, samples=samples)._out

aov_output(value=None, aov_name='')

Node AOV Output

Fixed values

Kind Name Value
Socket Color self

Parameters:

Name Type Description Default
value Float

socket 'Value' (id: Value)

None
aov_name str

parameter aov_name

''

Returns:

Type Description
None
Source code in core/generated/color.py
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
def aov_output(self, value: Float = None, aov_name = ''):
    """ > Node AOV Output

    **Fixed values**

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

    Parameters
    ----------
    value : Float, optional
        socket 'Value' (id: Value)

    aov_name : str
        parameter `aov_name`


    Returns
    -------
    None
    """
    node = Node('AOV Output', {'Color': self, 'Value': value}, aov_name=aov_name)
    return node._out

background(strength=None)

Node Background

Fixed values

Kind Name Value
Socket Color self

Parameters:

Name Type Description Default
strength Float

socket 'Strength' (id: Strength)

None

Returns:

Type Description
Shader
Source code in core/generated/color.py
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
def background(self, strength: Float = None):
    """ > Node Background

    **Fixed values**

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

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


    Returns
    -------
    Shader
    """
    node = Node('Background', {'Color': self, 'Strength': strength})
    return node._out

blur(iterations=None, weight=None)

Node Blur Attribute

Fixed values

Kind Name Value
Socket Value self
Parameter data_type 'FLOAT_COLOR'

Parameters:

Name Type Description Default
iterations Integer

socket 'Iterations' (id: Iterations)

None
weight Float

socket 'Weight' (id: Weight)

None

Returns:

Type Description
Color
Source code in core/generated/color.py
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
def blur(self, iterations: Integer = None, weight: Float = None):
    """ > Node Blur Attribute

    **Fixed values**

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

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

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


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

brighter(b=None)

Node Compare

Fixed values

Kind Name Value
Socket A self
Parameter data_type 'RGBA'
Parameter mode 'ELEMENT'
Parameter operation 'BRIGHTER'

Parameters:

Name Type Description Default
b Color

socket 'B' (id: B_COL)

None

Returns:

Type Description
Boolean
Source code in core/generated/color.py
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
def brighter(self, b: Color = None):
    """ > Node Compare

    **Fixed values**

    | Kind      | Name        | Value        |
    | --------- | ----------- | ------------ |
    | Socket    | A           | `self`       |
    | Parameter | `data_type` | `'RGBA'`     |
    | Parameter | `mode`      | `'ELEMENT'`  |
    | Parameter | `operation` | `'BRIGHTER'` |

    Parameters
    ----------
    b : Color, optional
        socket 'B' (id: B_COL)


    Returns
    -------
    Boolean
    """
    node = Node('Compare', {'A_COL': self, 'B_COL': b}, data_type='RGBA', mode='ELEMENT', operation='BRIGHTER')
    return node._out

brightness_contrast(bright=None, contrast=None)

Brightness and contrast.

[&SHADER]

Node Brightness/Contrast

Parameters:

Name Type Description Default
bright Float

socket

None
contrast Float

socket

None

Returns:

Type Description
Color

'Color' socket

Source code in core/sock_color.py
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
def brightness_contrast(self, bright=None, contrast=None):
    """ Brightness and contrast.

    [&SHADER]
    > Node Brightness/Contrast

    Parameters
    ----------
    bright : Float
        socket

    contrast : Float
        socket


    Returns
    -------
    Color
        'Color' socket

    """
    return Node('Brightness/Contrast', {'Color': self, 'Bright': bright, 'Contrast': contrast})._out

curves(fac=None, curves=None)

Node RGB 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'
Information
  • Socket 'Color' : 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
Color
Source code in core/sock_color.py
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
def curves(self, fac=None, curves=None):
    """ > Node RGB 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'

    Information
    -----------
    - Socket 'Color' : self

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

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

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

darker(b=None)

Node Compare

Fixed values

Kind Name Value
Socket A self
Parameter data_type 'RGBA'
Parameter mode 'ELEMENT'
Parameter operation 'DARKER'

Parameters:

Name Type Description Default
b Color

socket 'B' (id: B_COL)

None

Returns:

Type Description
Boolean
Source code in core/generated/color.py
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
def darker(self, b: Color = None):
    """ > Node Compare

    **Fixed values**

    | Kind      | Name        | Value       |
    | --------- | ----------- | ----------- |
    | Socket    | A           | `self`      |
    | Parameter | `data_type` | `'RGBA'`    |
    | Parameter | `mode`      | `'ELEMENT'` |
    | Parameter | `operation` | `'DARKER'`  |

    Parameters
    ----------
    b : Color, optional
        socket 'B' (id: B_COL)


    Returns
    -------
    Boolean
    """
    node = Node('Compare', {'A_COL': self, 'B_COL': b}, data_type='RGBA', mode='ELEMENT', operation='DARKER')
    return node._out

enable_output(enable=None)

Node Enable Output

Fixed values

Kind Name Value
Socket Value self
Parameter data_type 'RGBA'

Parameters:

Name Type Description Default
enable Boolean

socket 'Enable' (id: Enable)

None

Returns:

Type Description
Color
Source code in core/generated/color.py
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
def enable_output(self, enable: Boolean = None):
    """ > Node Enable Output

    **Fixed values**

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

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


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

equal(b=None, epsilon=None)

Node Compare

Fixed values

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

Parameters:

Name Type Description Default
b Color

socket 'B' (id: B_COL)

None
epsilon Float

socket 'Epsilon' (id: Epsilon)

None

Returns:

Type Description
Boolean
Source code in core/generated/color.py
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
def equal(self, b: Color = None, epsilon: Float = None):
    """ > Node Compare

    **Fixed values**

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

    Parameters
    ----------
    b : Color, optional
        socket 'B' (id: B_COL)

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


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

gamma(gamma=None)

Gamma.

[&SHADER]

Node Gamma

Parameters:

Name Type Description Default
gamma Float

socket

None

Returns:

Type Description
Color

'Gamma' socket

Source code in core/sock_color.py
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
def gamma(self, gamma=None):
    """ Gamma.

    [&SHADER]
    > Node Gamma

    Parameters
    ----------
    gamma : Float
        socket


    Returns
    -------
    Color
        'Gamma' socket

    """
    node = Node('Gamma', {'Color': self, 'Gamma': gamma})
    return node._out

hash_value(seed=None)

Node Hash Value

Fixed values

Kind Name Value
Socket Value self
Parameter data_type 'RGBA'

Parameters:

Name Type Description Default
seed Integer

socket 'Seed' (id: Seed)

None

Returns:

Type Description
Integer
Source code in core/generated/color.py
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
def hash_value(self, seed: Integer = None):
    """ > Node Hash Value

    **Fixed values**

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

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


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

hue_saturation_value(hue=None, saturation=None, value=None, fac=None)

Hue / saturation / value.

[&SHADER]

Node Hue/Saturation/Value

Parameters:

Name Type Description Default
hue Float

socket

None
saturation Float

socket

None
value Float

socket

None
fac Float

socket

None

Returns:

Type Description
Color

'Color' socket

Source code in core/sock_color.py
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
def hue_saturation_value(self, hue=None, saturation=None, value=None, fac=None):
    """ Hue / saturation / value.

    [&SHADER]
    > Node Hue/Saturation/Value

    Parameters
    ----------
    hue : Float
        socket

    saturation : Float
        socket

    value : Float
        socket

    fac : Float
        socket


    Returns
    -------
    Color
        'Color' socket

    """
    node = Node('Hue/Saturation/Value', {'Hue': hue, 'Saturation': saturation, 'Value': value, 'Fac': fac, 'Color': self})
    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)

invert(fac=None)

Invert.

[&SHADER]

Node Invert Color

Parameters:

Name Type Description Default
fac Float

socket

None

Returns:

Type Description
Color

'Color' socket

Source code in core/sock_color.py
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
def invert(self, fac=None):
    """ Invert.

    [&SHADER]
    > Node Invert Color

    Parameters
    ----------
    fac : Float
        socket


    Returns
    -------
    Color
        'Color' socket

    """
    node = Node('Invert Color', {'Fac': fac, 'Color': self})
    return node._out

invert_color(factor=None)

Node Invert Color

Fixed values

Kind Name Value
Socket Color self

Parameters:

Name Type Description Default
factor Float

socket 'Factor' (id: Fac)

None

Returns:

Type Description
Color
Source code in core/generated/color.py
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
def invert_color(self, factor: Float = None):
    """ > Node Invert Color

    **Fixed values**

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

    Parameters
    ----------
    factor : Float, optional
        socket 'Factor' (id: Fac)


    Returns
    -------
    Color
    """
    node = Node('Invert Color', {'Color': self, 'Fac': factor})
    return node._out

line_style_output(color_fac=None, alpha=None, alpha_fac=None, blend_type='MIX', is_active_output=True, target='ALL', use_alpha=False, use_clamp=False)

Node Line Style Output

Fixed values

Kind Name Value
Socket Color self

Parameters:

Name Type Description Default
color_fac Float

socket 'Color Fac' (id: Color Fac)

None
alpha Float

socket 'Alpha' (id: Alpha)

None
alpha_fac Float

socket 'Alpha Fac' (id: Alpha Fac)

None
blend_type Literal['Mix', 'Darken', 'Multiply', 'Color Burn', 'Lighten', 'Screen', 'Color Dodge', 'Add', 'Overlay', 'Soft Light', 'Linear Light', 'Difference', 'Exclusion', 'Subtract', 'Divide', 'Hue', 'Saturation', 'Color', 'Value']

parameter blend_type

'MIX'
is_active_output bool

parameter is_active_output

True
target Literal['All', 'EEVEE', 'Cycles']

parameter target

'ALL'
use_alpha bool

parameter use_alpha

False
use_clamp bool

parameter use_clamp

False

Returns:

Type Description
None
Source code in core/generated/color.py
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
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
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
def line_style_output(self,
                color_fac: Float = None,
                alpha: Float = None,
                alpha_fac: Float = None,
                blend_type: Literal['MIX', 'DARKEN', 'MULTIPLY', 'BURN', 'LIGHTEN', 'SCREEN', 'DODGE', 'ADD', 'OVERLAY', 'SOFT_LIGHT', 'LINEAR_LIGHT', 'DIFFERENCE', 'EXCLUSION', 'SUBTRACT', 'DIVIDE', 'HUE', 'SATURATION', 'COLOR', 'VALUE'] = 'MIX',
                is_active_output = True,
                target: Literal['ALL', 'EEVEE', 'CYCLES'] = 'ALL',
                use_alpha = False,
                use_clamp = False):
    """ > Node Line Style Output

    **Fixed values**

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

    Parameters
    ----------
    color_fac : Float, optional
        socket 'Color Fac' (id: Color Fac)

    alpha : Float, optional
        socket 'Alpha' (id: Alpha)

    alpha_fac : Float, optional
        socket 'Alpha Fac' (id: Alpha Fac)

    blend_type : Literal['Mix', 'Darken', 'Multiply', 'Color Burn', 'Lighten', 'Screen', 'Color Dodge', 'Add', 'Overlay', 'Soft Light', 'Linear Light', 'Difference', 'Exclusion', 'Subtract', 'Divide', 'Hue', 'Saturation', 'Color', 'Value']
        parameter `blend_type`

    is_active_output : bool
        parameter `is_active_output`

    target : Literal['All', 'EEVEE', 'Cycles']
        parameter `target`

    use_alpha : bool
        parameter `use_alpha`

    use_clamp : bool
        parameter `use_clamp`


    Returns
    -------
    None
    """
    utils.check_enum_arg('Line Style Output', 'blend_type', blend_type, 'line_style_output', ('MIX', 'DARKEN', 'MULTIPLY', 'BURN', 'LIGHTEN', 'SCREEN', 'DODGE', 'ADD', 'OVERLAY', 'SOFT_LIGHT', 'LINEAR_LIGHT', 'DIFFERENCE', 'EXCLUSION', 'SUBTRACT', 'DIVIDE', 'HUE', 'SATURATION', 'COLOR', 'VALUE'))
    utils.check_enum_arg('Line Style Output', 'target', target, 'line_style_output', ('ALL', 'EEVEE', 'CYCLES'))
    node = Node('Line Style Output', {'Color': self, 'Color Fac': color_fac, 'Alpha': alpha, 'Alpha Fac': alpha_fac}, blend_type=blend_type, is_active_output=is_active_output, target=target, use_alpha=use_alpha, use_clamp=use_clamp)
    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

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)

mix(b=None, factor=None, clamp_factor=True, clamp_result=False, factor_mode='UNIFORM')

Node Mix

Fixed values

Kind Name Value
Socket A self
Parameter blend_type 'MIX'
Parameter data_type 'RGBA'

Parameters:

Name Type Description Default
b Color

socket 'B' (id: B_Color)

None
factor Float

socket 'Factor' (id: Factor_Float)

None
clamp_factor bool

parameter clamp_factor

True
clamp_result bool

parameter clamp_result

False
factor_mode Literal['Uniform', 'Non-Uniform']

parameter factor_mode

'UNIFORM'

Returns:

Type Description
Color
Source code in core/generated/color.py
1390
1391
1392
1393
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
1422
1423
1424
1425
1426
1427
1428
1429
1430
def mix(self,
                b: Color = None,
                factor: Float = None,
                clamp_factor = True,
                clamp_result = False,
                factor_mode: Literal['UNIFORM', 'NON_UNIFORM'] = 'UNIFORM'):
    """ > Node Mix

    **Fixed values**

    | Kind      | Name         | Value    |
    | --------- | ------------ | -------- |
    | Socket    | A            | `self`   |
    | Parameter | `blend_type` | `'MIX'`  |
    | Parameter | `data_type`  | `'RGBA'` |

    Parameters
    ----------
    b : Color, optional
        socket 'B' (id: B_Color)

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

    clamp_factor : bool
        parameter `clamp_factor`

    clamp_result : bool
        parameter `clamp_result`

    factor_mode : Literal['Uniform', 'Non-Uniform']
        parameter `factor_mode`


    Returns
    -------
    Color
    """
    utils.check_enum_arg('Mix', 'factor_mode', factor_mode, 'mix', ('UNIFORM', 'NON_UNIFORM'))
    node = Node('Mix', {'A_Color': self, 'B_Color': b, 'Factor_Float': factor}, blend_type='MIX', clamp_factor=clamp_factor, clamp_result=clamp_result, data_type='RGBA', factor_mode=factor_mode)
    return node._out

mix_add(b=None, factor=None, clamp_factor=True, clamp_result=False)

Node Mix

Fixed values

Kind Name Value
Socket A self
Parameter blend_type 'ADD'
Parameter data_type 'RGBA'
Parameter factor_mode 'UNIFORM'

Parameters:

Name Type Description Default
b Color

socket 'B' (id: B_Color)

None
factor Float

socket 'Factor' (id: Factor_Float)

None
clamp_factor bool

parameter clamp_factor

True
clamp_result bool

parameter clamp_result

False

Returns:

Type Description
Color
Source code in core/generated/color.py
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
def mix_add(self,
                b: Color = None,
                factor: Float = None,
                clamp_factor = True,
                clamp_result = False):
    """ > Node Mix

    **Fixed values**

    | Kind      | Name          | Value       |
    | --------- | ------------- | ----------- |
    | Socket    | A             | `self`      |
    | Parameter | `blend_type`  | `'ADD'`     |
    | Parameter | `data_type`   | `'RGBA'`    |
    | Parameter | `factor_mode` | `'UNIFORM'` |

    Parameters
    ----------
    b : Color, optional
        socket 'B' (id: B_Color)

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

    clamp_factor : bool
        parameter `clamp_factor`

    clamp_result : bool
        parameter `clamp_result`


    Returns
    -------
    Color
    """
    node = Node('Mix', {'A_Color': self, 'B_Color': b, 'Factor_Float': factor}, blend_type='ADD', clamp_factor=clamp_factor, clamp_result=clamp_result, data_type='RGBA', factor_mode='UNIFORM')
    return node._out

mix_burn(b=None, factor=None, clamp_factor=True, clamp_result=False)

Node Mix

Fixed values

Kind Name Value
Socket A self
Parameter blend_type 'BURN'
Parameter data_type 'RGBA'
Parameter factor_mode 'UNIFORM'

Parameters:

Name Type Description Default
b Color

socket 'B' (id: B_Color)

None
factor Float

socket 'Factor' (id: Factor_Float)

None
clamp_factor bool

parameter clamp_factor

True
clamp_result bool

parameter clamp_result

False

Returns:

Type Description
Color
Source code in core/generated/color.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
807
808
809
810
811
812
813
814
815
816
817
818
def mix_burn(self,
                b: Color = None,
                factor: Float = None,
                clamp_factor = True,
                clamp_result = False):
    """ > Node Mix

    **Fixed values**

    | Kind      | Name          | Value       |
    | --------- | ------------- | ----------- |
    | Socket    | A             | `self`      |
    | Parameter | `blend_type`  | `'BURN'`    |
    | Parameter | `data_type`   | `'RGBA'`    |
    | Parameter | `factor_mode` | `'UNIFORM'` |

    Parameters
    ----------
    b : Color, optional
        socket 'B' (id: B_Color)

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

    clamp_factor : bool
        parameter `clamp_factor`

    clamp_result : bool
        parameter `clamp_result`


    Returns
    -------
    Color
    """
    node = Node('Mix', {'A_Color': self, 'B_Color': b, 'Factor_Float': factor}, blend_type='BURN', clamp_factor=clamp_factor, clamp_result=clamp_result, data_type='RGBA', factor_mode='UNIFORM')
    return node._out

mix_color(b=None, factor=None, clamp_factor=True, clamp_result=False)

Node Mix

Fixed values

Kind Name Value
Socket A self
Parameter blend_type 'COLOR'
Parameter data_type 'RGBA'
Parameter factor_mode 'UNIFORM'

Parameters:

Name Type Description Default
b Color

socket 'B' (id: B_Color)

None
factor Float

socket 'Factor' (id: Factor_Float)

None
clamp_factor bool

parameter clamp_factor

True
clamp_result bool

parameter clamp_result

False

Returns:

Type Description
Color
Source code in core/generated/color.py
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
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
def mix_color(self,
                b: Color = None,
                factor: Float = None,
                clamp_factor = True,
                clamp_result = False):
    """ > Node Mix

    **Fixed values**

    | Kind      | Name          | Value       |
    | --------- | ------------- | ----------- |
    | Socket    | A             | `self`      |
    | Parameter | `blend_type`  | `'COLOR'`   |
    | Parameter | `data_type`   | `'RGBA'`    |
    | Parameter | `factor_mode` | `'UNIFORM'` |

    Parameters
    ----------
    b : Color, optional
        socket 'B' (id: B_Color)

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

    clamp_factor : bool
        parameter `clamp_factor`

    clamp_result : bool
        parameter `clamp_result`


    Returns
    -------
    Color
    """
    node = Node('Mix', {'A_Color': self, 'B_Color': b, 'Factor_Float': factor}, blend_type='COLOR', clamp_factor=clamp_factor, clamp_result=clamp_result, data_type='RGBA', factor_mode='UNIFORM')
    return node._out

mix_darken(b=None, factor=None, clamp_factor=True, clamp_result=False)

Node Mix

Fixed values

Kind Name Value
Socket A self
Parameter blend_type 'DARKEN'
Parameter data_type 'RGBA'
Parameter factor_mode 'UNIFORM'

Parameters:

Name Type Description Default
b Color

socket 'B' (id: B_Color)

None
factor Float

socket 'Factor' (id: Factor_Float)

None
clamp_factor bool

parameter clamp_factor

True
clamp_result bool

parameter clamp_result

False

Returns:

Type Description
Color
Source code in core/generated/color.py
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
def mix_darken(self,
                b: Color = None,
                factor: Float = None,
                clamp_factor = True,
                clamp_result = False):
    """ > Node Mix

    **Fixed values**

    | Kind      | Name          | Value       |
    | --------- | ------------- | ----------- |
    | Socket    | A             | `self`      |
    | Parameter | `blend_type`  | `'DARKEN'`  |
    | Parameter | `data_type`   | `'RGBA'`    |
    | Parameter | `factor_mode` | `'UNIFORM'` |

    Parameters
    ----------
    b : Color, optional
        socket 'B' (id: B_Color)

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

    clamp_factor : bool
        parameter `clamp_factor`

    clamp_result : bool
        parameter `clamp_result`


    Returns
    -------
    Color
    """
    node = Node('Mix', {'A_Color': self, 'B_Color': b, 'Factor_Float': factor}, blend_type='DARKEN', clamp_factor=clamp_factor, clamp_result=clamp_result, data_type='RGBA', factor_mode='UNIFORM')
    return node._out

mix_difference(b=None, factor=None, clamp_factor=True, clamp_result=False)

Node Mix

Fixed values

Kind Name Value
Socket A self
Parameter blend_type 'DIFFERENCE'
Parameter data_type 'RGBA'
Parameter factor_mode 'UNIFORM'

Parameters:

Name Type Description Default
b Color

socket 'B' (id: B_Color)

None
factor Float

socket 'Factor' (id: Factor_Float)

None
clamp_factor bool

parameter clamp_factor

True
clamp_result bool

parameter clamp_result

False

Returns:

Type Description
Color
Source code in core/generated/color.py
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
def mix_difference(self,
                b: Color = None,
                factor: Float = None,
                clamp_factor = True,
                clamp_result = False):
    """ > Node Mix

    **Fixed values**

    | Kind      | Name          | Value          |
    | --------- | ------------- | -------------- |
    | Socket    | A             | `self`         |
    | Parameter | `blend_type`  | `'DIFFERENCE'` |
    | Parameter | `data_type`   | `'RGBA'`       |
    | Parameter | `factor_mode` | `'UNIFORM'`    |

    Parameters
    ----------
    b : Color, optional
        socket 'B' (id: B_Color)

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

    clamp_factor : bool
        parameter `clamp_factor`

    clamp_result : bool
        parameter `clamp_result`


    Returns
    -------
    Color
    """
    node = Node('Mix', {'A_Color': self, 'B_Color': b, 'Factor_Float': factor}, blend_type='DIFFERENCE', clamp_factor=clamp_factor, clamp_result=clamp_result, data_type='RGBA', factor_mode='UNIFORM')
    return node._out

mix_divide(b=None, factor=None, clamp_factor=True, clamp_result=False)

Node Mix

Fixed values

Kind Name Value
Socket A self
Parameter blend_type 'DIVIDE'
Parameter data_type 'RGBA'
Parameter factor_mode 'UNIFORM'

Parameters:

Name Type Description Default
b Color

socket 'B' (id: B_Color)

None
factor Float

socket 'Factor' (id: Factor_Float)

None
clamp_factor bool

parameter clamp_factor

True
clamp_result bool

parameter clamp_result

False

Returns:

Type Description
Color
Source code in core/generated/color.py
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
def mix_divide(self,
                b: Color = None,
                factor: Float = None,
                clamp_factor = True,
                clamp_result = False):
    """ > Node Mix

    **Fixed values**

    | Kind      | Name          | Value       |
    | --------- | ------------- | ----------- |
    | Socket    | A             | `self`      |
    | Parameter | `blend_type`  | `'DIVIDE'`  |
    | Parameter | `data_type`   | `'RGBA'`    |
    | Parameter | `factor_mode` | `'UNIFORM'` |

    Parameters
    ----------
    b : Color, optional
        socket 'B' (id: B_Color)

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

    clamp_factor : bool
        parameter `clamp_factor`

    clamp_result : bool
        parameter `clamp_result`


    Returns
    -------
    Color
    """
    node = Node('Mix', {'A_Color': self, 'B_Color': b, 'Factor_Float': factor}, blend_type='DIVIDE', clamp_factor=clamp_factor, clamp_result=clamp_result, data_type='RGBA', factor_mode='UNIFORM')
    return node._out

mix_dodge(b=None, factor=None, clamp_factor=True, clamp_result=False)

Node Mix

Fixed values

Kind Name Value
Socket A self
Parameter blend_type 'DODGE'
Parameter data_type 'RGBA'
Parameter factor_mode 'UNIFORM'

Parameters:

Name Type Description Default
b Color

socket 'B' (id: B_Color)

None
factor Float

socket 'Factor' (id: Factor_Float)

None
clamp_factor bool

parameter clamp_factor

True
clamp_result bool

parameter clamp_result

False

Returns:

Type Description
Color
Source code in core/generated/color.py
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
def mix_dodge(self,
                b: Color = None,
                factor: Float = None,
                clamp_factor = True,
                clamp_result = False):
    """ > Node Mix

    **Fixed values**

    | Kind      | Name          | Value       |
    | --------- | ------------- | ----------- |
    | Socket    | A             | `self`      |
    | Parameter | `blend_type`  | `'DODGE'`   |
    | Parameter | `data_type`   | `'RGBA'`    |
    | Parameter | `factor_mode` | `'UNIFORM'` |

    Parameters
    ----------
    b : Color, optional
        socket 'B' (id: B_Color)

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

    clamp_factor : bool
        parameter `clamp_factor`

    clamp_result : bool
        parameter `clamp_result`


    Returns
    -------
    Color
    """
    node = Node('Mix', {'A_Color': self, 'B_Color': b, 'Factor_Float': factor}, blend_type='DODGE', clamp_factor=clamp_factor, clamp_result=clamp_result, data_type='RGBA', factor_mode='UNIFORM')
    return node._out

mix_exclusion(b=None, factor=None, clamp_factor=True, clamp_result=False)

Node Mix

Fixed values

Kind Name Value
Socket A self
Parameter blend_type 'EXCLUSION'
Parameter data_type 'RGBA'
Parameter factor_mode 'UNIFORM'

Parameters:

Name Type Description Default
b Color

socket 'B' (id: B_Color)

None
factor Float

socket 'Factor' (id: Factor_Float)

None
clamp_factor bool

parameter clamp_factor

True
clamp_result bool

parameter clamp_result

False

Returns:

Type Description
Color
Source code in core/generated/color.py
1124
1125
1126
1127
1128
1129
1130
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
1156
1157
1158
1159
1160
def mix_exclusion(self,
                b: Color = None,
                factor: Float = None,
                clamp_factor = True,
                clamp_result = False):
    """ > Node Mix

    **Fixed values**

    | Kind      | Name          | Value         |
    | --------- | ------------- | ------------- |
    | Socket    | A             | `self`        |
    | Parameter | `blend_type`  | `'EXCLUSION'` |
    | Parameter | `data_type`   | `'RGBA'`      |
    | Parameter | `factor_mode` | `'UNIFORM'`   |

    Parameters
    ----------
    b : Color, optional
        socket 'B' (id: B_Color)

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

    clamp_factor : bool
        parameter `clamp_factor`

    clamp_result : bool
        parameter `clamp_result`


    Returns
    -------
    Color
    """
    node = Node('Mix', {'A_Color': self, 'B_Color': b, 'Factor_Float': factor}, blend_type='EXCLUSION', clamp_factor=clamp_factor, clamp_result=clamp_result, data_type='RGBA', factor_mode='UNIFORM')
    return node._out

mix_hue(b=None, factor=None, clamp_factor=True, clamp_result=False)

Node Mix

Fixed values

Kind Name Value
Socket A self
Parameter blend_type 'HUE'
Parameter data_type 'RGBA'
Parameter factor_mode 'UNIFORM'

Parameters:

Name Type Description Default
b Color

socket 'B' (id: B_Color)

None
factor Float

socket 'Factor' (id: Factor_Float)

None
clamp_factor bool

parameter clamp_factor

True
clamp_result bool

parameter clamp_result

False

Returns:

Type Description
Color
Source code in core/generated/color.py
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
1270
1271
1272
1273
1274
def mix_hue(self,
                b: Color = None,
                factor: Float = None,
                clamp_factor = True,
                clamp_result = False):
    """ > Node Mix

    **Fixed values**

    | Kind      | Name          | Value       |
    | --------- | ------------- | ----------- |
    | Socket    | A             | `self`      |
    | Parameter | `blend_type`  | `'HUE'`     |
    | Parameter | `data_type`   | `'RGBA'`    |
    | Parameter | `factor_mode` | `'UNIFORM'` |

    Parameters
    ----------
    b : Color, optional
        socket 'B' (id: B_Color)

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

    clamp_factor : bool
        parameter `clamp_factor`

    clamp_result : bool
        parameter `clamp_result`


    Returns
    -------
    Color
    """
    node = Node('Mix', {'A_Color': self, 'B_Color': b, 'Factor_Float': factor}, blend_type='HUE', clamp_factor=clamp_factor, clamp_result=clamp_result, data_type='RGBA', factor_mode='UNIFORM')
    return node._out

mix_lighten(b=None, factor=None, clamp_factor=True, clamp_result=False)

Node Mix

Fixed values

Kind Name Value
Socket A self
Parameter blend_type 'LIGHTEN'
Parameter data_type 'RGBA'
Parameter factor_mode 'UNIFORM'

Parameters:

Name Type Description Default
b Color

socket 'B' (id: B_Color)

None
factor Float

socket 'Factor' (id: Factor_Float)

None
clamp_factor bool

parameter clamp_factor

True
clamp_result bool

parameter clamp_result

False

Returns:

Type Description
Color
Source code in core/generated/color.py
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
def mix_lighten(self,
                b: Color = None,
                factor: Float = None,
                clamp_factor = True,
                clamp_result = False):
    """ > Node Mix

    **Fixed values**

    | Kind      | Name          | Value       |
    | --------- | ------------- | ----------- |
    | Socket    | A             | `self`      |
    | Parameter | `blend_type`  | `'LIGHTEN'` |
    | Parameter | `data_type`   | `'RGBA'`    |
    | Parameter | `factor_mode` | `'UNIFORM'` |

    Parameters
    ----------
    b : Color, optional
        socket 'B' (id: B_Color)

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

    clamp_factor : bool
        parameter `clamp_factor`

    clamp_result : bool
        parameter `clamp_result`


    Returns
    -------
    Color
    """
    node = Node('Mix', {'A_Color': self, 'B_Color': b, 'Factor_Float': factor}, blend_type='LIGHTEN', clamp_factor=clamp_factor, clamp_result=clamp_result, data_type='RGBA', factor_mode='UNIFORM')
    return node._out

mix_linear_light(b=None, factor=None, clamp_factor=True, clamp_result=False)

Node Mix

Fixed values

Kind Name Value
Socket A self
Parameter blend_type 'LINEAR_LIGHT'
Parameter data_type 'RGBA'
Parameter factor_mode 'UNIFORM'

Parameters:

Name Type Description Default
b Color

socket 'B' (id: B_Color)

None
factor Float

socket 'Factor' (id: Factor_Float)

None
clamp_factor bool

parameter clamp_factor

True
clamp_result bool

parameter clamp_result

False

Returns:

Type Description
Color
Source code in core/generated/color.py
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
def mix_linear_light(self,
                b: Color = None,
                factor: Float = None,
                clamp_factor = True,
                clamp_result = False):
    """ > Node Mix

    **Fixed values**

    | Kind      | Name          | Value            |
    | --------- | ------------- | ---------------- |
    | Socket    | A             | `self`           |
    | Parameter | `blend_type`  | `'LINEAR_LIGHT'` |
    | Parameter | `data_type`   | `'RGBA'`         |
    | Parameter | `factor_mode` | `'UNIFORM'`      |

    Parameters
    ----------
    b : Color, optional
        socket 'B' (id: B_Color)

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

    clamp_factor : bool
        parameter `clamp_factor`

    clamp_result : bool
        parameter `clamp_result`


    Returns
    -------
    Color
    """
    node = Node('Mix', {'A_Color': self, 'B_Color': b, 'Factor_Float': factor}, blend_type='LINEAR_LIGHT', clamp_factor=clamp_factor, clamp_result=clamp_result, data_type='RGBA', factor_mode='UNIFORM')
    return node._out

mix_mix(b=None, factor=None, clamp_factor=True, clamp_result=False)

Node Mix

Fixed values

Kind Name Value
Socket A self
Parameter blend_type 'MIX'
Parameter data_type 'RGBA'
Parameter factor_mode 'UNIFORM'

Parameters:

Name Type Description Default
b Color

socket 'B' (id: B_Color)

None
factor Float

socket 'Factor' (id: Factor_Float)

None
clamp_factor bool

parameter clamp_factor

True
clamp_result bool

parameter clamp_result

False

Returns:

Type Description
Color
Source code in core/generated/color.py
668
669
670
671
672
673
674
675
676
677
678
679
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
def mix_mix(self,
                b: Color = None,
                factor: Float = None,
                clamp_factor = True,
                clamp_result = False):
    """ > Node Mix

    **Fixed values**

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

    Parameters
    ----------
    b : Color, optional
        socket 'B' (id: B_Color)

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

    clamp_factor : bool
        parameter `clamp_factor`

    clamp_result : bool
        parameter `clamp_result`


    Returns
    -------
    Color
    """
    node = Node('Mix', {'A_Color': self, 'B_Color': b, 'Factor_Float': factor}, blend_type='MIX', clamp_factor=clamp_factor, clamp_result=clamp_result, data_type='RGBA', factor_mode='UNIFORM')
    return node._out

mix_multiply(b=None, factor=None, clamp_factor=True, clamp_result=False)

Node Mix

Fixed values

Kind Name Value
Socket A self
Parameter blend_type 'MULTIPLY'
Parameter data_type 'RGBA'
Parameter factor_mode 'UNIFORM'

Parameters:

Name Type Description Default
b Color

socket 'B' (id: B_Color)

None
factor Float

socket 'Factor' (id: Factor_Float)

None
clamp_factor bool

parameter clamp_factor

True
clamp_result bool

parameter clamp_result

False

Returns:

Type Description
Color
Source code in core/generated/color.py
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
def mix_multiply(self,
                b: Color = None,
                factor: Float = None,
                clamp_factor = True,
                clamp_result = False):
    """ > Node Mix

    **Fixed values**

    | Kind      | Name          | Value        |
    | --------- | ------------- | ------------ |
    | Socket    | A             | `self`       |
    | Parameter | `blend_type`  | `'MULTIPLY'` |
    | Parameter | `data_type`   | `'RGBA'`     |
    | Parameter | `factor_mode` | `'UNIFORM'`  |

    Parameters
    ----------
    b : Color, optional
        socket 'B' (id: B_Color)

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

    clamp_factor : bool
        parameter `clamp_factor`

    clamp_result : bool
        parameter `clamp_result`


    Returns
    -------
    Color
    """
    node = Node('Mix', {'A_Color': self, 'B_Color': b, 'Factor_Float': factor}, blend_type='MULTIPLY', clamp_factor=clamp_factor, clamp_result=clamp_result, data_type='RGBA', factor_mode='UNIFORM')
    return node._out

mix_overlay(b=None, factor=None, clamp_factor=True, clamp_result=False)

Node Mix

Fixed values

Kind Name Value
Socket A self
Parameter blend_type 'OVERLAY'
Parameter data_type 'RGBA'
Parameter factor_mode 'UNIFORM'

Parameters:

Name Type Description Default
b Color

socket 'B' (id: B_Color)

None
factor Float

socket 'Factor' (id: Factor_Float)

None
clamp_factor bool

parameter clamp_factor

True
clamp_result bool

parameter clamp_result

False

Returns:

Type Description
Color
Source code in core/generated/color.py
 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
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
def mix_overlay(self,
                b: Color = None,
                factor: Float = None,
                clamp_factor = True,
                clamp_result = False):
    """ > Node Mix

    **Fixed values**

    | Kind      | Name          | Value       |
    | --------- | ------------- | ----------- |
    | Socket    | A             | `self`      |
    | Parameter | `blend_type`  | `'OVERLAY'` |
    | Parameter | `data_type`   | `'RGBA'`    |
    | Parameter | `factor_mode` | `'UNIFORM'` |

    Parameters
    ----------
    b : Color, optional
        socket 'B' (id: B_Color)

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

    clamp_factor : bool
        parameter `clamp_factor`

    clamp_result : bool
        parameter `clamp_result`


    Returns
    -------
    Color
    """
    node = Node('Mix', {'A_Color': self, 'B_Color': b, 'Factor_Float': factor}, blend_type='OVERLAY', clamp_factor=clamp_factor, clamp_result=clamp_result, data_type='RGBA', factor_mode='UNIFORM')
    return node._out

mix_saturation(b=None, factor=None, clamp_factor=True, clamp_result=False)

Node Mix

Fixed values

Kind Name Value
Socket A self
Parameter blend_type 'SATURATION'
Parameter data_type 'RGBA'
Parameter factor_mode 'UNIFORM'

Parameters:

Name Type Description Default
b Color

socket 'B' (id: B_Color)

None
factor Float

socket 'Factor' (id: Factor_Float)

None
clamp_factor bool

parameter clamp_factor

True
clamp_result bool

parameter clamp_result

False

Returns:

Type Description
Color
Source code in core/generated/color.py
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
1306
1307
1308
1309
1310
1311
1312
def mix_saturation(self,
                b: Color = None,
                factor: Float = None,
                clamp_factor = True,
                clamp_result = False):
    """ > Node Mix

    **Fixed values**

    | Kind      | Name          | Value          |
    | --------- | ------------- | -------------- |
    | Socket    | A             | `self`         |
    | Parameter | `blend_type`  | `'SATURATION'` |
    | Parameter | `data_type`   | `'RGBA'`       |
    | Parameter | `factor_mode` | `'UNIFORM'`    |

    Parameters
    ----------
    b : Color, optional
        socket 'B' (id: B_Color)

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

    clamp_factor : bool
        parameter `clamp_factor`

    clamp_result : bool
        parameter `clamp_result`


    Returns
    -------
    Color
    """
    node = Node('Mix', {'A_Color': self, 'B_Color': b, 'Factor_Float': factor}, blend_type='SATURATION', clamp_factor=clamp_factor, clamp_result=clamp_result, data_type='RGBA', factor_mode='UNIFORM')
    return node._out

mix_screen(b=None, factor=None, clamp_factor=True, clamp_result=False)

Node Mix

Fixed values

Kind Name Value
Socket A self
Parameter blend_type 'SCREEN'
Parameter data_type 'RGBA'
Parameter factor_mode 'UNIFORM'

Parameters:

Name Type Description Default
b Color

socket 'B' (id: B_Color)

None
factor Float

socket 'Factor' (id: Factor_Float)

None
clamp_factor bool

parameter clamp_factor

True
clamp_result bool

parameter clamp_result

False

Returns:

Type Description
Color
Source code in core/generated/color.py
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
def mix_screen(self,
                b: Color = None,
                factor: Float = None,
                clamp_factor = True,
                clamp_result = False):
    """ > Node Mix

    **Fixed values**

    | Kind      | Name          | Value       |
    | --------- | ------------- | ----------- |
    | Socket    | A             | `self`      |
    | Parameter | `blend_type`  | `'SCREEN'`  |
    | Parameter | `data_type`   | `'RGBA'`    |
    | Parameter | `factor_mode` | `'UNIFORM'` |

    Parameters
    ----------
    b : Color, optional
        socket 'B' (id: B_Color)

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

    clamp_factor : bool
        parameter `clamp_factor`

    clamp_result : bool
        parameter `clamp_result`


    Returns
    -------
    Color
    """
    node = Node('Mix', {'A_Color': self, 'B_Color': b, 'Factor_Float': factor}, blend_type='SCREEN', clamp_factor=clamp_factor, clamp_result=clamp_result, data_type='RGBA', factor_mode='UNIFORM')
    return node._out

mix_soft_light(b=None, factor=None, clamp_factor=True, clamp_result=False)

Node Mix

Fixed values

Kind Name Value
Socket A self
Parameter blend_type 'SOFT_LIGHT'
Parameter data_type 'RGBA'
Parameter factor_mode 'UNIFORM'

Parameters:

Name Type Description Default
b Color

socket 'B' (id: B_Color)

None
factor Float

socket 'Factor' (id: Factor_Float)

None
clamp_factor bool

parameter clamp_factor

True
clamp_result bool

parameter clamp_result

False

Returns:

Type Description
Color
Source code in core/generated/color.py
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
def mix_soft_light(self,
                b: Color = None,
                factor: Float = None,
                clamp_factor = True,
                clamp_result = False):
    """ > Node Mix

    **Fixed values**

    | Kind      | Name          | Value          |
    | --------- | ------------- | -------------- |
    | Socket    | A             | `self`         |
    | Parameter | `blend_type`  | `'SOFT_LIGHT'` |
    | Parameter | `data_type`   | `'RGBA'`       |
    | Parameter | `factor_mode` | `'UNIFORM'`    |

    Parameters
    ----------
    b : Color, optional
        socket 'B' (id: B_Color)

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

    clamp_factor : bool
        parameter `clamp_factor`

    clamp_result : bool
        parameter `clamp_result`


    Returns
    -------
    Color
    """
    node = Node('Mix', {'A_Color': self, 'B_Color': b, 'Factor_Float': factor}, blend_type='SOFT_LIGHT', clamp_factor=clamp_factor, clamp_result=clamp_result, data_type='RGBA', factor_mode='UNIFORM')
    return node._out

mix_subtract(b=None, factor=None, clamp_factor=True, clamp_result=False)

Node Mix

Fixed values

Kind Name Value
Socket A self
Parameter blend_type 'SUBTRACT'
Parameter data_type 'RGBA'
Parameter factor_mode 'UNIFORM'

Parameters:

Name Type Description Default
b Color

socket 'B' (id: B_Color)

None
factor Float

socket 'Factor' (id: Factor_Float)

None
clamp_factor bool

parameter clamp_factor

True
clamp_result bool

parameter clamp_result

False

Returns:

Type Description
Color
Source code in core/generated/color.py
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
def mix_subtract(self,
                b: Color = None,
                factor: Float = None,
                clamp_factor = True,
                clamp_result = False):
    """ > Node Mix

    **Fixed values**

    | Kind      | Name          | Value        |
    | --------- | ------------- | ------------ |
    | Socket    | A             | `self`       |
    | Parameter | `blend_type`  | `'SUBTRACT'` |
    | Parameter | `data_type`   | `'RGBA'`     |
    | Parameter | `factor_mode` | `'UNIFORM'`  |

    Parameters
    ----------
    b : Color, optional
        socket 'B' (id: B_Color)

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

    clamp_factor : bool
        parameter `clamp_factor`

    clamp_result : bool
        parameter `clamp_result`


    Returns
    -------
    Color
    """
    node = Node('Mix', {'A_Color': self, 'B_Color': b, 'Factor_Float': factor}, blend_type='SUBTRACT', clamp_factor=clamp_factor, clamp_result=clamp_result, data_type='RGBA', factor_mode='UNIFORM')
    return node._out

mix_value(b=None, factor=None, clamp_factor=True, clamp_result=False)

Node Mix

Fixed values

Kind Name Value
Socket A self
Parameter blend_type 'VALUE'
Parameter data_type 'RGBA'
Parameter factor_mode 'UNIFORM'

Parameters:

Name Type Description Default
b Color

socket 'B' (id: B_Color)

None
factor Float

socket 'Factor' (id: Factor_Float)

None
clamp_factor bool

parameter clamp_factor

True
clamp_result bool

parameter clamp_result

False

Returns:

Type Description
Color
Source code in core/generated/color.py
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
def mix_value(self,
                b: Color = None,
                factor: Float = None,
                clamp_factor = True,
                clamp_result = False):
    """ > Node Mix

    **Fixed values**

    | Kind      | Name          | Value       |
    | --------- | ------------- | ----------- |
    | Socket    | A             | `self`      |
    | Parameter | `blend_type`  | `'VALUE'`   |
    | Parameter | `data_type`   | `'RGBA'`    |
    | Parameter | `factor_mode` | `'UNIFORM'` |

    Parameters
    ----------
    b : Color, optional
        socket 'B' (id: B_Color)

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

    clamp_factor : bool
        parameter `clamp_factor`

    clamp_result : bool
        parameter `clamp_result`


    Returns
    -------
    Color
    """
    node = Node('Mix', {'A_Color': self, 'B_Color': b, 'Factor_Float': factor}, blend_type='VALUE', clamp_factor=clamp_factor, clamp_result=clamp_result, data_type='RGBA', factor_mode='UNIFORM')
    return node._out

normal_map(strength=None, space='TANGENT', uv_map='')

Normal map.

[&SHADER]

Node Normal Map

Parameters:

Name Type Description Default
strength Float

socket

None
space str

str in ('TANGENT', 'OBJECT', 'WORLD', 'BLENDER_OBJECT', 'BLENDER_WORLD') default='TANGENT'.

'TANGENT'

Returns:

Type Description
Color

'Color' socket

Source code in core/sock_color.py
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
def normal_map(self, strength=None, space='TANGENT', uv_map=''):
    """ Normal map.

    [&SHADER]
    > Node Normal Map

    Parameters
    ----------
    strength : Float
        socket

    space : str, optional
        str in ('TANGENT', 'OBJECT', 'WORLD', 'BLENDER_OBJECT', 'BLENDER_WORLD') default='TANGENT'.


    Returns
    -------
    Color
        'Color' socket

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

not_equal(b=None, epsilon=None)

Node Compare

Fixed values

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

Parameters:

Name Type Description Default
b Color

socket 'B' (id: B_COL)

None
epsilon Float

socket 'Epsilon' (id: Epsilon)

None

Returns:

Type Description
Boolean
Source code in core/generated/color.py
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
def not_equal(self, b: Color = None, epsilon: Float = None):
    """ > Node Compare

    **Fixed values**

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

    Parameters
    ----------
    b : Color, optional
        socket 'B' (id: B_COL)

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


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

out(name=None, panel='')

Connect to output

Behavior

  • Geometry Nodes : create a group output socket with the provided name
  • Shader : create a node AOV Output
Source code in core/sock_color.py
132
133
134
135
136
137
138
139
140
141
142
143
144
145
def out(self, name=None, panel: str = ""):
    """ > Connect to output

    !!! important "Behavior"

        - Geometry Nodes : create a group output socket with the provided name
        - Shader : create a node AOV Output
    """
    if self._tree._btree.bl_idname == 'ShaderNodeTree' and not self._tree._is_group:
        if name is None:
            name = 'Color'
        self._tree.aov_output(name=name, color=self)
    else:
        super().out(name=name, panel=panel)

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)

rgb_to_bw()

Node RGB to BW

Fixed values

Kind Name Value
Socket Color self

Returns:

Type Description
Float
Source code in core/generated/color.py
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
def rgb_to_bw(self):
    """ > Node RGB to BW

    **Fixed values**

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

    Returns
    -------
    Float
    """
    node = Node('RGB to BW', {'Color': self})
    return node._out

separate(mode='RGB')

Node Separate Color

Fixed values

Kind Name Value
Socket Color self

Parameters:

Name Type Description Default
mode Literal['RGB', 'HSV', 'HSL']

parameter mode

'RGB'

Returns:

Type Description
node[red(Float), green(Float), blue(Float), alpha(Float)]
Source code in core/generated/color.py
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
def separate(self, mode: Literal['RGB', 'HSV', 'HSL'] = 'RGB'):
    """ > Node Separate Color

    **Fixed values**

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

    Parameters
    ----------
    mode : Literal['RGB', 'HSV', 'HSL']
        parameter `mode`


    Returns
    -------
    node [red (Float), green (Float), blue (Float), alpha (Float)]
    """
    utils.check_enum_arg('Separate Color', 'mode', mode, 'separate', ('RGB', 'HSV', 'HSL'))
    node = self._cache('Separate Color', {'Color': self}, mode=mode)
    return node

separate_HSL()

Node Separate Color

Fixed values

Kind Name Value
Socket Color self
Parameter mode 'HSL'

Returns:

Type Description
node[hue(Float), saturation(Float), lightness(Float), alpha(Float)]
Source code in core/generated/color.py
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
def separate_HSL(self):
    """ > Node Separate Color

    **Fixed values**

    | Kind      | Name   | Value   |
    | --------- | ------ | ------- |
    | Socket    | Color  | `self`  |
    | Parameter | `mode` | `'HSL'` |

    Returns
    -------
    node [hue (Float), saturation (Float), lightness (Float), alpha (Float)]
    """
    node = self._cache('Separate Color', {'Color': self}, mode='HSL')
    return node

separate_HSV()

Node Separate Color

Fixed values

Kind Name Value
Socket Color self
Parameter mode 'HSV'

Returns:

Type Description
node[hue(Float), saturation(Float), value(Float), alpha(Float)]
Source code in core/generated/color.py
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
def separate_HSV(self):
    """ > Node Separate Color

    **Fixed values**

    | Kind      | Name   | Value   |
    | --------- | ------ | ------- |
    | Socket    | Color  | `self`  |
    | Parameter | `mode` | `'HSV'` |

    Returns
    -------
    node [hue (Float), saturation (Float), value (Float), alpha (Float)]
    """
    node = self._cache('Separate Color', {'Color': self}, mode='HSV')
    return node

separate_RGB()

Node Separate Color

Fixed values

Kind Name Value
Socket Color self
Parameter mode 'RGB'

Returns:

Type Description
node[red(Float), green(Float), blue(Float), alpha(Float)]
Source code in core/generated/color.py
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
def separate_RGB(self):
    """ > Node Separate Color

    **Fixed values**

    | Kind      | Name   | Value   |
    | --------- | ------ | ------- |
    | Socket    | Color  | `self`  |
    | Parameter | `mode` | `'RGB'` |

    Returns
    -------
    node [red (Float), green (Float), blue (Float), alpha (Float)]
    """
    node = self._cache('Separate Color', {'Color': self}, mode='RGB')
    return node

separate_col(mode='RGB')

Node Separate Color

Fixed values

Kind Name Value
Socket Color self

Parameters:

Name Type Description Default
mode Literal['RGB', 'HSV', 'HSL']

parameter mode

'RGB'

Returns:

Type Description
node[red(Float), green(Float), blue(Float)]
Source code in core/generated/color.py
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
def separate_col(self, mode: Literal['RGB', 'HSV', 'HSL'] = 'RGB'):
    """ > Node Separate Color

    **Fixed values**

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

    Parameters
    ----------
    mode : Literal['RGB', 'HSV', 'HSL']
        parameter `mode`


    Returns
    -------
    node [red (Float), green (Float), blue (Float)]
    """
    utils.check_enum_arg('Separate Color', 'mode', mode, 'separate_col', ('RGB', 'HSV', 'HSL'))
    node = Node('Separate Color', {'Color': self}, mode=mode)
    return node

separate_col_HSL()

Node Separate Color

Fixed values

Kind Name Value
Socket Color self
Parameter mode 'HSL'

Returns:

Type Description
node[hue(Float), saturation(Float), lightness(Float)]
Source code in core/generated/color.py
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
def separate_col_HSL(self):
    """ > Node Separate Color

    **Fixed values**

    | Kind      | Name   | Value   |
    | --------- | ------ | ------- |
    | Socket    | Color  | `self`  |
    | Parameter | `mode` | `'HSL'` |

    Returns
    -------
    node [hue (Float), saturation (Float), lightness (Float)]
    """
    node = Node('Separate Color', {'Color': self}, mode='HSL')
    return node

separate_col_HSV()

Node Separate Color

Fixed values

Kind Name Value
Socket Color self
Parameter mode 'HSV'

Returns:

Type Description
node[hue(Float), saturation(Float), value(Float)]
Source code in core/generated/color.py
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
def separate_col_HSV(self):
    """ > Node Separate Color

    **Fixed values**

    | Kind      | Name   | Value   |
    | --------- | ------ | ------- |
    | Socket    | Color  | `self`  |
    | Parameter | `mode` | `'HSV'` |

    Returns
    -------
    node [hue (Float), saturation (Float), value (Float)]
    """
    node = Node('Separate Color', {'Color': self}, mode='HSV')
    return node

separate_col_RGB()

Node Separate Color

Fixed values

Kind Name Value
Socket Color self
Parameter mode 'RGB'

Returns:

Type Description
node[red(Float), green(Float), blue(Float)]
Source code in core/generated/color.py
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
def separate_col_RGB(self):
    """ > Node Separate Color

    **Fixed values**

    | Kind      | Name   | Value   |
    | --------- | ------ | ------- |
    | Socket    | Color  | `self`  |
    | Parameter | `mode` | `'RGB'` |

    Returns
    -------
    node [red (Float), green (Float), blue (Float)]
    """
    node = Node('Separate Color', {'Color': self}, mode='RGB')
    return node

separate_color()

Node Separate Color

Fixed values

Kind Name Value
Socket Color self
Parameter mode 'RGB'

Returns:

Type Description
node[red(Float), green(Float), blue(Float), alpha(Float)]
Source code in core/generated/color.py
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
def separate_color(self):
    """ > Node Separate Color

    **Fixed values**

    | Kind      | Name   | Value   |
    | --------- | ------ | ------- |
    | Socket    | Color  | `self`  |
    | Parameter | `mode` | `'RGB'` |

    Returns
    -------
    node [red (Float), green (Float), blue (Float), alpha (Float)]
    """
    node = self._cache('Separate Color', {'Color': self}, mode='RGB')
    return node

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)

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

vector_displacement(midlevel=None, scale=None, space='TANGENT')

Vector displacement

[&SHADER]

Node Vector Displacement

Parameters:

Name Type Description Default
midlevel Float

socket

None
scale Float

socket

None
space str

str in ('TANGENT', 'OBJECT', 'WORLD') default='TANGENT'.

'TANGENT'

Returns:

Type Description
Vector

'Displacement' socket

Source code in core/sock_color.py
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
def vector_displacement(self, midlevel=None, scale=None, space='TANGENT'):
    """ Vector displacement

    [&SHADER]
    > Node Vector Displacement

    Parameters
    ----------
    midlevel : Float
        socket

    scale : Float
        socket

    space : str, optional
        str in ('TANGENT', 'OBJECT', 'WORLD') default='TANGENT'.


    Returns
    -------
    Vector
        'Displacement' socket

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