procfunc 0.30.0__py3-none-any.whl
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/__init__.py +87 -0
- procfunc/color.py +57 -0
- procfunc/compute_graph/__init__.py +28 -0
- procfunc/compute_graph/compute_graph.py +115 -0
- procfunc/compute_graph/node.py +200 -0
- procfunc/compute_graph/operators_info.py +92 -0
- procfunc/compute_graph/proxy.py +173 -0
- procfunc/compute_graph/util.py +282 -0
- procfunc/context.py +115 -0
- procfunc/control.py +174 -0
- procfunc/nodes/__init__.py +66 -0
- procfunc/nodes/bindings_util.py +196 -0
- procfunc/nodes/bpy_node_info.py +280 -0
- procfunc/nodes/compositor.py +2242 -0
- procfunc/nodes/execute/construct_nodes.py +571 -0
- procfunc/nodes/execute/construct_special_cases.py +246 -0
- procfunc/nodes/execute/execute.py +548 -0
- procfunc/nodes/execute/infer_runtime_data_type.py +195 -0
- procfunc/nodes/execute/util.py +247 -0
- procfunc/nodes/func.py +1417 -0
- procfunc/nodes/geo.py +4240 -0
- procfunc/nodes/manifest.json +8769 -0
- procfunc/nodes/math.py +644 -0
- procfunc/nodes/node_function.py +160 -0
- procfunc/nodes/shader.py +2359 -0
- procfunc/nodes/types.py +347 -0
- procfunc/ops/__init__.py +35 -0
- procfunc/ops/_util.py +275 -0
- procfunc/ops/addons.py +59 -0
- procfunc/ops/attr.py +426 -0
- procfunc/ops/collection.py +90 -0
- procfunc/ops/curve.py +18 -0
- procfunc/ops/file.py +126 -0
- procfunc/ops/manifest.json +39149 -0
- procfunc/ops/mesh.py +1510 -0
- procfunc/ops/modifier.py +603 -0
- procfunc/ops/object.py +258 -0
- procfunc/ops/primitives/__init__.py +31 -0
- procfunc/ops/primitives/camera.py +45 -0
- procfunc/ops/primitives/curve.py +71 -0
- procfunc/ops/primitives/light.py +114 -0
- procfunc/ops/primitives/mesh.py +358 -0
- procfunc/ops/uv.py +271 -0
- procfunc/random.py +247 -0
- procfunc/tracer/__init__.py +43 -0
- procfunc/tracer/decorator.py +121 -0
- procfunc/tracer/patch.py +494 -0
- procfunc/tracer/proxy.py +127 -0
- procfunc/tracer/trace.py +222 -0
- procfunc/transforms/__init__.py +49 -0
- procfunc/transforms/cleanup.py +214 -0
- procfunc/transforms/convert.py +20 -0
- procfunc/transforms/distribution.py +191 -0
- procfunc/transforms/extract_materials.py +116 -0
- procfunc/transforms/infer_distribution.py +326 -0
- procfunc/transforms/parameters.py +15 -0
- procfunc/transforms/util.py +35 -0
- procfunc/transpiler/__init__.py +24 -0
- procfunc/transpiler/bpy_to_computegraph.py +1348 -0
- procfunc/transpiler/codegen.py +919 -0
- procfunc/transpiler/identifiers.py +595 -0
- procfunc/transpiler/main.py +299 -0
- procfunc/types.py +380 -0
- procfunc/util/__init__.py +0 -0
- procfunc/util/bpy_info.py +145 -0
- procfunc/util/camera.py +0 -0
- procfunc/util/keyframe.py +70 -0
- procfunc/util/log.py +96 -0
- procfunc/util/manifest.py +121 -0
- procfunc/util/pytree.py +343 -0
- procfunc/util/teardown.py +37 -0
- procfunc-0.30.0.dist-info/METADATA +120 -0
- procfunc-0.30.0.dist-info/RECORD +76 -0
- procfunc-0.30.0.dist-info/WHEEL +5 -0
- procfunc-0.30.0.dist-info/licenses/LICENSE.md +11 -0
- procfunc-0.30.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,2242 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Auto-generated Compositor Node bindings for Blender
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from typing import Any, Literal, NamedTuple
|
|
6
|
+
|
|
7
|
+
from procfunc import types as pt
|
|
8
|
+
from procfunc.nodes import types as nt
|
|
9
|
+
|
|
10
|
+
TColorSpace = Literal[
|
|
11
|
+
"ACES2065-1",
|
|
12
|
+
"ACEScg",
|
|
13
|
+
"AgX Base Display P3",
|
|
14
|
+
"AgX Base Rec.1886",
|
|
15
|
+
"AgX Base Rec.2020",
|
|
16
|
+
"AgX Base sRGB",
|
|
17
|
+
"AgX Log",
|
|
18
|
+
"Display P3",
|
|
19
|
+
"Filmic Log",
|
|
20
|
+
"Filmic sRGB",
|
|
21
|
+
"Khronos PBR Neutral sRGB",
|
|
22
|
+
"Linear CIE-XYZ D65",
|
|
23
|
+
"Linear CIE-XYZ E",
|
|
24
|
+
"Linear DCI-P3 D65",
|
|
25
|
+
"Linear FilmLight E-Gamut",
|
|
26
|
+
"Linear Rec.2020",
|
|
27
|
+
"Linear Rec.709",
|
|
28
|
+
"Non-Color",
|
|
29
|
+
"Rec.1886",
|
|
30
|
+
"Rec.2020",
|
|
31
|
+
"sRGB",
|
|
32
|
+
]
|
|
33
|
+
TBlendType = Literal[
|
|
34
|
+
"MIX",
|
|
35
|
+
"DARKEN",
|
|
36
|
+
"MULTIPLY",
|
|
37
|
+
"BURN",
|
|
38
|
+
"LIGHTEN",
|
|
39
|
+
"SCREEN",
|
|
40
|
+
"DODGE",
|
|
41
|
+
"ADD",
|
|
42
|
+
"OVERLAY",
|
|
43
|
+
"SOFT_LIGHT",
|
|
44
|
+
"LINEAR_LIGHT",
|
|
45
|
+
"DIFFERENCE",
|
|
46
|
+
"EXCLUSION",
|
|
47
|
+
"SUBTRACT",
|
|
48
|
+
"DIVIDE",
|
|
49
|
+
"HUE",
|
|
50
|
+
"SATURATION",
|
|
51
|
+
"COLOR",
|
|
52
|
+
"VALUE",
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class RenderLayersResult:
|
|
57
|
+
# TODO: ban RenderLayersResult and make all compositiors just be functions with certain values as inputs
|
|
58
|
+
|
|
59
|
+
def __init__(self, base: nt.ProcNode):
|
|
60
|
+
self.base = base
|
|
61
|
+
|
|
62
|
+
def __getattr__(self, name: str) -> nt.ProcNode:
|
|
63
|
+
base = object.__getattribute__(self, "base")
|
|
64
|
+
return base._output_socket(name)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
# Manual
|
|
68
|
+
def render_layers() -> RenderLayersResult:
|
|
69
|
+
"""
|
|
70
|
+
Uses a RenderLayers Compositor Node.
|
|
71
|
+
|
|
72
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/input/scene/render_layers.html
|
|
73
|
+
"""
|
|
74
|
+
res = nt.ProcNode.from_nodetype(
|
|
75
|
+
node_type="CompositorNodeRLayers", # dont change, this is the actual name of the node
|
|
76
|
+
inputs={},
|
|
77
|
+
attrs={},
|
|
78
|
+
)
|
|
79
|
+
return RenderLayersResult(res)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def alpha_over(
|
|
83
|
+
fac: nt.SocketOrVal[float] = 1.0,
|
|
84
|
+
image_0: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
85
|
+
image_1: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
86
|
+
premul: float = 0.0,
|
|
87
|
+
use_premultiply: bool = False,
|
|
88
|
+
) -> nt.ProcNode:
|
|
89
|
+
"""
|
|
90
|
+
Uses a AlphaOver Compositor Node.
|
|
91
|
+
|
|
92
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/color/mix/alpha_over.html
|
|
93
|
+
"""
|
|
94
|
+
return nt.ProcNode.from_nodetype(
|
|
95
|
+
node_type="CompositorNodeAlphaOver",
|
|
96
|
+
inputs={"Fac": fac, ("Image", 0): image_0, ("Image", 1): image_1},
|
|
97
|
+
attrs={"premul": premul, "use_premultiply": use_premultiply},
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def anti_aliasing(
|
|
102
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
103
|
+
contrast_limit: float = 0.2,
|
|
104
|
+
corner_rounding: float = 0.25,
|
|
105
|
+
threshold: float = 1.0,
|
|
106
|
+
) -> nt.ProcNode:
|
|
107
|
+
"""
|
|
108
|
+
Uses a AntiAliasing Compositor Node.
|
|
109
|
+
|
|
110
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/filter/anti_aliasing.html
|
|
111
|
+
"""
|
|
112
|
+
return nt.ProcNode.from_nodetype(
|
|
113
|
+
node_type="CompositorNodeAntiAliasing",
|
|
114
|
+
inputs={"Image": image},
|
|
115
|
+
attrs={
|
|
116
|
+
"contrast_limit": contrast_limit,
|
|
117
|
+
"corner_rounding": corner_rounding,
|
|
118
|
+
"threshold": threshold,
|
|
119
|
+
},
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def bilateralblur(
|
|
124
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
125
|
+
determinator: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
126
|
+
iterations: int = 1,
|
|
127
|
+
sigma_color: float = 0.3,
|
|
128
|
+
sigma_space: float = 5.0,
|
|
129
|
+
) -> nt.ProcNode:
|
|
130
|
+
"""
|
|
131
|
+
Uses a Bilateralblur Compositor Node.
|
|
132
|
+
|
|
133
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/filter/blur/bilateral_blur.html
|
|
134
|
+
"""
|
|
135
|
+
return nt.ProcNode.from_nodetype(
|
|
136
|
+
node_type="CompositorNodeBilateralblur",
|
|
137
|
+
inputs={"Image": image, "Determinator": determinator},
|
|
138
|
+
attrs={
|
|
139
|
+
"iterations": iterations,
|
|
140
|
+
"sigma_color": sigma_color,
|
|
141
|
+
"sigma_space": sigma_space,
|
|
142
|
+
},
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def blur(
|
|
147
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
148
|
+
size: nt.SocketOrVal[float] = 1.0,
|
|
149
|
+
aspect_correction: Literal["NONE", "Y", "X"] = "NONE",
|
|
150
|
+
factor: float = 0.0,
|
|
151
|
+
factor_x: float = 0.0,
|
|
152
|
+
factor_y: float = 0.0,
|
|
153
|
+
filter_type: Literal[
|
|
154
|
+
"FLAT", "TENT", "QUAD", "CUBIC", "GAUSS", "FAST_GAUSS", "CATROM", "MITCH"
|
|
155
|
+
] = "GAUSS",
|
|
156
|
+
size_x: int = 0,
|
|
157
|
+
size_y: int = 0,
|
|
158
|
+
use_bokeh: bool = False,
|
|
159
|
+
use_extended_bounds: bool = False,
|
|
160
|
+
use_gamma_correction: bool = False,
|
|
161
|
+
use_relative: bool = False,
|
|
162
|
+
use_variable_size: bool = False,
|
|
163
|
+
) -> nt.ProcNode:
|
|
164
|
+
"""
|
|
165
|
+
Uses a Blur Compositor Node.
|
|
166
|
+
|
|
167
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/filter/blur/blur.html
|
|
168
|
+
"""
|
|
169
|
+
return nt.ProcNode.from_nodetype(
|
|
170
|
+
node_type="CompositorNodeBlur",
|
|
171
|
+
inputs={"Image": image, "Size": size},
|
|
172
|
+
attrs={
|
|
173
|
+
"aspect_correction": aspect_correction,
|
|
174
|
+
"factor": factor,
|
|
175
|
+
"factor_x": factor_x,
|
|
176
|
+
"factor_y": factor_y,
|
|
177
|
+
"filter_type": filter_type,
|
|
178
|
+
"size_x": size_x,
|
|
179
|
+
"size_y": size_y,
|
|
180
|
+
"use_bokeh": use_bokeh,
|
|
181
|
+
"use_extended_bounds": use_extended_bounds,
|
|
182
|
+
"use_gamma_correction": use_gamma_correction,
|
|
183
|
+
"use_relative": use_relative,
|
|
184
|
+
"use_variable_size": use_variable_size,
|
|
185
|
+
},
|
|
186
|
+
)
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
def bokeh_blur(
|
|
190
|
+
image: nt.SocketOrVal[pt.Color] = (0.8, 0.8, 0.8, 1),
|
|
191
|
+
bokeh: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
192
|
+
size: nt.SocketOrVal[float] = 1.0,
|
|
193
|
+
bounding_box: nt.SocketOrVal[float] = 1.0,
|
|
194
|
+
blur_max: float = 16.0,
|
|
195
|
+
use_extended_bounds: bool = False,
|
|
196
|
+
use_variable_size: bool = False,
|
|
197
|
+
) -> nt.ProcNode:
|
|
198
|
+
"""
|
|
199
|
+
Uses a BokehBlur Compositor Node.
|
|
200
|
+
|
|
201
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/filter/blur/bokeh_blur.html
|
|
202
|
+
"""
|
|
203
|
+
return nt.ProcNode.from_nodetype(
|
|
204
|
+
node_type="CompositorNodeBokehBlur",
|
|
205
|
+
inputs={
|
|
206
|
+
"Image": image,
|
|
207
|
+
"Bokeh": bokeh,
|
|
208
|
+
"Size": size,
|
|
209
|
+
"Bounding box": bounding_box,
|
|
210
|
+
},
|
|
211
|
+
attrs={
|
|
212
|
+
"blur_max": blur_max,
|
|
213
|
+
"use_extended_bounds": use_extended_bounds,
|
|
214
|
+
"use_variable_size": use_variable_size,
|
|
215
|
+
},
|
|
216
|
+
)
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
def bokeh_image(
|
|
220
|
+
angle: float = 0.0,
|
|
221
|
+
catadioptric: float = 0.0,
|
|
222
|
+
flaps: int = 5,
|
|
223
|
+
rounding: float = 0.0,
|
|
224
|
+
shift: float = 0.0,
|
|
225
|
+
) -> nt.ProcNode:
|
|
226
|
+
"""
|
|
227
|
+
Uses a BokehImage Compositor Node.
|
|
228
|
+
|
|
229
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/input/bokeh_image.html
|
|
230
|
+
"""
|
|
231
|
+
return nt.ProcNode.from_nodetype(
|
|
232
|
+
node_type="CompositorNodeBokehImage",
|
|
233
|
+
inputs={},
|
|
234
|
+
attrs={
|
|
235
|
+
"angle": angle,
|
|
236
|
+
"catadioptric": catadioptric,
|
|
237
|
+
"flaps": flaps,
|
|
238
|
+
"rounding": rounding,
|
|
239
|
+
"shift": shift,
|
|
240
|
+
},
|
|
241
|
+
)
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
def box_mask(
|
|
245
|
+
mask: nt.SocketOrVal[float] = 0.0,
|
|
246
|
+
value: nt.SocketOrVal[float] = 1.0,
|
|
247
|
+
mask_height: float = 0.1,
|
|
248
|
+
mask_type: Literal["ADD", "SUBTRACT", "MULTIPLY", "NOT"] = "ADD",
|
|
249
|
+
mask_width: float = 0.2,
|
|
250
|
+
rotation: float = 0.0,
|
|
251
|
+
x: float = 0.5,
|
|
252
|
+
y: float = 0.5,
|
|
253
|
+
) -> nt.ProcNode:
|
|
254
|
+
"""
|
|
255
|
+
Uses a BoxMask Compositor Node.
|
|
256
|
+
|
|
257
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/mask/box_mask.html
|
|
258
|
+
"""
|
|
259
|
+
return nt.ProcNode.from_nodetype(
|
|
260
|
+
node_type="CompositorNodeBoxMask",
|
|
261
|
+
inputs={"Mask": mask, "Value": value},
|
|
262
|
+
attrs={
|
|
263
|
+
"mask_height": mask_height,
|
|
264
|
+
"mask_type": mask_type,
|
|
265
|
+
"mask_width": mask_width,
|
|
266
|
+
"rotation": rotation,
|
|
267
|
+
"x": x,
|
|
268
|
+
"y": y,
|
|
269
|
+
},
|
|
270
|
+
)
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
def bright_contrast(
|
|
274
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
275
|
+
bright: nt.SocketOrVal[float] = 0.0,
|
|
276
|
+
contrast: nt.SocketOrVal[float] = 0.0,
|
|
277
|
+
use_premultiply: bool = True,
|
|
278
|
+
) -> nt.ProcNode:
|
|
279
|
+
"""
|
|
280
|
+
Uses a BrightContrast Compositor Node.
|
|
281
|
+
|
|
282
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/color/adjust/bright_contrast.html
|
|
283
|
+
"""
|
|
284
|
+
return nt.ProcNode.from_nodetype(
|
|
285
|
+
node_type="CompositorNodeBrightContrast",
|
|
286
|
+
inputs={"Image": image, "Bright": bright, "Contrast": contrast},
|
|
287
|
+
attrs={"use_premultiply": use_premultiply},
|
|
288
|
+
)
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
def channel_matte(
|
|
292
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
293
|
+
color_space: Literal["RGB", "HSV", "YUV", "YCC"] = "RGB",
|
|
294
|
+
limit_channel: Literal["R", "G", "B"] = "R",
|
|
295
|
+
limit_max: float = 1.0,
|
|
296
|
+
limit_method: Literal["SINGLE", "MAX"] = "MAX",
|
|
297
|
+
limit_min: float = 0.0,
|
|
298
|
+
matte_channel: Literal["R", "G", "B"] = "G",
|
|
299
|
+
) -> nt.ProcNode:
|
|
300
|
+
"""
|
|
301
|
+
Uses a ChannelMatte Compositor Node.
|
|
302
|
+
|
|
303
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/keying/channel_key.html
|
|
304
|
+
"""
|
|
305
|
+
return nt.ProcNode.from_nodetype(
|
|
306
|
+
node_type="CompositorNodeChannelMatte",
|
|
307
|
+
inputs={"Image": image},
|
|
308
|
+
attrs={
|
|
309
|
+
"color_space": color_space,
|
|
310
|
+
"limit_channel": limit_channel,
|
|
311
|
+
"limit_max": limit_max,
|
|
312
|
+
"limit_method": limit_method,
|
|
313
|
+
"limit_min": limit_min,
|
|
314
|
+
"matte_channel": matte_channel,
|
|
315
|
+
},
|
|
316
|
+
)
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
def chroma_matte(
|
|
320
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
321
|
+
key_color: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
322
|
+
gain: float = 1.0,
|
|
323
|
+
lift: float = 0.0,
|
|
324
|
+
shadow_adjust: float = 0.0,
|
|
325
|
+
threshold: float = 0.174533,
|
|
326
|
+
tolerance: float = 0.523599,
|
|
327
|
+
) -> nt.ProcNode:
|
|
328
|
+
"""
|
|
329
|
+
Uses a ChromaMatte Compositor Node.
|
|
330
|
+
|
|
331
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/keying/chroma_key.html
|
|
332
|
+
"""
|
|
333
|
+
return nt.ProcNode.from_nodetype(
|
|
334
|
+
node_type="CompositorNodeChromaMatte",
|
|
335
|
+
inputs={"Image": image, "Key Color": key_color},
|
|
336
|
+
attrs={
|
|
337
|
+
"gain": gain,
|
|
338
|
+
"lift": lift,
|
|
339
|
+
"shadow_adjust": shadow_adjust,
|
|
340
|
+
"threshold": threshold,
|
|
341
|
+
"tolerance": tolerance,
|
|
342
|
+
},
|
|
343
|
+
)
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
def color_balance(
|
|
347
|
+
fac: nt.SocketOrVal[float] = 1.0,
|
|
348
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
349
|
+
correction_method: Literal[
|
|
350
|
+
"LIFT_GAMMA_GAIN", "OFFSET_POWER_SLOPE"
|
|
351
|
+
] = "LIFT_GAMMA_GAIN",
|
|
352
|
+
gain: tuple = (1.0, 1.0, 1.0),
|
|
353
|
+
gamma: tuple = (1.0, 1.0, 1.0),
|
|
354
|
+
lift: tuple = (1.0, 1.0, 1.0),
|
|
355
|
+
offset: tuple = (0.0, 0.0, 0.0),
|
|
356
|
+
offset_basis: float = 0.0,
|
|
357
|
+
power: tuple = (1.0, 1.0, 1.0),
|
|
358
|
+
slope: tuple = (1.0, 1.0, 1.0),
|
|
359
|
+
) -> nt.ProcNode:
|
|
360
|
+
"""
|
|
361
|
+
Uses a ColorBalance Compositor Node.
|
|
362
|
+
|
|
363
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/color/adjust/color_balance.html
|
|
364
|
+
"""
|
|
365
|
+
return nt.ProcNode.from_nodetype(
|
|
366
|
+
node_type="CompositorNodeColorBalance",
|
|
367
|
+
inputs={"Fac": fac, "Image": image},
|
|
368
|
+
attrs={
|
|
369
|
+
"correction_method": correction_method,
|
|
370
|
+
"gain": gain,
|
|
371
|
+
"gamma": gamma,
|
|
372
|
+
"lift": lift,
|
|
373
|
+
"offset": offset,
|
|
374
|
+
"offset_basis": offset_basis,
|
|
375
|
+
"power": power,
|
|
376
|
+
"slope": slope,
|
|
377
|
+
},
|
|
378
|
+
)
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
def color_correction(
|
|
382
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
383
|
+
mask: nt.SocketOrVal[float] = 1.0,
|
|
384
|
+
blue: bool = True,
|
|
385
|
+
green: bool = True,
|
|
386
|
+
highlights_contrast: float = 1.0,
|
|
387
|
+
highlights_gain: float = 1.0,
|
|
388
|
+
highlights_gamma: float = 1.0,
|
|
389
|
+
highlights_lift: float = 0.0,
|
|
390
|
+
highlights_saturation: float = 1.0,
|
|
391
|
+
master_contrast: float = 1.0,
|
|
392
|
+
master_gain: float = 1.0,
|
|
393
|
+
master_gamma: float = 1.0,
|
|
394
|
+
master_lift: float = 0.0,
|
|
395
|
+
master_saturation: float = 1.0,
|
|
396
|
+
midtones_contrast: float = 1.0,
|
|
397
|
+
midtones_end: float = 0.7,
|
|
398
|
+
midtones_gain: float = 1.0,
|
|
399
|
+
midtones_gamma: float = 1.0,
|
|
400
|
+
midtones_lift: float = 0.0,
|
|
401
|
+
midtones_saturation: float = 1.0,
|
|
402
|
+
midtones_start: float = 0.2,
|
|
403
|
+
red: bool = True,
|
|
404
|
+
shadows_contrast: float = 1.0,
|
|
405
|
+
shadows_gain: float = 1.0,
|
|
406
|
+
shadows_gamma: float = 1.0,
|
|
407
|
+
shadows_lift: float = 0.0,
|
|
408
|
+
shadows_saturation: float = 1.0,
|
|
409
|
+
) -> nt.ProcNode:
|
|
410
|
+
"""
|
|
411
|
+
Uses a ColorCorrection Compositor Node.
|
|
412
|
+
|
|
413
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/color/adjust/color_correction.html
|
|
414
|
+
"""
|
|
415
|
+
return nt.ProcNode.from_nodetype(
|
|
416
|
+
node_type="CompositorNodeColorCorrection",
|
|
417
|
+
inputs={"Image": image, "Mask": mask},
|
|
418
|
+
attrs={
|
|
419
|
+
"blue": blue,
|
|
420
|
+
"green": green,
|
|
421
|
+
"highlights_contrast": highlights_contrast,
|
|
422
|
+
"highlights_gain": highlights_gain,
|
|
423
|
+
"highlights_gamma": highlights_gamma,
|
|
424
|
+
"highlights_lift": highlights_lift,
|
|
425
|
+
"highlights_saturation": highlights_saturation,
|
|
426
|
+
"master_contrast": master_contrast,
|
|
427
|
+
"master_gain": master_gain,
|
|
428
|
+
"master_gamma": master_gamma,
|
|
429
|
+
"master_lift": master_lift,
|
|
430
|
+
"master_saturation": master_saturation,
|
|
431
|
+
"midtones_contrast": midtones_contrast,
|
|
432
|
+
"midtones_end": midtones_end,
|
|
433
|
+
"midtones_gain": midtones_gain,
|
|
434
|
+
"midtones_gamma": midtones_gamma,
|
|
435
|
+
"midtones_lift": midtones_lift,
|
|
436
|
+
"midtones_saturation": midtones_saturation,
|
|
437
|
+
"midtones_start": midtones_start,
|
|
438
|
+
"red": red,
|
|
439
|
+
"shadows_contrast": shadows_contrast,
|
|
440
|
+
"shadows_gain": shadows_gain,
|
|
441
|
+
"shadows_gamma": shadows_gamma,
|
|
442
|
+
"shadows_lift": shadows_lift,
|
|
443
|
+
"shadows_saturation": shadows_saturation,
|
|
444
|
+
},
|
|
445
|
+
)
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
def color_matte(
|
|
449
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
450
|
+
key_color: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
451
|
+
color_hue: float = 0.01,
|
|
452
|
+
color_saturation: float = 0.1,
|
|
453
|
+
color_value: float = 0.1,
|
|
454
|
+
) -> nt.ProcNode:
|
|
455
|
+
"""
|
|
456
|
+
Uses a ColorMatte Compositor Node.
|
|
457
|
+
|
|
458
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/keying/color_key.html
|
|
459
|
+
"""
|
|
460
|
+
return nt.ProcNode.from_nodetype(
|
|
461
|
+
node_type="CompositorNodeColorMatte",
|
|
462
|
+
inputs={"Image": image, "Key Color": key_color},
|
|
463
|
+
attrs={
|
|
464
|
+
"color_hue": color_hue,
|
|
465
|
+
"color_saturation": color_saturation,
|
|
466
|
+
"color_value": color_value,
|
|
467
|
+
},
|
|
468
|
+
)
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
def color_spill(
|
|
472
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
473
|
+
fac: nt.SocketOrVal[float] = 1.0,
|
|
474
|
+
channel: Literal["R", "G", "B"] = "G",
|
|
475
|
+
limit_channel: Literal["R", "G", "B"] = "R",
|
|
476
|
+
limit_method: Literal["SIMPLE", "AVERAGE"] = "SIMPLE",
|
|
477
|
+
ratio: float = 1.0,
|
|
478
|
+
unspill_blue: float = 0.0,
|
|
479
|
+
unspill_green: float = 0.0,
|
|
480
|
+
unspill_red: float = 0.0,
|
|
481
|
+
use_unspill: bool = False,
|
|
482
|
+
) -> nt.ProcNode:
|
|
483
|
+
"""
|
|
484
|
+
Uses a ColorSpill Compositor Node.
|
|
485
|
+
|
|
486
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/keying/color_spill.html
|
|
487
|
+
"""
|
|
488
|
+
return nt.ProcNode.from_nodetype(
|
|
489
|
+
node_type="CompositorNodeColorSpill",
|
|
490
|
+
inputs={"Image": image, "Fac": fac},
|
|
491
|
+
attrs={
|
|
492
|
+
"channel": channel,
|
|
493
|
+
"limit_channel": limit_channel,
|
|
494
|
+
"limit_method": limit_method,
|
|
495
|
+
"ratio": ratio,
|
|
496
|
+
"unspill_blue": unspill_blue,
|
|
497
|
+
"unspill_green": unspill_green,
|
|
498
|
+
"unspill_red": unspill_red,
|
|
499
|
+
"use_unspill": use_unspill,
|
|
500
|
+
},
|
|
501
|
+
)
|
|
502
|
+
|
|
503
|
+
|
|
504
|
+
def comb_hsva(
|
|
505
|
+
h: nt.SocketOrVal[float] = 0.0,
|
|
506
|
+
s: nt.SocketOrVal[float] = 0.0,
|
|
507
|
+
v: nt.SocketOrVal[float] = 0.0,
|
|
508
|
+
a: nt.SocketOrVal[float] = 1.0,
|
|
509
|
+
) -> nt.ProcNode:
|
|
510
|
+
"""
|
|
511
|
+
Uses a CombHSVA Compositor Node.
|
|
512
|
+
|
|
513
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/color/mix/combine_color.html
|
|
514
|
+
"""
|
|
515
|
+
return nt.ProcNode.from_nodetype(
|
|
516
|
+
node_type="CompositorNodeCombHSVA",
|
|
517
|
+
inputs={"H": h, "S": s, "V": v, "A": a},
|
|
518
|
+
attrs={},
|
|
519
|
+
)
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
def comb_rgba(
|
|
523
|
+
r: nt.SocketOrVal[float] = 0.0,
|
|
524
|
+
g: nt.SocketOrVal[float] = 0.0,
|
|
525
|
+
b: nt.SocketOrVal[float] = 0.0,
|
|
526
|
+
a: nt.SocketOrVal[float] = 1.0,
|
|
527
|
+
) -> nt.ProcNode:
|
|
528
|
+
"""
|
|
529
|
+
Uses a CombRGBA Compositor Node.
|
|
530
|
+
|
|
531
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/color/mix/combine_color.html
|
|
532
|
+
"""
|
|
533
|
+
return nt.ProcNode.from_nodetype(
|
|
534
|
+
node_type="CompositorNodeCombRGBA",
|
|
535
|
+
inputs={"R": r, "G": g, "B": b, "A": a},
|
|
536
|
+
attrs={},
|
|
537
|
+
)
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
def comb_ycca(
|
|
541
|
+
y: nt.SocketOrVal[float] = 0.0,
|
|
542
|
+
cb: nt.SocketOrVal[float] = 0.5,
|
|
543
|
+
cr: nt.SocketOrVal[float] = 0.5,
|
|
544
|
+
a: nt.SocketOrVal[float] = 1.0,
|
|
545
|
+
mode: Literal["ITUBT601", "ITUBT709", "JFIF"] = "ITUBT709",
|
|
546
|
+
) -> nt.ProcNode:
|
|
547
|
+
"""
|
|
548
|
+
Uses a CombYCCA Compositor Node.
|
|
549
|
+
|
|
550
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/color/mix/combine_color.html
|
|
551
|
+
"""
|
|
552
|
+
return nt.ProcNode.from_nodetype(
|
|
553
|
+
node_type="CompositorNodeCombYCCA",
|
|
554
|
+
inputs={"Y": y, "Cb": cb, "Cr": cr, "A": a},
|
|
555
|
+
attrs={"mode": mode},
|
|
556
|
+
)
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+
def comb_yuva(
|
|
560
|
+
y: nt.SocketOrVal[float] = 0.0,
|
|
561
|
+
u: nt.SocketOrVal[float] = 0.0,
|
|
562
|
+
v: nt.SocketOrVal[float] = 0.0,
|
|
563
|
+
a: nt.SocketOrVal[float] = 1.0,
|
|
564
|
+
) -> nt.ProcNode:
|
|
565
|
+
"""
|
|
566
|
+
Uses a CombYUVA Compositor Node.
|
|
567
|
+
|
|
568
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/color/mix/combine_color.html
|
|
569
|
+
"""
|
|
570
|
+
return nt.ProcNode.from_nodetype(
|
|
571
|
+
node_type="CompositorNodeCombYUVA",
|
|
572
|
+
inputs={"Y": y, "U": u, "V": v, "A": a},
|
|
573
|
+
attrs={},
|
|
574
|
+
)
|
|
575
|
+
|
|
576
|
+
|
|
577
|
+
def combine_color(
|
|
578
|
+
red: nt.SocketOrVal[float] = 0.0,
|
|
579
|
+
green: nt.SocketOrVal[float] = 0.0,
|
|
580
|
+
blue: nt.SocketOrVal[float] = 0.0,
|
|
581
|
+
alpha: nt.SocketOrVal[float] = 1.0,
|
|
582
|
+
mode: Literal["RGB", "HSV", "HSL", "YCC", "YUV"] = "RGB",
|
|
583
|
+
ycc_mode: Literal["ITUBT601", "ITUBT709", "JFIF"] = "ITUBT709",
|
|
584
|
+
) -> nt.ProcNode:
|
|
585
|
+
"""
|
|
586
|
+
Uses a CombineColor Compositor Node.
|
|
587
|
+
|
|
588
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/color/mix/combine_color.html
|
|
589
|
+
"""
|
|
590
|
+
return nt.ProcNode.from_nodetype(
|
|
591
|
+
node_type="CompositorNodeCombineColor",
|
|
592
|
+
inputs={"Red": red, "Green": green, "Blue": blue, "Alpha": alpha},
|
|
593
|
+
attrs={"mode": mode, "ycc_mode": ycc_mode},
|
|
594
|
+
)
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
def combine_xyz(
|
|
598
|
+
x: nt.SocketOrVal[float] = 0.0,
|
|
599
|
+
y: nt.SocketOrVal[float] = 0.0,
|
|
600
|
+
z: nt.SocketOrVal[float] = 0.0,
|
|
601
|
+
) -> nt.ProcNode:
|
|
602
|
+
"""
|
|
603
|
+
Uses a CombineXYZ Compositor Node.
|
|
604
|
+
|
|
605
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/vector/combine_xyz.html
|
|
606
|
+
"""
|
|
607
|
+
return nt.ProcNode.from_nodetype(
|
|
608
|
+
node_type="CompositorNodeCombineXYZ",
|
|
609
|
+
inputs={"X": x, "Y": y, "Z": z},
|
|
610
|
+
attrs={},
|
|
611
|
+
)
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
def composite(
|
|
615
|
+
image: nt.SocketOrVal[pt.Color] = (0, 0, 0, 1),
|
|
616
|
+
alpha: nt.SocketOrVal[float] = 1.0,
|
|
617
|
+
use_alpha: bool = True,
|
|
618
|
+
) -> nt.ProcNode:
|
|
619
|
+
"""
|
|
620
|
+
Uses a Composite Compositor Node.
|
|
621
|
+
|
|
622
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/output/composite.html
|
|
623
|
+
"""
|
|
624
|
+
return nt.ProcNode.from_nodetype(
|
|
625
|
+
node_type="CompositorNodeComposite",
|
|
626
|
+
inputs={"Image": image, "Alpha": alpha},
|
|
627
|
+
attrs={"use_alpha": use_alpha},
|
|
628
|
+
)
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
def convert_color_space(
|
|
632
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
633
|
+
from_color_space: TColorSpace = "Linear Rec.709",
|
|
634
|
+
to_color_space: TColorSpace = "Linear Rec.709",
|
|
635
|
+
) -> nt.ProcNode:
|
|
636
|
+
"""
|
|
637
|
+
Uses a ConvertColorSpace Compositor Node.
|
|
638
|
+
|
|
639
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/color/convert_colorspace.html
|
|
640
|
+
"""
|
|
641
|
+
return nt.ProcNode.from_nodetype(
|
|
642
|
+
node_type="CompositorNodeConvertColorSpace",
|
|
643
|
+
inputs={"Image": image},
|
|
644
|
+
attrs={"from_color_space": from_color_space, "to_color_space": to_color_space},
|
|
645
|
+
)
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
def corner_pin(
|
|
649
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
650
|
+
upper_left: nt.SocketOrVal[pt.Vector] = (0, 1, 0),
|
|
651
|
+
upper_right: nt.SocketOrVal[pt.Vector] = (1, 1, 0),
|
|
652
|
+
lower_left: nt.SocketOrVal[pt.Vector] = (0, 0, 0),
|
|
653
|
+
lower_right: nt.SocketOrVal[pt.Vector] = (1, 0, 0),
|
|
654
|
+
) -> nt.ProcNode:
|
|
655
|
+
"""
|
|
656
|
+
Uses a CornerPin Compositor Node.
|
|
657
|
+
|
|
658
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/transform/corner_pin.html
|
|
659
|
+
"""
|
|
660
|
+
return nt.ProcNode.from_nodetype(
|
|
661
|
+
node_type="CompositorNodeCornerPin",
|
|
662
|
+
inputs={
|
|
663
|
+
"Image": image,
|
|
664
|
+
"Upper Left": upper_left,
|
|
665
|
+
"Upper Right": upper_right,
|
|
666
|
+
"Lower Left": lower_left,
|
|
667
|
+
"Lower Right": lower_right,
|
|
668
|
+
},
|
|
669
|
+
attrs={},
|
|
670
|
+
)
|
|
671
|
+
|
|
672
|
+
|
|
673
|
+
def crop(
|
|
674
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
675
|
+
max_x: int = 0,
|
|
676
|
+
max_y: int = 0,
|
|
677
|
+
min_x: int = 0,
|
|
678
|
+
min_y: int = 0,
|
|
679
|
+
rel_max_x: float = 0.0,
|
|
680
|
+
rel_max_y: float = 0.0,
|
|
681
|
+
rel_min_x: float = 0.0,
|
|
682
|
+
rel_min_y: float = 0.0,
|
|
683
|
+
relative: bool = False,
|
|
684
|
+
use_crop_size: bool = False,
|
|
685
|
+
) -> nt.ProcNode:
|
|
686
|
+
"""
|
|
687
|
+
Uses a Crop Compositor Node.
|
|
688
|
+
|
|
689
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/transform/crop.html
|
|
690
|
+
"""
|
|
691
|
+
return nt.ProcNode.from_nodetype(
|
|
692
|
+
node_type="CompositorNodeCrop",
|
|
693
|
+
inputs={"Image": image},
|
|
694
|
+
attrs={
|
|
695
|
+
"max_x": max_x,
|
|
696
|
+
"max_y": max_y,
|
|
697
|
+
"min_x": min_x,
|
|
698
|
+
"min_y": min_y,
|
|
699
|
+
"rel_max_x": rel_max_x,
|
|
700
|
+
"rel_max_y": rel_max_y,
|
|
701
|
+
"rel_min_x": rel_min_x,
|
|
702
|
+
"rel_min_y": rel_min_y,
|
|
703
|
+
"relative": relative,
|
|
704
|
+
"use_crop_size": use_crop_size,
|
|
705
|
+
},
|
|
706
|
+
)
|
|
707
|
+
|
|
708
|
+
|
|
709
|
+
def cryptomatte(
|
|
710
|
+
image: nt.SocketOrVal[pt.Color] = (0, 0, 0, 1),
|
|
711
|
+
crypto_00: nt.SocketOrVal[pt.Color] = (0, 0, 0, 1),
|
|
712
|
+
crypto_01: nt.SocketOrVal[pt.Color] = (0, 0, 0, 1),
|
|
713
|
+
crypto_02: nt.SocketOrVal[pt.Color] = (0, 0, 0, 1),
|
|
714
|
+
add: tuple = (0.0, 0.0, 0.0),
|
|
715
|
+
matte_id: str = "",
|
|
716
|
+
remove: tuple = (0.0, 0.0, 0.0),
|
|
717
|
+
) -> nt.ProcNode:
|
|
718
|
+
"""
|
|
719
|
+
Uses a Cryptomatte Compositor Node.
|
|
720
|
+
|
|
721
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/mask/cryptomatte.html
|
|
722
|
+
"""
|
|
723
|
+
return nt.ProcNode.from_nodetype(
|
|
724
|
+
node_type="CompositorNodeCryptomatte",
|
|
725
|
+
inputs={
|
|
726
|
+
"Image": image,
|
|
727
|
+
"Crypto 00": crypto_00,
|
|
728
|
+
"Crypto 01": crypto_01,
|
|
729
|
+
"Crypto 02": crypto_02,
|
|
730
|
+
},
|
|
731
|
+
attrs={"add": add, "matte_id": matte_id, "remove": remove},
|
|
732
|
+
)
|
|
733
|
+
|
|
734
|
+
|
|
735
|
+
def curve_rgb(
|
|
736
|
+
fac: nt.SocketOrVal[float] = 1.0,
|
|
737
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
738
|
+
black_level: nt.SocketOrVal[pt.Color] = (0, 0, 0, 1),
|
|
739
|
+
white_level: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
740
|
+
) -> nt.ProcNode:
|
|
741
|
+
"""
|
|
742
|
+
Uses a CurveRGB Compositor Node.
|
|
743
|
+
|
|
744
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/color/adjust/rgb_curves.html
|
|
745
|
+
"""
|
|
746
|
+
return nt.ProcNode.from_nodetype(
|
|
747
|
+
node_type="CompositorNodeCurveRGB",
|
|
748
|
+
inputs={
|
|
749
|
+
"Fac": fac,
|
|
750
|
+
"Image": image,
|
|
751
|
+
"Black Level": black_level,
|
|
752
|
+
"White Level": white_level,
|
|
753
|
+
},
|
|
754
|
+
attrs={},
|
|
755
|
+
)
|
|
756
|
+
|
|
757
|
+
|
|
758
|
+
def curve_vec(vector: nt.SocketOrVal[pt.Vector] = (0, 0, 0)) -> nt.ProcNode:
|
|
759
|
+
"""
|
|
760
|
+
Uses a CurveVec Compositor Node.
|
|
761
|
+
|
|
762
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/color/adjust/rgb_curves.html
|
|
763
|
+
"""
|
|
764
|
+
return nt.ProcNode.from_nodetype(
|
|
765
|
+
node_type="CompositorNodeCurveVec",
|
|
766
|
+
inputs={"Vector": vector},
|
|
767
|
+
attrs={},
|
|
768
|
+
)
|
|
769
|
+
|
|
770
|
+
|
|
771
|
+
def d_blur(
|
|
772
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
773
|
+
angle: float = 0.0,
|
|
774
|
+
center_x: float = 0.5,
|
|
775
|
+
center_y: float = 0.5,
|
|
776
|
+
distance: float = 0.0,
|
|
777
|
+
iterations: int = 1,
|
|
778
|
+
spin: float = 0.0,
|
|
779
|
+
zoom: float = 0.0,
|
|
780
|
+
) -> nt.ProcNode:
|
|
781
|
+
"""
|
|
782
|
+
Uses a DBlur Compositor Node.
|
|
783
|
+
|
|
784
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/filter/blur/directional_blur.html
|
|
785
|
+
"""
|
|
786
|
+
return nt.ProcNode.from_nodetype(
|
|
787
|
+
node_type="CompositorNodeDBlur",
|
|
788
|
+
inputs={"Image": image},
|
|
789
|
+
attrs={
|
|
790
|
+
"angle": angle,
|
|
791
|
+
"center_x": center_x,
|
|
792
|
+
"center_y": center_y,
|
|
793
|
+
"distance": distance,
|
|
794
|
+
"iterations": iterations,
|
|
795
|
+
"spin": spin,
|
|
796
|
+
"zoom": zoom,
|
|
797
|
+
},
|
|
798
|
+
)
|
|
799
|
+
|
|
800
|
+
|
|
801
|
+
def defocus(
|
|
802
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
803
|
+
z: nt.SocketOrVal[float] = 1.0,
|
|
804
|
+
angle: float = 0.0,
|
|
805
|
+
blur_max: float = 16.0,
|
|
806
|
+
bokeh: Literal[
|
|
807
|
+
"OCTAGON", "HEPTAGON", "HEXAGON", "PENTAGON", "SQUARE", "TRIANGLE", "CIRCLE"
|
|
808
|
+
] = "CIRCLE",
|
|
809
|
+
f_stop: float = 128.0,
|
|
810
|
+
scene: Any = None,
|
|
811
|
+
threshold: float = 1.0,
|
|
812
|
+
use_gamma_correction: bool = False,
|
|
813
|
+
use_preview: bool = True,
|
|
814
|
+
use_zbuffer: bool = False,
|
|
815
|
+
z_scale: float = 1.0,
|
|
816
|
+
) -> nt.ProcNode:
|
|
817
|
+
"""
|
|
818
|
+
Uses a Defocus Compositor Node.
|
|
819
|
+
|
|
820
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/filter/blur/defocus.html
|
|
821
|
+
"""
|
|
822
|
+
return nt.ProcNode.from_nodetype(
|
|
823
|
+
node_type="CompositorNodeDefocus",
|
|
824
|
+
inputs={"Image": image, "Z": z},
|
|
825
|
+
attrs={
|
|
826
|
+
"angle": angle,
|
|
827
|
+
"blur_max": blur_max,
|
|
828
|
+
"bokeh": bokeh,
|
|
829
|
+
"f_stop": f_stop,
|
|
830
|
+
"scene": scene,
|
|
831
|
+
"threshold": threshold,
|
|
832
|
+
"use_gamma_correction": use_gamma_correction,
|
|
833
|
+
"use_preview": use_preview,
|
|
834
|
+
"use_zbuffer": use_zbuffer,
|
|
835
|
+
"z_scale": z_scale,
|
|
836
|
+
},
|
|
837
|
+
)
|
|
838
|
+
|
|
839
|
+
|
|
840
|
+
def denoise(
|
|
841
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
842
|
+
normal: nt.SocketOrVal[pt.Vector] = (0, 0, 0),
|
|
843
|
+
albedo: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
844
|
+
prefilter: Literal["NONE", "FAST", "ACCURATE"] = "ACCURATE",
|
|
845
|
+
use_hdr: bool = True,
|
|
846
|
+
) -> nt.ProcNode:
|
|
847
|
+
"""
|
|
848
|
+
Uses a Denoise Compositor Node.
|
|
849
|
+
|
|
850
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/filter/denoise.html
|
|
851
|
+
"""
|
|
852
|
+
return nt.ProcNode.from_nodetype(
|
|
853
|
+
node_type="CompositorNodeDenoise",
|
|
854
|
+
inputs={"Image": image, "Normal": normal, "Albedo": albedo},
|
|
855
|
+
attrs={"prefilter": prefilter, "use_hdr": use_hdr},
|
|
856
|
+
)
|
|
857
|
+
|
|
858
|
+
|
|
859
|
+
def despeckle(
|
|
860
|
+
fac: nt.SocketOrVal[float] = 1.0,
|
|
861
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
862
|
+
threshold: float = 0.5,
|
|
863
|
+
threshold_neighbor: float = 0.5,
|
|
864
|
+
) -> nt.ProcNode:
|
|
865
|
+
"""
|
|
866
|
+
Uses a Despeckle Compositor Node.
|
|
867
|
+
|
|
868
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/filter/despeckle.html
|
|
869
|
+
"""
|
|
870
|
+
return nt.ProcNode.from_nodetype(
|
|
871
|
+
node_type="CompositorNodeDespeckle",
|
|
872
|
+
inputs={"Fac": fac, "Image": image},
|
|
873
|
+
attrs={"threshold": threshold, "threshold_neighbor": threshold_neighbor},
|
|
874
|
+
)
|
|
875
|
+
|
|
876
|
+
|
|
877
|
+
def diff_matte(
|
|
878
|
+
image_1: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
879
|
+
image_2: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
880
|
+
falloff: float = 0.1,
|
|
881
|
+
tolerance: float = 0.1,
|
|
882
|
+
) -> nt.ProcNode:
|
|
883
|
+
"""
|
|
884
|
+
Uses a DiffMatte Compositor Node.
|
|
885
|
+
|
|
886
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/keying/difference_key.html
|
|
887
|
+
"""
|
|
888
|
+
return nt.ProcNode.from_nodetype(
|
|
889
|
+
node_type="CompositorNodeDiffMatte",
|
|
890
|
+
inputs={"Image 1": image_1, "Image 2": image_2},
|
|
891
|
+
attrs={"falloff": falloff, "tolerance": tolerance},
|
|
892
|
+
)
|
|
893
|
+
|
|
894
|
+
|
|
895
|
+
def dilate_erode(
|
|
896
|
+
mask: nt.SocketOrVal[float] = 0.0,
|
|
897
|
+
distance: int = 0,
|
|
898
|
+
edge: float = 0.0,
|
|
899
|
+
falloff: Literal[
|
|
900
|
+
"SMOOTH", "SPHERE", "ROOT", "INVERSE_SQUARE", "SHARP", "LINEAR"
|
|
901
|
+
] = "SMOOTH",
|
|
902
|
+
mode: Literal["STEP", "THRESHOLD", "DISTANCE", "FEATHER"] = "STEP",
|
|
903
|
+
) -> nt.ProcNode:
|
|
904
|
+
"""
|
|
905
|
+
Uses a DilateErode Compositor Node.
|
|
906
|
+
|
|
907
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/filter/dilate_erode.html
|
|
908
|
+
"""
|
|
909
|
+
return nt.ProcNode.from_nodetype(
|
|
910
|
+
node_type="CompositorNodeDilateErode",
|
|
911
|
+
inputs={"Mask": mask},
|
|
912
|
+
attrs={"distance": distance, "edge": edge, "falloff": falloff, "mode": mode},
|
|
913
|
+
)
|
|
914
|
+
|
|
915
|
+
|
|
916
|
+
def displace(
|
|
917
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
918
|
+
vector: nt.SocketOrVal[pt.Vector] = (1, 1, 1),
|
|
919
|
+
x_scale: nt.SocketOrVal[float] = 0.0,
|
|
920
|
+
y_scale: nt.SocketOrVal[float] = 0.0,
|
|
921
|
+
) -> nt.ProcNode:
|
|
922
|
+
"""
|
|
923
|
+
Uses a Displace Compositor Node.
|
|
924
|
+
|
|
925
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/transform/displace.html
|
|
926
|
+
"""
|
|
927
|
+
return nt.ProcNode.from_nodetype(
|
|
928
|
+
node_type="CompositorNodeDisplace",
|
|
929
|
+
inputs={
|
|
930
|
+
"Image": image,
|
|
931
|
+
"Vector": vector,
|
|
932
|
+
"X Scale": x_scale,
|
|
933
|
+
"Y Scale": y_scale,
|
|
934
|
+
},
|
|
935
|
+
attrs={},
|
|
936
|
+
)
|
|
937
|
+
|
|
938
|
+
|
|
939
|
+
def distance_matte(
|
|
940
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
941
|
+
key_color: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
942
|
+
channel: Literal["RGB", "YCC"] = "RGB",
|
|
943
|
+
falloff: float = 0.1,
|
|
944
|
+
tolerance: float = 0.1,
|
|
945
|
+
) -> nt.ProcNode:
|
|
946
|
+
"""
|
|
947
|
+
Uses a DistanceMatte Compositor Node.
|
|
948
|
+
|
|
949
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/keying/distance_key.html
|
|
950
|
+
"""
|
|
951
|
+
return nt.ProcNode.from_nodetype(
|
|
952
|
+
node_type="CompositorNodeDistanceMatte",
|
|
953
|
+
inputs={"Image": image, "Key Color": key_color},
|
|
954
|
+
attrs={"channel": channel, "falloff": falloff, "tolerance": tolerance},
|
|
955
|
+
)
|
|
956
|
+
|
|
957
|
+
|
|
958
|
+
def double_edge_mask(
|
|
959
|
+
inner_mask: nt.SocketOrVal[float] = 0.8,
|
|
960
|
+
outer_mask: nt.SocketOrVal[float] = 0.8,
|
|
961
|
+
edge_mode: Literal["BLEED_OUT", "KEEP_IN"] = "BLEED_OUT",
|
|
962
|
+
inner_mode: Literal["ALL", "ADJACENT_ONLY"] = "ALL",
|
|
963
|
+
) -> nt.ProcNode:
|
|
964
|
+
"""
|
|
965
|
+
Uses a DoubleEdgeMask Compositor Node.
|
|
966
|
+
|
|
967
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/mask/double_edge_mask.html
|
|
968
|
+
"""
|
|
969
|
+
return nt.ProcNode.from_nodetype(
|
|
970
|
+
node_type="CompositorNodeDoubleEdgeMask",
|
|
971
|
+
inputs={"Inner Mask": inner_mask, "Outer Mask": outer_mask},
|
|
972
|
+
attrs={"edge_mode": edge_mode, "inner_mode": inner_mode},
|
|
973
|
+
)
|
|
974
|
+
|
|
975
|
+
|
|
976
|
+
def ellipse_mask(
|
|
977
|
+
mask: nt.SocketOrVal[float] = 0.0,
|
|
978
|
+
value: nt.SocketOrVal[float] = 1.0,
|
|
979
|
+
mask_height: float = 0.1,
|
|
980
|
+
mask_type: Literal["ADD", "SUBTRACT", "MULTIPLY", "NOT"] = "ADD",
|
|
981
|
+
mask_width: float = 0.2,
|
|
982
|
+
rotation: float = 0.0,
|
|
983
|
+
x: float = 0.5,
|
|
984
|
+
y: float = 0.5,
|
|
985
|
+
) -> nt.ProcNode:
|
|
986
|
+
"""
|
|
987
|
+
Uses a EllipseMask Compositor Node.
|
|
988
|
+
|
|
989
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/mask/ellipse_mask.html
|
|
990
|
+
"""
|
|
991
|
+
return nt.ProcNode.from_nodetype(
|
|
992
|
+
node_type="CompositorNodeEllipseMask",
|
|
993
|
+
inputs={"Mask": mask, "Value": value},
|
|
994
|
+
attrs={
|
|
995
|
+
"mask_height": mask_height,
|
|
996
|
+
"mask_type": mask_type,
|
|
997
|
+
"mask_width": mask_width,
|
|
998
|
+
"rotation": rotation,
|
|
999
|
+
"x": x,
|
|
1000
|
+
"y": y,
|
|
1001
|
+
},
|
|
1002
|
+
)
|
|
1003
|
+
|
|
1004
|
+
|
|
1005
|
+
def exposure(
|
|
1006
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
1007
|
+
exposure: nt.SocketOrVal[float] = 0.0,
|
|
1008
|
+
) -> nt.ProcNode:
|
|
1009
|
+
"""
|
|
1010
|
+
Uses a Exposure Compositor Node.
|
|
1011
|
+
|
|
1012
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/color/adjust/exposure.html
|
|
1013
|
+
"""
|
|
1014
|
+
return nt.ProcNode.from_nodetype(
|
|
1015
|
+
node_type="CompositorNodeExposure",
|
|
1016
|
+
inputs={"Image": image, "Exposure": exposure},
|
|
1017
|
+
attrs={},
|
|
1018
|
+
)
|
|
1019
|
+
|
|
1020
|
+
|
|
1021
|
+
def filter(
|
|
1022
|
+
fac: nt.SocketOrVal[float] = 1.0,
|
|
1023
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
1024
|
+
filter_type: Literal[
|
|
1025
|
+
"SOFTEN",
|
|
1026
|
+
"SHARPEN",
|
|
1027
|
+
"SHARPEN_DIAMOND",
|
|
1028
|
+
"LAPLACE",
|
|
1029
|
+
"SOBEL",
|
|
1030
|
+
"PREWITT",
|
|
1031
|
+
"KIRSCH",
|
|
1032
|
+
"SHADOW",
|
|
1033
|
+
] = "SOFTEN",
|
|
1034
|
+
) -> nt.ProcNode:
|
|
1035
|
+
"""
|
|
1036
|
+
Uses a Filter Compositor Node.
|
|
1037
|
+
|
|
1038
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/filter/filter.html
|
|
1039
|
+
"""
|
|
1040
|
+
return nt.ProcNode.from_nodetype(
|
|
1041
|
+
node_type="CompositorNodeFilter",
|
|
1042
|
+
inputs={"Fac": fac, "Image": image},
|
|
1043
|
+
attrs={"filter_type": filter_type},
|
|
1044
|
+
)
|
|
1045
|
+
|
|
1046
|
+
|
|
1047
|
+
def flip(
|
|
1048
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1), axis: Literal["X", "Y", "XY"] = "X"
|
|
1049
|
+
) -> nt.ProcNode:
|
|
1050
|
+
"""
|
|
1051
|
+
Uses a Flip Compositor Node.
|
|
1052
|
+
|
|
1053
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/transform/flip.html
|
|
1054
|
+
"""
|
|
1055
|
+
return nt.ProcNode.from_nodetype(
|
|
1056
|
+
node_type="CompositorNodeFlip",
|
|
1057
|
+
inputs={"Image": image},
|
|
1058
|
+
attrs={"axis": axis},
|
|
1059
|
+
)
|
|
1060
|
+
|
|
1061
|
+
|
|
1062
|
+
def gamma(
|
|
1063
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1), gamma: nt.SocketOrVal[float] = 1.0
|
|
1064
|
+
) -> nt.ProcNode:
|
|
1065
|
+
"""
|
|
1066
|
+
Uses a Gamma Compositor Node.
|
|
1067
|
+
|
|
1068
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/color/adjust/gamma.html
|
|
1069
|
+
"""
|
|
1070
|
+
return nt.ProcNode.from_nodetype(
|
|
1071
|
+
node_type="CompositorNodeGamma",
|
|
1072
|
+
inputs={"Image": image, "Gamma": gamma},
|
|
1073
|
+
attrs={},
|
|
1074
|
+
)
|
|
1075
|
+
|
|
1076
|
+
|
|
1077
|
+
def glare(
|
|
1078
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
1079
|
+
angle_offset: float = 0.0,
|
|
1080
|
+
color_modulation: float = 0.25,
|
|
1081
|
+
fade: float = 0.9,
|
|
1082
|
+
glare_type: Literal[
|
|
1083
|
+
"BLOOM", "GHOSTS", "STREAKS", "FOG_GLOW", "SIMPLE_STAR"
|
|
1084
|
+
] = "STREAKS",
|
|
1085
|
+
iterations: int = 3,
|
|
1086
|
+
mix: float = 0.0,
|
|
1087
|
+
quality: Literal["HIGH", "MEDIUM", "LOW"] = "MEDIUM",
|
|
1088
|
+
size: int = 8,
|
|
1089
|
+
streaks: int = 4,
|
|
1090
|
+
threshold: float = 1.0,
|
|
1091
|
+
use_rotate_45: bool = True,
|
|
1092
|
+
) -> nt.ProcNode:
|
|
1093
|
+
"""
|
|
1094
|
+
Uses a Glare Compositor Node.
|
|
1095
|
+
|
|
1096
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/filter/glare.html
|
|
1097
|
+
"""
|
|
1098
|
+
return nt.ProcNode.from_nodetype(
|
|
1099
|
+
node_type="CompositorNodeGlare",
|
|
1100
|
+
inputs={"Image": image},
|
|
1101
|
+
attrs={
|
|
1102
|
+
"angle_offset": angle_offset,
|
|
1103
|
+
"color_modulation": color_modulation,
|
|
1104
|
+
"fade": fade,
|
|
1105
|
+
"glare_type": glare_type,
|
|
1106
|
+
"iterations": iterations,
|
|
1107
|
+
"mix": mix,
|
|
1108
|
+
"quality": quality,
|
|
1109
|
+
"size": size,
|
|
1110
|
+
"streaks": streaks,
|
|
1111
|
+
"threshold": threshold,
|
|
1112
|
+
"use_rotate_45": use_rotate_45,
|
|
1113
|
+
},
|
|
1114
|
+
)
|
|
1115
|
+
|
|
1116
|
+
|
|
1117
|
+
def group(node_tree: Any = None) -> nt.ProcNode:
|
|
1118
|
+
"""
|
|
1119
|
+
Uses a Group Compositor Node.
|
|
1120
|
+
|
|
1121
|
+
See: https://docs.blender.org/manual/en/4.2/modeling/geometry_nodes/group.html
|
|
1122
|
+
"""
|
|
1123
|
+
return nt.ProcNode.from_nodetype(
|
|
1124
|
+
node_type="CompositorNodeGroup",
|
|
1125
|
+
inputs={},
|
|
1126
|
+
attrs={"node_tree": node_tree},
|
|
1127
|
+
)
|
|
1128
|
+
|
|
1129
|
+
|
|
1130
|
+
def hue_correct(
|
|
1131
|
+
fac: nt.SocketOrVal[float] = 1.0, image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1)
|
|
1132
|
+
) -> nt.ProcNode:
|
|
1133
|
+
"""
|
|
1134
|
+
Uses a HueCorrect Compositor Node.
|
|
1135
|
+
|
|
1136
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/color/adjust/hue_correct.html
|
|
1137
|
+
"""
|
|
1138
|
+
return nt.ProcNode.from_nodetype(
|
|
1139
|
+
node_type="CompositorNodeHueCorrect",
|
|
1140
|
+
inputs={"Fac": fac, "Image": image},
|
|
1141
|
+
attrs={},
|
|
1142
|
+
)
|
|
1143
|
+
|
|
1144
|
+
|
|
1145
|
+
def hue_sat(
|
|
1146
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
1147
|
+
hue: nt.SocketOrVal[float] = 0.5,
|
|
1148
|
+
saturation: nt.SocketOrVal[float] = 1.0,
|
|
1149
|
+
value: nt.SocketOrVal[float] = 1.0,
|
|
1150
|
+
fac: nt.SocketOrVal[float] = 1.0,
|
|
1151
|
+
) -> nt.ProcNode:
|
|
1152
|
+
"""
|
|
1153
|
+
Uses a HueSat Compositor Node.
|
|
1154
|
+
|
|
1155
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/color/adjust/hue_saturation.html
|
|
1156
|
+
"""
|
|
1157
|
+
return nt.ProcNode.from_nodetype(
|
|
1158
|
+
node_type="CompositorNodeHueSat",
|
|
1159
|
+
inputs={
|
|
1160
|
+
"Image": image,
|
|
1161
|
+
"Hue": hue,
|
|
1162
|
+
"Saturation": saturation,
|
|
1163
|
+
"Value": value,
|
|
1164
|
+
"Fac": fac,
|
|
1165
|
+
},
|
|
1166
|
+
attrs={},
|
|
1167
|
+
)
|
|
1168
|
+
|
|
1169
|
+
|
|
1170
|
+
def id_mask(
|
|
1171
|
+
id_value: nt.SocketOrVal[float] = 1.0,
|
|
1172
|
+
index: int = 0,
|
|
1173
|
+
use_antialiasing: bool = False,
|
|
1174
|
+
) -> nt.ProcNode:
|
|
1175
|
+
"""
|
|
1176
|
+
Uses a IDMask Compositor Node.
|
|
1177
|
+
|
|
1178
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/mask/id_mask.html
|
|
1179
|
+
"""
|
|
1180
|
+
return nt.ProcNode.from_nodetype(
|
|
1181
|
+
node_type="CompositorNodeIDMask",
|
|
1182
|
+
inputs={"ID value": id_value},
|
|
1183
|
+
attrs={"index": index, "use_antialiasing": use_antialiasing},
|
|
1184
|
+
)
|
|
1185
|
+
|
|
1186
|
+
|
|
1187
|
+
def image(
|
|
1188
|
+
frame_duration: int = 1,
|
|
1189
|
+
frame_offset: int = 0,
|
|
1190
|
+
frame_start: int = 1,
|
|
1191
|
+
image: Any = None,
|
|
1192
|
+
layer: Literal["PLACEHOLDER"] | None = None,
|
|
1193
|
+
view: Literal["ALL"] | None = None,
|
|
1194
|
+
use_auto_refresh: bool = True,
|
|
1195
|
+
use_cyclic: bool = False,
|
|
1196
|
+
use_straight_alpha_output: bool = False,
|
|
1197
|
+
) -> nt.ProcNode:
|
|
1198
|
+
"""
|
|
1199
|
+
Uses a Image Compositor Node.
|
|
1200
|
+
|
|
1201
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/input/image.html
|
|
1202
|
+
"""
|
|
1203
|
+
attrs = {
|
|
1204
|
+
"frame_duration": frame_duration,
|
|
1205
|
+
"frame_offset": frame_offset,
|
|
1206
|
+
"frame_start": frame_start,
|
|
1207
|
+
"image": image,
|
|
1208
|
+
"use_auto_refresh": use_auto_refresh,
|
|
1209
|
+
"use_cyclic": use_cyclic,
|
|
1210
|
+
"use_straight_alpha_output": use_straight_alpha_output,
|
|
1211
|
+
}
|
|
1212
|
+
if layer is not None:
|
|
1213
|
+
attrs["layer"] = layer
|
|
1214
|
+
if view is not None:
|
|
1215
|
+
attrs["view"] = view
|
|
1216
|
+
return nt.ProcNode.from_nodetype(
|
|
1217
|
+
node_type="CompositorNodeImage",
|
|
1218
|
+
inputs={},
|
|
1219
|
+
attrs=attrs,
|
|
1220
|
+
)
|
|
1221
|
+
|
|
1222
|
+
|
|
1223
|
+
def inpaint(
|
|
1224
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1), distance: int = 0
|
|
1225
|
+
) -> nt.ProcNode:
|
|
1226
|
+
"""
|
|
1227
|
+
Uses a Inpaint Compositor Node.
|
|
1228
|
+
|
|
1229
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/filter/inpaint.html
|
|
1230
|
+
"""
|
|
1231
|
+
return nt.ProcNode.from_nodetype(
|
|
1232
|
+
node_type="CompositorNodeInpaint",
|
|
1233
|
+
inputs={"Image": image},
|
|
1234
|
+
attrs={"distance": distance},
|
|
1235
|
+
)
|
|
1236
|
+
|
|
1237
|
+
|
|
1238
|
+
def invert(
|
|
1239
|
+
fac: nt.SocketOrVal[float] = 1.0,
|
|
1240
|
+
color: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
1241
|
+
invert_alpha: bool = False,
|
|
1242
|
+
invert_rgb: bool = True,
|
|
1243
|
+
) -> nt.ProcNode:
|
|
1244
|
+
"""
|
|
1245
|
+
Uses a Invert Compositor Node.
|
|
1246
|
+
|
|
1247
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/color/invert_color.html
|
|
1248
|
+
"""
|
|
1249
|
+
return nt.ProcNode.from_nodetype(
|
|
1250
|
+
node_type="CompositorNodeInvert",
|
|
1251
|
+
inputs={"Fac": fac, "Color": color},
|
|
1252
|
+
attrs={"invert_alpha": invert_alpha, "invert_rgb": invert_rgb},
|
|
1253
|
+
)
|
|
1254
|
+
|
|
1255
|
+
|
|
1256
|
+
def keying(
|
|
1257
|
+
image: nt.SocketOrVal[pt.Color] = (0.8, 0.8, 0.8, 1),
|
|
1258
|
+
key_color: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
1259
|
+
garbage_matte: nt.SocketOrVal[float] = 0.0,
|
|
1260
|
+
core_matte: nt.SocketOrVal[float] = 0.0,
|
|
1261
|
+
blur_post: int = 0,
|
|
1262
|
+
blur_pre: int = 0,
|
|
1263
|
+
clip_black: float = 0.0,
|
|
1264
|
+
clip_white: float = 1.0,
|
|
1265
|
+
despill_balance: float = 0.5,
|
|
1266
|
+
despill_factor: float = 1.0,
|
|
1267
|
+
dilate_distance: int = 0,
|
|
1268
|
+
edge_kernel_radius: int = 3,
|
|
1269
|
+
edge_kernel_tolerance: float = 0.1,
|
|
1270
|
+
feather_distance: int = 0,
|
|
1271
|
+
feather_falloff: Literal[
|
|
1272
|
+
"SMOOTH", "SPHERE", "ROOT", "INVERSE_SQUARE", "SHARP", "LINEAR"
|
|
1273
|
+
] = "SMOOTH",
|
|
1274
|
+
screen_balance: float = 0.5,
|
|
1275
|
+
) -> nt.ProcNode:
|
|
1276
|
+
"""
|
|
1277
|
+
Uses a Keying Compositor Node.
|
|
1278
|
+
|
|
1279
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/keying/keying.html
|
|
1280
|
+
"""
|
|
1281
|
+
return nt.ProcNode.from_nodetype(
|
|
1282
|
+
node_type="CompositorNodeKeying",
|
|
1283
|
+
inputs={
|
|
1284
|
+
"Image": image,
|
|
1285
|
+
"Key Color": key_color,
|
|
1286
|
+
"Garbage Matte": garbage_matte,
|
|
1287
|
+
"Core Matte": core_matte,
|
|
1288
|
+
},
|
|
1289
|
+
attrs={
|
|
1290
|
+
"blur_post": blur_post,
|
|
1291
|
+
"blur_pre": blur_pre,
|
|
1292
|
+
"clip_black": clip_black,
|
|
1293
|
+
"clip_white": clip_white,
|
|
1294
|
+
"despill_balance": despill_balance,
|
|
1295
|
+
"despill_factor": despill_factor,
|
|
1296
|
+
"dilate_distance": dilate_distance,
|
|
1297
|
+
"edge_kernel_radius": edge_kernel_radius,
|
|
1298
|
+
"edge_kernel_tolerance": edge_kernel_tolerance,
|
|
1299
|
+
"feather_distance": feather_distance,
|
|
1300
|
+
"feather_falloff": feather_falloff,
|
|
1301
|
+
"screen_balance": screen_balance,
|
|
1302
|
+
},
|
|
1303
|
+
)
|
|
1304
|
+
|
|
1305
|
+
|
|
1306
|
+
def keying_screen(
|
|
1307
|
+
clip: Any = None, smoothness: float = 0.0, tracking_object: str = ""
|
|
1308
|
+
) -> nt.ProcNode:
|
|
1309
|
+
"""
|
|
1310
|
+
Uses a KeyingScreen Compositor Node.
|
|
1311
|
+
|
|
1312
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/keying/keying_screen.html
|
|
1313
|
+
"""
|
|
1314
|
+
return nt.ProcNode.from_nodetype(
|
|
1315
|
+
node_type="CompositorNodeKeyingScreen",
|
|
1316
|
+
inputs={},
|
|
1317
|
+
attrs={
|
|
1318
|
+
"clip": clip,
|
|
1319
|
+
"smoothness": smoothness,
|
|
1320
|
+
"tracking_object": tracking_object,
|
|
1321
|
+
},
|
|
1322
|
+
)
|
|
1323
|
+
|
|
1324
|
+
|
|
1325
|
+
def kuwahara(
|
|
1326
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
1327
|
+
size: nt.SocketOrVal[float] = 6.0,
|
|
1328
|
+
eccentricity: float = 1.0,
|
|
1329
|
+
sharpness: float = 0.5,
|
|
1330
|
+
uniformity: int = 4,
|
|
1331
|
+
use_high_precision: bool = False,
|
|
1332
|
+
variation: Literal["CLASSIC", "ANISOTROPIC"] = "CLASSIC",
|
|
1333
|
+
) -> nt.ProcNode:
|
|
1334
|
+
"""
|
|
1335
|
+
Uses a Kuwahara Compositor Node.
|
|
1336
|
+
|
|
1337
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/filter/kuwahara.html
|
|
1338
|
+
"""
|
|
1339
|
+
return nt.ProcNode.from_nodetype(
|
|
1340
|
+
node_type="CompositorNodeKuwahara",
|
|
1341
|
+
inputs={"Image": image, "Size": size},
|
|
1342
|
+
attrs={
|
|
1343
|
+
"eccentricity": eccentricity,
|
|
1344
|
+
"sharpness": sharpness,
|
|
1345
|
+
"uniformity": uniformity,
|
|
1346
|
+
"use_high_precision": use_high_precision,
|
|
1347
|
+
"variation": variation,
|
|
1348
|
+
},
|
|
1349
|
+
)
|
|
1350
|
+
|
|
1351
|
+
|
|
1352
|
+
def lensdist(
|
|
1353
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
1354
|
+
distortion: nt.SocketOrVal[float] = 0.0,
|
|
1355
|
+
dispersion: nt.SocketOrVal[float] = 0.0,
|
|
1356
|
+
use_fit: bool = False,
|
|
1357
|
+
use_jitter: bool = False,
|
|
1358
|
+
use_projector: bool = False,
|
|
1359
|
+
) -> nt.ProcNode:
|
|
1360
|
+
"""
|
|
1361
|
+
Uses a Lensdist Compositor Node.
|
|
1362
|
+
|
|
1363
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/transform/lens_distortion.html
|
|
1364
|
+
"""
|
|
1365
|
+
return nt.ProcNode.from_nodetype(
|
|
1366
|
+
node_type="CompositorNodeLensdist",
|
|
1367
|
+
inputs={"Image": image, "Distortion": distortion, "Dispersion": dispersion},
|
|
1368
|
+
attrs={
|
|
1369
|
+
"use_fit": use_fit,
|
|
1370
|
+
"use_jitter": use_jitter,
|
|
1371
|
+
"use_projector": use_projector,
|
|
1372
|
+
},
|
|
1373
|
+
)
|
|
1374
|
+
|
|
1375
|
+
|
|
1376
|
+
def levels(
|
|
1377
|
+
image: nt.SocketOrVal[pt.Color] = (0, 0, 0, 1),
|
|
1378
|
+
channel: Literal[
|
|
1379
|
+
"COMBINED_RGB", "RED", "GREEN", "BLUE", "LUMINANCE"
|
|
1380
|
+
] = "COMBINED_RGB",
|
|
1381
|
+
) -> nt.ProcNode:
|
|
1382
|
+
"""
|
|
1383
|
+
Uses a Levels Compositor Node.
|
|
1384
|
+
|
|
1385
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/utilities/levels.html
|
|
1386
|
+
"""
|
|
1387
|
+
return nt.ProcNode.from_nodetype(
|
|
1388
|
+
node_type="CompositorNodeLevels",
|
|
1389
|
+
inputs={"Image": image},
|
|
1390
|
+
attrs={"channel": channel},
|
|
1391
|
+
)
|
|
1392
|
+
|
|
1393
|
+
|
|
1394
|
+
def luma_matte(
|
|
1395
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
1396
|
+
limit_max: float = 1.0,
|
|
1397
|
+
limit_min: float = 0.0,
|
|
1398
|
+
) -> nt.ProcNode:
|
|
1399
|
+
"""
|
|
1400
|
+
Uses a LumaMatte Compositor Node.
|
|
1401
|
+
|
|
1402
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/keying/luminance_key.html
|
|
1403
|
+
"""
|
|
1404
|
+
return nt.ProcNode.from_nodetype(
|
|
1405
|
+
node_type="CompositorNodeLumaMatte",
|
|
1406
|
+
inputs={"Image": image},
|
|
1407
|
+
attrs={"limit_max": limit_max, "limit_min": limit_min},
|
|
1408
|
+
)
|
|
1409
|
+
|
|
1410
|
+
|
|
1411
|
+
def map_range(
|
|
1412
|
+
value: nt.SocketOrVal[float] = 1.0,
|
|
1413
|
+
from_min: nt.SocketOrVal[float] = 0.0,
|
|
1414
|
+
from_max: nt.SocketOrVal[float] = 1.0,
|
|
1415
|
+
to_min: nt.SocketOrVal[float] = 0.0,
|
|
1416
|
+
to_max: nt.SocketOrVal[float] = 1.0,
|
|
1417
|
+
) -> nt.ProcNode:
|
|
1418
|
+
"""
|
|
1419
|
+
Uses a MapRange Compositor Node.
|
|
1420
|
+
|
|
1421
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/utilities/map_range.html
|
|
1422
|
+
"""
|
|
1423
|
+
return nt.ProcNode.from_nodetype(
|
|
1424
|
+
node_type="CompositorNodeMapRange",
|
|
1425
|
+
inputs={
|
|
1426
|
+
"Value": value,
|
|
1427
|
+
"From Min": from_min,
|
|
1428
|
+
"From Max": from_max,
|
|
1429
|
+
"To Min": to_min,
|
|
1430
|
+
"To Max": to_max,
|
|
1431
|
+
},
|
|
1432
|
+
attrs={},
|
|
1433
|
+
)
|
|
1434
|
+
|
|
1435
|
+
|
|
1436
|
+
def map_uv(
|
|
1437
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
1438
|
+
uv: nt.SocketOrVal[pt.Vector] = (1, 0, 0),
|
|
1439
|
+
alpha: int = 0,
|
|
1440
|
+
filter_type: Literal["NEAREST", "ANISOTROPIC"] = "ANISOTROPIC",
|
|
1441
|
+
) -> nt.ProcNode:
|
|
1442
|
+
"""
|
|
1443
|
+
Uses a MapUV Compositor Node.
|
|
1444
|
+
|
|
1445
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/transform/map_uv.html
|
|
1446
|
+
"""
|
|
1447
|
+
return nt.ProcNode.from_nodetype(
|
|
1448
|
+
node_type="CompositorNodeMapUV",
|
|
1449
|
+
inputs={"Image": image, "UV": uv},
|
|
1450
|
+
attrs={"alpha": alpha, "filter_type": filter_type},
|
|
1451
|
+
)
|
|
1452
|
+
|
|
1453
|
+
|
|
1454
|
+
def map_value(
|
|
1455
|
+
value: nt.SocketOrVal[float] = 1.0,
|
|
1456
|
+
max: tuple = (1.0,),
|
|
1457
|
+
min: tuple = (0.0,),
|
|
1458
|
+
offset: tuple = (0.0,),
|
|
1459
|
+
size: tuple = (1.0,),
|
|
1460
|
+
use_max: bool = False,
|
|
1461
|
+
use_min: bool = False,
|
|
1462
|
+
) -> nt.ProcNode:
|
|
1463
|
+
"""
|
|
1464
|
+
Uses a MapValue Compositor Node.
|
|
1465
|
+
|
|
1466
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/utilities/map_value.html
|
|
1467
|
+
"""
|
|
1468
|
+
return nt.ProcNode.from_nodetype(
|
|
1469
|
+
node_type="CompositorNodeMapValue",
|
|
1470
|
+
inputs={"Value": value},
|
|
1471
|
+
attrs={
|
|
1472
|
+
"max": max,
|
|
1473
|
+
"min": min,
|
|
1474
|
+
"offset": offset,
|
|
1475
|
+
"size": size,
|
|
1476
|
+
"use_max": use_max,
|
|
1477
|
+
"use_min": use_min,
|
|
1478
|
+
},
|
|
1479
|
+
)
|
|
1480
|
+
|
|
1481
|
+
|
|
1482
|
+
def mask(
|
|
1483
|
+
mask: Any = None,
|
|
1484
|
+
motion_blur_samples: int = 16,
|
|
1485
|
+
motion_blur_shutter: float = 0.5,
|
|
1486
|
+
size_source: Literal["SCENE", "FIXED", "FIXED_SCENE"] = "SCENE",
|
|
1487
|
+
size_x: int = 256,
|
|
1488
|
+
size_y: int = 256,
|
|
1489
|
+
use_feather: bool = True,
|
|
1490
|
+
use_motion_blur: bool = False,
|
|
1491
|
+
) -> nt.ProcNode:
|
|
1492
|
+
"""
|
|
1493
|
+
Uses a Mask Compositor Node.
|
|
1494
|
+
|
|
1495
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/input/mask.html
|
|
1496
|
+
"""
|
|
1497
|
+
return nt.ProcNode.from_nodetype(
|
|
1498
|
+
node_type="CompositorNodeMask",
|
|
1499
|
+
inputs={},
|
|
1500
|
+
attrs={
|
|
1501
|
+
"mask": mask,
|
|
1502
|
+
"motion_blur_samples": motion_blur_samples,
|
|
1503
|
+
"motion_blur_shutter": motion_blur_shutter,
|
|
1504
|
+
"size_source": size_source,
|
|
1505
|
+
"size_x": size_x,
|
|
1506
|
+
"size_y": size_y,
|
|
1507
|
+
"use_feather": use_feather,
|
|
1508
|
+
"use_motion_blur": use_motion_blur,
|
|
1509
|
+
},
|
|
1510
|
+
)
|
|
1511
|
+
|
|
1512
|
+
|
|
1513
|
+
def math(
|
|
1514
|
+
value_0: nt.SocketOrVal[float] = 0.5, value_1: nt.SocketOrVal[float] = 0.5
|
|
1515
|
+
) -> nt.ProcNode:
|
|
1516
|
+
"""
|
|
1517
|
+
Uses a Math Compositor Node.
|
|
1518
|
+
|
|
1519
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/utilities/math.html
|
|
1520
|
+
"""
|
|
1521
|
+
return nt.ProcNode.from_nodetype(
|
|
1522
|
+
node_type="CompositorNodeMath",
|
|
1523
|
+
inputs={("Value", 0): value_0, ("Value", 1): value_1},
|
|
1524
|
+
attrs={},
|
|
1525
|
+
)
|
|
1526
|
+
|
|
1527
|
+
|
|
1528
|
+
def mix_rgb(
|
|
1529
|
+
fac: nt.SocketOrVal[float] = 1.0,
|
|
1530
|
+
image_0: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
1531
|
+
image_1: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
1532
|
+
blend_type: TBlendType = "MIX",
|
|
1533
|
+
use_alpha: bool = False,
|
|
1534
|
+
) -> nt.ProcNode:
|
|
1535
|
+
"""
|
|
1536
|
+
Uses a MixRGB Compositor Node.
|
|
1537
|
+
|
|
1538
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/color/mix/mix_color.html
|
|
1539
|
+
"""
|
|
1540
|
+
return nt.ProcNode.from_nodetype(
|
|
1541
|
+
node_type="CompositorNodeMixRGB",
|
|
1542
|
+
inputs={"Fac": fac, ("Image", 0): image_0, ("Image", 1): image_1},
|
|
1543
|
+
attrs={"blend_type": blend_type, "use_alpha": use_alpha},
|
|
1544
|
+
)
|
|
1545
|
+
|
|
1546
|
+
|
|
1547
|
+
class MovieClipResult(NamedTuple):
|
|
1548
|
+
image: nt.ProcNode[pt.Color]
|
|
1549
|
+
alpha: nt.ProcNode[float]
|
|
1550
|
+
offset_x: nt.ProcNode[float]
|
|
1551
|
+
offset_y: nt.ProcNode[float]
|
|
1552
|
+
scale: nt.ProcNode[float]
|
|
1553
|
+
angle: nt.ProcNode[float]
|
|
1554
|
+
|
|
1555
|
+
|
|
1556
|
+
def movie_clip(clip: Any = None) -> MovieClipResult:
|
|
1557
|
+
"""
|
|
1558
|
+
Uses a MovieClip Compositor Node.
|
|
1559
|
+
|
|
1560
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/input/movie_clip.html
|
|
1561
|
+
"""
|
|
1562
|
+
node = nt.ProcNode.from_nodetype(
|
|
1563
|
+
node_type="CompositorNodeMovieClip",
|
|
1564
|
+
inputs={},
|
|
1565
|
+
attrs={"clip": clip},
|
|
1566
|
+
)
|
|
1567
|
+
return MovieClipResult(
|
|
1568
|
+
node._output_socket("image"),
|
|
1569
|
+
node._output_socket("alpha"),
|
|
1570
|
+
node._output_socket("offset_x"),
|
|
1571
|
+
node._output_socket("offset_y"),
|
|
1572
|
+
node._output_socket("scale"),
|
|
1573
|
+
node._output_socket("angle"),
|
|
1574
|
+
)
|
|
1575
|
+
|
|
1576
|
+
|
|
1577
|
+
def movie_distortion(
|
|
1578
|
+
image: nt.SocketOrVal[pt.Color] = (0.8, 0.8, 0.8, 1),
|
|
1579
|
+
clip: Any = None,
|
|
1580
|
+
distortion_type: Literal["UNDISTORT", "DISTORT"] = "UNDISTORT",
|
|
1581
|
+
) -> nt.ProcNode:
|
|
1582
|
+
"""
|
|
1583
|
+
Uses a MovieDistortion Compositor Node.
|
|
1584
|
+
|
|
1585
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/transform/movie_distortion.html
|
|
1586
|
+
"""
|
|
1587
|
+
return nt.ProcNode.from_nodetype(
|
|
1588
|
+
node_type="CompositorNodeMovieDistortion",
|
|
1589
|
+
inputs={"Image": image},
|
|
1590
|
+
attrs={"clip": clip, "distortion_type": distortion_type},
|
|
1591
|
+
)
|
|
1592
|
+
|
|
1593
|
+
|
|
1594
|
+
def normal(normal: nt.SocketOrVal[pt.Vector] = (0, 0, 1)) -> nt.ProcNode:
|
|
1595
|
+
"""
|
|
1596
|
+
Uses a Normal Compositor Node.
|
|
1597
|
+
|
|
1598
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/vector/normal.html
|
|
1599
|
+
"""
|
|
1600
|
+
return nt.ProcNode.from_nodetype(
|
|
1601
|
+
node_type="CompositorNodeNormal",
|
|
1602
|
+
inputs={"Normal": normal},
|
|
1603
|
+
attrs={},
|
|
1604
|
+
)
|
|
1605
|
+
|
|
1606
|
+
|
|
1607
|
+
def normalize(value: nt.SocketOrVal[float] = 1.0) -> nt.ProcNode:
|
|
1608
|
+
"""
|
|
1609
|
+
Uses a Normalize Compositor Node.
|
|
1610
|
+
|
|
1611
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/utilities/normalize.html
|
|
1612
|
+
"""
|
|
1613
|
+
return nt.ProcNode.from_nodetype(
|
|
1614
|
+
node_type="CompositorNodeNormalize",
|
|
1615
|
+
inputs={"Value": value},
|
|
1616
|
+
attrs={},
|
|
1617
|
+
)
|
|
1618
|
+
|
|
1619
|
+
|
|
1620
|
+
# Manual changes
|
|
1621
|
+
def output_file(
|
|
1622
|
+
active_input_index: int = 0,
|
|
1623
|
+
base_path: str = "/tmp/",
|
|
1624
|
+
slot_paths: dict | None = None,
|
|
1625
|
+
format: dict | None = None,
|
|
1626
|
+
**kwargs,
|
|
1627
|
+
) -> nt.ProcNode:
|
|
1628
|
+
"""
|
|
1629
|
+
Uses a OutputFile Compositor Node.
|
|
1630
|
+
|
|
1631
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/output/file_output.html
|
|
1632
|
+
"""
|
|
1633
|
+
|
|
1634
|
+
if format is None:
|
|
1635
|
+
format = {}
|
|
1636
|
+
|
|
1637
|
+
return nt.ProcNode.from_nodetype(
|
|
1638
|
+
node_type="CompositorNodeOutputFile",
|
|
1639
|
+
inputs=kwargs,
|
|
1640
|
+
attrs={
|
|
1641
|
+
"active_input_index": active_input_index,
|
|
1642
|
+
"format": format,
|
|
1643
|
+
"base_path": base_path,
|
|
1644
|
+
"slot_paths": slot_paths,
|
|
1645
|
+
},
|
|
1646
|
+
)
|
|
1647
|
+
|
|
1648
|
+
|
|
1649
|
+
def pixelate(
|
|
1650
|
+
color: nt.SocketOrVal[pt.Color] = (0.8, 0.8, 0.8, 1), pixel_size: int = 1
|
|
1651
|
+
) -> nt.ProcNode:
|
|
1652
|
+
"""
|
|
1653
|
+
Uses a Pixelate Compositor Node.
|
|
1654
|
+
|
|
1655
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/filter/pixelate.html
|
|
1656
|
+
"""
|
|
1657
|
+
return nt.ProcNode.from_nodetype(
|
|
1658
|
+
node_type="CompositorNodePixelate",
|
|
1659
|
+
inputs={"Color": color},
|
|
1660
|
+
attrs={"pixel_size": pixel_size},
|
|
1661
|
+
)
|
|
1662
|
+
|
|
1663
|
+
|
|
1664
|
+
def plane_track_deform(
|
|
1665
|
+
image: nt.SocketOrVal[pt.Color] = (0.8, 0.8, 0.8, 1),
|
|
1666
|
+
clip: Any = None,
|
|
1667
|
+
motion_blur_samples: int = 16,
|
|
1668
|
+
motion_blur_shutter: float = 0.5,
|
|
1669
|
+
plane_track_name: str = "",
|
|
1670
|
+
tracking_object: str = "",
|
|
1671
|
+
use_motion_blur: bool = False,
|
|
1672
|
+
) -> nt.ProcNode:
|
|
1673
|
+
"""
|
|
1674
|
+
Uses a PlaneTrackDeform Compositor Node.
|
|
1675
|
+
|
|
1676
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/tracking/plane_track_deform.html
|
|
1677
|
+
"""
|
|
1678
|
+
return nt.ProcNode.from_nodetype(
|
|
1679
|
+
node_type="CompositorNodePlaneTrackDeform",
|
|
1680
|
+
inputs={"Image": image},
|
|
1681
|
+
attrs={
|
|
1682
|
+
"clip": clip,
|
|
1683
|
+
"motion_blur_samples": motion_blur_samples,
|
|
1684
|
+
"motion_blur_shutter": motion_blur_shutter,
|
|
1685
|
+
"plane_track_name": plane_track_name,
|
|
1686
|
+
"tracking_object": tracking_object,
|
|
1687
|
+
"use_motion_blur": use_motion_blur,
|
|
1688
|
+
},
|
|
1689
|
+
)
|
|
1690
|
+
|
|
1691
|
+
|
|
1692
|
+
def posterize(
|
|
1693
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1), steps: nt.SocketOrVal[float] = 8.0
|
|
1694
|
+
) -> nt.ProcNode:
|
|
1695
|
+
"""
|
|
1696
|
+
Uses a Posterize Compositor Node.
|
|
1697
|
+
|
|
1698
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/filter/posterize.html
|
|
1699
|
+
"""
|
|
1700
|
+
return nt.ProcNode.from_nodetype(
|
|
1701
|
+
node_type="CompositorNodePosterize",
|
|
1702
|
+
inputs={"Image": image, "Steps": steps},
|
|
1703
|
+
attrs={},
|
|
1704
|
+
)
|
|
1705
|
+
|
|
1706
|
+
|
|
1707
|
+
def premul_key(
|
|
1708
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
1709
|
+
mapping: Literal["STRAIGHT_TO_PREMUL", "PREMUL_TO_STRAIGHT"] = "STRAIGHT_TO_PREMUL",
|
|
1710
|
+
) -> nt.ProcNode:
|
|
1711
|
+
"""
|
|
1712
|
+
Uses a PremulKey Compositor Node.
|
|
1713
|
+
|
|
1714
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/color/alpha_convert.html
|
|
1715
|
+
"""
|
|
1716
|
+
return nt.ProcNode.from_nodetype(
|
|
1717
|
+
node_type="CompositorNodePremulKey",
|
|
1718
|
+
inputs={"Image": image},
|
|
1719
|
+
attrs={"mapping": mapping},
|
|
1720
|
+
)
|
|
1721
|
+
|
|
1722
|
+
|
|
1723
|
+
def rgb() -> nt.ProcNode:
|
|
1724
|
+
"""
|
|
1725
|
+
Uses a RGB Compositor Node.
|
|
1726
|
+
|
|
1727
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/input/constant/rgb.html
|
|
1728
|
+
"""
|
|
1729
|
+
return nt.ProcNode.from_nodetype(node_type="CompositorNodeRGB", inputs={}, attrs={})
|
|
1730
|
+
|
|
1731
|
+
|
|
1732
|
+
def rgb_to_bw(image: nt.SocketOrVal[pt.Color] = (0.8, 0.8, 0.8, 1)) -> nt.ProcNode:
|
|
1733
|
+
"""
|
|
1734
|
+
Uses a RGBToBW Compositor Node.
|
|
1735
|
+
|
|
1736
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/color/rgb_to_bw.html
|
|
1737
|
+
"""
|
|
1738
|
+
return nt.ProcNode.from_nodetype(
|
|
1739
|
+
node_type="CompositorNodeRGBToBW",
|
|
1740
|
+
inputs={"Image": image},
|
|
1741
|
+
attrs={},
|
|
1742
|
+
)
|
|
1743
|
+
|
|
1744
|
+
|
|
1745
|
+
def rotate(
|
|
1746
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
1747
|
+
degr: nt.SocketOrVal[float] = 0.0,
|
|
1748
|
+
filter_type: Literal["NEAREST", "BILINEAR", "BICUBIC"] = "BILINEAR",
|
|
1749
|
+
) -> nt.ProcNode:
|
|
1750
|
+
"""
|
|
1751
|
+
Uses a Rotate Compositor Node.
|
|
1752
|
+
|
|
1753
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/transform/rotate.html
|
|
1754
|
+
"""
|
|
1755
|
+
return nt.ProcNode.from_nodetype(
|
|
1756
|
+
node_type="CompositorNodeRotate",
|
|
1757
|
+
inputs={"Image": image, "Degr": degr},
|
|
1758
|
+
attrs={"filter_type": filter_type},
|
|
1759
|
+
)
|
|
1760
|
+
|
|
1761
|
+
|
|
1762
|
+
def scale(
|
|
1763
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
1764
|
+
x: nt.SocketOrVal[float] = 1.0,
|
|
1765
|
+
y: nt.SocketOrVal[float] = 1.0,
|
|
1766
|
+
frame_method: Literal["STRETCH", "FIT", "CROP"] = "STRETCH",
|
|
1767
|
+
offset_x: float = 0.0,
|
|
1768
|
+
offset_y: float = 0.0,
|
|
1769
|
+
space: Literal["RELATIVE", "ABSOLUTE", "SCENE_SIZE", "RENDER_SIZE"] = "RELATIVE",
|
|
1770
|
+
) -> nt.ProcNode:
|
|
1771
|
+
"""
|
|
1772
|
+
Uses a Scale Compositor Node.
|
|
1773
|
+
|
|
1774
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/transform/scale.html
|
|
1775
|
+
"""
|
|
1776
|
+
return nt.ProcNode.from_nodetype(
|
|
1777
|
+
node_type="CompositorNodeScale",
|
|
1778
|
+
inputs={"Image": image, "X": x, "Y": y},
|
|
1779
|
+
attrs={
|
|
1780
|
+
"frame_method": frame_method,
|
|
1781
|
+
"offset_x": offset_x,
|
|
1782
|
+
"offset_y": offset_y,
|
|
1783
|
+
"space": space,
|
|
1784
|
+
},
|
|
1785
|
+
)
|
|
1786
|
+
|
|
1787
|
+
|
|
1788
|
+
class SceneTimeResult(NamedTuple):
|
|
1789
|
+
seconds: nt.ProcNode[float]
|
|
1790
|
+
frame: nt.ProcNode[float]
|
|
1791
|
+
|
|
1792
|
+
|
|
1793
|
+
def scene_time() -> SceneTimeResult:
|
|
1794
|
+
"""
|
|
1795
|
+
Uses a SceneTime Compositor Node.
|
|
1796
|
+
|
|
1797
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/input/scene/scene_time.html
|
|
1798
|
+
"""
|
|
1799
|
+
node = nt.ProcNode.from_nodetype(
|
|
1800
|
+
node_type="CompositorNodeSceneTime",
|
|
1801
|
+
inputs={},
|
|
1802
|
+
attrs={},
|
|
1803
|
+
)
|
|
1804
|
+
return SceneTimeResult(node._output_socket("seconds"), node._output_socket("frame"))
|
|
1805
|
+
|
|
1806
|
+
|
|
1807
|
+
class SepHsvaResult(NamedTuple):
|
|
1808
|
+
h: nt.ProcNode[float]
|
|
1809
|
+
s: nt.ProcNode[float]
|
|
1810
|
+
v: nt.ProcNode[float]
|
|
1811
|
+
a: nt.ProcNode[float]
|
|
1812
|
+
|
|
1813
|
+
|
|
1814
|
+
def sep_hsva(image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1)) -> SepHsvaResult:
|
|
1815
|
+
"""
|
|
1816
|
+
Uses a SepHSVA Compositor Node.
|
|
1817
|
+
|
|
1818
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/color/mix/separate_color.html
|
|
1819
|
+
"""
|
|
1820
|
+
node = nt.ProcNode.from_nodetype(
|
|
1821
|
+
node_type="CompositorNodeSepHSVA",
|
|
1822
|
+
inputs={"Image": image},
|
|
1823
|
+
attrs={},
|
|
1824
|
+
)
|
|
1825
|
+
return SepHsvaResult(
|
|
1826
|
+
node._output_socket("h"),
|
|
1827
|
+
node._output_socket("s"),
|
|
1828
|
+
node._output_socket("v"),
|
|
1829
|
+
node._output_socket("a"),
|
|
1830
|
+
)
|
|
1831
|
+
|
|
1832
|
+
|
|
1833
|
+
class SepRgbaResult(NamedTuple):
|
|
1834
|
+
r: nt.ProcNode[float]
|
|
1835
|
+
g: nt.ProcNode[float]
|
|
1836
|
+
b: nt.ProcNode[float]
|
|
1837
|
+
a: nt.ProcNode[float]
|
|
1838
|
+
|
|
1839
|
+
|
|
1840
|
+
def sep_rgba(image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1)) -> SepRgbaResult:
|
|
1841
|
+
"""
|
|
1842
|
+
Uses a SepRGBA Compositor Node.
|
|
1843
|
+
|
|
1844
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/color/mix/separate_color.html
|
|
1845
|
+
"""
|
|
1846
|
+
node = nt.ProcNode.from_nodetype(
|
|
1847
|
+
node_type="CompositorNodeSepRGBA",
|
|
1848
|
+
inputs={"Image": image},
|
|
1849
|
+
attrs={},
|
|
1850
|
+
)
|
|
1851
|
+
return SepRgbaResult(
|
|
1852
|
+
node._output_socket("r"),
|
|
1853
|
+
node._output_socket("g"),
|
|
1854
|
+
node._output_socket("b"),
|
|
1855
|
+
node._output_socket("a"),
|
|
1856
|
+
)
|
|
1857
|
+
|
|
1858
|
+
|
|
1859
|
+
class SepYccaResult(NamedTuple):
|
|
1860
|
+
y: nt.ProcNode[float]
|
|
1861
|
+
cb: nt.ProcNode[float]
|
|
1862
|
+
cr: nt.ProcNode[float]
|
|
1863
|
+
a: nt.ProcNode[float]
|
|
1864
|
+
|
|
1865
|
+
|
|
1866
|
+
def sep_ycca(
|
|
1867
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
1868
|
+
mode: Literal["ITUBT601", "ITUBT709", "JFIF"] = "ITUBT709",
|
|
1869
|
+
) -> SepYccaResult:
|
|
1870
|
+
"""
|
|
1871
|
+
Uses a SepYCCA Compositor Node.
|
|
1872
|
+
|
|
1873
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/color/mix/separate_color.html
|
|
1874
|
+
"""
|
|
1875
|
+
node = nt.ProcNode.from_nodetype(
|
|
1876
|
+
node_type="CompositorNodeSepYCCA",
|
|
1877
|
+
inputs={"Image": image},
|
|
1878
|
+
attrs={"mode": mode},
|
|
1879
|
+
)
|
|
1880
|
+
return SepYccaResult(
|
|
1881
|
+
node._output_socket("y"),
|
|
1882
|
+
node._output_socket("cb"),
|
|
1883
|
+
node._output_socket("cr"),
|
|
1884
|
+
node._output_socket("a"),
|
|
1885
|
+
)
|
|
1886
|
+
|
|
1887
|
+
|
|
1888
|
+
class SepYuvaResult(NamedTuple):
|
|
1889
|
+
y: nt.ProcNode[float]
|
|
1890
|
+
u: nt.ProcNode[float]
|
|
1891
|
+
v: nt.ProcNode[float]
|
|
1892
|
+
a: nt.ProcNode[float]
|
|
1893
|
+
|
|
1894
|
+
|
|
1895
|
+
def sep_yuva(image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1)) -> SepYuvaResult:
|
|
1896
|
+
"""
|
|
1897
|
+
Uses a SepYUVA Compositor Node.
|
|
1898
|
+
|
|
1899
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/color/mix/separate_color.html
|
|
1900
|
+
"""
|
|
1901
|
+
node = nt.ProcNode.from_nodetype(
|
|
1902
|
+
node_type="CompositorNodeSepYUVA",
|
|
1903
|
+
inputs={"Image": image},
|
|
1904
|
+
attrs={},
|
|
1905
|
+
)
|
|
1906
|
+
return SepYuvaResult(
|
|
1907
|
+
node._output_socket("y"),
|
|
1908
|
+
node._output_socket("u"),
|
|
1909
|
+
node._output_socket("v"),
|
|
1910
|
+
node._output_socket("a"),
|
|
1911
|
+
)
|
|
1912
|
+
|
|
1913
|
+
|
|
1914
|
+
def set_alpha(
|
|
1915
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
1916
|
+
alpha: nt.SocketOrVal[float] = 1.0,
|
|
1917
|
+
mode: Literal["APPLY", "REPLACE_ALPHA"] = "APPLY",
|
|
1918
|
+
) -> nt.ProcNode:
|
|
1919
|
+
"""
|
|
1920
|
+
Uses a SetAlpha Compositor Node.
|
|
1921
|
+
|
|
1922
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/color/set_alpha.html
|
|
1923
|
+
"""
|
|
1924
|
+
return nt.ProcNode.from_nodetype(
|
|
1925
|
+
node_type="CompositorNodeSetAlpha",
|
|
1926
|
+
inputs={"Image": image, "Alpha": alpha},
|
|
1927
|
+
attrs={"mode": mode},
|
|
1928
|
+
)
|
|
1929
|
+
|
|
1930
|
+
|
|
1931
|
+
def split(
|
|
1932
|
+
image_0: nt.SocketOrVal[pt.Color] = (0.8, 0.8, 0.8, 1),
|
|
1933
|
+
image_1: nt.SocketOrVal[pt.Color] = (0.8, 0.8, 0.8, 1),
|
|
1934
|
+
axis: Literal["X", "Y"] = "X",
|
|
1935
|
+
factor: int = 50,
|
|
1936
|
+
) -> nt.ProcNode:
|
|
1937
|
+
"""
|
|
1938
|
+
Uses a Split Compositor Node.
|
|
1939
|
+
|
|
1940
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/utilities/split.html
|
|
1941
|
+
"""
|
|
1942
|
+
return nt.ProcNode.from_nodetype(
|
|
1943
|
+
node_type="CompositorNodeSplit",
|
|
1944
|
+
inputs={("Image", 0): image_0, ("Image", 1): image_1},
|
|
1945
|
+
attrs={"axis": axis, "factor": factor},
|
|
1946
|
+
)
|
|
1947
|
+
|
|
1948
|
+
|
|
1949
|
+
def stabilize(
|
|
1950
|
+
image: nt.SocketOrVal[pt.Color] = (0.8, 0.8, 0.8, 1),
|
|
1951
|
+
clip: Any = None,
|
|
1952
|
+
filter_type: Literal["NEAREST", "BILINEAR", "BICUBIC"] = "BILINEAR",
|
|
1953
|
+
invert: bool = False,
|
|
1954
|
+
) -> nt.ProcNode:
|
|
1955
|
+
"""
|
|
1956
|
+
Uses a Stabilize Compositor Node.
|
|
1957
|
+
|
|
1958
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/tracking/stabilize_2d.html
|
|
1959
|
+
"""
|
|
1960
|
+
return nt.ProcNode.from_nodetype(
|
|
1961
|
+
node_type="CompositorNodeStabilize",
|
|
1962
|
+
inputs={"Image": image},
|
|
1963
|
+
attrs={"clip": clip, "filter_type": filter_type, "invert": invert},
|
|
1964
|
+
)
|
|
1965
|
+
|
|
1966
|
+
|
|
1967
|
+
def sun_beams(
|
|
1968
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
1969
|
+
ray_length: float = 0.0,
|
|
1970
|
+
source: tuple = (0.5, 0.5),
|
|
1971
|
+
) -> nt.ProcNode:
|
|
1972
|
+
"""
|
|
1973
|
+
Uses a SunBeams Compositor Node.
|
|
1974
|
+
|
|
1975
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/filter/sun_beams.html
|
|
1976
|
+
"""
|
|
1977
|
+
return nt.ProcNode.from_nodetype(
|
|
1978
|
+
node_type="CompositorNodeSunBeams",
|
|
1979
|
+
inputs={"Image": image},
|
|
1980
|
+
attrs={"ray_length": ray_length, "source": source},
|
|
1981
|
+
)
|
|
1982
|
+
|
|
1983
|
+
|
|
1984
|
+
def switch(
|
|
1985
|
+
off: nt.SocketOrVal[pt.Color] = (0.8, 0.8, 0.8, 1),
|
|
1986
|
+
on: nt.SocketOrVal[pt.Color] = (0.8, 0.8, 0.8, 1),
|
|
1987
|
+
check: bool = False,
|
|
1988
|
+
) -> nt.ProcNode:
|
|
1989
|
+
"""
|
|
1990
|
+
Uses a Switch Compositor Node.
|
|
1991
|
+
|
|
1992
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/utilities/switch.html
|
|
1993
|
+
"""
|
|
1994
|
+
return nt.ProcNode.from_nodetype(
|
|
1995
|
+
node_type="CompositorNodeSwitch",
|
|
1996
|
+
inputs={"Off": off, "On": on},
|
|
1997
|
+
attrs={"check": check},
|
|
1998
|
+
)
|
|
1999
|
+
|
|
2000
|
+
|
|
2001
|
+
def switch_view(
|
|
2002
|
+
left: nt.SocketOrVal[pt.Color] = (0, 0, 0, 1),
|
|
2003
|
+
right: nt.SocketOrVal[pt.Color] = (0, 0, 0, 1),
|
|
2004
|
+
) -> nt.ProcNode:
|
|
2005
|
+
"""
|
|
2006
|
+
Uses a SwitchView Compositor Node.
|
|
2007
|
+
|
|
2008
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/utilities/switch.html
|
|
2009
|
+
"""
|
|
2010
|
+
return nt.ProcNode.from_nodetype(
|
|
2011
|
+
node_type="CompositorNodeSwitchView",
|
|
2012
|
+
inputs={"left": left, "right": right},
|
|
2013
|
+
attrs={},
|
|
2014
|
+
)
|
|
2015
|
+
|
|
2016
|
+
|
|
2017
|
+
def texture(
|
|
2018
|
+
offset: nt.SocketOrVal[pt.Vector] = (0, 0, 0),
|
|
2019
|
+
scale: nt.SocketOrVal[pt.Vector] = (1, 1, 1),
|
|
2020
|
+
node_output: int = 0,
|
|
2021
|
+
texture: Any = None,
|
|
2022
|
+
) -> nt.ProcNode:
|
|
2023
|
+
"""
|
|
2024
|
+
Uses a Texture Compositor Node.
|
|
2025
|
+
|
|
2026
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/input/texture.html
|
|
2027
|
+
"""
|
|
2028
|
+
return nt.ProcNode.from_nodetype(
|
|
2029
|
+
node_type="CompositorNodeTexture",
|
|
2030
|
+
inputs={"Offset": offset, "Scale": scale},
|
|
2031
|
+
attrs={"node_output": node_output, "texture": texture},
|
|
2032
|
+
)
|
|
2033
|
+
|
|
2034
|
+
|
|
2035
|
+
def time(frame_end: int = 250, frame_start: int = 1) -> nt.ProcNode:
|
|
2036
|
+
"""
|
|
2037
|
+
Uses a Time Compositor Node.
|
|
2038
|
+
|
|
2039
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/input/scene/scene_time.html
|
|
2040
|
+
"""
|
|
2041
|
+
return nt.ProcNode.from_nodetype(
|
|
2042
|
+
node_type="CompositorNodeTime",
|
|
2043
|
+
inputs={},
|
|
2044
|
+
attrs={"frame_end": frame_end, "frame_start": frame_start},
|
|
2045
|
+
)
|
|
2046
|
+
|
|
2047
|
+
|
|
2048
|
+
def tonemap(
|
|
2049
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
2050
|
+
adaptation: float = 1.0,
|
|
2051
|
+
contrast: float = 0.0,
|
|
2052
|
+
correction: float = 0.0,
|
|
2053
|
+
gamma: float = 1.0,
|
|
2054
|
+
intensity: float = 0.0,
|
|
2055
|
+
key: float = 0.18,
|
|
2056
|
+
offset: float = 1.0,
|
|
2057
|
+
tonemap_type: Literal["RD_PHOTORECEPTOR", "RH_SIMPLE"] = "RD_PHOTORECEPTOR",
|
|
2058
|
+
) -> nt.ProcNode:
|
|
2059
|
+
"""
|
|
2060
|
+
Uses a Tonemap Compositor Node.
|
|
2061
|
+
|
|
2062
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/color/adjust/tone_map.html
|
|
2063
|
+
"""
|
|
2064
|
+
return nt.ProcNode.from_nodetype(
|
|
2065
|
+
node_type="CompositorNodeTonemap",
|
|
2066
|
+
inputs={"Image": image},
|
|
2067
|
+
attrs={
|
|
2068
|
+
"adaptation": adaptation,
|
|
2069
|
+
"contrast": contrast,
|
|
2070
|
+
"correction": correction,
|
|
2071
|
+
"gamma": gamma,
|
|
2072
|
+
"intensity": intensity,
|
|
2073
|
+
"key": key,
|
|
2074
|
+
"offset": offset,
|
|
2075
|
+
"tonemap_type": tonemap_type,
|
|
2076
|
+
},
|
|
2077
|
+
)
|
|
2078
|
+
|
|
2079
|
+
|
|
2080
|
+
def track_pos(
|
|
2081
|
+
clip: Any = None,
|
|
2082
|
+
frame_relative: int = 0,
|
|
2083
|
+
position: Literal[
|
|
2084
|
+
"ABSOLUTE", "RELATIVE_START", "RELATIVE_FRAME", "ABSOLUTE_FRAME"
|
|
2085
|
+
] = "ABSOLUTE",
|
|
2086
|
+
track_name: str = "",
|
|
2087
|
+
tracking_object: str = "",
|
|
2088
|
+
) -> nt.ProcNode:
|
|
2089
|
+
"""
|
|
2090
|
+
Uses a TrackPos Compositor Node.
|
|
2091
|
+
|
|
2092
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/tracking/track_position.html
|
|
2093
|
+
"""
|
|
2094
|
+
return nt.ProcNode.from_nodetype(
|
|
2095
|
+
node_type="CompositorNodeTrackPos",
|
|
2096
|
+
inputs={},
|
|
2097
|
+
attrs={
|
|
2098
|
+
"clip": clip,
|
|
2099
|
+
"frame_relative": frame_relative,
|
|
2100
|
+
"position": position,
|
|
2101
|
+
"track_name": track_name,
|
|
2102
|
+
"tracking_object": tracking_object,
|
|
2103
|
+
},
|
|
2104
|
+
)
|
|
2105
|
+
|
|
2106
|
+
|
|
2107
|
+
def transform(
|
|
2108
|
+
image: nt.SocketOrVal[pt.Color] = (0.8, 0.8, 0.8, 1),
|
|
2109
|
+
x: nt.SocketOrVal[float] = 0.0,
|
|
2110
|
+
y: nt.SocketOrVal[float] = 0.0,
|
|
2111
|
+
angle: nt.SocketOrVal[float] = 0.0,
|
|
2112
|
+
scale: nt.SocketOrVal[float] = 1.0,
|
|
2113
|
+
filter_type: Literal["NEAREST", "BILINEAR", "BICUBIC"] = "NEAREST",
|
|
2114
|
+
) -> nt.ProcNode:
|
|
2115
|
+
"""
|
|
2116
|
+
Uses a Transform Compositor Node.
|
|
2117
|
+
|
|
2118
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/transform/transform.html
|
|
2119
|
+
"""
|
|
2120
|
+
return nt.ProcNode.from_nodetype(
|
|
2121
|
+
node_type="CompositorNodeTransform",
|
|
2122
|
+
inputs={"Image": image, "X": x, "Y": y, "Angle": angle, "Scale": scale},
|
|
2123
|
+
attrs={"filter_type": filter_type},
|
|
2124
|
+
)
|
|
2125
|
+
|
|
2126
|
+
|
|
2127
|
+
def translate(
|
|
2128
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
2129
|
+
x: nt.SocketOrVal[float] = 0.0,
|
|
2130
|
+
y: nt.SocketOrVal[float] = 0.0,
|
|
2131
|
+
interpolation: Literal["Nearest", "Bilinear", "Bicubic"] = "Nearest",
|
|
2132
|
+
use_relative: bool = False,
|
|
2133
|
+
wrap_axis: Literal["NONE", "XAXIS", "YAXIS", "BOTH"] = "NONE",
|
|
2134
|
+
) -> nt.ProcNode:
|
|
2135
|
+
"""
|
|
2136
|
+
Uses a Translate Compositor Node.
|
|
2137
|
+
|
|
2138
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/transform/translate.html
|
|
2139
|
+
"""
|
|
2140
|
+
return nt.ProcNode.from_nodetype(
|
|
2141
|
+
node_type="CompositorNodeTranslate",
|
|
2142
|
+
inputs={"Image": image, "X": x, "Y": y},
|
|
2143
|
+
attrs={
|
|
2144
|
+
"interpolation": interpolation,
|
|
2145
|
+
"use_relative": use_relative,
|
|
2146
|
+
"wrap_axis": wrap_axis,
|
|
2147
|
+
},
|
|
2148
|
+
)
|
|
2149
|
+
|
|
2150
|
+
|
|
2151
|
+
def val_to_rgb(fac: nt.SocketOrVal[float] = 0.5) -> nt.ProcNode:
|
|
2152
|
+
"""
|
|
2153
|
+
Uses a ValToRGB Compositor Node.
|
|
2154
|
+
|
|
2155
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/color/color_ramp.html
|
|
2156
|
+
"""
|
|
2157
|
+
return nt.ProcNode.from_nodetype(
|
|
2158
|
+
node_type="CompositorNodeValToRGB",
|
|
2159
|
+
inputs={"Fac": fac},
|
|
2160
|
+
attrs={},
|
|
2161
|
+
)
|
|
2162
|
+
|
|
2163
|
+
|
|
2164
|
+
def value() -> nt.ProcNode:
|
|
2165
|
+
"""
|
|
2166
|
+
Uses a Value Compositor Node.
|
|
2167
|
+
|
|
2168
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/input/constant/value.html
|
|
2169
|
+
"""
|
|
2170
|
+
return nt.ProcNode.from_nodetype(
|
|
2171
|
+
node_type="CompositorNodeValue", inputs={}, attrs={}
|
|
2172
|
+
)
|
|
2173
|
+
|
|
2174
|
+
|
|
2175
|
+
def vec_blur(
|
|
2176
|
+
image: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
2177
|
+
z: nt.SocketOrVal[float] = 0.0,
|
|
2178
|
+
speed: nt.SocketOrVal[pt.Vector] = (0, 0, 0),
|
|
2179
|
+
factor: float = 0.25,
|
|
2180
|
+
samples: int = 32,
|
|
2181
|
+
speed_max: int = 0,
|
|
2182
|
+
speed_min: int = 0,
|
|
2183
|
+
use_curved: bool = False,
|
|
2184
|
+
) -> nt.ProcNode:
|
|
2185
|
+
"""
|
|
2186
|
+
Uses a VecBlur Compositor Node.
|
|
2187
|
+
|
|
2188
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/filter/blur/vector_blur.html
|
|
2189
|
+
"""
|
|
2190
|
+
return nt.ProcNode.from_nodetype(
|
|
2191
|
+
node_type="CompositorNodeVecBlur",
|
|
2192
|
+
inputs={"Image": image, "Z": z, "Speed": speed},
|
|
2193
|
+
attrs={
|
|
2194
|
+
"factor": factor,
|
|
2195
|
+
"samples": samples,
|
|
2196
|
+
"speed_max": speed_max,
|
|
2197
|
+
"speed_min": speed_min,
|
|
2198
|
+
"use_curved": use_curved,
|
|
2199
|
+
},
|
|
2200
|
+
)
|
|
2201
|
+
|
|
2202
|
+
|
|
2203
|
+
def viewer(
|
|
2204
|
+
image: nt.SocketOrVal[pt.Color] = (0, 0, 0, 1),
|
|
2205
|
+
alpha: nt.SocketOrVal[float] = 1.0,
|
|
2206
|
+
use_alpha: bool = True,
|
|
2207
|
+
) -> nt.ProcNode:
|
|
2208
|
+
"""
|
|
2209
|
+
Uses a Viewer Compositor Node.
|
|
2210
|
+
|
|
2211
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/output/viewer.html
|
|
2212
|
+
"""
|
|
2213
|
+
return nt.ProcNode.from_nodetype(
|
|
2214
|
+
node_type="CompositorNodeViewer",
|
|
2215
|
+
inputs={"Image": image, "Alpha": alpha},
|
|
2216
|
+
attrs={"use_alpha": use_alpha},
|
|
2217
|
+
)
|
|
2218
|
+
|
|
2219
|
+
|
|
2220
|
+
def zcombine(
|
|
2221
|
+
image_0: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
2222
|
+
z_0: nt.SocketOrVal[float] = 1.0,
|
|
2223
|
+
image_1: nt.SocketOrVal[pt.Color] = (1, 1, 1, 1),
|
|
2224
|
+
z_1: nt.SocketOrVal[float] = 1.0,
|
|
2225
|
+
use_alpha: bool = False,
|
|
2226
|
+
use_antialias_z: bool = True,
|
|
2227
|
+
) -> nt.ProcNode:
|
|
2228
|
+
"""
|
|
2229
|
+
Uses a Zcombine Compositor Node.
|
|
2230
|
+
|
|
2231
|
+
See: https://docs.blender.org/manual/en/4.2/compositing/types/color/mix/z_combine.html
|
|
2232
|
+
"""
|
|
2233
|
+
return nt.ProcNode.from_nodetype(
|
|
2234
|
+
node_type="CompositorNodeZcombine",
|
|
2235
|
+
inputs={
|
|
2236
|
+
("Image", 0): image_0,
|
|
2237
|
+
("Z", 0): z_0,
|
|
2238
|
+
("Image", 1): image_1,
|
|
2239
|
+
("Z", 1): z_1,
|
|
2240
|
+
},
|
|
2241
|
+
attrs={"use_alpha": use_alpha, "use_antialias_z": use_antialias_z},
|
|
2242
|
+
)
|