Пример #1
0
 def addCallbackUpdateUI(self, func, nodeClass=None, group=None):
     self._addNukeCallbackGroup(group)
     self.windowInstance()['callback'][group]['updateUI'][func].add(nodeClass)
     if not self.__windowHidden:
         if nodeClass is None:
             nuke.addUpdateUI(func)
         else:
             nuke.addUpdateUI(func, nodeClass=nodeClass)
Пример #2
0
def setup():

    nuke.addBeforeRender(CALLBACKS_BEFORE_RENDER.execute)
    nuke.addOnScriptLoad(CALLBACKS_ON_SCRIPT_LOAD.execute)
    nuke.addOnScriptSave(CALLBACKS_ON_SCRIPT_SAVE.execute)
    nuke.addOnScriptClose(CALLBACKS_ON_SCRIPT_CLOSE.execute)
    nuke.addOnCreate(CALLBACKS_ON_CREATE.execute)
    nuke.addUpdateUI(CALLBACKS_UPDATE_UI.execute)
    if nuke.GUI:
        import nukescripts
        nukescripts.addDropDataCallback(CALLBACKS_ON_DROP_DATA.execute)
def SC_Create(CreateNode):
    try:
        print "Creating Sanity Checker"
        CreateNode_tab = nuke.Tab_Knob(set_Tab)
        CreateNode.addKnob(CreateNode_tab)
        for create_Knob in set_Knobs:
            CreateNode.addKnob(
                nuke.Text_Knob(create_Knob[0], create_Knob[1], create_Knob[2]))
        nuke.addUpdateUI(write_sanitychecker.SC_Update)
    except:
        pass
Пример #4
0
                                          shot_folder + custom_folder +
                                          version + "/" + show_filename +
                                          scene_filename + shot_filename +
                                          custom_filename + version + number +
                                          "." + extension)
                    node['proxy'].setValue(path + show_folder + scene_folder +
                                           shot_folder + custom_folder +
                                           version + "/" + show_filename +
                                           scene_filename + shot_filename +
                                           custom_filename + version +
                                           "_proxy" + number + "." + extension)

                    if extension == "sgi":
                        node['datatype'].setValue("16 Bit")
                except:
                    print("No AutoFillWrites found.")


def createOutputDir():
    file = nuke.filename(nuke.thisNode())
    dir = os.path.dirname(file)
    osdir = nuke.callbacks.filenameFilter(dir)
    if not os.path.isdir(osdir):
        os.makedirs(osdir)


