|
@@ -6,7 +6,9 @@ import nuke
|
6
|
6
|
__version__ = '1.0'
|
7
|
7
|
|
8
|
8
|
MODES = ['MergeBackIntoStream','SelectOnly', 'ContactSheet']
|
9
|
|
-PATTERNDEFAULT = "*direct* !*indirect* !*default"
|
|
9
|
+#PATTERNDEFAULT = "*direct* !*indirect* !*default"
|
|
10
|
+PATTERNDEFAULT = ""
|
|
11
|
+PATTERNIGNORE = "*variance *denoise* *matte* P N Z rgba albedo"
|
10
|
12
|
INIT_DONE = False
|
11
|
13
|
|
12
|
14
|
class ChannelSelect(KellerNukePlugin):
|
|
@@ -16,10 +18,12 @@ class ChannelSelect(KellerNukePlugin):
|
16
|
18
|
m = self.menu.addMenu('Workgroup','Toolbar_Workgroup.png')
|
17
|
19
|
m.addCommand('ChannelSelect', 'import ChannelSelect; ChannelSelect.createChannelSelect()', icon=':qrc/images/ToolbarChannel.png')
|
18
|
20
|
nuke.addKnobChanged(onKnobChanged)
|
|
21
|
+ nuke.addOnCreate(onCreate, nodeClass=('Group'))
|
19
|
22
|
|
20
|
23
|
def unconfigurePlugin(self):
|
21
|
24
|
self.menu.removeItem('ChannelSelect')
|
22
|
25
|
nuke.removeKnobChanged(onKnobChanged)
|
|
26
|
+ nuke.removeOnCreate(onCreate)
|
23
|
27
|
pass
|
24
|
28
|
|
25
|
29
|
|
|
@@ -32,7 +36,7 @@ def onKnobChanged():
|
32
|
36
|
|
33
|
37
|
k = nuke.thisKnob()
|
34
|
38
|
# do a refresh on these knobs
|
35
|
|
- refresh_resolved = ['pattern','update']
|
|
39
|
+ refresh_resolved = ['pattern', 'pattern_exclude', 'update']
|
36
|
40
|
|
37
|
41
|
if k.name() in refresh_resolved:
|
38
|
42
|
print('ChannelSelect: Info. Event refresh triggered.')
|
|
@@ -40,7 +44,8 @@ def onKnobChanged():
|
40
|
44
|
n = nuke.thisNode()
|
41
|
45
|
|
42
|
46
|
pattern = n['pattern'].value()
|
43
|
|
- resolved = resolvePattern(n, pattern)
|
|
47
|
+ pattern_exclude = n['pattern_exclude'].value()
|
|
48
|
+ resolved = resolvePattern(n, pattern, pattern_exclude)
|
44
|
49
|
if resolved:
|
45
|
50
|
resString = '\n'.join(resolved)
|
46
|
51
|
|
|
@@ -51,6 +56,15 @@ def onKnobChanged():
|
51
|
56
|
pass
|
52
|
57
|
|
53
|
58
|
|
|
59
|
+def onCreate():
|
|
60
|
+ print('ChannelSelect: Info. On Create refresh triggered.')
|
|
61
|
+ n = nuke.thisNode()
|
|
62
|
+ # % (r * 255, g * 255, b * 255, 1), 16): change r g and b to your liking
|
|
63
|
+ hexColour = int('%02x%02x%02x%02x' % (0 * 255, 0 * 255, 0 * 255, 1), 16)
|
|
64
|
+ n['tile_color'].setValue(hexColour)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
54
|
68
|
def createChannelSelect():
|
55
|
69
|
# get selected Node (for connecting our node below)
|
56
|
70
|
try:
|
|
@@ -73,11 +87,11 @@ def createChannelSelect():
|
73
|
87
|
n.setXYpos(s.xpos(), s.ypos() + 100)
|
74
|
88
|
|
75
|
89
|
# tab ChannelSelect
|
76
|
|
- k = nuke.Tab_Knob('select', 'Select')
|
|
90
|
+ k = nuke.Tab_Knob('select', 'select')
|
77
|
91
|
n.addKnob(k)
|
78
|
92
|
|
79
|
93
|
# Pattern
|
80
|
|
- k = nuke.EvalString_Knob('pattern', 'Pattern')
|
|
94
|
+ k = nuke.EvalString_Knob('pattern', 'pattern')
|
81
|
95
|
n.addKnob(k)
|
82
|
96
|
n.knob('pattern').setTooltip('*diffuse* *SSS*\nwith exclude (! or ^):\n*direct* !*indirect*')
|
83
|
97
|
n.knob('pattern').setValue(PATTERNDEFAULT)
|
|
@@ -87,39 +101,89 @@ def createChannelSelect():
|
87
|
101
|
n.addKnob(k)
|
88
|
102
|
n.knob('update').setTooltip('Creates Nodes in Group based on Search Pattern')
|
89
|
103
|
|
|
104
|
+ # Pattern
|
|
105
|
+ k = nuke.EvalString_Knob('pattern_exclude', 'exclude')
|
|
106
|
+ n.addKnob(k)
|
|
107
|
+ n.knob('pattern_exclude').setTooltip('always exclude this pattern')
|
|
108
|
+ n.knob('pattern_exclude').setValue(PATTERNIGNORE)
|
|
109
|
+
|
90
|
110
|
# Resolved Channels
|
91
|
|
- k = nuke.Multiline_Eval_String_Knob('resolved', 'Resolved')
|
|
111
|
+ k = nuke.Multiline_Eval_String_Knob('resolved', 'preview')
|
92
|
112
|
n.addKnob(k)
|
93
|
|
- n.knob('resolved').setTooltip('These AOVs are found based on your search Pattern above')
|
|
113
|
+ n.knob('resolved').setTooltip('These AOVs are found based on your search Pattern above. Press Set to use these aovs.')
|
|
114
|
+
|
|
115
|
+ # Divide and Conquer
|
|
116
|
+ k = nuke.Text_Knob('divider', '')
|
|
117
|
+ n.addKnob(k)
|
|
118
|
+
|
|
119
|
+ # unpremult
|
|
120
|
+ k = nuke.Boolean_Knob('unpremult', 'unpremult')
|
|
121
|
+ n.addKnob(k)
|
|
122
|
+ n.knob('unpremult').setValue(True)
|
|
123
|
+ n.knob('unpremult').setFlag(nuke.STARTLINE)
|
|
124
|
+
|
|
125
|
+ # Divide and Conquer
|
|
126
|
+ k = nuke.Text_Knob('divider', '')
|
|
127
|
+ n.addKnob(k)
|
|
128
|
+
|
|
129
|
+ # Saturation
|
|
130
|
+ k = nuke.Double_Knob('saturation', 'saturation')
|
|
131
|
+ n.addKnob(k)
|
|
132
|
+ n.knob('saturation').setRange(0,1)
|
|
133
|
+ n.knob('saturation').setValue(1)
|
94
|
134
|
|
95
|
135
|
# Divide and Conquer
|
96
|
136
|
k = nuke.Text_Knob('divider', '')
|
97
|
137
|
n.addKnob(k)
|
98
|
138
|
|
99
|
139
|
# Exposure
|
100
|
|
- k = nuke.Double_Knob('exposure', 'Exposure')
|
|
140
|
+ k = nuke.Double_Knob('exposure', 'exposure')
|
101
|
141
|
n.addKnob(k)
|
102
|
142
|
n.knob('exposure').setRange(-2,2)
|
103
|
143
|
|
|
144
|
+ # Divide and Conquer
|
|
145
|
+ k = nuke.Text_Knob('divider', '')
|
|
146
|
+ n.addKnob(k)
|
|
147
|
+
|
|
148
|
+ # Blackpoint
|
|
149
|
+ k = nuke.Color_Knob('blackpoint', 'blackpoint')
|
|
150
|
+ n.addKnob(k)
|
|
151
|
+ n.knob('blackpoint').setRange(-1,1)
|
|
152
|
+ n.knob('blackpoint').setValue([0, 0, 0])
|
|
153
|
+
|
|
154
|
+ # Whitepoint
|
|
155
|
+ k = nuke.Color_Knob('whitepoint', 'whitepoint')
|
|
156
|
+ n.addKnob(k)
|
|
157
|
+ n.knob('whitepoint').setRange(0,4)
|
|
158
|
+ n.knob('whitepoint').setValue(1)
|
|
159
|
+ n.knob('whitepoint').setValue([1, 1, 1])
|
|
160
|
+
|
|
161
|
+ # Lift
|
|
162
|
+ k = nuke.Color_Knob('black', 'lift')
|
|
163
|
+ n.addKnob(k)
|
|
164
|
+ n.knob('black').setRange(-1,1)
|
|
165
|
+ n.knob('black').setValue([0, 0, 0])
|
|
166
|
+
|
104
|
167
|
# Multiply
|
105
|
|
- k = nuke.Color_Knob('multiply', 'Multiply')
|
|
168
|
+ k = nuke.Color_Knob('multiply', 'multiply')
|
106
|
169
|
n.addKnob(k)
|
107
|
170
|
n.knob('multiply').setValue([1, 1, 1])
|
|
171
|
+ n.knob('multiply').setRange(0, 4)
|
108
|
172
|
|
109
|
173
|
# Gamma
|
110
|
|
- k = nuke.Double_Knob('gamma', 'Gamma')
|
|
174
|
+ k = nuke.Double_Knob('gamma', 'gamma')
|
111
|
175
|
n.addKnob(k)
|
112
|
176
|
n.knob('gamma').setValue(1)
|
113
|
177
|
n.knob('gamma').setRange(0.2, 2)
|
114
|
178
|
|
115
|
179
|
# Compensate Mult
|
116
|
|
- k = nuke.Boolean_Knob('compensate', 'Compensate Mult')
|
|
180
|
+ k = nuke.Boolean_Knob('compensate', 'compensate mult')
|
117
|
181
|
n.addKnob(k)
|
118
|
182
|
n.knob('compensate').setValue(True)
|
119
|
183
|
n.knob('compensate').setFlag(nuke.STARTLINE)
|
120
|
184
|
|
121
|
185
|
# Reset Values
|
122
|
|
- k = nuke.PyScript_Knob('reset', 'Reset', 'ChannelSelect.resetValues(nuke.thisNode())')
|
|
186
|
+ k = nuke.PyScript_Knob('reset', 'reset', 'ChannelSelect.resetValues(nuke.thisNode())')
|
123
|
187
|
n.addKnob(k)
|
124
|
188
|
n.knob('reset').setTooltip('Reset Color Correct values')
|
125
|
189
|
n.knob('reset').setFlag(nuke.STARTLINE)
|
|
@@ -129,7 +193,7 @@ def createChannelSelect():
|
129
|
193
|
n.addKnob(k)
|
130
|
194
|
|
131
|
195
|
# Mode
|
132
|
|
- k = nuke.Enumeration_Knob('mode', 'Mode', MODES)
|
|
196
|
+ k = nuke.Enumeration_Knob('mode', 'mode', MODES)
|
133
|
197
|
n.addKnob(k)
|
134
|
198
|
k.setTooltip('MergeBackIntoStream: Shuffles the resolved aovs, applies the grading options and merges the result back to main comp stream\n\nSelectOnly: Just shuffles the resolved aovs and adds them together.\n\nLayerContactSheet: Displays the LayerContactSheet with layer names. Note. You need to Press Set in order for this to work. An empty Pattern is possible')
|
135
|
199
|
n.knob('mode').clearFlag(nuke.STARTLINE)
|
|
@@ -137,6 +201,7 @@ def createChannelSelect():
|
137
|
201
|
# refresh again
|
138
|
202
|
n.knob('pattern').setValue('*key*')
|
139
|
203
|
n.knob('pattern').setValue(PATTERNDEFAULT)
|
|
204
|
+ tmp = n.knob('resolved').getValue()
|
140
|
205
|
|
141
|
206
|
global INIT_DONE
|
142
|
207
|
INIT_DONE = True
|
|
@@ -145,12 +210,16 @@ def createChannelSelect():
|
145
|
210
|
|
146
|
211
|
def resetValues(n):
|
147
|
212
|
n['exposure'].setValue(0)
|
|
213
|
+ n['blackpoint'].setValue(0)
|
|
214
|
+ n['whitepoint'].setValue(1)
|
|
215
|
+ n['saturation'].setValue(1)
|
|
216
|
+ n['black'].setValue(0)
|
148
|
217
|
n['multiply'].setValue([1, 1, 1])
|
149
|
218
|
n['gamma'].setValue(1)
|
150
|
219
|
n['compensate'].setValue(True)
|
151
|
220
|
|
152
|
221
|
|
153
|
|
-def resolvePattern(n, pattern):
|
|
222
|
+def resolvePattern(n, pattern, pattern_exclude):
|
154
|
223
|
if pattern == "":
|
155
|
224
|
return None
|
156
|
225
|
|
|
@@ -160,14 +229,22 @@ def resolvePattern(n, pattern):
|
160
|
229
|
|
161
|
230
|
matchChannels = []
|
162
|
231
|
ignoreChannels = []
|
|
232
|
+ ignoreChannels2 = []
|
|
233
|
+
|
|
234
|
+ # pattern
|
163
|
235
|
for p in pattern.split(' '):
|
164
|
236
|
matchChannels += (fnmatch.filter(layers, p))
|
165
|
237
|
# excludes
|
166
|
238
|
if p[0] == '!' or p[0] == '^':
|
167
|
239
|
ignoreChannels += (fnmatch.filter(layers, p[1:]))
|
168
|
240
|
|
169
|
|
- matchChannels = list(set(matchChannels) - set(ignoreChannels))
|
|
241
|
+ # pattern exclude
|
|
242
|
+ for p in pattern_exclude.split(' '):
|
|
243
|
+ ignoreChannels2 += (fnmatch.filter(layers, p))
|
|
244
|
+
|
|
245
|
+ matchChannels = list(set(matchChannels) - set(ignoreChannels) - set(ignoreChannels2))
|
170
|
246
|
matchChannels.sort()
|
|
247
|
+
|
171
|
248
|
return matchChannels
|
172
|
249
|
|
173
|
250
|
|
|
@@ -177,7 +254,8 @@ def updatePattern(n):
|
177
|
254
|
|
178
|
255
|
# n = node
|
179
|
256
|
pattern = n['pattern'].value()
|
180
|
|
- resolved = resolvePattern(n, pattern)
|
|
257
|
+ pattern_exclude = n['pattern_exclude'].value()
|
|
258
|
+ resolved = resolvePattern(n, pattern,pattern_exclude)
|
181
|
259
|
|
182
|
260
|
# create nodes
|
183
|
261
|
# input and output of Group
|
|
@@ -186,7 +264,8 @@ def updatePattern(n):
|
186
|
264
|
|
187
|
265
|
# delete old nodes
|
188
|
266
|
g = nuke.toNode(n.name())
|
189
|
|
- oldNodes = [i for i in g.nodes() if '__' in i['name'].value()]
|
|
267
|
+ #oldNodes = [i for i in g.nodes() if '__' in i['name'].value()]
|
|
268
|
+ oldNodes = [i for i in g.nodes() if '__' in i['label'].value()]
|
190
|
269
|
|
191
|
270
|
for node in oldNodes:
|
192
|
271
|
nuke.delete(node)
|
|
@@ -194,71 +273,92 @@ def updatePattern(n):
|
194
|
273
|
# dot input
|
195
|
274
|
dot_input = nuke.nodes.Dot(xpos=input.xpos() , ypos=input.ypos()+100)
|
196
|
275
|
dot_input['name'].setValue('dot_input__')
|
197
|
|
- dot_input['label'].setValue('[value name]')
|
|
276
|
+ dot_input['label'].setValue('dot_input__')
|
198
|
277
|
#dot_input['note_font_size'].setValue(25)
|
199
|
278
|
# connect to the input1 node
|
200
|
279
|
|
201
|
280
|
# dot input 2
|
202
|
281
|
dot_input2 = nuke.nodes.Dot(xpos=dot_input.xpos()+1500 , ypos=dot_input.ypos())
|
203
|
282
|
dot_input2['name'].setValue('dot_input2__')
|
204
|
|
- dot_input2['label'].setValue('[value name]')
|
|
283
|
+ dot_input2['label'].setValue('dot_input2__')
|
205
|
284
|
#dot_input2['note_font_size'].setValue(25)
|
206
|
285
|
# connect to the input1 node
|
207
|
286
|
|
|
287
|
+ # unpremult
|
|
288
|
+ unpremult = nuke.nodes.Unpremult(xpos=dot_input.xpos()+700 , ypos=dot_input.ypos() )
|
|
289
|
+ #unpremult['name'].setValue('unpremult_node__')
|
|
290
|
+ unpremult['label'].setValue('unpremult__')
|
|
291
|
+
|
208
|
292
|
# dot resolved
|
209
|
293
|
dot_resolved = nuke.nodes.Dot(xpos=dot_input.xpos() , ypos=dot_input.ypos() + V_OFFSET)
|
210
|
294
|
dot_resolved['name'].setValue('dot_resolved__')
|
211
|
|
- dot_resolved['label'].setValue('[value name]')
|
|
295
|
+ dot_resolved['label'].setValue('dot_resolved__')
|
212
|
296
|
#dot_resolved['note_font_size'].setValue(25)
|
213
|
297
|
|
214
|
298
|
# dot resolved2
|
215
|
299
|
dot_resolved2 = nuke.nodes.Dot(xpos=dot_resolved.xpos() - 100, ypos=dot_resolved.ypos())
|
216
|
300
|
dot_resolved2['name'].setValue('dot_resolved2__')
|
217
|
|
- dot_resolved2['label'].setValue('[value name]')
|
|
301
|
+ dot_resolved2['label'].setValue('dot_resolved2__')
|
218
|
302
|
#dot_resolved2['note_font_size'].setValue(25)
|
219
|
303
|
|
220
|
304
|
# dot resolved3
|
221
|
305
|
dot_resolved3 = nuke.nodes.Dot(xpos=dot_resolved2.xpos(), ypos=dot_resolved.ypos() + V_OFFSET)
|
222
|
306
|
dot_resolved3['name'].setValue('dot_resolved3__')
|
223
|
|
- dot_resolved3['label'].setValue('[value name]')
|
|
307
|
+ dot_resolved3['label'].setValue('dot_resolved3__')
|
224
|
308
|
#dot_resolved3['note_font_size'].setValue(25)
|
225
|
309
|
|
226
|
310
|
# merge from
|
227
|
311
|
merge_from = nuke.nodes.Merge2(xpos=dot_input.xpos()+500 , ypos=dot_input.ypos() )
|
|
312
|
+ merge_from['operation'].setValue("merge_from__")
|
228
|
313
|
merge_from['name'].setValue('merge_from__')
|
229
|
|
- merge_from['operation'].setValue("from")
|
|
314
|
+ merge_from['label'].setValue('merge_from__')
|
230
|
315
|
|
231
|
316
|
# exposure
|
232
|
317
|
exposure = nuke.nodes.EXPTool(xpos=dot_resolved.xpos() , ypos=dot_resolved.ypos() + V_OFFSET)
|
233
|
318
|
exposure['name'].setValue('exposure__')
|
|
319
|
+ exposure['label'].setValue('exposure__')
|
234
|
320
|
|
235
|
321
|
# grade
|
236
|
322
|
grade = nuke.nodes.Grade(xpos=exposure.xpos() , ypos=exposure.ypos() + V_OFFSET)
|
237
|
323
|
grade['name'].setValue('grade__')
|
|
324
|
+ grade['label'].setValue('grade__')
|
|
325
|
+
|
|
326
|
+ # saturation
|
|
327
|
+ saturation = nuke.nodes.Saturation(xpos=grade.xpos() , ypos=exposure.ypos() + V_OFFSET)
|
|
328
|
+ saturation['name'].setValue('saturation__')
|
|
329
|
+ saturation['label'].setValue('saturation__')
|
238
|
330
|
|
239
|
331
|
# merge plus
|
240
|
|
- merge_plus = nuke.nodes.Merge2(xpos=grade.xpos() , ypos=grade.ypos() + V_OFFSET)
|
|
332
|
+ merge_plus = nuke.nodes.Merge2(xpos=saturation.xpos() , ypos=saturation.ypos() + V_OFFSET)
|
241
|
333
|
merge_plus['operation'].setValue("plus")
|
242
|
334
|
merge_plus['name'].setValue('merge_plus__')
|
|
335
|
+ merge_plus['label'].setValue('merge_plus__')
|
243
|
336
|
|
244
|
337
|
# dot input From
|
245
|
338
|
dot_input_from = nuke.nodes.Dot(xpos=merge_from.xpos() , ypos=merge_plus.ypos())
|
246
|
339
|
dot_input_from['name'].setValue('dot_input_from__')
|
247
|
|
- dot_input_from['label'].setValue('[value name]')
|
|
340
|
+ dot_input_from['label'].setValue('dot_input_from__')
|
248
|
341
|
#dot_input_from['note_font_size'].setValue(25)
|
249
|
342
|
|
250
|
343
|
# contact_sheet_all
|
251
|
344
|
contact_sheet_all = nuke.nodes.LayerContactSheet(xpos=merge_plus.xpos() +250 , ypos=merge_plus.ypos() + 200)
|
252
|
345
|
contact_sheet_all['name'].setValue('contact_sheet__')
|
|
346
|
+ contact_sheet_all['label'].setValue('contact_sheet__')
|
253
|
347
|
|
254
|
348
|
# switch
|
255
|
349
|
switch = nuke.nodes.Switch(xpos=merge_plus.xpos() , ypos=merge_plus.ypos() + V_OFFSET)
|
256
|
350
|
switch['name'].setValue('switch__')
|
|
351
|
+ switch['label'].setValue('switch__')
|
|
352
|
+
|
|
353
|
+ # premult
|
|
354
|
+ premult = nuke.nodes.Premult(xpos=switch.xpos()+50 , ypos=switch.ypos() )
|
|
355
|
+ #premult['name'].setValue('premult_node__')
|
|
356
|
+ premult['label'].setValue('premult_node__')
|
257
|
357
|
|
258
|
358
|
# dot output
|
259
|
359
|
dot_output = nuke.nodes.Dot(xpos=dot_input.xpos() , ypos=dot_input.ypos() + V_OFFSET)
|
260
|
360
|
dot_output['name'].setValue('dot_output__')
|
261
|
|
- dot_output['label'].setValue('[value name]')
|
|
361
|
+ dot_output['label'].setValue('dot_output__')
|
262
|
362
|
#dot_output['note_font_size'].setValue(25)
|
263
|
363
|
|
264
|
364
|
# create new nodes
|
|
@@ -276,6 +376,8 @@ def updatePattern(n):
|
276
|
376
|
shuffle['in2'].setValue('rgba')
|
277
|
377
|
shuffle['out'].setValue('rgb')
|
278
|
378
|
shuffle['name'].setValue('shuffle__' + str(i))
|
|
379
|
+ # set label of aov
|
|
380
|
+ shuffle['label'].setValue(resolved[i - 1] + '__')
|
279
|
381
|
# connect to the dot dot_input
|
280
|
382
|
shuffle.setInput(0, dot_input)
|
281
|
383
|
|
|
@@ -284,6 +386,7 @@ def updatePattern(n):
|
284
|
386
|
merge_resolved = nuke.nodes.Merge2(xpos=dot_input.xpos(), ypos=dot_output.ypos() + 50)
|
285
|
387
|
merge_resolved['operation'].setValue("plus")
|
286
|
388
|
merge_resolved['name'].setValue("merge_resolved__")
|
|
389
|
+ merge_resolved['label'].setValue("merge_resolved__")
|
287
|
390
|
|
288
|
391
|
# connect plus
|
289
|
392
|
# skip Mask Input
|
|
@@ -297,7 +400,8 @@ def updatePattern(n):
|
297
|
400
|
j += 1
|
298
|
401
|
|
299
|
402
|
# connect to the input1 node
|
300
|
|
- dot_resolved.setInput(0, merge_resolved)
|
|
403
|
+ unpremult.setInput(0,merge_resolved)
|
|
404
|
+ dot_resolved.setInput(0, unpremult)
|
301
|
405
|
|
302
|
406
|
else:
|
303
|
407
|
# shuffle
|
|
@@ -307,6 +411,7 @@ def updatePattern(n):
|
307
|
411
|
shuffle['in2'].setValue('none')
|
308
|
412
|
shuffle['out'].setValue('rgb')
|
309
|
413
|
shuffle['name'].setValue('shuffle_empty__')
|
|
414
|
+ shuffle['label'].setValue('shuffle_empty__')
|
310
|
415
|
|
311
|
416
|
shuffle.setInput(0, dot_input)
|
312
|
417
|
|
|
@@ -317,23 +422,24 @@ def updatePattern(n):
|
317
|
422
|
# connect to the input1 node
|
318
|
423
|
dot_resolved.setInput(0, shuffle)
|
319
|
424
|
|
320
|
|
-
|
321
|
425
|
# connect the nodes
|
322
|
426
|
dot_input.setInput(0, input)
|
323
|
427
|
dot_input2.setInput(0, dot_input)
|
324
|
428
|
dot_input_from.setInput(0, merge_from)
|
325
|
429
|
dot_resolved2.setInput(0, dot_resolved)
|
326
|
430
|
dot_resolved3.setInput(0, dot_resolved2)
|
327
|
|
- merge_plus.setInput(1, grade)
|
|
431
|
+ merge_plus.setInput(1, saturation)
|
328
|
432
|
merge_plus.setInput(0, dot_input_from)
|
329
|
433
|
grade.setInput(0, exposure)
|
|
434
|
+ saturation.setInput(0, grade)
|
330
|
435
|
exposure.setInput(0, dot_resolved)
|
331
|
436
|
merge_from.setInput(0, dot_input2)
|
332
|
437
|
merge_from.setInput(1, dot_resolved)
|
333
|
438
|
contact_sheet_all.setInput(0, dot_input2)
|
334
|
|
- switch.setInput(0, merge_plus)
|
|
439
|
+ switch.setInput(0, premult)
|
335
|
440
|
switch.setInput(1, contact_sheet_all)
|
336
|
441
|
switch.setInput(2, dot_resolved3)
|
|
442
|
+ premult.setInput(0,merge_plus)
|
337
|
443
|
dot_output.setInput(0,switch)
|
338
|
444
|
output.setInput(0, dot_output)
|
339
|
445
|
|
|
@@ -343,15 +449,36 @@ def updatePattern(n):
|
343
|
449
|
exposure['red'].setExpression('parent.exposure')
|
344
|
450
|
exposure['green'].setExpression('parent.exposure')
|
345
|
451
|
exposure['blue'].setExpression('parent.exposure')
|
346
|
|
- # init
|
|
452
|
+ unpremult['disable'].setExpression('parent.unpremult == 1 ? 0 :1')
|
|
453
|
+ premult['disable'].setExpression('parent.unpremult == 1 ? 0 :1')
|
|
454
|
+
|
347
|
455
|
grade['multiply'].setValue([1,1,1,1])
|
348
|
456
|
grade['multiply'].setExpression('parent.multiply.r',0)
|
349
|
457
|
grade['multiply'].setExpression('parent.multiply.g',1)
|
350
|
458
|
grade['multiply'].setExpression('parent.multiply.b',2)
|
351
|
|
- grade['multiply'].setValue(1, 3)
|
352
|
|
- # enable Compensate Mult by default
|
|
459
|
+
|
|
460
|
+ grade['blackpoint'].setValue([0,0,0,0])
|
|
461
|
+ grade['blackpoint'].setExpression('parent.blackpoint.r',0)
|
|
462
|
+ grade['blackpoint'].setExpression('parent.blackpoint.g',1)
|
|
463
|
+ grade['blackpoint'].setExpression('parent.blackpoint.b',2)
|
|
464
|
+
|
|
465
|
+ grade['whitepoint'].setValue([1,1,1,1])
|
|
466
|
+ grade['whitepoint'].setExpression('parent.whitepoint.r',0)
|
|
467
|
+ grade['whitepoint'].setExpression('parent.whitepoint.g',1)
|
|
468
|
+ grade['whitepoint'].setExpression('parent.whitepoint.b',2)
|
|
469
|
+
|
|
470
|
+ grade['black'].setValue([0,0,0,0])
|
|
471
|
+ grade['black'].setExpression('parent.black.r',0)
|
|
472
|
+ grade['black'].setExpression('parent.black.g',1)
|
|
473
|
+ grade['black'].setExpression('parent.black.b',2)
|
|
474
|
+
|
|
475
|
+ grade['white'].setValue([1, 1, 1, 1])
|
353
|
476
|
grade['white'].setExpression('parent.compensate == 1 ? 1/((parent.multiply.r+parent.multiply.g+parent.multiply.b)/3) : 1')
|
|
477
|
+ #grade['white'].setExpression(['parent.compensate == 1 ? 1/((parent.multiply.r+parent.multiply.g+parent.multiply.b)/3) : 1,parent.compensate == 1 ? 1/((parent.multiply.r+parent.multiply.g+parent.multiply.b)/3) : 1,parent.compensate == 1 ? 1/((parent.multiply.r+parent.multiply.g+parent.multiply.b)/3) : 1,1'])
|
354
|
478
|
grade['gamma'].setExpression('parent.gamma')
|
|
479
|
+
|
|
480
|
+ saturation['saturation'].setExpression('parent.saturation')
|
|
481
|
+
|
355
|
482
|
contact_sheet_all['width'].setExpression('parent.width')
|
356
|
483
|
contact_sheet_all['height'].setExpression('parent.height')
|
357
|
484
|
contact_sheet_all['showLayerNames'].setValue(1)
|
|
@@ -360,21 +487,24 @@ def updatePattern(n):
|
360
|
487
|
switch['which'].setExpression('parent.mode == 0 ? 0 :(parent.mode == 1 ? 2 : 1)')
|
361
|
488
|
|
362
|
489
|
# arrange the nodes
|
363
|
|
- weird_dot_offset = 0
|
364
|
|
- dot_input.setXYpos(input.xpos()+weird_dot_offset, input.ypos() + 100)
|
|
490
|
+ dot_input.setXYpos(input.xpos(), input.ypos() + 100)
|
365
|
491
|
if merge_resolved:
|
366
|
492
|
merge_resolved.setXYpos(input.xpos(), input.ypos() + 350)
|
367
|
|
- dot_resolved.setXYpos(input.xpos()+weird_dot_offset, input.ypos() + 500)
|
368
|
|
- dot_resolved2.setXYpos(dot_resolved.xpos()-250+weird_dot_offset, dot_resolved.ypos())
|
369
|
|
- dot_resolved3.setXYpos(dot_resolved2.xpos()+weird_dot_offset, dot_resolved2.ypos() + 500)
|
|
493
|
+ unpremult.setXYpos(merge_resolved.xpos(), merge_resolved.ypos() + 75)
|
|
494
|
+
|
|
495
|
+ dot_resolved.setXYpos(input.xpos(), input.ypos() + 500)
|
|
496
|
+ dot_resolved2.setXYpos(dot_resolved.xpos()-250, dot_resolved.ypos())
|
|
497
|
+ dot_resolved3.setXYpos(dot_resolved2.xpos(), dot_resolved2.ypos() + 500)
|
370
|
498
|
exposure.setXYpos(dot_resolved.xpos(), dot_resolved.ypos()+150)
|
371
|
499
|
grade.setXYpos(exposure.xpos(), exposure.ypos() + 150)
|
372
|
|
- merge_plus.setXYpos(grade.xpos(), grade.ypos() + 150)
|
373
|
|
- switch.setXYpos(merge_plus.xpos(), merge_plus.ypos() + 150)
|
374
|
|
- dot_output.setXYpos(switch.xpos()+weird_dot_offset, switch.ypos() + 150)
|
|
500
|
+ saturation.setXYpos(grade.xpos(), grade.ypos() + 150)
|
|
501
|
+ merge_plus.setXYpos(saturation.xpos(), saturation.ypos() + 150)
|
|
502
|
+ premult.setXYpos(merge_plus.xpos(), merge_plus.ypos() + 75)
|
|
503
|
+ switch.setXYpos(premult.xpos(), premult.ypos() + 150)
|
|
504
|
+ dot_output.setXYpos(switch.xpos(), switch.ypos() + 150)
|
375
|
505
|
output.setXYpos(dot_output.xpos(), dot_output.ypos() + 150)
|
376
|
506
|
merge_from.setXYpos(dot_input2.xpos(), dot_resolved.ypos())
|
377
|
|
- dot_input_from.setXYpos(merge_from.xpos()+weird_dot_offset, merge_plus.ypos())
|
|
507
|
+ dot_input_from.setXYpos(merge_from.xpos(), merge_plus.ypos())
|
378
|
508
|
|
379
|
509
|
n['label'].setValue('[value pattern]')
|
380
|
510
|
return None
|