WriteMayaCore

Synopsis

Writes the contents of a field or array of fields to a Alias/Wavefront MAYA "OBJ" file.


   module WriteMayaCore  <src_file="wr_maya.cxx",
                          cxx_hdr_files="fld/Xfld.h"> {
      cxxmethod+req update <status=1>(
         filename+read+notify+req,
         in+read,
         top_name+read,
         nobjs+read,
         .err+write,
         .err_str+write
      );
      string filename<export=2,NEportLevels={2,0}>;
      Mesh+Node_Data &in<export=2,NEportLevels={2,0}>[];
      string top_name<export=2,NEportLevels={2,0}> = "default_avs_field";
      int nobjs<export=2,NEportLevels={2,0}>;
      int err<export=2,NEportLevels={0,2}> = 0;
      string err_str<export=2,NEportLevels={0,2}> = "";
   };

Description

This module parses the arrays of meshes in and then creates 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 3D geometric objects in the scene. 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.

The cell-set hierarchy is preserved in the file format, delimited by comments in the output file. As the module takes an array of meshes as its input it is able to output an array of objects. This is used by the user macros write_maya_multi and write_maya_ARR to output either an array of fields or a GroupObject containing a number of Graphic Display objects. This can, for example, be used to output bounds, isosurface and a slice plane objects to a single Maya file.

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

&in[]

Reference to an array of Fields which are to be written to the Maya file. Each Field should consist of a Mesh containing a Cell_Set, and Node data.

filename

The name of the file that should be written to. The parameter is of type string. The filename should specify the full path name of the file.

top_name

The name of the object being written to the file. The parameter is of type string. The Maya file format stores the names of the objects in the file. This parameter allows these names to be specified. The supplied user macros use the standard AVS object names.

nobjs

The number of objects to be written to the file. The parameter is of type int. The user macro write_maya_ARR uses the GroupObject parameters to set this parameter.

Outputs

err

This flag is used to indicate whether an error has occurred. The parameter is of type int. If this parameter is set to 1 then an error has occurred within the module and the user should be informed. This can be done by using the parameter to control the visibility of an err_str label.

err_str

The description of the current error condition. The parameter is of type string. This parameter is used to store a user readable description of the current error. If no error has occurred the parameter has a value of "".

Utility Modules

The low-level WriteMayaCore module is used in the User Macros write_maya, write_maya_multi, write_maya_GD and write_maya_ARR.

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/wrmymods.v contains the WriteMayaCore module V definition.

Other Notes

The low-level WriteMayaMods library containing the module WriteMayaCore does not specify a process. By default the express process will be used.

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

write_maya, write_maya_multi, write_maya_GD, write_maya_ARR, WriteMayaUI, WriteMayaEg, WriteMayaMultiEg, WriteMayaArrEg, Write STL, Write VGF, Write POV