# register functions
nuke.addOnScriptSave(updateAutoFillWrite)
nuke.addUpdateUI(updateAutoFillWrite, nodeClass='Write')
nuke.addBeforeRender(createOutputDir)
def setup_MOTools_UI():
    if nuke.GUI:
        toolbar = nuke.menu('Nodes')
        menu = toolbar.addMenu("MOTools", 'MOTools.png', index=-1)

        # Auto Add Menu Items

        # Search Folders for Files
        for (path, dirs, files) in os.walk('%s' % (thisFolder)):
            categories = path.replace(thisFolder, '').replace('\\',
                                                              '/').title()
            categories = categories[1:]
            path = path.replace('\\', '/')

            menu.addMenu(categories, categories + '.png')

            for curFile in files:
                nodeName = os.path.splitext(curFile)[0]
                if os.path.splitext(curFile)[1].lower() == '.gizmo':
                    menu.addCommand('%s/%s' % (categories, nodeName),
                                    'nuke.createNode("%s")' % (nodeName),
                                    icon=(nodeName + '.png'))
                    print("\t GIZMO : " + categories + " / " + nodeName)
                if os.path.splitext(curFile)[1].lower() == '.nk':
                    menu.addCommand('%s/%s' % (categories, nodeName),
                                    'nuke.nodePaste("/%s/%s.nk")' %
                                    (path, nodeName),
                                    icon=(nodeName + '.png'))
                    print("\t NK : " + categories + " / " + nodeName)

        #Accesibility

        #Automation
        menu = toolbar.addMenu("MOTools/Automation",
                               'Automation.png',
                               index=-1)
        menu.addCommand("AutoWrite",
                        'MOTools.create_AutoWrite()',
                        icon='AutoWrite.png')
        menu.addCommand("AutoExtract",
                        'MOTools.autoExtractEXR()',
                        icon='AutoExtract.png')
        menu.addCommand("ManualExtract",
                        'MOTools.manualExtractEXR()',
                        icon='ManualExtract.png')
        menu.addCommand("Crop: Set to bbox",
                        'MOTools.Auto_Settobbox( )',
                        icon='CroptoBbox.png')
        menu.addCommand("Crop: Set crop to Resolution",
                        'MOTools.Auto_CroptoResolution( )',
                        icon='CroptoBbox.png')
        menu.addCommand("Contactsheet: Set resolution to inputs",
                        'MOTools.Auto_ContactSheet( )',
                        icon='CroptoBbox.png')

        # Camera
        menu = toolbar.addMenu("MOTools/Camera", 'Camera.png', index=-1)
        menu.addCommand("EXR Maya to Nuke",
                        'MOTools.createCam_Cam_MayatoNuke( )',
                        icon='Cam_MayatoNuke_EXR.png')
        menu.addCommand("EXR VRay to Nuke",
                        'MOTools.createCam_Cam_VraytoNuke( )',
                        icon='Cam_VraytoNuke_EXR.png')

        # Enviroments
        menu = toolbar.addMenu("MOTools/Enviroments",
                               'Enviroments.png',
                               index=-1)

        # FX
        menu = toolbar.addMenu("MOTools/FX", 'FX.png', index=-1)

        # Help
        menu = toolbar.addMenu("MOTools/Help", 'Help.png', index=-1)
        menu.addCommand(
            "Help online at MikeOakey.com",
            'nukescripts.start ("https://www.mikeoakley.com/wiki/motools-for-nuke/")',
            icon='Help.png')

        # Hidden
        menu = toolbar.addMenu("MOTools/Hidden", 'Hidden.png', index=-1)

        # Image
        menu = toolbar.addMenu("MOTools/Image", 'Image.png', index=-1)

        # IO
        menu = toolbar.addMenu("MOTools/IO", 'Image.png', index=-1)

        # Learning
        menu = toolbar.addMenu("MOTools/Learning", 'Help.png', index=-1)

        # Lens
        menu = toolbar.addMenu("MOTools/Lens", 'Lens.png', index=-1)

        # Mattes
        menu = toolbar.addMenu("MOTools/Mattes", 'Mattes.png', index=-1)

        # QC
        menu = toolbar.addMenu("MOTools/QC", 'QC.png', index=-1)

        # Rebuilds
        menu = toolbar.addMenu("MOTools/Rebuilds", 'Rebuilds.png', index=-1)

        # Vr
        menu = toolbar.addMenu("MOTools/Vr", 'Vr.png', index=-1)

        # Zebug
        menu = toolbar.addMenu("MOTools/Debug", 'Zebug.png', index=999)
        menu.addCommand("Postage Stamps/Postage Stamps ALL On",
                        'MOTools.PostageStamps_On()',
                        icon='')
        menu.addCommand("Postage Stamps/Postage Stamps ALL Off",
                        'MOTools.PostageStamps_Off()',
                        icon='')
        menu.addCommand("Postage Stamps/Postage Stamps ALL On Selected",
                        'MOTools.PostageStamps_Selected_On()',
                        icon='')
        menu.addCommand("Postage Stamps/Postage Stamps ALL Off Selected",
                        'MOTools.PostageStamps_Selected_Off()',
                        icon='')

        menu.addCommand("Preformance Timers/Preformance Timers On",
                        'nuke.startPerformanceTimers()',
                        icon='')
        menu.addCommand("Preformance Timers/Preformance Timers Off",
                        'nuke.stopPerformanceTimers()',
                        icon='')

        menu.addCommand("System/Return OS",
                        'nuke.stopPerformanceTimers()',
                        icon='')
        menu.addCommand("System/Return HD Space",
                        'nuke.stopPerformanceTimers()',
                        icon='')

        # This adds a global trigger to update the autowrite node when something changes.
        nuke.addUpdateUI(update_AutoWrite, nodeClass='Write')
