nodebpy 520.33.0__tar.gz → 520.34.0__tar.gz
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-520.33.0 → nodebpy-520.34.0}/PKG-INFO +1 -1
- {nodebpy-520.33.0 → nodebpy-520.34.0}/pyproject.toml +2 -1
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/builder/mixins.py +31 -12
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/builder/socket.py +596 -16
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/export/codegen.py +271 -4
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/geometry/manual.py +20 -27
- {nodebpy-520.33.0 → nodebpy-520.34.0}/README.md +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/__init__.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/__main__.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/assets/__init__.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/assets/__main__.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/assets/_codegen.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/assets/_library.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/assets/_pipeline.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/assets/_textconv.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/builder/__init__.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/builder/_registry.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/builder/_socket_order.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/builder/_utils.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/builder/accessor.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/builder/asset.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/builder/items.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/builder/node.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/builder/tree.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/export/__init__.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/export/_floats.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/export/diagram.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/export/parity.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/export/plot.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/export/web_render.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/layout/DESIGN.md +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/layout/__init__.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/layout/api.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/layout/apply.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/layout/balancing.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/layout/build.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/layout/common.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/layout/config.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/layout/digraph.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/layout/dna.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/layout/edits.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/layout/extract.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/layout/long_links.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/layout/model.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/layout/node_size.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/layout/ordering.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/layout/packing.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/layout/pipeline.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/layout/placement.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/layout/priority.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/layout/ranking.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/layout/realize.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/layout/reroutes.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/layout/routing.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/layout/snapping.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/layout/spacing.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/layout/stacking.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/layout/sugiyama.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/layout/zones.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/live.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/__init__.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/_mixins.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/compositor/__init__.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/compositor/assets.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/compositor/color.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/compositor/converter.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/compositor/distort.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/compositor/filter.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/compositor/group.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/compositor/input.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/compositor/interface.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/compositor/manual.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/compositor/matte.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/compositor/output.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/compositor/vector.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/geometry/__init__.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/geometry/assets.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/geometry/attribute.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/geometry/color.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/geometry/converter.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/geometry/geometry.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/geometry/grid.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/geometry/group.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/geometry/groups.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/geometry/input.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/geometry/interface.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/geometry/output.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/geometry/texture.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/geometry/utilities.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/geometry/vector.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/geometry/zone.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/shader/__init__.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/shader/assets.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/shader/color.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/shader/converter.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/shader/grid.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/shader/group.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/shader/input.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/shader/manual.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/shader/output.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/shader/script.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/shader/shader.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/shader/texture.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/nodes/shader/vector.py +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/py.typed +0 -0
- {nodebpy-520.33.0 → nodebpy-520.34.0}/src/nodebpy/types.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "nodebpy"
|
|
3
|
-
version = "520.
|
|
3
|
+
version = "520.34.0"
|
|
4
4
|
description = "Build nodes trees in Blender more elegantly with code"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [
|
|
@@ -48,6 +48,7 @@ dev = [
|
|
|
48
48
|
"griffe<2.0.0",
|
|
49
49
|
"ty==0.0.74",
|
|
50
50
|
"matplotlib>=3.11.2",
|
|
51
|
+
"databpy>=0.9.0",
|
|
51
52
|
]
|
|
52
53
|
|
|
53
54
|
# The bpy stubs mark most collections/pointers as `| None` and cannot type
|
|
@@ -12,6 +12,14 @@ from ._utils import SocketError, _resolve_promotion, _SocketLike
|
|
|
12
12
|
_RShiftT = TypeVar("_RShiftT")
|
|
13
13
|
_OutT = TypeVar("_OutT", bound="BaseSocket")
|
|
14
14
|
|
|
15
|
+
_MIRRORED_COMPARISONS = {
|
|
16
|
+
"less_than": "greater_than",
|
|
17
|
+
"greater_than": "less_than",
|
|
18
|
+
"less_equal": "greater_equal",
|
|
19
|
+
"greater_equal": "less_equal",
|
|
20
|
+
}
|
|
21
|
+
_BIT_MATH_OPERATIONS = {"l_and": "l_and", "l_or": "l_or", "not_equal": "exclusive_or"}
|
|
22
|
+
|
|
15
23
|
if TYPE_CHECKING:
|
|
16
24
|
from ..nodes.geometry import CombineTransform
|
|
17
25
|
from ..nodes.geometry.converter import BooleanMath
|
|
@@ -147,11 +155,14 @@ class OperatorMixin:
|
|
|
147
155
|
def _apply_compare_operation(
|
|
148
156
|
self, other: Any, operation: str
|
|
149
157
|
) -> FloatSocket | BooleanSocket:
|
|
150
|
-
socket, other,
|
|
158
|
+
socket, other, reverse = _resolve_promotion(
|
|
151
159
|
self._default_output_socket,
|
|
152
160
|
other,
|
|
153
161
|
False,
|
|
154
162
|
)
|
|
163
|
+
# promotion swapped the operands, so mirror the comparison
|
|
164
|
+
if reverse:
|
|
165
|
+
operation = _MIRRORED_COMPARISONS.get(operation, operation)
|
|
155
166
|
return _wrap_socket(socket)._dispatch_compare(other, operation)
|
|
156
167
|
|
|
157
168
|
def __lt__(self, other: Any) -> FloatSocket | BooleanSocket:
|
|
@@ -172,36 +183,44 @@ class OperatorMixin:
|
|
|
172
183
|
def __ne__(self, other: object) -> FloatSocket | BooleanSocket: # type: ignore
|
|
173
184
|
return self._apply_compare_operation(other, "not_equal")
|
|
174
185
|
|
|
175
|
-
def _apply_boolean_operation(
|
|
186
|
+
def _apply_boolean_operation(
|
|
187
|
+
self, other: Any, operation: str, reverse: bool = False
|
|
188
|
+
) -> BooleanMath | Socket:
|
|
189
|
+
# Integers take the bitwise path, as Python's ``&``/``|``/``^`` do;
|
|
190
|
+
# Boolean Math would cast them to booleans.
|
|
191
|
+
if self._default_output_socket.type == "INT":
|
|
192
|
+
from ..nodes.geometry.converter import BitMath
|
|
193
|
+
|
|
194
|
+
values = (other, self) if reverse else (self, other)
|
|
195
|
+
return getattr(BitMath, _BIT_MATH_OPERATIONS[operation])(*values).o.value
|
|
176
196
|
from ..nodes.geometry.converter import BooleanMath
|
|
177
197
|
|
|
178
|
-
|
|
198
|
+
values = (other, self) if reverse else (self, other)
|
|
199
|
+
return getattr(BooleanMath, operation)(*values)
|
|
179
200
|
|
|
180
201
|
def __and__(self, other: Any) -> BooleanMath | Socket:
|
|
181
202
|
return self._apply_boolean_operation(other, "l_and")
|
|
182
203
|
|
|
183
204
|
def __rand__(self, other: Any) -> BooleanMath | Socket:
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
return BooleanMath.l_and(other, cast(Any, self))
|
|
205
|
+
return self._apply_boolean_operation(other, "l_and", reverse=True)
|
|
187
206
|
|
|
188
207
|
def __or__(self, other: Any) -> BooleanMath | Socket:
|
|
189
208
|
return self._apply_boolean_operation(other, "l_or")
|
|
190
209
|
|
|
191
210
|
def __ror__(self, other: Any) -> BooleanMath | Socket:
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
return BooleanMath.l_or(other, cast(Any, self))
|
|
211
|
+
return self._apply_boolean_operation(other, "l_or", reverse=True)
|
|
195
212
|
|
|
196
213
|
def __xor__(self, other: Any) -> BooleanMath | Socket:
|
|
197
214
|
return self._apply_boolean_operation(other, "not_equal")
|
|
198
215
|
|
|
199
216
|
def __rxor__(self, other: Any) -> BooleanMath | Socket:
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
return BooleanMath.not_equal(other, cast(Any, self))
|
|
217
|
+
return self._apply_boolean_operation(other, "not_equal", reverse=True)
|
|
203
218
|
|
|
204
219
|
def __invert__(self) -> BooleanMath | Socket:
|
|
220
|
+
if self._default_output_socket.type == "INT":
|
|
221
|
+
from ..nodes.geometry.converter import BitMath
|
|
222
|
+
|
|
223
|
+
return BitMath.l_not(cast(Any, self)).o.value
|
|
205
224
|
from ..nodes.geometry.converter import BooleanMath
|
|
206
225
|
|
|
207
226
|
return BooleanMath.l_not(cast(Any, self))
|