nodebpy 0.1.1__py3-none-any.whl → 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2344 +0,0 @@
1
- """
2
- Auto-generated Blender Geometry Node classes.
3
-
4
- DO NOT EDIT THIS FILE MANUALLY.
5
- This file is generated by molecularnodes/nodes/generator.py
6
-
7
- To regenerate: Run generator.py from within Blender
8
-
9
- KNOWN LIMITATIONS:
10
- - Dynamic multi-input/output sockets are not yet supported
11
- (these are the unnamed sockets that appear in the UI for nodes like
12
- "Evaluate Closure", "Join Geometry", etc. that allow dragging in
13
- multiple connections)
14
- - TODO: Add support for dynamic socket creation
15
- """
16
-
17
- from __future__ import annotations
18
- import bpy
19
- from typing_extensions import Literal
20
- from ..builder import NodeBuilder, NodeSocket
21
- from .types import LINKABLE, TYPE_INPUT_VECTOR
22
-
23
-
24
- class AlignEulerToVector(NodeBuilder):
25
- """Orient an Euler rotation along the given direction"""
26
-
27
- name = "FunctionNodeAlignEulerToVector"
28
- node: bpy.types.FunctionNodeAlignEulerToVector
29
-
30
- def __init__(
31
- self,
32
- rotation: LINKABLE | None = [0.0, 0.0, 0.0],
33
- factor: LINKABLE | None = 1.0,
34
- vector: TYPE_INPUT_VECTOR = [0.0, 0.0, 1.0],
35
- axis: Literal["X", "Y", "Z"] = "X",
36
- pivot_axis: Literal["AUTO", "X", "Y", "Z"] = "AUTO",
37
- **kwargs,
38
- ):
39
- super().__init__()
40
- key_args = {"Rotation": rotation, "Factor": factor, "Vector": vector}
41
- key_args.update(kwargs)
42
- self.axis = axis
43
- self.pivot_axis = pivot_axis
44
- self._establish_links(**key_args)
45
-
46
- @property
47
- def i_rotation(self) -> NodeSocket:
48
- """Input socket: Rotation"""
49
- return self._input("Rotation")
50
-
51
- @property
52
- def i_factor(self) -> NodeSocket:
53
- """Input socket: Factor"""
54
- return self._input("Factor")
55
-
56
- @property
57
- def i_vector(self) -> bpy.types.NodeSocketVector:
58
- """Input socket: Vector"""
59
- return self._input("Vector")
60
-
61
- @property
62
- def o_rotation(self) -> NodeSocket:
63
- """Output socket: Rotation"""
64
- return self._output("Rotation")
65
-
66
- @property
67
- def axis(self) -> Literal["X", "Y", "Z"]:
68
- return self.node.axis
69
-
70
- @axis.setter
71
- def axis(self, value: Literal["X", "Y", "Z"]):
72
- self.node.axis = value
73
-
74
- @property
75
- def pivot_axis(self) -> Literal["AUTO", "X", "Y", "Z"]:
76
- return self.node.pivot_axis
77
-
78
- @pivot_axis.setter
79
- def pivot_axis(self, value: Literal["AUTO", "X", "Y", "Z"]):
80
- self.node.pivot_axis = value
81
-
82
-
83
- class AlignRotationToVector(NodeBuilder):
84
- """Orient a rotation along the given direction"""
85
-
86
- name = "FunctionNodeAlignRotationToVector"
87
- node: bpy.types.FunctionNodeAlignRotationToVector
88
-
89
- def __init__(
90
- self,
91
- rotation: TYPE_INPUT_ROTATION = [0.0, 0.0, 0.0],
92
- factor: LINKABLE | None = 1.0,
93
- vector: LINKABLE | None = [0.0, 0.0, 1.0],
94
- axis: Literal["X", "Y", "Z"] = "Z",
95
- pivot_axis: Literal["AUTO", "X", "Y", "Z"] = "AUTO",
96
- **kwargs,
97
- ):
98
- super().__init__()
99
- key_args = {"Rotation": rotation, "Factor": factor, "Vector": vector}
100
- key_args.update(kwargs)
101
- self.axis = axis
102
- self.pivot_axis = pivot_axis
103
- self._establish_links(**key_args)
104
-
105
- @property
106
- def i_rotation(self) -> bpy.types.NodeSocketRotation:
107
- """Input socket: Rotation"""
108
- return self._input("Rotation")
109
-
110
- @property
111
- def i_factor(self) -> NodeSocket:
112
- """Input socket: Factor"""
113
- return self._input("Factor")
114
-
115
- @property
116
- def i_vector(self) -> NodeSocket:
117
- """Input socket: Vector"""
118
- return self._input("Vector")
119
-
120
- @property
121
- def o_rotation(self) -> bpy.types.NodeSocketRotation:
122
- """Output socket: Rotation"""
123
- return self._output("Rotation")
124
-
125
- @property
126
- def axis(self) -> Literal["X", "Y", "Z"]:
127
- return self.node.axis
128
-
129
- @axis.setter
130
- def axis(self, value: Literal["X", "Y", "Z"]):
131
- self.node.axis = value
132
-
133
- @property
134
- def pivot_axis(self) -> Literal["AUTO", "X", "Y", "Z"]:
135
- return self.node.pivot_axis
136
-
137
- @pivot_axis.setter
138
- def pivot_axis(self, value: Literal["AUTO", "X", "Y", "Z"]):
139
- self.node.pivot_axis = value
140
-
141
-
142
- class AxesToRotation(NodeBuilder):
143
- """Create a rotation from a primary and (ideally orthogonal) secondary axis"""
144
-
145
- name = "FunctionNodeAxesToRotation"
146
- node: bpy.types.FunctionNodeAxesToRotation
147
-
148
- def __init__(
149
- self,
150
- primary_axis: TYPE_INPUT_VECTOR = [0.0, 0.0, 1.0],
151
- secondary_axis: TYPE_INPUT_VECTOR = [1.0, 0.0, 0.0],
152
- primary_axis_axis: Literal["X", "Y", "Z"] = "Z",
153
- secondary_axis_axis: Literal["X", "Y", "Z"] = "X",
154
- **kwargs,
155
- ):
156
- super().__init__()
157
- key_args = {"Primary Axis": primary_axis, "Secondary Axis": secondary_axis}
158
- key_args.update(kwargs)
159
- self.primary_axis = primary_axis
160
- self.secondary_axis = secondary_axis
161
- self._establish_links(**key_args)
162
-
163
- @property
164
- def i_primary_axis(self) -> bpy.types.NodeSocketVector:
165
- """Input socket: Primary Axis"""
166
- return self._input("Primary Axis")
167
-
168
- @property
169
- def i_secondary_axis(self) -> bpy.types.NodeSocketVector:
170
- """Input socket: Secondary Axis"""
171
- return self._input("Secondary Axis")
172
-
173
- @property
174
- def o_rotation(self) -> bpy.types.NodeSocketRotation:
175
- """Output socket: Rotation"""
176
- return self._output("Rotation")
177
-
178
- @property
179
- def primary_axis(self) -> Literal["X", "Y", "Z"]:
180
- return self.node.primary_axis
181
-
182
- @primary_axis.setter
183
- def primary_axis(self, value: Literal["X", "Y", "Z"]):
184
- self.node.primary_axis = value
185
-
186
- @property
187
- def secondary_axis(self) -> Literal["X", "Y", "Z"]:
188
- return self.node.secondary_axis
189
-
190
- @secondary_axis.setter
191
- def secondary_axis(self, value: Literal["X", "Y", "Z"]):
192
- self.node.secondary_axis = value
193
-
194
-
195
- class AxisAngleToRotation(NodeBuilder):
196
- """Build a rotation from an axis and a rotation around that axis"""
197
-
198
- name = "FunctionNodeAxisAngleToRotation"
199
- node: bpy.types.FunctionNodeAxisAngleToRotation
200
-
201
- def __init__(
202
- self,
203
- axis: TYPE_INPUT_VECTOR = [0.0, 0.0, 1.0],
204
- angle: LINKABLE | None = 0.0,
205
- **kwargs,
206
- ):
207
- super().__init__()
208
- key_args = {"Axis": axis, "Angle": angle}
209
- key_args.update(kwargs)
210
-
211
- self._establish_links(**key_args)
212
-
213
- @property
214
- def i_axis(self) -> bpy.types.NodeSocketVector:
215
- """Input socket: Axis"""
216
- return self._input("Axis")
217
-
218
- @property
219
- def i_angle(self) -> NodeSocket:
220
- """Input socket: Angle"""
221
- return self._input("Angle")
222
-
223
- @property
224
- def o_rotation(self) -> bpy.types.NodeSocketRotation:
225
- """Output socket: Rotation"""
226
- return self._output("Rotation")
227
-
228
-
229
- class BitMath(NodeBuilder):
230
- """Perform bitwise operations on 32-bit integers"""
231
-
232
- name = "FunctionNodeBitMath"
233
- node: bpy.types.FunctionNodeBitMath
234
-
235
- def __init__(
236
- self,
237
- a: int | LINKABLE | None = 0,
238
- b: int | LINKABLE | None = 0,
239
- operation: Literal["AND", "OR", "XOR", "NOT", "SHIFT", "ROTATE"] = "AND",
240
- **kwargs,
241
- ):
242
- super().__init__()
243
- key_args = {"A": a, "B": b}
244
- key_args.update(kwargs)
245
- self.operation = operation
246
- self._establish_links(**key_args)
247
-
248
- @classmethod
249
- def l_and(
250
- cls, a: int | LINKABLE | None = 0, b: int | LINKABLE | None = 0
251
- ) -> "BitMath":
252
- """Create Bit Math with operation 'And'."""
253
- return cls(operation="AND", a=a, b=b)
254
-
255
- @classmethod
256
- def l_or(
257
- cls, a: int | LINKABLE | None = 0, b: int | LINKABLE | None = 0
258
- ) -> "BitMath":
259
- """Create Bit Math with operation 'Or'."""
260
- return cls(operation="OR", a=a, b=b)
261
-
262
- @classmethod
263
- def xor(
264
- cls, a: int | LINKABLE | None = 0, b: int | LINKABLE | None = 0
265
- ) -> "BitMath":
266
- """Create Bit Math with operation 'Exclusive Or'."""
267
- return cls(operation="XOR", a=a, b=b)
268
-
269
- @classmethod
270
- def l_not(
271
- cls, a: int | LINKABLE | None = 0, b: int | LINKABLE | None = 0
272
- ) -> "BitMath":
273
- """Create Bit Math with operation 'Not'."""
274
- return cls(operation="NOT", a=a, b=b)
275
-
276
- @classmethod
277
- def shift(
278
- cls, a: int | LINKABLE | None = 0, b: int | LINKABLE | None = 0
279
- ) -> "BitMath":
280
- """Create Bit Math with operation 'Shift'."""
281
- return cls(operation="SHIFT", a=a, b=b)
282
-
283
- @classmethod
284
- def rotate(
285
- cls, a: int | LINKABLE | None = 0, b: int | LINKABLE | None = 0
286
- ) -> "BitMath":
287
- """Create Bit Math with operation 'Rotate'."""
288
- return cls(operation="ROTATE", a=a, b=b)
289
-
290
- @property
291
- def i_a(self) -> bpy.types.NodeSocketInt:
292
- """Input socket: A"""
293
- return self._input("A")
294
-
295
- @property
296
- def i_b(self) -> bpy.types.NodeSocketInt:
297
- """Input socket: B"""
298
- return self._input("B")
299
-
300
- @property
301
- def o_value(self) -> bpy.types.NodeSocketInt:
302
- """Output socket: Value"""
303
- return self._output("Value")
304
-
305
- @property
306
- def operation(self) -> Literal["AND", "OR", "XOR", "NOT", "SHIFT", "ROTATE"]:
307
- return self.node.operation
308
-
309
- @operation.setter
310
- def operation(self, value: Literal["AND", "OR", "XOR", "NOT", "SHIFT", "ROTATE"]):
311
- self.node.operation = value
312
-
313
-
314
- class CombineColor(NodeBuilder):
315
- """Combine four channels into a single color, based on a particular color model"""
316
-
317
- name = "FunctionNodeCombineColor"
318
- node: bpy.types.FunctionNodeCombineColor
319
-
320
- def __init__(
321
- self,
322
- red: LINKABLE | None = 0.0,
323
- green: LINKABLE | None = 0.0,
324
- blue: LINKABLE | None = 0.0,
325
- alpha: LINKABLE | None = 1.0,
326
- mode: Literal["RGB", "HSV", "HSL"] = "RGB",
327
- **kwargs,
328
- ):
329
- super().__init__()
330
- key_args = {"Red": red, "Green": green, "Blue": blue, "Alpha": alpha}
331
- key_args.update(kwargs)
332
- self.mode = mode
333
- self._establish_links(**key_args)
334
-
335
- @property
336
- def i_red(self) -> NodeSocket:
337
- """Input socket: Red"""
338
- return self._input("Red")
339
-
340
- @property
341
- def i_green(self) -> NodeSocket:
342
- """Input socket: Green"""
343
- return self._input("Green")
344
-
345
- @property
346
- def i_blue(self) -> NodeSocket:
347
- """Input socket: Blue"""
348
- return self._input("Blue")
349
-
350
- @property
351
- def i_alpha(self) -> NodeSocket:
352
- """Input socket: Alpha"""
353
- return self._input("Alpha")
354
-
355
- @property
356
- def o_color(self) -> bpy.types.NodeSocketColor:
357
- """Output socket: Color"""
358
- return self._output("Color")
359
-
360
- @property
361
- def mode(self) -> Literal["RGB", "HSV", "HSL"]:
362
- return self.node.mode
363
-
364
- @mode.setter
365
- def mode(self, value: Literal["RGB", "HSV", "HSL"]):
366
- self.node.mode = value
367
-
368
-
369
- class CombineMatrix(NodeBuilder):
370
- """Construct a 4x4 matrix from its individual values"""
371
-
372
- name = "FunctionNodeCombineMatrix"
373
- node: bpy.types.FunctionNodeCombineMatrix
374
-
375
- def __init__(
376
- self,
377
- column_1_row_1: float | LINKABLE | None = 1.0,
378
- column_1_row_2: float | LINKABLE | None = 0.0,
379
- column_1_row_3: float | LINKABLE | None = 0.0,
380
- column_1_row_4: float | LINKABLE | None = 0.0,
381
- column_2_row_1: float | LINKABLE | None = 0.0,
382
- column_2_row_2: float | LINKABLE | None = 1.0,
383
- column_2_row_3: float | LINKABLE | None = 0.0,
384
- column_2_row_4: float | LINKABLE | None = 0.0,
385
- column_3_row_1: float | LINKABLE | None = 0.0,
386
- column_3_row_2: float | LINKABLE | None = 0.0,
387
- column_3_row_3: float | LINKABLE | None = 1.0,
388
- column_3_row_4: float | LINKABLE | None = 0.0,
389
- column_4_row_1: float | LINKABLE | None = 0.0,
390
- column_4_row_2: float | LINKABLE | None = 0.0,
391
- column_4_row_3: float | LINKABLE | None = 0.0,
392
- column_4_row_4: float | LINKABLE | None = 1.0,
393
- **kwargs,
394
- ):
395
- super().__init__()
396
- key_args = {
397
- "Column 1 Row 1": column_1_row_1,
398
- "Column 1 Row 2": column_1_row_2,
399
- "Column 1 Row 3": column_1_row_3,
400
- "Column 1 Row 4": column_1_row_4,
401
- "Column 2 Row 1": column_2_row_1,
402
- "Column 2 Row 2": column_2_row_2,
403
- "Column 2 Row 3": column_2_row_3,
404
- "Column 2 Row 4": column_2_row_4,
405
- "Column 3 Row 1": column_3_row_1,
406
- "Column 3 Row 2": column_3_row_2,
407
- "Column 3 Row 3": column_3_row_3,
408
- "Column 3 Row 4": column_3_row_4,
409
- "Column 4 Row 1": column_4_row_1,
410
- "Column 4 Row 2": column_4_row_2,
411
- "Column 4 Row 3": column_4_row_3,
412
- "Column 4 Row 4": column_4_row_4,
413
- }
414
- key_args.update(kwargs)
415
-
416
- self._establish_links(**key_args)
417
-
418
- @property
419
- def i_column_1_row_1(self) -> bpy.types.NodeSocketFloat:
420
- """Input socket: Column 1 Row 1"""
421
- return self._input("Column 1 Row 1")
422
-
423
- @property
424
- def i_column_1_row_2(self) -> bpy.types.NodeSocketFloat:
425
- """Input socket: Column 1 Row 2"""
426
- return self._input("Column 1 Row 2")
427
-
428
- @property
429
- def i_column_1_row_3(self) -> bpy.types.NodeSocketFloat:
430
- """Input socket: Column 1 Row 3"""
431
- return self._input("Column 1 Row 3")
432
-
433
- @property
434
- def i_column_1_row_4(self) -> bpy.types.NodeSocketFloat:
435
- """Input socket: Column 1 Row 4"""
436
- return self._input("Column 1 Row 4")
437
-
438
- @property
439
- def i_column_2_row_1(self) -> bpy.types.NodeSocketFloat:
440
- """Input socket: Column 2 Row 1"""
441
- return self._input("Column 2 Row 1")
442
-
443
- @property
444
- def i_column_2_row_2(self) -> bpy.types.NodeSocketFloat:
445
- """Input socket: Column 2 Row 2"""
446
- return self._input("Column 2 Row 2")
447
-
448
- @property
449
- def i_column_2_row_3(self) -> bpy.types.NodeSocketFloat:
450
- """Input socket: Column 2 Row 3"""
451
- return self._input("Column 2 Row 3")
452
-
453
- @property
454
- def i_column_2_row_4(self) -> bpy.types.NodeSocketFloat:
455
- """Input socket: Column 2 Row 4"""
456
- return self._input("Column 2 Row 4")
457
-
458
- @property
459
- def i_column_3_row_1(self) -> bpy.types.NodeSocketFloat:
460
- """Input socket: Column 3 Row 1"""
461
- return self._input("Column 3 Row 1")
462
-
463
- @property
464
- def i_column_3_row_2(self) -> bpy.types.NodeSocketFloat:
465
- """Input socket: Column 3 Row 2"""
466
- return self._input("Column 3 Row 2")
467
-
468
- @property
469
- def i_column_3_row_3(self) -> bpy.types.NodeSocketFloat:
470
- """Input socket: Column 3 Row 3"""
471
- return self._input("Column 3 Row 3")
472
-
473
- @property
474
- def i_column_3_row_4(self) -> bpy.types.NodeSocketFloat:
475
- """Input socket: Column 3 Row 4"""
476
- return self._input("Column 3 Row 4")
477
-
478
- @property
479
- def i_column_4_row_1(self) -> bpy.types.NodeSocketFloat:
480
- """Input socket: Column 4 Row 1"""
481
- return self._input("Column 4 Row 1")
482
-
483
- @property
484
- def i_column_4_row_2(self) -> bpy.types.NodeSocketFloat:
485
- """Input socket: Column 4 Row 2"""
486
- return self._input("Column 4 Row 2")
487
-
488
- @property
489
- def i_column_4_row_3(self) -> bpy.types.NodeSocketFloat:
490
- """Input socket: Column 4 Row 3"""
491
- return self._input("Column 4 Row 3")
492
-
493
- @property
494
- def i_column_4_row_4(self) -> bpy.types.NodeSocketFloat:
495
- """Input socket: Column 4 Row 4"""
496
- return self._input("Column 4 Row 4")
497
-
498
- @property
499
- def o_matrix(self) -> NodeSocket:
500
- """Output socket: Matrix"""
501
- return self._output("Matrix")
502
-
503
-
504
- class CombineTransform(NodeBuilder):
505
- """Combine a translation vector, a rotation, and a scale vector into a transformation matrix"""
506
-
507
- name = "FunctionNodeCombineTransform"
508
- node: bpy.types.FunctionNodeCombineTransform
509
-
510
- def __init__(
511
- self,
512
- translation: LINKABLE | None = [0.0, 0.0, 0.0],
513
- rotation: TYPE_INPUT_ROTATION = [0.0, 0.0, 0.0],
514
- scale: LINKABLE | None = [1.0, 1.0, 1.0],
515
- **kwargs,
516
- ):
517
- super().__init__()
518
- key_args = {"Translation": translation, "Rotation": rotation, "Scale": scale}
519
- key_args.update(kwargs)
520
-
521
- self._establish_links(**key_args)
522
-
523
- @property
524
- def i_translation(self) -> NodeSocket:
525
- """Input socket: Translation"""
526
- return self._input("Translation")
527
-
528
- @property
529
- def i_rotation(self) -> bpy.types.NodeSocketRotation:
530
- """Input socket: Rotation"""
531
- return self._input("Rotation")
532
-
533
- @property
534
- def i_scale(self) -> NodeSocket:
535
- """Input socket: Scale"""
536
- return self._input("Scale")
537
-
538
- @property
539
- def o_transform(self) -> NodeSocket:
540
- """Output socket: Transform"""
541
- return self._output("Transform")
542
-
543
-
544
- class Compare(NodeBuilder):
545
- """Perform a comparison operation on the two given inputs"""
546
-
547
- name = "FunctionNodeCompare"
548
- node: bpy.types.FunctionNodeCompare
549
-
550
- def __init__(
551
- self,
552
- a: float | LINKABLE | None = 0.0,
553
- b: float | LINKABLE | None = 0.0,
554
- operation: Literal[
555
- "LESS_THAN",
556
- "LESS_EQUAL",
557
- "GREATER_THAN",
558
- "GREATER_EQUAL",
559
- "EQUAL",
560
- "NOT_EQUAL",
561
- "BRIGHTER",
562
- "DARKER",
563
- ] = "GREATER_THAN",
564
- data_type: Literal[
565
- "FLOAT",
566
- "INT",
567
- "BOOLEAN",
568
- "VECTOR",
569
- "RGBA",
570
- "ROTATION",
571
- "MATRIX",
572
- "STRING",
573
- "MENU",
574
- "SHADER",
575
- "OBJECT",
576
- "IMAGE",
577
- "GEOMETRY",
578
- "COLLECTION",
579
- "TEXTURE",
580
- "MATERIAL",
581
- "BUNDLE",
582
- "CLOSURE",
583
- ] = "FLOAT",
584
- mode: Literal[
585
- "ELEMENT", "LENGTH", "AVERAGE", "DOT_PRODUCT", "DIRECTION"
586
- ] = "ELEMENT",
587
- **kwargs,
588
- ):
589
- super().__init__()
590
- key_args = {"A": a, "B": b}
591
- key_args.update(kwargs)
592
- self.operation = operation
593
- self.data_type = data_type
594
- self.mode = mode
595
- self._establish_links(**key_args)
596
-
597
- @classmethod
598
- def lessthan(
599
- cls, a: float | LINKABLE | None = 0.0, b: float | LINKABLE | None = 0.0
600
- ) -> "Compare":
601
- """Create Compare with operation 'Less Than'."""
602
- return cls(operation="LESS_THAN", a=a, b=b)
603
-
604
- @classmethod
605
- def lessequal(
606
- cls, a: float | LINKABLE | None = 0.0, b: float | LINKABLE | None = 0.0
607
- ) -> "Compare":
608
- """Create Compare with operation 'Less Than or Equal'."""
609
- return cls(operation="LESS_EQUAL", a=a, b=b)
610
-
611
- @classmethod
612
- def greaterthan(
613
- cls, a: float | LINKABLE | None = 0.0, b: float | LINKABLE | None = 0.0
614
- ) -> "Compare":
615
- """Create Compare with operation 'Greater Than'."""
616
- return cls(operation="GREATER_THAN", a=a, b=b)
617
-
618
- @classmethod
619
- def greaterequal(
620
- cls, a: float | LINKABLE | None = 0.0, b: float | LINKABLE | None = 0.0
621
- ) -> "Compare":
622
- """Create Compare with operation 'Greater Than or Equal'."""
623
- return cls(operation="GREATER_EQUAL", a=a, b=b)
624
-
625
- @classmethod
626
- def equal(
627
- cls, a: float | LINKABLE | None = 0.0, b: float | LINKABLE | None = 0.0
628
- ) -> "Compare":
629
- """Create Compare with operation 'Equal'."""
630
- return cls(operation="EQUAL", a=a, b=b)
631
-
632
- @classmethod
633
- def notequal(
634
- cls, a: float | LINKABLE | None = 0.0, b: float | LINKABLE | None = 0.0
635
- ) -> "Compare":
636
- """Create Compare with operation 'Not Equal'."""
637
- return cls(operation="NOT_EQUAL", a=a, b=b)
638
-
639
- @classmethod
640
- def brighter(
641
- cls, a: float | LINKABLE | None = 0.0, b: float | LINKABLE | None = 0.0
642
- ) -> "Compare":
643
- """Create Compare with operation 'Brighter'."""
644
- return cls(operation="BRIGHTER", a=a, b=b)
645
-
646
- @classmethod
647
- def darker(
648
- cls, a: float | LINKABLE | None = 0.0, b: float | LINKABLE | None = 0.0
649
- ) -> "Compare":
650
- """Create Compare with operation 'Darker'."""
651
- return cls(operation="DARKER", a=a, b=b)
652
-
653
- @property
654
- def i_a(self) -> bpy.types.NodeSocketFloat:
655
- """Input socket: A"""
656
- return self._input("A")
657
-
658
- @property
659
- def i_b(self) -> bpy.types.NodeSocketFloat:
660
- """Input socket: B"""
661
- return self._input("B")
662
-
663
- @property
664
- def o_result(self) -> bpy.types.NodeSocketBool:
665
- """Output socket: Result"""
666
- return self._output("Result")
667
-
668
- @property
669
- def operation(
670
- self,
671
- ) -> Literal[
672
- "LESS_THAN",
673
- "LESS_EQUAL",
674
- "GREATER_THAN",
675
- "GREATER_EQUAL",
676
- "EQUAL",
677
- "NOT_EQUAL",
678
- "BRIGHTER",
679
- "DARKER",
680
- ]:
681
- return self.node.operation
682
-
683
- @operation.setter
684
- def operation(
685
- self,
686
- value: Literal[
687
- "LESS_THAN",
688
- "LESS_EQUAL",
689
- "GREATER_THAN",
690
- "GREATER_EQUAL",
691
- "EQUAL",
692
- "NOT_EQUAL",
693
- "BRIGHTER",
694
- "DARKER",
695
- ],
696
- ):
697
- self.node.operation = value
698
-
699
- @property
700
- def data_type(
701
- self,
702
- ) -> Literal[
703
- "FLOAT",
704
- "INT",
705
- "BOOLEAN",
706
- "VECTOR",
707
- "RGBA",
708
- "ROTATION",
709
- "MATRIX",
710
- "STRING",
711
- "MENU",
712
- "SHADER",
713
- "OBJECT",
714
- "IMAGE",
715
- "GEOMETRY",
716
- "COLLECTION",
717
- "TEXTURE",
718
- "MATERIAL",
719
- "BUNDLE",
720
- "CLOSURE",
721
- ]:
722
- return self.node.data_type
723
-
724
- @data_type.setter
725
- def data_type(
726
- self,
727
- value: Literal[
728
- "FLOAT",
729
- "INT",
730
- "BOOLEAN",
731
- "VECTOR",
732
- "RGBA",
733
- "ROTATION",
734
- "MATRIX",
735
- "STRING",
736
- "MENU",
737
- "SHADER",
738
- "OBJECT",
739
- "IMAGE",
740
- "GEOMETRY",
741
- "COLLECTION",
742
- "TEXTURE",
743
- "MATERIAL",
744
- "BUNDLE",
745
- "CLOSURE",
746
- ],
747
- ):
748
- self.node.data_type = value
749
-
750
- @property
751
- def mode(
752
- self,
753
- ) -> Literal["ELEMENT", "LENGTH", "AVERAGE", "DOT_PRODUCT", "DIRECTION"]:
754
- return self.node.mode
755
-
756
- @mode.setter
757
- def mode(
758
- self, value: Literal["ELEMENT", "LENGTH", "AVERAGE", "DOT_PRODUCT", "DIRECTION"]
759
- ):
760
- self.node.mode = value
761
-
762
-
763
- class EulerToRotation(NodeBuilder):
764
- """Build a rotation from separate angles around each axis"""
765
-
766
- name = "FunctionNodeEulerToRotation"
767
- node: bpy.types.FunctionNodeEulerToRotation
768
-
769
- def __init__(self, euler: LINKABLE | None = [0.0, 0.0, 0.0], **kwargs):
770
- super().__init__()
771
- key_args = {"Euler": euler}
772
- key_args.update(kwargs)
773
-
774
- self._establish_links(**key_args)
775
-
776
- @property
777
- def i_euler(self) -> NodeSocket:
778
- """Input socket: Euler"""
779
- return self._input("Euler")
780
-
781
- @property
782
- def o_rotation(self) -> bpy.types.NodeSocketRotation:
783
- """Output socket: Rotation"""
784
- return self._output("Rotation")
785
-
786
-
787
- class FindInString(NodeBuilder):
788
- """Find the number of times a given string occurs in another string and the position of the first match"""
789
-
790
- name = "FunctionNodeFindInString"
791
- node: bpy.types.FunctionNodeFindInString
792
-
793
- def __init__(
794
- self,
795
- string: str | LINKABLE | None = "",
796
- search: str | LINKABLE | None = "",
797
- **kwargs,
798
- ):
799
- super().__init__()
800
- key_args = {"String": string, "Search": search}
801
- key_args.update(kwargs)
802
-
803
- self._establish_links(**key_args)
804
-
805
- @property
806
- def i_string(self) -> bpy.types.NodeSocketString:
807
- """Input socket: String"""
808
- return self._input("String")
809
-
810
- @property
811
- def i_search(self) -> bpy.types.NodeSocketString:
812
- """Input socket: Search"""
813
- return self._input("Search")
814
-
815
- @property
816
- def o_first_found(self) -> bpy.types.NodeSocketInt:
817
- """Output socket: First Found"""
818
- return self._output("First Found")
819
-
820
- @property
821
- def o_count(self) -> bpy.types.NodeSocketInt:
822
- """Output socket: Count"""
823
- return self._output("Count")
824
-
825
-
826
- class FloatToInteger(NodeBuilder):
827
- """Convert the given floating-point number to an integer, with a choice of methods"""
828
-
829
- name = "FunctionNodeFloatToInt"
830
- node: bpy.types.FunctionNodeFloatToInt
831
-
832
- def __init__(
833
- self,
834
- float: float | LINKABLE | None = 0.0,
835
- rounding_mode: Literal["ROUND", "FLOOR", "CEILING", "TRUNCATE"] = "ROUND",
836
- **kwargs,
837
- ):
838
- super().__init__()
839
- key_args = {"Float": float}
840
- key_args.update(kwargs)
841
- self.rounding_mode = rounding_mode
842
- self._establish_links(**key_args)
843
-
844
- @property
845
- def i_float(self) -> bpy.types.NodeSocketFloat:
846
- """Input socket: Float"""
847
- return self._input("Float")
848
-
849
- @property
850
- def o_integer(self) -> bpy.types.NodeSocketInt:
851
- """Output socket: Integer"""
852
- return self._output("Integer")
853
-
854
- @property
855
- def rounding_mode(self) -> Literal["ROUND", "FLOOR", "CEILING", "TRUNCATE"]:
856
- return self.node.rounding_mode
857
-
858
- @rounding_mode.setter
859
- def rounding_mode(self, value: Literal["ROUND", "FLOOR", "CEILING", "TRUNCATE"]):
860
- self.node.rounding_mode = value
861
-
862
-
863
- class FormatString(NodeBuilder):
864
- """Insert values into a string using a Python and path template compatible formatting syntax"""
865
-
866
- name = "FunctionNodeFormatString"
867
- node: bpy.types.FunctionNodeFormatString
868
-
869
- def __init__(
870
- self,
871
- format: str | LINKABLE | None = "",
872
- extend: LINKABLE | None = None,
873
- active_index: int = 0,
874
- **kwargs,
875
- ):
876
- super().__init__()
877
- key_args = {"Format": format, "__extend__": extend}
878
- key_args.update(kwargs)
879
- self.active_index = active_index
880
- self._establish_links(**key_args)
881
-
882
- @property
883
- def i_format(self) -> bpy.types.NodeSocketString:
884
- """Input socket: Format"""
885
- return self._input("Format")
886
-
887
- @property
888
- def i_input_socket(self) -> NodeSocket:
889
- """Input socket:"""
890
- return self._input("__extend__")
891
-
892
- @property
893
- def o_string(self) -> bpy.types.NodeSocketString:
894
- """Output socket: String"""
895
- return self._output("String")
896
-
897
- @property
898
- def active_index(self) -> int:
899
- return self.node.active_index
900
-
901
- @active_index.setter
902
- def active_index(self, value: int):
903
- self.node.active_index = value
904
-
905
-
906
- class HashValue(NodeBuilder):
907
- """Generate a randomized integer using the given input value as a seed"""
908
-
909
- name = "FunctionNodeHashValue"
910
- node: bpy.types.FunctionNodeHashValue
911
-
912
- def __init__(
913
- self,
914
- value: int | LINKABLE | None = 0,
915
- seed: int | LINKABLE | None = 0,
916
- data_type: Literal[
917
- "FLOAT",
918
- "INT",
919
- "BOOLEAN",
920
- "VECTOR",
921
- "RGBA",
922
- "ROTATION",
923
- "MATRIX",
924
- "STRING",
925
- "MENU",
926
- "SHADER",
927
- "OBJECT",
928
- "IMAGE",
929
- "GEOMETRY",
930
- "COLLECTION",
931
- "TEXTURE",
932
- "MATERIAL",
933
- "BUNDLE",
934
- "CLOSURE",
935
- ] = "INT",
936
- **kwargs,
937
- ):
938
- super().__init__()
939
- key_args = {"Value": value, "Seed": seed}
940
- key_args.update(kwargs)
941
- self.data_type = data_type
942
- self._establish_links(**key_args)
943
-
944
- @property
945
- def i_value(self) -> bpy.types.NodeSocketInt:
946
- """Input socket: Value"""
947
- return self._input("Value")
948
-
949
- @property
950
- def i_seed(self) -> bpy.types.NodeSocketInt:
951
- """Input socket: Seed"""
952
- return self._input("Seed")
953
-
954
- @property
955
- def o_hash(self) -> bpy.types.NodeSocketInt:
956
- """Output socket: Hash"""
957
- return self._output("Hash")
958
-
959
- @property
960
- def data_type(
961
- self,
962
- ) -> Literal[
963
- "FLOAT",
964
- "INT",
965
- "BOOLEAN",
966
- "VECTOR",
967
- "RGBA",
968
- "ROTATION",
969
- "MATRIX",
970
- "STRING",
971
- "MENU",
972
- "SHADER",
973
- "OBJECT",
974
- "IMAGE",
975
- "GEOMETRY",
976
- "COLLECTION",
977
- "TEXTURE",
978
- "MATERIAL",
979
- "BUNDLE",
980
- "CLOSURE",
981
- ]:
982
- return self.node.data_type
983
-
984
- @data_type.setter
985
- def data_type(
986
- self,
987
- value: Literal[
988
- "FLOAT",
989
- "INT",
990
- "BOOLEAN",
991
- "VECTOR",
992
- "RGBA",
993
- "ROTATION",
994
- "MATRIX",
995
- "STRING",
996
- "MENU",
997
- "SHADER",
998
- "OBJECT",
999
- "IMAGE",
1000
- "GEOMETRY",
1001
- "COLLECTION",
1002
- "TEXTURE",
1003
- "MATERIAL",
1004
- "BUNDLE",
1005
- "CLOSURE",
1006
- ],
1007
- ):
1008
- self.node.data_type = value
1009
-
1010
-
1011
- class IntegerMath(NodeBuilder):
1012
- """Perform various math operations on the given integer inputs"""
1013
-
1014
- name = "FunctionNodeIntegerMath"
1015
- node: bpy.types.FunctionNodeIntegerMath
1016
-
1017
- def __init__(
1018
- self,
1019
- value: int | LINKABLE | None = 0,
1020
- value_001: int | LINKABLE | None = 0,
1021
- operation: Literal[
1022
- "ADD",
1023
- "SUBTRACT",
1024
- "MULTIPLY",
1025
- "DIVIDE",
1026
- "MULTIPLY_ADD",
1027
- "ABSOLUTE",
1028
- "NEGATE",
1029
- "POWER",
1030
- "MINIMUM",
1031
- "MAXIMUM",
1032
- "SIGN",
1033
- "DIVIDE_ROUND",
1034
- "DIVIDE_FLOOR",
1035
- "DIVIDE_CEIL",
1036
- "FLOORED_MODULO",
1037
- "MODULO",
1038
- "GCD",
1039
- "LCM",
1040
- ] = "ADD",
1041
- **kwargs,
1042
- ):
1043
- super().__init__()
1044
- key_args = {"Value": value, "Value_001": value_001}
1045
- key_args.update(kwargs)
1046
- self.operation = operation
1047
- self._establish_links(**key_args)
1048
-
1049
- @classmethod
1050
- def add(
1051
- cls, value: int | LINKABLE | None = 0, value_001: int | LINKABLE | None = 0
1052
- ) -> "IntegerMath":
1053
- """Create Integer Math with operation 'Add'."""
1054
- return cls(operation="ADD", value=value, value_001=value_001)
1055
-
1056
- @classmethod
1057
- def subtract(
1058
- cls, value: int | LINKABLE | None = 0, value_001: int | LINKABLE | None = 0
1059
- ) -> "IntegerMath":
1060
- """Create Integer Math with operation 'Subtract'."""
1061
- return cls(operation="SUBTRACT", value=value, value_001=value_001)
1062
-
1063
- @classmethod
1064
- def multiply(
1065
- cls, value: int | LINKABLE | None = 0, value_001: int | LINKABLE | None = 0
1066
- ) -> "IntegerMath":
1067
- """Create Integer Math with operation 'Multiply'."""
1068
- return cls(operation="MULTIPLY", value=value, value_001=value_001)
1069
-
1070
- @classmethod
1071
- def divide(
1072
- cls, value: int | LINKABLE | None = 0, value_001: int | LINKABLE | None = 0
1073
- ) -> "IntegerMath":
1074
- """Create Integer Math with operation 'Divide'."""
1075
- return cls(operation="DIVIDE", value=value, value_001=value_001)
1076
-
1077
- @classmethod
1078
- def multiplyadd(
1079
- cls, value: int | LINKABLE | None = 0, value_001: int | LINKABLE | None = 0
1080
- ) -> "IntegerMath":
1081
- """Create Integer Math with operation 'Multiply Add'."""
1082
- return cls(operation="MULTIPLY_ADD", value=value, value_001=value_001)
1083
-
1084
- @classmethod
1085
- def absolute(
1086
- cls, value: int | LINKABLE | None = 0, value_001: int | LINKABLE | None = 0
1087
- ) -> "IntegerMath":
1088
- """Create Integer Math with operation 'Absolute'."""
1089
- return cls(operation="ABSOLUTE", value=value, value_001=value_001)
1090
-
1091
- @classmethod
1092
- def negate(
1093
- cls, value: int | LINKABLE | None = 0, value_001: int | LINKABLE | None = 0
1094
- ) -> "IntegerMath":
1095
- """Create Integer Math with operation 'Negate'."""
1096
- return cls(operation="NEGATE", value=value, value_001=value_001)
1097
-
1098
- @classmethod
1099
- def power(
1100
- cls, value: int | LINKABLE | None = 0, value_001: int | LINKABLE | None = 0
1101
- ) -> "IntegerMath":
1102
- """Create Integer Math with operation 'Power'."""
1103
- return cls(operation="POWER", value=value, value_001=value_001)
1104
-
1105
- @classmethod
1106
- def minimum(
1107
- cls, value: int | LINKABLE | None = 0, value_001: int | LINKABLE | None = 0
1108
- ) -> "IntegerMath":
1109
- """Create Integer Math with operation 'Minimum'."""
1110
- return cls(operation="MINIMUM", value=value, value_001=value_001)
1111
-
1112
- @classmethod
1113
- def maximum(
1114
- cls, value: int | LINKABLE | None = 0, value_001: int | LINKABLE | None = 0
1115
- ) -> "IntegerMath":
1116
- """Create Integer Math with operation 'Maximum'."""
1117
- return cls(operation="MAXIMUM", value=value, value_001=value_001)
1118
-
1119
- @classmethod
1120
- def sign(
1121
- cls, value: int | LINKABLE | None = 0, value_001: int | LINKABLE | None = 0
1122
- ) -> "IntegerMath":
1123
- """Create Integer Math with operation 'Sign'."""
1124
- return cls(operation="SIGN", value=value, value_001=value_001)
1125
-
1126
- @classmethod
1127
- def divideround(
1128
- cls, value: int | LINKABLE | None = 0, value_001: int | LINKABLE | None = 0
1129
- ) -> "IntegerMath":
1130
- """Create Integer Math with operation 'Divide Round'."""
1131
- return cls(operation="DIVIDE_ROUND", value=value, value_001=value_001)
1132
-
1133
- @classmethod
1134
- def dividefloor(
1135
- cls, value: int | LINKABLE | None = 0, value_001: int | LINKABLE | None = 0
1136
- ) -> "IntegerMath":
1137
- """Create Integer Math with operation 'Divide Floor'."""
1138
- return cls(operation="DIVIDE_FLOOR", value=value, value_001=value_001)
1139
-
1140
- @classmethod
1141
- def divideceil(
1142
- cls, value: int | LINKABLE | None = 0, value_001: int | LINKABLE | None = 0
1143
- ) -> "IntegerMath":
1144
- """Create Integer Math with operation 'Divide Ceiling'."""
1145
- return cls(operation="DIVIDE_CEIL", value=value, value_001=value_001)
1146
-
1147
- @classmethod
1148
- def flooredmodulo(
1149
- cls, value: int | LINKABLE | None = 0, value_001: int | LINKABLE | None = 0
1150
- ) -> "IntegerMath":
1151
- """Create Integer Math with operation 'Floored Modulo'."""
1152
- return cls(operation="FLOORED_MODULO", value=value, value_001=value_001)
1153
-
1154
- @classmethod
1155
- def modulo(
1156
- cls, value: int | LINKABLE | None = 0, value_001: int | LINKABLE | None = 0
1157
- ) -> "IntegerMath":
1158
- """Create Integer Math with operation 'Modulo'."""
1159
- return cls(operation="MODULO", value=value, value_001=value_001)
1160
-
1161
- @classmethod
1162
- def gcd(
1163
- cls, value: int | LINKABLE | None = 0, value_001: int | LINKABLE | None = 0
1164
- ) -> "IntegerMath":
1165
- """Create Integer Math with operation 'Greatest Common Divisor'."""
1166
- return cls(operation="GCD", value=value, value_001=value_001)
1167
-
1168
- @classmethod
1169
- def lcm(
1170
- cls, value: int | LINKABLE | None = 0, value_001: int | LINKABLE | None = 0
1171
- ) -> "IntegerMath":
1172
- """Create Integer Math with operation 'Least Common Multiple'."""
1173
- return cls(operation="LCM", value=value, value_001=value_001)
1174
-
1175
- @property
1176
- def i_value(self) -> bpy.types.NodeSocketInt:
1177
- """Input socket: Value"""
1178
- return self._input("Value")
1179
-
1180
- @property
1181
- def i_value_001(self) -> bpy.types.NodeSocketInt:
1182
- """Input socket: Value"""
1183
- return self._input("Value_001")
1184
-
1185
- @property
1186
- def o_value(self) -> bpy.types.NodeSocketInt:
1187
- """Output socket: Value"""
1188
- return self._output("Value")
1189
-
1190
- @property
1191
- def operation(
1192
- self,
1193
- ) -> Literal[
1194
- "ADD",
1195
- "SUBTRACT",
1196
- "MULTIPLY",
1197
- "DIVIDE",
1198
- "MULTIPLY_ADD",
1199
- "ABSOLUTE",
1200
- "NEGATE",
1201
- "POWER",
1202
- "MINIMUM",
1203
- "MAXIMUM",
1204
- "SIGN",
1205
- "DIVIDE_ROUND",
1206
- "DIVIDE_FLOOR",
1207
- "DIVIDE_CEIL",
1208
- "FLOORED_MODULO",
1209
- "MODULO",
1210
- "GCD",
1211
- "LCM",
1212
- ]:
1213
- return self.node.operation
1214
-
1215
- @operation.setter
1216
- def operation(
1217
- self,
1218
- value: Literal[
1219
- "ADD",
1220
- "SUBTRACT",
1221
- "MULTIPLY",
1222
- "DIVIDE",
1223
- "MULTIPLY_ADD",
1224
- "ABSOLUTE",
1225
- "NEGATE",
1226
- "POWER",
1227
- "MINIMUM",
1228
- "MAXIMUM",
1229
- "SIGN",
1230
- "DIVIDE_ROUND",
1231
- "DIVIDE_FLOOR",
1232
- "DIVIDE_CEIL",
1233
- "FLOORED_MODULO",
1234
- "MODULO",
1235
- "GCD",
1236
- "LCM",
1237
- ],
1238
- ):
1239
- self.node.operation = value
1240
-
1241
-
1242
- class InvertMatrix(NodeBuilder):
1243
- """Compute the inverse of the given matrix, if one exists"""
1244
-
1245
- name = "FunctionNodeInvertMatrix"
1246
- node: bpy.types.FunctionNodeInvertMatrix
1247
-
1248
- def __init__(self, matrix: LINKABLE | None = None, **kwargs):
1249
- super().__init__()
1250
- key_args = {"Matrix": matrix}
1251
- key_args.update(kwargs)
1252
-
1253
- self._establish_links(**key_args)
1254
-
1255
- @property
1256
- def i_matrix(self) -> NodeSocket:
1257
- """Input socket: Matrix"""
1258
- return self._input("Matrix")
1259
-
1260
- @property
1261
- def o_matrix(self) -> NodeSocket:
1262
- """Output socket: Matrix"""
1263
- return self._output("Matrix")
1264
-
1265
- @property
1266
- def o_invertible(self) -> bpy.types.NodeSocketBool:
1267
- """Output socket: Invertible"""
1268
- return self._output("Invertible")
1269
-
1270
-
1271
- class InvertRotation(NodeBuilder):
1272
- """Compute the inverse of the given rotation"""
1273
-
1274
- name = "FunctionNodeInvertRotation"
1275
- node: bpy.types.FunctionNodeInvertRotation
1276
-
1277
- def __init__(self, rotation: TYPE_INPUT_ROTATION = [0.0, 0.0, 0.0], **kwargs):
1278
- super().__init__()
1279
- key_args = {"Rotation": rotation}
1280
- key_args.update(kwargs)
1281
-
1282
- self._establish_links(**key_args)
1283
-
1284
- @property
1285
- def i_rotation(self) -> bpy.types.NodeSocketRotation:
1286
- """Input socket: Rotation"""
1287
- return self._input("Rotation")
1288
-
1289
- @property
1290
- def o_rotation(self) -> bpy.types.NodeSocketRotation:
1291
- """Output socket: Rotation"""
1292
- return self._output("Rotation")
1293
-
1294
-
1295
- class MatchString(NodeBuilder):
1296
- """Check if a given string exists within another string"""
1297
-
1298
- name = "FunctionNodeMatchString"
1299
- node: bpy.types.FunctionNodeMatchString
1300
-
1301
- def __init__(
1302
- self,
1303
- string: str | LINKABLE | None = "",
1304
- operation: LINKABLE | None = "Starts With",
1305
- key: str | LINKABLE | None = "",
1306
- **kwargs,
1307
- ):
1308
- super().__init__()
1309
- key_args = {"String": string, "Operation": operation, "Key": key}
1310
- key_args.update(kwargs)
1311
-
1312
- self._establish_links(**key_args)
1313
-
1314
- @property
1315
- def i_string(self) -> bpy.types.NodeSocketString:
1316
- """Input socket: String"""
1317
- return self._input("String")
1318
-
1319
- @property
1320
- def i_operation(self) -> NodeSocket:
1321
- """Input socket: Operation"""
1322
- return self._input("Operation")
1323
-
1324
- @property
1325
- def i_key(self) -> bpy.types.NodeSocketString:
1326
- """Input socket: Key"""
1327
- return self._input("Key")
1328
-
1329
- @property
1330
- def o_result(self) -> bpy.types.NodeSocketBool:
1331
- """Output socket: Result"""
1332
- return self._output("Result")
1333
-
1334
-
1335
- class MatrixDeterminant(NodeBuilder):
1336
- """Compute the determinant of the given matrix"""
1337
-
1338
- name = "FunctionNodeMatrixDeterminant"
1339
- node: bpy.types.FunctionNodeMatrixDeterminant
1340
-
1341
- def __init__(self, matrix: LINKABLE | None = None, **kwargs):
1342
- super().__init__()
1343
- key_args = {"Matrix": matrix}
1344
- key_args.update(kwargs)
1345
-
1346
- self._establish_links(**key_args)
1347
-
1348
- @property
1349
- def i_matrix(self) -> NodeSocket:
1350
- """Input socket: Matrix"""
1351
- return self._input("Matrix")
1352
-
1353
- @property
1354
- def o_determinant(self) -> bpy.types.NodeSocketFloat:
1355
- """Output socket: Determinant"""
1356
- return self._output("Determinant")
1357
-
1358
-
1359
- class MultiplyMatrices(NodeBuilder):
1360
- """Perform a matrix multiplication on two input matrices"""
1361
-
1362
- name = "FunctionNodeMatrixMultiply"
1363
- node: bpy.types.FunctionNodeMatrixMultiply
1364
-
1365
- def __init__(
1366
- self,
1367
- matrix: LINKABLE | None = None,
1368
- matrix_001: LINKABLE | None = None,
1369
- **kwargs,
1370
- ):
1371
- super().__init__()
1372
- key_args = {"Matrix": matrix, "Matrix_001": matrix_001}
1373
- key_args.update(kwargs)
1374
-
1375
- self._establish_links(**key_args)
1376
-
1377
- @property
1378
- def i_matrix(self) -> NodeSocket:
1379
- """Input socket: Matrix"""
1380
- return self._input("Matrix")
1381
-
1382
- @property
1383
- def i_matrix_001(self) -> NodeSocket:
1384
- """Input socket: Matrix"""
1385
- return self._input("Matrix_001")
1386
-
1387
- @property
1388
- def o_matrix(self) -> NodeSocket:
1389
- """Output socket: Matrix"""
1390
- return self._output("Matrix")
1391
-
1392
-
1393
- class ProjectPoint(NodeBuilder):
1394
- """Project a point using a matrix, using location, rotation, scale, and perspective divide"""
1395
-
1396
- name = "FunctionNodeProjectPoint"
1397
- node: bpy.types.FunctionNodeProjectPoint
1398
-
1399
- def __init__(
1400
- self,
1401
- vector: LINKABLE | None = [0.0, 0.0, 0.0],
1402
- transform: LINKABLE | None = None,
1403
- **kwargs,
1404
- ):
1405
- super().__init__()
1406
- key_args = {"Vector": vector, "Transform": transform}
1407
- key_args.update(kwargs)
1408
-
1409
- self._establish_links(**key_args)
1410
-
1411
- @property
1412
- def i_vector(self) -> NodeSocket:
1413
- """Input socket: Vector"""
1414
- return self._input("Vector")
1415
-
1416
- @property
1417
- def i_transform(self) -> NodeSocket:
1418
- """Input socket: Transform"""
1419
- return self._input("Transform")
1420
-
1421
- @property
1422
- def o_vector(self) -> NodeSocket:
1423
- """Output socket: Vector"""
1424
- return self._output("Vector")
1425
-
1426
-
1427
- class QuaternionToRotation(NodeBuilder):
1428
- """Build a rotation from quaternion components"""
1429
-
1430
- name = "FunctionNodeQuaternionToRotation"
1431
- node: bpy.types.FunctionNodeQuaternionToRotation
1432
-
1433
- def __init__(
1434
- self,
1435
- w: float | LINKABLE | None = 1.0,
1436
- x: float | LINKABLE | None = 0.0,
1437
- y: float | LINKABLE | None = 0.0,
1438
- z: float | LINKABLE | None = 0.0,
1439
- **kwargs,
1440
- ):
1441
- super().__init__()
1442
- key_args = {"W": w, "X": x, "Y": y, "Z": z}
1443
- key_args.update(kwargs)
1444
-
1445
- self._establish_links(**key_args)
1446
-
1447
- @property
1448
- def i_w(self) -> bpy.types.NodeSocketFloat:
1449
- """Input socket: W"""
1450
- return self._input("W")
1451
-
1452
- @property
1453
- def i_x(self) -> bpy.types.NodeSocketFloat:
1454
- """Input socket: X"""
1455
- return self._input("X")
1456
-
1457
- @property
1458
- def i_y(self) -> bpy.types.NodeSocketFloat:
1459
- """Input socket: Y"""
1460
- return self._input("Y")
1461
-
1462
- @property
1463
- def i_z(self) -> bpy.types.NodeSocketFloat:
1464
- """Input socket: Z"""
1465
- return self._input("Z")
1466
-
1467
- @property
1468
- def o_rotation(self) -> bpy.types.NodeSocketRotation:
1469
- """Output socket: Rotation"""
1470
- return self._output("Rotation")
1471
-
1472
-
1473
- class ReplaceString(NodeBuilder):
1474
- """Replace a given string segment with another"""
1475
-
1476
- name = "FunctionNodeReplaceString"
1477
- node: bpy.types.FunctionNodeReplaceString
1478
-
1479
- def __init__(
1480
- self,
1481
- string: str | LINKABLE | None = "",
1482
- find: str | LINKABLE | None = "",
1483
- replace: str | LINKABLE | None = "",
1484
- **kwargs,
1485
- ):
1486
- super().__init__()
1487
- key_args = {"String": string, "Find": find, "Replace": replace}
1488
- key_args.update(kwargs)
1489
-
1490
- self._establish_links(**key_args)
1491
-
1492
- @property
1493
- def i_string(self) -> bpy.types.NodeSocketString:
1494
- """Input socket: String"""
1495
- return self._input("String")
1496
-
1497
- @property
1498
- def i_find(self) -> bpy.types.NodeSocketString:
1499
- """Input socket: Find"""
1500
- return self._input("Find")
1501
-
1502
- @property
1503
- def i_replace(self) -> bpy.types.NodeSocketString:
1504
- """Input socket: Replace"""
1505
- return self._input("Replace")
1506
-
1507
- @property
1508
- def o_string(self) -> bpy.types.NodeSocketString:
1509
- """Output socket: String"""
1510
- return self._output("String")
1511
-
1512
-
1513
- class RotateEuler(NodeBuilder):
1514
- """Apply a secondary Euler rotation to a given Euler rotation"""
1515
-
1516
- name = "FunctionNodeRotateEuler"
1517
- node: bpy.types.FunctionNodeRotateEuler
1518
-
1519
- def __init__(
1520
- self,
1521
- rotation: LINKABLE | None = [0.0, 0.0, 0.0],
1522
- rotate_by: LINKABLE | None = [0.0, 0.0, 0.0],
1523
- rotation_type: Literal["AXIS_ANGLE", "EULER"] = "EULER",
1524
- space: Literal["OBJECT", "LOCAL"] = "OBJECT",
1525
- **kwargs,
1526
- ):
1527
- super().__init__()
1528
- key_args = {"Rotation": rotation, "Rotate By": rotate_by}
1529
- key_args.update(kwargs)
1530
- self.rotation_type = rotation_type
1531
- self.space = space
1532
- self._establish_links(**key_args)
1533
-
1534
- @property
1535
- def i_rotation(self) -> NodeSocket:
1536
- """Input socket: Rotation"""
1537
- return self._input("Rotation")
1538
-
1539
- @property
1540
- def i_rotate_by(self) -> NodeSocket:
1541
- """Input socket: Rotate By"""
1542
- return self._input("Rotate By")
1543
-
1544
- @property
1545
- def o_rotation(self) -> bpy.types.NodeSocketVector:
1546
- """Output socket: Rotation"""
1547
- return self._output("Rotation")
1548
-
1549
- @property
1550
- def rotation_type(self) -> Literal["AXIS_ANGLE", "EULER"]:
1551
- return self.node.rotation_type
1552
-
1553
- @rotation_type.setter
1554
- def rotation_type(self, value: Literal["AXIS_ANGLE", "EULER"]):
1555
- self.node.rotation_type = value
1556
-
1557
- @property
1558
- def space(self) -> Literal["OBJECT", "LOCAL"]:
1559
- return self.node.space
1560
-
1561
- @space.setter
1562
- def space(self, value: Literal["OBJECT", "LOCAL"]):
1563
- self.node.space = value
1564
-
1565
-
1566
- class RotateRotation(NodeBuilder):
1567
- """Apply a secondary rotation to a given rotation value"""
1568
-
1569
- name = "FunctionNodeRotateRotation"
1570
- node: bpy.types.FunctionNodeRotateRotation
1571
-
1572
- def __init__(
1573
- self,
1574
- rotation: TYPE_INPUT_ROTATION = [0.0, 0.0, 0.0],
1575
- rotate_by: TYPE_INPUT_ROTATION = [0.0, 0.0, 0.0],
1576
- rotation_space: Literal["GLOBAL", "LOCAL"] = "GLOBAL",
1577
- **kwargs,
1578
- ):
1579
- super().__init__()
1580
- key_args = {"Rotation": rotation, "Rotate By": rotate_by}
1581
- key_args.update(kwargs)
1582
- self.rotation_space = rotation_space
1583
- self._establish_links(**key_args)
1584
-
1585
- @property
1586
- def i_rotation(self) -> bpy.types.NodeSocketRotation:
1587
- """Input socket: Rotation"""
1588
- return self._input("Rotation")
1589
-
1590
- @property
1591
- def i_rotate_by(self) -> bpy.types.NodeSocketRotation:
1592
- """Input socket: Rotate By"""
1593
- return self._input("Rotate By")
1594
-
1595
- @property
1596
- def o_rotation(self) -> bpy.types.NodeSocketRotation:
1597
- """Output socket: Rotation"""
1598
- return self._output("Rotation")
1599
-
1600
- @property
1601
- def rotation_space(self) -> Literal["GLOBAL", "LOCAL"]:
1602
- return self.node.rotation_space
1603
-
1604
- @rotation_space.setter
1605
- def rotation_space(self, value: Literal["GLOBAL", "LOCAL"]):
1606
- self.node.rotation_space = value
1607
-
1608
-
1609
- class RotateVector(NodeBuilder):
1610
- """Apply a rotation to a given vector"""
1611
-
1612
- name = "FunctionNodeRotateVector"
1613
- node: bpy.types.FunctionNodeRotateVector
1614
-
1615
- def __init__(
1616
- self,
1617
- vector: TYPE_INPUT_VECTOR = [0.0, 0.0, 0.0],
1618
- rotation: TYPE_INPUT_ROTATION = [0.0, 0.0, 0.0],
1619
- **kwargs,
1620
- ):
1621
- super().__init__()
1622
- key_args = {"Vector": vector, "Rotation": rotation}
1623
- key_args.update(kwargs)
1624
-
1625
- self._establish_links(**key_args)
1626
-
1627
- @property
1628
- def i_vector(self) -> bpy.types.NodeSocketVector:
1629
- """Input socket: Vector"""
1630
- return self._input("Vector")
1631
-
1632
- @property
1633
- def i_rotation(self) -> bpy.types.NodeSocketRotation:
1634
- """Input socket: Rotation"""
1635
- return self._input("Rotation")
1636
-
1637
- @property
1638
- def o_vector(self) -> bpy.types.NodeSocketVector:
1639
- """Output socket: Vector"""
1640
- return self._output("Vector")
1641
-
1642
-
1643
- class RotationToAxisAngle(NodeBuilder):
1644
- """Convert a rotation to axis angle components"""
1645
-
1646
- name = "FunctionNodeRotationToAxisAngle"
1647
- node: bpy.types.FunctionNodeRotationToAxisAngle
1648
-
1649
- def __init__(self, rotation: TYPE_INPUT_ROTATION = [0.0, 0.0, 0.0], **kwargs):
1650
- super().__init__()
1651
- key_args = {"Rotation": rotation}
1652
- key_args.update(kwargs)
1653
-
1654
- self._establish_links(**key_args)
1655
-
1656
- @property
1657
- def i_rotation(self) -> bpy.types.NodeSocketRotation:
1658
- """Input socket: Rotation"""
1659
- return self._input("Rotation")
1660
-
1661
- @property
1662
- def o_axis(self) -> bpy.types.NodeSocketVector:
1663
- """Output socket: Axis"""
1664
- return self._output("Axis")
1665
-
1666
- @property
1667
- def o_angle(self) -> NodeSocket:
1668
- """Output socket: Angle"""
1669
- return self._output("Angle")
1670
-
1671
-
1672
- class RotationToEuler(NodeBuilder):
1673
- """Convert a standard rotation value to an Euler rotation"""
1674
-
1675
- name = "FunctionNodeRotationToEuler"
1676
- node: bpy.types.FunctionNodeRotationToEuler
1677
-
1678
- def __init__(self, rotation: TYPE_INPUT_ROTATION = [0.0, 0.0, 0.0], **kwargs):
1679
- super().__init__()
1680
- key_args = {"Rotation": rotation}
1681
- key_args.update(kwargs)
1682
-
1683
- self._establish_links(**key_args)
1684
-
1685
- @property
1686
- def i_rotation(self) -> bpy.types.NodeSocketRotation:
1687
- """Input socket: Rotation"""
1688
- return self._input("Rotation")
1689
-
1690
- @property
1691
- def o_euler(self) -> NodeSocket:
1692
- """Output socket: Euler"""
1693
- return self._output("Euler")
1694
-
1695
-
1696
- class RotationToQuaternion(NodeBuilder):
1697
- """Retrieve the quaternion components representing a rotation"""
1698
-
1699
- name = "FunctionNodeRotationToQuaternion"
1700
- node: bpy.types.FunctionNodeRotationToQuaternion
1701
-
1702
- def __init__(self, rotation: TYPE_INPUT_ROTATION = [0.0, 0.0, 0.0], **kwargs):
1703
- super().__init__()
1704
- key_args = {"Rotation": rotation}
1705
- key_args.update(kwargs)
1706
-
1707
- self._establish_links(**key_args)
1708
-
1709
- @property
1710
- def i_rotation(self) -> bpy.types.NodeSocketRotation:
1711
- """Input socket: Rotation"""
1712
- return self._input("Rotation")
1713
-
1714
- @property
1715
- def o_w(self) -> bpy.types.NodeSocketFloat:
1716
- """Output socket: W"""
1717
- return self._output("W")
1718
-
1719
- @property
1720
- def o_x(self) -> bpy.types.NodeSocketFloat:
1721
- """Output socket: X"""
1722
- return self._output("X")
1723
-
1724
- @property
1725
- def o_y(self) -> bpy.types.NodeSocketFloat:
1726
- """Output socket: Y"""
1727
- return self._output("Y")
1728
-
1729
- @property
1730
- def o_z(self) -> bpy.types.NodeSocketFloat:
1731
- """Output socket: Z"""
1732
- return self._output("Z")
1733
-
1734
-
1735
- class SeparateColor(NodeBuilder):
1736
- """Split a color into separate channels, based on a particular color model"""
1737
-
1738
- name = "FunctionNodeSeparateColor"
1739
- node: bpy.types.FunctionNodeSeparateColor
1740
-
1741
- def __init__(
1742
- self,
1743
- color: tuple[float, float, float, float] | LINKABLE | None = [
1744
- 1.0,
1745
- 1.0,
1746
- 1.0,
1747
- 1.0,
1748
- ],
1749
- mode: Literal["RGB", "HSV", "HSL"] = "RGB",
1750
- **kwargs,
1751
- ):
1752
- super().__init__()
1753
- key_args = {"Color": color}
1754
- key_args.update(kwargs)
1755
- self.mode = mode
1756
- self._establish_links(**key_args)
1757
-
1758
- @property
1759
- def i_color(self) -> bpy.types.NodeSocketColor:
1760
- """Input socket: Color"""
1761
- return self._input("Color")
1762
-
1763
- @property
1764
- def o_red(self) -> bpy.types.NodeSocketFloat:
1765
- """Output socket: Red"""
1766
- return self._output("Red")
1767
-
1768
- @property
1769
- def o_green(self) -> bpy.types.NodeSocketFloat:
1770
- """Output socket: Green"""
1771
- return self._output("Green")
1772
-
1773
- @property
1774
- def o_blue(self) -> bpy.types.NodeSocketFloat:
1775
- """Output socket: Blue"""
1776
- return self._output("Blue")
1777
-
1778
- @property
1779
- def o_alpha(self) -> bpy.types.NodeSocketFloat:
1780
- """Output socket: Alpha"""
1781
- return self._output("Alpha")
1782
-
1783
- @property
1784
- def mode(self) -> Literal["RGB", "HSV", "HSL"]:
1785
- return self.node.mode
1786
-
1787
- @mode.setter
1788
- def mode(self, value: Literal["RGB", "HSV", "HSL"]):
1789
- self.node.mode = value
1790
-
1791
-
1792
- class SeparateMatrix(NodeBuilder):
1793
- """Split a 4x4 matrix into its individual values"""
1794
-
1795
- name = "FunctionNodeSeparateMatrix"
1796
- node: bpy.types.FunctionNodeSeparateMatrix
1797
-
1798
- def __init__(self, matrix: LINKABLE | None = None, **kwargs):
1799
- super().__init__()
1800
- key_args = {"Matrix": matrix}
1801
- key_args.update(kwargs)
1802
-
1803
- self._establish_links(**key_args)
1804
-
1805
- @property
1806
- def i_matrix(self) -> NodeSocket:
1807
- """Input socket: Matrix"""
1808
- return self._input("Matrix")
1809
-
1810
- @property
1811
- def o_column_1_row_1(self) -> bpy.types.NodeSocketFloat:
1812
- """Output socket: Column 1 Row 1"""
1813
- return self._output("Column 1 Row 1")
1814
-
1815
- @property
1816
- def o_column_1_row_2(self) -> bpy.types.NodeSocketFloat:
1817
- """Output socket: Column 1 Row 2"""
1818
- return self._output("Column 1 Row 2")
1819
-
1820
- @property
1821
- def o_column_1_row_3(self) -> bpy.types.NodeSocketFloat:
1822
- """Output socket: Column 1 Row 3"""
1823
- return self._output("Column 1 Row 3")
1824
-
1825
- @property
1826
- def o_column_1_row_4(self) -> bpy.types.NodeSocketFloat:
1827
- """Output socket: Column 1 Row 4"""
1828
- return self._output("Column 1 Row 4")
1829
-
1830
- @property
1831
- def o_column_2_row_1(self) -> bpy.types.NodeSocketFloat:
1832
- """Output socket: Column 2 Row 1"""
1833
- return self._output("Column 2 Row 1")
1834
-
1835
- @property
1836
- def o_column_2_row_2(self) -> bpy.types.NodeSocketFloat:
1837
- """Output socket: Column 2 Row 2"""
1838
- return self._output("Column 2 Row 2")
1839
-
1840
- @property
1841
- def o_column_2_row_3(self) -> bpy.types.NodeSocketFloat:
1842
- """Output socket: Column 2 Row 3"""
1843
- return self._output("Column 2 Row 3")
1844
-
1845
- @property
1846
- def o_column_2_row_4(self) -> bpy.types.NodeSocketFloat:
1847
- """Output socket: Column 2 Row 4"""
1848
- return self._output("Column 2 Row 4")
1849
-
1850
- @property
1851
- def o_column_3_row_1(self) -> bpy.types.NodeSocketFloat:
1852
- """Output socket: Column 3 Row 1"""
1853
- return self._output("Column 3 Row 1")
1854
-
1855
- @property
1856
- def o_column_3_row_2(self) -> bpy.types.NodeSocketFloat:
1857
- """Output socket: Column 3 Row 2"""
1858
- return self._output("Column 3 Row 2")
1859
-
1860
- @property
1861
- def o_column_3_row_3(self) -> bpy.types.NodeSocketFloat:
1862
- """Output socket: Column 3 Row 3"""
1863
- return self._output("Column 3 Row 3")
1864
-
1865
- @property
1866
- def o_column_3_row_4(self) -> bpy.types.NodeSocketFloat:
1867
- """Output socket: Column 3 Row 4"""
1868
- return self._output("Column 3 Row 4")
1869
-
1870
- @property
1871
- def o_column_4_row_1(self) -> bpy.types.NodeSocketFloat:
1872
- """Output socket: Column 4 Row 1"""
1873
- return self._output("Column 4 Row 1")
1874
-
1875
- @property
1876
- def o_column_4_row_2(self) -> bpy.types.NodeSocketFloat:
1877
- """Output socket: Column 4 Row 2"""
1878
- return self._output("Column 4 Row 2")
1879
-
1880
- @property
1881
- def o_column_4_row_3(self) -> bpy.types.NodeSocketFloat:
1882
- """Output socket: Column 4 Row 3"""
1883
- return self._output("Column 4 Row 3")
1884
-
1885
- @property
1886
- def o_column_4_row_4(self) -> bpy.types.NodeSocketFloat:
1887
- """Output socket: Column 4 Row 4"""
1888
- return self._output("Column 4 Row 4")
1889
-
1890
-
1891
- class SeparateTransform(NodeBuilder):
1892
- """Split a transformation matrix into a translation vector, a rotation, and a scale vector"""
1893
-
1894
- name = "FunctionNodeSeparateTransform"
1895
- node: bpy.types.FunctionNodeSeparateTransform
1896
-
1897
- def __init__(self, transform: LINKABLE | None = None, **kwargs):
1898
- super().__init__()
1899
- key_args = {"Transform": transform}
1900
- key_args.update(kwargs)
1901
-
1902
- self._establish_links(**key_args)
1903
-
1904
- @property
1905
- def i_transform(self) -> NodeSocket:
1906
- """Input socket: Transform"""
1907
- return self._input("Transform")
1908
-
1909
- @property
1910
- def o_translation(self) -> NodeSocket:
1911
- """Output socket: Translation"""
1912
- return self._output("Translation")
1913
-
1914
- @property
1915
- def o_rotation(self) -> bpy.types.NodeSocketRotation:
1916
- """Output socket: Rotation"""
1917
- return self._output("Rotation")
1918
-
1919
- @property
1920
- def o_scale(self) -> NodeSocket:
1921
- """Output socket: Scale"""
1922
- return self._output("Scale")
1923
-
1924
-
1925
- class SliceString(NodeBuilder):
1926
- """Extract a string segment from a larger string"""
1927
-
1928
- name = "FunctionNodeSliceString"
1929
- node: bpy.types.FunctionNodeSliceString
1930
-
1931
- def __init__(
1932
- self,
1933
- string: str | LINKABLE | None = "",
1934
- position: int | LINKABLE | None = 0,
1935
- length: int | LINKABLE | None = 10,
1936
- **kwargs,
1937
- ):
1938
- super().__init__()
1939
- key_args = {"String": string, "Position": position, "Length": length}
1940
- key_args.update(kwargs)
1941
-
1942
- self._establish_links(**key_args)
1943
-
1944
- @property
1945
- def i_string(self) -> bpy.types.NodeSocketString:
1946
- """Input socket: String"""
1947
- return self._input("String")
1948
-
1949
- @property
1950
- def i_position(self) -> bpy.types.NodeSocketInt:
1951
- """Input socket: Position"""
1952
- return self._input("Position")
1953
-
1954
- @property
1955
- def i_length(self) -> bpy.types.NodeSocketInt:
1956
- """Input socket: Length"""
1957
- return self._input("Length")
1958
-
1959
- @property
1960
- def o_string(self) -> bpy.types.NodeSocketString:
1961
- """Output socket: String"""
1962
- return self._output("String")
1963
-
1964
-
1965
- class StringLength(NodeBuilder):
1966
- """Output the number of characters in the given string"""
1967
-
1968
- name = "FunctionNodeStringLength"
1969
- node: bpy.types.FunctionNodeStringLength
1970
-
1971
- def __init__(self, string: str | LINKABLE | None = "", **kwargs):
1972
- super().__init__()
1973
- key_args = {"String": string}
1974
- key_args.update(kwargs)
1975
-
1976
- self._establish_links(**key_args)
1977
-
1978
- @property
1979
- def i_string(self) -> bpy.types.NodeSocketString:
1980
- """Input socket: String"""
1981
- return self._input("String")
1982
-
1983
- @property
1984
- def o_length(self) -> bpy.types.NodeSocketInt:
1985
- """Output socket: Length"""
1986
- return self._output("Length")
1987
-
1988
-
1989
- class StringToValue(NodeBuilder):
1990
- """Derive a numeric value from a given string representation"""
1991
-
1992
- name = "FunctionNodeStringToValue"
1993
- node: bpy.types.FunctionNodeStringToValue
1994
-
1995
- def __init__(
1996
- self,
1997
- string: str | LINKABLE | None = "",
1998
- data_type: Literal["FLOAT", "INT"] = "FLOAT",
1999
- **kwargs,
2000
- ):
2001
- super().__init__()
2002
- key_args = {"String": string}
2003
- key_args.update(kwargs)
2004
- self.data_type = data_type
2005
- self._establish_links(**key_args)
2006
-
2007
- @property
2008
- def i_string(self) -> bpy.types.NodeSocketString:
2009
- """Input socket: String"""
2010
- return self._input("String")
2011
-
2012
- @property
2013
- def o_value(self) -> bpy.types.NodeSocketFloat:
2014
- """Output socket: Value"""
2015
- return self._output("Value")
2016
-
2017
- @property
2018
- def o_length(self) -> bpy.types.NodeSocketInt:
2019
- """Output socket: Length"""
2020
- return self._output("Length")
2021
-
2022
- @property
2023
- def data_type(self) -> Literal["FLOAT", "INT"]:
2024
- return self.node.data_type
2025
-
2026
- @data_type.setter
2027
- def data_type(self, value: Literal["FLOAT", "INT"]):
2028
- self.node.data_type = value
2029
-
2030
-
2031
- class TransformDirection(NodeBuilder):
2032
- """Apply a transformation matrix (excluding translation) to the given vector"""
2033
-
2034
- name = "FunctionNodeTransformDirection"
2035
- node: bpy.types.FunctionNodeTransformDirection
2036
-
2037
- def __init__(
2038
- self,
2039
- direction: LINKABLE | None = [0.0, 0.0, 0.0],
2040
- transform: LINKABLE | None = None,
2041
- **kwargs,
2042
- ):
2043
- super().__init__()
2044
- key_args = {"Direction": direction, "Transform": transform}
2045
- key_args.update(kwargs)
2046
-
2047
- self._establish_links(**key_args)
2048
-
2049
- @property
2050
- def i_direction(self) -> NodeSocket:
2051
- """Input socket: Direction"""
2052
- return self._input("Direction")
2053
-
2054
- @property
2055
- def i_transform(self) -> NodeSocket:
2056
- """Input socket: Transform"""
2057
- return self._input("Transform")
2058
-
2059
- @property
2060
- def o_direction(self) -> NodeSocket:
2061
- """Output socket: Direction"""
2062
- return self._output("Direction")
2063
-
2064
-
2065
- class TransformPoint(NodeBuilder):
2066
- """Apply a transformation matrix to the given vector"""
2067
-
2068
- name = "FunctionNodeTransformPoint"
2069
- node: bpy.types.FunctionNodeTransformPoint
2070
-
2071
- def __init__(
2072
- self,
2073
- vector: LINKABLE | None = [0.0, 0.0, 0.0],
2074
- transform: LINKABLE | None = None,
2075
- **kwargs,
2076
- ):
2077
- super().__init__()
2078
- key_args = {"Vector": vector, "Transform": transform}
2079
- key_args.update(kwargs)
2080
-
2081
- self._establish_links(**key_args)
2082
-
2083
- @property
2084
- def i_vector(self) -> NodeSocket:
2085
- """Input socket: Vector"""
2086
- return self._input("Vector")
2087
-
2088
- @property
2089
- def i_transform(self) -> NodeSocket:
2090
- """Input socket: Transform"""
2091
- return self._input("Transform")
2092
-
2093
- @property
2094
- def o_vector(self) -> NodeSocket:
2095
- """Output socket: Vector"""
2096
- return self._output("Vector")
2097
-
2098
-
2099
- class TransposeMatrix(NodeBuilder):
2100
- """Flip a matrix over its diagonal, turning columns into rows and vice-versa"""
2101
-
2102
- name = "FunctionNodeTransposeMatrix"
2103
- node: bpy.types.FunctionNodeTransposeMatrix
2104
-
2105
- def __init__(self, matrix: LINKABLE | None = None, **kwargs):
2106
- super().__init__()
2107
- key_args = {"Matrix": matrix}
2108
- key_args.update(kwargs)
2109
-
2110
- self._establish_links(**key_args)
2111
-
2112
- @property
2113
- def i_matrix(self) -> NodeSocket:
2114
- """Input socket: Matrix"""
2115
- return self._input("Matrix")
2116
-
2117
- @property
2118
- def o_matrix(self) -> NodeSocket:
2119
- """Output socket: Matrix"""
2120
- return self._output("Matrix")
2121
-
2122
-
2123
- class ValueToString(NodeBuilder):
2124
- """Generate a string representation of the given input value"""
2125
-
2126
- name = "FunctionNodeValueToString"
2127
- node: bpy.types.FunctionNodeValueToString
2128
-
2129
- def __init__(
2130
- self,
2131
- value: float | LINKABLE | None = 0.0,
2132
- decimals: int | LINKABLE | None = 0,
2133
- data_type: Literal["FLOAT", "INT"] = "FLOAT",
2134
- **kwargs,
2135
- ):
2136
- super().__init__()
2137
- key_args = {"Value": value, "Decimals": decimals}
2138
- key_args.update(kwargs)
2139
- self.data_type = data_type
2140
- self._establish_links(**key_args)
2141
-
2142
- @property
2143
- def i_value(self) -> bpy.types.NodeSocketFloat:
2144
- """Input socket: Value"""
2145
- return self._input("Value")
2146
-
2147
- @property
2148
- def i_decimals(self) -> bpy.types.NodeSocketInt:
2149
- """Input socket: Decimals"""
2150
- return self._input("Decimals")
2151
-
2152
- @property
2153
- def o_string(self) -> bpy.types.NodeSocketString:
2154
- """Output socket: String"""
2155
- return self._output("String")
2156
-
2157
- @property
2158
- def data_type(self) -> Literal["FLOAT", "INT"]:
2159
- return self.node.data_type
2160
-
2161
- @data_type.setter
2162
- def data_type(self, value: Literal["FLOAT", "INT"]):
2163
- self.node.data_type = value
2164
-
2165
-
2166
- class Clamp(NodeBuilder):
2167
- """Clamp a value between a minimum and a maximum"""
2168
-
2169
- name = "ShaderNodeClamp"
2170
- node: bpy.types.ShaderNodeClamp
2171
-
2172
- def __init__(
2173
- self,
2174
- value: float | LINKABLE | None = 1.0,
2175
- min: float | LINKABLE | None = 0.0,
2176
- max: float | LINKABLE | None = 1.0,
2177
- clamp_type: Literal["MINMAX", "RANGE"] = "MINMAX",
2178
- **kwargs,
2179
- ):
2180
- super().__init__()
2181
- key_args = {"Value": value, "Min": min, "Max": max}
2182
- key_args.update(kwargs)
2183
- self.clamp_type = clamp_type
2184
- self._establish_links(**key_args)
2185
-
2186
- @property
2187
- def i_value(self) -> bpy.types.NodeSocketFloat:
2188
- """Input socket: Value"""
2189
- return self._input("Value")
2190
-
2191
- @property
2192
- def i_min(self) -> bpy.types.NodeSocketFloat:
2193
- """Input socket: Min"""
2194
- return self._input("Min")
2195
-
2196
- @property
2197
- def i_max(self) -> bpy.types.NodeSocketFloat:
2198
- """Input socket: Max"""
2199
- return self._input("Max")
2200
-
2201
- @property
2202
- def o_result(self) -> bpy.types.NodeSocketFloat:
2203
- """Output socket: Result"""
2204
- return self._output("Result")
2205
-
2206
- @property
2207
- def clamp_type(self) -> Literal["MINMAX", "RANGE"]:
2208
- return self.node.clamp_type
2209
-
2210
- @clamp_type.setter
2211
- def clamp_type(self, value: Literal["MINMAX", "RANGE"]):
2212
- self.node.clamp_type = value
2213
-
2214
-
2215
- class Gamma(NodeBuilder):
2216
- """Apply a gamma correction"""
2217
-
2218
- name = "ShaderNodeGamma"
2219
- node: bpy.types.ShaderNodeGamma
2220
-
2221
- def __init__(
2222
- self,
2223
- color: tuple[float, float, float, float] | LINKABLE | None = [
2224
- 1.0,
2225
- 1.0,
2226
- 1.0,
2227
- 1.0,
2228
- ],
2229
- gamma: float | LINKABLE | None = 1.0,
2230
- **kwargs,
2231
- ):
2232
- super().__init__()
2233
- key_args = {"Color": color, "Gamma": gamma}
2234
- key_args.update(kwargs)
2235
-
2236
- self._establish_links(**key_args)
2237
-
2238
- @property
2239
- def i_color(self) -> bpy.types.NodeSocketColor:
2240
- """Input socket: Color"""
2241
- return self._input("Color")
2242
-
2243
- @property
2244
- def i_gamma(self) -> bpy.types.NodeSocketFloat:
2245
- """Input socket: Gamma"""
2246
- return self._input("Gamma")
2247
-
2248
- @property
2249
- def o_color(self) -> bpy.types.NodeSocketColor:
2250
- """Output socket: Color"""
2251
- return self._output("Color")
2252
-
2253
-
2254
- class MapRange(NodeBuilder):
2255
- """Remap a value from a range to a target range"""
2256
-
2257
- name = "ShaderNodeMapRange"
2258
- node: bpy.types.ShaderNodeMapRange
2259
-
2260
- def __init__(
2261
- self,
2262
- value: float | LINKABLE | None = 1.0,
2263
- from_min: float | LINKABLE | None = 0.0,
2264
- from_max: float | LINKABLE | None = 1.0,
2265
- to_min: float | LINKABLE | None = 0.0,
2266
- to_max: float | LINKABLE | None = 1.0,
2267
- clamp: bool = False,
2268
- interpolation_type: Literal[
2269
- "LINEAR", "STEPPED", "SMOOTHSTEP", "SMOOTHERSTEP"
2270
- ] = "LINEAR",
2271
- data_type: Literal["FLOAT", "FLOAT_VECTOR"] = "FLOAT",
2272
- **kwargs,
2273
- ):
2274
- super().__init__()
2275
- key_args = {
2276
- "Value": value,
2277
- "From Min": from_min,
2278
- "From Max": from_max,
2279
- "To Min": to_min,
2280
- "To Max": to_max,
2281
- }
2282
- key_args.update(kwargs)
2283
- self.clamp = clamp
2284
- self.interpolation_type = interpolation_type
2285
- self.data_type = data_type
2286
- self._establish_links(**key_args)
2287
-
2288
- @property
2289
- def i_value(self) -> bpy.types.NodeSocketFloat:
2290
- """Input socket: Value"""
2291
- return self._input("Value")
2292
-
2293
- @property
2294
- def i_from_min(self) -> bpy.types.NodeSocketFloat:
2295
- """Input socket: From Min"""
2296
- return self._input("From Min")
2297
-
2298
- @property
2299
- def i_from_max(self) -> bpy.types.NodeSocketFloat:
2300
- """Input socket: From Max"""
2301
- return self._input("From Max")
2302
-
2303
- @property
2304
- def i_to_min(self) -> bpy.types.NodeSocketFloat:
2305
- """Input socket: To Min"""
2306
- return self._input("To Min")
2307
-
2308
- @property
2309
- def i_to_max(self) -> bpy.types.NodeSocketFloat:
2310
- """Input socket: To Max"""
2311
- return self._input("To Max")
2312
-
2313
- @property
2314
- def o_result(self) -> bpy.types.NodeSocketFloat:
2315
- """Output socket: Result"""
2316
- return self._output("Result")
2317
-
2318
- @property
2319
- def clamp(self) -> bool:
2320
- return self.node.clamp
2321
-
2322
- @clamp.setter
2323
- def clamp(self, value: bool):
2324
- self.node.clamp = value
2325
-
2326
- @property
2327
- def interpolation_type(
2328
- self,
2329
- ) -> Literal["LINEAR", "STEPPED", "SMOOTHSTEP", "SMOOTHERSTEP"]:
2330
- return self.node.interpolation_type
2331
-
2332
- @interpolation_type.setter
2333
- def interpolation_type(
2334
- self, value: Literal["LINEAR", "STEPPED", "SMOOTHSTEP", "SMOOTHERSTEP"]
2335
- ):
2336
- self.node.interpolation_type = value
2337
-
2338
- @property
2339
- def data_type(self) -> Literal["FLOAT", "FLOAT_VECTOR"]:
2340
- return self.node.data_type
2341
-
2342
- @data_type.setter
2343
- def data_type(self, value: Literal["FLOAT", "FLOAT_VECTOR"]):
2344
- self.node.data_type = value