Python in Nuke | Arnold Render Layers

This page shows the results of my personal explorations of setting up the user interface for the Arnold render layers in Nuke

Setting up the shuffle node for each Arnold render layer would take time. So I wrote a script that helps us to set up all the shuffle nodes without worrying to create shuffle node one by one.

Result:
Result_RenLayNUKE.jpg
User Interface:
UI_RenLayNUKE.png
How to use the code in Nuke:
Progress:

I did some research about using Python in Nuke. I found multiple examples of python code that were used to create a Node or even setting up a value inside a filter node. I decided to create a code for Arnold render layers that can be useful in the long run.

settingUpLayers.jpg

First, I created a variable that contains the channels of an image. Then, I split the names so it does not have the rgb channel for the Arnold render Layers.

uiNuke.jpg

Next, I created a user interface in Nuke that will allow the user to choose what layers are being used for each render layer. I'm using 'addEnumerationPulldown' to create a list of layers as a dropdown menu.

storeListChannels.jpg

Then,I set up a variable to store the value of the menu in a variable. After this, I need to write a code for how to create the shuffle nodes.

shuffleNodes.jpg

I write the code for it in a function so that I can call it easier. Dot is an empty node that is being used only to organize the node graph. I also add a grade and color correct node.

shuffleNodes2.jpg

I call the function to create shuffle nodes for each render layer that the value has been stored. It creates a shuffle node based on what layers do the user chooses.

mergeNodes.jpg

Then, I write some python code that works in the Nuke script editor to create a merge node for each shuffle so that it automatically comp all of the shuffle nodes together. I put all of these codes inside a function to tidy up the code.

This code still can be developed in many ways. Personally, I will try to expand this code, so it could has various functions. Feel free to download the code and modified it so it could be improved significantly.

Thank you.