Maya> other>Maya File Formats

Maya File Formats

Share |

This tutorial covers the differences between Maya binary and Maya Ascii file formats, also, advantages and disadvantages of the two file formats.

How To Save Different File Formats

If your scene hasn't been saved before, go to file>save scene as.

click to enlarge

Set the files of type to one of the two file formats which I'll be explaining below.

Maya Binary

The Maya binary file extension is .mb. This is probably the most used of the file formats because it's faster loading and faster saving, and in some cases it will create a smaller file. The downside is, unlike Maya Ascii, you can't edit it outside Maya in a program such as wordpad. To open a file like this in wordpad, you would need to go to file>open and set the file of type to all documents so it can select the Maya binary file. If you open a Maya binary file in wordpad, you'd get something like this.

click to enlarge

Wordpad is not capable of editing this type of file. To edit this type of file outside of Maya, you would need a hex editor.

click to enlarge

Editing a Maya file this way is quite difficult. This is where an Ascii file has an advantage.

Maya Ascii Files

The Maya Ascii file extension is .ma. These files can be edited without need of a hex editor. If you were to open one of these files in wordpad, it would appear legible and editable.

click to enlarge

Bascially, an Ascii file is layed out in a straight-forward way. The "file info" lines let you change information such as the file version (this can be handy) and the supposed copy of Maya it was created with.

If you roll down to "createNode transform -s -n "persp";", it doesn't take much to guess that this creates the transform node to the camera. Ascii files look very similar to Mel scripts, because it is. If you were to drop some of the file's code into the script editor, you could run that script and it would create the contents of the file. You can also edit pieces of the file. Let's use a simple example to show how this can be done.

Step one - Download asciicube.ma.

Step two - Open the file in Maya, select the cube in the scene and open the attributes editor. The name of the cube is pCube1. Notice the history node that creates the cube is named polyCube1. We're going to change this using wordpad, not Maya.

click to enlarge

Step three - Go to wordpad and open the asciicube.ma file.

Step four - Roll down to createNode transform -n "pCube1";

Step five - Change the name to "Box1" so now the text looks like this: createNode transform -n "Box1";

Now save the file in wordpad and reopen the file in Maya.

Step five - Select the cube and look at its name. You'll probably see an error like this: _UNKNOWN_REF_NODE_fosterParent1. This error is telling us that the shape node no longer has a transform node parent, so Maya generated this parent transform node. This is because the shape node lost it's connection with the transform node, which is the one we changed the name on. If you open the outliner (window>outliner), you can see the Box1 transform node.

click to enlarge

Step six - Now go back to wordpad.

Step seven - Go back to that section. We need to change the line: createNode mesh -n "pCubeShape1" -p "pCube1";

It's parent node, pCube1 no longer exists, so we need to change it to its new name of Box1. So now it should look like this: createNode mesh -n "pCubeShape1" -p "Box1"; Save the file and go back to Maya to reopen the file.

Step eight - Now the cube is named Box1. But now let's say we want to change the shape node's name to BoxShape1. Close the scene and go back to wordpad.

Step nine - Go back to the line we last edited and change the name of the shape node to BoxShape1. So now the code looks like this: createNode mesh -n "BoxShape1" -p "Box1";.

Close wordpad, go back to Maya, and reopen the file.

Step ten - Now the box has disappeared. If you open the outliner, you can see the box transform and shape nodes, but the node polyCube1 is no longer there. This is because this node has not been connected to the new shade node. It needs to be connected for the cube to be created. So close the file and go back to wordpad for the last time.

Step eleven - Roll down near the bottom of the file. You'll see the line connectAttr "polyCube1.out" "pCubeShape1.i"; This is the piece of code that connects the output of the polyCube create node to the input of the shape node. So change the shape nodes name to the new shape nodes name, which is BoxShape1. So now the line should read: connectAttr "polyCube1.out" "BoxShape1.i"; Also, while we're here, we need to reconnect the shading (the gray color) to the model. Go to the line connectAttr "pCubeShape1.iog" ":initialShadingGroup.dsm" -na; and change the shape node to the right name. So now the line should read connectAttr "polyCube1.out" "BoxShape1.i"; Now save the file and reopen it in Maya.

Step twelve - As you can see, you've successfully changed all the nodes and connections to rename the cube. For this example, we went the slow way of doing this to help show you what you're doing. A faster way would be to use the replace function in wordpad.

Maya Binary vs Maya Ascii

Maya binary saves more quicky and opens files more quickly, and that's probably why it's used more often. While an ascii file may take longer to save and open, it has the advantage of being editable outside of Maya. When sending small to medium sized files to someone, I recommend just using an ascii file, incase, for some reason they can't open it, they'll be able to edit it. For large files, I recommend binary files because no one wants to wait an hour for a file to open. For general saving on your computer, just use binary.

Conclusion

I hope this tutorial has taught you the differences and pros and cons of these two file formats.

Good luck.

turbosquid
Visit The3dStudio.com
Home Tutorials About the Author Site Map
User Agreement Privacy Policy ©2014