Join Aaron F. Ross for an in-depth discussion in this video Managing source images and other dependent files, part of Maya: Workflow Tips.
In order to prevent problems with scene files, we need to make sure that any dependent files, such as texture maps or sounds, are placed within the appropriate folders within the Maya project structure. If you open a Maya scene and the textures or maps are not found, then it's probably because you didn't place them in the correct location to begin with. We are going to go through the process of correctly adding files to a Maya project and we'll also look at the pitfalls that could happen if you do it incorrectly.
I've got a scene here with a picture and I just want to place an image onto the picture plane here. On the panel toolbar here I'm just going to activate shaded mode by clicking on smooth shade all. And I'll also activate textured mode, you can do that by hitting the five key and then the six key on your keyboard as well. I want to add a new material to this picture plane object, so I'll select that. And then right-click on it and choose Assign New Material from the Marking menu.
In the assign new material window, I'll choose Lambert, which is a shader type. It does not have highlights. The attribute editor opens automatically, and I want to rename this shader. So go over here and rename it. I'll call it Picture Lambert. An underscore. Get rid of that two at the end and press the Enter key so that it will actually take the change. At this point we can go and add a map to the color slot of the material or shader. However, before we do this, we want to make sure that the file in question is in the source images folder within the current project.
And if we don't place the file in the correct location and we go and link to some other random location then we will have an improperly structured path. What we need here is a relative path. In which the only information Maya has is that the file is inside a certain sub-folder within the current project, wherever that project may be. It's important that we have a relative path so that we can actually move projects around and all the links internal to that project will not get broken.
So before we jump off a cliff here, we want to make sure that our file is actually in the right place before we try to create a file node here. I'm going to minimize Maya, and minimize this output window as well. And you'll see that I've got two windows open here on my desktop. I've got the exercise files, and also the exercise files master project source images. Inside this exercise files folder, there's a raw files folder. I want to open that. And in there we have an image or two.
Go ahead and open this up and scroll through. And we got this image called tower of London skyline. What we need to do is make a copy of that and place it within the source images of the current project. Which is master project. I don't recommend just moving it, it's a better idea to have two copies of it. Basically, when you are working with textures and maps, you will tend to have a folder that's sort of your library, and then you will also have the files that you have actually used in the project. So, I want to copy this, I will select it and then right-click And choose Copy.
Go over to the source image's folder and paste into that folder. And now that file has been placed in the location that it needs to be for a properly structured path. Alright, I'll go back to Maya, open that back up again. Go back to my attribute editor, picture Lambert. And for the color slot, I'll click on, create render node, the little checker icon. And in the create render node dialogue, I want to choose file, because this is a file node. And then go to where it says, image name, and click on the browse button.
And it takes us directly to the current project, which is master project. Source images. If, for some reason, it happens to take you somewhere else, just go over here in the current project section, and click source images. That will take you directly to the current project source images. I'll select that and click Open. And now it's been correctly applied onto that material. Let's look at the image name here. So I'll click in that and I'll just use the arrow key to move over a bit and you can see that the only information that is stored here is that the file is inside a folder called source images and that's a default location for all images that will be applied onto surfaces.
The same goes for sounds, they're placed into a folder called sounds. And that's inside the current project. We don't see anything here like a drive letter or a volume name. And if we do see a drive letter or a volume name, that's actually a problem. You never want to see that. You want to see a relative path, not an absolute path. And again, that's so that your folders, your entire projects, will be self-contained. And that makes it very easy for you to do things like merge projects, archive projects and most importantly, not have broken links to textures and sounds.
So, this is how you do it correctly, I just want to show you how to do it the wrong way so that you don't make that mistake. If I try to browse here and just go to some other location, other than source images in the current project, then I'm doing it wrong. So, let's do it wrong. I'll go into the desktop exercise files, raw files, or whatever random folder and choose that. Click open and now in my image name here, if we scroll over with the arrow key, you will see that there is an absolute path, which in Windows starts with a drive letter.
On the Mac it will just be the name of the current volume or disk. This is bad because if we ever move that file anywhere else then this link will get broken. So basically, if we want to have properly structured projects, we never ever want to see a drive letter or a volume name. So, I'll undo the damage and do it correctly. Go back in here and I want to go to Source Images and link to the file inside Source Images, and click Open. And now we're back to having a relative path, and everything's wonderful.
So that's how you correctly link to source image files in the Maya project structure.
- Managing projects assets
- Versioning scenes
- Importing, exporting, and sending scenes to other applications
- Referencing files
- Populating a master scene with assembly references
- Loading and unloading modules
- Setting options for new scenes
- Customizing Maya's interface