nodebpy 520.23.0__tar.gz → 520.25.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.23.0 → nodebpy-520.25.0}/PKG-INFO +1 -1
- {nodebpy-520.23.0 → nodebpy-520.25.0}/pyproject.toml +1 -1
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/assets/_library.py +65 -22
- nodebpy-520.25.0/src/nodebpy/builder/_socket_order.py +1626 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/builder/layout.py +462 -56
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/builder/tree.py +32 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/export/codegen.py +13 -2
- nodebpy-520.25.0/src/nodebpy/export/plot.py +1351 -0
- nodebpy-520.23.0/src/nodebpy/export/plot.py +0 -225
- {nodebpy-520.23.0 → nodebpy-520.25.0}/README.md +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/__init__.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/assets/__init__.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/assets/__main__.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/assets/_codegen.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/assets/_pipeline.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/builder/__init__.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/builder/_registry.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/builder/_utils.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/builder/accessor.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/builder/asset.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/builder/items.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/builder/mixins.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/builder/node.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/builder/socket.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/export/__init__.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/export/diagram.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/export/parity.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/export/web_render.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/lib/nodearrange/VENDORED.md +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/lib/nodearrange/__init__.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/lib/nodearrange/arrange/__init__.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/lib/nodearrange/arrange/graph.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/lib/nodearrange/arrange/ordering.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/lib/nodearrange/arrange/ranking.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/lib/nodearrange/arrange/realize.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/lib/nodearrange/arrange/stacking.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/lib/nodearrange/arrange/structs.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/lib/nodearrange/arrange/sugiyama.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/lib/nodearrange/arrange/x_coords.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/lib/nodearrange/arrange/y_coords.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/lib/nodearrange/config.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/lib/nodearrange/utils.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/__init__.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/_mixins.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/compositor/__init__.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/compositor/assets.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/compositor/color.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/compositor/converter.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/compositor/distort.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/compositor/filter.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/compositor/group.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/compositor/input.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/compositor/interface.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/compositor/manual.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/compositor/matte.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/compositor/output.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/compositor/vector.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/__init__.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/assets.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/attribute.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/color.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/converter.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/geometry.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/grid.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/group.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/groups.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/input.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/interface.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/manual.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/output.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/texture.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/utilities.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/vector.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/zone.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/shader/__init__.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/shader/assets.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/shader/color.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/shader/converter.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/shader/grid.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/shader/group.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/shader/input.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/shader/manual.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/shader/output.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/shader/script.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/shader/shader.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/shader/texture.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/shader/vector.py +0 -0
- {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/types.py +0 -0
|
@@ -1275,24 +1275,33 @@ def plot_library(
|
|
|
1275
1275
|
*,
|
|
1276
1276
|
dpi: int = 150,
|
|
1277
1277
|
arrange: SugiyamaOptions | None = None,
|
|
1278
|
+
tree: bool = True,
|
|
1279
|
+
node: bool = True,
|
|
1280
|
+
open_panels: bool = False,
|
|
1278
1281
|
) -> dict[str, Path]:
|
|
1279
1282
|
"""Render node groups from ``blend_path`` to PNG images under
|
|
1280
|
-
``output_dir`` — a headless look at node graphs, e.g.
|
|
1281
|
-
pull requests (``python -m nodebpy.assets
|
|
1283
|
+
``output_dir`` — a headless, Blender-styled look at node graphs, e.g.
|
|
1284
|
+
for reviewing new nodes in pull requests (``python -m nodebpy.assets
|
|
1285
|
+
plot``).
|
|
1282
1286
|
|
|
1283
1287
|
``names`` selects the groups to plot: exact names or :mod:`fnmatch`
|
|
1284
1288
|
wildcard patterns (``"Style *"``), matched against *every* node group in
|
|
1285
1289
|
the ``.blend`` (not just assets); ``None`` plots them all. A pattern
|
|
1286
|
-
matching nothing raises. Each
|
|
1287
|
-
:func:`nodebpy.export.to_plot
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1290
|
+
matching nothing raises. Each group is rendered twice: its internals
|
|
1291
|
+
(``<name>.png``, :func:`nodebpy.export.to_plot`, drawn at the stored
|
|
1292
|
+
layout or re-arranged first when ``arrange`` options are given) and the
|
|
1293
|
+
single group node a user sees when adding it (``<name>_node.png``,
|
|
1294
|
+
``to_plot(node=True)``, with every interface panel expanded when
|
|
1295
|
+
``open_panels`` is set); ``tree=False`` / ``node=False`` skip either.
|
|
1296
|
+
Both need the optional ``matplotlib`` dependency.
|
|
1297
|
+
Everything appended for plotting is removed from the session again
|
|
1298
|
+
afterwards.
|
|
1291
1299
|
|
|
1292
1300
|
Returns
|
|
1293
1301
|
-------
|
|
1294
1302
|
dict[str, Path]
|
|
1295
|
-
Mapping of group name
|
|
1303
|
+
Mapping of group name (suffixed with ``" (node)"`` for the group-node
|
|
1304
|
+
render) to the image it was written to.
|
|
1296
1305
|
"""
|
|
1297
1306
|
blend_path = Path(blend_path)
|
|
1298
1307
|
output_dir = Path(output_dir)
|
|
@@ -1339,12 +1348,23 @@ def plot_library(
|
|
|
1339
1348
|
try:
|
|
1340
1349
|
output_dir.mkdir(parents=True, exist_ok=True)
|
|
1341
1350
|
written: dict[str, Path] = {}
|
|
1342
|
-
for
|
|
1343
|
-
assert
|
|
1344
|
-
if arrange is not None:
|
|
1345
|
-
arrange_tree_nodes(
|
|
1346
|
-
slug = re.sub(r"[^A-Za-z0-9._-]+", "_",
|
|
1347
|
-
|
|
1351
|
+
for group in dst.node_groups:
|
|
1352
|
+
assert group is not None
|
|
1353
|
+
if arrange is not None and tree:
|
|
1354
|
+
arrange_tree_nodes(group, arrange)
|
|
1355
|
+
slug = re.sub(r"[^A-Za-z0-9._-]+", "_", group.name).lstrip(".") or "tree"
|
|
1356
|
+
if tree:
|
|
1357
|
+
written[group.name] = to_plot(
|
|
1358
|
+
group, output_dir / f"{slug}.png", title=group.name, dpi=dpi
|
|
1359
|
+
)
|
|
1360
|
+
if node:
|
|
1361
|
+
written[f"{group.name} (node)"] = to_plot(
|
|
1362
|
+
group,
|
|
1363
|
+
output_dir / f"{slug}_node.png",
|
|
1364
|
+
dpi=dpi,
|
|
1365
|
+
node=True,
|
|
1366
|
+
open_panels=open_panels,
|
|
1367
|
+
)
|
|
1348
1368
|
finally:
|
|
1349
1369
|
for coll in _CLEANUP_COLLECTIONS:
|
|
1350
1370
|
data = getattr(bpy.data, coll)
|
|
@@ -1726,13 +1746,15 @@ def _parse_args(argv: list[str] | None = None):
|
|
|
1726
1746
|
"plot",
|
|
1727
1747
|
help="Render node groups from a .blend to PNG images.",
|
|
1728
1748
|
description=(
|
|
1729
|
-
"Render node groups from a .blend to PNG images — a headless "
|
|
1730
|
-
"look at node graphs, e.g. for
|
|
1731
|
-
"groups by exact name or fnmatch
|
|
1732
|
-
"against every node group in the
|
|
1733
|
-
"names, every group is plotted.
|
|
1734
|
-
"
|
|
1735
|
-
"
|
|
1749
|
+
"Render node groups from a .blend to PNG images — a headless, "
|
|
1750
|
+
"Blender-styled look at node graphs, e.g. for reviewing new nodes "
|
|
1751
|
+
"in pull requests. Selects groups by exact name or fnmatch "
|
|
1752
|
+
"wildcard ('Style *'), matched against every node group in the "
|
|
1753
|
+
"file (not just assets); with no names, every group is plotted. "
|
|
1754
|
+
"Each group gets two images: its internals (<name>.png, drawn at "
|
|
1755
|
+
"the stored layout unless --arrange or any arrangement flag is "
|
|
1756
|
+
"given) and the group node as seen from another tree "
|
|
1757
|
+
"(<name>_node.png). Requires matplotlib (pip install nodebpy[plot])."
|
|
1736
1758
|
),
|
|
1737
1759
|
)
|
|
1738
1760
|
plot.add_argument("blend", type=Path, help="The .blend holding the node groups.")
|
|
@@ -1746,6 +1768,24 @@ def _parse_args(argv: list[str] | None = None):
|
|
|
1746
1768
|
),
|
|
1747
1769
|
)
|
|
1748
1770
|
plot.add_argument("--dpi", type=int, default=150, help="Image DPI (default: 150).")
|
|
1771
|
+
plot.add_argument(
|
|
1772
|
+
"--tree-only",
|
|
1773
|
+
action="store_true",
|
|
1774
|
+
help="Only render the internals of each group (skip <name>_node.png).",
|
|
1775
|
+
)
|
|
1776
|
+
plot.add_argument(
|
|
1777
|
+
"--node-only",
|
|
1778
|
+
action="store_true",
|
|
1779
|
+
help="Only render each group as a group node (skip <name>.png).",
|
|
1780
|
+
)
|
|
1781
|
+
plot.add_argument(
|
|
1782
|
+
"--open-panels",
|
|
1783
|
+
action="store_true",
|
|
1784
|
+
help=(
|
|
1785
|
+
"Expand every interface panel in the group-node render instead "
|
|
1786
|
+
"of drawing panels in their default closed state."
|
|
1787
|
+
),
|
|
1788
|
+
)
|
|
1749
1789
|
plot.add_argument(
|
|
1750
1790
|
"--arrange",
|
|
1751
1791
|
action="store_true",
|
|
@@ -1835,10 +1875,13 @@ def main(argv: list[str] | None = None) -> None: # pragma: no cover - CLI wrapp
|
|
|
1835
1875
|
args.names or None,
|
|
1836
1876
|
dpi=args.dpi,
|
|
1837
1877
|
arrange=method,
|
|
1878
|
+
tree=not args.node_only,
|
|
1879
|
+
node=not args.tree_only,
|
|
1880
|
+
open_panels=args.open_panels,
|
|
1838
1881
|
)
|
|
1839
1882
|
for name, path in written.items():
|
|
1840
1883
|
print(f" {name}: {path}")
|
|
1841
|
-
print(f"
|
|
1884
|
+
print(f"Wrote {len(written)} images to {args.output}")
|
|
1842
1885
|
else:
|
|
1843
1886
|
_build_command(args)
|
|
1844
1887
|
|