nodebpy 520.5.2__tar.gz → 520.7.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 (82) hide show
  1. {nodebpy-520.5.2 → nodebpy-520.7.0}/PKG-INFO +1 -1
  2. {nodebpy-520.5.2 → nodebpy-520.7.0}/pyproject.toml +1 -1
  3. nodebpy-520.7.0/src/nodebpy/assets/__init__.py +20 -0
  4. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/assets/__main__.py +16 -2
  5. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/assets/_codegen.py +52 -0
  6. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/export/codegen.py +16 -0
  7. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/compositor/__init__.py +1 -1
  8. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/compositor/color.py +1 -1
  9. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/compositor/converter.py +1 -1
  10. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/compositor/distort.py +1 -1
  11. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/compositor/filter.py +1 -1
  12. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/compositor/group.py +1 -1
  13. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/compositor/input.py +1 -1
  14. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/compositor/interface.py +1 -1
  15. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/compositor/matte.py +1 -1
  16. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/compositor/output.py +1 -1
  17. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/compositor/vector.py +1 -1
  18. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/geometry/__init__.py +208 -210
  19. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/geometry/assets.py +0 -46
  20. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/geometry/attribute.py +1 -1
  21. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/geometry/color.py +1 -1
  22. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/geometry/converter.py +3 -3
  23. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/geometry/geometry.py +1 -1
  24. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/geometry/grid.py +1 -1
  25. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/geometry/group.py +1 -1
  26. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/geometry/input.py +1 -1
  27. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/geometry/interface.py +1 -1
  28. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/geometry/output.py +1 -1
  29. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/geometry/texture.py +1 -1
  30. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/geometry/utilities.py +1 -1
  31. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/geometry/vector.py +1 -1
  32. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/shader/__init__.py +1 -1
  33. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/shader/color.py +1 -1
  34. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/shader/converter.py +1 -1
  35. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/shader/grid.py +1 -1
  36. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/shader/group.py +1 -1
  37. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/shader/input.py +1 -1
  38. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/shader/output.py +1 -1
  39. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/shader/script.py +1 -1
  40. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/shader/shader.py +3 -3
  41. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/shader/texture.py +1 -1
  42. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/shader/vector.py +1 -1
  43. nodebpy-520.5.2/src/nodebpy/assets/__init__.py +0 -17
  44. {nodebpy-520.5.2 → nodebpy-520.7.0}/README.md +0 -0
  45. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/__init__.py +0 -0
  46. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/builder/__init__.py +0 -0
  47. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/builder/_registry.py +0 -0
  48. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/builder/_utils.py +0 -0
  49. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/builder/accessor.py +0 -0
  50. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/builder/arrange.py +0 -0
  51. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/builder/asset.py +0 -0
  52. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/builder/items.py +0 -0
  53. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/builder/mixins.py +0 -0
  54. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/builder/node.py +0 -0
  55. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/builder/socket.py +0 -0
  56. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/builder/tree.py +0 -0
  57. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/export/__init__.py +0 -0
  58. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/export/diagram.py +0 -0
  59. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/export/web_render.py +0 -0
  60. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/lib/nodearrange/__init__.py +0 -0
  61. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/lib/nodearrange/arrange/__init__.py +0 -0
  62. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/lib/nodearrange/arrange/graph.py +0 -0
  63. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/lib/nodearrange/arrange/ordering.py +0 -0
  64. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/lib/nodearrange/arrange/ranking.py +0 -0
  65. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/lib/nodearrange/arrange/realize.py +0 -0
  66. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/lib/nodearrange/arrange/stacking.py +0 -0
  67. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/lib/nodearrange/arrange/structs.py +0 -0
  68. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/lib/nodearrange/arrange/sugiyama.py +0 -0
  69. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/lib/nodearrange/arrange/x_coords.py +0 -0
  70. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/lib/nodearrange/arrange/y_coords.py +0 -0
  71. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/lib/nodearrange/config.py +0 -0
  72. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/lib/nodearrange/utils.py +0 -0
  73. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/__init__.py +0 -0
  74. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/_mixins.py +0 -0
  75. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/compositor/assets.py +0 -0
  76. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/compositor/manual.py +0 -0
  77. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/geometry/groups.py +0 -0
  78. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/geometry/manual.py +0 -0
  79. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/geometry/zone.py +0 -0
  80. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/shader/assets.py +0 -0
  81. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/nodes/shader/manual.py +0 -0
  82. {nodebpy-520.5.2 → nodebpy-520.7.0}/src/nodebpy/types.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: nodebpy
