shuffleFromViewer v1.1


 
This location is for Registered Users Only.
Perhaps you need to login or register.
Contributor: Conrad Olson
Sets a shuffle node to layer currently being shown the viewer and vice versa.
Requirements:
12.2, 12.1, 12.0, 11.3, 11.2, 11.1, 11.0, 10.5, 10 or later
Linux, Mac, Windows
14 Dec 2020
124

You can watch a video demo of this tool here: https://www.youtube.com/watch?v=AiVtWjrtDlk

When I'm working with CG renders that include excesive numbers of AOVs I find it a real pain to look through and find the ones I need to work with. I found the easiest way to go through them was the view the render and then use the Page Up/Page Down keys to change the layer that the viewer is showing. But once I found a layer I wanted I would have to go back to the node graph, create a shuffle node and then find the layer again.

I created this python script to speed up the process. Now, once I find a layer I want I can press CTRL+ALT+SHIFT+S (couldn't think of a better keybaord shortcut) and the script will automatically create a new shuffle node with the first in set to whatever layer I was viewing. If one or more shuffle nodes were already selected in the Node Graph then the script will change the first in of these nodes, rather than creating new nodes.

I thought I may as well also create the reverse script, so if you have a shuffle node selected it you can set the viewer to view the matching layer with CTRL+ALT+SHIFT+V.

I've tried to write it so that it will create the new Shuffle 2 node if you are using Nuke 12, but if that fails it will create an old Shuffle node if you are using an older version of Nuke, but I haven't had access to Nuke 11 to test it. Please let me know if it doesn't work.

To install it, download this file and move it to wherever you keep your python scripts and just add import shuffleFromViewer to your menu.py

You can watch a video demo of this tool here: https://www.youtube.com/watch?v=AiVtWjrtDlk When I'm working with CG renders that include excesive numbers of AOVs I find it a real pain to look through and find the ones I need to work with. I found the easiest way to go through them was the view the render and then use the Page Up/Page Down keys to change the layer that the viewer is showing. But once I found a layer I wanted I would have to go back to the node graph, create a shuffle node and then find the layer again. I created this python script to speed up the process. Now, once I find a layer I want I can press CTRL+ALT+SHIFT+S (couldn't think of a better keybaord shortcut) and the script will automatically create a new shuffle node with the first in set to whatever layer I was viewing. If one or more shuffle nodes were already selected in the Node Graph then the script will change the first in of these nodes, rather than creating new nodes. I thought I may as well also create the reverse script, so if you have a shuffle node selected it you can set the viewer to view the matching layer with CTRL+ALT+SHIFT+V. I've tried to write it so that it will create the new Shuffle 2 node if you are using Nuke 12, but if that fails it will create an old Shuffle node if you are using an older version of Nuke, but I haven't had access to Nuke 11 to test it. Please let me know if it doesn't work. To install it, download this file and move it to wherever you keep your python scripts and just add import shuffleFromViewer to your menu.py Version 1.1 Added an extra line (line 31) to switch the viewer back to RGBA after creating the shuffle node. This is commented out by default, simply remove the # at the start of line 31 to enable this option.
Please login in order to download these files.

Comments   

 
+1 # Vincent Forand 2020-12-12 23:45
Hi
first i did not even know about the page up / down ! thanks for that.
i have not use your code yet but i would think that after the shuffle is created, it would be usefull to set the viewer back to rgba, to go on and use the pass you just shuffle in the main comp.
also for the label, i guess you could add it to an existing shuffle if you test first if it's empty, but i'm used to having a label like this as a knobDefault anyway!
 
 
0 # Conrad Olson 2020-12-14 22:10
Hi Vincent, I didn't set the viewer back to rgba becuase I often want to keep going through the AOVs to find others. I often pull out several at a time to see what works, or to compare them once I've found them. But that's just the way I work.

It is quite a simple fix though. If you look at the top of the script there is a function called createShuffleNo de(). Inside there there is a try and except statement. The try statement is attempts to create a new shuffle node, from Nuke 12, and if that doesn't work the except statement creates an old shuffle node.

You just need to add this line after the except statement but making sure the indentation of the line lines up with the word except, so that it isn't part of the except statement and will run after either the try or the excpet:

nuke.activeViewer().node()['channels'].setValue('rgba')

This will set the viewer back to rgba after either of the shuffle nodes have been created.
 
 
0 # Conrad Olson 2020-12-14 22:19
I've just updated the script Vincent. All you need to do is download the new version and remove the # at the start of line 31 to enable that new operation
 

You have no rights to post comments

We have 3219 guests and 105 members online