DO THE SHUFFLE

DO THE SHUFFLE


UPDATE 21/04/2022 - fixed a issue where if current layers where not present in a render it would refuse to run :) but all fixed now so it should be fine



One of my larger python projects, Do the Shuffle, is a utility gizmo that makes working with CG renders a lot easier. Made up of 2 sections, I will explain how it works below.


Something to keep in mind, in order to save bloating and other issues, this technique doesn’t work with cryptomatts. This is because these layers can get mad, so it just made sense to remove cryptomatts.?The other thing is that I have only really been able to test this out with Arnold renders, it may/probably will work with the other major renderers, but the utility passes may not work unfortunately. also it utilises the new shuffle node, if wanted i could add a old shuffle node into it b


Picknick -

This was created due to a comment by one of the VTs about how, in industry, they render out each pass separately, which is recommended for speed reasons. This lead to the creation of the sandwich system that you can use to either write out each layer separately before recombining them back into the script, or by recombining single layers. When you press the write node button, it will create all the needed write nodes with their own folders, (if folders are already present then it will just render into them). This part follows a naming convention, where the subfolders and EXRs need to be names the same thing. This means that if you have already separated EXRs, you may need to rename them but once this is done you can press the sandwich button and it will re-combine all of the layers inside that folder, hopefully making it faster to work with!


Do the Shuffle -

The main part of the gizmo is this set up. It is used to quickly create a bunch of postage stamped shuffle nodes with each beauty and utility pass shuffled out as well as a 'primitive' shader rebuilder that I will discuss below.

With the Break it Down button you have a couple of options, you can have it just shuffle out the utility passes (n depth and p), or you can also have it just shuffle out the major lighting shading groups, or you can do a full light break up where it will break up the light groups into each light pass with the option to add a remove node to each of these. There is also have the shader rebuilder, this creates a shader tree with all the light passes first merged to each other then into each group, it only currently works with diffuse direct, indirect and spec. It’s not laid out in the nicest way but may be a good starting point.

showcase video:



I’m sure there will be issues with this so if you find any please let me know!


Hopefully you guys find it useful


Warwick


code : just copy and paste into nuke



