-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSID_Settings.py
386 lines (340 loc) · 12.6 KB
/
SID_Settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
import bpy
from bpy.types import (
PropertyGroup,
)
from bpy.props import (
BoolProperty,
EnumProperty,
FloatProperty,
IntProperty,
PointerProperty,
StringProperty
)
def get_percent_complete(self):
jobs_total = self['jobs_total']
jobs_done = self['jobs_done']
return 0 if jobs_total == 0 else 100 * jobs_done / jobs_total
def set_percent_complete(self, value):
pass
class SID_DenoiseRenderStatus(PropertyGroup):
is_rendering: BoolProperty(
name="Rendering",
description="Currently rendering",
default=False,
options=set(), # Not animatable!
)
should_stop: BoolProperty(
name="Stop",
description="User requested stop",
default=False,
options=set(), # Not animatable!
)
jobs_total: IntProperty(
name="Total Jobs",
description="Total number of jobs to run",
options=set(), # Not animatable!
)
jobs_done: IntProperty(
name="Jobs Done",
description="Number of jobs completed",
options=set(), # Not animatable!
)
jobs_remaining: IntProperty(
name="Jobs Remaining",
description="Number of jobs still remaining to complete",
options=set(), # Not animatable!
)
percent_complete: FloatProperty(
name="%",
description="Percentage of jobs completed",
subtype='PERCENTAGE',
min=0,
max=100,
options=set(), # Not animatable!
get=get_percent_complete,
set=set_percent_complete,
)
class SID_TemporalDenoiserStatus(PropertyGroup):
is_running: BoolProperty(
name="Denoising",
description="A Denoising operation is currently in progress",
default=False,
options=set(), # Not animatable!
)
should_stop: BoolProperty(
name="Stop",
description="User requested stop",
default=False,
options=set(), # Not animatable!
)
jobs_total: IntProperty(
name="Total Jobs",
description="Total number of jobs to run",
options=set(), # Not animatable!
)
jobs_done: IntProperty(
name="Jobs Done",
description="Number of jobs completed",
options=set(), # Not animatable!
)
jobs_remaining: IntProperty(
name="Jobs Remaining",
description="Number of jobs still remaining to complete",
options=set(), # Not animatable!
)
percent_complete: FloatProperty(
name="%",
description="Percentage of jobs completed",
subtype='PERCENTAGE',
min=0,
max=100,
options=set(), # Not animatable!
get=get_percent_complete,
set=set_percent_complete,
)
class SID_Settings(PropertyGroup):
denoiser_type: EnumProperty(
name="Denoiser Type",
items=(
(
'SID',
'SID',
'Super Image Denoiser'
),
(
'SID TEMPORAL',
'SID Temporal',
'Temporal Animation Denoiser using Super Image Denoiser'
),
(
'TEMPORAL',
'OptiX Temporal',
'Temporal Animation Denoiser using OptiX'
),
),
default='SID',
description="Choose the denoiser type,\nSID is recomended for images and animations,\ntemporal for animations only",
options=set(), # Not animatable!
)
quality: EnumProperty(
name="Denoiser Quality",
items=(
(
'STANDARD',
'Standard',
"Standard denoiser quality (fast compositing time, uses least memory)"
),
(
'HIGH',
'High',
"Extra denoiser quality (moderate compositing time, uses a little more memory)"
),
(
'SUPER',
'Super',
"Highest denoiser quality (slower compositing time, uses significantly more memory)"
),
),
default='HIGH',
description="Choose the quality of the final denoised image. Affects memory usage and speed for compositing.",
options=set(), # Not animatable!
)
inputdir: StringProperty(
name="Noisy Frames",
default= "",
description="Noisy EXR Frames will be saved here",
subtype='DIR_PATH',
maxlen=1024,
options=set(), # Not animatable!
)
filename: StringProperty(
name="File Name",
default= "",
description="File",
subtype='DIR_PATH',
maxlen=1024,
options=set(), # Not animatable!
)
use_emission: BoolProperty(
name="Emission",
default=True,
description="Enable this if you have emissive materials in your scene",
options=set(), # Not animatable!
)
use_environment: BoolProperty(
name="Environment",
default=True,
description="Enable this if your environment is visible in the render",
options=set(), # Not animatable!
)
use_transmission: BoolProperty(
name="Transmission",
default=True,
description="Enable this if you have transmissive materials in your scene",
options=set(), # Not animatable!
)
use_volumetric: BoolProperty(
name="Volume",
default=False,
description="Enable this if you have volumetric materials in your scene",
options=set(), # Not animatable!
)
SID_mlEXR: BoolProperty(
name="MultiLayerEXR",
default=False,
description="Export a denoised MultiLayer EXR file",
options=set(), # Not animatable!
)
SID_mlEXR_Compressed: BoolProperty(
name="Smaller EXR Files",
default=False,
description="Compresses the EXR files to save space,\nwill use 16bit DWAA EXR (lossy) instead of 32bit ZIP (lossless)",
options=set(), # Not animatable!
)
SIDT_MB_Toggle: BoolProperty(
name="Motion Blur",
default=True,
description="Enables faked motion blur",
options=set(), # Not animatable!
)
SIDT_MB_Samples: IntProperty(
name="Samples",
default=32,
min=1,
max=256,
description="Number of motion blur samples,\nmore samples = more accurate motion blur",
options=set(), # Not animatable!
)
SIDT_MB_Shutter: FloatProperty(
name="Shutter Speed",
default=0.5,
min=0,
max=2,
description="Time taken in frames between shutter open and close",
options=set(), # Not animatable!
)
SIDT_MB_Min: IntProperty(
name="Min",
default=0,
min=0,
max=1024,
description="Minimum speed for a pixel to be blurred,\nused to separate fast moving objects from slow moving ones",
options=set(), # Not animatable!
)
SIDT_MB_Max: IntProperty(
name="Max",
default=0,
min=0,
max=1024,
description="Maximum speed, or zero for no limit",
options=set(), # Not animatable!
)
SIDT_MB_Interpolation: BoolProperty(
name="Curved Interpolation",
default=False,
description="Interpolate between frames in a bezier curve, rather than linearly",
options=set(), # Not animatable!
)
SIDT_File_Format: EnumProperty(
name="File Output",
items=(
(
'PNG',
'PNG',
"This is the slowest option\nsuiteable for final rendering.\nExports as 8bit RGBA PNG, 0% compression.\nWarning: no compression!"
),
(
'JPEG',
'JPEG',
"This is the smallest file size and fastest processing option.\nsuiteable for previewing.\nExports as RGB JPG, 90% quality.\nWarning: lossy compression, may cause JPEG artifacts!"
),
(
'OPEN_EXR',
'EXR',
"This is the highest quality option\nsuiteable if you want to edit the frames later.\nExports as 32bit RGBA EXR, zip compression.\nWarning: this will use a lot of disk space!"
),
(
'TIFF',
'TIFF',
"This is the second highest quality option\nsuiteable if you want to edit the frames later.\nTakes color management into consideration.\nExports as 16bit RGBA TIFF, no compression.\nWarning: this will use a lot of disk space!"
),
),
default='PNG',
description="Choose the file format step 2 will output.",
options=set(), # Not animatable!
)
SIDT_Overscan_Auto: BoolProperty(
name="Automatic overscan value",
default=True,
description="Automatically calculate the overscan value based on the camera's motion.\nCurrently disabled, because I haven't implemented it yet.",
options=set(), # Not animatable!
)
SIDT_Overscan_Amount: IntProperty(
name="Overscan",
default=5,
min=0,
max=20,
description="Overscan is the amount of pixels that are rendered outside of the camera's view,\nthis is used to reduce the amount of artifacts at the edges of the image.\nThis is a percentage of the image's width and height.\nThe faster the camera movement, the higher the overscan should be.",
options=set(), # Not animatable!
)
SIDT_mlEXR: BoolProperty(
name="MultiLayerEXR",
default=False,
description="Export a denoised MultiLayer EXR file.\nThis setting takes a lot of disk space!",
options=set(), # Not animatable!
)
SIDT_Preview: BoolProperty(
name="Preview",
default=False,
description="View the render while it's being rendered.\nNot recommended.",
options=set(), # Not animatable!
)
SIDT_TED_Filter_Threshold: FloatProperty(
name="Filter Threshold",
default=3,
min=0,
max=50,
description="The higher, the more agressive the TED-Filter will be.\nThe TED-Filter detects artifacts caused by fast movement.\nWe recommend a value between 2 and 5 for most scenes.\nA value of 0 will disable the filter.",
options=set(), # Not animatable!
)
SIDT_TED_Filter_Distance: IntProperty(
name="Filter Radius",
default=3,
min=0,
max=10,
description="The higher, the more feathering the TED-Filter will have.\nThis value determins how smooth the transition of the TED-Filter should be.\nWe recommend a value between 2 and 5 for most scenes.\nA value of 0 will disable the filter.",
options=set(), # Not animatable!
)
SIDT_TED_Filter_Source: EnumProperty(
name="Filter Source",
items=(
(
'Temporal Albedo',
'Color',
"This will use the color of the surfaces to detect artifacts.\nUse this option if your scene has changes in lighting, reflections or shadows."
),
(
'Image',
'Shaded',
"This will use the shaded image to detect artifacts.\nUse this option if your scene has a lot of solid colored materials,\nlike a white wall, Leaves, Grass, etc."
),
(
'Depth',
'Depth',
"This will use the depth of the image to detect artifacts.\nWe recommend this option if your scene has a lot of transparent materials,\nlike glass, water, etc.\nWarning: this option is experimental! If you get good results, please let us know!"
)
),
default='Image',
description="Chose the source the TED-Filter will use to detect artifacts.",
options=set(), # Not animatable!
)
# Temporal denoiser part 1: render noisy frames
denoise_render_status: PointerProperty(
type=SID_DenoiseRenderStatus,
options=set(), # Not animatable!
)
# Temporal denoiser part 2: denoise animation
temporal_denoiser_status: PointerProperty(
type=SID_TemporalDenoiserStatus,
options=set(), # Not animatable!
)