3
- Version: 520.5.2
3
+ Version: 520.7.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.5.2"
3
+ version = "520.7.0"
4
4
  description = "Build nodes trees in Blender more elegantly with code"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -0,0 +1,20 @@
1
+ """Typed APIs for node-group assets.
2
+
3
+ ``generate_asset_api`` builds typed :class:`~nodebpy.builder.AssetNodeGroup`
4
+ classes for the node groups in a ``.blend`` asset library into a single module;
5
+ ``generate_asset_modules`` splits them into one module per tree type
6
+ (``geometry.py`` / ``shader.py`` / ``compositor.py``). The bundled-essentials
7
+ APIs generated for nodebpy itself live in ``nodebpy.nodes.{geometry,shader,
8
+ compositor}.assets`` and are re-exported alongside the built-in nodes.
9
+ """
10
+
11
+ from ..builder import AssetLibrary, BundledLibrary, PackageLibrary
12
+ from ._codegen import generate_asset_api, generate_asset_modules
13
+
14
+ __all__ = [
15
+ "generate_asset_api",
16
+ "generate_asset_modules",
17
+ "AssetLibrary",
18
+ "BundledLibrary",
19
+ "PackageLibrary",
20
+ ]
@@ -14,7 +14,7 @@ import os
14
14
  from pathlib import Path
15
15
 
16
16
  from ..builder import BundledLibrary, PackageLibrary
17
- from ._codegen import generate_asset_api
17
+ from ._codegen import generate_asset_api, generate_asset_modules
18
18
 
19
19
  # Bundled libraries shipped with Blender, grouped by output module. Each library
20
20
  # holds node groups of a single tree type.
@@ -70,7 +70,11 @@ def parse_args() -> argparse.Namespace:
70
70
  "-o",
71
71
  dest="output",
72
72
  type=Path,
73
- help="Path of the assets.py module to write.",
73
+ help=(
74
+ "Where to write the generated module(s). A .py path writes a single "
75
+ "module; a directory writes one module per tree type "
76
+ "(geometry.py / shader.py / compositor.py)."
77
+ ),
74
78
  )
