Chapter 12: File Handling in MEL


 Download CD Content
click to expand

Overview

To this point, we have only covered handling data inside the Maya environment, with the obvious exception of our use of the system command in Chapter 9, Lighting and Rendering. In this chapter, we will examine writing and reading files in and out of Maya, and the Maya ASCII file type, which is actually a MEL script.

The ability to read files in and out of Maya using MEL is a powerful tool, allowing artists and technical directors to efficiently share data without having to share and pass Maya files themselves . This would allow, for example, one artist to work on tweaking the weighting of a skin while another begins adding controls . Perhaps an exporter is needed to an external model format that Maya does not natively support or whose specifications have changed since the last release of Maya. By being able to read data in from files, Maya can use data from other applications, either by writing a script that reads their file format, or by creating an interchange format that all applications can read.

Similarly, understanding the Maya ASCII file format will increase the usability and openness of Maya. Because ASCII files are MEL scripts, if there are problems with a scene file that are causing Maya problems, it is a simple matter to open the scene file in a text editor to find and correct the problem. A popular use of this is to bring data created in a current version of Maya into an earlier version, an operation normally not possible.




The MEL Companion
The MEL Companion: Maya Scripting for 3D Artists (Charles River Media Graphics)
ISBN: 1584502754
EAN: 2147483647
Year: 2003
Pages: 101

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net