def RVTrixtersasa(): import nuke import os import nukescripts dicts={"BROWSER":"/corky/projects/Sputnik_343196/bin/centos-6_x86-64/rv"} os.environ.update(dicts) n = nuke.selectedNode() try: path = n['file'].value() path = path.rpartition("/")[0] file=os.listdir(path)[5] fullpath = path + "/" + file fullpath = fullpath.replace("exr","jpg") fullpath = fullpath.replace("elin","jflut") #fullpath = fullpath.replace("main","avid") if "whoami" in fullpath: #fullpath = fullpath.replace("2048x1536","1920x1080") fullpath = fullpath.replace("avid","main") if "spides" in fullpath: fullpath = fullpath.replace("3840x2160","1920x1080") nukescripts.start(fullpath) dicts={"BROWSER":"firefox"} os.environ.update(dicts) except: nuke.message("Dude!!!! there is nothing in!!!! we all gonna die!!!!")
def RVwindowsEXR(): import nuke import os import nukescripts n = nuke.selectedNode() path = n['file'].value() path = path.rpartition("/")[0] file=os.listdir(path)[5] fullpath = path + "/" + file fullpath = fullpath.replace("/",'\\') print fullpath nukescripts.start(fullpath)
def RVwindowsJpeg(): import nuke import os import nukescripts n = nuke.selectedNode() path = n['file'].value() path = path.rpartition("/")[0] file=os.listdir(path)[5] print file fullpath = path + "/" + file fullpath = fullpath.replace("/",'\\') fullpath = fullpath.replace("exr",'jpg') fullpath = fullpath.replace("linear",'proxy') print fullpath nukescripts.start(fullpath)
def displayDocumentation(node=None): """ Wrapper function to display documentation in Nuke as a PySide2.QtWebEngineWidgets.QWebEngineView Due to a bug in Nuke 11, the documentation will be displayed using the web browser https://support.foundry.com/hc/en-us/articles/360000148684-Q100379-Importing-PySide2-QtWebEngine-into-Nuke-11 :param node: the Nuke node object :type node: :class:`nuke.Node` :return: a PySide web view widget set up with the local documentation :rtype: PySide2.QtWebEngineWidgets.QWebEngineView """ htmlFile = documentationPath(node) if nuke.env['NukeVersionMajor'] == 11: import nukescripts nukescripts.start(htmlFile) else: return documentationWebViewWidget(htmlFile)
def BGRender(): write = nuke.selectedNode() Name = write['name'].value() first = nuke.toNode("root")['first_frame'].value() first = int(first) first = str(first) last = nuke.toNode("root")['last_frame'].value() last = int(last) last = str(last) G = path = nuke.env['ExecutablePath'] # nuke location Y = nuke.Root().knob('name').getValue() # project name panel = nuke.Panel("BG Render") panel.addSingleLineInput("Run Me:",u"\u0022" + G + u"\u0022" + " -X "+ " " + Name+" " + Y + " " + first + ","+ last ) panel.setWidth(700) panel.show() nuke.scriptSave() nukescripts.start("C:\WINDOWS\system32\cmd.exe")
def knobChangedCommon(knob): """ common knobChanged function for plugin ins this suite :param knob: the nuke knob object :type knob: :class:`nuke.Knob` """ if knob.name() == "docButton": documentationIndex = layer_alchemy.utilities.getDocumentationIndexPath( ) if not documentationIndex: nuke.message("documentation is unavailable") return pluginDocFileName = "{0}.{1}".format(knob.node().Class(), 'html') htmlFile = os.path.join(os.path.dirname(documentationIndex), pluginDocFileName) outputPath = htmlFile if os.path.isfile( htmlFile) else documentationIndex nukescripts.start(outputPath)
def RV(): import nuke import os import nukescripts n = nuke.selectedNode() try: path = n['file'].value() path = path.rpartition("/")[0] file=os.listdir(path)[5] print file fullpath = path + "/" + file fullpath = fullpath.replace("/",'\\') fullpath = fullpath.replace("exr",'jpg') fullpath = fullpath.replace("linear_2khd",'proxy_2khd') print fullpath nukescripts.start(fullpath) except: nuke.message("Dude!!!! there is nothing in!!!! we all gonna die!!!!")
def main(): focusKnobs = ["file", "vfiled_file"] nodes = nuke.selectedNodes() if len(nodes) != 1: nuke.message("노드를 하나만 선택해주세요.") return for knob in focusKnobs: if knob in nodes[0].knobs(): path = nodes[0][knob].value() if path == "": nuke.message("경로가 비어있습니다.") return parentPath = os.path.dirname(path) if not os.path.exists(parentPath): nuke.message("경로가 존재하지 않습니다.") return nukescripts.start(parentPath) return nuke.message("file Knob을 사용하는 노드가 아닙니다.")
def RVTrixter(): import nuke import os import nukescripts dicts={"BROWSER":"/corky/projects/Sputnik_343196/bin/centos-6_x86-64/rv"} os.environ.update(dicts) n = nuke.selectedNode() try: path = n['file'].value() path = path.rpartition("/")[0] file=os.listdir(path)[5] print file fullpath = path + "/" + file print fullpath nukescripts.start(fullpath) dicts={"BROWSER":"firefox"} os.environ.update(dicts) except: nuke.message("Dude!!!! there is nothing in!!!! we all gonna die!!!!")
# Help menu m = menubar.addMenu("Help") if isNukeStudio: m.addCommand( "Comp Keyboard Shortcuts", "nuke.display(\"nuke.hotkeys()\", None, title = \"Nuke key assignments\")" ) else: m.addCommand( "Keyboard Shortcuts", "nuke.display(\"nuke.hotkeys()\", None, title = \"Nuke key assignments\")" ) m.addCommand("-", "", "") m.addCommand( "Documentation", "TopDir = os.path.dirname(nuke.env['ExecutablePath']) + '/';\n\ if nuke.env['MACOS']:\n\ TopDir = os.path.abspath(TopDir + '../../../') + '/'\n\ nukescripts.start(TopDir + 'Documentation/index.html')") m.addCommand( "Release Notes", "nukescripts.start('http://www.thefoundry.co.uk/products/nuke-product-family/nuke/release-notes/')" ) m.addCommand( "Training and Tutorials", "nukescripts.start('http://www.thefoundry.co.uk/products/nuke/training')") m.addCommand("Nukepedia", "nukescripts.start('http://www.nukepedia.com')") m.addCommand( "Mailing Lists", "nukescripts.start('http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo')" )
if nuke.env['WIN32']: args.append( "\"" + path + "\"" ) else: args.append( path ) os.spawnv(os.P_NOWAITO, path, args) # Help menu m = menubar.addMenu("Help") if isNukeStudio: m.addCommand("Comp Keyboard Shortcuts", "nuke.display(\"nuke.hotkeys()\", None, title = \"Nuke key assignments\")") else: m.addCommand("Keyboard Shortcuts", "nuke.display(\"nuke.hotkeys()\", None, title = \"Nuke key assignments\")") m.addCommand("-", "", "") m.addCommand("Documentation", "TopDir = os.path.dirname(nuke.env['ExecutablePath']) + '/';\n\ if nuke.env['MACOS']:\n\ TopDir = os.path.abspath(TopDir + '../../../') + '/'\n\ nukescripts.start(TopDir + 'Documentation/index.html')") m.addCommand("Release Notes", "nukescripts.start('https://www.foundry.com/products/nuke/online-help')") m.addCommand("Training and Tutorials", "nukescripts.start('http://www.thefoundry.co.uk/products/nuke/training')") m.addCommand("Nukepedia", "nukescripts.start('http://www.nukepedia.com')") m.addCommand("Forums", "nukescripts.start('https://community.foundry.com/discuss/nuke')") m.addCommand("-", "", "") m.addCommand("License...", "nuke.licenseInfo()") m.addCommand("Nuke Plug-ins", "FnOpenPluginInstaller()") m = nuke.menu("Animation") m.addCommand("File/Import Ascii...", "nuke.tcl('import_ascii')") m.addCommand("File/Import Time+value Ascii...", "nuke.tcl('import_discreet')") m.addCommand("File/Import Discreet LUT...", "nuke.tcl('import_discreet_lut')")
def TextEdit(): import nuke import os import nukescripts nukescripts.start('Applications/TextEdit.app')