75
79
  parser.add_argument(
76
80
  "--nodebpy-pkg",
@@ -98,6 +102,16 @@ def main() -> None: # pragma: no cover - CLI wrapper
98
102
  # directory (``__file__``), so express the .blend relative to the output
99
103
  # module — not the CWD the command happened to run from.
100
104
  blend = args.blend_file.resolve()
105
+ if output.suffix != ".py":
106
+ # Directory output: one module per tree type.
107
+ out_dir = output.resolve()
108
+ relative = Path(os.path.relpath(blend, out_dir)).as_posix()
109
+ generate_asset_modules(
110
+ [PackageLibrary(str(out_dir / "_anchor.py"), relative)],
111
+ output,
112
+ nodebpy_pkg=args.nodebpy_pkg,
113
+ )
114
+ return
101
115
  relative = Path(os.path.relpath(blend, output.resolve().parent)).as_posix()
102
116
  generate_asset_api(
103
117
  [PackageLibrary(str(output), relative)],
@@ -50,6 +50,14 @@ _SOCKET_TYPES: dict[str, tuple[str, str]] = {
50
50
  }
51
51
 
52
52
 
53
+ # Tree type → module name used when splitting generated output per tree type.
54
+ _TREE_MODULES: dict[str, str] = {
55
+ "GeometryNodeTree": "geometry",
56
+ "ShaderNodeTree": "shader",
57
+ "CompositorNodeTree": "compositor",
58
+ }
59
+
60
+
53
61
  def _socket_types(bl_socket_type: str) -> tuple[str, str]:
54
62
  for key, value in _SOCKET_TYPES.items():
55
63
  if key in bl_socket_type:
@@ -329,3 +337,47 @@ def generate_asset_api(
329
337
  _render_module(classes, nodebpy_pkg=nodebpy_pkg), encoding="utf-8"
330
338
  )
331
339
  return [c.class_name for c in classes]
340
+
341
+
342
+ def generate_asset_modules(
343
+ libraries: AssetLibrary | Sequence[AssetLibrary],
344
+ output_dir: str | Path,
345
+ *,
346
+ names: set[str] | None = None,
347
+ nodebpy_pkg: str = "nodebpy",
348
+ ) -> dict[str, list[str]]:
349
+ """Generate typed asset classes for ``libraries``, split into one module per
350
+ tree type inside ``output_dir``.
351
+
352
+ Writes ``geometry.py``, ``shader.py`` and/or ``compositor.py`` — one module
353
+ for each tree type that has assets in the libraries (no file for the
354
+ others). Asset names repeat across editors (a geometry *and* a compositor
355
+ "Combine Spherical" both exist), so splitting keeps the generated class
356
+ names collision-free where a single :func:`generate_asset_api` module would
357
+ silently shadow one with the other.
358
+
359
+ Parameters are as for :func:`generate_asset_api`, except ``output_dir`` is
360
+ the directory to write the modules into (created if needed).
361
+
362
+ Returns a mapping of module name (``"geometry"`` / ``"shader"`` /
363
+ ``"compositor"``) to the class names written to it.
364
+ """
365
+ if isinstance(libraries, AssetLibrary):
366
+ libraries = [libraries]
367
+
368
+ classes: list[_AssetClass] = []
369
+ for library in libraries:
370
+ classes.extend(_introspect(library, names))
371
+
372
+ output_dir = Path(output_dir)
373
+ output_dir.mkdir(parents=True, exist_ok=True)
374
+ written: dict[str, list[str]] = {}
375
+ for tree_idname, module in _TREE_MODULES.items():
376
+ tree_classes = [c for c in classes if c.tree_idname == tree_idname]
377
+ if not tree_classes:
378
+ continue
379
+ (output_dir / f"{module}.py").write_text(
380
+ _render_module(tree_classes, nodebpy_pkg=nodebpy_pkg), encoding="utf-8"
381
+ )
382
+ written[module] = [c.class_name for c in tree_classes]
383
+ return written
@@ -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": ">",
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from .manual import (
4
4
  MenuSwitch,
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING, Literal
4
4
 
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING, Generic, Literal
4
4
 
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING, Literal
4
4
 
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING, Literal
4
4
 
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING
4
4
 
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING, Literal
4
4
 
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING, Generic, Literal
4
4
 
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING, Literal
4
4
 
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING
4
4
 
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING
4
4
 
@@ -1,79 +1,45 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
- from .assets import (
4
- Array,
5
- AttachHairCurvesToSurface,
6
- AttachmentInfo,
7
- BlendHairCurves,
8
- BoxSelection,
9
- BraidHairCurves,
10
- CaptureRestGeometry,
11
- ClothDynamicsExperimental,
12
- ClumpHairCurves,
13
- Collider,
14
- CombineCylindrical,
15
- CombineSpherical,
16
- CreateGuideIndexMap,
17
- CurlHairCurves,
18
- CurveInfo,
19
- CurveRoot,
20
- CurveSegment,
21
- CurveTip,
22
- CurveToTube,
23
- CustomEffector,
24
- CustomForce,
25
- DisplaceGeometry,
26
- DisplaceHairCurves,
27
- DuplicateHairCurves,
28
- EdgeLength,
29
- FaceCornerAngle,
30
- FrizzHairCurves,
31
- GenerateHairCurves,
32
- GeometryInput,
33
- GeometryPrincipalComponents,
34
- HairCurvesNoise,
35
- HairDynamics,
36
- InstanceOnElements,
37
- InterpolateHairCurves,
38
- IsEdgeBoundary,
39
- IsEdgeLoose,
40
- IsEdgeManifold,
41
- IsUVSplit,
42
- NormalSelection,
43
- PrincipalComponents,
44
- ProjectWithDepth,
45
- RandomizeTransforms,
46
- RandomRotation,
47
- RedistributeCurvePoints,
48
- RestoreCurveSegmentLength,
49
- RollHairCurves,
50
- RotateHairCurves,
51
- ScatterOnSurface,
52
- ScreenTo3DSpace,
53
- SeparateCylindrical,
54
- SeparateSpherical,
55
- SetAttachmentSurface,
56
- SetEffector,
57
- SetHairCurveProfile,
58
- ShrinkwrapHairCurves,
59
- SmoothByAngle,
60
- SmoothGeometry,
61
- SmoothHairCurves,
62
- SphereSelection,
63
- StraightenHairCurves,
64
- TransformAndProject,
65
- TrimHairCurves,
66
- _3DToScreenSpace,
67
- )
68
- from .attribute import (
69
- BlurAttribute,
70
- DomainSize,
71
- GetAttributeNames,
72
- RemoveNamedAttribute,
73
- )
74
- from .color import (
75
- Gamma,
76
- RGBCurves,
3
+ from .manual import (
4
+ IndexSwitch,
5
+ MenuSwitch,
6
+ CaptureAttribute,
7
+ FieldToGrid,
8
+ JoinGeometry,
9
+ SDFGridBoolean,
10
+ GeometryToInstance,
11
+ RepeatInput,
12
+ RepeatOutput,
13
+ RepeatZone,
14
+ SimulationInput,
15
+ SimulationOutput,
16
+ SimulationZone,
17
+ ForEachGeometryElementInput,
18
+ ForEachGeometryElementOutput,
19
+ ForEachGeometryElementZone,
20
+ EvaluateClosure,
21
+ ClosureInput,
22
+ ClosureOutput,
23
+ ClosureZone,
24
+ JoinStrings,
25
+ Menu,
26
+ Collection,
27
+ Material,
28
+ Object,
29
+ Value,
30
+ MeshBoolean,
31
+ Compare,
32
+ Mix,
33
+ AttributeStatistic,
34
+ SampleIndex,
35
+ IntegerVector,
36
+ SampleCurve,
37
+ Frame,
38
+ Float,
39
+ FloatCurve,
40
+ ColorRamp,
41
+ StoreNamedAttribute,
42
+ tree,
77
43
  )
78
44
  from .converter import (
79
45
  AccumulateField,
@@ -97,8 +63,8 @@ from .converter import (
97
63
  EvaluateOnDomain,
98
64
  FieldAverage,
99
65
  FieldMinAndMax,
100
- FieldToList,
101
66
  FieldVariance,
67
+ FieldToList,
102
68
  FilterList,
103
69
  FindInString,
104
70
  FloatToInteger,
@@ -154,20 +120,108 @@ from .converter import (
154
120
  UVUnwrap,
155
121
  ValueToString,
156
122
  )
123
+ from .input import (
124
+ Cursor3D,
125
+ ActiveCamera,
126
+ ActiveElement,
127
+ BoneInfo,
128
+ Boolean,
129
+ CameraInfo,
130
+ CollectionChildren,
131
+ CollectionInfo,
132
+ Color,
133
+ CornersOfEdge,
134
+ CornersOfFace,
135
+ CornersOfVertex,
136
+ CurveHandlePositions,
137
+ CurveTangent,
138
+ CurveTilt,
139
+ CurveOfPoint,
140
+ EdgeAngle,
141
+ EdgeNeighbors,
142
+ EdgePathsToSelection,
143
+ EdgeVertices,
144
+ EdgesOfCorner,
145
+ EdgesOfVertex,
146
+ EdgesToFaceGroups,
147
+ EndpointSelection,
148
+ FaceArea,
149
+ FaceGroupBoundaries,
150
+ FaceNeighbors,
151
+ FaceSet,
152
+ FaceOfCorner,
153
+ Font,
154
+ HandleTypeSelection,
155
+ ID,
156
+ Image,
157
+ ImageInfo,
158
+ ImportCSV,
159
+ ImportOBJ,
160
+ ImportPLY,
161
+ ImportSTL,
162
+ ImportText,
163
+ ImportVDB,
164
+ Index,
165
+ InstanceBounds,
166
+ InstanceReference,
167
+ InstanceRotation,
168
+ InstanceScale,
169
+ InstanceTransform,
170
+ Integer,
171
+ IsEdgeSmooth,
172
+ IsFacePlanar,
173
+ IsFaceSmooth,
174
+ IsSplineCyclic,
175
+ IsViewport,
176
+ MaterialIndex,
177
+ MeshIsland,
178
+ MousePosition,
179
+ NamedAttribute,
180
+ NamedLayerSelection,
181
+ Normal,
182
+ ObjectInfo,
183
+ OffsetCornerInFace,
184
+ OffsetPointInCurve,
185
+ PointsOfCurve,
186
+ Position,
187
+ Radius,
188
+ Rotation,
189
+ SceneTime,
190
+ Selection,
191
+ SelfObject,
192
+ ShortestEdgePaths,
193
+ SpecialCharacters,
194
+ SplineLength,
195
+ SplineParameter,
196
+ SplineResolution,
197
+ String,
198
+ UVTangent,
199
+ Vector,
200
+ VertexNeighbors,
201
+ VertexOfCorner,
202
+ ViewportTransform,
203
+ VoxelIndex,
204
+ )
205
+ from .attribute import (
206
+ BlurAttribute,
207
+ DomainSize,
208
+ GetAttributeNames,
209
+ RemoveNamedAttribute,
210
+ )
157
211
  from .geometry import (
158
212
  Arc,
159
213
  Bake,
160
- BezierSegment,
161
214
  BoundingBox,
215
+ BezierSegment,
162
216
  Cone,
163
217
  ConvexHull,
164
218
  Cube,
165
219
  CurveCircle,
166
220
  CurveLength,
167
221
  CurveLine,
168
- CurvesToGreasePencil,
169
222
  CurveToMesh,
170
223
  CurveToPoints,
224
+ CurvesToGreasePencil,
171
225
  Cylinder,
172
226
  DeformCurvesOnSurface,
173
227
  DeleteGeometry,
@@ -189,9 +243,9 @@ from .geometry import (
189
243
  InstancesToPoints,
190
244
  InterpolateCurves,
191
245
  MaterialSelection,
192
- MergeByDistance,
193
246
  MergeLayers,
194
247
  MergePoints,
248
+ MergeByDistance,
195
249
  MeshBevel,
196
250
  MeshCircle,
197
251
  MeshLine,
@@ -281,14 +335,14 @@ from .grid import (
281
335
  PointsToSDFGrid,
282
336
  PointsToVolume,
283
337
  PruneGrid,
284
- SampleGrid,
285
- SampleGridIndex,
286
338
  SDFGridFillet,
287
339
  SDFGridLaplacian,
288
340
  SDFGridMean,
289
341
  SDFGridMeanCurvature,
290
342
  SDFGridMedian,
291
343
  SDFGridOffset,
344
+ SampleGrid,
345
+ SampleGridIndex,
292
346
  SetGridBackground,
293
347
  SetGridTransform,
294
348
  StoreNamedGrid,
@@ -296,91 +350,6 @@ from .grid import (
296
350
  VolumeToMesh,
297
351
  VoxelizeGrid,
298
352
  )
299
- from .group import (
300
- Group,
301
- )
302
- from .input import (
303
- ID,
304
- ActiveCamera,
305
- ActiveElement,
306
- BoneInfo,
307
- Boolean,
308
- CameraInfo,
309
- CollectionChildren,
310
- CollectionInfo,
311
- Color,
312
- CornersOfEdge,
313
- CornersOfFace,
314
- CornersOfVertex,
315
- Cursor3D,
316
- CurveHandlePositions,
317
- CurveOfPoint,
318
- CurveTangent,
319
- CurveTilt,
320
- EdgeAngle,
321
- EdgeNeighbors,
322
- EdgePathsToSelection,
323
- EdgesOfCorner,
324
- EdgesOfVertex,
325
- EdgesToFaceGroups,
326
- EdgeVertices,
327
- EndpointSelection,
328
- FaceArea,
329
- FaceGroupBoundaries,
330
- FaceNeighbors,
331
- FaceOfCorner,
332
- FaceSet,
333
- Font,
334
- HandleTypeSelection,
335
- Image,
336
- ImageInfo,
337
- ImportCSV,
338
- ImportOBJ,
339
- ImportPLY,
340
- ImportSTL,
341
- ImportText,
342
- ImportVDB,
343
- Index,
344
- InstanceBounds,
345
- InstanceReference,
346
- InstanceRotation,
347
- InstanceScale,
348
- InstanceTransform,
349
- Integer,
350
- IsEdgeSmooth,
351
- IsFacePlanar,
352
- IsFaceSmooth,
353
- IsSplineCyclic,
354
- IsViewport,
355
- MaterialIndex,
356
- MeshIsland,
357
- MousePosition,
358
- NamedAttribute,
359
- NamedLayerSelection,
360
- Normal,
361
- ObjectInfo,
362
- OffsetCornerInFace,
363
- OffsetPointInCurve,
364
- PointsOfCurve,
365
- Position,
366
- Radius,
367
- Rotation,
368
- SceneTime,
369
- Selection,
370
- SelfObject,
371
- ShortestEdgePaths,
372
- SpecialCharacters,
373
- SplineLength,
374
- SplineParameter,
375
- SplineResolution,
376
- String,
377
- UVTangent,
378
- Vector,
379
- VertexNeighbors,
380
- VertexOfCorner,
381
- ViewportTransform,
382
- VoxelIndex,
383
- )
384
353
  from .interface import (
385
354
  DialGizmo,
386
355
  EnableOutput,
@@ -390,49 +359,8 @@ from .interface import (
390
359
  TransformGizmo,
391
360
  Warning,
392
361
  )
393
- from .manual import (
394
- AttributeStatistic,
395
- CaptureAttribute,
396
- ClosureInput,
397
- ClosureOutput,
398
- ClosureZone,
399
- Collection,
400
- ColorRamp,
401
- Compare,
402
- EvaluateClosure,
403
- FieldToGrid,
404
- Float,
405
- FloatCurve,
406
- ForEachGeometryElementInput,
407
- ForEachGeometryElementOutput,
408
- ForEachGeometryElementZone,
409
- Frame,
410
- GeometryToInstance,
411
- IndexSwitch,
412
- IntegerVector,
413
- JoinGeometry,
414
- JoinStrings,
415
- Material,
416
- Menu,
417
- MenuSwitch,
418
- MeshBoolean,
419
- Mix,
420
- Object,
421
- RepeatInput,
422
- RepeatOutput,
423
- RepeatZone,
424
- SampleCurve,
425
- SampleIndex,
426
- SDFGridBoolean,
427
- SimulationInput,
428
- SimulationOutput,
429
- SimulationZone,
430
- StoreNamedAttribute,
431
- Value,
432
- tree,
433
- )
434
- from .output import (
435
- Viewer,
362
+ from .group import (
363
+ Group,
436
364
  )
437
365
  from .texture import (
438
366
  BrickTexture,
@@ -446,15 +374,86 @@ from .texture import (
446
374
  WaveTexture,
447
375
  WhiteNoiseTexture,
448
376
  )
377
+ from .output import (
378
+ Viewer,
379
+ )
449
380
  from .utilities import (
450
381
  Reroute,
451
382
  )
383
+ from .color import (
384
+ Gamma,
385
+ RGBCurves,
386
+ )
452
387
  from .vector import (
453
388
  RadialTiling,
454
389
  VectorCurves,
455
390
  VectorMath,
456
391
  VectorRotate,
457
392
  )
393
+ from .assets import (
394
+ Array,
395
+ AttachHairCurvesToSurface,
396
+ AttachmentInfo,
397
+ BlendHairCurves,
398
+ BoxSelection,
399
+ BraidHairCurves,
400
+ CaptureRestGeometry,
401
+ ClothDynamicsExperimental,
402
+ ClumpHairCurves,
403
+ Collider,
404
+ CombineCylindrical,
405
+ CombineSpherical,
406
+ CreateGuideIndexMap,
407
+ CurlHairCurves,
408
+ CurveInfo,
409
+ CurveRoot,
410
+ CurveSegment,
411
+ CurveTip,
412
+ CurveToTube,
413
+ CustomEffector,
414
+ CustomForce,
415
+ DisplaceGeometry,
416
+ DisplaceHairCurves,
417
+ DuplicateHairCurves,
418
+ EdgeLength,
419
+ FaceCornerAngle,
420
+ FrizzHairCurves,
421
+ GenerateHairCurves,
422
+ GeometryInput,
423
+ GeometryPrincipalComponents,
424
+ HairCurvesNoise,
425
+ HairDynamics,
426
+ InstanceOnElements,
427
+ InterpolateHairCurves,
428
+ IsEdgeBoundary,
429
+ IsEdgeLoose,
430
+ IsEdgeManifold,
431
+ IsUVSplit,
432
+ NormalSelection,
433
+ PrincipalComponents,
434
+ ProjectWithDepth,
435
+ RandomRotation,
436
+ RandomizeTransforms,
437
+ RedistributeCurvePoints,
438
+ RestoreCurveSegmentLength,
439
+ RollHairCurves,
440
+ RotateHairCurves,
441
+ ScatterOnSurface,
442
+ ScreenTo3DSpace,
443
+ SeparateCylindrical,
444
+ SeparateSpherical,
445
+ SetEffector,
446
+ SetHairCurveProfile,
447
+ ShrinkwrapHairCurves,
448
+ SmoothByAngle,
449
+ SmoothGeometry,
450
+ SmoothHairCurves,
451
+ SphereSelection,
452
+ StraightenHairCurves,
453
+ TransformAndProject,
454
+ TrimHairCurves,
455
+ _3DToScreenSpace,
456
+ )
458
457
 
459
458
  __all__ = (
460
459
  "AccumulateField",
@@ -784,7 +783,6 @@ __all__ = (
784
783
  "SeparateSpherical",
785
784
  "SeparateTransform",
786
785
  "SeparateXYZ",
787
- "SetAttachmentSurface",
788
786
  "SetCurveNormal",
789
787
  "SetCurveRadius",
790
788
  "SetCurveTilt",
@@ -2720,51 +2720,6 @@ class SeparateSpherical(AssetGeometryGroup):
2720
2720
  super().__init__(**{"Input_7": vector})
2721
2721
 
2722
2722
 
2723
- class SetAttachmentSurface(AssetGeometryGroup):
2724
- """Set Attachment Surface"""
2725
-
2726
- _name = "Set Attachment Surface"
2727
- _asset_name = "Set Attachment Surface"
2728
- _library = BundledLibrary("procedural_hair_node_assets.blend")
2729
-
2730
- class _Inputs(SocketAccessor):
2731
- geometry: GeometrySocket
2732
- """Geometry"""
2733
- mode: MenuSocket
2734
- """Mode"""
2735
- surface_object: ObjectSocket
2736
- """Surface Object"""
2737
- surface_uv_map: VectorSocket
2738
- """Surface UV Map"""
2739
-
2740
- class _Outputs(SocketAccessor):
2741
- geometry: GeometrySocket
2742
- """Geometry"""
2743
-
2744
- if TYPE_CHECKING:
2745
-
2746
- @property
2747
- def i(self) -> _Inputs: ...
2748
- @property
2749
- def o(self) -> _Outputs: ...
2750
-
2751
- def __init__(
2752
- self,
2753
- geometry: InputGeometry = None,
2754
- mode: InputMenu = "Object",
2755
- surface_object: InputObject = None,
2756
- surface_uv_map: InputVector = None,
2757
- ):
2758
- super().__init__(
2759
- **{
2760
- "Socket_0": geometry,
2761
- "Socket_6": mode,
2762
- "Socket_4": surface_object,
2763
- "Socket_5": surface_uv_map,
2764
- }
2765
- )
2766
-
2767
-
2768
2723
  class SetEffector(AssetGeometryGroup):
2769
2724
  """Add effector information to the geometry bundle."""
2770
2725
 
@@ -3327,7 +3282,6 @@ __all__ = (
3327
3282
  "ScreenTo3DSpace",
3328
3283
  "SeparateCylindrical",
3329
3284
  "SeparateSpherical",
3330
- "SetAttachmentSurface",
3331
3285
  "SetEffector",
3332
3286
  "SetHairCurveProfile",
3333
3287
  "ShrinkwrapHairCurves",
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING, Generic, Literal
4
4
 
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING
4
4
 
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING, Generic, Literal
4
4
 
@@ -4095,14 +4095,14 @@ class IntegerMath(BaseNode):
4095
4095
  def divide_floor(
4096
4096
  cls, value: InputInteger = 0, value_001: InputInteger = 0
4097
4097
  ) -> "IntegerMath":
4098
- """Create Integer Math with operation 'Divide Floor'. Divide and floor result, the largest integer smaller than or equal A"""
4098
+ """Create Integer Math with operation 'Divide Floor'. Divide and floor to the largest integer smaller than or equal to the result"""
4099
4099
  return cls(operation="DIVIDE_FLOOR", value=value, value_001=value_001)
4100
4100
 
4101
4101
  @classmethod
4102
4102
  def divide_ceiling(
4103
4103
  cls, value: InputInteger = 0, value_001: InputInteger = 0
4104
4104
  ) -> "IntegerMath":
4105
- """Create Integer Math with operation 'Divide Ceiling'. Divide and ceil result, the smallest integer greater than or equal A"""
4105
+ """Create Integer Math with operation 'Divide Ceiling'. Divide and ceil to the smallest integer greater than or equal to the result"""
4106
4106
  return cls(operation="DIVIDE_CEIL", value=value, value_001=value_001)
4107
4107
 
4108
4108
  @classmethod
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING, Generic, Literal
4
4
 
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING, Generic, Literal
4
4
 
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING
4
4
 
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING, Generic, Literal
4
4
 
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING, Generic, Literal
4
4
 
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING, Literal
4
4
 
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING, Literal
4
4
 
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING
4
4
 
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING, Literal
4
4
 
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from .manual import (
4
4
  MenuSwitch,
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING
4
4
 
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING, Generic, Literal
4
4
 
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING, Literal
4
4
 
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING
4
4
 
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING, Literal
4
4
 
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING, Literal
4
4
 
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING, Literal
4
4
 
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING, Literal
4
4
 
@@ -1156,7 +1156,7 @@ class PrincipledBSDF(BaseNode):
1156
1156
  diffuse_roughness: InputFloat = 0.0,
1157
1157
  subsurface_weight: InputFloat = 0.0,
1158
1158
  subsurface_radius: InputVector = None,
1159
- subsurface_scale: InputFloat = 0.05,
1159
+ subsurface_scale: InputFloat = 0.005,
1160
1160
  subsurface_ior: InputFloat = 1.4,
1161
1161
  subsurface_anisotropy: InputFloat = 0.0,
1162
1162
  specular_ior_level: InputFloat = 0.5,
@@ -1909,7 +1909,7 @@ class SubsurfaceScattering(BaseNode):
1909
1909
  def __init__(
1910
1910
  self,
1911
1911
  color: InputColor = None,
1912
- scale: InputFloat = 0.05,
1912
+ scale: InputFloat = 0.005,
1913
1913
  radius: InputVector = None,
1914
1914
  ior: InputFloat = 1.4,
1915
1915
  roughness: InputFloat = 1.0,
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING, Literal
4
4
 
@@ -1,4 +1,4 @@
1
- # Auto-generated by generate.py — do not edit manually.
1
+ # Auto-generated by `python -m gen` — do not edit manually.
2
2
 
3
3
  from typing import TYPE_CHECKING, Literal
4
4
 
@@ -1,17 +0,0 @@
1
- """Typed APIs for node-group assets.
2
-
3
- ``generate_asset_api`` builds typed :class:`~nodebpy.builder.AssetNodeGroup`
4
- classes for the node groups in a ``.blend`` asset library. The bundled-essentials
5
- APIs generated for nodebpy itself live alongside this module as
6
- ``nodebpy.assets.geometry`` / ``.shader`` / ``.compositor``.
7
- """
8
-
9
- from ..builder import AssetLibrary, BundledLibrary, PackageLibrary
10
- from ._codegen import generate_asset_api
11
-
12
- __all__ = [
13
- "generate_asset_api",
14
- "AssetLibrary",
15
- "BundledLibrary",
16
- "PackageLibrary",
17
- ]
File without changes