write_maya, write_maya_multi, write_maya_GD, write_maya_ARR

Synopsis

Writes the contents of a field, an array of fields, a Graphic Display object (red renderable port) or a group of Graphic Display objects to a Maya OBJ file.

Input Ports

User Macro Name Type Description

write_maya in_fld Field single set of field data
write_maya_multi in_flds[] Field array of field data
write_maya_GD obj GD Object single Graphic Display Object
write_maya_ARR top_obj GroupObject group of Graphic Display Objects

Description

These user macros all write data to Maya OBJ format files. The exact purpose of each of these three macros is described below:

These macros parse the appropriate input and then create an ASCII Maya OBJ output file containing the Cell_Sets of certain 3D elements. The current implementation outputs triangle, quad, line, polyline and polytristrip cell sets. The module takes cell mesh topology from the input field structure and writes this data out to the Maya file.

The format output is the original Wavefront OBJ file format. This format can store several 3D geometric objects in the scene. These are separated by comment lines. The module is able to pass normals through if they exist on the input mesh. Colors and scalar numerical values at nodes can also be passed through using UV texture coordinates.

Alias/Wavefront Maya logo

The MAYA system is an advanced animation and visualization system developed by Alias/Wavefront. Other packages, such as SoftImage and Lightwave3D can also read the Maya OBJ format. More information about the Maya system can be found on the Alias/Wavefront web-site. A full description of the file format structure with examples, can be found at:

http://cica.cica.indiana.edu/graphics/object_specs/OBJ.format.txt

Inputs

Note that each of the user macros has a different input port.

in_fld - write_maya

Reference to a set of field data that should be written to the Maya file. The field data should consist of a Mesh containing a Cell_Set, and Node data.

in_flds[] - write_maya_multi

Reference to an array of Fields that should be written to the Maya file. The field data should consist of a Mesh containing a Cell_Set, and Node data. The data in each field is written into the Maya file and separated by comments.

obj - write_maya_GD

Reference to a Graphic Display object (red renderable port) that should be written to the Maya file. The field data to be written is extracted from the supplied Graphic Display object.

top_obj - write_maya_ARR

Reference to a GroupObject (red renderable port) that should be written to the Maya file. The GroupObject should contain a number of child Graphic Display objects. These are separated by comments in the output Maya file. GroupObjects are generated by ARR library modules. They can also be created manually.

Utility Modules

The User Macro write_maya uses the low-level module WriteMayaCore and the UI macro WriteMayaUI. As all of the other User Macros are derived from the write_maya macro they also make use of these components.

Example

Three example applications are provided. WriteMayaEg demonstrates the use of the write_maya user macro by generating an isosurface and writing that isosurface to a file. WriteMayaMultiEg demonstrates the use of the write_maya_multi user macro by generating several sets of Field data and writing them all to a single file. WriteMayaArrEg demonstrates the use of the write_maya_ARR macro by loading a multiblock set of data and generating a series of visualizations. The isosurface can then be written to a file. If the resultant file is examined then it is apparent that the isosurface is written out in several chunks, one per block of data.

Files

iac_proj/wr_maya/wrmymacs.v contains the V definitions of the write_maya, write_maya_multi, write_maya_GD and write_maya_ARR User Macros, the WriteMayaUI UI Macro, and the example applications WriteMayaEg, WriteMayaMultiEg and WriteMayaArrEg.

Other Notes

The WriteMayaMacs library inherits its process. As this library contains no procedural code, the process is not important.

Author

Ian Curington
Advanced Visual Systems, Ltd.
Hanworth Lane, Chertsey Surrey, UK
KT16 9JX

Contact

International AVS Centre
Manchester Visualization Centre
Manchester Computing
University of Manchester
Oxford Road
Manchester
United Kingdom
M13 9PL

See Also

WriteMayaCore, WriteMayaUI, WriteMayaEg, WriteMayaMultiEg, WriteMayaArrEg, Write VGF, Write STL, Write POV