Beispiel #1
0
def register_callbacks():

    # nuke.addOnCreate(crop_overscan.cropOverscan, nodeClass='Crop')
    nuke.addOnCreate(CamProjTab.CamProjTab01, nodeClass='Camera')
    nuke.addOnCreate(CamProjTab.CamProjTab01, nodeClass='Camera2')
    nuke.addOnCreate(DIWrite.CreateWriteTab, nodeClass='Write')
    nuke.addBeforeRender(writeMeta.writeMeta)
    nuke.addAfterRender(writeMeta.delMetaNode)
Beispiel #2
0
import missingFrames
import RandomSelection
import updateFrameRange
import saveTheScript
from Apps.Steropes.SteropesDailies.Nuke import steropesDailies
from Apps.Steropes.SteropesPublish.ui import PublishUi


#from python_thb_dev import templateNode

# import geoffroy_callbacks
# geoffroy_callbacks.register_callbacks()

ToDoList.registerNukePanel()

nuke.addAfterRender(ImageMagick.makeThumbnail)

stores.addStoresMenu()

os.environ['GENEPATH'] = '/usr/home/ggivry/Geoff/NUKE/'
genePath = os.environ['GENEPATH']

fullHD = '2048 1152 0 0 2048 1152 1 2K_178'
nuke.addFormat(fullHD)

fullHD1K = '1024 576 0 0 1024 576 1 1K_178'
nuke.addFormat(fullHD1K)

CGOverscan = '2150 1209 0 0 2150 1209 1 CG_Overscan'
nuke.addFormat(CGOverscan)
Beispiel #3
0
import nuke


def renderFinished():
    nuke.message("render finished")


nuke.addAfterRender(renderFinished)
Beispiel #4
0
import nuke
import renderFinished

print "renderFinished menu.py is loaded"
# All Nuke callback functions can be found on below address.
# https://www.thefoundry.co.uk/products/nuke/developers/90/pythondevguide/callbacks.html
nuke.addAfterRender(renderFinished.notify_user)
Beispiel #5
0
    metadataNode.setName(__modifyMetadataName)
    metadataNode.setXYpos(xposWriteNode, yposWriteNode - 40)
    for name, value in values.iteritems():
        metadataNode.knob('metadata').fromScript('{' + "set {name}".format(name=name) + " \"{}\"".format(value[0].replace('"', '\\"')) + '}')
    connectedNode = writeNode.input(0)
    metadataNode.setInput(0, connectedNode)
    writeNode.setInput(0, metadataNode)


def hasMetadata(writeNode):
    """
    Check if the metadata exist in the write node.

    :parm writeNode: The curernt write node
    :type writeNode: nuke.Node
    :return foundMetadata: A flag that return if it found the metadata or not
    :rtype: boolean
    """
    foundMetadata = False

    for metadataKey in writeNode.metadata().keys():
        if fnmatch(metadataKey, __metadataConvention):
            foundMetadata = True

    return foundMetadata


# registering callbacks
nuke.addBeforeRender(beforeRender, nodeClass='Write')
nuke.addAfterRender(afterRender, nodeClass='Write')
Beispiel #6
0
import nuke

def renderFinished():
	nuke.message("render finished")
		
nuke.addAfterRender(renderFinished)
Beispiel #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 + "')"))
Beispiel #8
0

def createArtifact():

    nuke.scriptSave()
    script = nuke.value("root.name")
    filename, file_extension = os.path.splitext(script)
    artef = '{}_artifact.{}'.format(filename, file_extension)
    shutil.copyfile(script, artef)


def beforeWrite_cb():
    if script_has_version():
        createArtifact()


def afterWrite_cb():
    if script_has_version() and nuke.ask(
            'Do you want to version up your script?'):
        incrementalSave()


# for some off reason these callbacks are added tiwce
nuke.addBeforeRender(beforeWrite_cb)
nuke.addAfterRender(afterWrite_cb)

# setting callback to remove the second one on script load - odd stuff
nuke.addOnScriptLoad(lambda: nuke.removeAfterRender(afterWrite_cb))

####################################