|
Maya to MGFE file format translator |
|

Version 1.0, November 1998
Roberto Jiménez
Graphics Group of Girona (GGG)
Introduction
The "standard" scene format at the GGG for realistic image synthesis is the MGFE format. Files written in this format can be obtained for instance through manual file edition using one's favourite editor. Alternatively, they can be written by the maya2mgfe plug-in, described herein, developed by our group in order to be able to adapt scenes generated by Alias|Wavefront's Maya.
What does version 1.0 support?
Maya2mgfe v. 1.0 translates:
- Geometry of transformed polygonal objects. This information is written how mgfe object formed by vertices and faces.
- Cameras. All Maya's cameras are written in the output file (all them commented but the one selected, if any). The selected camera is specified by a parameter in translator dialog box.
- Materials. Currently the translation of radiometric properties is restricted to lambert and Phong materials.
- Animation. Information about animating some objects or cameras using key frames or motion path. The animated properties in a object are its transformations, the scale, rotate, and translate information. But the camera animation is quite different. We animate the center point, the eye point and the up vector with differents channels. The plug-in translates the camera (like a camera in the real world) transfomations (rotate and translate) over time, and the distance between the eye and the center.
Example
The following example shows a comparison between an original scene, which was modeled using Alias|Wavefront's Maya, and the scene generated by the plug-in. Two animations are shown in Figure 1: the first one was generated by Maya and the second by Multi-Frame, an aplication based on [1], [2] over SIR ("Síntesis de Imágenes Realistas") system, developed by our group. Differences can be appreciated between the two animations. These are due basically to the different input scenes to each one of the rendering systems: the Maya rendering used point light sources whereas the Multi-Frame rendering used area light sources. (To our knowledge Maya doesn't deal with "light" sources represented by incandescent materials.)

Figure 1. Two animations generated by Maya and Multi-Frame respectively.
Click here to see the generated MGFE file.
User's guide
Once the plug-in is loaded, use "File | Export All" to execute it to translate the entire scene. To export just the selected objects use "File | Export Selection", and the selected objects together with their properties (material, associated transform, animation channels) will be translated. Within the popped dialog box (as shown in Figure 2) the user can set the following parameters:
- name of the active camera [string]
- normalize animation time [toggle]
- use the default extension in the output file name [toggle]
If the user does not activate the dialog box, the plug-in will translate the scene with the last values of these parameters.
Figure 2. Dialog box associated to the plug-in.
- The default extension is ".mgfe".
- If the flag "Normalize timing animation" is false, then all animations in the scene are translated with its interval animation time; else if this is true, then the translator applies a linear map from Maya's time slider interval time to the interval time [0,1] in all animation channels in the mgfe file.
- The selected camera will not be commented. Only one camera is not commented in the mgfe file, if any.
Implementation details
To make this new plug-in we need to access to the internals of Maya. Maya API (Application Programmer Interface) provide us this internal access. There ara two graphs in Maya internals we can read to translate the scene: DAG and Dependency Graph. The DAG (Direct Acyclic Graph) is composed of two types of DAG nodes, transforms and shapes. Transform nodes maintain transformation information as well as parenting information. The dependency graph is used to read the information about animation and materials. This graph maybe cyclic and include the DAG. All the information in the scene can be read from these graphs.
Maya API provides us several kind of plug-ins. Each kind can be developed making a new class derived from the correspondent class in the hierarchy Maya provide.
We define a new maya2mgfe class that derives from MPxFileTranslator class. This class permit us to receive a message when the user wants to translate the scene. This class has two basic methods: reader and writer. We only use writer.
Basically, as explained above, we translate the following information:
- Geometry and its associated transformations.
- Cameras.
- Materials. Phong and Lambert.
- Animation:
- with key frames.
- with motion paths.
The DAG permit us the access to all the information we need to read geometry and cameras. We read the geometry as meshes, cameras, and its associated transformations. These transforms can be distributed in a hierarchy, i.e, if the scene is a hand, we could have a transformation applied to the fingers, and other transformation applied to the entire hand.
From the geometry or camera we access the dependency graph to read the information about animations and materials associated with it. In Figure 3 we can see a hierarchy of a simple scene. It is formed by a group with only two objects.
Figure 3: Objects hierarchy in a simple scene
To read the information about the animation and materials, we should navigate from an object through the dependency graph, that is, to find the information about animation we should navigate through the links named { scaleX, scaleY, scaleZ, rotateX, ..., translateZ}. Figure 4 and Figure 5 show each kind of information in the maya hypergraph, that is, materials and animation.
Figure 4. A selected mesh "pCubeShape1" connected to a lambert shading group
In Figure 5 each channel animates one kind of transformation in the object. This channel can be associated with a shape transform or other higher transform in the hierarchy. In the image, the animation channels affect to the entire group and no object in the group has animation channels.
Figure 5. An animation with keyframes.
Things to do
In order to cover the evolving requirements of the GGG, we plan to incorporate the following improvements to following releases (Note: entries are listed in no particular order, i.e. their priorities must still be fixed by our group):
- Correct treatment of Maya illumination models. Currently maya2mgfe only translates ideal diffuse (i.e. lambertian) and specular materials.
- Better translation of geometric primitives. For instance, maya2mgfe v. 1.0 translates a sphere as a set of polygons. This can be convenient for Finite Element algorithms, like hierarchical radiosity and others, but other algorithms, like Monte Carlo path tracers, would deal more efficiently with the straight sphere definition consisting on a center and a radius.
- Translation of new animated properties, like camera view, visibility, ...
- ...
References
- G. Besuievsky and M. Sbert. The Multi-Frame Lighting Method: A Monte Carlo Based Solution for Radiosity in Dynamic Environments. In X. Pueyo and P. Shoeder (editors) Rendering Techniques '96 (Proceedings of the Seventh Eurographics Workshop on Rendering) June, 1996.
- G. Besuievsky and X. Pueyo. Animating Radiosity Environments Through the Multi-Frame Lighting Method. Journal of Visualization and Computer Animation (to appear).

Last modified: Monday, 18-Dec-2000 17:40:55 MET
You can drop us a note (rjimenez@ima.udg.es)