New portfolio, please access:

This is a research blog for my MA in Visual Effects @ Ravensbourne, UK.

Python scripting in Nuke I

In order to get more familiar with Python scripting in Nuke, I’ve decided to start from the very beggining. I knew there were some videos from The Foundry Youtube channel but I’ve never bothered in watching them. Actually they’ve seemed to be more useful than I initially thought and I quite liked the start. It’s still all very basic, but it gave me a good idea of the syntax and the way I can interact with some nodes and the interface. It also contributes to a better overall understanding of the tool itself.

I’m listing here some basic scripts as a sort of quick memory note/snippet.

// settin defaults;
nuke.knobDefault ("Bezier.output", "alpha");
nuke.knobDefault ("EXPTool.mode", "Stops");
nuke.knobDefault ("EXPTool.label", "[value mode]");

// command help;

// add new format;
nuke.addFormat("2000 1000 LatLong_2K");

// var + setting default format;
latlong = "2000 1000 Latlong";
nuke.knobDefault ("Root.format", latlong);

// redefine/change tools
toolbar ="Nodes");
toolbar.addCommand ("Transform/Reformat", "nuke.createNode('Reformat')", "ctrl+r");

// saved to the ".nuke" folder
// inside the "root" folder --> executed everytime Nuke is initialised.
usersToolbar = nuke.toolbar("Users");
myMenu = usersToolbar.addMenu ("Frank", "calvin.png");
myMenu.addCommand ("Keyer.LumaKeyer", "nuke.createNode('LumaKeyer')", "alt+F");

nuke.createNode ("Merge");
nuke.createNode ("Merge", "operation stencil");


- Posted by rrraul on 01/07/2013 | Nuke |