nodebpy 0.1.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.
@@ -0,0 +1,12 @@
1
+ """Auto-generated geometry node classes."""
2
+
3
+ # Import manually specified nodes
4
+ from .manually_specified import *
5
+
6
+ # Import auto-generated nodes
7
+ from .attribute import *
8
+ from .curve import *
9
+ from .geometry import *
10
+ from .input import *
11
+ from .mesh import *
12
+ from .utilities import *
@@ -0,0 +1,580 @@
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_BOOLEAN
22
+
23
+
24
+ class DomainSize(NodeBuilder):
25
+ """Retrieve the number of elements in a geometry for each attribute domain"""
26
+
27
+ name = "GeometryNodeAttributeDomainSize"
28
+ node: bpy.types.GeometryNodeAttributeDomainSize
29
+
30
+ def __init__(
31
+ self,
32
+ geometry: LINKABLE = None,
33
+ component: Literal[
34
+ "MESH", "POINTCLOUD", "CURVE", "INSTANCES", "GREASEPENCIL"
35
+ ] = "MESH",
36
+ **kwargs,
37
+ ):
38
+ super().__init__()
39
+ key_args = {"Geometry": geometry}
40
+ key_args.update(kwargs)
41
+ self.component = component
42
+ self._establish_links(**key_args)
43
+
44
+ @property
45
+ def i_geometry(self) -> NodeSocket:
46
+ """Input socket: Geometry"""
47
+ return self._input("Geometry")
48
+
49
+ @property
50
+ def o_point_count(self) -> bpy.types.NodeSocketInt:
51
+ """Output socket: Point Count"""
52
+ return self._output("Point Count")
53
+
54
+ @property
55
+ def o_edge_count(self) -> bpy.types.NodeSocketInt:
56
+ """Output socket: Edge Count"""
57
+ return self._output("Edge Count")
58
+
59
+ @property
60
+ def o_face_count(self) -> bpy.types.NodeSocketInt:
61
+ """Output socket: Face Count"""
62
+ return self._output("Face Count")
63
+
64
+ @property
65
+ def o_face_corner_count(self) -> bpy.types.NodeSocketInt:
66
+ """Output socket: Face Corner Count"""
67
+ return self._output("Face Corner Count")
68
+
69
+ @property
70
+ def component(
71
+ self,
72
+ ) -> Literal["MESH", "POINTCLOUD", "CURVE", "INSTANCES", "GREASEPENCIL"]:
73
+ return self.node.component
74
+
75
+ @component.setter
76
+ def component(
77
+ self, value: Literal["MESH", "POINTCLOUD", "CURVE", "INSTANCES", "GREASEPENCIL"]
78
+ ):
79
+ self.node.component = value
80
+
81
+
82
+ class AttributeStatistic(NodeBuilder):
83
+ """Calculate statistics about a data set from a field evaluated on a geometry"""
84
+
85
+ name = "GeometryNodeAttributeStatistic"
86
+ node: bpy.types.GeometryNodeAttributeStatistic
87
+
88
+ def __init__(
89
+ self,
90
+ geometry: LINKABLE = None,
91
+ selection: TYPE_INPUT_BOOLEAN = True,
92
+ attribute: float | LINKABLE | None = 0.0,
93
+ data_type: Literal[
94
+ "FLOAT",
95
+ "INT",
96
+ "BOOLEAN",
97
+ "FLOAT_VECTOR",
98
+ "FLOAT_COLOR",
99
+ "QUATERNION",
100
+ "FLOAT4X4",
101
+ "STRING",
102
+ "INT8",
103
+ "INT16_2D",
104
+ "INT32_2D",
105
+ "FLOAT2",
106
+ "BYTE_COLOR",
107
+ ] = "FLOAT",
108
+ domain: Literal[
109
+ "POINT", "EDGE", "FACE", "CORNER", "CURVE", "INSTANCE", "LAYER"
110
+ ] = "POINT",
111
+ **kwargs,
112
+ ):
113
+ super().__init__()
114
+ key_args = {
115
+ "Geometry": geometry,
116
+ "Selection": selection,
117
+ "Attribute": attribute,
118
+ }
119
+ key_args.update(kwargs)
120
+ self.data_type = data_type
121
+ self.domain = domain
122
+ self._establish_links(**key_args)
123
+
124
+ @property
125
+ def i_geometry(self) -> NodeSocket:
126
+ """Input socket: Geometry"""
127
+ return self._input("Geometry")
128
+
129
+ @property
130
+ def i_selection(self) -> bpy.types.NodeSocketBool:
131
+ """Input socket: Selection"""
132
+ return self._input("Selection")
133
+
134
+ @property
135
+ def i_attribute(self) -> bpy.types.NodeSocketFloat:
136
+ """Input socket: Attribute"""
137
+ return self._input("Attribute")
138
+
139
+ @property
140
+ def o_mean(self) -> bpy.types.NodeSocketFloat:
141
+ """Output socket: Mean"""
142
+ return self._output("Mean")
143
+
144
+ @property
145
+ def o_median(self) -> bpy.types.NodeSocketFloat:
146
+ """Output socket: Median"""
147
+ return self._output("Median")
148
+
149
+ @property
150
+ def o_sum(self) -> bpy.types.NodeSocketFloat:
151
+ """Output socket: Sum"""
152
+ return self._output("Sum")
153
+
154
+ @property
155
+ def o_min(self) -> bpy.types.NodeSocketFloat:
156
+ """Output socket: Min"""
157
+ return self._output("Min")
158
+
159
+ @property
160
+ def o_max(self) -> bpy.types.NodeSocketFloat:
161
+ """Output socket: Max"""
162
+ return self._output("Max")
163
+
164
+ @property
165
+ def o_range(self) -> bpy.types.NodeSocketFloat:
166
+ """Output socket: Range"""
167
+ return self._output("Range")
168
+
169
+ @property
170
+ def o_standard_deviation(self) -> bpy.types.NodeSocketFloat:
171
+ """Output socket: Standard Deviation"""
172
+ return self._output("Standard Deviation")
173
+
174
+ @property
175
+ def o_variance(self) -> bpy.types.NodeSocketFloat:
176
+ """Output socket: Variance"""
177
+ return self._output("Variance")
178
+
179
+ @property
180
+ def data_type(
181
+ self,
182
+ ) -> Literal[
183
+ "FLOAT",
184
+ "INT",
185
+ "BOOLEAN",
186
+ "FLOAT_VECTOR",
187
+ "FLOAT_COLOR",
188
+ "QUATERNION",
189
+ "FLOAT4X4",
190
+ "STRING",
191
+ "INT8",
192
+ "INT16_2D",
193
+ "INT32_2D",
194
+ "FLOAT2",
195
+ "BYTE_COLOR",
196
+ ]:
197
+ return self.node.data_type
198
+
199
+ @data_type.setter
200
+ def data_type(
201
+ self,
202
+ value: Literal[
203
+ "FLOAT",
204
+ "INT",
205
+ "BOOLEAN",
206
+ "FLOAT_VECTOR",
207
+ "FLOAT_COLOR",
208
+ "QUATERNION",
209
+ "FLOAT4X4",
210
+ "STRING",
211
+ "INT8",
212
+ "INT16_2D",
213
+ "INT32_2D",
214
+ "FLOAT2",
215
+ "BYTE_COLOR",
216
+ ],
217
+ ):
218
+ self.node.data_type = value
219
+
220
+ @property
221
+ def domain(
222
+ self,
223
+ ) -> Literal["POINT", "EDGE", "FACE", "CORNER", "CURVE", "INSTANCE", "LAYER"]:
224
+ return self.node.domain
225
+
226
+ @domain.setter
227
+ def domain(
228
+ self,
229
+ value: Literal["POINT", "EDGE", "FACE", "CORNER", "CURVE", "INSTANCE", "LAYER"],
230
+ ):
231
+ self.node.domain = value
232
+
233
+
234
+ class BlurAttribute(NodeBuilder):
235
+ """Mix attribute values of neighboring elements"""
236
+
237
+ name = "GeometryNodeBlurAttribute"
238
+ node: bpy.types.GeometryNodeBlurAttribute
239
+
240
+ def __init__(
241
+ self,
242
+ value: float | LINKABLE | None = 0.0,
243
+ iterations: int | LINKABLE | None = 1,
244
+ weight: LINKABLE | None = 1.0,
245
+ data_type: Literal[
246
+ "FLOAT",
247
+ "INT",
248
+ "BOOLEAN",
249
+ "FLOAT_VECTOR",
250
+ "FLOAT_COLOR",
251
+ "QUATERNION",
252
+ "FLOAT4X4",
253
+ "STRING",
254
+ "INT8",
255
+ "INT16_2D",
256
+ "INT32_2D",
257
+ "FLOAT2",
258
+ "BYTE_COLOR",
259
+ ] = "FLOAT",
260
+ **kwargs,
261
+ ):
262
+ super().__init__()
263
+ key_args = {"Value": value, "Iterations": iterations, "Weight": weight}
264
+ key_args.update(kwargs)
265
+ self.data_type = data_type
266
+ self._establish_links(**key_args)
267
+
268
+ @property
269
+ def i_value(self) -> bpy.types.NodeSocketFloat:
270
+ """Input socket: Value"""
271
+ return self._input("Value")
272
+
273
+ @property
274
+ def i_iterations(self) -> bpy.types.NodeSocketInt:
275
+ """Input socket: Iterations"""
276
+ return self._input("Iterations")
277
+
278
+ @property
279
+ def i_weight(self) -> NodeSocket:
280
+ """Input socket: Weight"""
281
+ return self._input("Weight")
282
+
283
+ @property
284
+ def o_value(self) -> bpy.types.NodeSocketFloat:
285
+ """Output socket: Value"""
286
+ return self._output("Value")
287
+
288
+ @property
289
+ def data_type(
290
+ self,
291
+ ) -> Literal[
292
+ "FLOAT",
293
+ "INT",
294
+ "BOOLEAN",
295
+ "FLOAT_VECTOR",
296
+ "FLOAT_COLOR",
297
+ "QUATERNION",
298
+ "FLOAT4X4",
299
+ "STRING",
300
+ "INT8",
301
+ "INT16_2D",
302
+ "INT32_2D",
303
+ "FLOAT2",
304
+ "BYTE_COLOR",
305
+ ]:
306
+ return self.node.data_type
307
+
308
+ @data_type.setter
309
+ def data_type(
310
+ self,
311
+ value: Literal[
312
+ "FLOAT",
313
+ "INT",
314
+ "BOOLEAN",
315
+ "FLOAT_VECTOR",
316
+ "FLOAT_COLOR",
317
+ "QUATERNION",
318
+ "FLOAT4X4",
319
+ "STRING",
320
+ "INT8",
321
+ "INT16_2D",
322
+ "INT32_2D",
323
+ "FLOAT2",
324
+ "BYTE_COLOR",
325
+ ],
326
+ ):
327
+ self.node.data_type = value
328
+
329
+
330
+ class NamedAttribute(NodeBuilder):
331
+ """Retrieve the data of a specified attribute"""
332
+
333
+ name = "GeometryNodeInputNamedAttribute"
334
+ node: bpy.types.GeometryNodeInputNamedAttribute
335
+
336
+ def __init__(
337
+ self,
338
+ name: str | LINKABLE | None = "",
339
+ data_type: Literal[
340
+ "FLOAT",
341
+ "INT",
342
+ "BOOLEAN",
343
+ "FLOAT_VECTOR",
344
+ "FLOAT_COLOR",
345
+ "QUATERNION",
346
+ "FLOAT4X4",
347
+ "STRING",
348
+ "INT8",
349
+ "INT16_2D",
350
+ "INT32_2D",
351
+ "FLOAT2",
352
+ "BYTE_COLOR",
353
+ ] = "FLOAT",
354
+ **kwargs,
355
+ ):
356
+ super().__init__()
357
+ key_args = {"Name": name}
358
+ key_args.update(kwargs)
359
+ self.data_type = data_type
360
+ self._establish_links(**key_args)
361
+
362
+ @property
363
+ def i_name(self) -> bpy.types.NodeSocketString:
364
+ """Input socket: Name"""
365
+ return self._input("Name")
366
+
367
+ @property
368
+ def o_attribute(self) -> bpy.types.NodeSocketFloat:
369
+ """Output socket: Attribute"""
370
+ return self._output("Attribute")
371
+
372
+ @property
373
+ def o_exists(self) -> bpy.types.NodeSocketBool:
374
+ """Output socket: Exists"""
375
+ return self._output("Exists")
376
+
377
+ @property
378
+ def data_type(
379
+ self,
380
+ ) -> Literal[
381
+ "FLOAT",
382
+ "INT",
383
+ "BOOLEAN",
384
+ "FLOAT_VECTOR",
385
+ "FLOAT_COLOR",
386
+ "QUATERNION",
387
+ "FLOAT4X4",
388
+ "STRING",
389
+ "INT8",
390
+ "INT16_2D",
391
+ "INT32_2D",
392
+ "FLOAT2",
393
+ "BYTE_COLOR",
394
+ ]:
395
+ return self.node.data_type
396
+
397
+ @data_type.setter
398
+ def data_type(
399
+ self,
400
+ value: Literal[
401
+ "FLOAT",
402
+ "INT",
403
+ "BOOLEAN",
404
+ "FLOAT_VECTOR",
405
+ "FLOAT_COLOR",
406
+ "QUATERNION",
407
+ "FLOAT4X4",
408
+ "STRING",
409
+ "INT8",
410
+ "INT16_2D",
411
+ "INT32_2D",
412
+ "FLOAT2",
413
+ "BYTE_COLOR",
414
+ ],
415
+ ):
416
+ self.node.data_type = value
417
+
418
+
419
+ class RemoveNamedAttribute(NodeBuilder):
420
+ """Delete an attribute with a specified name from a geometry. Typically used to optimize performance"""
421
+
422
+ name = "GeometryNodeRemoveAttribute"
423
+ node: bpy.types.GeometryNodeRemoveAttribute
424
+
425
+ def __init__(
426
+ self,
427
+ geometry: LINKABLE = None,
428
+ pattern_mode: LINKABLE | None = "Exact",
429
+ name: str | LINKABLE | None = "",
430
+ **kwargs,
431
+ ):
432
+ super().__init__()
433
+ key_args = {"Geometry": geometry, "Pattern Mode": pattern_mode, "Name": name}
434
+ key_args.update(kwargs)
435
+
436
+ self._establish_links(**key_args)
437
+
438
+ @property
439
+ def i_geometry(self) -> NodeSocket:
440
+ """Input socket: Geometry"""
441
+ return self._input("Geometry")
442
+
443
+ @property
444
+ def i_pattern_mode(self) -> NodeSocket:
445
+ """Input socket: Pattern Mode"""
446
+ return self._input("Pattern Mode")
447
+
448
+ @property
449
+ def i_name(self) -> bpy.types.NodeSocketString:
450
+ """Input socket: Name"""
451
+ return self._input("Name")
452
+
453
+ @property
454
+ def o_geometry(self) -> NodeSocket:
455
+ """Output socket: Geometry"""
456
+ return self._output("Geometry")
457
+
458
+
459
+ class StoreNamedAttribute(NodeBuilder):
460
+ """Store the result of a field on a geometry as an attribute with the specified name"""
461
+
462
+ name = "GeometryNodeStoreNamedAttribute"
463
+ node: bpy.types.GeometryNodeStoreNamedAttribute
464
+
465
+ def __init__(
466
+ self,
467
+ geometry: LINKABLE = None,
468
+ selection: TYPE_INPUT_BOOLEAN = True,
469
+ name: str | LINKABLE | None = "",
470
+ value: float | LINKABLE | None = 0.0,
471
+ data_type: Literal[
472
+ "FLOAT",
473
+ "INT",
474
+ "BOOLEAN",
475
+ "FLOAT_VECTOR",
476
+ "FLOAT_COLOR",
477
+ "QUATERNION",
478
+ "FLOAT4X4",
479
+ "STRING",
480
+ "INT8",
481
+ "INT16_2D",
482
+ "INT32_2D",
483
+ "FLOAT2",
484
+ "BYTE_COLOR",
485
+ ] = "FLOAT",
486
+ domain: Literal[
487
+ "POINT", "EDGE", "FACE", "CORNER", "CURVE", "INSTANCE", "LAYER"
488
+ ] = "POINT",
489
+ **kwargs,
490
+ ):
491
+ super().__init__()
492
+ key_args = {
493
+ "Geometry": geometry,
494
+ "Selection": selection,
495
+ "Name": name,
496
+ "Value": value,
497
+ }
498
+ key_args.update(kwargs)
499
+ self.data_type = data_type
500
+ self.domain = domain
501
+ self._establish_links(**key_args)
502
+
503
+ @property
504
+ def i_geometry(self) -> NodeSocket:
505
+ """Input socket: Geometry"""
506
+ return self._input("Geometry")
507
+
508
+ @property
509
+ def i_selection(self) -> bpy.types.NodeSocketBool:
510
+ """Input socket: Selection"""
511
+ return self._input("Selection")
512
+
513
+ @property
514
+ def i_name(self) -> bpy.types.NodeSocketString:
515
+ """Input socket: Name"""
516
+ return self._input("Name")
517
+
518
+ @property
519
+ def i_value(self) -> bpy.types.NodeSocketFloat:
520
+ """Input socket: Value"""
521
+ return self._input("Value")
522
+
523
+ @property
524
+ def o_geometry(self) -> NodeSocket:
525
+ """Output socket: Geometry"""
526
+ return self._output("Geometry")
527
+
528
+ @property
529
+ def data_type(
530
+ self,
531
+ ) -> Literal[
532
+ "FLOAT",
533
+ "INT",
534
+ "BOOLEAN",
535
+ "FLOAT_VECTOR",
536
+ "FLOAT_COLOR",
537
+ "QUATERNION",
538
+ "FLOAT4X4",
539
+ "STRING",
540
+ "INT8",
541
+ "INT16_2D",
542
+ "INT32_2D",
543
+ "FLOAT2",
544
+ "BYTE_COLOR",
545
+ ]:
546
+ return self.node.data_type
547
+
548
+ @data_type.setter
549
+ def data_type(
550
+ self,
551
+ value: Literal[
552
+ "FLOAT",
553
+ "INT",
554
+ "BOOLEAN",
555
+ "FLOAT_VECTOR",
556
+ "FLOAT_COLOR",
557
+ "QUATERNION",
558
+ "FLOAT4X4",
559
+ "STRING",
560
+ "INT8",
561
+ "INT16_2D",
562
+ "INT32_2D",
563
+ "FLOAT2",
564
+ "BYTE_COLOR",
565
+ ],
566
+ ):
567
+ self.node.data_type = value
568
+
569
+ @property
570
+ def domain(
571
+ self,
572
+ ) -> Literal["POINT", "EDGE", "FACE", "CORNER", "CURVE", "INSTANCE", "LAYER"]:
573
+ return self.node.domain
574
+
575
+ @domain.setter
576
+ def domain(
577
+ self,
578
+ value: Literal["POINT", "EDGE", "FACE", "CORNER", "CURVE", "INSTANCE", "LAYER"],
579
+ ):
580
+ self.node.domain = value