nodebpy 0.1.1__py3-none-any.whl → 0.2.1__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.
- nodebpy/builder.py +786 -316
- nodebpy/nodes/__init__.py +641 -10
- nodebpy/nodes/attribute.py +345 -389
- nodebpy/nodes/color.py +72 -0
- nodebpy/nodes/converter.py +3527 -0
- nodebpy/nodes/experimental.py +312 -0
- nodebpy/nodes/geometry.py +3677 -4717
- nodebpy/nodes/grid.py +1713 -0
- nodebpy/nodes/group.py +17 -0
- nodebpy/nodes/input.py +1821 -316
- nodebpy/nodes/interface.py +519 -0
- nodebpy/nodes/manual.py +2022 -0
- nodebpy/nodes/output.py +85 -0
- nodebpy/nodes/texture.py +930 -0
- nodebpy/nodes/vector.py +528 -0
- nodebpy/nodes/zone.py +442 -0
- nodebpy/screenshot.py +2 -1
- nodebpy/sockets.py +12 -12
- nodebpy/types.py +445 -0
- {nodebpy-0.1.1.dist-info → nodebpy-0.2.1.dist-info}/METADATA +5 -5
- nodebpy-0.2.1.dist-info/RECORD +26 -0
- nodebpy/nodes/curve.py +0 -2006
- nodebpy/nodes/manually_specified.py +0 -1382
- nodebpy/nodes/mesh.py +0 -1408
- nodebpy/nodes/types.py +0 -119
- nodebpy/nodes/utilities.py +0 -2344
- nodebpy-0.1.1.dist-info/RECORD +0 -19
- {nodebpy-0.1.1.dist-info → nodebpy-0.2.1.dist-info}/WHEEL +0 -0
- {nodebpy-0.1.1.dist-info → nodebpy-0.2.1.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
from typing import Literal
|
|
2
|
+
|
|
3
|
+
import bpy
|
|
4
|
+
|
|
5
|
+
from ..builder import NodeBuilder, SocketLinker
|
|
6
|
+
from ..types import (
|
|
7
|
+
TYPE_INPUT_BOOLEAN,
|
|
8
|
+
TYPE_INPUT_INT,
|
|
9
|
+
TYPE_INPUT_MENU,
|
|
10
|
+
TYPE_INPUT_ROTATION,
|
|
11
|
+
TYPE_INPUT_COLOR,
|
|
12
|
+
TYPE_INPUT_MATRIX,
|
|
13
|
+
TYPE_INPUT_VALUE,
|
|
14
|
+
TYPE_INPUT_VECTOR,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class GetListItem(NodeBuilder):
|
|
19
|
+
"""Retrieve a value from a list"""
|
|
20
|
+
|
|
21
|
+
_bl_idname = "GeometryNodeListGetItem"
|
|
22
|
+
node: bpy.types.GeometryNodeListGetItem
|
|
23
|
+
|
|
24
|
+
def __init__(
|
|
25
|
+
self,
|
|
26
|
+
list: TYPE_INPUT_VALUE = 0.0,
|
|
27
|
+
index: TYPE_INPUT_INT = 0,
|
|
28
|
+
*,
|
|
29
|
+
data_type: Literal[
|
|
30
|
+
"FLOAT", "INT", "BOOLEAN", "VECTOR", "RGBA", "ROTATION", "MATRIX", "MENU"
|
|
31
|
+
] = "FLOAT",
|
|
32
|
+
):
|
|
33
|
+
super().__init__()
|
|
34
|
+
key_args = {"List": list, "Index": index}
|
|
35
|
+
self.data_type = data_type
|
|
36
|
+
self._establish_links(**key_args)
|
|
37
|
+
|
|
38
|
+
@classmethod
|
|
39
|
+
def float(
|
|
40
|
+
cls, list: TYPE_INPUT_VALUE = 0.0, index: TYPE_INPUT_INT = 0
|
|
41
|
+
) -> "GetListItem":
|
|
42
|
+
"""Create Get List Item with operation 'Float'."""
|
|
43
|
+
return cls(data_type="FLOAT", list=list, index=index)
|
|
44
|
+
|
|
45
|
+
@classmethod
|
|
46
|
+
def integer(
|
|
47
|
+
cls, list: TYPE_INPUT_INT = 0, index: TYPE_INPUT_INT = 0
|
|
48
|
+
) -> "GetListItem":
|
|
49
|
+
"""Create Get List Item with operation 'Integer'."""
|
|
50
|
+
return cls(data_type="INT", list=list, index=index)
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def boolean(
|
|
54
|
+
cls, list: TYPE_INPUT_BOOLEAN = False, index: TYPE_INPUT_INT = 0
|
|
55
|
+
) -> "GetListItem":
|
|
56
|
+
"""Create Get List Item with operation 'Boolean'."""
|
|
57
|
+
return cls(data_type="BOOLEAN", list=list, index=index)
|
|
58
|
+
|
|
59
|
+
@classmethod
|
|
60
|
+
def vector(
|
|
61
|
+
cls, list: TYPE_INPUT_VECTOR = None, index: TYPE_INPUT_INT = 0
|
|
62
|
+
) -> "GetListItem":
|
|
63
|
+
"""Create Get List Item with operation 'Vector'."""
|
|
64
|
+
return cls(data_type="VECTOR", list=list, index=index)
|
|
65
|
+
|
|
66
|
+
@classmethod
|
|
67
|
+
def color(
|
|
68
|
+
cls, list: TYPE_INPUT_COLOR = None, index: TYPE_INPUT_INT = 0
|
|
69
|
+
) -> "GetListItem":
|
|
70
|
+
"""Create Get List Item with operation 'Color'."""
|
|
71
|
+
return cls(data_type="RGBA", list=list, index=index)
|
|
72
|
+
|
|
73
|
+
@classmethod
|
|
74
|
+
def rotation(
|
|
75
|
+
cls, list: TYPE_INPUT_ROTATION = None, index: TYPE_INPUT_INT = 0
|
|
76
|
+
) -> "GetListItem":
|
|
77
|
+
"""Create Get List Item with operation 'Rotation'."""
|
|
78
|
+
return cls(data_type="ROTATION", list=list, index=index)
|
|
79
|
+
|
|
80
|
+
@classmethod
|
|
81
|
+
def matrix(
|
|
82
|
+
cls, list: TYPE_INPUT_MATRIX = None, index: TYPE_INPUT_INT = 0
|
|
83
|
+
) -> "GetListItem":
|
|
84
|
+
"""Create Get List Item with operation 'Matrix'."""
|
|
85
|
+
return cls(data_type="MATRIX", list=list, index=index)
|
|
86
|
+
|
|
87
|
+
@classmethod
|
|
88
|
+
def menu(
|
|
89
|
+
cls, list: TYPE_INPUT_MENU = "", index: TYPE_INPUT_INT = 0
|
|
90
|
+
) -> "GetListItem":
|
|
91
|
+
"""Create Get List Item with operation 'Menu'."""
|
|
92
|
+
return cls(data_type="MENU", list=list, index=index)
|
|
93
|
+
|
|
94
|
+
@property
|
|
95
|
+
def i_list(self) -> SocketLinker:
|
|
96
|
+
"""Input socket: List"""
|
|
97
|
+
return self._input("List")
|
|
98
|
+
|
|
99
|
+
@property
|
|
100
|
+
def i_index(self) -> SocketLinker:
|
|
101
|
+
"""Input socket: Index"""
|
|
102
|
+
return self._input("Index")
|
|
103
|
+
|
|
104
|
+
@property
|
|
105
|
+
def o_value(self) -> SocketLinker:
|
|
106
|
+
"""Output socket: Value"""
|
|
107
|
+
return self._output("Value")
|
|
108
|
+
|
|
109
|
+
@property
|
|
110
|
+
def data_type(
|
|
111
|
+
self,
|
|
112
|
+
) -> Literal[
|
|
113
|
+
"FLOAT", "INT", "BOOLEAN", "VECTOR", "RGBA", "ROTATION", "MATRIX", "MENU"
|
|
114
|
+
]:
|
|
115
|
+
return self.node.data_type
|
|
116
|
+
|
|
117
|
+
@data_type.setter
|
|
118
|
+
def data_type(
|
|
119
|
+
self,
|
|
120
|
+
value: Literal[
|
|
121
|
+
"FLOAT", "INT", "BOOLEAN", "VECTOR", "RGBA", "ROTATION", "MATRIX", "MENU"
|
|
122
|
+
],
|
|
123
|
+
):
|
|
124
|
+
self.node.data_type = value
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
class List(NodeBuilder):
|
|
128
|
+
"""Create a list of values"""
|
|
129
|
+
|
|
130
|
+
_bl_idname = "GeometryNodeList"
|
|
131
|
+
node: bpy.types.GeometryNodeList
|
|
132
|
+
|
|
133
|
+
def __init__(
|
|
134
|
+
self,
|
|
135
|
+
count: TYPE_INPUT_INT = 1,
|
|
136
|
+
value: TYPE_INPUT_VALUE = 0.0,
|
|
137
|
+
*,
|
|
138
|
+
data_type: Literal[
|
|
139
|
+
"FLOAT", "INT", "BOOLEAN", "VECTOR", "RGBA", "ROTATION", "MATRIX", "MENU"
|
|
140
|
+
] = "FLOAT",
|
|
141
|
+
):
|
|
142
|
+
super().__init__()
|
|
143
|
+
key_args = {"Count": count, "Value": value}
|
|
144
|
+
self.data_type = data_type
|
|
145
|
+
self._establish_links(**key_args)
|
|
146
|
+
|
|
147
|
+
@classmethod
|
|
148
|
+
def float(cls, count: TYPE_INPUT_INT = 1, value: TYPE_INPUT_VALUE = 0.0) -> "List":
|
|
149
|
+
"""Create List with operation 'Float'."""
|
|
150
|
+
return cls(data_type="FLOAT", count=count, value=value)
|
|
151
|
+
|
|
152
|
+
@classmethod
|
|
153
|
+
def integer(cls, count: TYPE_INPUT_INT = 1, value: TYPE_INPUT_INT = 0) -> "List":
|
|
154
|
+
"""Create List with operation 'Integer'."""
|
|
155
|
+
return cls(data_type="INT", count=count, value=value)
|
|
156
|
+
|
|
157
|
+
@classmethod
|
|
158
|
+
def boolean(
|
|
159
|
+
cls, count: TYPE_INPUT_INT = 1, value: TYPE_INPUT_BOOLEAN = False
|
|
160
|
+
) -> "List":
|
|
161
|
+
"""Create List with operation 'Boolean'."""
|
|
162
|
+
return cls(data_type="BOOLEAN", count=count, value=value)
|
|
163
|
+
|
|
164
|
+
@classmethod
|
|
165
|
+
def vector(
|
|
166
|
+
cls, count: TYPE_INPUT_INT = 1, value: TYPE_INPUT_VECTOR = None
|
|
167
|
+
) -> "List":
|
|
168
|
+
"""Create List with operation 'Vector'."""
|
|
169
|
+
return cls(data_type="VECTOR", count=count, value=value)
|
|
170
|
+
|
|
171
|
+
@classmethod
|
|
172
|
+
def color(cls, count: TYPE_INPUT_INT = 1, value: TYPE_INPUT_COLOR = None) -> "List":
|
|
173
|
+
"""Create List with operation 'Color'."""
|
|
174
|
+
return cls(data_type="RGBA", count=count, value=value)
|
|
175
|
+
|
|
176
|
+
@classmethod
|
|
177
|
+
def rotation(
|
|
178
|
+
cls, count: TYPE_INPUT_INT = 1, value: TYPE_INPUT_ROTATION = None
|
|
179
|
+
) -> "List":
|
|
180
|
+
"""Create List with operation 'Rotation'."""
|
|
181
|
+
return cls(data_type="ROTATION", count=count, value=value)
|
|
182
|
+
|
|
183
|
+
@classmethod
|
|
184
|
+
def matrix(
|
|
185
|
+
cls, count: TYPE_INPUT_INT = 1, value: TYPE_INPUT_MATRIX = None
|
|
186
|
+
) -> "List":
|
|
187
|
+
"""Create List with operation 'Matrix'."""
|
|
188
|
+
return cls(data_type="MATRIX", count=count, value=value)
|
|
189
|
+
|
|
190
|
+
@classmethod
|
|
191
|
+
def menu(cls, count: TYPE_INPUT_INT = 1, value: TYPE_INPUT_MENU = "") -> "List":
|
|
192
|
+
"""Create List with operation 'Menu'."""
|
|
193
|
+
return cls(data_type="MENU", count=count, value=value)
|
|
194
|
+
|
|
195
|
+
@property
|
|
196
|
+
def i_count(self) -> SocketLinker:
|
|
197
|
+
"""Input socket: Count"""
|
|
198
|
+
return self._input("Count")
|
|
199
|
+
|
|
200
|
+
@property
|
|
201
|
+
def i_value(self) -> SocketLinker:
|
|
202
|
+
"""Input socket: Value"""
|
|
203
|
+
return self._input("Value")
|
|
204
|
+
|
|
205
|
+
@property
|
|
206
|
+
def o_list(self) -> SocketLinker:
|
|
207
|
+
"""Output socket: List"""
|
|
208
|
+
return self._output("List")
|
|
209
|
+
|
|
210
|
+
@property
|
|
211
|
+
def data_type(
|
|
212
|
+
self,
|
|
213
|
+
) -> Literal[
|
|
214
|
+
"FLOAT", "INT", "BOOLEAN", "VECTOR", "RGBA", "ROTATION", "MATRIX", "MENU"
|
|
215
|
+
]:
|
|
216
|
+
return self.node.data_type
|
|
217
|
+
|
|
218
|
+
@data_type.setter
|
|
219
|
+
def data_type(
|
|
220
|
+
self,
|
|
221
|
+
value: Literal[
|
|
222
|
+
"FLOAT", "INT", "BOOLEAN", "VECTOR", "RGBA", "ROTATION", "MATRIX", "MENU"
|
|
223
|
+
],
|
|
224
|
+
):
|
|
225
|
+
self.node.data_type = value
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
class ListLength(NodeBuilder):
|
|
229
|
+
"""Count how many items are in a given list"""
|
|
230
|
+
|
|
231
|
+
_bl_idname = "GeometryNodeListLength"
|
|
232
|
+
node: bpy.types.GeometryNodeListLength
|
|
233
|
+
|
|
234
|
+
def __init__(
|
|
235
|
+
self,
|
|
236
|
+
list: TYPE_INPUT_VALUE = 0.0,
|
|
237
|
+
*,
|
|
238
|
+
data_type: Literal[
|
|
239
|
+
"FLOAT", "INT", "BOOLEAN", "VECTOR", "RGBA", "ROTATION", "MATRIX", "MENU"
|
|
240
|
+
] = "FLOAT",
|
|
241
|
+
):
|
|
242
|
+
super().__init__()
|
|
243
|
+
key_args = {"List": list}
|
|
244
|
+
self.data_type = data_type
|
|
245
|
+
self._establish_links(**key_args)
|
|
246
|
+
|
|
247
|
+
@classmethod
|
|
248
|
+
def float(cls, list: TYPE_INPUT_VALUE = 0.0) -> "ListLength":
|
|
249
|
+
"""Create List Length with operation 'Float'."""
|
|
250
|
+
return cls(data_type="FLOAT", list=list)
|
|
251
|
+
|
|
252
|
+
@classmethod
|
|
253
|
+
def integer(cls, list: TYPE_INPUT_INT = 0) -> "ListLength":
|
|
254
|
+
"""Create List Length with operation 'Integer'."""
|
|
255
|
+
return cls(data_type="INT", list=list)
|
|
256
|
+
|
|
257
|
+
@classmethod
|
|
258
|
+
def boolean(cls, list: TYPE_INPUT_BOOLEAN = False) -> "ListLength":
|
|
259
|
+
"""Create List Length with operation 'Boolean'."""
|
|
260
|
+
return cls(data_type="BOOLEAN", list=list)
|
|
261
|
+
|
|
262
|
+
@classmethod
|
|
263
|
+
def vector(cls, list: TYPE_INPUT_VECTOR = None) -> "ListLength":
|
|
264
|
+
"""Create List Length with operation 'Vector'."""
|
|
265
|
+
return cls(data_type="VECTOR", list=list)
|
|
266
|
+
|
|
267
|
+
@classmethod
|
|
268
|
+
def color(cls, list: TYPE_INPUT_COLOR = None) -> "ListLength":
|
|
269
|
+
"""Create List Length with operation 'Color'."""
|
|
270
|
+
return cls(data_type="RGBA", list=list)
|
|
271
|
+
|
|
272
|
+
@classmethod
|
|
273
|
+
def rotation(cls, list: TYPE_INPUT_ROTATION = None) -> "ListLength":
|
|
274
|
+
"""Create List Length with operation 'Rotation'."""
|
|
275
|
+
return cls(data_type="ROTATION", list=list)
|
|
276
|
+
|
|
277
|
+
@classmethod
|
|
278
|
+
def matrix(cls, list: TYPE_INPUT_MATRIX = None) -> "ListLength":
|
|
279
|
+
"""Create List Length with operation 'Matrix'."""
|
|
280
|
+
return cls(data_type="MATRIX", list=list)
|
|
281
|
+
|
|
282
|
+
@classmethod
|
|
283
|
+
def menu(cls, list: TYPE_INPUT_MENU = "") -> "ListLength":
|
|
284
|
+
"""Create List Length with operation 'Menu'."""
|
|
285
|
+
return cls(data_type="MENU", list=list)
|
|
286
|
+
|
|
287
|
+
@property
|
|
288
|
+
def i_list(self) -> SocketLinker:
|
|
289
|
+
"""Input socket: List"""
|
|
290
|
+
return self._input("List")
|
|
291
|
+
|
|
292
|
+
@property
|
|
293
|
+
def o_length(self) -> SocketLinker:
|
|
294
|
+
"""Output socket: Length"""
|
|
295
|
+
return self._output("Length")
|
|
296
|
+
|
|
297
|
+
@property
|
|
298
|
+
def data_type(
|
|
299
|
+
self,
|
|
300
|
+
) -> Literal[
|
|
301
|
+
"FLOAT", "INT", "BOOLEAN", "VECTOR", "RGBA", "ROTATION", "MATRIX", "MENU"
|
|
302
|
+
]:
|
|
303
|
+
return self.node.data_type
|
|
304
|
+
|
|
305
|
+
@data_type.setter
|
|
306
|
+
def data_type(
|
|
307
|
+
self,
|
|
308
|
+
value: Literal[
|
|
309
|
+
"FLOAT", "INT", "BOOLEAN", "VECTOR", "RGBA", "ROTATION", "MATRIX", "MENU"
|
|
310
|
+
],
|
|
311
|
+
):
|
|
312
|
+
self.node.data_type = value
|