set cut_paste_input [stack 0]
version 12.2 v8
push $cut_paste_input
NoOp {
?name do_the_shuffle_8
?label "by warwick \n\n\[basename \[value \[topnode].file ]]\n\n"
?note_font Verdana
?selected true
?xpos -249
?ypos -986
?addUserKnob {20 user2 l picknick}
?addUserKnob {22 write_genarator l "write node genrator" t "use this to genrate write nodes for each pass in your render! " T " \n#picknick v1 warwick crewe-brown#\njk = nuke.thisNode()\njk.knob('selected').setValue(True)\n\nimport os \n\n\nread=nuke.Root().selectedNode()\nlayer=nuke.layers(read)\nfile_name=nuke\n\n? ? ? ? ? ? ####VERIABLES#####\n## geting ht efile path \nout_ad = nuke.selectedNode().knob('file').getValue()\nprint out_ad\n\n\n\n#genrating list for each cryptomatt to remove it as we dont want it, this was a pain pls work i beg#\ncra =\[('crypto_asset') + \"%.2d\" % i for i in range(100)]\n#adding in the basse crpyto_asset to the list same for rest of cryptomatt things#\ncra.append('crypto_asset')\n\ncro =\[('crypto_object') + \"%.2d\" % i for i in range(100)]\ncro.append('crypto_object')\n\ncrm =\[('crypto_material') + \"%.2d\" % i for i in range(100)]\ncrm.append('crypto_material')\n\n#putting them all togther\ncrymat= cra + cro + crm\n\n#now finally filtering out the stupid ammount of cryptopasses fucking kill me it works tho#\nlayer = \[i for i in layer if i not in crymat]\n\n\nprint layer\n\n\n# Creates a folder in the current directory called data\n\nfor i in layer :\n? ? ?wr = nuke.createNode( \"Write\" )? ?\n? ? ?wr.setInput(0, read)\n? ? ?wr.knob('channels').setValue(i)\n? ? ?wr.knob('file').setValue(out_ad + '/' + i + '/' + i + '.####.exr')\n## if there4s a folder for that layer will render into it if not will make it before render ###\n? ? ?wr.knob('beforeRender').setValue(\"if not os.path.isdir(os.path.dirname(nuke.thisNode()\['file'].evaluate())): os.makedirs(os.path.dirname(nuke.thisNode()\['file'].evaluate()))\")" +STARTLINE}
?addUserKnob {2 file l "render location" t "hear is where your renders from the write node genorator will be located, or can use it for seprate exr renders as well "}
?file "V:/Workspace/Warwick Crewe-Brown/lv 666/picknicktest"
?addUserKnob {22 sandwitch t "use this to recombine all your layers into one " T "? \n#sandwitch v1.01 warwick crewe-brown#\njk = nuke.thisNode()\njk.knob('selected').setValue(True)\nnuke.selectedNode().setInput(0,None)\nimport os \n\n\nread=nuke.Root().selectedNode()\nlayer=nuke.layers(read)\nfile_name=nuke\n\n? ? ? ? ? ? ####VERIABLES#####\n## geting ht efile path \nout_ad = nuke.selectedNode().knob('file').getValue()\nprint out_ad\n#### getting the folder names incase its diffrent from render or its just a render with seprate exrs #### \nfolder = os.listdir(out_ad) \nprint folder\n### gets prodjects last and first frame to set in read nodes for frame range ##### \nfirst_frame = int(nuke.Root().knob('first_frame').getValue())\nlast_frame = int(nuke.Root().knob('last_frame').getValue())\n\n\n###cryptomatt_shit####\n#genrating list for each cryptomatt to remove it as we dont want it, this was a pain pls work i beg#\ncra =\[('crypto_asset') + \"%.2d\" % i for i in range(100)]\n#adding in the basse crpyto_asset to the list same for rest of cryptomatt things#\ncra.append('crypto_asset')\n\ncro =\[('crypto_object') + \"%.2d\" % i for i in range(100)]\ncro.append('crypto_object')\n\ncrm =\[('crypto_material') + \"%.2d\" % i for i in range(100)]\ncrm.append('crypto_material')\n\n#putting them all togther\ncrymat= cra + cro + crm\n\n#now finally filtering out the stupid ammount of cryptopasses fucking kill me it works tho#\nlayer = \[i for i in layer if i not in crymat]\n? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \nxval= jk\['xpos'].value()\nyval= jk\['ypos'].value()\n\nfirstshit = True\n\n? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ##### end of major veriablesd#####\n\n\nprint layer\nprint type(out_ad) \nprint type(first_frame) \n\n## setting the adress shitttt (this was a pain)##\nfor i in folder :\n p= out_ad + '/'+? i \n pe= nuke.getFileNameList(p)\n pe0= (' '.join(pe))\n pe= out_ad + '/' + i + '/' + str(pe0)\n\n## adding to the x val for each rung through ##\n xval = int(xval)+ 169\n\n## creating the reads ## \n re = nuke.createNode(\"Read\", inpanel = False)\n re.knob('selected').setValue(True)\n re.knob('file').fromUserText(pe)\n\n#setting the x and y val so its layed out a bit niceer? \n re\['xpos'].setValue(xval)\n re\['ypos'].setValue(yval)\n\n\n## getting the channels for each read ## \n jkchan = re.channels()\n jklen = len(jkchan) \n\n cc=nuke.createNode(\"Copy\", inpanel = False)\n cc.knob('selected').setValue(True)\n nuke.autoplace(cc)\n \n if jklen > 0 :\n? ? cc.knob('from0').setValue(jkchan\[0])\n? ? cc.knob('to0').setValue(jkchan\[0])\n if jklen > 1 :\n? ? cc.knob('from0').setValue(jkchan\[0])\n? ? cc.knob('to0').setValue(jkchan\[0])\n? ? cc.knob('from1').setValue(jkchan\[1])\n? ? cc.knob('to1').setValue(jkchan\[1])\n if jklen > 2 :\n? ? cc.knob('from0').setValue(jkchan\[0])\n? ? cc.knob('to0').setValue(jkchan\[0])\n? ? cc.knob('from1').setValue(jkchan\[1])\n? ? cc.knob('to1').setValue(jkchan\[1])\n? ? cc.knob('from2').setValue(jkchan\[2])\n? ? cc.knob('to2').setValue(jkchan\[2])\n if jklen > 3 : \n? ? cc.knob('from0').setValue(jkchan\[0])\n? ? cc.knob('to0').setValue(jkchan\[0])\n? ? cc.knob('from1').setValue(jkchan\[1])\n? ? cc.knob('to1').setValue(jkchan\[1])\n? ? cc.knob('from2').setValue(jkchan\[2])\n? ? cc.knob('to2').setValue(jkchan\[2])? \n? ? cc.knob('from3').setValue(jkchan\[3])\n? ? cc.knob('to3').setValue(jkchan\[3])\n\n#### if its the first one attatch the b input to a base node to act as abase? turns off after first loop #### \n\n if? firstshit == True : \n? ? ?firstshit = False\n? ? ?magicdot = nuke.createNode(\"Dot\", inpanel = False)\n? ? ?magicdot.knob('selected').setValue(True)\n? ? ?magicdot.setYpos( 111 )\n? ? ?cc.setInput(0,read)\n? ? ?\n? ? ?\n### sets a input b to a got thats created after each loop rember this its what makes it work you goonn) ######\n else :\n? ? ?cc.setInput(0,magicdot)\n\n## creatiing the magic dot ## \n magicdot = nuke.createNode(\"Dot\", inpanel = False)\n magicdot.knob('selected').setValue(True)? \n nuke.autoplace(magicdot)\n\n\n## alings them nicer (it finally works yay) ### \nnuke.selectConnectedNodes()\n\nnuke.autoplace_all" +STARTLINE}
?addUserKnob {26 ""}
?addUserKnob {26 instructions -STARTLINE T "Use this menu to separate out a multi-layer EXR into separate layers and then re-combine them for quicker render times!\n\nIf using a multi-layer EXR:\n\n1. Set output location with the render location\nknob, you only need to create one folder, the\ngizmo will do the others for you.\n\n2. Press the write node generator, and a write\nnode for each of your passes will be\ngenerated, containing only one layer. The\ngizmo will create subfolders based off the layer\nnames as needed, once happy either render\nlocally or on a farm (keep in mind takes a while\nto render on a farm).\n\n3. Press the sandwich button, and it will\nreconstruct the layers for you,\npress 'L' to align them nicer (if you would like).\n\nAny issues feel free to drop me a message"}
?addUserKnob {20 User l "do the shuffle"}
?addUserKnob {22 full_braek_up l brake_it_down t "once you have slected your options press this to eacute it" -STARTLINE T "\n\n#made by warwick crewe-brown AUB 1900013 if you like this node please let me know :)\n\n\n#do_the_shuffle_v1.03#\njk = nuke.thisNode()\n#SLECTING ITSELF AS IT WORK BETTER THAT WAY \njk.knob('selected').setValue(True)\n#full light braKEUP KNOB\nfulllight=jk\['fulll'].getValue()\n#utility pass knbo get value\nuti=jk\['uti_on'].getValue()\n#add a remove node and setting the value\nrem=jk\['remove'].getValue()\n\nread=nuke.Root().selectedNode()\nlayer=nuke.layers(read)\nfile_name=nuke\n? ? ? ? ? ? ####VERIABLES#####\n\n\nprint fulllight\n#THE UTLILITY PASSES \nuti_pass =\['N', 'P', 'depth', 'UVPass']\n\n\n#genrating list for each cryptomatt to remove it as we dont want it, this was a pain pls work i beg#\ncra =\[('crypto_asset') + \"%.2d\" % i for i in range(100)]\n#adding in the basse crpyto_asset to the list same for rest of cryptomatt things#\ncra.append('crypto_asset')\n\ncro =\[('crypto_object') + \"%.2d\" % i for i in range(100)]\ncro.append('crypto_object')\n\ncrm =\[('crypto_material') + \"%.2d\" % i for i in range(100)]\ncrm.append('crypto_material')\n\n#putting them all togther\ncrymat= cra + cro + crm\n\n\n\n#GENRATING AND STORING A LIST OF ALL THE LAYERS THAT START OR CONTAINE THE WORLD SPECULER and diffuse it will gather them in a list will also ignore the base layers? #\nDIF_DI=filter(lambda x: x.startswith('diffuse_direct'), layer)\nif DIF_DI == ('diffuse_direct'):\n? ? DIF_DI.remove('diffuse_direct')\n\nDIF_IDI=filter(lambda x: x.startswith('diffuse_indirect'), layer)\nif DIF_IDI == ('diffuse_indirect'):\n? ? DIF_IDI.remove('diffuse_indirect')\n\nSPEC_DI=filter(lambda x: x.startswith('specular_direct'), layer)\nif SPEC_DI == ('specular_direct'):\n? ? SPEC_DI.remove('specular_direct')\n\nSPEC_IDI=filter(lambda x: x.startswith('specular_indirect'), layer)\nif SPEC_IDI == ('specular_indirect'):\n? ? SPEC_IDI.remove('specular_indirect')\n\nEMITION=filter(lambda x: x.startswith('emission'), layer)\nif EMITION == ('emission'):\n? ? EMITION.remove('emission')\n\nB_LIGHTS= SPEC_DI + SPEC_IDI +DIF_DI + DIF_IDI + EMITION\n\n\n\n\n\n#now finally filtering out the stupid ammount of cryptopasses fucking kill me it works tho#\nlayer = \[i for i in layer if i not in crymat]\n\n\n# if uti is turned on fullight is 0 so it dossnt fuck up the shuffles\nif uti == 1.0:\n? ? fulllight=0\nelse:fulllight=fulllight\n#removeing broken up light passes if the full light is turned on \nif fulllight == 1.0:\n? layer=layer\nelse:? layer = \[i for i in layer if i not in B_LIGHTS] \n\n\n#uti clear list append in normals postion and uv pass if turned on \nif uti == 1.0:\n? ? layer=\[i for i in layer if i in uti_pass]\nelse: layer=layer\nprint layer\n\n\n#custom code for passes that dont contain standed rgba channels#\n\n\n\n#custom code as uvpass isnt working for some reason#\nfor uv in layer:\n? ? if uv == 'UVPass':\n? ? ? ? s=nuke.createNode(\"Shuffle2\", inpanel = False)\n? ? ? ? s.knob('in1').setValue(uv)\n? ? ? ? s.knob('out1').setValue('rgba')\n? ? ? ? s.knob('label').setValue('layer:\[value in1] render: \[lindex \[split \[lindex \[split \[knob \[topnode].file] .] 0] /] end]')\n? ? ? ? s.setInput(0, read)\n? ? ? ? s.knob('postage_stamp').setValue(1)\n? ? ? ? s.knob('hide_input').setValue(1)\n? ? ? ? if rem == 1.0:\n? ? ? ? ? ? ? ? k=nuke.createNode(\"Remove\", inpanel = False)\n? ? ? ? ? ? ? ? k.knob('operation').setValue('keep')\n? ? ? ? ? ? ? ? k.knob('channels').setValue('rgba')\n? ? ? ? ? ? ? ? k.connectInput(1,s) \n\n\n#custom code as depth has fucked channels#? ? ? ?\nfor d in layer:\n? ? if d == 'depth':\n? ? ? ? s=nuke.createNode(\"Shuffle2\", inpanel = False)\n? ? ? ? s.knob('in1').setValue(d)\n? ? ? ? s.knob('out1').setValue('rgba')\n? ? ? ? s.knob('label').setValue('layer:\[value in1] render: \[lindex \[split \[lindex \[split \[knob \[topnode].file] .] 0] /] end]')\n? ? ? ? s.setInput(0, read)\n? ? ? ? s.knob('postage_stamp').setValue(1)\n? ? ? ? s.knob('hide_input').setValue(1)\n? ? ? ? s.knob('mappings').setValue(('depth.Z'),'rgba.red')\n? ? ? ? s.knob('mappings').setValue(('depth.Z'),'rgba.alpha')\n? ? ? ? if rem == 1.0:\n? ? ? ? ? ? ? ? k=nuke.createNode(\"Remove\", inpanel = False)\n? ? ? ? ? ? ? ? k.knob('operation').setValue('keep')\n? ? ? ? ? ? ? ? k.knob('channels').setValue('rgba')\n? ? ? ? ? ? ? ? k.connectInput(1,s)? ?\n\n\n#custom code as normal channel? has fucked channels#\nfor n in layer:\n? ? if n == 'N':\n? ? ? ? s=nuke.createNode(\"Shuffle2\", inpanel = False)\n? ? ? ? s.knob('in1').setValue(n)\n? ? ? ? s.knob('out1').setValue('rgba')\n? ? ? ? s.knob('label').setValue('layer:\[value in1]? render: \[lindex \[split \[lindex \[split \[knob \[topnode].file] .] 0] /] end]')\n? ? ? ? s.setInput(0, read)\n? ? ? ? s.knob('postage_stamp').setValue(1)\n? ? ? ? s.knob('hide_input').setValue(1)\n? ? ? ? s.knob('mappings').setValue(('N.X'),'rgba.red')\n? ? ? ? s.knob('mappings').setValue(('N.Y'),'rgba.green')\n? ? ? ? s.knob('mappings').setValue(('N.Z'),'rgba.blue')\n? ? ? ? if rem == 1.0:\n? ? ? ? ? ? ? ? k=nuke.createNode(\"Remove\", inpanel = False)\n? ? ? ? ? ? ? ? k.knob('operation').setValue('keep')\n? ? ? ? ? ? ? ? k.knob('channels').setValue('rgba')\n? ? ? ? ? ? ? ? k.connectInput(1,s) \nfor pp in layer:\n? ? if pp == 'P':\n? ? ? ? s=nuke.createNode(\"Shuffle2\", inpanel = False)\n? ? ? ? s.knob('in1').setValue(pp)\n? ? ? ? s.knob('out1').setValue('rgba')\n? ? ? ? s.knob('label').setValue('layer:\[value in1]? render: \[lindex \[split \[lindex \[split \[knob \[topnode].file] .] 0] /] end]')\n? ? ? ? s.setInput(0, read)\n? ? ? ? s.knob('postage_stamp').setValue(1)\n? ? ? ? s.knob('hide_input').setValue(1)\n? ? ? ? s.knob('mappings').setValue(('P.X'),'rgba.red')\n? ? ? ? s.knob('mappings').setValue(('P.Y'),'rgba.green')\n? ? ? ? s.knob('mappings').setValue(('P.Z'),'rgba.blue')\n? ? ? ? if rem == 1.0:\n? ? ? ? ? ? ? ? k=nuke.createNode(\"Remove\", inpanel = False)\n? ? ? ? ? ? ? ? k.knob('operation').setValue('keep')\n? ? ? ? ? ? ? ? k.knob('channels').setValue('rgba')\n? ? ? ? ? ? ? ? k.connectInput(1,s) \n\n#custom code to remove the channels we did before#\nfor i in layer:\n? ? if i =='rgb' or 'rgba' or 'alpha' or 'depth' or 'N' or 'crypto_asset' or 'crypto_object' or 'crypto_material':\n? ? ? ? try:\n? ? ? ? ? ? if uti == 0:? ? ? ? \n? ? ? ? ? ? ? ? layer.remove('rgb')\n? ? ? ? ? ? ? ? layer.remove('rgba')\n? ? ? ? ? ? ? ? layer.remove('alpha')\n? ? ? ? ? ? ? ? layer.remove('depth')\n? ? ? ? ? ? ? ? layer.remove('N')\n? ? ? ? ? ? ? ? layer.remove('cra')\n? ? ? ? ? ? ? ? print layer? \n? ? ? ? except:\n? ? #code that dose the rest#\n? ? ? ? ? ? s=nuke.createNode(\"Shuffle2\", inpanel = False)\n? ? ? ? ? ? s.knob('in1').setValue(i)\n? ? ? ? ? ? s.knob('out1').setValue('rgba')\n? ? ? ? ? ? s.knob('label').setValue('layer:\[value in1] render: \[lindex \[split \[lindex \[split \[knob \[topnode].file] .] 0] /] end]')\n? ? ? ? ? ? s.setInput(0, read)\n? ? ? ? ? ? s.knob('postage_stamp').setValue(1)\n? ? ? ? ? ? s.knob('hide_input').setValue(1)\n? ? ? ? ? ? if rem == 1.0:\n? ? ? ? ? ? ? ? k=nuke.createNode(\"Remove\", inpanel = False)\n? ? ? ? ? ? ? ? k.knob('operation').setValue('keep')\n? ? ? ? ? ? ? ? k.knob('channels').setValue('rgba')\n? ? ? ? ? ? ? ? k.connectInput(1,s) "}
?addUserKnob {26 _1 l "" +STARTLINE}
?addUserKnob {6 fulll l "full light brake up " t "if pressent in the redner, the shuffle node will brake up each pass with there slected lights as well! " +STARTLINE}
?addUserKnob {6 uti_on l "utilities only " t "will only export the utilitie passes" +STARTLINE}
?addUserKnob {6 remove l "add a remove node" t "adds a remove node with keep rgba on to each of your shuffled out passes " +STARTLINE}
?remove true
?addUserKnob {26 ""}
?addUserKnob {22 shaderrebuilder l "shader rebuilder " t "rebuilds the shaders spec and dif with there full brake out, can have remove nodes on or off as you want! " T "#made by warwick crewe-brown AUB 1900013 if you like this node please let me know :)\n\n\n#do_the_shuffle_v1.03#\njk = nuke.thisNode()\n#SLECTING ITSELF AS IT WORK BETTER THAT WAY \njk.knob('selected').setValue(True)\n#full light braKEUP KNOB\nfulllight = nuke.selectedNode().knob('fulll').getValue()\n#utility pass knbo get value\nuti = nuke.selectedNode().knob('uti_on').getValue()\n#add a remove node and setting the value\nrem = nuke.selectedNode().knob('remove').getValue()\n\nread=nuke.Root().selectedNode()\nlayer=nuke.layers(read)\nfile_name=nuke\n? ? ? ? ? ? ####VERIABLES#####\n\n\nprint fulllight\n#THE UTLILITY PASSES \nuti_pass =\['N', 'P', 'depth', 'UVPass']\n\n\n#genrating list for each cryptomatt to remove it as we dont want it, this was a pain pls work i beg#\ncra =\[('crypto_asset') + \"%.2d\" % i for i in range(100)]\n#adding in the basse crpyto_asset to the list same for rest of cryptomatt things#\ncra.append('crypto_asset')\n\ncro =\[('crypto_object') + \"%.2d\" % i for i in range(100)]\ncro.append('crypto_object')\n\ncrm =\[('crypto_material') + \"%.2d\" % i for i in range(100)]\ncrm.append('crypto_material')\n\n#putting them all togther\ncrymat= cra + cro + crm\n\n\n\n#GENRATING AND STORING A LIST OF ALL THE LAYERS THAT START OR CONTAINE THE WORLD SPECULER and diffuse it will gather them in a list will also ignore the base layers? #\n\nDIF_DI=filter(lambda x: x.startswith('diffuse_direct'), layer)\nif DIF_DI == ('diffuse_direct'):\n? ? DIF_DI.remove('diffuse_direct')\n\nDIF_IDI=filter(lambda x: x.startswith('diffuse_indirect'), layer)\nif DIF_IDI == ('diffuse_indirect'):\n? ? DIF_IDI.remove('diffuse_indirect')\n\nSPEC_DI=filter(lambda x: x.startswith('specular_direct'), layer)\nif SPEC_DI == ('specular_direct'):\n? ? SPEC_DI.remove('specular_direct')\n\nSPEC_IDI=filter(lambda x: x.startswith('specular_indirect'), layer)\nif SPEC_IDI == ('specular_indirect'):\n? ? SPEC_IDI.remove('specular_indirect')\n\nEMITION=filter(lambda x: x.startswith('emission'), layer)\nif EMITION == ('emission'):\n? ? EMITION.remove('emission')\n\nB_LIGHTS= SPEC_DI + SPEC_IDI +DIF_DI + DIF_IDI + EMITION\n\n\nB_LIGHTS= SPEC_DI + SPEC_IDI +DIF_DI + DIF_IDI + EMITION\nprint DIF_IDI\n\nONE = 1\nDIF_IDI_TLENGTH = len(DIF_IDI)\nDIF_IDI_LENGTH = 0\n\nDIF_DI_TLENGTH = len(DIF_DI)\nDIF_DI_LENGTH = 0\n\nSPEC_IDI_TLENGTH = len(SPEC_IDI)\nSPEC_IDI_LENGTH = 0\n\nSPEC_DI_TLENGTH = len(SPEC_DI)\nSPEC_DI_LENGTH = 0\n\n#### difuse dirrect tree maker #### \ndif_di_firstshit = True \nfor i in DIF_DI :\n? ? s=nuke.createNode(\"Shuffle2\", inpanel = False)\n? ? s.knob('in1').setValue(i)\n? ? s.knob('out1').setValue('rgba')\n? ? s.knob('label').setValue('layer:\[value in1] render: \[lindex \[split \[lindex \[split \[knob \[topnode].file] .] 0] /] end]')\n? ? s.setInput(0, read)\n? ? s.knob('postage_stamp').setValue(1)\n? ? s.knob('hide_input').setValue(1)\n\n? ? DIF_DI_LENGTH = DIF_DI_LENGTH + 1 \n\n? ? if rem == 1.0:\n? ? ? ? ?k=nuke.createNode(\"Remove\", inpanel = False)\n? ? ? ? ?k.knob('operation').setValue('keep')\n? ? ? ? ?k.knob('channels').setValue('rgba')\n? ? ? ? ?k.connectInput(1,s) \n? ? if dif_di_firstshit == True :\n? ? ? ? ?dif_di_firstshit = False\n? ? ? ? ?magicdot = nuke.createNode(\"Dot\", inpanel = False)\n? ? ? ? ?magicdot.knob('selected').setValue(True)\n? ? else: \n? ? ? ? ?if DIF_DI_LENGTH == DIF_DI_TLENGTH : \n? ? ? ? ? ?m=nuke.createNode(\"Merge\", inpanel = False)\n? ? ? ? ? ?m.knob('operation').setValue('plus')\n? ? ? ? ? ?m.connectInput(0,magicdot)\n? ? ? ? ? ?magicenddot = nuke.createNode(\"Dot\", inpanel = False)\n? ? ? ? ? ? \n? ? ? ? ?else:\n? ? ? ? ? m=nuke.createNode(\"Merge\", inpanel = False)\n? ? ? ? ? m.connectInput(0,magicdot)\n? ? ? ? ? m.knob('operation').setValue('plus')\n? ? ? ? ? magicdot = nuke.createNode(\"Dot\", inpanel = False)\n? ? ? ? ? magicdot.knob('selected').setValue(True)\n\n\n\n\n\n##### diffuse indirect tree ######\ndif_idi_firstshit = True \nfor i in DIF_IDI :\n? ? s=nuke.createNode(\"Shuffle2\", inpanel = False)\n? ? s.knob('in1').setValue(i)\n? ? s.knob('out1').setValue('rgba')\n? ? s.knob('label').setValue('layer:\[value in1] render: \[lindex \[split \[lindex \[split \[knob \[topnode].file] .] 0] /] end]')\n? ? s.setInput(0, read)\n? ? s.knob('postage_stamp').setValue(1)\n? ? s.knob('hide_input').setValue(1)\n\n? ? DIF_IDI_LENGTH = DIF_IDI_LENGTH + 1 \n\n? ? if rem == 1.0:\n? ? ? ? ?k=nuke.createNode(\"Remove\", inpanel = False)\n? ? ? ? ?k.knob('operation').setValue('keep')\n? ? ? ? ?k.knob('channels').setValue('rgba')\n? ? ? ? ?k.connectInput(1,s) \n? ? if dif_idi_firstshit == True :\n? ? ? ? ?dif_idi_firstshit = False\n? ? ? ? ?magicdot = nuke.createNode(\"Dot\", inpanel = False)\n? ? ? ? ?magicdot.knob('selected').setValue(True)\n? ? else: \n? ? ? ? ?if DIF_IDI_LENGTH == DIF_IDI_TLENGTH : \n? ? ? ? ? ? ?m=nuke.createNode(\"Merge\", inpanel = False)\n? ? ? ? ? ? ?m.connectInput(0,magicdot)\n? ? ? ? ? ? ?m.knob('operation').setValue('plus') \n? ? ? ? ? ? ?mc1 = nuke.createNode(\"Merge\", inpanel = False)\n? ? ? ? ? ? ?mc1.connectInput(1,magicenddot)\n? ? ? ? ? ? ?mc1.knob('operation').setValue('plus')\n? ? ? ? ? ? ?\n? ? ? ? ?else: \n? ? ? ? ? m=nuke.createNode(\"Merge\", inpanel = False)\n? ? ? ? ? m.connectInput(0,magicdot)\n? ? ? ? ? m.knob('operation').setValue('plus')\n? ? ? ? ? magicdot = nuke.createNode(\"Dot\", inpanel = False)\n? ? ? ? ?\n\n\n\n#### SPEC dirrect tree maker #### \nSPEC_di_firstshit = True \nfor i in SPEC_DI :\n? ? s=nuke.createNode(\"Shuffle2\", inpanel = False)\n? ? s.knob('in1').setValue(i)\n? ? s.knob('out1').setValue('rgba')\n? ? s.knob('label').setValue('layer:\[value in1] render: \[lindex \[split \[lindex \[split \[knob \[topnode].file] .] 0] /] end]')\n? ? s.setInput(0, read)\n? ? s.knob('postage_stamp').setValue(1)\n? ? s.knob('hide_input').setValue(1)\n\n? ? SPEC_DI_LENGTH = SPEC_DI_LENGTH + 1 \n\n? ? if rem == 1.0:\n? ? ? ? ?k=nuke.createNode(\"Remove\", inpanel = False)\n? ? ? ? ?k.knob('operation').setValue('keep')\n? ? ? ? ?k.knob('channels').setValue('rgba')\n? ? ? ? ?k.connectInput(1,s) \n? ? if SPEC_di_firstshit == True :\n? ? ? ? ?SPEC_di_firstshit = False\n? ? ? ? ?magicdot = nuke.createNode(\"Dot\", inpanel = False)\n? ? ? ? ?magicdot.knob('selected').setValue(True)\n? ? else: \n? ? ? ? ?if SPEC_DI_LENGTH == SPEC_DI_TLENGTH : \n? ? ? ? ? ?m=nuke.createNode(\"Merge\", inpanel = False)\n? ? ? ? ? ?m.knob('operation').setValue('plus')\n? ? ? ? ? ?m.connectInput(0,magicdot)\n? ? ? ? ? ?magicenddot2 = nuke.createNode(\"Dot\", inpanel = False)\n? ? ? ? ? ? \n? ? ? ? ?else:\n? ? ? ? ? m=nuke.createNode(\"Merge\", inpanel = False)\n? ? ? ? ? m.connectInput(0,magicdot)\n? ? ? ? ? m.knob('operation').setValue('plus')\n? ? ? ? ? magicdot = nuke.createNode(\"Dot\", inpanel = False)\n? ? ? ? ? magicdot.knob('selected').setValue(True)\n\n\n\n\n\n##### diffuse indirect tree ######\nSPEC_idi_firstshit = True \nfor i in SPEC_IDI :\n? ? s=nuke.createNode(\"Shuffle2\", inpanel = False)\n? ? s.knob('in1').setValue(i)\n? ? s.knob('out1').setValue('rgba')\n? ? s.knob('label').setValue('layer:\[value in1] render: \[lindex \[split \[lindex \[split \[knob \[topnode].file] .] 0] /] end]')\n? ? s.setInput(0, read)\n? ? s.knob('postage_stamp').setValue(1)\n? ? s.knob('hide_input').setValue(1)\n\n? ? SPEC_IDI_LENGTH = SPEC_IDI_LENGTH + 1 \n\n? ? if rem == 1.0:\n? ? ? ? ?k=nuke.createNode(\"Remove\", inpanel = False)\n? ? ? ? ?k.knob('operation').setValue('keep')\n? ? ? ? ?k.knob('channels').setValue('rgba')\n? ? ? ? ?k.connectInput(1,s) \n? ? if SPEC_idi_firstshit == True :\n? ? ? ? ?SPEC_idi_firstshit = False\n? ? ? ? ?magicdot = nuke.createNode(\"Dot\", inpanel = False)\n? ? ? ? ?magicdot.knob('selected').setValue(True)\n? ? else: \n? ? ? ? ?if SPEC_IDI_LENGTH == SPEC_IDI_TLENGTH : \n? ? ? ? ? ? ?m=nuke.createNode(\"Merge\", inpanel = False)\n? ? ? ? ? ? ?m.connectInput(0,magicdot) \n? ? ? ? ? ? ?mc2 = nuke.createNode(\"Merge\", inpanel = False)\n? ? ? ? ? ? ?mc2.connectInput(1,magicenddot2)\n? ? ? ? ? ? ?mc2.knob('operation').setValue('plus')\n? ? ? ? ? ? ?supermc = nuke.createNode(\"Merge\", inpanel = False)\n? ? ? ? ? ? ?supermc.connectInput(1,mc1)\n? ? ? ? ? ? ?supermc.knob('operation').setValue('plus')\n? ? ? ? ? ? ? \n? ? ? ? ?else: \n? ? ? ? ? m=nuke.createNode(\"Merge\", inpanel = False)\n? ? ? ? ? m.knob('operation').setValue('plus')\n? ? ? ? ? m.connectInput(0,magicdot)\n? ? ? ? ? magicdot = nuke.createNode(\"Dot\", inpanel = False)\n? ? ? ? ?\n" +STARTLINE}
?addUserKnob {26 infroshaderrebuilder l instructions T "use this to quickly recreate a shader network keep in mind it currently only recreates the main 4\n shader groups ( difusse, spec, dirrect and indirect) \n"}
?addUserKnob {26 ""}
?addUserKnob {26 text l "" +STARTLINE T "use this to quickly shuffle out all passes in a cg render : ) \n\n\nwarwick crewe-brown"}
?addUserKnob {26 version l "" +STARTLINE T version1.8}
?addUserKnob {20 endGroup n -1}
}

        

要查看或添加评论,请登录

warwick crewe-brown的更多文章

  • CANDY CANE CHAINSAW

    CANDY CANE CHAINSAW

    what is candy cane chainsaw?- Candy Cane Chainsaw is a set of gizmos I made in my second year at university during our…

    6 条评论
  • Lens Distortion Database Gizmo

    Lens Distortion Database Gizmo

    For are movie, I wanted to create a 'lens database' so other 2D artists (and myself) could quickly and easily distort…

社区洞察

其他会员也浏览了