Browse Source

2021-07-09

playInRV. Now can use Sequence and Shot Environment entries in order for RV to display Shot LUTs.
sceneControl. After a new shot is created the curresponding ENV variables are automatically exported.
Added Gimmicks for OCIO neutralgrade.
Added ColorPanel.
Added superpose for 12.2. (Schnelli)
channelSelect. Fixed incorrect merge mode.
channelSelect. Fixed issues when copying node.
our write. Fixed issue when color of write node does not change with changed compression mode.
our write. changed label to 'exr compression: [value compression]'
project defaults. Default exr write compression is now DWAA!
Martin Sächsinger 3 years ago
parent
commit
7b8d377071

+ 25
- 0
README.md View File

14
 - ffmpeg render: `F6`
14
 - ffmpeg render: `F6`
15
 - stamps: `F8`
15
 - stamps: `F8`
16
 - stacking backdrops (grey): `alt + b`
16
 - stacking backdrops (grey): `alt + b`
17
+- color panel: `shift + c`
17
 
18
 
18
 
19
 
19
 ##### New panels:
20
 ##### New panels:
54
 
55
 
55
 ##### Changelog:
56
 ##### Changelog:
56
 
57
 
58
+`2021-07-09`
59
+
60
+`playInRV. Now can use Sequence and Shot Environment entries in order for RV to display Shot LUTs.`
61
+
62
+`sceneControl. After a new shot is created the curresponding ENV variables are automatically exported.`
63
+
64
+`Added Gimmicks for OCIO neutralgrade.`
65
+
66
+`Added ColorPanel.`
67
+
68
+`Added superpose for 12.2. (Schnelli)`
69
+
70
+`channelSelect. Fixed incorrect merge mode.`
71
+
72
+`channelSelect. Fixed issues when copying node.`
73
+
74
+`our write. Fixed issue when color of write node does not change with changed compression mode.`
75
+
76
+`our write. changed label to 'exr compression: [value compression]'`
77
+
78
+`project defaults. Default exr write compression is now DWAA!`
79
+
80
+
81
+`__________`
57
 
82
 
58
 
83
 
59
 `2021-07-02`
84
 `2021-07-02`

+ 15
- 8
gimmicks/Gimmicks/_gen/BalanceGrade.gimmick View File

2
 version 12.2 v5
2
 version 12.2 v5
3
 push $cut_paste_input
3
 push $cut_paste_input
4
 Group {
4
 Group {
5
- name BalanceGrade3
6
- tile_color 0x6c9de1ff
5
+ name BalanceGrade1
6
+ tile_color 0xff
7
+ label "\[value sequence]_\[value shot]"
7
  selected true
8
  selected true
8
- xpos -641
9
- ypos 75
9
+ xpos 1986
10
+ ypos 327
10
  addUserKnob {20 BalanceGrade}
11
  addUserKnob {20 BalanceGrade}
11
  addUserKnob {26 ColorMatrix_label l "@b;ColorMatrix" T " "}
12
  addUserKnob {26 ColorMatrix_label l "@b;ColorMatrix" T " "}
12
  addUserKnob {41 matrix T ColorMatrix.matrix}
13
  addUserKnob {41 matrix T ColorMatrix.matrix}
39
  addUserKnob {26 ""}
40
  addUserKnob {26 ""}
40
  addUserKnob {6 invert t "Invert the color transform." +STARTLINE}
41
  addUserKnob {6 invert t "Invert the color transform." +STARTLINE}
41
  addUserKnob {41 export_cc l "Export CC" T OCIOCDLTransform.export_cc}
42
  addUserKnob {41 export_cc l "Export CC" T OCIOCDLTransform.export_cc}
42
- addUserKnob {22 export_spimtx l "Export spimtx" t "Export spimtx format describing the balancegrade.\n\nSupports saturation, primaries multiply, offset." T "from __future__ import print_function\nfrom __future__ import with_statement\nimport nuke\n\ndef mtx_mult(a, b):\n    # multiply two 3x3 matrices and return the result\n    a = \[a\[0:3], a\[3:6], a\[6:9]]\n    b = \[b\[0:3], b\[3:6], b\[6:9]]\n    c = \[\[sum(a * b for a, b in zip(a_row, b_col)) for b_col in zip(*b)] for a_row in a]\n    return c\[0] + c\[1] + c\[2]\n\ndef export_spimtx(output_path=None):\n    # export an spimtx file given the color transformations specified on the balancegrade node.\n    node = nuke.thisNode()\n    nuke.root().begin()\n    spimtx_calibration_only = node\['spimtx_calibration_only'].getValue()\n\n    if not output_path:\n        output_path = nuke.getFilename('output_path')\n    if not output_path:\n        print('Error: no output path specified. Exiting...')\n        return\n\n    with node:\n        cdltransform = nuke.toNode('OCIOCDLTransform')\n    \n    mtx = node\['matrix'].getValue()\n\n    if spimtx_calibration_only:\n        dst_mtx = mtx\n        offset = \[0, 0, 0]\n        slope = \[1, 1, 1]\n    else:\n        offset = cdltransform\['offset'].getValue()\n        slope = cdltransform\['slope'].getValue()\n        mult_mtx = \[slope\[0], 0, 0, 0, slope\[1], 0, 0, 0, slope\[2]]\n        dst_mtx = mtx_mult(mult_mtx, mtx)\n\n    output_spimtx_string = '\{0\} \{1\} \{2\} \{3\} \{4\} \{5\} \{6\} \{7\} \{8\} \{9\} \{10\} \{11\}'.format(\n        dst_mtx\[0],\n        dst_mtx\[1],\n        dst_mtx\[2],\n        int(round(offset\[0] * 65535)),\n        dst_mtx\[3],\n        dst_mtx\[4],\n        dst_mtx\[5],\n        int(round(offset\[1] * 65535)),\n        dst_mtx\[6],\n        dst_mtx\[7],\n        dst_mtx\[8],\n        int(round(offset\[2] * 65535))\n        )\n\n    # Create spimtx file\n    spimtx_file = open(output_path, 'w+')\n    spimtx_file.write(output_spimtx_string)\n    spimtx_file.close()\n\n\nif __name__=='__main__':\n    export_spimtx()" +STARTLINE}
43
+ addUserKnob {1 sequence}
44
+ sequence "\[value sceneCtrl.sequence]"
45
+ addUserKnob {1 shot -STARTLINE}
46
+ shot "\[value sceneCtrl.shot]"
47
+ addUserKnob {2 spimtx_path l "spimtx path"}
48
+ spimtx_path "\$env(PROJECT_ROOT_3D)/000_env/ocio/aces_1.2/luts/\$env(PROJECT)_\[value sequence]_\[value shot]_neutral.spimtx"
49
+ addUserKnob {22 export_spimtx l "Export spimtx" t "Export spimtx format describing the balancegrade.\n\nSupports saturation, primaries multiply, offset." T "from __future__ import print_function\nfrom __future__ import with_statement\nimport nuke\n\ndef mtx_mult(a, b):\n    # multiply two 3x3 matrices and return the result\n    a = \[a\[0:3], a\[3:6], a\[6:9]]\n    b = \[b\[0:3], b\[3:6], b\[6:9]]\n    c = \[\[sum(a * b for a, b in zip(a_row, b_col)) for b_col in zip(*b)] for a_row in a]\n    return c\[0] + c\[1] + c\[2]\n\ndef export_spimtx(output_path=None):\n    # export an spimtx file given the color transformations specified on the balancegrade node.\n    node = nuke.thisNode()\n    nuke.root().begin()\n    spimtx_calibration_only = node\['spimtx_calibration_only'].getValue()\n\n    if not output_path:\n        output_path = nuke.getFilename('output_path')\n    if not output_path:\n        print('Error: no output path specified. Exiting...')\n        return\n\n    with node:\n        cdltransform = nuke.toNode('OCIOCDLTransform')\n    \n    mtx = node\['matrix'].getValue()\n\n    if spimtx_calibration_only:\n        dst_mtx = mtx\n        offset = \[0, 0, 0]\n        slope = \[1, 1, 1]\n    else:\n        offset = cdltransform\['offset'].getValue()\n        slope = cdltransform\['slope'].getValue()\n        mult_mtx = \[slope\[0], 0, 0, 0, slope\[1], 0, 0, 0, slope\[2]]\n        dst_mtx = mtx_mult(mult_mtx, mtx)\n\n    output_spimtx_string = '\{0\} \{1\} \{2\} \{3\} \{4\} \{5\} \{6\} \{7\} \{8\} \{9\} \{10\} \{11\}'.format(\n        dst_mtx\[0],\n        dst_mtx\[1],\n        dst_mtx\[2],\n        int(round(offset\[0] * 65535)),\n        dst_mtx\[3],\n        dst_mtx\[4],\n        dst_mtx\[5],\n        int(round(offset\[1] * 65535)),\n        dst_mtx\[6],\n        dst_mtx\[7],\n        dst_mtx\[8],\n        int(round(offset\[2] * 65535))\n        )\n\n    # Create spimtx file\n    spimtx_file = open(output_path, 'w+')\n    spimtx_file.write(output_spimtx_string)\n    spimtx_file.close()\n    print('Balance Grade: Done writing spimtx file.')\n\n\nif __name__=='__main__':\n    node = nuke.thisNode()\n    outputpath = node\['spimtx_path'].evaluate()\n    if outputpath != '':\n        export_spimtx(outputpath)\n    else:\n        export_spimtx()" +STARTLINE}
43
  addUserKnob {6 spimtx_calibration_only l "calibration only" t "only export the colormatrix calibration to the spimtx file. \n\notherwise export the entire balancegrade to the spimtx file." -STARTLINE}
50
  addUserKnob {6 spimtx_calibration_only l "calibration only" t "only export the colormatrix calibration to the spimtx file. \n\notherwise export the entire balancegrade to the spimtx file." -STARTLINE}
44
 }
51
 }
45
  Input {
52
  Input {
57
   xpos -336
64
   xpos -336
58
   ypos -486
65
   ypos -486
59
  }
66
  }
60
-set N55320800 [stack 0]
67
+set N787cd800 [stack 0]
61
  OCIOCDLTransform {
68
  OCIOCDLTransform {
62
   slope {{parent.OCIOCDLTransform.slope} {parent.OCIOCDLTransform.slope} {parent.OCIOCDLTransform.slope}}
69
   slope {{parent.OCIOCDLTransform.slope} {parent.OCIOCDLTransform.slope} {parent.OCIOCDLTransform.slope}}
63
   offset {{parent.OCIOCDLTransform.offset} {parent.OCIOCDLTransform.offset} {parent.OCIOCDLTransform.offset}}
70
   offset {{parent.OCIOCDLTransform.offset} {parent.OCIOCDLTransform.offset} {parent.OCIOCDLTransform.offset}}
78
   xpos -260
85
   xpos -260
79
   ypos -370
86
   ypos -370
80
  }
87
  }
