procfunc 0.33.2__tar.gz → 0.34.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.
- {procfunc-0.33.2/src/procfunc.egg-info → procfunc-0.34.0}/PKG-INFO +3 -1
- {procfunc-0.33.2 → procfunc-0.34.0}/pyproject.toml +3 -1
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/__init__.py +1 -1
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/color.py +4 -11
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/compute_graph/__init__.py +0 -1
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/context.py +0 -40
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/control/__init__.py +2 -5
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/nodes/execute/construct_standard.py +5 -9
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/nodes/execute/util.py +2 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/nodes/func.py +0 -15
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/nodes/geo.py +4 -51
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/nodes/manifest.json +13 -627
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/nodes/math.py +2 -2
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/nodes/shader.py +0 -39
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/nodes/texture.py +88 -96
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/nodes/util/bindings_util.py +0 -35
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/transpiler/bpy_to_computegraph.py +3 -7
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/transpiler/parse_special_cases.py +10 -6
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/util/bpy_info.py +9 -11
- {procfunc-0.33.2 → procfunc-0.34.0/src/procfunc.egg-info}/PKG-INFO +3 -1
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc.egg-info/requires.txt +2 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/LICENSE.md +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/README.md +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/setup.cfg +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/cli/__init__.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/cli/main.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/codegen/__init__.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/codegen/codegen.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/codegen/identifiers.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/codegen/repr.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/compute_graph/compute_graph.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/compute_graph/node.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/compute_graph/operators_info.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/compute_graph/proxy.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/compute_graph/util.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/nodes/__init__.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/nodes/color.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/nodes/compositor.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/nodes/execute/construct_nodes.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/nodes/execute/construct_operator.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/nodes/execute/construct_special_cases.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/nodes/execute/execute.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/nodes/execute/infer_runtime_data_type.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/nodes/execute/realize.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/nodes/types.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/nodes/util/__init__.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/nodes/util/bpy_node_info.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/nodes/util/node_function.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/ops/__init__.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/ops/_util.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/ops/addons.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/ops/attr.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/ops/collection.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/ops/curve.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/ops/file.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/ops/manifest.json +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/ops/mesh.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/ops/modifier.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/ops/object.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/ops/primitives/__init__.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/ops/primitives/camera.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/ops/primitives/curve.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/ops/primitives/light.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/ops/primitives/mesh.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/ops/uv.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/random.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/tracer/__init__.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/tracer/decorator.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/tracer/patch.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/tracer/proxy.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/tracer/trace.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/transforms/__init__.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/transforms/cleanup.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/transforms/convert.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/transforms/distribution.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/transforms/extract_materials.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/transforms/infer_distribution.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/transforms/parameters.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/transforms/util.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/transpiler/__init__.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/transpiler/main.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/transpiler/parse_default_values.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/types.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/util/__init__.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/util/bpy_data.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/util/camera.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/util/keyframe.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/util/log.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/util/manifest.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/util/pytree.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc/util/teardown.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc.egg-info/SOURCES.txt +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc.egg-info/dependency_links.txt +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc.egg-info/entry_points.txt +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/src/procfunc.egg-info/top_level.txt +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/tests/test_asset.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/tests/test_bpy_data_cleanup.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/tests/test_cli_transpile.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/tests/test_codegen.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/tests/test_codegen_matrix.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/tests/test_compute_graph.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/tests/test_node_function.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/tests/test_ops.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/tests/test_pytree.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/tests/test_random.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/tests/test_trace.py +0 -0
- {procfunc-0.33.2 → procfunc-0.34.0}/tests/test_transforms.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: procfunc
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.34.0
|
|
4
4
|
Summary: Function-Oriented Abstractions for Procedural 3D Generation in Python
|
|
5
5
|
License-Expression: BSD-3-Clause
|
|
6
6
|
Project-URL: Homepage, https://github.com/princeton-vl/procfunc
|
|
@@ -16,6 +16,8 @@ Requires-Dist: pytest; extra == "dev"
|
|
|
16
16
|
Requires-Dist: pytest-xdist; extra == "dev"
|
|
17
17
|
Requires-Dist: ruff<0.16,>=0.15; extra == "dev"
|
|
18
18
|
Requires-Dist: ty; extra == "dev"
|
|
19
|
+
Requires-Dist: imageio; extra == "dev"
|
|
20
|
+
Requires-Dist: matplotlib; extra == "dev"
|
|
19
21
|
Provides-Extra: docs
|
|
20
22
|
Requires-Dist: sphinx; extra == "docs"
|
|
21
23
|
Requires-Dist: sphinx-rtd-theme; extra == "docs"
|
|
@@ -31,12 +31,7 @@ def rgb_color(
|
|
|
31
31
|
) -> t.Color:
|
|
32
32
|
if rgb is None and (r is None or g is None or b is None):
|
|
33
33
|
raise ValueError("provide rgb=... or all of r/g/b")
|
|
34
|
-
|
|
35
|
-
if rgb is not None:
|
|
36
|
-
color.r, color.g, color.b = rgb
|
|
37
|
-
else:
|
|
38
|
-
color.r, color.g, color.b = r, g, b
|
|
39
|
-
return color
|
|
34
|
+
return t.Color(rgb if rgb is not None else (r, g, b))
|
|
40
35
|
|
|
41
36
|
|
|
42
37
|
def _srgb_to_linearrgb(c):
|
|
@@ -48,14 +43,12 @@ def _srgb_to_linearrgb(c):
|
|
|
48
43
|
return ((c + 0.055) / 1.055) ** 2.4
|
|
49
44
|
|
|
50
45
|
|
|
51
|
-
def _hex_to_rgb(h: int
|
|
46
|
+
def _hex_to_rgb(h: int):
|
|
52
47
|
r = (h & 0xFF0000) >> 16
|
|
53
48
|
g = (h & 0x00FF00) >> 8
|
|
54
49
|
b = h & 0x0000FF
|
|
55
50
|
return tuple([_srgb_to_linearrgb(c / 0xFF) for c in (r, g, b)])
|
|
56
51
|
|
|
57
52
|
|
|
58
|
-
def hex_color(h: int
|
|
59
|
-
|
|
60
|
-
c.r, c.g, c.b = _hex_to_rgb(h, alpha)
|
|
61
|
-
return c
|
|
53
|
+
def hex_color(h: int) -> t.Color:
|
|
54
|
+
return t.Color(_hex_to_rgb(h))
|
|
@@ -13,24 +13,6 @@ class ProcfuncContext:
|
|
|
13
13
|
num_cpu_cores: int
|
|
14
14
|
current_trace_level: int | None # compared against to TraceLevel int values
|
|
15
15
|
|
|
16
|
-
warn_mode_avoid_normal_bump: Literal["ignore", "warn", "throw"]
|
|
17
|
-
"""
|
|
18
|
-
Set to 'throw' for strict usage. Using a normal map / bump map / BSDF vector input _can_ be useful,
|
|
19
|
-
but its always better to do it via the Displacement output of the shader (so that it at least can also be done as displacement)
|
|
20
|
-
"""
|
|
21
|
-
|
|
22
|
-
warn_mode_avoid_implicit_vector: Literal["ignore", "warn", "throw"]
|
|
23
|
-
"""
|
|
24
|
-
Set to 'throw' to force the user to specify exactly what vector to sample.
|
|
25
|
-
This prevents materials from being incorrect when on a moving object, or ignoring uv coordinates
|
|
26
|
-
"""
|
|
27
|
-
|
|
28
|
-
warn_mode_avoid_io_nodes: Literal["ignore", "warn", "throw"]
|
|
29
|
-
"""
|
|
30
|
-
Set to 'throw' to prevent floating Value Vector Color nodes, or strange output nodes like AOV in shader
|
|
31
|
-
Intent is to force nodegroups to be more functional - all inputs and outputs go through nodegroup interface
|
|
32
|
-
"""
|
|
33
|
-
|
|
34
16
|
warn_mode_empty_geonodes: Literal["ignore", "warn", "throw"]
|
|
35
17
|
"""
|
|
36
18
|
Controls behavior when a geometry node graph produces no mesh geometry (e.g. unconnected inputs).
|
|
@@ -44,16 +26,10 @@ class ProcfuncContext:
|
|
|
44
26
|
|
|
45
27
|
def set_strict(self):
|
|
46
28
|
"""Set all warning modes to 'throw'"""
|
|
47
|
-
self.warn_mode_avoid_normal_bump = "throw"
|
|
48
|
-
self.warn_mode_avoid_implicit_vector = "throw"
|
|
49
|
-
self.warn_mode_avoid_io_nodes = "throw"
|
|
50
29
|
self.warn_mode_empty_geonodes = "throw"
|
|
51
30
|
|
|
52
31
|
def set_warn(self):
|
|
53
32
|
"""Set all warning modes to 'warn'"""
|
|
54
|
-
self.warn_mode_avoid_normal_bump = "warn"
|
|
55
|
-
self.warn_mode_avoid_implicit_vector = "warn"
|
|
56
|
-
self.warn_mode_avoid_io_nodes = "warn"
|
|
57
33
|
self.warn_mode_empty_geonodes = "warn"
|
|
58
34
|
|
|
59
35
|
|
|
@@ -61,27 +37,11 @@ class ProcfuncContext:
|
|
|
61
37
|
|
|
62
38
|
warn_modes = ["ignore", "warn", "throw"]
|
|
63
39
|
|
|
64
|
-
_warn_mode_avoid_normal_bump = os.environ.get(
|
|
65
|
-
"PROCFUNC_WARN_MODE_AVOID_NORMAL_BUMP", "ignore"
|
|
66
|
-
)
|
|
67
|
-
assert _warn_mode_avoid_normal_bump in warn_modes
|
|
68
|
-
|
|
69
|
-
warn_mode_avoid_implicit_vector = os.environ.get(
|
|
70
|
-
"PROCFUNC_WARN_MODE_AVOID_IMPLICIT_VECTOR", "ignore"
|
|
71
|
-
)
|
|
72
|
-
assert warn_mode_avoid_implicit_vector in warn_modes
|
|
73
|
-
|
|
74
|
-
warn_mode_avoid_io_nodes = os.environ.get("PROCFUNC_WARN_MODE_AVOID_IO_NODES", "ignore")
|
|
75
|
-
assert warn_mode_avoid_io_nodes in warn_modes
|
|
76
|
-
|
|
77
40
|
_warn_mode_empty_geonodes = os.environ.get("PROCFUNC_WARN_MODE_EMPTY_GEONODES", "warn")
|
|
78
41
|
assert _warn_mode_empty_geonodes in warn_modes
|
|
79
42
|
|
|
80
43
|
globals = ProcfuncContext(
|
|
81
44
|
num_cpu_cores=int(os.environ.get("PROCFUNC_NUM_CPU_CORES", 0)),
|
|
82
|
-
warn_mode_avoid_normal_bump=_warn_mode_avoid_normal_bump, # type: ignore[invalid-assignment]
|
|
83
|
-
warn_mode_avoid_implicit_vector=warn_mode_avoid_implicit_vector, # type: ignore[invalid-assignment]
|
|
84
|
-
warn_mode_avoid_io_nodes=warn_mode_avoid_io_nodes, # type: ignore[invalid-assignment]
|
|
85
45
|
warn_mode_empty_geonodes=_warn_mode_empty_geonodes, # type: ignore[invalid-assignment]
|
|
86
46
|
current_trace_level=None,
|
|
87
47
|
)
|
|
@@ -127,12 +127,9 @@ def choice(
|
|
|
127
127
|
) -> T:
|
|
128
128
|
"""
|
|
129
129
|
Args:
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
options: list of callables to choose from
|
|
133
|
-
chosen: if not None, use this value instead of choosing randomly. Cannot be traced, but may appear in the output of the tracer.
|
|
130
|
+
choice_rng: random number generator
|
|
131
|
+
choice_options: list of (value, weight) tuples; weights are normalized to a probability distribution
|
|
134
132
|
chosen_idx: if not None, use this index instead of choosing randomly. Cannot be traced, but may appear in the output of the tracer.
|
|
135
|
-
**child_kwargs: keyword arguments to pass to the chosen callable
|
|
136
133
|
|
|
137
134
|
TODO: this function should really take args and kwargs as tuple & dict, not via expansion
|
|
138
135
|
but this requires our Node to handle cases with pytrees as inputs. Currently it would fail to execute the children if they are hidden in a pytree
|
|
@@ -320,26 +320,22 @@ def _construct_procnode_standard(
|
|
|
320
320
|
for input_name, input_py in kwargs.items():
|
|
321
321
|
input_result = input_results[input_name]
|
|
322
322
|
if input_result is None:
|
|
323
|
-
# Strict-None policy: None means "leave disconnected" and is only
|
|
324
|
-
# allowed for sockets with no default_value attr at all (Geometry,
|
|
325
|
-
# Shader, Matrix, Virtual) - never rely on Blender's internal
|
|
326
|
-
# defaults, whose values may change across versions. A disabled or
|
|
327
|
-
# missing socket name is a binding bug and propagates as ValueError.
|
|
328
323
|
to_socket = get_input_socket_to_connect_to(
|
|
329
324
|
bl_node_tree, bl_node, input_name, None
|
|
330
325
|
)
|
|
331
|
-
# IMAGE default_value is a datablock pointer; None faithfully means "no image assigned"
|
|
332
326
|
if (
|
|
333
327
|
to_socket.is_multi_input
|
|
334
328
|
or not hasattr(to_socket, "default_value")
|
|
335
|
-
or to_socket.
|
|
329
|
+
or to_socket.hide_value
|
|
330
|
+
or to_socket.default_value is None
|
|
336
331
|
):
|
|
337
332
|
continue
|
|
338
333
|
raise ValueError(
|
|
339
334
|
f"Node {bl_node.name!r} input {to_socket.name!r} (socket type "
|
|
340
335
|
f"{to_socket.type}) received None. Explicitly pass a value; None is "
|
|
341
|
-
f"only allowed for
|
|
342
|
-
f"
|
|
336
|
+
f"only allowed for disconnected implicit-field sockets (hide_value), "
|
|
337
|
+
f"datablock pointers, or sockets with no default_value attribute "
|
|
338
|
+
f"(e.g. Geometry/Shader)."
|
|
343
339
|
)
|
|
344
340
|
to_socket = get_input_socket_to_connect_to(
|
|
345
341
|
bl_node_tree, bl_node, input_name, input_result
|
|
@@ -327,6 +327,8 @@ def assign_default_value(
|
|
|
327
327
|
target_socket.default_value = t.Vector(input_val)
|
|
328
328
|
case bni.NodeDataType.FLOAT:
|
|
329
329
|
target_socket.default_value = float(input_val)
|
|
330
|
+
case bni.NodeDataType.INT:
|
|
331
|
+
target_socket.default_value = int(input_val)
|
|
330
332
|
case bni.NodeDataType.FLOAT_MATRIX:
|
|
331
333
|
# matrix values travel as numpy arrays in the compute graph;
|
|
332
334
|
# coerce back to mathutils.Matrix for bpy
|
|
@@ -6,7 +6,6 @@ from procfunc.nodes import types as nt
|
|
|
6
6
|
from procfunc.nodes.util.bindings_util import (
|
|
7
7
|
ContextualNode,
|
|
8
8
|
RuntimeResolveDataType,
|
|
9
|
-
raise_io_error,
|
|
10
9
|
)
|
|
11
10
|
from procfunc.nodes.util.bpy_node_info import NodeDataType
|
|
12
11
|
|
|
@@ -466,8 +465,6 @@ def input_bool(boolean: bool = False) -> t.ProcNode[bool]:
|
|
|
466
465
|
See: https://docs.blender.org/manual/en/4.2/modeling/geometry_nodes/input/constant/boolean.html
|
|
467
466
|
"""
|
|
468
467
|
|
|
469
|
-
raise_io_error("input_bool", logger=logger)
|
|
470
|
-
|
|
471
468
|
return t.ProcNode.from_nodetype(
|
|
472
469
|
node_type="FunctionNodeInputBool",
|
|
473
470
|
inputs={},
|
|
@@ -482,8 +479,6 @@ def input_color(value: tuple = (0.5, 0.5, 0.5, 1.0)) -> t.ProcNode[pt.Color]:
|
|
|
482
479
|
See: https://docs.blender.org/manual/en/4.2/modeling/geometry_nodes/input/constant/color.html
|
|
483
480
|
"""
|
|
484
481
|
|
|
485
|
-
raise_io_error("input_color", logger=logger)
|
|
486
|
-
|
|
487
482
|
return t.ProcNode.from_nodetype(
|
|
488
483
|
node_type="FunctionNodeInputColor",
|
|
489
484
|
inputs={},
|
|
@@ -498,8 +493,6 @@ def input_int(integer: int = 0) -> t.ProcNode[int]:
|
|
|
498
493
|
See: https://docs.blender.org/manual/en/4.2/modeling/geometry_nodes/input/constant/integer.html
|
|
499
494
|
"""
|
|
500
495
|
|
|
501
|
-
raise_io_error("input_int", logger=logger)
|
|
502
|
-
|
|
503
496
|
return t.ProcNode.from_nodetype(
|
|
504
497
|
node_type="FunctionNodeInputInt",
|
|
505
498
|
inputs={},
|
|
@@ -514,8 +507,6 @@ def input_rotation(rotation_euler: tuple = (0.0, 0.0, 0.0)) -> t.ProcNode[pt.Vec
|
|
|
514
507
|
See: https://docs.blender.org/manual/en/4.2/modeling/geometry_nodes/input/constant/rotation.html
|
|
515
508
|
"""
|
|
516
509
|
|
|
517
|
-
raise_io_error("input_rotation", logger=logger)
|
|
518
|
-
|
|
519
510
|
return t.ProcNode.from_nodetype(
|
|
520
511
|
node_type="FunctionNodeInputRotation",
|
|
521
512
|
inputs={},
|
|
@@ -536,8 +527,6 @@ def input_special_characters() -> InputSpecialCharactersResult:
|
|
|
536
527
|
See: https://docs.blender.org/manual/en/4.2/modeling/geometry_nodes/utilities/text/special_characters.html
|
|
537
528
|
"""
|
|
538
529
|
|
|
539
|
-
raise_io_error("input_special_characters", logger=logger)
|
|
540
|
-
|
|
541
530
|
node = nt.ProcNode.from_nodetype(
|
|
542
531
|
node_type="FunctionNodeInputSpecialCharacters",
|
|
543
532
|
inputs={},
|
|
@@ -555,8 +544,6 @@ def input_string(string: str = "") -> nt.ProcNode[str]:
|
|
|
555
544
|
See: https://docs.blender.org/manual/en/4.2/modeling/geometry_nodes/input/constant/string.html
|
|
556
545
|
"""
|
|
557
546
|
|
|
558
|
-
raise_io_error("input_string", logger=logger)
|
|
559
|
-
|
|
560
547
|
return nt.ProcNode.from_nodetype(
|
|
561
548
|
node_type="FunctionNodeInputString",
|
|
562
549
|
inputs={},
|
|
@@ -571,8 +558,6 @@ def input_vector(vector: tuple = (0.0, 0.0, 0.0)) -> nt.ProcNode[pt.Vector]:
|
|
|
571
558
|
See: https://docs.blender.org/manual/en/4.2/modeling/geometry_nodes/input/constant/vector.html
|
|
572
559
|
"""
|
|
573
560
|
|
|
574
|
-
raise_io_error("input_vector", logger=logger)
|
|
575
|
-
|
|
576
561
|
return nt.ProcNode.from_nodetype(
|
|
577
562
|
node_type="FunctionNodeInputVector",
|
|
578
563
|
inputs={},
|
|
@@ -4,7 +4,7 @@ from typing import Generic, Literal, NamedTuple, TypeVar
|
|
|
4
4
|
|
|
5
5
|
from procfunc import types as pt
|
|
6
6
|
from procfunc.nodes import types as nt
|
|
7
|
-
from procfunc.nodes.util.bindings_util import RuntimeResolveDataType
|
|
7
|
+
from procfunc.nodes.util.bindings_util import RuntimeResolveDataType
|
|
8
8
|
from procfunc.nodes.util.bpy_node_info import NodeDataType
|
|
9
9
|
from procfunc.util import pytree
|
|
10
10
|
|
|
@@ -491,22 +491,6 @@ def curve_endpoint_selection(
|
|
|
491
491
|
)
|
|
492
492
|
|
|
493
493
|
|
|
494
|
-
# def curve_handle_type_selection(
|
|
495
|
-
# handle_type: Literal["FREE", "AUTO", "VECTOR", "ALIGN"] = "AUTO",
|
|
496
|
-
# mode: Literal["LEFT", "RIGHT"] = "RIGHT",
|
|
497
|
-
# ) -> t.ProcNode:
|
|
498
|
-
# """
|
|
499
|
-
# Uses a CurveHandleTypeSelection Geometry Node.
|
|
500
|
-
#
|
|
501
|
-
# See: https://docs.blender.org/manual/en/4.2/modeling/geometry_nodes/curve/read/handle_type_selection.html
|
|
502
|
-
# """
|
|
503
|
-
# return t.ProcNode.from_nodetype(
|
|
504
|
-
# node_type="GeometryNodeCurveHandleTypeSelection",
|
|
505
|
-
# inputs={},
|
|
506
|
-
# attrs={"handle_type": handle_type, "mode": mode},
|
|
507
|
-
# )
|
|
508
|
-
|
|
509
|
-
|
|
510
494
|
def curve_length(curve: nt.ProcNode[pt.CurveObject] | None) -> nt.ProcNode[float]:
|
|
511
495
|
"""
|
|
512
496
|
Uses a CurveLength Geometry Node.
|
|
@@ -1636,8 +1620,6 @@ def input_active_camera() -> nt.ProcNode[pt.Object]:
|
|
|
1636
1620
|
|
|
1637
1621
|
See: https://docs.blender.org/manual/en/4.2/modeling/geometry_nodes/input/scene/active_camera.html
|
|
1638
1622
|
"""
|
|
1639
|
-
raise_io_error("input_active_camera", logger=logger)
|
|
1640
|
-
|
|
1641
1623
|
return nt.ProcNode.from_nodetype(
|
|
1642
1624
|
node_type="GeometryNodeInputActiveCamera",
|
|
1643
1625
|
inputs={},
|
|
@@ -1712,7 +1694,6 @@ def input_image(image: pt.Image | None = None) -> nt.ProcNode[pt.Image]:
|
|
|
1712
1694
|
See: https://docs.blender.org/manual/en/4.2/modeling/geometry_nodes/input/constant/image.html
|
|
1713
1695
|
"""
|
|
1714
1696
|
|
|
1715
|
-
raise_io_error("input_image", logger=logger)
|
|
1716
1697
|
return nt.ProcNode.from_nodetype(
|
|
1717
1698
|
node_type="GeometryNodeInputImage",
|
|
1718
1699
|
inputs={},
|
|
@@ -1765,8 +1746,6 @@ def input_material(material: pt.Material | None = None) -> nt.ProcNode[pt.Materi
|
|
|
1765
1746
|
|
|
1766
1747
|
See: https://docs.blender.org/manual/en/4.2/modeling/geometry_nodes/input/constant/material.html
|
|
1767
1748
|
"""
|
|
1768
|
-
raise_io_error("input_material", logger=logger)
|
|
1769
|
-
|
|
1770
1749
|
return nt.ProcNode.from_nodetype(
|
|
1771
1750
|
node_type="GeometryNodeInputMaterial",
|
|
1772
1751
|
inputs={},
|
|
@@ -2160,7 +2139,7 @@ def instance_transform() -> nt.ProcNode:
|
|
|
2160
2139
|
|
|
2161
2140
|
|
|
2162
2141
|
def instances_to_points(
|
|
2163
|
-
position: nt.SocketOrVal[nt.pt.Vector],
|
|
2142
|
+
position: nt.SocketOrVal[nt.pt.Vector] | None,
|
|
2164
2143
|
instances: nt.ProcNode[nt.Instances] | None,
|
|
2165
2144
|
selection: nt.SocketOrVal[bool] = True,
|
|
2166
2145
|
radius: nt.SocketOrVal[float] = 0.05,
|
|
@@ -2685,7 +2664,7 @@ def mesh_to_density_grid(
|
|
|
2685
2664
|
|
|
2686
2665
|
def mesh_to_points(
|
|
2687
2666
|
mesh: nt.ProcNode[pt.MeshObject] | None,
|
|
2688
|
-
position: nt.SocketOrVal[nt.pt.Vector],
|
|
2667
|
+
position: nt.SocketOrVal[nt.pt.Vector] | None = None,
|
|
2689
2668
|
selection: nt.SocketOrVal[bool] = True,
|
|
2690
2669
|
radius: nt.SocketOrVal[float] = 0.05,
|
|
2691
2670
|
mode: Literal["VERTICES", "EDGES", "FACES", "CORNERS"] = "VERTICES",
|
|
@@ -3480,7 +3459,7 @@ def sample_uv_surface(
|
|
|
3480
3459
|
def scale_elements(
|
|
3481
3460
|
geometry: nt.ProcNode[nt.Geometry] | None,
|
|
3482
3461
|
scale: nt.SocketOrVal[float],
|
|
3483
|
-
center: nt.SocketOrVal[nt.pt.Vector],
|
|
3462
|
+
center: nt.SocketOrVal[nt.pt.Vector] | None = None,
|
|
3484
3463
|
selection: nt.SocketOrVal[bool] = True,
|
|
3485
3464
|
axis: nt.SocketOrVal[nt.pt.Vector] | None = None,
|
|
3486
3465
|
domain: Literal["FACE", "EDGE"] = "FACE",
|
|
@@ -4465,32 +4444,6 @@ TViewer = TypeVar(
|
|
|
4465
4444
|
)
|
|
4466
4445
|
|
|
4467
4446
|
|
|
4468
|
-
# def viewer(
|
|
4469
|
-
# geometry: t.ProcNode[t.Geometry],
|
|
4470
|
-
# value: TViewer = 0,
|
|
4471
|
-
# domain: TDomain = "AUTO",
|
|
4472
|
-
# data_type: NodeDataType | RuntimeResolveDataType | None = None,
|
|
4473
|
-
# ) -> t.ProcNode:
|
|
4474
|
-
# """
|
|
4475
|
-
# Uses a Viewer Geometry Node.
|
|
4476
|
-
#
|
|
4477
|
-
# See: https://docs.blender.org/manual/en/4.2/modeling/geometry_nodes/output/viewer.html
|
|
4478
|
-
# """
|
|
4479
|
-
# if data_type is None:
|
|
4480
|
-
# data_type = RuntimeResolveDataType(
|
|
4481
|
-
# [NodeDataType.BOOLEAN, NodeDataType.INT, NodeDataType.FLOAT],
|
|
4482
|
-
# ["Value"],
|
|
4483
|
-
# )
|
|
4484
|
-
# return t.ProcNode.from_nodetype(
|
|
4485
|
-
# node_type="GeometryNodeViewer",
|
|
4486
|
-
# inputs={"Geometry": geometry, "Value": value},
|
|
4487
|
-
# attrs={
|
|
4488
|
-
# "domain": domain,
|
|
4489
|
-
# "data_type": data_type,
|
|
4490
|
-
# },
|
|
4491
|
-
# )
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
4447
|
class ViewportTransformResult(NamedTuple):
|
|
4495
4448
|
projection: nt.ProcNode
|
|
4496
4449
|
view: nt.ProcNode
|