Tip of the Week - Shuffle, ShuffleCopy, Copy

| Category: Tip of the Week | | Comments (7) | Views: 6463

Nuke has been gaining some headway in the compositing circles, and I'm seeing more and more questions on VFXTalk about some of the tools that are available to us. In this Tip, I'll be going over the use of the Shuffle, ShuffleCopy, and Copy nodes. These are a couple of the very basic channel controls that you have within Nuke.

Follow along in the extended entry below.

The following nodes, Shuffle, ShuffleCopy, and Copy are used to reorganize channels into a single branch to ease image manipulation.

Shuffle NodeShuffle Copy NodeCopy Node
You'll notice that Shuffle and ShuffleCopy have an identical panel. The difference is in the DAG.
DAG Shuffle & ShuffleCopy
Shuffle only takes one input, while ShuffleCopy takes two. Copy also takes two inputs. In addition, you can also do a quick full channel change into white or black by just clicking the white or black buttons in the Shuffle Nodes.

Using Shuffle is pretty straightfoward, as it only has one input. You can shuffle channels around into the order you want them to. Let's say you have a mask in a channel called maskA.red, but would like it to be the alpha in your rgba layer. Simply set in1 to maskA and in2 to rgba, and the out1 to the rgb of the rgba layer, and rgb.a to the maskA.red layer.

Shuffle Example 1
If you wanted, you could also use maskA.g or maskA.b to pipe into the rgb.a channel. Pretty cool. Here's another Shuffle Node below. What is it doing?

Shuffle Example 2
It's setting the outgoing rgb.a channel to completely white, while shuffling in the maskA.r,g, and b channels into the respective maskB.r,g, and b. As you can see, the Shuffle Node is a powerful channel management tool that you can quickly and easily see which channels are getting affected. Let's move on to the Copy Node.

Copy in DAGThis node has less options than a Shuffle, but it allows you to copy a channel from a different image! A plus of this node over the Shuffle or ShuffleCopy is that it shows you what is being copied within the DAG, allowing for a quick assessment of what you're doing. As you can see from the image on the right, I'm copying my MaskA.red channel from input A into the alpha channel of input B. More often than not you'll see Copy Nodes sprinkled all around a Nuke script. It's set to a default hotkey, K, and it's a quick way to just copy a channel from one input to another. On to the next powerful channel tool, ShuffleCopy!


ShuffleCopy takes the best of both Shuffle and Copy and makes it better. Twice as better? Twice as poweful? That's up for you to decide. While ShuffleCopy only outputs one stream, you can take a combination of different channels from two different inputs and shuffle and copy them around to your hearts content. Instead of in1 and in2 being the same input as in Shuffle, ShuffleCopy maps the in1 to the first input, and in2 to the second input. out1 and out2 are the two different layers in the outgoing stream. What's happening below?

ShuffleCopy Example 1
The rgb channels from the first input are becoming the maskA layer of the second input, while the rgb of the second input remains unchanged, while the alpha is being copied from the first inputs alpha. One thing to remember is that these tools are channel replacement tools. They remove the existing channel! If you want to keep the channel, you'll have to use a ChannelMerge node, which is the subject of another future tip!

7 Comments

Thanks for the breakdown of the tools, I just figured out shuffle and shuffle copy a few days ago after looking for shake's equivalent of reorder > shuffle and switchmatte > shuffle copy. I had no clue as to what copy did.

Awesome stuff. I was wondering if you would be willing to discuss Nuke's Image Based Keyer at all? Also do you use Keylight a lot--even though it is not shipped with Nuke?

I'm hoping to get into an IBK Tip of the Week sometime in the future. At the moment I'm slammed, and an IBK tutorial is a little involved, especially at this moment in time! I do not regularly use Keylight in Nuke, the IBK and regular keyer get my attention the most.

Thanks for this tip. Cannot hold myself from saying that these matrices are exactly the kind of thing that is the most repelling in nuke. Excuse me but the shuffle node in shake has one input control, and it doesn't look like this one needs much more. Granted, you needed to know that you can type 1 and 0 for black and white but still...

I know you still hardly use Nuke 5 but with Nuke's new mask input do you prefer channel streaming or shakes way of doing things. I tried a script with both ways and to me passing channels down the tree just seems so clean and efficient. I don't think I will be using mask inputs anymore. Does nukes channel method make it easier if a script is passed to another compositing for some reason?
What are your thoughts?

Edit: Does Nuke's channel method make it easier if a script is passed to another compositor during production, have you experienced this? As well you have pirates 3 banner up top, do you use the ships geometry for matte purposes or to help you better place the cards? Thanks for your time.

Hey Geronimo, I prefer the Nuke method of piping in channels via copy nodes or shuffles and the like. It makes the script much neater. The shake way of piping in mattes into the side of nodes is archaic, to me, since if you need that same matte further down the line, you've got to pipe it in again. The Nuke5 ability to pipe things directly into nodes is so the Fusion and Shake users will feel more comfortable transitioning to Nuke. But once you've got these Copy, Shuffle, and ShuffleCopy nodes down, you won't want to go back. I find that its much easier to take someone else's script, or hand off my own, if there is a limit on the number of piped in masks.

Concerning the pirate ship in the rotating banner image, I have used the ships as a holdout for images placed on cards in the 3D space. We also had a way to cement a card to a particular 3D vertex, so cards would get locked to the 3D geometry.


Leave a comment