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.
Files changed (88) hide show
  1. {nodebpy-520.23.0 → nodebpy-520.25.0}/PKG-INFO +1 -1
  2. {nodebpy-520.23.0 → nodebpy-520.25.0}/pyproject.toml +1 -1
  3. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/assets/_library.py +65 -22
  4. nodebpy-520.25.0/src/nodebpy/builder/_socket_order.py +1626 -0
  5. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/builder/layout.py +462 -56
  6. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/builder/tree.py +32 -0
  7. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/export/codegen.py +13 -2
  8. nodebpy-520.25.0/src/nodebpy/export/plot.py +1351 -0
  9. nodebpy-520.23.0/src/nodebpy/export/plot.py +0 -225
  10. {nodebpy-520.23.0 → nodebpy-520.25.0}/README.md +0 -0
  11. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/__init__.py +0 -0
  12. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/assets/__init__.py +0 -0
  13. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/assets/__main__.py +0 -0
  14. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/assets/_codegen.py +0 -0
  15. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/assets/_pipeline.py +0 -0
  16. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/builder/__init__.py +0 -0
  17. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/builder/_registry.py +0 -0
  18. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/builder/_utils.py +0 -0
  19. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/builder/accessor.py +0 -0
  20. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/builder/asset.py +0 -0
  21. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/builder/items.py +0 -0
  22. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/builder/mixins.py +0 -0
  23. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/builder/node.py +0 -0
  24. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/builder/socket.py +0 -0
  25. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/export/__init__.py +0 -0
  26. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/export/diagram.py +0 -0
  27. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/export/parity.py +0 -0
  28. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/export/web_render.py +0 -0
  29. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/lib/nodearrange/VENDORED.md +0 -0
  30. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/lib/nodearrange/__init__.py +0 -0
  31. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/lib/nodearrange/arrange/__init__.py +0 -0
  32. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/lib/nodearrange/arrange/graph.py +0 -0
  33. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/lib/nodearrange/arrange/ordering.py +0 -0
  34. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/lib/nodearrange/arrange/ranking.py +0 -0
  35. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/lib/nodearrange/arrange/realize.py +0 -0
  36. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/lib/nodearrange/arrange/stacking.py +0 -0
  37. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/lib/nodearrange/arrange/structs.py +0 -0
  38. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/lib/nodearrange/arrange/sugiyama.py +0 -0
  39. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/lib/nodearrange/arrange/x_coords.py +0 -0
  40. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/lib/nodearrange/arrange/y_coords.py +0 -0
  41. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/lib/nodearrange/config.py +0 -0
  42. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/lib/nodearrange/utils.py +0 -0
  43. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/__init__.py +0 -0
  44. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/_mixins.py +0 -0
  45. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/compositor/__init__.py +0 -0
  46. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/compositor/assets.py +0 -0
  47. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/compositor/color.py +0 -0
  48. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/compositor/converter.py +0 -0
  49. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/compositor/distort.py +0 -0
  50. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/compositor/filter.py +0 -0
  51. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/compositor/group.py +0 -0
  52. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/compositor/input.py +0 -0
  53. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/compositor/interface.py +0 -0
  54. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/compositor/manual.py +0 -0
  55. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/compositor/matte.py +0 -0
  56. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/compositor/output.py +0 -0
  57. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/compositor/vector.py +0 -0
  58. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/__init__.py +0 -0
  59. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/assets.py +0 -0
  60. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/attribute.py +0 -0
  61. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/color.py +0 -0
  62. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/converter.py +0 -0
  63. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/geometry.py +0 -0
  64. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/grid.py +0 -0
  65. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/group.py +0 -0
  66. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/groups.py +0 -0
  67. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/input.py +0 -0
  68. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/interface.py +0 -0
  69. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/manual.py +0 -0
  70. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/output.py +0 -0
  71. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/texture.py +0 -0
  72. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/utilities.py +0 -0
  73. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/vector.py +0 -0
  74. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/geometry/zone.py +0 -0
  75. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/shader/__init__.py +0 -0
  76. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/shader/assets.py +0 -0
  77. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/shader/color.py +0 -0
  78. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/shader/converter.py +0 -0
  79. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/shader/grid.py +0 -0
  80. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/shader/group.py +0 -0
  81. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/shader/input.py +0 -0
  82. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/shader/manual.py +0 -0
  83. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/shader/output.py +0 -0
  84. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/shader/script.py +0 -0
  85. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/shader/shader.py +0 -0
  86. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/shader/texture.py +0 -0
  87. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/nodes/shader/vector.py +0 -0
  88. {nodebpy-520.23.0 → nodebpy-520.25.0}/src/nodebpy/types.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: nodebpy
3
- Version: 520.23.0
3
+ Version: 520.25.0
4
4
  Summary: Build nodes trees in Blender more elegantly with code
5
5
  Author: Brady Johnston
6
6
  Author-email: Brady Johnston <brady.johnston@me.com>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "nodebpy"
3
- version = "520.23.0"
3
+ version = "520.25.0"
4
4
  description = "Build nodes trees in Blender more elegantly with code"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -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. for posting in
1281
- pull requests (``python -m nodebpy.assets plot``).
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 tree is drawn with
1287
- :func:`nodebpy.export.to_plot` (which needs the optional ``matplotlib``
1288
- dependency) at its stored layout, or re-arranged first when ``arrange``
1289
- options are given. Everything appended for plotting is removed from the
1290
- session again afterwards.
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 to the image it was written to.
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 tree in dst.node_groups:
1343
- assert tree is not None
1344
- if arrange is not None:
1345
- arrange_tree_nodes(tree, arrange)
1346
- slug = re.sub(r"[^A-Za-z0-9._-]+", "_", tree.name).lstrip(".") or "tree"
1347
- written[tree.name] = to_plot(tree, output_dir / f"{slug}.png", dpi=dpi)
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 posting in pull requests. Selects "
1731
- "groups by exact name or fnmatch wildcard ('Style *'), matched "
1732
- "against every node group in the file (not just assets); with no "
1733
- "names, every group is plotted. Trees are drawn at their stored "
1734
- "layout unless --arrange (or any arrangement flag) is given. "
1735
- "Requires matplotlib (pip install nodebpy[plot])."
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"Plotted {len(written)} node groups to {args.output}")
1884
+ print(f"Wrote {len(written)} images to {args.output}")
1842
1885
  else:
1843
1886
  _build_command(args)
1844
1887