Пример #6
0
import nuke

from helix.api.nuke import Nuke
import helix.api.nuke.plugin as nkplugin

Nuke.guiStartup()

nuke.addUpdateUI(nkplugin.knobChanged)
Пример #7
0
                nuke.thisKnob().name())


nuke.addOnUserCreate(_cb, ("onUserCreate"))

nuke.addOnCreate(_cb, ("onCreate"))

nuke.addOnScriptLoad(_cb, ("onScriptLoad"))

nuke.addOnScriptSave(_cb, ("onScriptSave"))

nuke.addOnScriptClose(_cb, ("onScriptClose"))

nuke.addOnDestroy(_cb, ("onDestroy"))

nuke.addKnobChanged(_cbk, ("knobChanged"))

nuke.addUpdateUI(_cb, ("updateUI"))

nuke.addAutolabel(_cb, ("autolabel"))

nuke.addBeforeRender(_cb, ("beforeRender"))

nuke.addBeforeFrameRender(_cb, ("beforeFrameRender"))

nuke.addAfterFrameRender(_cb, ("afterFrameRender"))

nuke.addAfterRender(_cb, ("afterRender"))

nuke.addFilenameFilter(lambda s: nuke.tprint("filenameFilter('" + s + "')"))
Пример #8
0
def writeReadingStatus():
	"""
	Change appearance of Write nodes based on whether the node
	is in read/write mode.
	"""
	n = nuke.thisNode()
	if n['reading'].value():
		n['postage_stamp'].setValue(True)
		n['tile_color'].setValue(13500671)
	elif n['reading'].value() != True and n['tile_color'].value != 0:
		n['postage_stamp'].setValue(False)
		n['tile_color'].setValue(0)
	else: pass

nuke.addUpdateUI(writeReadingStatus,(),{},"Write")

def dpxNoAlpha():
	"""
	Do not allow DPX files to be written with alpha
	"""
	n = nuke.thisNode()
	if nuke.filename(n).endswith("dpx"):
		n['channels'].setValue("rgb")

nuke.addUpdateUI(dpxNoAlpha,(),{},"Write")

# Attach Reveal in Finder to Write/Read nodes"""
def deprecated_attach_reveal_in_finder():
	n = nuke.thisNode()
	if not n.knobs().has_key("revealPath"):
Пример #9
0
import nuke
import fxpipe
import fxpipenukescripts
import filenameFilters
import os 
'''
The template for the nuke setup
Make sure to configure this file so that you get the show specific things loaded in
'''
### CUSTOMIZE HERE
nuke.pluginAddPath(os.path.join(fxpipe.jobPath[0], fxpipe.job, fxpipe.jobPathNuke))
### END CUSTOMIZE

### NO Fiddling past here generally
nuke.pluginAddPath('./gizmos')
nuke.pluginAddPath('./plugins')
nuke.pluginAddPath('./scripts')

### Add general formats here
nuke.load('formats.py')

### Make sure we create write directories automatically
nuke.addBeforeRender(fxpipenukescripts.createWriteDir)

### add the autowrite update code
nuke.addUpdateUI(fxpipenukescripts.updateAutowrite)
Пример #10
0
import nuke
import fxpipe
import fxpipenukescripts
import filenameFilters
import os
'''
The template for the nuke setup
Make sure to configure this file so that you get the show specific things loaded in
'''
### CUSTOMIZE HERE
nuke.pluginAddPath(
    os.path.join(fxpipe.jobPath[0], fxpipe.job, fxpipe.jobPathNuke))
### END CUSTOMIZE

### NO Fiddling past here generally
nuke.pluginAddPath('./gizmos')
nuke.pluginAddPath('./plugins')
nuke.pluginAddPath('./scripts')

### Add general formats here
nuke.load('formats.py')

### Make sure we create write directories automatically
nuke.addBeforeRender(fxpipenukescripts.createWriteDir)

### add the autowrite update code
nuke.addUpdateUI(fxpipenukescripts.updateAutowrite)