def userToLabel(): try: nuke.thisNode()['label'].setValue(activeUser) exept NameError: pass nuke.addOnUserCreate(userToLabel)

]]>

import nuke import random roto = nuke.selectedNode() knob = roto['curves'] for shp in knob.rootLayer: attrs = shp.getAttributes() attrs.set( 'opc', random.random() )

There’s more in-depth information on the Foundry forums:

http://community.thefoundry.co.uk/discussion/topic.aspx?f=190&t=103073

http://community.thefoundry.co.uk/discussion/topic.aspx?f=190&t=102867

http://community.thefoundry.co.uk/discussion/topic.aspx?f=190&t=102009

(This assumes a left-handed coordinate system with green as the y-axis pointing up.)

]]>In case you would like to switch the antialiasing inside a Scanline Renderer to “high” when rendering on the farm, but keep working in the GUI with “none”, you could use a line like this:

nuke.selectedNode()['antialiasing'].setExpression('$gui? 0:3')

Of Course you can use this for every kind of knob. Quite useful to link transformation and rotation order in 3d space, too.

]]>lerp(oldMin, newMin, oldMax, newMax, curve)

Yeah, I know. Where was this function all these years?

]]>twostrip offers a basic level of controls over how the input is treated and separated. There’s also an option to output the strip mattes instead of the final treated image, so you can use your own grain or go completely nuts with it.

]]>t%(step) ? lerp( t-(t%step), yourFunction(t-(t%step)), t+(step-(t%step)), yourFunction(t+(step-(t%step))), t) : yourFunction

with yourFunction referencing your original random curve and step being the interval in frames in which you want to sample that curve (so 5 would sample every 5th key frame, .2 would sample 5 times in-between key frames etc…).

]]>isinf(r)? r(x+1,y):r

isinf(r)? ((r(x+1,y)+r(x+1,y+1)+r(x+1,y-1)+r(x,y+1)+r(x,y-1)+r(x-1,y+1)+r(x-1,y)+r(x-1,y-1))/8):r

]]>

isnan(r)? r(x+1,y):r

or

isnan(r)? ((r(x+1,y)+r(x+1,y+1)+r(x+1,y-1)+r(x,y+1)+r(x,y-1)+r(x-1,y+1)+r(x-1,y)+r(x-1,y-1))/8):r

]]>