nodebpy 520.32.0__tar.gz → 520.32.1__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.32.0 → nodebpy-520.32.1}/PKG-INFO +1 -1
- {nodebpy-520.32.0 → nodebpy-520.32.1}/pyproject.toml +1 -1
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/builder/items.py +23 -2
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/builder/mixins.py +9 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/builder/node.py +4 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/geometry/zone.py +19 -1
- {nodebpy-520.32.0 → nodebpy-520.32.1}/README.md +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/__init__.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/__main__.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/assets/__init__.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/assets/__main__.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/assets/_codegen.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/assets/_library.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/assets/_pipeline.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/assets/_textconv.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/builder/__init__.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/builder/_registry.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/builder/_socket_order.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/builder/_utils.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/builder/accessor.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/builder/asset.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/builder/socket.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/builder/tree.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/export/__init__.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/export/_floats.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/export/codegen.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/export/diagram.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/export/parity.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/export/plot.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/export/web_render.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/layout/DESIGN.md +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/layout/__init__.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/layout/api.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/layout/apply.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/layout/balancing.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/layout/build.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/layout/common.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/layout/config.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/layout/digraph.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/layout/dna.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/layout/edits.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/layout/extract.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/layout/long_links.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/layout/model.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/layout/node_size.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/layout/ordering.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/layout/packing.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/layout/pipeline.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/layout/placement.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/layout/priority.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/layout/ranking.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/layout/realize.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/layout/reroutes.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/layout/routing.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/layout/snapping.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/layout/spacing.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/layout/stacking.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/layout/sugiyama.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/layout/zones.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/live.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/__init__.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/_mixins.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/compositor/__init__.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/compositor/assets.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/compositor/color.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/compositor/converter.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/compositor/distort.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/compositor/filter.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/compositor/group.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/compositor/input.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/compositor/interface.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/compositor/manual.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/compositor/matte.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/compositor/output.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/compositor/vector.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/geometry/__init__.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/geometry/assets.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/geometry/attribute.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/geometry/color.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/geometry/converter.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/geometry/geometry.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/geometry/grid.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/geometry/group.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/geometry/groups.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/geometry/input.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/geometry/interface.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/geometry/manual.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/geometry/output.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/geometry/texture.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/geometry/utilities.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/geometry/vector.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/shader/__init__.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/shader/assets.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/shader/color.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/shader/converter.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/shader/grid.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/shader/group.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/shader/input.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/shader/manual.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/shader/output.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/shader/script.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/shader/shader.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/shader/texture.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/nodes/shader/vector.py +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/py.typed +0 -0
- {nodebpy-520.32.0 → nodebpy-520.32.1}/src/nodebpy/types.py +0 -0
|
@@ -184,6 +184,8 @@ def _resolve_source(
|
|
|
184
184
|
"""The source socket, its socket type and the item name for a linkable.
|
|
185
185
|
|
|
186
186
|
The name is the source socket's unless one is given."""
|
|
187
|
+
if isinstance(value, Item):
|
|
188
|
+
value = value.output
|
|
187
189
|
accessor = getattr(value, "o", None)
|
|
188
190
|
if accessor is None and not isinstance(value, (NodeSocket, _SocketLike)):
|
|
189
191
|
raise TypeError(f"{value!r} is not a socket, node or default value")
|
|
@@ -199,6 +201,7 @@ def _resolve_source(
|
|
|
199
201
|
|
|
200
202
|
_InT = TypeVar("_InT", bound=BaseSocket, default=Socket)
|
|
201
203
|
_OutT = TypeVar("_OutT", bound=BaseSocket, default=_InT)
|
|
204
|
+
_RShiftT = TypeVar("_RShiftT")
|
|
202
205
|
|
|
203
206
|
|
|
204
207
|
class Item(Generic[_InT, _OutT]):
|
|
@@ -209,9 +212,14 @@ class Item(Generic[_InT, _OutT]):
|
|
|
209
212
|
from. The type parameters are the socket classes of the two roles; one
|
|
210
213
|
parameter means both roles share it, none means plain :class:`Socket`.
|
|
211
214
|
|
|
212
|
-
|
|
215
|
+
The handle stands in for its sockets: as a value or on the left of
|
|
216
|
+
``>>`` it is ``output``, on the right of ``>>`` it is ``input``, and the
|
|
217
|
+
chain then continues from ``output``::
|
|
213
218
|
|
|
214
|
-
g.Position() >> capture.items.vector()
|
|
219
|
+
g.Position() >> capture.items.vector() >> g.SetPosition()
|
|
220
|
+
g.SetPosition(position=capture.items.vector(g.Position()))
|
|
221
|
+
|
|
222
|
+
An item with only one side raises for the side it does not have.
|
|
215
223
|
|
|
216
224
|
Holds the item's collection index rather than the bpy item itself:
|
|
217
225
|
bpy collection item references are invalidated when the collection
|
|
@@ -260,6 +268,19 @@ class Item(Generic[_InT, _OutT]):
|
|
|
260
268
|
"_OutT", _wrap_socket(self._items._item_socket(self._item, output=True))
|
|
261
269
|
)
|
|
262
270
|
|
|
271
|
+
# -- the handle as a link source or target --
|
|
272
|
+
|
|
273
|
+
@property
|
|
274
|
+
def _default_output_socket(self) -> NodeSocket:
|
|
275
|
+
return self.output.socket
|
|
276
|
+
|
|
277
|
+
def _as_rshift_target(self) -> _InT:
|
|
278
|
+
return self.input
|
|
279
|
+
|
|
280
|
+
def __rshift__(self, other: _RShiftT) -> _RShiftT:
|
|
281
|
+
"""``item >> target`` links from the item's output socket."""
|
|
282
|
+
return cast("_RShiftT", self.output >> cast(Any, other))
|
|
283
|
+
|
|
263
284
|
|
|
264
285
|
def _chained(socket: NodeSocket, continues: bool, follow) -> Socket:
|
|
265
286
|
"""Wrap a link-target socket so ``>>`` into it carries on from the
|
|
@@ -10,14 +10,17 @@ from ._registry import _wrap_socket
|
|
|
10
10
|
from ._utils import SocketError, _resolve_promotion, _SocketLike
|
|
11
11
|
|
|
12
12
|
_RShiftT = TypeVar("_RShiftT")
|
|
13
|
+
_OutT = TypeVar("_OutT", bound="BaseSocket")
|
|
13
14
|
|
|
14
15
|
if TYPE_CHECKING:
|
|
15
16
|
from ..nodes.geometry import CombineTransform
|
|
16
17
|
from ..nodes.geometry.converter import BooleanMath
|
|
17
18
|
from ..types import InputLinkable
|
|
18
19
|
from .accessor import SocketAccessor
|
|
20
|
+
from .items import Item
|
|
19
21
|
from .node import BaseNode
|
|
20
22
|
from .socket import (
|
|
23
|
+
BaseSocket,
|
|
21
24
|
BooleanSocket,
|
|
22
25
|
FloatSocket,
|
|
23
26
|
MatrixSocket,
|
|
@@ -367,6 +370,8 @@ class LinkingMixin:
|
|
|
367
370
|
@overload
|
|
368
371
|
def __rshift__(self, other: None) -> Self: ...
|
|
369
372
|
@overload
|
|
373
|
+
def __rshift__(self, other: Item[Any, _OutT]) -> _OutT: ...
|
|
374
|
+
@overload
|
|
370
375
|
def __rshift__(self, other: _RShiftT) -> _RShiftT: ...
|
|
371
376
|
def __rshift__(self, other: _RShiftT | None) -> _RShiftT | Self:
|
|
372
377
|
"""Chain nodes using >> operator. Links output to input.
|
|
@@ -387,6 +392,10 @@ class LinkingMixin:
|
|
|
387
392
|
"""
|
|
388
393
|
if other is None:
|
|
389
394
|
return self
|
|
395
|
+
as_target = getattr(other, "_as_rshift_target", None)
|
|
396
|
+
if as_target is not None:
|
|
397
|
+
# an item handle stands for its input socket on the right of >>
|
|
398
|
+
return self >> as_target()
|
|
390
399
|
if isinstance(other, _SocketLike):
|
|
391
400
|
source = self._default_output_socket
|
|
392
401
|
target = other.socket
|
|
@@ -238,6 +238,10 @@ class BaseNode(_NodeLike, OperatorMixin, LinkingMixin):
|
|
|
238
238
|
elif isinstance(value, _NodeLike):
|
|
239
239
|
target_type = target.type if not named else self.i._get(target).type
|
|
240
240
|
self._link_from(value.o._best_match(target_type), target)
|
|
241
|
+
elif getattr(value, "_as_rshift_target", None) is not None:
|
|
242
|
+
# an item handle stands for its output socket (and says so when
|
|
243
|
+
# it has none)
|
|
244
|
+
self._link_from(cast(Any, value)._default_output_socket, target)
|
|
241
245
|
else:
|
|
242
246
|
# TODO: explicitly skipping the sockets for BooleanMath as they are default false,
|
|
243
247
|
# but this needs to be a more generic solution for sockets which aren't available
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from abc import ABC
|
|
2
2
|
from collections.abc import Iterable, Iterator, Mapping
|
|
3
|
-
from typing import TYPE_CHECKING, ClassVar, TypeVar, cast
|
|
3
|
+
from typing import TYPE_CHECKING, ClassVar, NoReturn, TypeVar, cast
|
|
4
4
|
|
|
5
5
|
import bpy
|
|
6
6
|
from bpy.types import (
|
|
@@ -152,6 +152,24 @@ class ZoneItem(Item[_SocketT]):
|
|
|
152
152
|
"""Output-node output socket — read the item after the zone."""
|
|
153
153
|
return self.output
|
|
154
154
|
|
|
155
|
+
# A state item has two inputs and two outputs, so the handle itself
|
|
156
|
+
# cannot stand for a socket: name the role.
|
|
157
|
+
def _no_role(self, side: str) -> NoReturn:
|
|
158
|
+
raise TypeError(
|
|
159
|
+
f"{self!r} has two {side} sockets; link through .initial / .current / "
|
|
160
|
+
".next / .result rather than the handle"
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
@property
|
|
164
|
+
def _default_output_socket(self) -> bpy.types.NodeSocket:
|
|
165
|
+
self._no_role("output")
|
|
166
|
+
|
|
167
|
+
def _as_rshift_target(self) -> _SocketT:
|
|
168
|
+
self._no_role("input")
|
|
169
|
+
|
|
170
|
+
def __rshift__(self, other: object) -> NoReturn:
|
|
171
|
+
self._no_role("output")
|
|
172
|
+
|
|
155
173
|
|
|
156
174
|
class _ZonePair:
|
|
157
175
|
"""Zone wrapper holding the paired input and output builder nodes.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|