Tag Archive | pipeline

NUKE PYTHON | disable Furnace nodes

Sometimes the Furnace plugins drive me crazy as having quite a few of them in a Nuke script can slow viewport feedback down drastically. Often, they don’t need to be active all the time. That’s why I searched the internet and found this tiny code and modified it a bit to disable all OFX nodes in the node tree for faster working. All you need to do is to paste this into the script editor and change the value in the last line to 1 (disable OFX) or 0 (enable OFX).

ofxNodes = []
ofxClasses = {‘nuke_furnace’:’OFXuk.co.thefoundry.furnace’}
allNodes = nuke.allNodes()
for node in allNodes:
if ‘OFX’ in node.Class():
ofxNodes.append( node )

#print(ofxNodes)

for node in ofxNodes:
node.knob(“disable”).setValue(0)

The script creates an empty list “ofxNodes” and adds any node of the Furnace class by searching the class for “OFX”.

NUKE PYTHON | change read node’s attributes

My first post is going to cover a simple but quite useful method to replace values of all read nodes in Nuke with Python. It’s especially helpful when you work on multiple computers (at home and at work) with different drive letters. Just paste this into the script editor and change it according to your wishes:

readnds = nuke.allNodes(‘Read’)
for x in readnds:
pth = x.knob(‘file’).value()
npth = pth.replace(“X:”, “Y:”)
x.knob(‘file’).setValue(npth)

x.knob(‘first’).setValue(###)
x.knob(‘last’).setValue(###)

x.knob(‘frame_mode’).setValue(“start at”)
x.knob(‘frame’).setValue(“1”)

pth = current path; npth = new path

!You need to add an indend to each line beginning with line 3!

With the last 4 lines you can optionally set a new frame range and start frame (if you also need to change the project frame range see below).

Setting the project frame range:

nuke.root().knob(‘first_frame’).setValue(#)
nuke.root().knob(‘last_frame’).setValue(#)