nodebpy 520.5.1__tar.gz → 520.6.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.6.0/PKG-INFO +79 -0
- nodebpy-520.6.0/README.md +63 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/pyproject.toml +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/builder/tree.py +2 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/export/__init__.py +2 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/export/codegen.py +17 -1
- {nodebpy-520.5.1/src/nodebpy → nodebpy-520.6.0/src/nodebpy/export}/web_render.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/_mixins.py +2 -2
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/compositor/__init__.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/compositor/color.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/compositor/converter.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/compositor/distort.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/compositor/filter.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/compositor/group.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/compositor/input.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/compositor/interface.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/compositor/matte.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/compositor/output.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/compositor/vector.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/geometry/__init__.py +208 -210
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/geometry/assets.py +0 -46
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/geometry/attribute.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/geometry/color.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/geometry/converter.py +3 -3
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/geometry/geometry.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/geometry/grid.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/geometry/group.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/geometry/input.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/geometry/interface.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/geometry/output.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/geometry/texture.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/geometry/utilities.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/geometry/vector.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/shader/__init__.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/shader/color.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/shader/converter.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/shader/grid.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/shader/group.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/shader/input.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/shader/output.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/shader/script.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/shader/shader.py +3 -3
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/shader/texture.py +1 -1
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/shader/vector.py +1 -1
- nodebpy-520.5.1/PKG-INFO +0 -159
- nodebpy-520.5.1/README.md +0 -143
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/__init__.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/assets/__init__.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/assets/__main__.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/assets/_codegen.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/builder/__init__.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/builder/_registry.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/builder/_utils.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/builder/accessor.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/builder/arrange.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/builder/asset.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/builder/items.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/builder/mixins.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/builder/node.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/builder/socket.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/export/diagram.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/lib/nodearrange/__init__.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/lib/nodearrange/arrange/__init__.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/lib/nodearrange/arrange/graph.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/lib/nodearrange/arrange/ordering.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/lib/nodearrange/arrange/ranking.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/lib/nodearrange/arrange/realize.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/lib/nodearrange/arrange/stacking.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/lib/nodearrange/arrange/structs.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/lib/nodearrange/arrange/sugiyama.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/lib/nodearrange/arrange/x_coords.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/lib/nodearrange/arrange/y_coords.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/lib/nodearrange/config.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/lib/nodearrange/utils.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/__init__.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/compositor/assets.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/compositor/manual.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/geometry/groups.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/geometry/manual.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/geometry/zone.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/shader/assets.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/nodes/shader/manual.py +0 -0
- {nodebpy-520.5.1 → nodebpy-520.6.0}/src/nodebpy/types.py +0 -0
nodebpy-520.6.0/PKG-INFO
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: nodebpy
|
|
3
|
+
Version: 520.6.0
|
|
4
|
+
Summary: Build nodes trees in Blender more elegantly with code
|
|
5
|
+
Author: Brady Johnston
|
|
6
|
+
Author-email: Brady Johnston <brady.johnston@me.com>
|
|
7
|
+
License: GPL-3.0-or-later
|
|
8
|
+
Requires-Dist: bpy==5.2.* ; extra == 'bpy'
|
|
9
|
+
Requires-Dist: ruff>=0.14.11 ; extra == 'format'
|
|
10
|
+
Requires-Dist: networkx>=3.6.1 ; extra == 'networkx'
|
|
11
|
+
Requires-Python: >=3.13
|
|
12
|
+
Provides-Extra: bpy
|
|
13
|
+
Provides-Extra: format
|
|
14
|
+
Provides-Extra: networkx
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
# nodebpy
|
|
18
|
+
|
|
19
|
+
[](https://github.com/BradyAJohnston/nodebpy/actions/workflows/tests.yml)
|
|
21
|
+
[](https://codecov.io/gh/BradyAJohnston/nodebpy)
|
|
22
|
+
|
|
23
|
+
Build node trees in Blender more elegantly with Python code. Geometry Nodes, Shader Nodes and Compositor nodes are all fully supported, with type hints and IDE auto-completion throughout.
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pip install nodebpy
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
> A text-based version of nodes should bring the convenience of writing code with IDE auto-completion, type hinting, with overall compactness and readability, while staying as close as possible to what building a node tree via the GUI feels like.
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
from nodebpy import geometry as g
|
|
33
|
+
|
|
34
|
+
with g.tree("AnotherTree", collapse=True) as tree:
|
|
35
|
+
rotation = (
|
|
36
|
+
g.RandomValue.vector(min=-1, seed=2)
|
|
37
|
+
>> g.AlignRotationToVector()
|
|
38
|
+
>> g.RotateRotation(rotate_by=g.AxisAngleToRotation(angle=0.3))
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
_ = (
|
|
42
|
+
tree.inputs.integer("Count", 10)
|
|
43
|
+
>> g.Points(position=g.RandomValue.vector(min=-1))
|
|
44
|
+
>> g.InstanceOnPoints(instance=g.Cube(), rotation=rotation)
|
|
45
|
+
>> g.SetPosition(
|
|
46
|
+
position=g.Position() * 2.0 + (0, 0.2, 0.3),
|
|
47
|
+
offset=(0, 0, 0.1),
|
|
48
|
+
)
|
|
49
|
+
>> g.RealizeInstances()
|
|
50
|
+
>> g.InstanceOnPoints(g.Cube(), instance=...)
|
|
51
|
+
>> tree.outputs.geometry("Instances")
|
|
52
|
+
)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+

|
|
56
|
+
|
|
57
|
+
- Every node is a typed class named after the node it creates — 'Random Value' becomes `g.RandomValue()` — and node subtypes are class methods: `g.RandomValue.vector()`.
|
|
58
|
+
- Trees are built inside a `with g.tree(...):` context; instantiating a node class adds it to the current tree, and the tree's interface is declared with `tree.inputs.*` / `tree.outputs.*`.
|
|
59
|
+
- Nodes are linked with the `>>` operator, which picks the most compatible socket pair automatically (much like Node Wrangler's <kbd>Alt</kbd> + <kbd>Right Click</kbd> drag) — or address sockets explicitly through the `.i.*` / `.o.*` accessors.
|
|
60
|
+
- Python's arithmetic, comparison and boolean operators create the matching `Math` / `VectorMath` / `Compare` / `BooleanMath` nodes: `g.Value(1.0) * 2 + (0, 0, 1)`.
|
|
61
|
+
- Existing node trees — including ones wired up by hand in the GUI — can be exported back to `nodebpy` source with `to_python()`.
|
|
62
|
+
|
|
63
|
+
## Documentation
|
|
64
|
+
|
|
65
|
+
Guides and the full node reference live at [bradyajohnston.github.io/nodebpy](https://bradyajohnston.github.io/nodebpy):
|
|
66
|
+
|
|
67
|
+
- [Writing node trees](https://bradyajohnston.github.io/nodebpy/introduction.html) — adding, linking and organising nodes
|
|
68
|
+
- [Math operators](https://bradyajohnston.github.io/nodebpy/operators.html) — arithmetic, comparison and boolean expressions as nodes
|
|
69
|
+
- [Node API design](https://bradyajohnston.github.io/nodebpy/node-api.html) — sockets, accessors, enum options and class methods
|
|
70
|
+
- [Custom node groups](https://bradyajohnston.github.io/nodebpy/custom-node-groups.html) and [asset node groups](https://bradyajohnston.github.io/nodebpy/assets.html) — reusable groups as Python classes
|
|
71
|
+
- [Nodes to code](https://bradyajohnston.github.io/nodebpy/nodes-to-code.html) — turn existing trees back into `nodebpy` code
|
|
72
|
+
- [Using `nodebpy` in your add-on](https://bradyajohnston.github.io/nodebpy/using.html) — installation, bundling and the Blender-tracking versioning scheme
|
|
73
|
+
- [Comparisons](https://bradyajohnston.github.io/nodebpy/comparisons.html) — how the API relates to [`geometry-script`](https://github.com/carson-katri/geometry-script), [`geonodes`](https://github.com/al1brn/geonodes), [NodeToPython](https://github.com/BrendanParmer/NodeToPython) and [TreeClipper](https://github.com/Algebraic-UG/tree_clipper)
|
|
74
|
+
|
|
75
|
+
Like [`databpy`](https://github.com/BradyAJohnston/databpy), this project started as an internal tool inside [`molecularnodes`](https://github.com/BradyAJohnston/MolecularNodes) before being broken out into its own robustly typed and tested package.
|
|
76
|
+
|
|
77
|
+
## Contributing
|
|
78
|
+
|
|
79
|
+
Development setup, running the tests and regenerating the node classes (most of `src/nodebpy/nodes/` is auto-generated by the `gen/` package) are covered in [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# nodebpy
|
|
2
|
+
|
|
3
|
+
[](https://github.com/BradyAJohnston/nodebpy/actions/workflows/tests.yml)
|
|
5
|
+
[](https://codecov.io/gh/BradyAJohnston/nodebpy)
|
|
6
|
+
|
|
7
|
+
Build node trees in Blender more elegantly with Python code. Geometry Nodes, Shader Nodes and Compositor nodes are all fully supported, with type hints and IDE auto-completion throughout.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install nodebpy
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
> A text-based version of nodes should bring the convenience of writing code with IDE auto-completion, type hinting, with overall compactness and readability, while staying as close as possible to what building a node tree via the GUI feels like.
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
from nodebpy import geometry as g
|
|
17
|
+
|
|
18
|
+
with g.tree("AnotherTree", collapse=True) as tree:
|
|
19
|
+
rotation = (
|
|
20
|
+
g.RandomValue.vector(min=-1, seed=2)
|
|
21
|
+
>> g.AlignRotationToVector()
|
|
22
|
+
>> g.RotateRotation(rotate_by=g.AxisAngleToRotation(angle=0.3))
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
_ = (
|
|
26
|
+
tree.inputs.integer("Count", 10)
|
|
27
|
+
>> g.Points(position=g.RandomValue.vector(min=-1))
|
|
28
|
+
>> g.InstanceOnPoints(instance=g.Cube(), rotation=rotation)
|
|
29
|
+
>> g.SetPosition(
|
|
30
|
+
position=g.Position() * 2.0 + (0, 0.2, 0.3),
|
|
31
|
+
offset=(0, 0, 0.1),
|
|
32
|
+
)
|
|
33
|
+
>> g.RealizeInstances()
|
|
34
|
+
>> g.InstanceOnPoints(g.Cube(), instance=...)
|
|
35
|
+
>> tree.outputs.geometry("Instances")
|
|
36
|
+
)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+

|
|
40
|
+
|
|
41
|
+
- Every node is a typed class named after the node it creates — 'Random Value' becomes `g.RandomValue()` — and node subtypes are class methods: `g.RandomValue.vector()`.
|
|
42
|
+
- Trees are built inside a `with g.tree(...):` context; instantiating a node class adds it to the current tree, and the tree's interface is declared with `tree.inputs.*` / `tree.outputs.*`.
|
|
43
|
+
- Nodes are linked with the `>>` operator, which picks the most compatible socket pair automatically (much like Node Wrangler's <kbd>Alt</kbd> + <kbd>Right Click</kbd> drag) — or address sockets explicitly through the `.i.*` / `.o.*` accessors.
|
|
44
|
+
- Python's arithmetic, comparison and boolean operators create the matching `Math` / `VectorMath` / `Compare` / `BooleanMath` nodes: `g.Value(1.0) * 2 + (0, 0, 1)`.
|
|
45
|
+
- Existing node trees — including ones wired up by hand in the GUI — can be exported back to `nodebpy` source with `to_python()`.
|
|
46
|
+
|
|
47
|
+
## Documentation
|
|
48
|
+
|
|
49
|
+
Guides and the full node reference live at [bradyajohnston.github.io/nodebpy](https://bradyajohnston.github.io/nodebpy):
|
|
50
|
+
|
|
51
|
+
- [Writing node trees](https://bradyajohnston.github.io/nodebpy/introduction.html) — adding, linking and organising nodes
|
|
52
|
+
- [Math operators](https://bradyajohnston.github.io/nodebpy/operators.html) — arithmetic, comparison and boolean expressions as nodes
|
|
53
|
+
- [Node API design](https://bradyajohnston.github.io/nodebpy/node-api.html) — sockets, accessors, enum options and class methods
|
|
54
|
+
- [Custom node groups](https://bradyajohnston.github.io/nodebpy/custom-node-groups.html) and [asset node groups](https://bradyajohnston.github.io/nodebpy/assets.html) — reusable groups as Python classes
|
|
55
|
+
- [Nodes to code](https://bradyajohnston.github.io/nodebpy/nodes-to-code.html) — turn existing trees back into `nodebpy` code
|
|
56
|
+
- [Using `nodebpy` in your add-on](https://bradyajohnston.github.io/nodebpy/using.html) — installation, bundling and the Blender-tracking versioning scheme
|
|
57
|
+
- [Comparisons](https://bradyajohnston.github.io/nodebpy/comparisons.html) — how the API relates to [`geometry-script`](https://github.com/carson-katri/geometry-script), [`geonodes`](https://github.com/al1brn/geonodes), [NodeToPython](https://github.com/BrendanParmer/NodeToPython) and [TreeClipper](https://github.com/Algebraic-UG/tree_clipper)
|
|
58
|
+
|
|
59
|
+
Like [`databpy`](https://github.com/BradyAJohnston/databpy), this project started as an internal tool inside [`molecularnodes`](https://github.com/BradyAJohnston/MolecularNodes) before being broken out into its own robustly typed and tested package.
|
|
60
|
+
|
|
61
|
+
## Contributing
|
|
62
|
+
|
|
63
|
+
Development setup, running the tests and regenerating the node classes (most of `src/nodebpy/nodes/` is auto-generated by the `gen/` package) are covered in [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
@@ -15,6 +15,7 @@ from bpy.types import (
|
|
|
15
15
|
ShaderNodeTree,
|
|
16
16
|
)
|
|
17
17
|
|
|
18
|
+
|
|
18
19
|
from ..types import (
|
|
19
20
|
SOCKET_COMPATIBILITY,
|
|
20
21
|
FloatInterfaceSubtypes,
|
|
@@ -856,7 +857,7 @@ class TreeBuilder(Generic[_TreeT]):
|
|
|
856
857
|
Mermaid ``_repr_markdown_`` fallback take over.
|
|
857
858
|
"""
|
|
858
859
|
try:
|
|
859
|
-
from ..
|
|
860
|
+
from ..export import to_web_render_html
|
|
860
861
|
|
|
861
862
|
return to_web_render_html(self)
|
|
862
863
|
except Exception as e:
|
|
@@ -1389,7 +1389,7 @@ def _non_default_props(node, cls: type) -> dict[str, Any]:
|
|
|
1389
1389
|
# (``Compare.float.less_than``). Parsing those bodies at runtime yields a
|
|
1390
1390
|
# reverse table from node state to factory path, so generated code uses the
|
|
1391
1391
|
# same idiomatic spellings users write — with no separate table to keep in
|
|
1392
|
-
# sync with
|
|
1392
|
+
# sync with the generator. Factories whose bodies are not statically analysable
|
|
1393
1393
|
# (positional args, helper indirection, **kwargs) are simply skipped and the
|
|
1394
1394
|
# node falls back to the plain constructor.
|
|
1395
1395
|
# ---------------------------------------------------------------------------
|
|
@@ -3665,6 +3665,22 @@ def _emit_tree(node_tree, collector: "_GroupCollector") -> "_TreeEmission":
|
|
|
3665
3665
|
# ---------------------------------------------------------------------------
|
|
3666
3666
|
|
|
3667
3667
|
|
|
3668
|
+
@register_emitter("ShaderNodeValue")
|
|
3669
|
+
def _emit_value(node, ctx: EmitContext) -> Call:
|
|
3670
|
+
"""Preserve the Value node's output-backed constructor argument.
|
|
3671
|
+
|
|
3672
|
+
Unlike ordinary node inputs, ``ShaderNodeValue`` stores its editable value
|
|
3673
|
+
directly on its output socket. The generic constructor path only examines
|
|
3674
|
+
input sockets, so a non-zero value needs to be supplied explicitly.
|
|
3675
|
+
"""
|
|
3676
|
+
call = ctx.constructor(node)
|
|
3677
|
+
if node.outputs:
|
|
3678
|
+
value = node.outputs[0].default_value
|
|
3679
|
+
if not _eq(value, 0.0):
|
|
3680
|
+
call.args.append(Lit(value))
|
|
3681
|
+
return call
|
|
3682
|
+
|
|
3683
|
+
|
|
3668
3684
|
_COMPARE_LIFT = {
|
|
3669
3685
|
"LESS_THAN": "<",
|
|
3670
3686
|
"GREATER_THAN": ">",
|
|
@@ -19,7 +19,7 @@ import uuid
|
|
|
19
19
|
from typing import TYPE_CHECKING
|
|
20
20
|
|
|
21
21
|
if TYPE_CHECKING:
|
|
22
|
-
from
|
|
22
|
+
from ..builder.tree import TreeBuilder
|
|
23
23
|
|
|
24
24
|
#: geonodes-web-render version served from the CDN. A semver range (`"0.3"`)
|
|
25
25
|
#: lets esm.sh serve the latest matching patch, so web-render bug fixes ship to
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"""Hand-written mixins attached to auto-generated node classes.
|
|
2
2
|
|
|
3
3
|
These hold reusable behaviour that the code generator cannot derive on its own
|
|
4
|
-
(ergonomic flag accessors, items helpers, …). ``
|
|
5
|
-
the generated classes via :class:`~
|
|
4
|
+
(ergonomic flag accessors, items helpers, …). The ``gen`` package wires them
|
|
5
|
+
onto the generated classes via :class:`~gen.NodeCustomization`, so the bulky
|
|
6
6
|
boilerplate (sockets, docstrings, property accessors) stays generated while the
|
|
7
7
|
bespoke behaviour lives here.
|
|
8
8
|
"""
|