81
-push $N55320800
88
+push $N787cd800
82
  ColorMatrix {
89
  ColorMatrix {
83
   matrix {
90
   matrix {
84
       {1 0 0}
91
       {1 0 0}
110
   ypos -202
117
   ypos -202
111
  }
118
  }
112
 end_group
119
 end_group
113
-# Creation Time=Mon Jun 28 09:30:30 2021
120
+# Creation Time=Thu Jul  8 16:36:34 2021
114
 # Creator=Martin
121
 # Creator=Martin

+ 541
- 0
gimmicks/Gimmicks/_gen/HDR_Prepper.gimmick View File

1
+set cut_paste_input [stack 0]
2
+version 12.2 v5
3
+push $cut_paste_input
4
+Group {
5
+ name HDR_PREPPER
6
+ tile_color 1
7
+ label "\[value lightname]"
8
+ selected true
9
+ xpos 232
10
+ ypos -2
11
+ addUserKnob {20 light_ctrls l "Light Controls"}
12
+ addUserKnob {26 hdrPrepTag l INVISIBLE +INVISIBLE T "scoping sucks."}
13
+ addUserKnob {2 root_path l "Output Folder" t "Choose the root path of where to output the exr's."}
14
+ root_path /var/tmp
15
+ addUserKnob {22 setAllFolders l "Set all to this folder" t "Set all other HDRPreppers' output folders in this script to the path from this node." -STARTLINE T "n = nuke.thisNode()\nout = n\['root_path'].value()\nallGroupNodes = nuke.allNodes('Group', group = nuke.root())\n\nfor i in allGroupNodes:\n        if i.knob('hdrPrepTag'):\n            i\['root_path'].setValue(out)  \n"}
16
+ addUserKnob {1 lightname l "Light Name" t "Specify a unique name for this light."}
17
+ lightname light1
18
+ addUserKnob {22 setNameForSel l "Set selected to this name" t "All other HDR_PREPPERs that you select in the nodegraph will have the same light name like this one (numbered consecutively)." -STARTLINE T "n = nuke.thisNode()\nwith nuke.root():\n    sel = nuke.selectedNodes()\n\n#increase nummer list by number of HDR Preppers\n    num=\[]\n    for i in sel:\n        if i.knob('hdrPrepTag'):\n            num.append(i)\n\n    num=len(num)\n\n    name = n\['lightname'].getValue()\n    base=name\[:-1]\n    last=name\[-1]\n\n    allGroupNodes = nuke.allNodes('Group', group = nuke.root())\n    \n    if sel == \[]:\n        raise ValueError, 'No Nodes selected. Make sure to select other HDR_PREPPER Nodes.'\n    else:\n        pass\n\n#Set count to end number if there is one    \n    if last.isdigit() == True:\n        count = int(last)\n    else:\n        count = 1\n\n#Set count one number higher than original name if its not included in the selection\n    if not n in sel:\n        count = count + 1\n\n#Set last number to \"1\" on this node if it doesnt have a number at the end\n\n    if last.isdigit() == False:\n        n\['lightname'].setValue(name + str(1)) \n    else:\n        pass\n\n    while (count < num+1):    \n        for i in allGroupNodes:\n            if i in sel:\n                if i.knob('hdrPrepTag'):\n                    if last.isdigit() == False:\n                        newname=name + str(count)\n                    else:\n                        newname=base + str(count) \n                    i\['lightname'].setValue(newname) \n                    count = count + 1\n"}
19
+ addUserKnob {41 Render -STARTLINE T Write1.Render}
20
+ addUserKnob {20 EnvHDRGrp l "Env HDR Output" n 1}
21
+ EnvHDRGrp 0
22
+ addUserKnob {1 hdrname l "HDR Name" t "Specify a name for the environment HDR."}
23
+ hdrname env
24
+ addUserKnob {6 KeepInputFormat l "Keep Input Format" t "If checked the output will have the same format like the incoming format." +STARTLINE}
25
+ addUserKnob {4 setFormat l "| Format" -STARTLINE M {256x128 512x256 1024x512 2048x1024 4096x2048 8192x4096 custom "" "" ""}}
26
+ setFormat 1024x512
27
+ addUserKnob {6 envConvolve l "EnvConvolve (c) Michael Garrett" t "Convolve the output. You must have the EnvConvolve gizmo installed, otherwhise it won't work." +STARTLINE}
28
+ addUserKnob {7 exponent l "| exp" t "Set the environment convolution exponent. 1 represents a diffuse surface. Higher values exponentially increase specularity/glossiness." -STARTLINE R 1 100}
29
+ exponent 40
30
+ addUserKnob {22 createOut l "Create Env Output" T "sel = nuke.thisNode()\nformat = sel\['setFormat'].getValue()\n\nwith nuke.root():\n    #create Reformat\n    if sel\['KeepInputFormat'].value() == False:\n        ref=nuke.nodes.Reformat()\n        ref.setInput(0,sel)\n        if format == 0:\n            try:\n                Latlong256\n            except:\n                Latlong256=nuke.addFormat('256 128 1')\n            ref\['format'].setValue(Latlong256)\n            \n        if format == 1:\n            try:\n                Latlong512\n            except:\n                Latlong512=nuke.addFormat('512 256 1')\n            ref\['format'].setValue(Latlong512)\n            \n        if format == 2:\n            try:\n                Latlong1k\n            except:\n                Latlong1k=nuke.addFormat('1024 512 1')\n            ref\['format'].setValue(Latlong1k)\n            \n        if format == 3:\n            try:\n                Latlong2k\n            except:\n                Latlong2k=nuke.addFormat('2048 1024 1')\n            ref\['format'].setValue(Latlong2k)\n            \n        if format == 4:\n            try:\n                Latlong4k\n            except:\n                Latlong4k=nuke.addFormat('4096 2048 1')\n            ref\['format'].setValue(Latlong4k)\n            \n        if format == 5:\n            try:\n                Latlong8k\n            except:\n                Latlong8k=nuke.addFormat('8192 4096 1')\n            ref\['format'].setValue(Latlong8k)\n\n        if format == 6:\n            customRes = nuke.getInput('Custom Resolution:', '128x64')\n            if not 'x' in customRes:\n                raise ValueError, 'Make sure to use a proper format (Width x Height). For example 1024x512'\n\n            else:\n                reslist = customRes.split('x')\n                cRes = str(reslist\[0] + ' ' + reslist\[1] + ' 1')\n                LatlongCustom=nuke.addFormat(cRes)\n            ref\['format'].setValue(LatlongCustom)\n\n    #create EnvConvolve\n    if sel\['envConvolve'].value() == True: \n        conv=nuke.nodes.EnvConvolve()\n        if sel\['KeepInputFormat'].value() == False:\n            conv.setInput(0,ref)\n        else:\n            conv.setInput(0,sel)\n        exp=sel\['exponent'].getValue()\n        conv\['phexp'].setValue(exp)\n        conv\['label'].setValue('exp: \[value phexp]')       \n            \n\n    #create Write Node\n    wr=nuke.nodes.Write()\n    if sel\['KeepInputFormat'].value() == False:\n        if sel\['envConvolve'].value() == False:\n            wr.setInput(0,ref)\n        else:\n            wr.setInput(0,conv)\n    else:\n        if sel\['envConvolve'].value() == False:\n            wr.setInput(0,sel)\n        else:\n            wr.setInput(0,conv)\n\n    wr\['channels'].setValue('rgba')\n    outPath=sel\['root_path'].value()\n    outName=sel\['hdrname'].value()\n    wr\['file'].setValue(outPath + '/' + outName + '.exr')\n    wr\['file_type'].setValue('exr')\n    wr\['datatype'].setValue('32 bit float')\n" +STARTLINE}
31
+ addUserKnob {20 endGroup_2 l endGroup n -1}
32
+ addUserKnob {26 ""}
33
+ addUserKnob {20 lightremoval l "Light Removal Settings" n 1}
34
+ addUserKnob {41 area1 l Area t "Wrap this box tightly around the light source. This will define the output size of the extracted light." T Crop1.box}
35
+ addUserKnob {41 size l "Edge Smudge" t "Control the amount of edge pixels sucked into the light-crop area. Increase this value if holes appear." T Smudge1.size}
36
+ addUserKnob {14 FilterErode1_size l "Edge Extend" t "Extend the edges around the crop area to clean more of the surrounding pixels" R -100 100}
37
+ FilterErode1_size -10
38
+ addUserKnob {7 edge_blur1 l "Edge Blur" t "Blur the edges of the light-crop area." R 0 100}
39
+ edge_blur1 10
40
+ addUserKnob {6 rough_edge1 l "Rough Edge" t "Break up the edges. Best to be used with higher Edge Blur values." +STARTLINE}
41
+ addUserKnob {7 bring_details1 l Details t "Bring back original Details." R 0 100}
42
+ bring_details1 3.5
43
+ addUserKnob {41 detail_blur1 l "Detail Blur" t "Soften the re-introduced Details." T detailBlur1.size}
44
+ addUserKnob {41 useSingleColor l "Fill with constant color" t "Fill in the light area with a solid color." T Switch1.disable}
45
+ addUserKnob {41 singleColor l Color t "The color to fill the light area with if \"Use constant color\" is checked." T Grade2.black}
46
+ addUserKnob {20 endGroup n -1}
47
+ addUserKnob {26 ""}
48
+ addUserKnob {20 addCtrls l "Additional Controls" n 1}
49
+ addUserKnob {6 output_lightmask l "Output Lights Mask" t "Outputs the masks of the lights into the alpha channel." +STARTLINE}
50
+ output_lightmask true
51
+ addUserKnob {0 Shuffle4_disable t "Wheter to apply the edge extensions and blurs to the mask or not." -STARTLINE +INVISIBLE}
52
+ addUserKnob {20 endGroup_1 l endGroup n -1}
53
+}
54
+ BackdropNode {
55
+  inputs 0
56
+  name BackdropNode1
57
+  tile_color 0x565656ff
58
+  label details
59
+  note_font_size 42
60
+  xpos -580
61
+  ypos 1059
62
+  bdwidth 428
63
+  bdheight 279
64
+ }
65
+ Input {
66
+  inputs 0
67
+  name Input1
68
+  xpos -3
69
+  ypos 208
70
+ }
71
+ Dot {
72
+  name Dot39
73
+  xpos 31
74
+  ypos 309
75
+ }
76
+set N6831d400 [stack 0]
77
+ Dot {
78
+  name Dot38
79
+  xpos -611
80
+  ypos 309
81
+ }
82
+ Dot {
83
+  name Dot37
84
+  xpos -611
85
+  ypos 2190
86
+ }
87
+ Input {
88
+  inputs 0
89
+  name Mask
90
+  xpos -276
91
+  ypos 692
92
+  number 1
93
+ }
94
+set N6831c800 [stack 0]
95
+push $N6831d400
96
+ Shuffle {
97
+  alpha white
98
+  name Shuffle1
99
+  label "\[value in]"
100
+  xpos -3
101
+  ypos 368
102
+ }
103
+ Dot {
104
+  name Dot7
105
+  xpos 31
106
+  ypos 426
107
+ }
108
+ Dot {
109
+  name Dot3
110
+  xpos 31
111
+  ypos 601
112
+ }
113
+set N682cf800 [stack 0]
114
+ Crop {
115
+  box {250 100 450 300}
116
+  name Crop1
117
+  xpos -123
118
+  ypos 637
119
+ }
120
+ ChannelMerge {
121
+  inputs 2
122
+  operation multiply
123
+  name ChannelMerge2
124
+  xpos -123
125
+  ypos 680
126
+ }
127
+add_layer {lightmaskOrig lightmaskOrig.red lightmaskOrig.green lightmaskOrig.blue lightmaskOrig.alpha}
128
+ Shuffle {
129
+  red alpha
130
+  green alpha
131
+  blue alpha
132
+  out lightmaskOrig
133
+  name Shuffle3
134
+  label "\[value in]"
135
+  xpos -123
136
+  ypos 730
137
+ }
138
+ FilterErode {
139
+  channels rgba
140
+  size {{parent.FilterErode1_size.w} {parent.FilterErode1_size.h}}
141
+  name FilterErode1
142
+  xpos -123
143
+  ypos 772
144
+ }
145
+ Blur {
146
+  channels rgba
147
+  size {{parent.edge_blur1}}
148
+  name Blur1
149
+  label "\[value size]"
150
+  xpos -123
151
+  ypos 811
152
+ }
153
+ Dot {
154
+  name Dot31
155
+  xpos -89
156
+  ypos 882
157
+ }
158
+set N682ce000 [stack 0]
159
+ Dot {
160
+  name Dot33
161
+  xpos -159
162
+  ypos 882
163
+ }
164
+set N682cdc00 [stack 0]
165
+ FilterErode {
166
+  channels rgba
167
+  size -12
168
+  name FilterErode6
169
+  xpos -193
170
+  ypos 924
171
+ }
172
+push $N682cdc00
173
+ Dot {
174
+  name Dot32
175
+  xpos -255
176
+  ypos 882
177
+ }
178
+set N682cd400 [stack 0]
179
+ Shuffle {
180
+  red black
181
+  green black
182
+  blue black
183
+  alpha black
184
+  name Shuffle2
185
+  label "\[value in]"
186
+  xpos -289
187
+  ypos 908
188
+ }
189
+ Noise {
190
+  size 10.5
191
+  gain 0.46
192
+  gamma 0.635
193
+  center {1024 778}
194
+  name Noise1
195
+  xpos -289
196
+  ypos 957
197
+ }
198
+ Dot {
199
+  name Dot4
200
+  xpos -255
201
+  ypos 1018
202
+ }
203
+push $N682ce000
204
+ Merge2 {
205
+  inputs 2+1
206
+  operation color-dodge
207
+  name Merge16
208
+  xpos -123
209
+  ypos 1014
210
+  disable {{!parent.rough_edge1}}
211
+ }
212
+ Blur {
213
+  channels rgba
214
+  size 4
215
+  name Blur4
216
+  label "\[value size]"
217
+  xpos -123
218
+  ypos 1061
219
+  disable {{!parent.rough_edge1}}
220
+ }
221
+ Dot {
222
+  name Dot9
223
+  xpos -89
224
+  ypos 1597
225
+ }
226
+set N6827b800 [stack 0]
227
+ Shuffle {
228
+  in lightmaskOrig
229
+  red alpha
230
+  out alpha
231
+  name Shuffle4
232
+  label "\[value in]"
233
+  xpos -123
234
+  ypos 1677
235
+  disable {{!parent.Shuffle4_disable}}
236
+ }
237
+ Dot {
238
+  name Dot45
239
+  xpos -89
240
+  ypos 2017
241
+ }
242
+push $N6827b800
243
+push $N682cd400
244
+ Dot {
245
+  name Dot2
246
+  xpos -331
247
+  ypos 882
248
+ }
249
+push $N682cf800
250
+ Dot {
251
+  name Dot1
252
+  xpos -441
253
+  ypos 601
254
+ }
255
+ Colorspace {
256
+  colorspace_out Cineon
257
+  name Colorspace1
258
+  label "\[value colorspace_in] >> \[value colorspace_out]"
259
+  xpos -475
260
+  ypos 1139
261
+ }
262
+set N6827a400 [stack 0]
263
+push $N6827a400
264
+ Blur {
265
+  channels rgba
266
+  size {{parent.bring_details1}}
267
+  name details1
268
+  label "\[value size]"
269
+  xpos -570
270
+  ypos 1187
271
+ }
272
+ Merge2 {
273
+  inputs 2
274
+  operation minus
275
+  name Merge1
276
+  xpos -475
277
+  ypos 1233
278
+ }
279
+ Blur {
280
+  channels rgba
281
+  size 4
282
+  name detailBlur1
283
+  label "\[value size]"
284
+  xpos -475
285
+  ypos 1296
286
+ }
287
+ Merge2 {
288
+  inputs 2
289
+  operation mask
290
+  name Merge3
291
+  xpos -365
292
+  ypos 1302
293
+ }
294
+push $N682ce000
295
+push $N682cf800
296
+ ChannelMerge {
297
+  inputs 2
298
+  operation stencil
299
+  name ChannelMerge1
300
+  xpos -3
301
+  ypos 866
302
+ }
303
+ Premult {
304
+  name Premult1
305
+  xpos -3
306
+  ypos 1057
307
+ }
308
+ Blur {
309
+  channels rgba
310
+  size {65 65}
311
+  name Smudge1
312
+  label "\[value size]"
313
+  xpos -3
314
+  ypos 1083
315
+ }
316
+ Unpremult {
317
+  name Unpremult1
318
+  xpos -3
319
+  ypos 1121
320
+ }
321
+ Merge2 {
322
+  inputs 2
323
+  operation plus
324
+  name Merge2
325
+  xpos -3
326
+  ypos 1302
327
+ }
328
+ Clamp {
329
+  channels rgba
330
+  maximum 10000
331
+  name Clamp2
332
+  xpos -3
333
+  ypos 1328
334
+ }
335
+push $N682cf800
336
+ Dot {
337
+  name Dot6
338
+  xpos 122
339
+  ypos 601
340
+ }
341
+set N68a13400 [stack 0]
342
+ Grade {
343
+  black {0 0 0 0}
344
+  multiply 0
345
+  name Grade2
346
+  xpos 88
347
+  ypos 1335
348
+ }
349
+ Switch {
350
+  inputs 2
351
+  which 1
352
+  name Switch1
353
+  label singlecolor
354
+  xpos -3
355
+  ypos 1407
356
+ }
357
+ Shuffle {
358
+  alpha black
359
+  name Shuffle6
360
+  label "\[value in]"
361
+  xpos -3
362
+  ypos 1445
363
+ }
364
+ Dot {
365
+  name Dot5
366
+  xpos 31
367
+  ypos 1541
368
+ }
369
+push $N6831d400
370
+ Dot {
371
+  name Dot10
372
+  xpos 213
373
+  ypos 309
374
+ }
375
+ Keymix {
376
+  inputs 3
377
+  channels rgba
378
+  name Keymix1
379
+  xpos 179
380
+  ypos 1593
381
+ }
382
+ Grade {
383
+  name clamp_blacks
384
+  xpos 179
385
+  ypos 1894
386
+ }
387
+ ChannelMerge {
388
+  inputs 2
389
+  name ChannelMerge4
390
+  xpos 179
391
+  ypos 2001
392
+ }
393
+ Clamp {
394
+  channels alpha
395
+  name Clamp1
396
+  xpos 179
397
+  ypos 2074
398
+ }
399
+ ShuffleCopy {
400
+  inputs 2
401
+  name ShuffleCopy1
402
+  xpos 179
403
+  ypos 2186
404
+  disable {{parent.output_lightmask x1 1}}
405
+ }
406
+ Output {
407
+  name Output1
408
+  xpos 179
409
+  ypos 2625
410
+ }
411
+push $N6831c800
412
+push $N68a13400
413
+ Dot {
414
+  name Dot8
415
+  xpos 327
416
+  ypos 601
417
+ }
418
+ ChannelMerge {
419
+  inputs 2
420
+  operation multiply
421
+  name ChannelMerge3
422
+  xpos 293
423
+  ypos 680
424
+ }
425
+ Premult {
426
+  name Premult2
427
+  xpos 293
428
+  ypos 730
429
+ }
430
+ Crop {
431
+  box {{Crop1.box} {Crop1.box} {Crop1.box} {Crop1.box}}
432
+  softness {{Crop1.softness}}
433
+  reformat true
434
+  intersect {{Crop1.intersect}}
435
+  crop {{Crop1.crop x1250 0}}
436
+  name Crop1_clone1
437
+  xpos 293
438
+  ypos 756
439
+  icon "\[value Crop1.icon]"
440
+  bookmark {{Crop1.bookmark}}
441
+ }
442
+ Write {
443
+  channels rgba
444
+  file "\[value parent.root_path]/\[value parent.lightname].exr"
445
+  colorspace linear
446
+  raw true
447
+  file_type exr
448
+  datatype "32 bit float"
449
+  first_part rgba
450
+  version 4
451
+  name Write1
452
+  tile_color 0xb8b80001
453
+  label "\nexr compression: \[value compression]"
454
+  xpos 293
455
+  ypos 782
456
+  addUserKnob {20 Modules}
457
+  addUserKnob {4 write_modules l module M {" " Comp_footage Comp_render Weekly "Weekly Resolution"}}
458
+  addUserKnob {1 wm_layer l layer}
459
+  addUserKnob {22 trixter_update_me +INVISIBLE T "try:\n    import tx_nuke.write_modules as wm\n    wm.update_node(nuke.thisNode())\nexcept: pass" +STARTLINE}
460
+  addUserKnob {20 keller l Keller}
461
+  addUserKnob {4 extension l Extension M {" " cin dpx exr hdr jpeg "mov\t\t\tffmpeg" mxf null pic png sgi targa tiff xpm yuv}}
462
+  extension exr
463
+  addUserKnob {4 subtask l Subtask t "Defaults to the Task selected in sceneControl, ignoring Element and Info.\nAll other subtasks are pre-renders and get rendered into the precomp (=prerender) directory." M {--------------->}}
464
+  addUserKnob {22 w_reload l Reload t "Reload Tasks" -STARTLINE T sceneControl.kenvWriteReloadSubTasks(nuke.thisNode())}
465
+  addUserKnob {1 element l Element t "Optional Specifier. For example \[BG]_denoise. \[FG]_denoise."}
466
+  addUserKnob {1 info l Info t "Optional Info before Framenumber.\nPRO_comp3d_001_010.comp3d_v008.\[acescg].%04d.exr"}
467
+  addUserKnob {22 set l Set t "Set Output Path of this node" T sceneControl.kenvWriteSetPath(nuke.thisNode()) +STARTLINE}
468
+  addUserKnob {26 divider1 l "" +STARTLINE}
469
+  addUserKnob {6 ignore l "ignore in sceneControl" -STARTLINE}
470
+  addUserKnob {26 divider2 l "" +STARTLINE}
471
+  addUserKnob {22 playinrv l "Play in RV" t "Opens new instance of RV" T playInRV.playInRV(nuke.thisNode().knob('file').getValue(),0) +STARTLINE}
472
+  addUserKnob {22 pushtorv l "Push to RV" t "Push to tagged RV. Will open RV and uses this instance to directly push sequences." -STARTLINE T playInRV.playInRV(nuke.thisNode().knob('file').getValue(),1)}
473
+  addUserKnob {22 pushtorvappend l "Push to RV (append)" t "Push to RV and append to existing sources" -STARTLINE T playInRV.playInRV(nuke.thisNode().knob('file').getValue(),2)}
474
+  addUserKnob {26 divider3 l "" +STARTLINE}
475
+  addUserKnob {22 explore l Explore t "Open Folder" -STARTLINE T exploreThis.exploreThis()}
476
+  addUserKnob {78 ver l Version +HIDDEN n 1}
477
+  ver 1
478
+ }
479
+ NoOp {
480
+  inputs 0
481
+  name sceneCtrl
482
+  tile_color 0x3379a401
483
+  label "_\n__"
484
+  selected true
485
+  hide_input true
486
+  addUserKnob {20 main l Main}
487
+  addUserKnob {1 project l Project t "Project Shortname"}
488
+  project HOTZ
489
+  addUserKnob {4 dept l Dept t "Department. Changes tasks and servers." -STARTLINE M {comp anim cam dev model layout lookdev light shots sim}}
490
+  addUserKnob {4 task l Task -STARTLINE M {comp denoise key layout neutralgrade prep stabilize dev}}
491
+  addUserKnob {1 element l Element t "Optional Element." -STARTLINE}
492
+  addUserKnob {22 reloadConfig l Reload t "Reload project config file." -STARTLINE T sceneControl.kenvDelete()}
493
+  addUserKnob {1 season l Season +HIDDEN}
494
+  season 01
495
+  addUserKnob {1 episode l Episode +HIDDEN}
496
+  episode 101
497
+  addUserKnob {26 divider1 l "" +STARTLINE}
498
+  addUserKnob {1 sequence l Seq t "can be a sequence number or gen when doing generic tasks.\n\ncomp_001_010.comp_v01.ms.nk\ncomp_gen.footageIngest_v01.ms.nk"}
499
+  sequence 001
500
+  addUserKnob {1 shot l Shot t "can be a shot number or gen in a multiShot context.\n\ncomp_001_010.comp_v01.ms.nk\ncomp_001_gen.comp_v01.ms.nk" -STARTLINE}
501
+  shot 010
502
+  addUserKnob {3 major_version l Major t "Increment Major Version and save script"}
503
+  major_version 1
504
+  addUserKnob {22 increment_major_version l + -STARTLINE T sceneControl.increment_major_version()}
505
+  addUserKnob {3 minor_version l Minor t "Increment Minor Version and save script" -STARTLINE}
506
+  minor_version 1
507
+  addUserKnob {22 increment_minor_version l + -STARTLINE T sceneControl.increment_minor_version()}
508
+  addUserKnob {22 save_script l Save t "Save Script with current Major and Minor" -STARTLINE T sceneControl.save_script()}
509
+  addUserKnob {6 overwrite l Overwrite t "Automatically overwrite Scriptfiles without asking." -STARTLINE}
510
+  addUserKnob {1 info l Info t "Additional (mandatory) File Info."}
511
+  addUserKnob {1 user l User t "User Short. Reading Env Variable: USER" -STARTLINE}
512
+  user ms
513
+  addUserKnob {26 divider2 l "" +STARTLINE}
514
+  addUserKnob {1 folder l Folder t "Save folder Preview." +DISABLED}
515
+  folder "\$env(PROJECT_ROOT_2D)/300_work2D/comp/001/010/"
516
+  addUserKnob {6 useEnvProjectRoot l "Use Env Project Root" t "Use env variables for 2d and 3d servers set in the site_config.\nUse these env variables before nuke startup." -STARTLINE}
517
+  useEnvProjectRoot true
518
+  addUserKnob {1 file l File t "Save file Preview." +DISABLED}
519
+  file HOT_comp_001_010.comp_v001.001.ms.nk
520
+  addUserKnob {26 divider3 l "" +STARTLINE}
521
+  addUserKnob {3 fStart l Start t Startframe}
522
+  fStart 1001
523
+  addUserKnob {3 fCutIn l CutIn t CutIn -STARTLINE}
524
+  fCutIn 1001
525
+  addUserKnob {3 fCutOut l CutOut t CutOut -STARTLINE}
526
+  fCutOut 1001
527
+  addUserKnob {3 fEnd l End t Endframe -STARTLINE}
528
+  fEnd 1001
529
+  addUserKnob {22 get_framerange l "Get Range" t "Get Framerange from FTrack.\nPlease check you firewall rules and and allow ftrack ip 104.155.3.128 on port 443" -STARTLINE T sceneControl.get_framerange(nuke.thisNode())}
530
+  addUserKnob {22 set_framerange l "Set Range" t "Set Framerange from SceneControl Interface" -STARTLINE T sceneControl.set_framerange(nuke.thisNode())}
531
+  addUserKnob {43 comment l Comment}
532
+  addUserKnob {3 layerNum l Slots +HIDDEN}
533
+  addUserKnob {1 eval_helper +HIDDEN}
534
+  addUserKnob {6 stereoToggle l "Stereo Toggle" -STARTLINE +HIDDEN}
535
+  addUserKnob {1 precomp_output l "Precomp Output" +HIDDEN}
536
+  addUserKnob {6 debug l Debug -STARTLINE +HIDDEN}
537
+  debug true
538
+ }
539
+end_group
540
+# Creation Time=Wed Jul  7 12:46:20 2021
541
+# Creator=Martin

+ 169
- 0
gimmicks/Gimmicks/_gen/KeepChannels.gimmick View File

1
+set cut_paste_input [stack 0]
2
+version 12.2 v5
3
+push $cut_paste_input
4
+Group {
5
+ name Keep1
6
+ tile_color 1
7
+ label "keep beauty"
8
+ selected true
9
+ xpos 969
10
+ ypos 2620
11
+ addUserKnob {20 Keep}
12
+ addUserKnob {4 operation M {keep remove}}
13
+ addUserKnob {41 channels l 01 T Remove1.channels}
14
+ addUserKnob {41 channels2 l 02 T Remove1.channels2}
15
+ addUserKnob {41 channels3 l 03 T Remove1.channels3}
16
+ addUserKnob {41 channels4 l 04 T Remove1.channels4}
17
+ addUserKnob {41 channels2_1 l 05 T Remove2.channels2}
18
+ addUserKnob {41 channels3_1 l 06 T Remove2.channels3}
19
+ addUserKnob {41 channels4_1 l 07 T Remove2.channels4}
20
+ addUserKnob {41 channels_1 l 08 T Remove2.channels}
21
+ addUserKnob {41 channels2_2 l 09 T Remove3.channels2}
22
+ addUserKnob {41 channels3_2 l 10 T Remove3.channels3}
23
+ addUserKnob {41 channels4_2 l 11 T Remove3.channels4}
24
+ addUserKnob {41 channels_2 l 12 T Remove7.channels}
25
+ addUserKnob {41 channels2_3 l 13 T Remove7.channels2}
26
+ addUserKnob {41 channels3_3 l 14 T Remove7.channels3}
27
+ addUserKnob {41 channels4_3 l 15 T Remove7.channels4}
28
+}
29
+ Input {
30
+  inputs 0
31
+  name Input
32
+  xpos 228
33
+  ypos 110
34
+ }
35
+ Dot {
36
+  name Dot1
37
+  label " "
38
+  note_font "Helvetica Bold"
39
+  note_font_size 24
40
+  note_font_color 0xff000000
41
+  xpos 262
42
+  ypos 354
43
+ }
44
+set N1ac06800 [stack 0]
45
+ Dot {
46
+  name Dot2
47
+  label " "
48
+  note_font "Helvetica Bold"
49
+  note_font_size 24
50
+  note_font_color 0xa5a5a501
51
+  xpos 396
52
+  ypos 354
53
+ }
54
+ Remove {
55
+  channels {{{parent.Remove1.channels}}}
56
+  channels2 {{{parent.Remove1.channels2}}}
57
+  channels3 {{{parent.Remove1.channels3}}}
58
+  channels4 {{{parent.Remove1.channels4}}}
59
+  name Remove4
60
+  xpos 362
61
+  ypos 430
62
+ }
63
+ Remove {
64
+  channels {{{parent.Remove2.channels}}}
65
+  channels2 {{{parent.Remove2.channels2}}}
66
+  channels3 {{{parent.Remove2.channels3}}}
67
+  channels4 {{{parent.Remove2.channels4}}}
68
+  name Remove5
69
+  xpos 362
70
+  ypos 504
71
+ }
72
+ Remove {
73
+  channels {{{parent.Remove3.channels}}}
74
+  channels2 {{{parent.Remove3.channels2}}}
75
+  channels3 {{{parent.Remove3.channels3}}}
76
+  channels4 {{{parent.Remove3.channels4}}}
77
+  name Remove6
78
+  xpos 362
79
+  ypos 584
80
+ }
81
+ Remove {
82
+  channels {{{parent.Remove7.channels}}}
83
+  channels2 {{{parent.Remove7.channels2}}}
84
+  channels3 {{{parent.Remove7.channels3}}}
85
+  channels4 {{{parent.Remove7.channels4}}}
86
+  name Remove8
87
+  xpos 362
88
+  ypos 664
89
+ }
90
+ Dot {
91
+  name Dot3
92
+  label " "
93
+  note_font "Helvetica Bold"
94
+  note_font_size 24
95
+  note_font_color 0xa5a5a501
96
+  xpos 396
97
+  ypos 834
98
+ }
99
+push $N1ac06800
100
+ Remove {
101
+  operation keep
102
+  channels none
103
+  name Remove7
104
+  xpos -174
105
+  ypos 424
106
+ }
107
+push $N1ac06800
108
+ Remove {
109
+  operation keep
110
+  channels none
111
+  name Remove3
112
+  xpos -40
113
+  ypos 424
114
+ }
115
+push $N1ac06800
116
+ Remove {
117
+  operation keep
118
+  channels none
119
+  name Remove2
120
+  xpos 94
121
+  ypos 424
122
+ }
123
+push $N1ac06800
124
+ Remove {
125
+  operation keep
126
+  channels rgba
127
+  name Remove1
128
+  xpos 228
129
+  ypos 430
130
+ }
131
+ Copy {
132
+  inputs 2
133
+  channels all
134
+  bbox B
135
+  name Copy1
136
+  xpos 228
137
+  ypos 538
138
+ }
139
+ Copy {
140
+  inputs 2
141
+  channels all
142
+  bbox B
143
+  name Copy2
144
+  xpos 228
145
+  ypos 618
146
+ }
147
+ Copy {
148
+  inputs 2
149
+  channels all
150
+  bbox B
151
+  name Copy3
152
+  xpos 228
153
+  ypos 698
154
+ }
155
+ Switch {
156
+  inputs 2
157
+  which {{parent.operation}}
158
+  name _OPERATION_
159
+  xpos 228
160
+  ypos 830
161
+ }
162
+ Output {
163
+  name Output1
164
+  xpos 228
165
+  ypos 1150
166
+ }
167
+end_group
168
+# Creation Time=Tue Jul  6 14:33:59 2021
169
+# Creator=Martin

+ 460
- 0
gizmos/HDR_Prepper.gizmo View File

1
+set cut_paste_input [stack 0]
2
+version 7.0 v10
3
+push $cut_paste_input
4
+Group {
5
+ name HDR_PREPPER
6
+ label "\[value lightname]"
7
+ selected true
8
+ xpos -196
9
+ ypos -304
10
+ addUserKnob {20 light_ctrls l "Light Controls"}
11
+ addUserKnob {26 hdrPrepTag l INVISIBLE +INVISIBLE T "scoping sucks."}
12
+ addUserKnob {2 root_path l "Output Folder" t "Choose the root path of where to output the exr's."}
13
+ root_path /var/tmp
14
+ addUserKnob {22 setAllFolders l "Set all to this folder" t "Set all other HDRPreppers' output folders in this script to the path from this node." -STARTLINE T "n = nuke.thisNode()\nout = n\['root_path'].value()\nallGroupNodes = nuke.allNodes('Group', group = nuke.root())\n\nfor i in allGroupNodes:\n        if i.knob('hdrPrepTag'):\n            i\['root_path'].setValue(out)  \n"}
15
+ addUserKnob {1 lightname l "Light Name" t "Specify a unique name for this light."}
16
+ lightname light1
17
+ addUserKnob {22 setNameForSel l "Set selected to this name" t "All other HDR_PREPPERs that you select in the nodegraph will have the same light name like this one (numbered consecutively)." -STARTLINE T "n = nuke.thisNode()\nwith nuke.root():\n    sel = nuke.selectedNodes()\n\n#increase nummer list by number of HDR Preppers\n    num=\[]\n    for i in sel:\n        if i.knob('hdrPrepTag'):\n            num.append(i)\n\n    num=len(num)\n\n    name = n\['lightname'].getValue()\n    base=name\[:-1]\n    last=name\[-1]\n\n    allGroupNodes = nuke.allNodes('Group', group = nuke.root())\n    \n    if sel == \[]:\n        raise ValueError, 'No Nodes selected. Make sure to select other HDR_PREPPER Nodes.'\n    else:\n        pass\n\n#Set count to end number if there is one    \n    if last.isdigit() == True:\n        count = int(last)\n    else:\n        count = 1\n\n#Set count one number higher than original name if its not included in the selection\n    if not n in sel:\n        count = count + 1\n\n#Set last number to \"1\" on this node if it doesnt have a number at the end\n\n    if last.isdigit() == False:\n        n\['lightname'].setValue(name + str(1)) \n    else:\n        pass\n\n    while (count < num+1):    \n        for i in allGroupNodes:\n            if i in sel:\n                if i.knob('hdrPrepTag'):\n                    if last.isdigit() == False:\n                        newname=name + str(count)\n                    else:\n                        newname=base + str(count) \n                    i\['lightname'].setValue(newname) \n                    count = count + 1\n"}
18
+ addUserKnob {41 Render -STARTLINE T Write1.Render}
19
+ addUserKnob {20 EnvHDRGrp l "Env HDR Output" n 1}
20
+ EnvHDRGrp 0
21
+ addUserKnob {1 hdrname l "HDR Name" t "Specify a name for the environment HDR."}
22
+ hdrname env
23
+ addUserKnob {6 KeepInputFormat l "Keep Input Format" t "If checked the output will have the same format like the incoming format." +STARTLINE}
24
+ addUserKnob {4 setFormat l "| Format" -STARTLINE M {256x128 512x256 1024x512 2048x1024 4096x2048 8192x4096 custom "" "" ""}}
25
+ setFormat 1024x512
26
+ addUserKnob {6 envConvolve l "EnvConvolve (c) Michael Garrett" t "Convolve the output. You must have the EnvConvolve gizmo installed, otherwhise it won't work." +STARTLINE}
27
+ addUserKnob {7 exponent l "| exp" t "Set the environment convolution exponent. 1 represents a diffuse surface. Higher values exponentially increase specularity/glossiness." -STARTLINE R 1 100}
28
+ exponent 40
29
+ addUserKnob {22 createOut l "Create Env Output" T "sel = nuke.thisNode()\nformat = sel\['setFormat'].getValue()\n\nwith nuke.root():\n    #create Reformat\n    if sel\['KeepInputFormat'].value() == False:\n        ref=nuke.nodes.Reformat()\n        ref.setInput(0,sel)\n        if format == 0:\n            try:\n                Latlong256\n            except:\n                Latlong256=nuke.addFormat('256 128 1')\n            ref\['format'].setValue(Latlong256)\n            \n        if format == 1:\n            try:\n                Latlong512\n            except:\n                Latlong512=nuke.addFormat('512 256 1')\n            ref\['format'].setValue(Latlong512)\n            \n        if format == 2:\n            try:\n                Latlong1k\n            except:\n                Latlong1k=nuke.addFormat('1024 512 1')\n            ref\['format'].setValue(Latlong1k)\n            \n        if format == 3:\n            try:\n                Latlong2k\n            except:\n                Latlong2k=nuke.addFormat('2048 1024 1')\n            ref\['format'].setValue(Latlong2k)\n            \n        if format == 4:\n            try:\n                Latlong4k\n            except:\n                Latlong4k=nuke.addFormat('4096 2048 1')\n            ref\['format'].setValue(Latlong4k)\n            \n        if format == 5:\n            try:\n                Latlong8k\n            except:\n                Latlong8k=nuke.addFormat('8192 4096 1')\n            ref\['format'].setValue(Latlong8k)\n\n        if format == 6:\n            customRes = nuke.getInput('Custom Resolution:', '128x64')\n            if not 'x' in customRes:\n                raise ValueError, 'Make sure to use a proper format (Width x Height). For example 1024x512'\n\n            else:\n                reslist = customRes.split('x')\n                cRes = str(reslist\[0] + ' ' + reslist\[1] + ' 1')\n                LatlongCustom=nuke.addFormat(cRes)\n            ref\['format'].setValue(LatlongCustom)\n\n    #create EnvConvolve\n    if sel\['envConvolve'].value() == True: \n        conv=nuke.nodes.EnvConvolve()\n        if sel\['KeepInputFormat'].value() == False:\n            conv.setInput(0,ref)\n        else:\n            conv.setInput(0,sel)\n        exp=sel\['exponent'].getValue()\n        conv\['phexp'].setValue(exp)\n        conv\['label'].setValue('exp: \[value phexp]')       \n            \n\n    #create Write Node\n    wr=nuke.nodes.Write()\n    if sel\['KeepInputFormat'].value() == False:\n        if sel\['envConvolve'].value() == False:\n            wr.setInput(0,ref)\n        else:\n            wr.setInput(0,conv)\n    else:\n        if sel\['envConvolve'].value() == False:\n            wr.setInput(0,sel)\n        else:\n            wr.setInput(0,conv)\n\n    wr\['channels'].setValue('rgba')\n    outPath=sel\['root_path'].value()\n    outName=sel\['hdrname'].value()\n    wr\['file'].setValue(outPath + '/' + outName + '.exr')\n    wr\['file_type'].setValue('exr')\n    wr\['datatype'].setValue('32 bit float')\n" +STARTLINE}
30
+ addUserKnob {20 endGroup_2 l endGroup n -1}
31
+ addUserKnob {26 ""}
32
+ addUserKnob {20 lightremoval l "Light Removal Settings" n 1}
33
+ addUserKnob {41 area1 l Area t "Wrap this box tightly around the light source. This will define the output size of the extracted light." T Crop1.box}
34
+ addUserKnob {41 size l "Edge Smudge" t "Control the amount of edge pixels sucked into the light-crop area. Increase this value if holes appear." T Smudge1.size}
35
+ addUserKnob {14 FilterErode1_size l "Edge Extend" t "Extend the edges around the crop area to clean more of the surrounding pixels" R -100 100}
36
+ FilterErode1_size -10
37
+ addUserKnob {7 edge_blur1 l "Edge Blur" t "Blur the edges of the light-crop area." R 0 100}
38
+ edge_blur1 10
39
+ addUserKnob {6 rough_edge1 l "Rough Edge" t "Break up the edges. Best to be used with higher Edge Blur values." +STARTLINE}
40
+ addUserKnob {7 bring_details1 l Details t "Bring back original Details." R 0 100}
41
+ bring_details1 3.5
42
+ addUserKnob {41 detail_blur1 l "Detail Blur" t "Soften the re-introduced Details." T detailBlur1.size}
43
+ addUserKnob {41 useSingleColor l "Fill with constant color" t "Fill in the light area with a solid color." T Switch1.disable}
44
+ addUserKnob {41 singleColor l Color t "The color to fill the light area with if \"Use constant color\" is checked." T Grade2.black}
45
+ addUserKnob {20 endGroup n -1}
46
+ addUserKnob {26 ""}
47
+ addUserKnob {20 addCtrls l "Additional Controls" n 1}
48
+ addUserKnob {6 output_lightmask l "Output Lights Mask" t "Outputs the masks of the lights into the alpha channel." +STARTLINE}
49
+ output_lightmask true
50
+ addUserKnob {0 Shuffle4_disable t "Wheter to apply the edge extensions and blurs to the mask or not." -STARTLINE +INVISIBLE}
51
+ addUserKnob {20 endGroup_1 l endGroup n -1}
52
+}
53
+ BackdropNode {
54
+  inputs 0
55
+  name BackdropNode1
56
+  tile_color 0x565656ff
57
+  label details
58
+  note_font_size 42
59
+  xpos -580
60
+  ypos 1059
61
+  bdwidth 428
62
+  bdheight 279
63
+ }
64
+ Input {
65
+  inputs 0
66
+  name Input1
67
+  xpos -3
68
+  ypos 208
69
+ }
70
+ Dot {
71
+  name Dot39
72
+  xpos 31
73
+  ypos 309
74
+ }
75
+set N7cc55e0 [stack 0]
76
+ Dot {
77
+  name Dot38
78
+  xpos -611
79
+  ypos 309
80
+ }
81
+ Dot {
82
+  name Dot37
83
+  xpos -611
84
+  ypos 2190
85
+ }
86
+ Input {
87
+  inputs 0
88
+  name Mask
89
+  xpos -276
90
+  ypos 692
91
+  number 1
92
+ }
93
+set N7cd1970 [stack 0]
94
+push $N7cc55e0
95
+ Shuffle {
96
+  alpha white
97
+  name Shuffle1
98
+  label "\[value in]"
99
+  xpos -3
100
+  ypos 368
101
+ }
102
+ Dot {
103
+  name Dot7
104
+  xpos 31
105
+  ypos 426
106
+ }
107
+ Dot {
108
+  name Dot3
109
+  xpos 31
110
+  ypos 601
111
+ }
112
+set N7ce6cc0 [stack 0]
113
+ Crop {
114
+  box {250 100 450 300}
115
+  name Crop1
116
+  xpos -123
117
+  ypos 637
118
+ }
119
+ ChannelMerge {
120
+  inputs 2
121
+  operation multiply
122
+  name ChannelMerge2
123
+  xpos -123
124
+  ypos 680
125
+ }
126
+add_layer {lightmaskOrig lightmaskOrig.red lightmaskOrig.green lightmaskOrig.blue lightmaskOrig.alpha}
127
+ Shuffle {
128
+  red alpha
129
+  green alpha
130
+  blue alpha
131
+  out lightmaskOrig
132
+  name Shuffle3
133
+  label "\[value in]"
134
+  xpos -123
135
+  ypos 730
136
+ }
137
+ FilterErode {
138
+  channels rgba
139
+  size {{parent.FilterErode1_size.w} {parent.FilterErode1_size.h}}
140
+  name FilterErode1
141
+  xpos -123
142
+  ypos 772
143
+ }
144
+ Blur {
145
+  channels rgba
146
+  size {{parent.edge_blur1}}
147
+  name Blur1
148
+  label "\[value size]"
149
+  xpos -123
150
+  ypos 811
151
+ }
152
+ Dot {
153
+  name Dot31
154
+  xpos -89
155
+  ypos 882
156
+ }
157
+set N7d21ce0 [stack 0]
158
+ Dot {
159
+  name Dot33
160
+  xpos -159
161
+  ypos 882
162
+ }
163
+set N7d25ef0 [stack 0]
164
+ FilterErode {
165
+  channels rgba
166
+  size -12
167
+  name FilterErode6
168
+  xpos -193
169
+  ypos 924
170
+ }
171
+push $N7d25ef0
172
+ Dot {
173
+  name Dot32
174
+  xpos -255
175
+  ypos 882
176
+ }
177
+set N7d33eb0 [stack 0]
178
+ Shuffle {
179
+  red black
180
+  green black
181
+  blue black
182
+  alpha black
183
+  name Shuffle2
184
+  label "\[value in]"
185
+  xpos -289
186
+  ypos 908
187
+ }
188
+ Noise {
189
+  size 10.5
190
+  gain 0.46
191
+  gamma 0.635
192
+  center {1024 778}
193
+  name Noise1
194
+  xpos -289
195
+  ypos 957
196
+ }
197
+ Dot {
198
+  name Dot4
199
+  xpos -255
200
+  ypos 1018
201
+ }
202
+push $N7d21ce0
203
+ Merge2 {
204
+  inputs 2+1
205
+  operation color-dodge
206
+  name Merge16
207
+  xpos -123
208
+  ypos 1014
209
+  disable {{!parent.rough_edge1}}
210
+ }
211
+ Blur {
212
+  channels rgba
213
+  size 4
214
+  name Blur4
215
+  label "\[value size]"
216
+  xpos -123
217
+  ypos 1061
218
+  disable {{!parent.rough_edge1}}
219
+ }
220
+ Dot {
221
+  name Dot9
222
+  xpos -89
223
+  ypos 1597
224
+ }
225
+set N7d73970 [stack 0]
226
+ Shuffle {
227
+  in lightmaskOrig
228
+  red alpha
229
+  out alpha
230
+  name Shuffle4
231
+  label "\[value in]"
232
+  xpos -123
233
+  ypos 1677
234
+  disable {{!parent.Shuffle4_disable}}
235
+ }
236
+ Dot {
237
+  name Dot45
238
+  xpos -89
239
+  ypos 2017
240
+ }
241
+push $N7d73970
242
+push $N7d33eb0
243
+ Dot {
244
+  name Dot2
245
+  xpos -331
246
+  ypos 882
247
+ }
248
+push $N7ce6cc0
249
+ Dot {
250
+  name Dot1
251
+  xpos -441
252
+  ypos 601
253
+ }
254
+ Colorspace {
255
+  colorspace_out Cineon
256
+  name Colorspace1
257
+  label "\[value colorspace_in] >> \[value colorspace_out]"
258
+  xpos -475
259
+  ypos 1139
260
+ }
261
+set N7d91b80 [stack 0]
262
+push $N7d91b80
263
+ Blur {
264
+  channels rgba
265
+  size {{parent.bring_details1}}
266
+  name details1
267
+  label "\[value size]"
268
+  xpos -570
269
+  ypos 1187
270
+ }
271
+ Merge2 {
272
+  inputs 2
273
+  operation minus
274
+  name Merge1
275
+  xpos -475
276
+  ypos 1233
277
+ }
278
+ Blur {
279
+  channels rgba
280
+  size 4
281
+  name detailBlur1
282
+  label "\[value size]"
283
+  xpos -475
284
+  ypos 1296
285
+ }
286
+ Merge2 {
287
+  inputs 2
288
+  operation mask
289
+  name Merge3
290
+  xpos -365
291
+  ypos 1302
292
+ }
293
+push $N7d21ce0
294
+push $N7ce6cc0
295
+ ChannelMerge {
296
+  inputs 2
297
+  operation stencil
298
+  name ChannelMerge1
299
+  xpos -3
300
+  ypos 866
301
+ }
302
+ Premult {
303
+  name Premult1
304
+  xpos -3
305
+  ypos 1057
306
+ }
307
+ Blur {
308
+  channels rgba
309
+  size {65 65}
310
+  name Smudge1
311
+  label "\[value size]"
312
+  xpos -3
313
+  ypos 1083
314
+ }
315
+ Unpremult {
316
+  name Unpremult1
317
+  xpos -3
318
+  ypos 1121
319
+ }
320
+ Merge2 {
321
+  inputs 2
322
+  operation plus
323
+  name Merge2
324
+  xpos -3
325
+  ypos 1302
326
+ }
327
+ Clamp {
328
+  channels rgba
329
+  maximum 10000
330
+  name Clamp2
331
+  xpos -3
332
+  ypos 1328
333
+ }
334
+push $N7ce6cc0
335
+ Dot {
336
+  name Dot6
337
+  xpos 122
338
+  ypos 601
339
+ }
340
+set N7e10da0 [stack 0]
341
+ Grade {
342
+  black {0 0 0 0}
343
+  multiply 0
344
+  name Grade2
345
+  xpos 88
346
+  ypos 1335
347
+ }
348
+ Switch {
349
+  inputs 2
350
+  which 1
351
+  name Switch1
352
+  label singlecolor
353
+  xpos -3
354
+  ypos 1407
355
+ }
356
+ Shuffle {
357
+  alpha black
358
+  name Shuffle6
359
+  label "\[value in]"
360
+  xpos -3
361
+  ypos 1445
362
+ }
363
+ Dot {
364
+  name Dot5
365
+  xpos 31
366
+  ypos 1541
367
+ }
368
+push $N7cc55e0
369
+ Dot {
370
+  name Dot10
371
+  xpos 213
372
+  ypos 309
373
+ }
374
+ Keymix {
375
+  inputs 3
376
+  channels rgba
377
+  name Keymix1
378
+  xpos 179
379
+  ypos 1593
380
+ }
381
+ Grade {
382
+  name clamp_blacks
383
+  xpos 179
384
+  ypos 1894
385
+ }
386
+ ChannelMerge {
387
+  inputs 2
388
+  name ChannelMerge4
389
+  xpos 179
390
+  ypos 2001
391
+ }
392
+ Clamp {
393
+  channels alpha
394
+  name Clamp1
395
+  xpos 179
396
+  ypos 2074
397
+ }
398
+ ShuffleCopy {
399
+  inputs 2
400
+  name ShuffleCopy1
401
+  selected true
402
+  xpos 179
403
+  ypos 2186
404
+  disable {{parent.output_lightmask x1 1}}
405
+ }
406
+ Output {
407
+  name Output1
408
+  xpos 179
409
+  ypos 2625
410
+ }
411
+push $N7cd1970
412
+push $N7e10da0
413
+ Dot {
414
+  name Dot8
415
+  xpos 327
416
+  ypos 601
417
+ }
418
+ ChannelMerge {
419
+  inputs 2
420
+  operation multiply
421
+  name ChannelMerge3
422
+  xpos 293
423
+  ypos 680
424
+ }
425
+ Premult {
426
+  name Premult2
427
+  xpos 293
428
+  ypos 730
429
+ }
430
+ Crop {
431
+  box {{Crop1.box} {Crop1.box} {Crop1.box} {Crop1.box}}
432
+  softness {{Crop1.softness}}
433
+  reformat true
434
+  intersect {{Crop1.intersect}}
435
+  crop {{Crop1.crop x1250 0}}
436
+  name Crop1_clone1
437
+  xpos 293
438
+  ypos 756
439
+  icon "\[value Crop1.icon]"
440
+  bookmark {{Crop1.bookmark}}
441
+ }
442
+ Write {
443
+  channels rgba
444
+  file "\[value parent.root_path]/\[value parent.lightname].exr"
445
+  colorspace linear
446
+  raw true
447
+  file_type exr
448
+  datatype "32 bit float"
449
+  version 4
450
+  name Write1
451
+  label "\[value write_modules] \[value wm_layer]"
452
+  xpos 293
453
+  ypos 782
454
+  addUserKnob {20 Modules}
455
+  addUserKnob {4 write_modules l module M {" " Comp_footage Comp_render Weekly "Weekly Resolution"}}
456
+  addUserKnob {1 wm_layer l layer}
457
+  addUserKnob {22 trixter_update_me +INVISIBLE T "try:\n    import tx_nuke.write_modules as wm\n    wm.update_node(nuke.thisNode())\nexcept: pass" +STARTLINE}
458
+ }
459
+end_group
460
+

BIN
plugins/superpose.dll View File


+ 2
- 1
pythonplugins/_default_configs/projectDefaults.py View File

47
         nuke.knobDefault("Write.create_directories", "1")
47
         nuke.knobDefault("Write.create_directories", "1")
48
         nuke.knobDefault("Write.exr.noprefix", "1")
48
         nuke.knobDefault("Write.exr.noprefix", "1")
49
         nuke.knobDefault("Write.exr.metadata", "all metadata")
49
         nuke.knobDefault("Write.exr.metadata", "all metadata")
50
-
50
+        # exr compression
51
+        nuke.knobDefault("Write.exr.compression", "DWAA")
51
     def unconfigurePlugin(self):
52
     def unconfigurePlugin(self):
52
         pass
53
         pass

+ 14
- 0
pythonplugins/superpose/superposeDLL.py View File

1
+
2
+class SuperposeDLL(KellerNukePlugin):
3
+
4
+    def configurePlugin(self):
5
+      # Superpose
6
+      pass
7
+      nuke.load("superpose.dll")
8
+    
9
+
10
+
11
+    def unconfigurePlugin(self):
12
+        pass
13
+    
14
+

+ 5
- 5
pythonpluginsUI/ChannelSelect/ChannelSelect.py View File

113
     n.knob('resolved').setTooltip('These AOVs are found based on your search Pattern above. Press Set to use these aovs.')
113
     n.knob('resolved').setTooltip('These AOVs are found based on your search Pattern above. Press Set to use these aovs.')
114
 
114
 
115
     # Divide and Conquer
115
     # Divide and Conquer
116
-    k = nuke.Text_Knob('divider', '')
116
+    k = nuke.Text_Knob('divider1', '')
117
     n.addKnob(k)
117
     n.addKnob(k)
118
 
118
 
119
     # unpremult
119
     # unpremult
123
     n.knob('unpremult').setFlag(nuke.STARTLINE)
123
     n.knob('unpremult').setFlag(nuke.STARTLINE)
124
 
124
 
125
     # Divide and Conquer
125
     # Divide and Conquer
126
-    k = nuke.Text_Knob('divider', '')
126
+    k = nuke.Text_Knob('divider2', '')
127
     n.addKnob(k)
127
     n.addKnob(k)
128
 
128
 
129
     # Saturation
129
     # Saturation
133
     n.knob('saturation').setValue(1)
133
     n.knob('saturation').setValue(1)
134
 
134
 
135
     # Divide and Conquer
135
     # Divide and Conquer
136
-    k = nuke.Text_Knob('divider', '')
136
+    k = nuke.Text_Knob('divider3', '')
137
     n.addKnob(k)
137
     n.addKnob(k)
138
 
138
 
139
     # Exposure
139
     # Exposure
189
     n.knob('reset').setFlag(nuke.STARTLINE)
189
     n.knob('reset').setFlag(nuke.STARTLINE)
190
 
190
 
191
     # Divide and Conquer
191
     # Divide and Conquer
192
-    k = nuke.Text_Knob('divider', '')
192
+    k = nuke.Text_Knob('divider4', '')
193
     n.addKnob(k)
193
     n.addKnob(k)
194
 
194
 
195
     # Mode
195
     # Mode
309
 
309
 
310
     # merge from
310
     # merge from
311
     merge_from = nuke.nodes.Merge2(xpos=dot_input.xpos()+500 , ypos=dot_input.ypos() )
311
     merge_from = nuke.nodes.Merge2(xpos=dot_input.xpos()+500 , ypos=dot_input.ypos() )
312
-    merge_from['operation'].setValue("merge_from__")
312
+    merge_from['operation'].setValue('from')
313
     merge_from['name'].setValue('merge_from__')
313
     merge_from['name'].setValue('merge_from__')
314
     merge_from['label'].setValue('merge_from__')
314
     merge_from['label'].setValue('merge_from__')
315
 
315
 

+ 20
- 6
pythonpluginsUI/_generic/playInRV.py View File

12
         self.m.removeItem('Play in RV (append)')
12
         self.m.removeItem('Play in RV (append)')
13
 
13
 
14
 
14
 
15
-def playInRV(file, mode):
15
+def playInRV(node, mode):
16
     """
16
     """
17
     loads the file specified in the write node to a new or existing RV session
17
     loads the file specified in the write node to a new or existing RV session
18
     rvlink:// -l -play /path/to/my/movie.mov
18
     rvlink:// -l -play /path/to/my/movie.mov
25
     import random
25
     import random
26
     import nuke
26
     import nuke
27
 
27
 
28
+    file = node.knobs()['file'].getValue()
29
+    useshotenv = node.knobs()['useshotenv'].getValue()
28
     my_env = os.environ.copy()
30
     my_env = os.environ.copy()
29
 
31
 
32
+    if useshotenv == 0:
33
+        try:
34
+            del my_env['PREFIX']
35
+            del my_env['SEQ']
36
+            del my_env['SHOT']
37
+        except:
38
+            pass
30
     try:
39
     try:
31
         rvpush = my_env['RV'] + 'rvpush'
40
         rvpush = my_env['RV'] + 'rvpush'
32
         print(('playInRV: Info. Using RV: %s') % rvpush)
41
         print(('playInRV: Info. Using RV: %s') % rvpush)
35
         return
44
         return
36
 
45
 
37
     try:
46
     try:
38
-        job = my_env['JOB']
39
-        print(('playInRV: Info. Using JOB: %s') % job)
47
+        rv_gen_workgroup = my_env['RV_GEN_WORKGROUP']
48
+    except:
49
+        print('playInRV: Error. No env variable RV_GEN_WORKGROUP found. Exiting.')
50
+        return
51
+
52
+    try:
53
+        root3d = my_env['PROJECT_ROOT_3D']
54
+        print(('playInRV: Info. Using JOB: %s') % root3d)
40
     except:
55
     except:
41
         print('playInRV: Warning. No env variable job found.')
56
         print('playInRV: Warning. No env variable job found.')
42
         my_env['JOB'] = 'GEN'
57
         my_env['JOB'] = 'GEN'
48
         print('playInRV: Warning. No env variable dev found. Setting pub.')
63
         print('playInRV: Warning. No env variable dev found. Setting pub.')
49
         my_env['DEV'] = "0"
64
         my_env['DEV'] = "0"
50
 
65
 
51
-    # TODO: check 000_dev/000_env vs dev/pub
52
     # check with default project without dev/pub structure
66
     # check with default project without dev/pub structure
53
     if my_env['JOB'] == 'GEN':
67
     if my_env['JOB'] == 'GEN':
54
         pass
68
         pass
55
     if my_env['DEV'] == "0":
69
     if my_env['DEV'] == "0":
56
-        my_env['RV_SUPPORT_PATH'] = job.replace('"', '').replace('\\', '/') + '/000_env/rv/'
70
+        my_env['RV_SUPPORT_PATH'] = rv_gen_workgroup.replace('"', '').replace('\\', '/') + ';' + root3d.replace('"', '').replace('\\', '/') + '/000_env/rv/'
57
     else:
71
     else:
58
-        my_env['RV_SUPPORT_PATH'] = job.replace('"', '').replace('\\', '/') + '/000_dev/rv/'
72
+        my_env['RV_SUPPORT_PATH'] = rv_gen_workgroup.replace('"', '').replace('\\', '/') + ';' + root3d.replace('"', '').replace('\\', '/') + '/000_dev/rv/'
59
     print(('playInRV: Info. Using RV Workgroup: %s') % my_env['RV_SUPPORT_PATH'])
73
     print(('playInRV: Info. Using RV Workgroup: %s') % my_env['RV_SUPPORT_PATH'])
60
 
74
 
61
     if nuke.root()['colorManagement'].value().lower() != 'ocio':
75
     if nuke.root()['colorManagement'].value().lower() != 'ocio':

+ 2
- 2
pythonpluginsUI/_menu/menuWrapper.py View File

10
 import kellertools
10
 import kellertools
11
 import stamps
11
 import stamps
12
 import GrayAutoBackdrop
12
 import GrayAutoBackdrop
13
-#import ffmpeg_render
13
+import ColorPanel
14
 
14
 
15
 
15
 
16
 class KellerPluginKoppler(KellerNukePlugin):
16
 class KellerPluginKoppler(KellerNukePlugin):
66
         m.addCommand("Read from Write", 'read_from_write.ReadFromWrite()', "#+R")
66
         m.addCommand("Read from Write", 'read_from_write.ReadFromWrite()', "#+R")
67
         m.addCommand("Write from Read", 'makewritefromread.make_write_from_read()', "shift+R")
67
         m.addCommand("Write from Read", 'makewritefromread.make_write_from_read()', "shift+R")
68
         m.addCommand("Paste to selected", 'pasteToSelected.pasteToSelected()', 'ctrl+shift+v')
68
         m.addCommand("Paste to selected", 'pasteToSelected.pasteToSelected()', 'ctrl+shift+v')
69
-
69
+        m.addCommand('ColorPanel', 'ColorPanel.colorPanel()', 'shift+c', icon="")
70
         # SCENECONTROL MENU IS DEFINED INSIDE sceneControl.py
70
         # SCENECONTROL MENU IS DEFINED INSIDE sceneControl.py

BIN
pythonpluginsUI/colorpanel/ColorPanel.png View File


+ 423
- 0
pythonpluginsUI/colorpanel/ColorPanel.py View File

1
+#############################################################
2
+###############COLOR PANEL PySIDE V1.5#######################
3
+#################by Andrea Geremia###########################
4
+###############www.andreageremia.it##########################
5
+#############################################################
6
+#############compatible with Nuke 13#########################
7
+#############################################################
8
+import os
9
+import nuke
10
+import webbrowser
11
+#---------------------------------------------------------
12
+
13
+if nuke.NUKE_VERSION_MAJOR < 11:
14
+	from PySide.QtGui import *
15
+	from PySide.QtCore import *
16
+	from PySide.QtUiTools import QUiLoader
17
+	from PySide import QtCore, QtGui, QtUiTools, QtGui as QtWidgets
18
+else:
19
+	from PySide2.QtGui import *
20
+	from PySide2.QtCore import *
21
+	from PySide2.QtUiTools import QUiLoader
22
+	from PySide2 import QtCore, QtGui, QtUiTools, QtGui, QtWidgets
23
+
24
+
25
+thisFileDir = os.path.dirname(os.path.realpath(__file__))
26
+file_interface = os.path.join(thisFileDir, "ColorPanel.ui")
27
+
28
+
29
+global color_copied
30
+color_copied = None
31
+
32
+
33
+#---------------------------------------------------------
34
+class MyWindow(QtWidgets.QMainWindow):
35
+    def __init__(self, parent=None):
36
+        super(MyWindow, self).__init__(parent)
37
+        self.main_widget = self.load_ui(file_interface)
38
+        self.setCentralWidget(self.main_widget)
39
+        self.setWindowTitle("ColorPanel")
40
+        #windows always on top
41
+        self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
42
+        
43
+        #set Fixed Sizes
44
+        self.setFixedWidth(370)
45
+        self.setFixedHeight(678)
46
+
47
+        self.load_ui_elements()
48
+
49
+
50
+    def load_ui(self, ui_file):
51
+        loader = QUiLoader()
52
+        file = QFile(ui_file)
53
+        file.open(QFile.ReadOnly)
54
+        myWidget = loader.load(file, None)
55
+        file.close()
56
+        return myWidget
57
+
58
+
59
+    def load_ui_elements(self):
60
+            self.button1 = self.main_widget.findChild(QtWidgets.QPushButton, 'button1')
61
+            self.button1.clicked.connect(lambda: self.changeColorNode(self.button1.styleSheet()))
62
+
63
+            self.button2 = self.main_widget.findChild(QtWidgets.QPushButton, 'button2')
64
+            self.button2.clicked.connect(lambda: self.changeColorNode(self.button2.styleSheet()))
65
+
66
+            self.button3 = self.main_widget.findChild(QtWidgets.QPushButton, 'button3')
67
+            self.button3.clicked.connect(lambda: self.changeColorNode(self.button3.styleSheet()))
68
+
69
+            self.button4 = self.main_widget.findChild(QtWidgets.QPushButton, 'button4')
70
+            self.button4.clicked.connect(lambda: self.changeColorNode(self.button4.styleSheet()))
71
+
72
+            self.button5 = self.main_widget.findChild(QtWidgets.QPushButton, 'button5')
73
+            self.button5.clicked.connect(lambda: self.changeColorNode(self.button5.styleSheet()))
74
+
75
+            self.button6 = self.main_widget.findChild(QtWidgets.QPushButton, 'button6')
76
+            self.button6.clicked.connect(lambda: self.changeColorNode(self.button6.styleSheet()))  
77
+
78
+            self.button7 = self.main_widget.findChild(QtWidgets.QPushButton, 'button7')
79
+            self.button7.clicked.connect(lambda: self.changeColorNode(self.button7.styleSheet()))
80
+
81
+            self.button8 = self.main_widget.findChild(QtWidgets.QPushButton, 'button8')
82
+            self.button8.clicked.connect(lambda: self.changeColorNode(self.button8.styleSheet()))
83
+
84
+            self.button9 = self.main_widget.findChild(QtWidgets.QPushButton, 'button9')
85
+            self.button9.clicked.connect(lambda: self.changeColorNode(self.button9.styleSheet()))
86
+
87
+            self.button10 = self.main_widget.findChild(QtWidgets.QPushButton, 'button10')
88
+            self.button10.clicked.connect(lambda: self.changeColorNode(self.button10.styleSheet()))
89
+
90
+            self.button11 = self.main_widget.findChild(QtWidgets.QPushButton, 'button11')
91
+            self.button11.clicked.connect(lambda: self.changeColorNode(self.button11.styleSheet()))    
92
+
93
+            self.button12 = self.main_widget.findChild(QtWidgets.QPushButton, 'button12')
94
+            self.button12.clicked.connect(lambda: self.changeColorNode(self.button12.styleSheet()))
95
+
96
+            self.button13 = self.main_widget.findChild(QtWidgets.QPushButton, 'button13')
97
+            self.button13.clicked.connect(lambda: self.changeColorNode(self.button13.styleSheet()))
98
+
99
+            self.button14 = self.main_widget.findChild(QtWidgets.QPushButton, 'button14')
100
+            self.button14.clicked.connect(lambda: self.changeColorNode(self.button14.styleSheet()))        
101
+
102
+            self.button15 = self.main_widget.findChild(QtWidgets.QPushButton, 'button15')
103
+            self.button15.clicked.connect(lambda: self.changeColorNode(self.button15.styleSheet()))
104
+
105
+            self.button16 = self.main_widget.findChild(QtWidgets.QPushButton, 'button16')
106
+            self.button16.clicked.connect(lambda: self.changeColorNode(self.button16.styleSheet()))
107
+
108
+            self.button17 = self.main_widget.findChild(QtWidgets.QPushButton, 'button17')
109
+            self.button17.clicked.connect(lambda: self.changeColorNode(self.button17.styleSheet()))
110
+            
111
+            self.button18 = self.main_widget.findChild(QtWidgets.QPushButton, 'button18')
112
+            self.button18.clicked.connect(lambda: self.changeColorNode(self.button18.styleSheet()))
113
+
114
+            self.button19 = self.main_widget.findChild(QtWidgets.QPushButton, 'button19')
115
+            self.button19.clicked.connect(lambda: self.changeColorNode(self.button19.styleSheet()))
116
+
117
+            self.button20 = self.main_widget.findChild(QtWidgets.QPushButton, 'button20')
118
+            self.button20.clicked.connect(lambda: self.changeColorNode(self.button20.styleSheet()))
119
+
120
+            self.button21 = self.main_widget.findChild(QtWidgets.QPushButton, 'button21')
121
+            self.button21.clicked.connect(lambda: self.changeColorNode(self.button21.styleSheet()))
122
+
123
+            self.button22 = self.main_widget.findChild(QtWidgets.QPushButton, 'button22')
124
+            self.button22.clicked.connect(lambda: self.changeColorNode(self.button22.styleSheet()))
125
+
126
+            self.button23 = self.main_widget.findChild(QtWidgets.QPushButton, 'button23')
127
+            self.button23.clicked.connect(lambda: self.changeColorNode(self.button23.styleSheet()))  
128
+
129
+            self.button24 = self.main_widget.findChild(QtWidgets.QPushButton, 'button24')
130
+            self.button24.clicked.connect(lambda: self.changeColorNode(self.button24.styleSheet()))
131
+
132
+            self.button25 = self.main_widget.findChild(QtWidgets.QPushButton, 'button25')
133
+            self.button25.clicked.connect(lambda: self.changeColorNode(self.button25.styleSheet()))
134
+
135
+            self.button26 = self.main_widget.findChild(QtWidgets.QPushButton, 'button26')
136
+            self.button26.clicked.connect(lambda: self.changeColorNode(self.button26.styleSheet()))
137
+
138
+            self.button27 = self.main_widget.findChild(QtWidgets.QPushButton, 'button27')
139
+            self.button27.clicked.connect(lambda: self.changeColorNode(self.button27.styleSheet()))
140
+
141
+            self.button28 = self.main_widget.findChild(QtWidgets.QPushButton, 'button28')
142
+            self.button28.clicked.connect(lambda: self.changeColorNode(self.button28.styleSheet()))    
143
+
144
+            self.button29 = self.main_widget.findChild(QtWidgets.QPushButton, 'button29')
145
+            self.button29.clicked.connect(lambda: self.changeColorNode(self.button29.styleSheet()))
146
+
147
+            self.button30 = self.main_widget.findChild(QtWidgets.QPushButton, 'button30')
148
+            self.button30.clicked.connect(lambda: self.changeColorNode(self.button30.styleSheet()))
149
+
150
+            self.button31 = self.main_widget.findChild(QtWidgets.QPushButton, 'button31')
151
+            self.button31.clicked.connect(lambda: self.changeColorNode(self.button31.styleSheet()))
152
+
153
+            self.button32 = self.main_widget.findChild(QtWidgets.QPushButton, 'button32')
154
+            self.button32.clicked.connect(lambda: self.changeColorNode(self.button32.styleSheet()))
155
+
156
+            self.button33 = self.main_widget.findChild(QtWidgets.QPushButton, 'button33')
157
+            self.button33.clicked.connect(lambda: self.changeColorNode(self.button33.styleSheet()))
158
+
159
+            self.button34 = self.main_widget.findChild(QtWidgets.QPushButton, 'button34')
160
+            self.button34.clicked.connect(lambda: self.changeColorNode(self.button34.styleSheet()))
161
+
162
+            self.button35 = self.main_widget.findChild(QtWidgets.QPushButton, 'button35')
163
+            self.button35.clicked.connect(lambda: self.changeColorNode(self.button35.styleSheet()))
164
+
165
+            self.button36 = self.main_widget.findChild(QtWidgets.QPushButton, 'button36')
166
+            self.button36.clicked.connect(lambda: self.changeColorNode(self.button36.styleSheet()))  
167
+
168
+            self.button37 = self.main_widget.findChild(QtWidgets.QPushButton, 'button37')
169
+            self.button37.clicked.connect(lambda: self.changeColorNode(self.button37.styleSheet()))
170
+
171
+            self.button38 = self.main_widget.findChild(QtWidgets.QPushButton, 'button38')
172
+            self.button38.clicked.connect(lambda: self.changeColorNode(self.button38.styleSheet()))
173
+
174
+            self.button39 = self.main_widget.findChild(QtWidgets.QPushButton, 'button39')
175
+            self.button39.clicked.connect(lambda: self.changeColorNode(self.button39.styleSheet()))
176
+
177
+            self.button40 = self.main_widget.findChild(QtWidgets.QPushButton, 'button40')
178
+            self.button40.clicked.connect(lambda: self.changeColorNode(self.button40.styleSheet()))
179
+
180
+            self.button41 = self.main_widget.findChild(QtWidgets.QPushButton, 'button41')
181
+            self.button41.clicked.connect(lambda: self.changeColorNode(self.button41.styleSheet()))    
182
+
183
+            self.button42 = self.main_widget.findChild(QtWidgets.QPushButton, 'button42')
184
+            self.button42.clicked.connect(lambda: self.changeColorNode(self.button42.styleSheet()))
185
+
186
+            self.button43 = self.main_widget.findChild(QtWidgets.QPushButton, 'button43')
187
+            self.button43.clicked.connect(lambda: self.changeColorNode(self.button43.styleSheet()))
188
+
189
+            self.button44 = self.main_widget.findChild(QtWidgets.QPushButton, 'button44')
190
+            self.button44.clicked.connect(lambda: self.changeColorNode(self.button44.styleSheet()))        
191
+
192
+            self.button45 = self.main_widget.findChild(QtWidgets.QPushButton, 'button45')
193
+            self.button45.clicked.connect(lambda: self.changeColorNode(self.button45.styleSheet()))
194
+
195
+            self.button46 = self.main_widget.findChild(QtWidgets.QPushButton, 'button46')
196
+            self.button46.clicked.connect(lambda: self.changeColorNode(self.button46.styleSheet()))
197
+
198
+            self.button47 = self.main_widget.findChild(QtWidgets.QPushButton, 'button47')
199
+            self.button47.clicked.connect(lambda: self.changeColorNode(self.button47.styleSheet()))
200
+            
201
+            self.button48 = self.main_widget.findChild(QtWidgets.QPushButton, 'button48')
202
+            self.button48.clicked.connect(lambda: self.changeColorNode(self.button48.styleSheet()))
203
+
204
+            self.button49 = self.main_widget.findChild(QtWidgets.QPushButton, 'button49')
205
+            self.button49.clicked.connect(lambda: self.changeColorNode(self.button49.styleSheet()))
206
+
207
+            self.button50 = self.main_widget.findChild(QtWidgets.QPushButton, 'button50')
208
+            self.button50.clicked.connect(lambda: self.changeColorNode(self.button50.styleSheet()))
209
+
210
+            self.button51 = self.main_widget.findChild(QtWidgets.QPushButton, 'button51')
211
+            self.button51.clicked.connect(lambda: self.changeColorNode(self.button51.styleSheet()))
212
+
213
+            self.button52 = self.main_widget.findChild(QtWidgets.QPushButton, 'button52')
214
+            self.button52.clicked.connect(lambda: self.changeColorNode(self.button52.styleSheet()))
215
+
216
+            self.button53 = self.main_widget.findChild(QtWidgets.QPushButton, 'button53')
217
+            self.button53.clicked.connect(lambda: self.changeColorNode(self.button53.styleSheet()))  
218
+
219
+            self.button54 = self.main_widget.findChild(QtWidgets.QPushButton, 'button54')
220
+            self.button54.clicked.connect(lambda: self.changeColorNode(self.button54.styleSheet()))
221
+
222
+            self.button55 = self.main_widget.findChild(QtWidgets.QPushButton, 'button55')
223
+            self.button55.clicked.connect(lambda: self.changeColorNode(self.button55.styleSheet()))
224
+
225
+            self.button56 = self.main_widget.findChild(QtWidgets.QPushButton, 'button56')
226
+            self.button56.clicked.connect(lambda: self.changeColorNode(self.button56.styleSheet()))
227
+
228
+            self.button57 = self.main_widget.findChild(QtWidgets.QPushButton, 'button57')
229
+            self.button57.clicked.connect(lambda: self.changeColorNode(self.button57.styleSheet()))
230
+
231
+            self.button58 = self.main_widget.findChild(QtWidgets.QPushButton, 'button58')
232
+            self.button58.clicked.connect(lambda: self.changeColorNode(self.button58.styleSheet()))    
233
+
234
+            self.button59 = self.main_widget.findChild(QtWidgets.QPushButton, 'button59')
235
+            self.button59.clicked.connect(lambda: self.changeColorNode(self.button59.styleSheet()))
236
+
237
+            self.button60 = self.main_widget.findChild(QtWidgets.QPushButton, 'button60')
238
+            self.button60.clicked.connect(lambda: self.changeColorNode(self.button60.styleSheet()))
239
+
240
+
241
+            self.customColor = self.main_widget.findChild(QtWidgets.QPushButton, 'customColor')
242
+            self.customColor.clicked.connect(self.changeColorNodeCustom)
243
+            
244
+            self.restoreColor = self.main_widget.findChild(QtWidgets.QPushButton, 'restoreColor')
245
+            self.restoreColor.clicked.connect(self.restoreOriginalColor)
246
+
247
+            self.copyButton = self.main_widget.findChild(QtWidgets.QPushButton, 'copyButton')
248
+            self.copyButton.clicked.connect(self.copy_color)
249
+
250
+            self.pasteButton = self.main_widget.findChild(QtWidgets.QPushButton, 'pasteButton')
251
+            self.pasteButton.clicked.connect(self.paste_color)
252
+            
253
+            self.infoButton = self.main_widget.findChild(QtWidgets.QPushButton, 'infoButton')
254
+            self.infoButton.clicked.connect(self.info)
255
+            
256
+            self.wwwButton = self.main_widget.findChild(QtWidgets.QPushButton, 'wwwButton')
257
+            self.wwwButton.clicked.connect(self.website)
258
+
259
+            self.checkboxClose = self.main_widget.findChild(QtWidgets.QCheckBox, 'checkboxClose')
260
+
261
+
262
+#---------------------------------------------------------
263
+    #if clicked button
264
+    def changeColorNode(self, color):
265
+        color = color.replace('background-color: rgb','').replace(';','').replace('(','').replace(')','').replace(' ','')
266
+        r,g,b = color.split(',')
267
+        red = float(float(r)/255)
268
+        green = float(float(g)/255)
269
+        blue = float(float(b)/255)
270
+        
271
+        #NUKE 13+
272
+        if (nuke.NUKE_VERSION_MAJOR > 12):
273
+            #hexColour = f'{int(((red*255))):02x}{int(((green*255))):02x}{int(((blue*255))):02x}'
274
+            hexColour = "{:02x}{:02x}{:02x}".format(int(red*255),int(green*255),int(blue*255))
275
+
276
+            weird = int(hexColour+'00',16)
277
+            
278
+            if (weird == 0):
279
+                weird = 1
280
+            
281
+        else:
282
+        #NUKE < 13
283
+            hexColour = '%02x' % (red*255) + '%02x' % (green*255) + '%02x' % (blue*255)
284
+            weird = int('%02x%02x%02x%02x' % (red*255,green*255,blue*255,1),16)
285
+            
286
+        
287
+        
288
+        print ("HEX COLOR: " + str(hexColour))
289
+        print ("COLOR: " + str(weird))
290
+
291
+
292
+
293
+        selectNodes()
294
+        
295
+        if(nodeSelected is not None):
296
+	        for node in nodeSelected:
297
+	        	#print node.name()
298
+	        	node.knob('tile_color').setValue(weird)
299
+        
300
+        
301
+        self.closeWindow()
302
+
303
+
304
+#---------------------------------------------------------
305
+    #if clicked custom color button
306
+    def changeColorNodeCustom(self):
307
+        self.closeWindow()
308
+        col = nuke.getColor()
309
+        
310
+        
311
+        selectNodes()
312
+		
313
+        if col:
314
+	        if(nodeSelected is not None):
315
+		        for node in nodeSelected:
316
+		        	node.knob('gl_color').setValue(col)
317
+		        	node.knob('tile_color').setValue(col)
318
+		        	print("COLOR: " + str(col))
319
+            #for n in nuke.selectedNodes():
320
+            #    n['tile_color'].setValue(col)
321
+            #    n['gl_color'].setValue(col)
322
+			#	 print "COLOR: " + str(col)
323
+			
324
+        
325
+       # self.closeWindow()
326
+#---------------------------------------------------------
327
+    #restore original color of the Node. Depending on the Node Class
328
+    def restoreOriginalColor(self):
329
+        selection = None
330
+        try:
331
+                selection = nuke.selectedNode()
332
+                if (selection.Class() == "Group" and selection.selectedNodes()):
333
+                    if nuke.ask('Are you sure you want to change color of Nodes inside Group <b>' + selection.name() + '?'):
334
+                        #nuke.message("Changing color of Nodes inside Group: <b>" + selection.name())
335
+                        selection = selection.selectedNodes()
336
+                else:
337
+                    selection = nuke.selectedNodes()
338
+        except:
339
+                nuke.message("SELECT A NODE.\nIf you want to change color of Nodes inside a Group, please select also the Group in the Node Graph.")
340
+            
341
+        for n in selection:
342
+            color_default = nuke.defaultNodeColor(n.Class())
343
+            n['tile_color'].setValue(color_default)
344
+            #or you can use: n['tile_color'].setValue(0)
345
+#---------------------------------------------------------
346
+    #COPY
347
+    def copy_color(self):
348
+        global color_copied
349
+        if len(nuke.selectedNodes()) <= 1:
350
+            n = nuke.selectedNode()
351
+            if (n.Class() == "Group" and n.selectedNodes()):
352
+                #if node selected is a group, then check if anything is selected inside
353
+                if nuke.ask('Are you sure you want to copy the color of Nodes inside Group <b>' + n.name() + '?'):
354
+                    #nuke.message("Changing color of Nodes inside Group: <b>" + selection.name())
355
+                    n = n.selectedNode()
356
+            if n['tile_color'].getValue()==0:
357
+                color_copied = nuke.defaultNodeColor(n.Class())
358
+            else:
359
+                color_copied = int(n['tile_color'].getValue())
360
+        else:
361
+            nuke.message("SELECT A NODE.\nIf you want to change color of Nodes inside a Group, please select also the Group in the Node Graph.")
362
+            if color_copied is None:
363
+                color_copied = 0
364
+        
365
+        print("COPIED COLOR: " + str(color_copied))
366
+
367
+
368
+    #PASTE
369
+    def paste_color(self):
370
+        if color_copied is not None:
371
+            selectNodes()
372
+            
373
+            if(nodeSelected is not None):
374
+                    for node in nodeSelected:
375
+                        #print node.name()
376
+                        node.knob('tile_color').setValue(color_copied)
377
+        
378
+         
379
+            #for n in nuke.selectedNodes(): 
380
+            #    n['tile_color'].setValue(color_copied)
381
+
382
+#---------------------------------------------------------         
383
+    #www
384
+    def website(self):
385
+        webbrowser.open('http://www.andreageremia.it/tutorial_color_panel.html')  # Go to the website
386
+        
387
+#---------------------------------------------------------        
388
+    #info
389
+    def info(self):
390
+        nuke.message('- Select Nodes and change the color\n\n- You can copy and paste color from one node to others\n\n- Restore the original color of a node, depending on the Class of it\n\n- If you want to change color of Nodes inside a Group, please select also the Group in the Node Graph.')
391
+#---------------------------------------------------------
392
+    #close window
393
+    def closeWindow(self):
394
+        if self.checkboxClose.isChecked():
395
+            self.close()
396
+    
397
+#GOOOOOOOOOOOOOOOOOO!
398
+def colorPanel():
399
+    my_window = MyWindow()
400
+    my_window.show()
401
+    
402
+#---------------------------------------------------------
403
+#SELECT NODES
404
+def selectNodes():
405
+	global nodeSelected
406
+	nodeSelected = None
407
+	
408
+	try:
409
+		nodeSelected = nuke.selectedNode()
410
+		if (nodeSelected.Class() == "Group" and nodeSelected.selectedNodes()):
411
+			#if node selected is a group, then check if anything is selected inside
412
+			if nuke.ask('Are you sure you want to change color of Nodes inside Group <b>' + nodeSelected.name() + '?'):
413
+				#nuke.message("Changing color of Nodes inside Group: <b>" + selection.name())
414
+				nodeSelected = nodeSelected.selectedNodes()
415
+			else:
416
+				nodeSelected = nuke.selectedNodes()
417
+		else:
418
+			nodeSelected = nuke.selectedNodes()
419
+	except:
420
+		nuke.message("SELECT A NODE.\nIf you want to change color of Nodes inside a Group, please select also the Group in the Node Graph.")    
421
+
422
+
423
+#colorPanel()

+ 895
- 0
pythonpluginsUI/colorpanel/ColorPanel.ui View File

1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<ui version="4.0">
3
+ <class>ColorPanel</class>
4
+ <widget class="QMainWindow" name="ColorPanel">
5
+  <property name="geometry">
6
+   <rect>
7
+    <x>0</x>
8
+    <y>0</y>
9
+    <width>370</width>
10
+    <height>678</height>
11
+   </rect>
12
+  </property>
13
+  <property name="sizePolicy">
14
+   <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
15
+    <horstretch>0</horstretch>
16
+    <verstretch>0</verstretch>
17
+   </sizepolicy>
18
+  </property>
19
+  <property name="minimumSize">
20
+   <size>
21
+    <width>370</width>
22
+    <height>678</height>
23
+   </size>
24
+  </property>
25
+  <property name="maximumSize">
26
+   <size>
27
+    <width>1000</width>
28
+    <height>1000</height>
29
+   </size>
30
+  </property>
31
+  <property name="baseSize">
32
+   <size>
33
+    <width>361</width>
34
+    <height>654</height>
35
+   </size>
36
+  </property>
37
+  <property name="windowTitle">
38
+   <string>MainWindow</string>
39
+  </property>
40
+  <widget class="QWidget" name="centralwidget">
41
+   <property name="enabled">
42
+    <bool>true</bool>
43
+   </property>
44
+   <property name="sizePolicy">
45
+    <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
46
+     <horstretch>0</horstretch>
47
+     <verstretch>0</verstretch>
48
+    </sizepolicy>
49
+   </property>
50
+   <widget class="QCheckBox" name="checkboxClose">
51
+    <property name="geometry">
52
+     <rect>
53
+      <x>20</x>
54
+      <y>620</y>
55
+      <width>261</width>
56
+      <height>22</height>
57
+     </rect>
58
+    </property>
59
+    <property name="text">
60
+     <string>Close Window when color is selected</string>
61
+    </property>
62
+    <property name="checked">
63
+     <bool>true</bool>
64
+    </property>
65
+   </widget>
66
+   <widget class="QGroupBox" name="groupBox">
67
+    <property name="geometry">
68
+     <rect>
69
+      <x>10</x>
70
+      <y>10</y>
71
+      <width>351</width>
72
+      <height>111</height>
73
+     </rect>
74
+    </property>
75
+    <property name="title">
76
+     <string>Nuke Color Nodes</string>
77
+    </property>
78
+    <widget class="QWidget" name="layoutWidget">
79
+     <property name="geometry">
80
+      <rect>
81
+       <x>10</x>
82
+       <y>70</y>
83
+       <width>332</width>
84
+       <height>29</height>
85
+      </rect>
86
+     </property>
87
+     <layout class="QHBoxLayout" name="horizontalLayout_2">
88
+      <item>
89
+       <widget class="QPushButton" name="button7">
90
+        <property name="styleSheet">
91
+         <string notr="true">background-color: rgb(83, 120, 149)</string>
92
+        </property>
93
+        <property name="text">
94
+         <string/>
95
+        </property>
96
+       </widget>
97
+      </item>
98
+      <item>
99
+       <widget class="QPushButton" name="button8">
100
+        <property name="styleSheet">
101
+         <string notr="true">background-color: rgb(97, 170, 162)</string>
102
+        </property>
103
+        <property name="text">
104
+         <string/>
105
+        </property>
106
+       </widget>
107
+      </item>
108
+      <item>
109
+       <widget class="QPushButton" name="button9">
110
+        <property name="styleSheet">
111
+         <string notr="true">background-color: rgb(153, 185, 135)</string>
112
+        </property>
113
+        <property name="text">
114
+         <string/>
115
+        </property>
116
+       </widget>
117
+      </item>
118
+      <item>
119
+       <widget class="QPushButton" name="button10">
120
+        <property name="styleSheet">
121
+         <string notr="true">background-color: rgb(230, 190, 125)</string>
122
+        </property>
123
+        <property name="text">
124
+         <string/>
125
+        </property>
126
+       </widget>
127
+      </item>
128
+      <item>
129
+       <widget class="QPushButton" name="button11">
130
+        <property name="styleSheet">
131
+         <string notr="true">background-color: rgb(241, 164, 119)</string>
132
+        </property>
133
+        <property name="text">
134
+         <string/>
135
+        </property>
136
+       </widget>
137
+      </item>
138
+      <item>
139
+       <widget class="QPushButton" name="button12">
140
+        <property name="styleSheet">
141
+         <string notr="true">background-color: rgb(229, 120, 104)</string>
142
+        </property>
143
+        <property name="text">
144
+         <string/>
145
+        </property>
146
+       </widget>
147
+      </item>
148
+     </layout>
149
+    </widget>
150
+    <widget class="QWidget" name="layoutWidget">
151
+     <property name="geometry">
152
+      <rect>
153
+       <x>10</x>
154
+       <y>30</y>
155
+       <width>332</width>
156
+       <height>29</height>
157
+      </rect>
158
+     </property>
159
+     <layout class="QHBoxLayout" name="horizontalLayout">
160
+      <item>
161
+       <widget class="QPushButton" name="button1">
162
+        <property name="styleSheet">
163
+         <string notr="true">background-color: rgb(230, 57, 70)</string>
164
+        </property>
165
+        <property name="text">
166
+         <string/>
167
+        </property>
168
+       </widget>
169
+      </item>
170
+      <item>
171
+       <widget class="QPushButton" name="button2">
172
+        <property name="styleSheet">
173
+         <string notr="true">background-color: rgb(168, 218, 220)</string>
174
+        </property>
175
+        <property name="text">
176
+         <string/>
177
+        </property>
178
+       </widget>
179
+      </item>
180
+      <item>
181
+       <widget class="QPushButton" name="button3">
182
+        <property name="styleSheet">
183
+         <string notr="true">background-color: rgb(229, 236, 233)</string>
184
+        </property>
185
+        <property name="text">
186
+         <string/>
187
+        </property>
188
+       </widget>
189
+      </item>
190
+      <item>
191
+       <widget class="QPushButton" name="button4">
192
+        <property name="styleSheet">
193
+         <string notr="true">background-color: rgb(69, 123, 157)</string>
194
+        </property>
195
+        <property name="text">
196
+         <string/>
197
+        </property>
198
+       </widget>
199
+      </item>
200
+      <item>
201
+       <widget class="QPushButton" name="button5">
202
+        <property name="styleSheet">
203
+         <string notr="true">background-color: rgb(29, 53, 87)</string>
204
+        </property>
205
+        <property name="text">
206
+         <string/>
207
+        </property>
208
+       </widget>
209
+      </item>
210
+      <item>
211
+       <widget class="QPushButton" name="button6">
212
+        <property name="styleSheet">
213
+         <string notr="true">background-color: rgb(27, 38, 79)</string>
214
+        </property>
215
+        <property name="text">
216
+         <string/>
217
+        </property>
218
+       </widget>
219
+      </item>
220
+     </layout>
221
+    </widget>
222
+   </widget>
223
+   <widget class="QGroupBox" name="groupBox_2">
224
+    <property name="geometry">
225
+     <rect>
226
+      <x>10</x>
227
+      <y>130</y>
228
+      <width>351</width>
229
+      <height>351</height>
230
+     </rect>
231
+    </property>
232
+    <property name="title">
233
+     <string>Other Colors</string>
234
+    </property>
235
+    <widget class="QWidget" name="layoutWidget_2">
236
+     <property name="geometry">
237
+      <rect>
238
+       <x>10</x>
239
+       <y>70</y>
240
+       <width>332</width>
241
+       <height>29</height>
242
+      </rect>
243
+     </property>
244
+     <layout class="QHBoxLayout" name="horizontalLayout_4">
245
+      <item>
246
+       <widget class="QPushButton" name="button19">
247
+        <property name="styleSheet">
248
+         <string notr="true">background-color: rgb(181, 228, 140);</string>
249
+        </property>
250
+        <property name="text">
251
+         <string/>
252
+        </property>
253
+       </widget>
254
+      </item>
255
+      <item>
256
+       <widget class="QPushButton" name="button20">
257
+        <property name="styleSheet">
258
+         <string notr="true">background-color: rgb(118, 200, 147);</string>
259
+        </property>
260
+        <property name="text">
261
+         <string/>
262
+        </property>
263
+       </widget>
264
+      </item>
265
+      <item>
266
+       <widget class="QPushButton" name="button21">
267
+        <property name="styleSheet">
268
+         <string notr="true">background-color: rgb(82, 182, 154);</string>
269
+        </property>
270
+        <property name="text">
271
+         <string/>
272
+        </property>
273
+       </widget>
274
+      </item>
275
+      <item>
276
+       <widget class="QPushButton" name="button22">
277
+        <property name="styleSheet">
278
+         <string notr="true">background-color: rgb(52, 160, 164)</string>
279
+        </property>
280
+        <property name="text">
281
+         <string/>
282
+        </property>
283
+       </widget>
284
+      </item>
285
+      <item>
286
+       <widget class="QPushButton" name="button23">
287
+        <property name="styleSheet">
288
+         <string notr="true">background-color: rgb(22, 138, 173);</string>
289
+        </property>
290
+        <property name="text">
291
+         <string/>
292
+        </property>
293
+       </widget>
294
+      </item>
295
+      <item>
296
+       <widget class="QPushButton" name="button24">
297
+        <property name="styleSheet">
298
+         <string notr="true">background-color: rgb(26, 117, 159);</string>
299
+        </property>
300
+        <property name="text">
301
+         <string/>
302
+        </property>
303
+       </widget>
304
+      </item>
305
+     </layout>
306
+    </widget>
307
+    <widget class="QWidget" name="layoutWidget_3">
308
+     <property name="geometry">
309
+      <rect>
310
+       <x>10</x>
311
+       <y>30</y>
312
+       <width>332</width>
313
+       <height>29</height>
314
+      </rect>
315
+     </property>
316
+     <layout class="QHBoxLayout" name="horizontalLayout_3">
317
+      <item>
318
+       <widget class="QPushButton" name="button13">
319
+        <property name="styleSheet">
320
+         <string notr="true">background-color: rgb(2, 62, 138)</string>
321
+        </property>
322
+        <property name="text">
323
+         <string/>
324
+        </property>
325
+       </widget>
326
+      </item>
327
+      <item>
328
+       <widget class="QPushButton" name="button14">
329
+        <property name="styleSheet">
330
+         <string notr="true">background-color: rgb(0, 119, 182)</string>
331
+        </property>
332
+        <property name="text">
333
+         <string/>
334
+        </property>
335
+       </widget>
336
+      </item>
337
+      <item>
338
+       <widget class="QPushButton" name="button15">
339
+        <property name="styleSheet">
340
+         <string notr="true">background-color: rgb(0, 150, 199)</string>
341
+        </property>
342
+        <property name="text">
343
+         <string/>
344
+        </property>
345
+       </widget>
346
+      </item>
347
+      <item>
348
+       <widget class="QPushButton" name="button16">
349
+        <property name="styleSheet">
350
+         <string notr="true">background-color: rgb(0, 180, 216)</string>
351
+        </property>
352
+        <property name="text">
353
+         <string/>
354
+        </property>
355
+       </widget>
356
+      </item>
357
+      <item>
358
+       <widget class="QPushButton" name="button17">
359
+        <property name="styleSheet">
360
+         <string notr="true">background-color: rgb(72, 202, 228)</string>
361
+        </property>
362
+        <property name="text">
363
+         <string/>
364
+        </property>
365
+       </widget>
366
+      </item>
367
+      <item>
368
+       <widget class="QPushButton" name="button18">
369
+        <property name="styleSheet">
370
+         <string notr="true">background-color: rgb(144, 224, 239);</string>
371
+        </property>
372
+        <property name="text">
373
+         <string/>
374
+        </property>
375
+       </widget>
376
+      </item>
377
+     </layout>
378
+    </widget>
379
+    <widget class="QWidget" name="layoutWidget_4">
380
+     <property name="geometry">
381
+      <rect>
382
+       <x>10</x>
383
+       <y>110</y>
384
+       <width>332</width>
385
+       <height>29</height>
386
+      </rect>
387
+     </property>
388
+     <layout class="QHBoxLayout" name="horizontalLayout_5">
389
+      <item>
390
+       <widget class="QPushButton" name="button25">
391
+        <property name="styleSheet">
392
+         <string notr="true">background-color: rgb(249, 65, 68);</string>
393
+        </property>
394
+        <property name="text">
395
+         <string/>
396
+        </property>
397
+       </widget>
398
+      </item>
399
+      <item>
400
+       <widget class="QPushButton" name="button26">
401
+        <property name="styleSheet">
402
+         <string notr="true">background-color: rgb(243, 114, 44);</string>
403
+        </property>
404
+        <property name="text">
405
+         <string/>
406
+        </property>
407
+       </widget>
408
+      </item>
409
+      <item>
410
+       <widget class="QPushButton" name="button27">
411
+        <property name="styleSheet">
412
+         <string notr="true">background-color: rgb(248, 150, 30);</string>
413
+        </property>
414
+        <property name="text">
415
+         <string/>
416
+        </property>
417
+       </widget>
418
+      </item>
419
+      <item>
420
+       <widget class="QPushButton" name="button28">
421
+        <property name="styleSheet">
422
+         <string notr="true">background-color: rgb(249, 199, 79);</string>
423
+        </property>
424
+        <property name="text">
425
+         <string/>
426
+        </property>
427
+       </widget>
428
+      </item>
429
+      <item>
430
+       <widget class="QPushButton" name="button29">
431
+        <property name="styleSheet">
432
+         <string notr="true">background-color: rgb(144, 190, 109);</string>
433
+        </property>
434
+        <property name="text">
435
+         <string/>
436
+        </property>
437
+       </widget>
438
+      </item>
439
+      <item>
440
+       <widget class="QPushButton" name="button30">
441
+        <property name="styleSheet">
442
+         <string notr="true">background-color: rgb(67, 170, 139);</string>
443
+        </property>
444
+        <property name="text">
445
+         <string/>
446
+        </property>
447
+       </widget>
448
+      </item>
449
+     </layout>
450
+    </widget>
451
+    <widget class="QWidget" name="layoutWidget_5">
452
+     <property name="geometry">
453
+      <rect>
454
+       <x>10</x>
455
+       <y>150</y>
456
+       <width>332</width>
457
+       <height>29</height>
458
+      </rect>
459
+     </property>
460
+     <layout class="QHBoxLayout" name="horizontalLayout_6">
461
+      <item>
462
+       <widget class="QPushButton" name="button31">
463
+        <property name="styleSheet">
464
+         <string notr="true">background-color: rgb(27, 80, 113);</string>
465
+        </property>
466
+        <property name="text">
467
+         <string/>
468
+        </property>
469
+       </widget>
470
+      </item>
471
+      <item>
472
+       <widget class="QPushButton" name="button32">
473
+        <property name="styleSheet">
474
+         <string notr="true">background-color: rgb(52, 145, 153);</string>
475
+        </property>
476
+        <property name="text">
477
+         <string/>
478
+        </property>
479
+       </widget>
480
+      </item>
481
+      <item>
482
+       <widget class="QPushButton" name="button33">
483
+        <property name="styleSheet">
484
+         <string notr="true">background-color: rgb(74, 197, 179);</string>
485
+        </property>
486
+        <property name="text">
487
+         <string/>
488
+        </property>
489
+       </widget>
490
+      </item>
491
+      <item>
492
+       <widget class="QPushButton" name="button34">
493
+        <property name="styleSheet">
494
+         <string notr="true">background-color: rgb(20, 245, 208);</string>
495
+        </property>
496
+        <property name="text">
497
+         <string/>
498
+        </property>
499
+       </widget>
500
+      </item>
501
+      <item>
502
+       <widget class="QPushButton" name="button35">
503
+        <property name="styleSheet">
504
+         <string notr="true">background-color: rgb(125, 255, 216);</string>
505
+        </property>
506
+        <property name="text">
507
+         <string/>
508
+        </property>
509
+       </widget>
510
+      </item>
511
+      <item>
512
+       <widget class="QPushButton" name="button36">
513
+        <property name="styleSheet">
514
+         <string notr="true">background-color: rgb(181, 255, 222);</string>
515
+        </property>
516
+        <property name="text">
517
+         <string/>
518
+        </property>
519
+       </widget>
520
+      </item>
521
+     </layout>
522
+    </widget>
523
+    <widget class="QWidget" name="layoutWidget_6">
524
+     <property name="geometry">
525
+      <rect>
526
+       <x>10</x>
527
+       <y>190</y>
528
+       <width>332</width>
529
+       <height>29</height>
530
+      </rect>
531
+     </property>
532
+     <layout class="QHBoxLayout" name="horizontalLayout_7">
533
+      <item>
534
+       <widget class="QPushButton" name="button37">
535
+        <property name="styleSheet">
536
+         <string notr="true">background-color: rgb(3, 56, 0);</string>
537
+        </property>
538
+        <property name="text">
539
+         <string/>
540
+        </property>
541
+       </widget>
542
+      </item>
543
+      <item>
544
+       <widget class="QPushButton" name="button38">
545
+        <property name="styleSheet">
546
+         <string notr="true">background-color: rgb(79, 126, 66);</string>
547
+        </property>
548
+        <property name="text">
549
+         <string/>
550
+        </property>
551
+       </widget>
552
+      </item>
553
+      <item>
554
+       <widget class="QPushButton" name="button39">
555
+        <property name="styleSheet">
556
+         <string notr="true">background-color: rgb(85, 170, 0);</string>
557
+        </property>
558
+        <property name="text">
559
+         <string/>
560
+        </property>
561
+       </widget>
562
+      </item>
563
+      <item>
564
+       <widget class="QPushButton" name="button40">
565
+        <property name="styleSheet">
566
+         <string notr="true">background-color: rgb(0, 255, 0);</string>
567
+        </property>
568
+        <property name="text">
569
+         <string/>
570
+        </property>
571
+       </widget>
572
+      </item>
573
+      <item>
574
+       <widget class="QPushButton" name="button41">
575
+        <property name="styleSheet">
576
+         <string notr="true">background-color: rgb(107, 214, 0);</string>
577
+        </property>
578
+        <property name="text">
579
+         <string/>
580
+        </property>
581
+       </widget>
582
+      </item>
583
+      <item>
584
+       <widget class="QPushButton" name="button42">
585
+        <property name="styleSheet">
586
+         <string notr="true">background-color: rgb(128, 255, 0);</string>
587
+        </property>
588
+        <property name="text">
589
+         <string/>
590
+        </property>
591
+       </widget>
592
+      </item>
593
+     </layout>
594
+    </widget>
595
+    <widget class="QWidget" name="layoutWidget_7">
596
+     <property name="geometry">
597
+      <rect>
598
+       <x>10</x>
599
+       <y>230</y>
600
+       <width>332</width>
601
+       <height>29</height>
602
+      </rect>
603
+     </property>
604
+     <layout class="QHBoxLayout" name="horizontalLayout_8">
605
+      <item>
606
+       <widget class="QPushButton" name="button43">
607
+        <property name="styleSheet">
608
+         <string notr="true">background-color: rgb(89, 106, 34);</string>
609
+        </property>
610
+        <property name="text">
611
+         <string/>
612
+        </property>
613
+       </widget>
614
+      </item>
615
+      <item>
616
+       <widget class="QPushButton" name="button44">
617
+        <property name="styleSheet">
618
+         <string notr="true">background-color: rgb(159, 180, 82);</string>
619
+        </property>
620
+        <property name="text">
621
+         <string/>
622
+        </property>
623
+       </widget>
624
+      </item>
625
+      <item>
626
+       <widget class="QPushButton" name="button45">
627
+        <property name="styleSheet">
628
+         <string notr="true">background-color: rgb(108, 168, 80);</string>
629
+        </property>
630
+        <property name="text">
631
+         <string/>
632
+        </property>
633
+       </widget>
634
+      </item>
635
+      <item>
636
+       <widget class="QPushButton" name="button46">
637
+        <property name="styleSheet">
638
+         <string notr="true">background-color: rgb(163, 212, 0);</string>
639
+        </property>
640
+        <property name="text">
641
+         <string/>
642
+        </property>
643
+       </widget>
644
+      </item>
645
+      <item>
646
+       <widget class="QPushButton" name="button47">
647
+        <property name="styleSheet">
648
+         <string notr="true">background-color: rgb(167, 213, 97);</string>
649
+        </property>
650
+        <property name="text">
651
+         <string/>
652
+        </property>
653
+       </widget>
654
+      </item>
655
+      <item>
656
+       <widget class="QPushButton" name="button48">
657
+        <property name="styleSheet">
658
+         <string notr="true">background-color: rgb(191, 255, 42);</string>
659
+        </property>
660
+        <property name="text">
661
+         <string/>
662
+        </property>
663
+       </widget>
664
+      </item>
665
+     </layout>
666
+    </widget>
667
+    <widget class="QWidget" name="layoutWidget_8">
668
+     <property name="geometry">
669
+      <rect>
670
+       <x>10</x>
671
+       <y>270</y>
672
+       <width>332</width>
673
+       <height>29</height>
674
+      </rect>
675
+     </property>
676
+     <layout class="QHBoxLayout" name="horizontalLayout_9">
677
+      <item>
678
+       <widget class="QPushButton" name="button49">
679
+        <property name="styleSheet">
680
+         <string notr="true">background-color: rgb(79, 55, 0);</string>
681
+        </property>
682
+        <property name="text">
683
+         <string/>
684
+        </property>
685
+       </widget>
686
+      </item>
687
+      <item>
688
+       <widget class="QPushButton" name="button50">
689
+        <property name="styleSheet">
690
+         <string notr="true">background-color: rgb(122, 63, 15);</string>
691
+        </property>
692
+        <property name="text">
693
+         <string/>
694
+        </property>
695
+       </widget>
696
+      </item>
697
+      <item>
698
+       <widget class="QPushButton" name="button51">
699
+        <property name="styleSheet">
700
+         <string notr="true">background-color: rgb(177, 99, 9);</string>
701
+        </property>
702
+        <property name="text">
703
+         <string/>
704
+        </property>
705
+       </widget>
706
+      </item>
707
+      <item>
708
+       <widget class="QPushButton" name="button52">
709
+        <property name="styleSheet">
710
+         <string notr="true">background-color: rgb(150, 107, 47);</string>
711
+        </property>
712
+        <property name="text">
713
+         <string/>
714
+        </property>
715
+       </widget>
716
+      </item>
717
+      <item>
718
+       <widget class="QPushButton" name="button53">
719
+        <property name="styleSheet">
720
+         <string notr="true">background-color: rgb(189, 147, 41);</string>
721
+        </property>
722
+        <property name="text">
723
+         <string/>
724
+        </property>
725
+       </widget>
726
+      </item>
727
+      <item>
728
+       <widget class="QPushButton" name="button54">
729
+        <property name="styleSheet">
730
+         <string notr="true">background-color: rgb(221, 188, 0);</string>
731
+        </property>
732
+        <property name="text">
733
+         <string/>
734
+        </property>
735
+       </widget>
736
+      </item>
737
+     </layout>
738
+    </widget>
739
+    <widget class="QWidget" name="layoutWidget_9">
740
+     <property name="geometry">
741
+      <rect>
742
+       <x>10</x>
743
+       <y>310</y>
744
+       <width>332</width>
745
+       <height>30</height>
746
+      </rect>
747
+     </property>
748
+     <layout class="QHBoxLayout" name="horizontalLayout_10">
749
+      <item>
750
+       <widget class="QPushButton" name="button55">
751
+        <property name="styleSheet">
752
+         <string notr="true">background-color: rgb(0, 0, 0);</string>
753
+        </property>
754
+        <property name="text">
755
+         <string/>
756
+        </property>
757
+       </widget>
758
+      </item>
759
+      <item>
760
+       <widget class="QPushButton" name="button56">
761
+        <property name="styleSheet">
762
+         <string notr="true">background-color: rgb(25,25,25);</string>
763
+        </property>
764
+        <property name="text">
765
+         <string/>
766
+        </property>
767
+       </widget>
768
+      </item>
769
+      <item>
770
+       <widget class="QPushButton" name="button57">
771
+        <property name="styleSheet">
772
+         <string notr="true">background-color: rgb(50,50,50);</string>
773
+        </property>
774
+        <property name="text">
775
+         <string/>
776
+        </property>
777
+       </widget>
778
+      </item>
779
+      <item>
780
+       <widget class="QPushButton" name="button58">
781
+        <property name="styleSheet">
782
+         <string notr="true">background-color: rgb(70,70,70);</string>
783
+        </property>
784
+        <property name="text">
785
+         <string/>
786
+        </property>
787
+       </widget>
788
+      </item>
789
+      <item>
790
+       <widget class="QPushButton" name="button59">
791
+        <property name="styleSheet">
792
+         <string notr="true">background-color: rgb(100,100,100);</string>
793
+        </property>
794
+        <property name="text">
795
+         <string/>
796
+        </property>
797
+       </widget>
798
+      </item>
799
+      <item>
800
+       <widget class="QPushButton" name="button60">
801
+        <property name="styleSheet">
802
+         <string notr="true">background-color: rgb(150, 150, 150);</string>
803
+        </property>
804
+        <property name="text">
805
+         <string/>
806
+        </property>
807
+       </widget>
808
+      </item>
809
+     </layout>
810
+    </widget>
811
+   </widget>
812
+   <widget class="QPushButton" name="customColor">
813
+    <property name="geometry">
814
+     <rect>
815
+      <x>30</x>
816
+      <y>490</y>
817
+      <width>311</width>
818
+      <height>27</height>
819
+     </rect>
820
+    </property>
821
+    <property name="text">
822
+     <string>Custom Color</string>
823
+    </property>
824
+   </widget>
825
+   <widget class="QPushButton" name="infoButton">
826
+    <property name="geometry">
827
+     <rect>
828
+      <x>280</x>
829
+      <y>610</y>
830
+      <width>31</width>
831
+      <height>32</height>
832
+     </rect>
833
+    </property>
834
+    <property name="text">
835
+     <string>?</string>
836
+    </property>
837
+   </widget>
838
+   <widget class="QPushButton" name="restoreColor">
839
+    <property name="geometry">
840
+     <rect>
841
+      <x>30</x>
842
+      <y>570</y>
843
+      <width>311</width>
844
+      <height>27</height>
845
+     </rect>
846
+    </property>
847
+    <property name="text">
848
+     <string>Restore Original Color</string>
849
+    </property>
850
+   </widget>
851
+   <widget class="QPushButton" name="copyButton">
852
+    <property name="geometry">
853
+     <rect>
854
+      <x>30</x>
855
+      <y>530</y>
856
+      <width>151</width>
857
+      <height>27</height>
858
+     </rect>
859
+    </property>
860
+    <property name="text">
861
+     <string>Copy Color</string>
862
+    </property>
863
+   </widget>
864
+   <widget class="QPushButton" name="pasteButton">
865
+    <property name="geometry">
866
+     <rect>
867
+      <x>190</x>
868
+      <y>530</y>
869
+      <width>151</width>
870
+      <height>27</height>
871
+     </rect>
872
+    </property>
873
+    <property name="text">
874
+     <string>Paste Color</string>
875
+    </property>
876
+   </widget>
877
+   <widget class="QPushButton" name="wwwButton">
878
+    <property name="geometry">
879
+     <rect>
880
+      <x>320</x>
881
+      <y>610</y>
882
+      <width>41</width>
883
+      <height>32</height>
884
+     </rect>
885
+    </property>
886
+    <property name="text">
887
+     <string>www</string>
888
+    </property>
889
+   </widget>
890
+  </widget>
891
+  <widget class="QStatusBar" name="statusbar"/>
892
+ </widget>
893
+ <resources/>
894
+ <connections/>
895
+</ui>

+ 9
- 0
pythonpluginsUI/colorpanel/menu.py View File

1
+import nuke
2
+
3
+#Shortcut: SHIFT+C
4
+#add this line to your menu.py to add ColorPanel to the side menu
5
+import ColorPanel
6
+
7
+t = nuke.menu("Nodes")
8
+c = t.addMenu("ColorPanel", icon="ColorPanel.png")
9
+c.addCommand('ColorPanel', 'ColorPanel.colorPanel()', 'shift+c', icon="")

+ 125
- 27
pythonpluginsUI/sceneControl/sceneControl.py View File

18
 episodeDef = '101'
18
 episodeDef = '101'
19
 listTasks = ['taskOne___', 'taskTwo___']
19
 listTasks = ['taskOne___', 'taskTwo___']
20
 listDepts = ['departmentOne___', 'departmentTwo___']
20
 listDepts = ['departmentOne___', 'departmentTwo___']
21
-seqDef = '001'
22
-shotDef = '010'
21
+seqDef = ''
22
+shotDef = ''
23
 major_version = 1
23
 major_version = 1
24
 minor_version = 1
24
 minor_version = 1
25
 user = 'xy'
25
 user = 'xy'
29
 cutOut = 1001
29
 cutOut = 1001
30
 end = 1001
30
 end = 1001
31
 comment = ''
31
 comment = ''
32
-# / default interface values
33
 
32
 
34
-
35
-# debug
36
-
37
-# __GLOBALS__
33
+# switches
38
 # generic project folder: //hades/p/_projekte/GENFOLDER
34
 # generic project folder: //hades/p/_projekte/GENFOLDER
39
 GENFOLDER = 'GEN'
35
 GENFOLDER = 'GEN'
40
 INIT_DONE = False
36
 INIT_DONE = False
42
 UPDATE_TOOLSET = False
38
 UPDATE_TOOLSET = False
43
 WRITENODE_VERSION = 1.0
39
 WRITENODE_VERSION = 1.0
44
 USE_ENV_PROJECT_ROOT = 1
40
 USE_ENV_PROJECT_ROOT = 1
45
-WRITENODE_LABEL = '[value compression]'
41
+WRITENODE_LABEL = 'exr compression: [value compression]'
46
 
42
 
43
+# globals
44
+sequenceGlobal=''
45
+shotGlobal=''
47
 
46
 
48
 # Plugin / commands
47
 # Plugin / commands
49
 class sceneControl(KellerNukePlugin):
48
 class sceneControl(KellerNukePlugin):
76
         m.addCommand('Debug/Internal/WriteNodeReloadTasks', 'import sceneControl; sceneControl.kenvWriteReloadTasks(writeNode)', index=14)
75
         m.addCommand('Debug/Internal/WriteNodeReloadTasks', 'import sceneControl; sceneControl.kenvWriteReloadTasks(writeNode)', index=14)
77
         m.addCommand('Debug/Internal/KEnvQuery', 'import sceneControl; sceneControl.kenvQuery(query,**kwargs)', index=15)
76
         m.addCommand('Debug/Internal/KEnvQuery', 'import sceneControl; sceneControl.kenvQuery(query,**kwargs)', index=15)
78
 
77
 
78
+        # TODO: add command to delete keller tab.
79
         # TODO: remove the commands from the menu
79
         # TODO: remove the commands from the menu
80
         #m.findItem('Draw/ReloadTasks').setVisible(False)
80
         #m.findItem('Draw/ReloadTasks').setVisible(False)
81
         #m.findItem('Draw/GetRenderpath').setVisible(False)
81
         #m.findItem('Draw/GetRenderpath').setVisible(False)
128
         if kenvModuleLoaded():
128
         if kenvModuleLoaded():
129
             print('SceneControl: Info. Script Load. Generating KEnv environment...')
129
             print('SceneControl: Info. Script Load. Generating KEnv environment...')
130
             initSceneControlValues(sc)
130
             initSceneControlValues(sc)
131
-
131
+    # init shot
132
+    set_shot()
132
 
133
 
133
 def onKnobChanged():
134
 def onKnobChanged():
134
     # sceneControl ready
135
     # sceneControl ready
135
-    global INIT_DONE
136
-    if not INIT_DONE:
137
-        # not ready
138
-        return
139
-
140
     k = nuke.thisKnob()
136
     k = nuke.thisKnob()
141
     refresh = ['project','dept','task','element','sequence','shot','major_version','minor_version','info','user','useEnvProjectRoot']
137
     refresh = ['project','dept','task','element','sequence','shot','major_version','minor_version','info','user','useEnvProjectRoot']
142
     task_refresh = ['dept','task']
138
     task_refresh = ['dept','task']
143
     exr_compression = ['compression',]
139
     exr_compression = ['compression',]
140
+
144
     if k.name() in task_refresh:
141
     if k.name() in task_refresh:
145
         print('SceneControl: Info. Event task_refresh triggered.')
142
         print('SceneControl: Info. Event task_refresh triggered.')
146
         # Department changed, loading new tasks
143
         # Department changed, loading new tasks
180
         print('SceneControl: Info. KEnv was already gone.')
177
         print('SceneControl: Info. KEnv was already gone.')
181
 
178
 
182
 
179
 
183
-
184
 # SceneControl
180
 # SceneControl
185
 def getSceneControl():
181
 def getSceneControl():
186
     c = nuke.exists("sceneCtrl")
182
     c = nuke.exists("sceneCtrl")
517
         except:
513
         except:
518
             print('SceneControl: Warning. Please enter your shortname.')
514
             print('SceneControl: Warning. Please enter your shortname.')
519
 
515
 
516
+        # export Sequence and Shot Environment variables
517
+        exportEnv()
520
 
518
 
521
 
519
 
522
 # KEnv functions
520
 # KEnv functions
858
     return nuke.Root()["name"].getValue()
856
     return nuke.Root()["name"].getValue()
859
 
857
 
860
 
858
 
861
-def checkEnvEntry(value):
862
-    try:
863
-        val = os.environ[value]
864
-    except:
865
-        print(('SceneControl: Info. Env variable %s not set.') %value)
866
-        return None
867
-    return val
868
-
869
 
859
 
870
 def find_node_by_type(nodename, nodeclass):
860
 def find_node_by_type(nodename, nodeclass):
871
     nodes = nuke.allNodes()
861
     nodes = nuke.allNodes()
894
 
884
 
895
 
885
 
896
 def updateWriteNodeConfig():
886
 def updateWriteNodeConfig():
887
+    # TODO: more automated update function.
897
     import sceneControl
888
     import sceneControl
898
 
889
 
899
     # 'task' for legacy write nodes
890
     # 'task' for legacy write nodes
974
     return
965
     return
975
 
966
 
976
 
967
 
968
+def checkEnvEntry(value):
969
+    try:
970
+        val = os.environ[value]
971
+    except:
972
+        print(('SceneControl: Info. Env variable %s not set.') %value)
973
+        return None
974
+    return val
975
+
976
+
977
+def exportEnv():
978
+    sceneControl = getSceneControl()
979
+    k = sceneControl.knobs()
980
+
981
+    project = k['project'].value()
982
+    if project == '':
983
+        project = 'None'
984
+    # temp
985
+    if project == 'HOTZ':
986
+        project = 'HOT'
987
+
988
+    sequence = k['sequence'].value()
989
+    if sequence == '':
990
+        sequence = 'None'
991
+
992
+    shot = k['shot'].value()
993
+    if shot == '':
994
+        shot = 'None'
995
+
996
+    os.environ['JOB'] = str(project)
997
+    os.environ['PREFIX'] = str(project) # houdini world
998
+    os.environ['SEQUENCE'] = str(sequence)
999
+    os.environ['SEQ'] = str(sequence) # houdini world
1000
+    os.environ['SHOT'] = str(shot)
1001
+
1002
+    print('SceneControl: Info. Exported Env Variables SEQUENCE: {0} and SHOT: {1}'.format(sequence,shot))
1003
+    return
1004
+
1005
+
1006
+def set_shot():
1007
+    global sequenceGlobal
1008
+    global shotGlobal
1009
+
1010
+    envExportNeeded = False
1011
+
1012
+    sceneControl = getSceneControl()
1013
+    k = sceneControl.knobs()
1014
+    # sequence
1015
+    sequence = k['sequence'].value()
1016
+    if sequence != 'gen' and sequence !='':
1017
+        if sequence != sequenceGlobal:
1018
+            print('SceneControl: Info. Env Export needed')
1019
+            envExportNeeded = True
1020
+            # new sequence
1021
+            sequenceGlobal = sequence
1022
+    # shot
1023
+    shot = k['shot'].value()
1024
+    if shot != 'gen' and shot !='':
1025
+        if shot != shotGlobal:
1026
+            print('SceneControl: Info. Env Export needed')
1027
+            envExportNeeded = True
1028
+            # new sequence
1029
+            shotGlobal = shot
1030
+
1031
+    # sequence and or shot changed
1032
+    if envExportNeeded:
1033
+        # export sequence and shot
1034
+        exportEnv()
1035
+        # refresh ocio config
1036
+        print('SceneControl: Info. Reloading ocio config.')
1037
+        try:
1038
+            v = nuke.ViewerProcess.node().knob('view').getValue()
1039
+            # reset viewer to default project viewerprocess
1040
+            nuke.ViewerProcess.node().knob('view').setValue(0)
1041
+        except:
1042
+            # empty script without viewer...
1043
+            pass
1044
+        # reload ocio config
1045
+        nuke.root().knobs()['reloadConfig'].execute()
1046
+        try:
1047
+            # set viewerProcess back
1048
+            nuke.ViewerProcess.node().knob('view').setValue(int(v))
1049
+        except:
1050
+            # empty script without viewer...
1051
+            pass
1052
+
977
 
1053
 
978
 # write nodes
1054
 # write nodes
979
 def createCustomWrite(n):
1055
 def createCustomWrite(n):
1054
     # _______________________________________________________________
1130
     # _______________________________________________________________
1055
 
1131
 
1056
     # play in new rv
1132
     # play in new rv
1057
-    k = nuke.PyScript_Knob("playinrv", "Play in RV", "playInRV.playInRV(nuke.thisNode().knob('file').getValue(),0)")
1133
+    k = nuke.PyScript_Knob("playinrv", "Play in RV", "playInRV.playInRV(nuke.thisNode(),0)")
1058
     n.addKnob(k)
1134
     n.addKnob(k)
1059
     n.knob("playinrv").setTooltip("Opens new instance of RV")
1135
     n.knob("playinrv").setTooltip("Opens new instance of RV")
1060
     n.knob("playinrv").setFlag(nuke.STARTLINE)
1136
     n.knob("playinrv").setFlag(nuke.STARTLINE)
1061
 
1137
 
1062
     # push to rv
1138
     # push to rv
1063
-    k = nuke.PyScript_Knob("pushtorv", "Push to RV", "playInRV.playInRV(nuke.thisNode().knob('file').getValue(),1)")
1139
+    k = nuke.PyScript_Knob("pushtorv", "Push to RV", "playInRV.playInRV(nuke.thisNode(),1)")
1064
     n.addKnob(k)
1140
     n.addKnob(k)
1065
     n.knob("pushtorv").setTooltip("Push to tagged RV. Will open RV and uses this instance to directly push sequences.")
1141
     n.knob("pushtorv").setTooltip("Push to tagged RV. Will open RV and uses this instance to directly push sequences.")
1066
 
1142
 
1067
     # push to rv / append
1143
     # push to rv / append
1068
-    k = nuke.PyScript_Knob("pushtorvappend", "Push to RV (append)", "playInRV.playInRV(nuke.thisNode().knob('file').getValue(),2)")
1144
+    k = nuke.PyScript_Knob("pushtorvappend", "Push to RV (append)", "playInRV.playInRV(nuke.thisNode(),2)")
1069
     n.addKnob(k)
1145
     n.addKnob(k)
1070
     n.knob("pushtorvappend").setTooltip("Push to RV and append to existing sources")
1146
     n.knob("pushtorvappend").setTooltip("Push to RV and append to existing sources")
1071
     n.knob("pushtorvappend").clearFlag(nuke.STARTLINE)
1147
     n.knob("pushtorvappend").clearFlag(nuke.STARTLINE)
1072
 
1148
 
1149
+    k = nuke.Boolean_Knob("useshotenv", "use shot env")
1150
+    n.addKnob(k)
1151
+    n.knob("useshotenv").setTooltip("Use Sequence and Shot Env entries in order for RV to load shot specific configs.")
1152
+    n.knob("useshotenv").setValue(1)
1153
+
1073
     # _______________________________________________________________
1154
     # _______________________________________________________________
1074
     k = nuke.Text_Knob("divider3", "")
1155
     k = nuke.Text_Knob("divider3", "")
1075
     n.addKnob(k)
1156
     n.addKnob(k)
1092
     else:
1173
     else:
1093
         n.knob("label").setValue(WRITENODE_LABEL)
1174
         n.knob("label").setValue(WRITENODE_LABEL)
1094
 
1175
 
1176
+    n.knob('file_type').setValue('exr')
1177
+
1178
+    k = n.knob('compression')
1179
+    if k.value().startswith('Zip'):
1180
+        # % (r * 255, g * 255, b * 255, 1), 16): change r g and b to your liking
1181
+        hexColour = int('%02x%02x%02x%02x' % (184, 184, 0, 1), 16)
1182
+        n['tile_color'].setValue(hexColour)
1183
+    if k.value().startswith('DW'):
1184
+        # % (r * 255, g * 255, b * 255, 1), 16): change r g and b to your liking
1185
+        hexColour = int('%02x%02x%02x%02x' % (1 * 255, 0.666 * 255, 0.266 * 255, 1), 16)
1186
+        n['tile_color'].setValue(hexColour)
1187
+
1188
+
1189
+
1095
 
1190
 
1096
 
1191
 
1097
 # saving
1192
 # saving
1137
         if owrite:
1232
         if owrite:
1138
             # good to go: change write nodes first
1233
             # good to go: change write nodes first
1139
             updateWriteNodePaths()
1234
             updateWriteNodePaths()
1235
+            set_shot()
1140
             nuke.scriptSave()
1236
             nuke.scriptSave()
1141
         else:
1237
         else:
1142
             s = "SceneControl. Overwrite Nuke Script? %s" % script
1238
             s = "SceneControl. Overwrite Nuke Script? %s" % script
1144
             if overwrite:
1240
             if overwrite:
1145
                 # good to go: change write nodes first
1241
                 # good to go: change write nodes first
1146
                 updateWriteNodePaths()
1242
                 updateWriteNodePaths()
1243
+                set_shot()
1147
                 nuke.scriptSave()
1244
                 nuke.scriptSave()
1148
             else:
1245
             else:
1149
                 nuke.Root()["name"].setValue(oldname)
1246
                 nuke.Root()["name"].setValue(oldname)
1150
     else:
1247
     else:
1151
         # good to go: change write nodes first
1248
         # good to go: change write nodes first
1152
         updateWriteNodePaths()
1249
         updateWriteNodePaths()
1250
+        set_shot()
1153
         nuke.scriptSave()
1251
         nuke.scriptSave()
1154
 
1252
 
1155
 
1253
 
1502
 
1600
 
1503
 
1601
 
1504
 
1602
 
1505
-# publish
1603
+# publish // redo this
1506
 def publish_shot():
1604
 def publish_shot():
1507
     n = nuke.thisNode()
1605
     n = nuke.thisNode()
1508
     k = n.knobs()
1606
     k = n.knobs()

+ 14
- 0
pythonpluginsUI/superpose/superpose.py View File

1
+
2
+class Superpose(KellerNukePlugin):
3
+
4
+    def configurePlugin(self):
5
+      toolbar = nuke.menu("Nodes")
6
+      self.n = toolbar.addMenu("superpose")
7
+      self.n.addCommand("Superpose","nuke.createNode('Superpose')")
8
+    
9
+
10
+
11
+    def unconfigurePlugin(self):
12
+      self.n.removeItem("Superpose",)
13
+    
14
+

Loading…
Cancel
Save