Thursday, 23 September 2021

What's a Reference?

Referencing files into other files is a powerful feature in Maya.
When incorporated into rigging it allows for a way more non-destructive workflow.
This post will just be an intro to references for the uninitiated.

But first, let's review importation. We need to be sure we understand that so we can appreciate how referencing is different. And then we'll look at some of cool shit you can do in a reference workflow.

So I have two files here. Scene A:

and Scene B:

As you can see, the contents of these two files are very different. But what I'd like to do is get that green cube from Scene A into Scene B.

A quick export from Scene A and import into Scene B can achieve that.



Now the green cube is in both scenes. And let's be clear, the information that is the green cube is now local to both files. Each scene stores that green cube information data separately. There is no relationship between the green cube in Scene A and the green cube in Scene B. They just look identical because one was made one by copying the other.
But since they are two separate examples of the same information, those examples can diverge as we edit them separately:



Okay. Nothing new you to there, I'd wager. Importation. Everybody gets that.
Now let's look at referencing.
Here I have two more scenes, I will show them to you. Two scenes and I call them Scene 1 and Scene 2. These scenes will not bite you, they want to have fun, so now out of the box comes Scene 2 and Scene 1!



In Scene 1 is a lovely red cube. I'd like to get that red cube into Scene 2, but this time I'll reference it rather than importing it.
So I'll save Scene 1, and then in Scene 2 I'll fo File > Create Reference, and then navigate to Scene 1 to reference it.


Nice. There it is. Scene 1 is now inside Scene 2, including it's lovely red cube.
Notice the outliner. There are two nodes of interest:


Down the bottom, 'scene1RN' is like the entirety of Scene 1 represented as a node. The 'RN' is for "Reference Nodes" (I always assymed...) and if you expand it, you'll see all the nodes contained in Scene 1:


But notice that the node 'scene1:pCube' appears twice the outliner. It's under 'scene1RN' like we'd expect. It's also under the world. Because it was under the world in Scene 1, so now that we've referenced it into Scene 2, it's under Scene 2's world now.

All referenced nodes carry that little blue diamond symbol to denote them as referenced, which is very helpful
And of course the reference has brought with it a namespace named after itself, in this case "scene1".

So far this all seems like formality. In practical terms, how is this different from if we had just imported Scene 1 into Scene 2?
The difference is when we import data, we make a new copy of that data. But that's not what we've done. Since we referenced Scene 1, Scene 1 is not stored inside Scene 2. Scene 1 is just hanging out inside Scene 2 while Scene 2 is open.
No where inside the Scene 2 file is the information composing a lovely red cube. The lovely red cube still belongs to Scene 1.

Remember when we imported the green cube from Scene A to Scene B, and I said there's no relationship between the two green cubes? That isn't there case here. The lovely red cube in Scene 2 looks just like the cube in Scene 1 because it is the cube in Scene 1.

To illustrate this - leaving Scene 2 open - let's go back to Scene 1 in another window and make some edits to cube. Let us alter its loveliness.


Here is what it looks like now inside Scene 1. Make sure to save Scene 1 after these edits.
Lets go back to our Scene 2 window. In the outliner, right click on any referenced node from Scene 1 and go Reference > Reload.


As you can see, the edits we made in Scene 1 have come through in Scene 2. Like I said, the cube in Scene 2 is not a duplicate of the cube in Scene 1, it is the cube in Scene 1. There is only one cube! But it's present in two scenes. It's local to Scene 1, and it's visiting in Scene 2.

As you can imagine, it can be very handy to work like this. Especially in a production environment. If you've a character that's present in dozens of shots, and a change is requested be made to that character - if the character referenced into all those shots, then you only need to make the change in the character's local file, and then the change will automatically be present in all the shots too.

It also saves space. A character file can be pretty large. If it's imported into a hundred shots, then the space taken up by that character is now the character file's size * 101. Yikes.
But if the character is only stored in one file... well you can see how much better than is in terms of storage.

No comments:

Post a Comment