├── allFilesGoInYourDotNukeOrNukePath ├── SearchReplacePanel.py ├── aePremult.gizmo ├── branchout.py ├── grad.gizmo └── grad.png ├── init.py ├── menu.py └── menuPyAnatomy_v01.nk /allFilesGoInYourDotNukeOrNukePath/SearchReplacePanel.py: -------------------------------------------------------------------------------- 1 | import nuke 2 | import nukescripts 3 | import re 4 | 5 | class SearchReplacePanel( nukescripts.PythonPanel ): 6 | def __init__( self ): 7 | nukescripts.PythonPanel.__init__( self, 'Search and Replace', 'com.ohufx.SearchReplace') 8 | # CREATE KNOBS 9 | self.nodesChoice = nuke.Enumeration_Knob( 'nodes', 'Source Nodes', ['all', 'selected']) 10 | self.searchStr = nuke.String_Knob('searchStr', 'Search for:') 11 | self.update = nuke.PyScript_Knob('update', 'Update') 12 | self.info = nuke.Multiline_Eval_String_Knob('info', 'Found') 13 | self.info.setEnabled( False ) 14 | self.replaceStr = nuke.String_Knob('replaceStr', 'Replace with:') 15 | self.replace = nuke.PyScript_Knob('replace', 'Replace') 16 | # ADD KNOBS 17 | self.addKnob( self.nodesChoice ) 18 | self.addKnob( self.searchStr ) 19 | self.addKnob( self.update ) 20 | self.addKnob( self.info ) 21 | self.addKnob( self.replaceStr ) 22 | self.addKnob( self.replace ) 23 | 24 | self.matches = None 25 | 26 | def __NodeHasKnobWithName( self, node, name): 27 | try: 28 | node[name] 29 | except NameError: 30 | return False 31 | return True 32 | 33 | def __FindNode( self, searchstr, knob): 34 | v = knob.value() 35 | if v and searchstr and searchstr in v: 36 | return True 37 | 38 | def search( self, searchstr, nodes ): 39 | """ Search in nodes with file knobs. """ 40 | fileKnobNodes = [i for i in nodes if self.__NodeHasKnobWithName(i, 'file')] 41 | proxyKnobNodes = [i for i in nodes if self.__NodeHasKnobWithName(i, 'proxy')] 42 | if not fileKnobNodes and not proxyKnobNodes: raise ValueError, "No file nodes selected" 43 | nodeMatches = [] 44 | knobMatches = [] 45 | for i in fileKnobNodes: 46 | if self.__FindNode(searchstr, i['file']): 47 | nodeMatches.append( i ) 48 | knobMatches.append( i['file'] ) 49 | for i in proxyKnobNodes: 50 | if self.__FindNode(searchstr, i['proxy']): 51 | nodeMatches.append( i ) 52 | knobMatches.append( i['proxy'] ) 53 | return nodeMatches, knobMatches 54 | 55 | 56 | def getSearchResult( self, nodes ): 57 | nodeMatches, knobMatches = self.search( self.searchStr.value(), nodes ) 58 | nodes = [n.name() for n in nodeMatches] 59 | infoStr = '%s node(s) found:\n\t%s' % ( len(nodes), ', '.join( nodes ) ) 60 | self.info.setValue( infoStr ) 61 | return knobMatches 62 | 63 | def knobChanged( self, knob ): 64 | if knob in (self.searchStr, self.update, self.nodesChoice): 65 | srcNodes = { 'all': nuke.allNodes(), 'selected': nuke.selectedNodes() } 66 | self.matches = self.getSearchResult( srcNodes[self.nodesChoice.value()] ) 67 | elif knob is self.replace and self.matches is not None: 68 | for k in self.matches: 69 | newStr = re.sub( self.searchStr.value(), self.replaceStr.value(), k.value() ) 70 | k.setValue( newStr ) 71 | 72 | -------------------------------------------------------------------------------- /allFilesGoInYourDotNukeOrNukePath/aePremult.gizmo: -------------------------------------------------------------------------------- 1 | ### 2 | ### Deke Kincaid 3 | ### dekekincaid@gmail.com 4 | ### aePremult v1.02 5 | ### Nuke 6.2v1 6 | ### tested with 4.8.x, 5.1.x, 5.2.x, and it works fine 7 | ### 8 | 9 | Gizmo { 10 | name aePremult 11 | help "This fixes the issue when your background color is anything other then black.\n\nJust pick whatever color the guys in 3d or matte painters gave you and Walla! the funky color fringe is now gone." 12 | addUserKnob {20 aePremult} 13 | addUserKnob {41 color T BG_COLOR.color} 14 | } 15 | Input { 16 | inputs 0 17 | name Input1 18 | xpos 388 19 | ypos -21 20 | } 21 | Dot { 22 | name Dot1 23 | xpos 422 24 | ypos 28 25 | } 26 | set N22e8a890 [stack 0] 27 | Dot { 28 | name Dot2 29 | xpos 556 30 | ypos 28 31 | } 32 | push $N22e8a890 33 | push $N22e8a890 34 | Invert { 35 | channels rgba 36 | name Invert1 37 | xpos 304 38 | ypos 24 39 | } 40 | Constant { 41 | inputs 0 42 | channels rgb 43 | color {1 0 0 0} 44 | name BG_COLOR 45 | xpos 245 46 | ypos -105 47 | } 48 | Reformat { 49 | type "to box" 50 | box_width {{Input1.width}} 51 | box_height {{Input1.height}} 52 | box_fixed true 53 | name Reformat1 54 | selected true 55 | xpos 245 56 | ypos -33 57 | } 58 | Copy { 59 | inputs 2 60 | from0 rgba.alpha 61 | to0 rgba.alpha 62 | name Copy1 63 | xpos 245 64 | ypos 61 65 | } 66 | Premult { 67 | name Premult2 68 | xpos 245 69 | ypos 100 70 | } 71 | Merge2 { 72 | inputs 2 73 | operation minus 74 | name Merge1 75 | xpos 388 76 | ypos 100 77 | } 78 | Dot { 79 | name Dot3 80 | xpos 422 81 | ypos 163 82 | } 83 | Copy { 84 | inputs 2 85 | from0 rgba.alpha 86 | to0 rgba.alpha 87 | name Copy2 88 | xpos 522 89 | ypos 155 90 | } 91 | set N22ea0020 [stack 0] 92 | Output { 93 | name Output1 94 | xpos 522 95 | ypos 248 96 | } 97 | push $N22ea0020 98 | Viewer { 99 | input_process false 100 | name Viewer1 101 | xpos 110 102 | ypos -9 103 | } 104 | end_group 105 | -------------------------------------------------------------------------------- /allFilesGoInYourDotNukeOrNukePath/branchout.py: -------------------------------------------------------------------------------- 1 | ### Branch out Layers 2 | ### v2.0 - Last modified: 25/02/2009 3 | ### Written by Diogo Girondi 4 | ### diogogirondi@gmail.com 5 | 6 | import nuke 7 | 8 | def branchout(): 9 | 10 | sn = nuke.selectedNode() 11 | ch = nuke.channels(sn) 12 | xp = sn['xpos'].value() 13 | yp = sn['ypos'].value() 14 | 15 | layers = [] 16 | valid_channels = ['red', 'green', 'blue', 'alpha', 'black', 'white'] 17 | 18 | for each in ch: 19 | layer_name = each.split('.')[0] 20 | tmp = [] 21 | for channel in ch: 22 | if channel.startswith(layer_name) == True: 23 | tmp.append(channel) 24 | if len(tmp) < 4: 25 | for i in range(4-len(tmp)): 26 | tmp.append(layer_name+".white") 27 | if tmp not in layers: 28 | layers.append(tmp) 29 | 30 | for each in layers: 31 | layer = each[0].split('.')[0] 32 | ch1 = each[0].split('.')[1] 33 | ch2 = each[1].split('.')[1] 34 | ch3 = each[2].split('.')[1] 35 | ch4 = each[3].split('.')[1] 36 | 37 | if ch1 not in valid_channels: 38 | ch1 = "red red" 39 | else: 40 | ch1 = ch1+" "+ch1 41 | 42 | if ch2 not in valid_channels: 43 | ch2 = "green green" 44 | else: 45 | ch2 = ch2+" "+ch2 46 | 47 | if ch3 not in valid_channels: 48 | ch3 = "blue blue" 49 | else: 50 | ch3 = ch3+" "+ch3 51 | 52 | if ch4 not in valid_channels: 53 | ch4 = "alpha alpha" 54 | else: 55 | ch4 = ch4+" "+ch4 56 | 57 | prefs = "in " + layer + " " + ch1 + " " + ch2 + " " + ch3 + " " + ch4 58 | shuffle = nuke.createNode('Shuffle', prefs) 59 | shuffle.knob('label').setValue(layer) 60 | shuffle.setInput(0, sn) 61 | 62 | 63 | -------------------------------------------------------------------------------- /allFilesGoInYourDotNukeOrNukePath/grad.gizmo: -------------------------------------------------------------------------------- 1 | #! /Applications/Nuke5.2v1/Nuke5.2v1.app/Contents/MacOS/Nuke5.2v1 -nx 2 | version 5.2100 3 | Gizmo { 4 | inputs 0 5 | addUserKnob {20 Grad} 6 | addUserKnob {41 channels T Constant2.channels} 7 | addUserKnob {41 format T Constant2.format} 8 | addUserKnob {41 LLColor T Expression2.LLColor} 9 | addUserKnob {41 LRColor T Expression2.LRColor} 10 | addUserKnob {41 URColor T Expression2.URColor} 11 | addUserKnob {41 ULColor T Expression2.ULColor} 12 | addUserKnob {7 alpha} 13 | alpha 1 14 | } 15 | Constant { 16 | inputs 0 17 | color {0 0 0 {parent.alpha.main i}} 18 | name Constant2 19 | xpos -469 20 | ypos -254 21 | } 22 | Expression { 23 | temp_name0 LLCorner 24 | temp_expr0 (1-x/width)*(1-y/height) 25 | temp_name1 LRCorner 26 | temp_expr1 (x/width)*(1-y/height) 27 | temp_name2 URCorner 28 | temp_expr2 (x/width)*(y/height) 29 | temp_name3 ULCorner 30 | temp_expr3 (1-x/width)*(y/height) 31 | expr0 LLColor.r*LLCorner+LRColor.r*LRCorner+URColor.r*URCorner+ULColor.r*ULCorner 32 | expr1 LLColor.g*LLCorner+LRColor.g*LRCorner+URColor.g*URCorner+ULColor.g*ULCorner 33 | expr2 LLColor.b*LLCorner+LRColor.b*LRCorner+URColor.b*URCorner+ULColor.b*ULCorner 34 | name Expression2 35 | xpos -469 36 | ypos -174 37 | addUserKnob {20 User} 38 | addUserKnob {18 LLColor} 39 | LLColor {1 0 0} 40 | addUserKnob {18 LRColor} 41 | LRColor {0 1 0} 42 | addUserKnob {18 URColor} 43 | URColor {0 0 1} 44 | addUserKnob {18 ULColor} 45 | ULColor {0 0 0} 46 | } 47 | Output { 48 | name Output1 49 | xpos -469 50 | ypos -74 51 | } 52 | end_group 53 | -------------------------------------------------------------------------------- /allFilesGoInYourDotNukeOrNukePath/grad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dekekincaid/nukeEnvExample/f448b9f663ed924d1c13ba7879f14ab411427115/allFilesGoInYourDotNukeOrNukePath/grad.png -------------------------------------------------------------------------------- /init.py: -------------------------------------------------------------------------------- 1 | # init.py example file for teaching people how to create their own for use with Nuke 2 | # 3 | # Author: Deke Kincaid, The Foundry 4 | # dekekincaid@gmail.com 5 | # v1.0 6 | # 10/22/11 7 | # dekekincaid@gmail.com 8 | # 9 | # This file is automatically executed when you launch nuke in both command line and interactive(gui) sessions 10 | # 11 | # Install Instructions: 12 | # 1. copy the file into your .nuke folder or anywhere in your NUKE_PATH 13 | # 14 | # 15 | # Any issues then email me or post a reply in the comments on nukepedia 16 | # dekekincaid@gmail.com 17 | # 18 | # 19 | import os 20 | # 21 | # this example is for directly pointing to other directories you want nuke to look at for loading scripts, gizmos and plugins 22 | nuke.pluginAddPath("/blah/blah/blah/blah") 23 | #nuke.pluginAddPath(os.path.exanduser("~/nukescripts"))# this exampe is if you want to use a folder relative to your user's home directory 24 | 25 | #so lets say you want to really organize scripts on your home machine 26 | #I would first set an environment variable for NUKE_PATH pointing to for example $HOME/nukescripts or /SERVERNAME/SERVERSHARE/PATH/TO/NUKE/ENVIRONMENT/ON/SERVER 27 | #then I will then in my init.py setup the following to organize my scripts: 28 | # 29 | #this will use my home directory 30 | nuke.pluginAddPath(os.path.expanduser("~/nukescripts")) 31 | nuke.pluginAddPath(os.path.expanduser("~/nukescripts/gizmos")) 32 | nuke.pluginAddPath(os.path.expanduser("~/nukescripts/icons")) 33 | nuke.pluginAddPath(os.path.expanduser("~/nukescripts/lut")) 34 | nuke.pluginAddPath(os.path.expanduser("~/nukescripts/plugins")) 35 | nuke.pluginAddPath(os.path.expanduser("~/nukescripts/python")) 36 | nuke.pluginAddPath(os.path.expanduser("~/nukescripts/tcl")) 37 | # 38 | #this example will use a location on the server 39 | # 40 | nuke.pluginAddPath("/path/to/server/nukescripts/gizmos") 41 | nuke.pluginAddPath("/path/to/server/nukescripts/icons") 42 | nuke.pluginAddPath("/path/to/server/nukescripts/lut") 43 | nuke.pluginAddPath("/path/to/server/nukescripts/plugins") 44 | nuke.pluginAddPath("/path/to/server/nukescripts/python") 45 | nuke.pluginAddPath("/path/to/server/nukescripts/tcl") 46 | -------------------------------------------------------------------------------- /menu.py: -------------------------------------------------------------------------------- 1 | # menu.py example file for teaching people how to create their own 2 | # 3 | # Author: Deke Kincaid, The Foundry 4 | # dekekincaid@gmail.com 5 | # v1.0 6 | # 10/22/11 7 | # 8 | # menu.py is automatically executed when you launch nuke but only in interactive(gui) sessions 9 | # if you need something when you render on the farm then you should put it in the init.py 10 | # 11 | # this example shows setting default formats,adds custom menu gizmos, shortcuts, python/tcl scripts 12 | # 13 | # 14 | # Install Instructions: 15 | # 1. copy the file into your .nuke folder or anywhere in your NUKE_PATH 16 | # 17 | # 18 | # Any issues then email me 19 | # dekekincaid@gmail.com 20 | # 21 | # credits: 22 | # Diogo Girondi's branchout.py is used as and example of adding a python script to the menu 23 | # Frank Reuter's SearchReplacePanel is an example of installing a python panel 24 | # Ivan Busquets grad.gizmo is the example for adding gizmos with icons 25 | # 26 | 27 | #this example defines format resolutions 28 | 29 | 30 | nuke.addFormat ("1280 720 0 0 1280 720 1.0 720p") 31 | nuke.addFormat ("2048 1108 0 0 2048 1108 1.0 2k_185") 32 | nuke.addFormat ("2048 1157 0 0 2048 1157 1.0 2k_3perf") 33 | nuke.addFormat ("2048 872 0 0 2048 872 1.0 2k_235") 34 | 35 | #here we are importing python modules and scripts for use as menu items or panels inside nuke on startup 36 | 37 | import os 38 | import os.path 39 | import sys 40 | import nuke 41 | import time 42 | 43 | import branchout 44 | import IconPanel 45 | import nodeOps 46 | import SearchReplacePanel 47 | 48 | #this is where I add different buttons in your tools menus which call python scripts, gizmos, etc... 49 | nuke.menu("Nodes").addMenu("Filter").addCommand("aePremult", "nuke.createNode('aePremult.gizmo')", index=4)#add a gizmo to the Filter menu, index value is menu item number 50 | nuke.menu("Nodes").addMenu("Image").addCommand("Grad", "nuke.createNode('grad')", icon='grad.png', index=8)#add gizmo to Image menu, assigns a specified icon 51 | nuke.menu("Nodes").addMenu("Channels").addCommand("Branch Out Channels", "branchout.branchout()", 'alt+b')#add python script example below to channel menu #also adds alt+b hotkey 52 | 53 | #alternative way to add many items to a single menu with a basic variable 54 | menubar=nuke.menu("Nodes") 55 | m=menubar.addMenu("Image") 56 | m.addCommand("Grad", "nuke.createNode('grad')", icon='grad.png', index=8) 57 | m.addCommand("aePremult", "nuke.createNode('aePremult.gizmo')", index=4) 58 | m.addCommand("Branch Out Channels", "branchout.branchout()") 59 | 60 | #This adds html links to help Menu 61 | nuke.menu("Nuke").addMenu("Help").addCommand("Creative Crash Nuke Downloads", "nuke.tcl(\"start \\\"http://www.creativecrash.com/nuke/downloads/\\\"\")") 62 | nuke.menu("Nuke").addMenu("Help").addCommand("Creative Crash Nuke Tutorials", "nuke.tcl(\"start \\\"http://www.creativecrash.com/nuke/tutorials/\\\"\")") 63 | nuke.menu("Nuke").addMenu("Help").addCommand("Vfxtalk Nuke Forum", "nuke.tcl(\"start \\\"http://www.vfxtalk.com/forum/nuke-foundry-f60.html\\\"\")") 64 | nuke.menu("Nuke").addMenu("Help").addCommand("Vfxtalk Nuke Downloads", "nuke.tcl(\"start \\\"http://www.vfxtalk.com/forum/nuke-plugins-scripts-f124.html\\\"\")") 65 | nuke.menu("Nuke").addMenu("Help").addCommand("Nukepedia", "nuke.tcl(\"start \\\"http://www.nukepedia.com\\\"\")") 66 | 67 | 68 | 69 | #this sets default node values on the grade node and write node 70 | nuke.knobDefault('Grade.black_clamp','false')#turns off black clamp knob on Grade nodes when created 71 | nuke.knobDefault("Write.channels", "rgba")#changes the default on write nodes from rgb to rgba 72 | 73 | 74 | #example for spawining an external application or process from a nuke button 75 | import subprocess 76 | nuke.menu("Nuke").addMenu("Footage").addCommand('BrokenGlass rv', "subprocess.Popen('/usr/local/tweaks/rv/bin/rv /path/to/my/files/', shell = True)")#this spawns flipbook for specific render 77 | nuke.menu("Nuke").addMenu("Utilities").addCommand('Vim', "subprocess.Popen('/usr/bin/gvim', shell = True)")#this creates a menu on the top bar called Utilities and adds a button to start up gvim 78 | 79 | 80 | #example for adding slog lut in root 81 | nuke.root().knob('luts').addCurve("sLog", "{pow(10.0, ((t - 0.616596 - 0.03) /0.432699)) - 0.037584}") 82 | 83 | #example for killing all viewers apon opening new script to speed up working with large scripts 84 | def killViewers(): 85 | for v in nuke.allNodes("Viewer"): 86 | nuke.delete(v) 87 | nuke.addOnScriptLoad(killViewers) 88 | 89 | #adds frank's search and replace python panel which is included 90 | def addSRPanel(): 91 | '''Run the panel script and add it as a tab into the pane it is called from''' 92 | myPanel = SearchReplacePanel.SearchReplacePanel() 93 | return myPanel.addToPane() 94 | nuke.menu('Pane').addCommand('SearchReplace', addSRPanel)#THIS LINE WILL ADD THE NEW ENTRY TO THE PANE MENU 95 | nukescripts.registerPanel('com.ohufx.SearchReplace', addSRPanel)#THIS LINE WILL REGISTER THE PANEL SO IT CAN BE RESTORED WITH LAYOUTS 96 | 97 | 98 | -------------------------------------------------------------------------------- /menuPyAnatomy_v01.nk: -------------------------------------------------------------------------------- 1 | #! /Applications/Nuke6.3v3/Nuke6.3v3.app/Contents/MacOS/Nuke6.3v3 -nx 2 | version 6.3 v3 3 | define_window_layout_xml { 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | } 38 | Root { 39 | inputs 0 40 | name /Users/deke/nukescripts/nukeEnvExampleFiles/menuPyAnatomy_v01.nk 41 | frame 5 42 | last_frame 96 43 | format "640 480 0 0 640 480 1 PC_Video" 44 | proxy_type scale 45 | proxy_format "1024 778 0 0 1024 778 1 1K_Super_35(full-ap)" 46 | luts {linear {} 47 | sRGB {} 48 | rec709 {} 49 | Cineon {} 50 | Gamma1.8 {} 51 | Gamma2.2 {} 52 | Panalog {} 53 | REDLog {} 54 | ViperLog {} 55 | REDSpace {} 56 | sLog {"pow(10.0, ((t - 0.616596 - 0.03) /0.432699)) - 0.037584"} 57 | AlexaV3LogC {"(t > 0.1496582 ? pow(10.0, (t - 0.385537) / 0.2471896) : t / 0.9661776 - 0.04378604) * 0.18 - 0.00937677 "}} 58 | views { 59 | {LFT ""} 60 | {RGT ""} 61 | } 62 | addUserKnob {20 User} 63 | addUserKnob {4 deptMode l "Choose a department mode:" M {none "Paint Fix" Lighting FX}} 64 | addUserKnob {2 filebase} 65 | filebase /studio/pib/shdw_light/prod/sqtrain/sfoundry_teacher/comp/DreamworksWorkingFiles/24-Relighting/footage/ 66 | addUserKnob {20 mariTab l Mari} 67 | addUserKnob {3 socketPort l "command port" t "Port to listen on. Make sure this matches the command port set in Mari's \"Nuke\" Palette." -STARTLINE} 68 | socketPort 50007 69 | addUserKnob {6 enableSocket l enable -STARTLINE} 70 | addUserKnob {1 hostName l "Mari host/port" t "Set machine name or ip address that Mari is running on.\nLeave empty if both Mari and Nuke are running on the same machine."} 71 | addUserKnob {3 socketPortSend l "" t "Port that Mari is listening to. Make sure this matches the command port set in Mari's Preferences." -STARTLINE} 72 | socketPortSend 6100 73 | addUserKnob {2 mariDataDir l "mari data dir" t "Path to directory that will hold data to be sent to Mari (exrs, objs and fbx files). If this is left empty a \"mari\" directory will be created in the nk file's location"} 74 | mariDataDir "\[file dirname \[value root.name]]/mariData" 75 | } 76 | BackdropNode { 77 | inputs 0 78 | name BackdropNode2 79 | tile_color 0x20034ff 80 | label "\n\nnuke.addFormat(\" \")\n\n\n\n nuke.addFormat (\"1280 720 0 0 1280 720 1.0 720p\")\n nuke.addFormat (\"2048 1108 0 0 2048 1108 1.0 2k_185\")\n nuke.addFormat (\"2048 1157 0 0 2048 1157 1.0 2k_3perf\")\n nuke.addFormat (\"2048 872 0 0 2048 872 1.0 2k_235\")" 81 | note_font_size 42 82 | xpos 1288 83 | ypos -3238 84 | bdwidth 1658 85 | bdheight 539 86 | } 87 | BackdropNode { 88 | inputs 0 89 | name BackdropNode5 90 | tile_color 0xff5f00ff 91 | label "\n\n\n\n\n\n nuke.knobDefault('Grade.black_clamp','false')\n#When you create a Grade node, take the knob \"black_clamp\" and make it's value \"false\" or \"off\"\n\n nuke.knobDefault(\"Write.channels\", \"rgba\")\n#When you create a write node, change the default output from \"rgb\" to \"rgba\"\n\n" 92 | note_font "Bitstream Vera Sans" 93 | note_font_size 42 94 | xpos 1308 95 | ypos 26 96 | bdwidth 1849 97 | bdheight 691 98 | } 99 | BackdropNode { 100 | inputs 0 101 | name BackdropNode4 102 | tile_color 0x142e46ff 103 | label "\n\n\n nuke.menu(\"Nuke\").addMenu(\"Help\").addCommand(\"Creative Crash Nuke Downloads\", \"nuke.tcl(\\\"start \\\\\\\"http://www.creativecrash.com/nuke/downloads/\\\\\\\"\\\")\")\n#In the Help menu make a button called \"Creative Crash Nuke Downloads\"\n#Open the url\n\nnuke.menu(\"Nuke\").addMenu(\"Help\").addCommand(\"Nukepedia\", \"nuke.tcl(\\\"start \\\\\\\"http://www.nukepedia.com\\\\\\\"\\\")\")" 104 | note_font "Bitstream Vera Sans" 105 | note_font_size 42 106 | xpos 1293 107 | ypos -1212 108 | bdwidth 2989 109 | bdheight 446 110 | } 111 | BackdropNode { 112 | inputs 0 113 | name BackdropNode7 114 | tile_color 0x142e46ff 115 | label "\n\n\n#example for spawining an external application or process from a nuke button\nimport subprocess\nnuke.menu(\"Nuke\").addMenu(\"Footage\").addCommand('BrokenGlass rv', \"subprocess.Popen('/usr/local/tweaks/rv/bin/rv /path/to/my/files/', shell = True)\")\n#create a new menu called \"Footage\". \n#Inside it add a menu item called BrokenGlass. \n#Spawns RV flipbook for the specified file.\n\nnuke.menu(\"Nuke\").addMenu(\"Utilities\").addCommand('Vim', \"subprocess.Popen('/usr/bin/gvim', shell = True)\")\n#create a menu on the top bar called Utilities\n#adds a button called \"Vim\"\n#start up the external application gvim from the shell " 116 | note_font "Bitstream Vera Sans" 117 | note_font_size 42 118 | xpos 1306 119 | ypos -718 120 | bdwidth 3506 121 | bdheight 702 122 | } 123 | BackdropNode { 124 | inputs 0 125 | name BackdropNode6 126 | tile_color 0x849b00ff 127 | label "\n\n\n\n\n\n nuke.root().knob('luts').addCurve(\"sLog\", \"\{pow(10.0, ((t - 0.616596 - 0.03) /0.432699)) - 0.037584\}\")\n#Add the curve called \"sLog\" to the root luts with the included formula for reversing the curve\n\n" 128 | note_font "Bitstream Vera Sans" 129 | note_font_size 42 130 | xpos 1304 131 | ypos 818 132 | bdwidth 1932 133 | bdheight 556 134 | } 135 | BackdropNode { 136 | inputs 0 137 | name BackdropNode8 138 | tile_color 0x2d03ff 139 | label "\n\n\n\n\n\n\n\n\n\n\n nuke.ViewerProcess.register(\"Cineon\", nuke.createNode, (\"ViewerProcess_1DLUT\", \"current Cineon\"))\n#adds the default cineon 1d lut to the viewer\n\n\nnuke.ViewerProcess.register(\"My Custom Process\", nuke.Node, (\"MyProcess\", \"\"))\n#adds \"My Custom Process\" to viewer\n#Use the gizmo called MyProcess.gizmo\n\n\n nuke.ViewerProcess.register(\"AlexaV3Rec709\", nuke.createNode, (\"Vectorfield\",\"vfield_file /path/to/lut/AlexaV3_EI0800_WYSIWYG_EE_nuke1d.cube colorspaceIn AlexaV3LogC\"))\n#Create a viewer process called \"AlexaV3Rec709\"\n#inside the viewer use a Vectorfield node with the included lut\n#convert the incoming colorspace to AlexaV3LogC before applying the vectorfield\n\n" 140 | note_font "Bitstream Vera Sans" 141 | note_font_size 42 142 | xpos 1304 143 | ypos 1426 144 | bdwidth 3401 145 | bdheight 1133 146 | } 147 | BackdropNode { 148 | inputs 0 149 | name BackdropNode1 150 | tile_color 0x142e46ff 151 | label "\n\n\n\n\n\n\n\nnuke.menu(\"Nodes\").addMenu(\"Filter\").addCommand(\"aePremult\", \"nuke.createNode('aePremult.gizmo')\", index=4)\n#add a gizmo dFielder to the Filter menu as item number 4 in the menu\n\nnuke.menu(\"Nodes\").addMenu(\"Image\").addCommand(\"Grad\", \"nuke.createNode('grad')\", icon='grad.png', index=8)\n#add the Grad gizmo to Image menu with the icon grad.png as item number 8 in the menu\n\nnuke.menu(\"Nodes\").addMenu(\"Channels\").addCommand(\"Branch Out Channels\", \"branchout.branchout()\", 'alt+b')\n#add python script called branchout to the Channels menu. Call branchout function from inside the script. Also assign the alt+b hotkey" 152 | note_font "Bitstream Vera Sans" 153 | note_font_size 42 154 | xpos 1293 155 | ypos -2590 156 | bdwidth 3466 157 | bdheight 761 158 | } 159 | BackdropNode { 160 | inputs 0 161 | name BackdropNode3 162 | tile_color 0x142e46ff 163 | label "\n\n\nmenubar=nuke.menu(\"Nodes\")\nm=menubar.addMenu(\"Image\")\nm.addCommand(\"Grad\", \"nuke.createNode('grad')\", icon='grad.png', index=8)\nm.addCommand(\"aePremult\", \"nuke.createNode('aePremult.gizmo')\", index=4)\nimport branchout\nm.addCommand(\"Branch Out Channels\", \"branchout.branchout()\")" 164 | note_font "Bitstream Vera Sans" 165 | note_font_size 42 166 | xpos 1293 167 | ypos -1772 168 | bdwidth 2010 169 | bdheight 456 170 | } 171 | StickyNote { 172 | inputs 0 173 | name StickyNote21 174 | label "Anatomy of a Nuke menu.py file" 175 | note_font_size 50 176 | xpos 1656 177 | ypos -3516 178 | } 179 | StickyNote { 180 | inputs 0 181 | name StickyNote8 182 | tile_color 0xd8d8d8ff 183 | label Top 184 | note_font_size 42 185 | xpos 2160 186 | ypos -3143 187 | } 188 | StickyNote { 189 | inputs 0 190 | name StickyNote7 191 | tile_color 0xd8d8d8ff 192 | label Right 193 | note_font_size 42 194 | xpos 2052 195 | ypos -3143 196 | } 197 | StickyNote { 198 | inputs 0 199 | name StickyNote2 200 | tile_color 0xd8d8d8ff 201 | label Y 202 | note_font_size 42 203 | xpos 1960 204 | ypos -3143 205 | } 206 | StickyNote { 207 | inputs 0 208 | name StickyNote5 209 | tile_color 0xd8d8d8ff 210 | label Y 211 | note_font_size 42 212 | xpos 1710 213 | ypos -3143 214 | } 215 | StickyNote { 216 | inputs 0 217 | name StickyNote6 218 | tile_color 0xd8d8d8ff 219 | gl_color 0x46cc2cff 220 | label X 221 | note_font_size 42 222 | xpos 1610 223 | ypos -3143 224 | } 225 | StickyNote { 226 | inputs 0 227 | name StickyNote4 228 | tile_color 0xd8d8d8ff 229 | label X 230 | note_font_size 42 231 | xpos 1860 232 | ypos -3143 233 | } 234 | StickyNote { 235 | inputs 0 236 | name StickyNote9 237 | tile_color 0xd8d8d8ff 238 | label "Aspect Ratio" 239 | note_font_size 42 240 | xpos 2288 241 | ypos -3143 242 | } 243 | Reformat { 244 | inputs 0 245 | name Reformat1 246 | xpos 2760 247 | ypos -3129 248 | } 249 | StickyNote { 250 | inputs 0 251 | name StickyNote19 252 | tile_color 0x142e46ff 253 | gl_color 0x46cc2cff 254 | label "\").addCommand(\"" 255 | note_font_size 42 256 | xpos 2196 257 | ypos -2543 258 | } 259 | StickyNote { 260 | inputs 0 261 | name StickyNote20 262 | tile_color 0x142e46ff 263 | gl_color 0x46cc2cff 264 | label "\", \"nuke.createNode('" 265 | note_font_size 42 266 | xpos 2918 267 | ypos -2543 268 | } 269 | StickyNote { 270 | inputs 0 271 | name StickyNote12 272 | tile_color 0xd8d8d8ff 273 | label " Gizmo file name " 274 | note_font_size 42 275 | xpos 3299 276 | ypos -2543 277 | } 278 | StickyNote { 279 | inputs 0 280 | name StickyNote22 281 | tile_color 0x142e46ff 282 | gl_color 0x46cc2cff 283 | label "')\", icon='" 284 | note_font_size 42 285 | xpos 3618 286 | ypos -2543 287 | } 288 | StickyNote { 289 | inputs 0 290 | name StickyNote14 291 | tile_color 0xd8d8d8ff 292 | label " iconName.png " 293 | note_font_size 42 294 | xpos 3811 295 | ypos -2543 296 | } 297 | StickyNote { 298 | inputs 0 299 | name StickyNote23 300 | tile_color 0x142e46ff 301 | gl_color 0x46cc2cff 302 | label "' , index=" 303 | note_font_size 42 304 | xpos 4112 305 | ypos -2543 306 | } 307 | StickyNote { 308 | inputs 0 309 | name StickyNote13 310 | tile_color 0xd8d8d8ff 311 | label " item number in menu " 312 | note_font_size 42 313 | xpos 4307 314 | ypos -2543 315 | } 316 | StickyNote { 317 | inputs 0 318 | name StickyNote25 319 | tile_color 0xd8d8d8ff 320 | gl_color 0x46cc2cff 321 | label " Define file formats " 322 | note_font_size 52 323 | xpos 1290 324 | ypos -3316 325 | } 326 | StickyNote { 327 | inputs 0 328 | name StickyNote36 329 | tile_color 0xd8d8d8ff 330 | gl_color 0x46cc2cff 331 | label " Alternative way to add many items to a single menu with basic variables" 332 | note_font_size 52 333 | xpos 1299 334 | ypos -1754 335 | } 336 | StickyNote { 337 | inputs 0 338 | name StickyNote11 339 | tile_color 0xd8d8d8ff 340 | label " Gizmo Name in Menu " 341 | note_font "Bitstream Vera Sans" 342 | note_font_size 42 343 | xpos 2503 344 | ypos -2543 345 | } 346 | StickyNote { 347 | inputs 0 348 | name StickyNote1 349 | tile_color 0x20034ff 350 | label " File Size " 351 | note_font_size 42 352 | xpos 1616 353 | ypos -3215 354 | } 355 | StickyNote { 356 | inputs 0 357 | name StickyNote3 358 | tile_color 0x20034ff 359 | label " Image Area " 360 | note_font_size 42 361 | xpos 1937 362 | ypos -3215 363 | } 364 | StickyNote { 365 | inputs 0 366 | name StickyNote10 367 | tile_color 0xd8d8d8ff 368 | label Name 369 | note_font_size 42 370 | xpos 2546 371 | ypos -3143 372 | } 373 | StickyNote { 374 | inputs 0 375 | name StickyNote24 376 | tile_color 0xd8d8d8ff 377 | gl_color 0x46cc2cff 378 | label " Add button to nuke menus " 379 | note_font_size 52 380 | xpos 1299 381 | ypos -2668 382 | } 383 | StickyNote { 384 | inputs 0 385 | name StickyNote16 386 | tile_color 0x142e46ff 387 | gl_color 0x46cc2cff 388 | label " nuke.menu(\"Nodes\").addMenu(\"" 389 | note_font_size 42 390 | xpos 1320 391 | ypos -2543 392 | } 393 | StickyNote { 394 | inputs 0 395 | name StickyNote17 396 | tile_color 0xd8d8d8ff 397 | gl_color 0x46cc2cff 398 | label " Examples " 399 | note_font_size 52 400 | xpos 1328 401 | ypos -2356 402 | } 403 | StickyNote { 404 | inputs 0 405 | name StickyNote18 406 | tile_color 0xd8d8d8ff 407 | gl_color 0x46cc2cff 408 | label " Menu Name " 409 | note_font_size 42 410 | xpos 1933 411 | ypos -2543 412 | } 413 | StickyNote { 414 | inputs 0 415 | name StickyNote32 416 | tile_color 0x142e46ff 417 | gl_color 0x46cc2cff 418 | label " nuke.menu(\"Nuke\").addMenu(\"" 419 | note_font_size 42 420 | xpos 1332 421 | ypos -2423 422 | } 423 | StickyNote { 424 | inputs 0 425 | name StickyNote28 426 | tile_color 0xd8d8d8ff 427 | gl_color 0x46cc2cff 428 | label " Examples " 429 | note_font_size 52 430 | xpos 1328 431 | ypos -3052 432 | } 433 | StickyNote { 434 | inputs 0 435 | name StickyNote44 436 | tile_color 0xd8d8d8ff 437 | gl_color 0x46cc2cff 438 | label " Examples " 439 | note_font_size 52 440 | xpos 1332 441 | ypos 212 442 | } 443 | StickyNote { 444 | inputs 0 445 | name StickyNote42 446 | tile_color 0x142e46ff 447 | gl_color 0x46cc2cff 448 | label " nuke.knobDefault(' " 449 | note_font_size 42 450 | xpos 1324 451 | ypos 121 452 | } 453 | StickyNote { 454 | inputs 0 455 | name StickyNote31 456 | tile_color 0x142e46ff 457 | gl_color 0x46cc2cff 458 | label " ',' " 459 | note_font_size 42 460 | xpos 1914 461 | ypos 121 462 | } 463 | StickyNote { 464 | inputs 0 465 | name StickyNote43 466 | tile_color 0xd8d8d8ff 467 | gl_color 0x46cc2cff 468 | label " knob name" 469 | note_font_size 42 470 | xpos 1700 471 | ypos 121 472 | } 473 | StickyNote { 474 | inputs 0 475 | name StickyNote41 476 | tile_color 0xd8d8d8ff 477 | label " knob value " 478 | note_font "Bitstream Vera Sans" 479 | note_font_size 42 480 | xpos 1997 481 | ypos 121 482 | } 483 | StickyNote { 484 | inputs 0 485 | name StickyNote34 486 | tile_color 0x142e46ff 487 | gl_color 0x46cc2cff 488 | label " ') " 489 | note_font_size 42 490 | xpos 2214 491 | ypos 121 492 | } 493 | StickyNote { 494 | inputs 0 495 | name StickyNote30 496 | tile_color 0xd8d8d8ff 497 | gl_color 0x46cc2cff 498 | label " Setting knob defaults on node creation" 499 | note_font_size 52 500 | xpos 1314 501 | ypos 44 502 | } 503 | StickyNote { 504 | inputs 0 505 | name StickyNote35 506 | tile_color 0xd8d8d8ff 507 | gl_color 0x46cc2cff 508 | label " Examples " 509 | note_font_size 52 510 | xpos 1328 511 | ypos 1004 512 | } 513 | StickyNote { 514 | inputs 0 515 | name StickyNote37 516 | tile_color 0x142e46ff 517 | gl_color 0x46cc2cff 518 | label " nuke.root().knob('luts').addCurve(\" " 519 | note_font_size 42 520 | xpos 1320 521 | ypos 913 522 | } 523 | StickyNote { 524 | inputs 0 525 | name StickyNote39 526 | tile_color 0xd8d8d8ff 527 | gl_color 0x46cc2cff 528 | label " lut name" 529 | note_font_size 42 530 | xpos 1972 531 | ypos 913 532 | } 533 | StickyNote { 534 | inputs 0 535 | name StickyNote38 536 | tile_color 0x142e46ff 537 | gl_color 0x46cc2cff 538 | label " \",\"\{ " 539 | note_font_size 42 540 | xpos 2164 541 | ypos 913 542 | } 543 | StickyNote { 544 | inputs 0 545 | name StickyNote45 546 | tile_color 0x142e46ff 547 | gl_color 0x46cc2cff 548 | label " \}\") " 549 | note_font_size 42 550 | xpos 2764 551 | ypos 913 552 | } 553 | StickyNote { 554 | inputs 0 555 | name StickyNote40 556 | tile_color 0xd8d8d8ff 557 | label " formula for reversing curve " 558 | note_font "Bitstream Vera Sans" 559 | note_font_size 42 560 | xpos 2262 561 | ypos 913 562 | } 563 | StickyNote { 564 | inputs 0 565 | name StickyNote46 566 | tile_color 0xd8d8d8ff 567 | gl_color 0x46cc2cff 568 | label " Creating a root LUT" 569 | note_font_size 52 570 | xpos 1310 571 | ypos 836 572 | } 573 | StickyNote { 574 | inputs 0 575 | name StickyNote29 576 | tile_color 0xd8d8d8ff 577 | gl_color 0x46cc2cff 578 | label " examples for adding html links to help Menu" 579 | note_font_size 52 580 | xpos 1316 581 | ypos -1180 582 | } 583 | StickyNote { 584 | inputs 0 585 | name StickyNote53 586 | tile_color 0xd8d8d8ff 587 | gl_color 0x46cc2cff 588 | label " example menu item for launching an external application" 589 | note_font_size 52 590 | xpos 1332 591 | ypos -700 592 | } 593 | StickyNote { 594 | inputs 0 595 | name StickyNote47 596 | tile_color 0xd8d8d8ff 597 | label " #import the python script branchout so we can call any functions inside it" 598 | note_font "Bitstream Vera Sans" 599 | note_font_size 30 600 | xpos 1612 601 | ypos -1482 602 | } 603 | StickyNote { 604 | inputs 0 605 | name StickyNote27 606 | tile_color 0xd8d8d8ff 607 | label " #take the variable menubar + .addMenu(\"Image\") and assign it to a new variable called \"m\" " 608 | note_font "Bitstream Vera Sans" 609 | note_font_size 30 610 | xpos 1844 611 | ypos -1600 612 | } 613 | StickyNote { 614 | inputs 0 615 | name StickyNote26 616 | tile_color 0xd8d8d8ff 617 | label " #assign the command nuke.menu(\"Nodes\") to the variable \"menubar\" " 618 | note_font "Bitstream Vera Sans" 619 | note_font_size 30 620 | xpos 1839 621 | ypos -1648 622 | } 623 | StickyNote { 624 | inputs 0 625 | name StickyNote33 626 | tile_color 0xd8d8d8ff 627 | gl_color 0x46cc2cff 628 | label " #This alternative adds items to the top bar of Nuke" 629 | note_font_size 30 630 | xpos 1333 631 | ypos -2468 632 | } 633 | StickyNote { 634 | inputs 0 635 | name StickyNote49 636 | tile_color 0x142e46ff 637 | gl_color 0x46cc2cff 638 | label " nuke.ViewerProcess.register(\" " 639 | note_font_size 42 640 | xpos 1324 641 | ypos 1537 642 | } 643 | StickyNote { 644 | inputs 0 645 | name StickyNote51 646 | tile_color 0x142e46ff 647 | gl_color 0x46cc2cff 648 | label " \", nuke.createNode, (\" " 649 | note_font_size 42 650 | xpos 2262 651 | ypos 1537 652 | } 653 | StickyNote { 654 | inputs 0 655 | name StickyNote55 656 | tile_color 0xd8d8d8ff 657 | gl_color 0x46cc2cff 658 | label " Add a custom viewer Lut or gizmo process" 659 | note_font_size 52 660 | xpos 1310 661 | ypos 1444 662 | } 663 | StickyNote { 664 | inputs 0 665 | name StickyNote50 666 | tile_color 0xd8d8d8ff 667 | gl_color 0x46cc2cff 668 | label " Viewer process label " 669 | note_font_size 42 670 | xpos 1866 671 | ypos 1537 672 | } 673 | StickyNote { 674 | inputs 0 675 | name StickyNote56 676 | tile_color 0x142e46ff 677 | gl_color 0x46cc2cff 678 | label " \")) " 679 | note_font_size 42 680 | xpos 3260 681 | ypos 1537 682 | } 683 | StickyNote { 684 | inputs 0 685 | name StickyNote52 686 | tile_color 0x142e46ff 687 | gl_color 0x46cc2cff 688 | label " \",\" " 689 | note_font_size 42 690 | xpos 2910 691 | ypos 1537 692 | } 693 | StickyNote { 694 | inputs 0 695 | name StickyNote54 696 | tile_color 0xd8d8d8ff 697 | label " node name " 698 | note_font "Bitstream Vera Sans" 699 | note_font_size 42 700 | xpos 2692 701 | ypos 1537 702 | } 703 | StickyNote { 704 | inputs 0 705 | name StickyNote57 706 | tile_color 0xd8d8d8ff 707 | label " node settings " 708 | note_font "Bitstream Vera Sans" 709 | note_font_size 42 710 | xpos 2993 711 | ypos 1537 712 | } 713 | StickyNote { 714 | inputs 0 715 | name StickyNote48 716 | tile_color 0xd8d8d8ff 717 | gl_color 0x46cc2cff 718 | label " Examples " 719 | note_font_size 52 720 | xpos 1328 721 | ypos 1772 722 | } 723 | --------------------------------------------------------------------------------