The following are workflow issues you should consider when working with OpenFlight files in Maya.
OpenFlight models are built with a Z-up axis up orientation. When a model is read into Maya using File > Open Scene, the default orientation in Maya is repositioned so that Z is the up vector (normally Maya’s Y axis is oriented as the up vector).
When files are read into Maya using File > Import, the orientation is not affected by the import. You must correctly orient the imported data yourself.
Here are some of the limitations to consider when exporting an OpenFlight file from Maya:
OpenFlight objects have a flat shading flag, which specifies whether the object is to be drawn with flat shading or Gouraud (smooth) shading. This flag is now connected with the "Smooth Shading" attribute of polygons in Maya (as found in the Render Stats tab of the Attribute Editor for the shape).
While OpenFlight supports the flat shading flag at the object level as well as at the face level, Maya only supports the flag at the object level. Thus, the flat shading flag of any object imported into Maya must be set identically for the object and all its faces.
The illumination flag of OpenFlight objects specifies whether the object is to be illuminated by nearby lights or whether it is exclusively self-illuminating.
When importing a self-illuminating object, the following attributes of the corresponding Maya object are turned off: "Casts Shadows", "Receive Shadows", "Visible in Reflections" and "Visible in Refractions". When the imported object is not self-illuminating, all these attributes are turned on.
When exporting a Maya object to OpenFlight, the self-illumination flag is set if and only if the "Receive Shadows" attribute of the Maya object is turned off.
Support has been added to Maya for OpenFlight Switch nodes. Switch nodes allow for an array of visibility masks to be applied to a group transform node. Each child node’s visibility is represented by one bit in the visibility mask. (Current implementation only supports up to 32 children.)
The switch node is implemented as a helper node that is applied to a group transform node and can be viewed and selected through the Hypergraph. The currently selected mask can be modified through the Attribute Editor associated with the switch node.
Switch Nodes are created automatically when an OpenFlight database with Switch Nodes is read into Maya. They may also be created using the fltSwitch command from within the Maya modeling environment.
// Create a Switch node
fltSwitch -n sw1;
// After some geometry has been added under sw1, masks maybe created by selecting the geometry to be visible under the switch for the mask and and then using the fltSwitch command as follows.
fltSwitch -e -am -n sw1;
// Setting the current mask to the desired switch will enable that mask.
fltSwitch -e -cm 0 -n sw1;
Support has been added to Maya for OpenFlight Light Points. Light Points allow for an array of lights to be created that have no render properties.
They can be imported & exported into OpenFlight files, with the following restrictions
Light Points are implemented as a shape in Maya. They are created automatically when an OpenFlight database with Light Points is read into Maya. Additionally, Light Points can be created from within Maya using the OpenFlight menu commands or the MEL command, fltLightPoints.
Each LightPointShape can contain any number of Light Points. By selecting a LightPointShape and opening its Attribute Editor, all Light Points attributes are available. Many of these attributes have no visible effect within Maya but can still be edited, saved, and exported.
Light point functionality has been extended to display the effects of several more attributes of light point shapes:
Both Display > Normals and Display > Lobe have no Creator equivalent. They are used to control the visibility of the normal and lobe of light points as you develop your scene inside of Maya. Note that you cannot display lobes of omni-directional lights.
Currently the back color only displays as red regardless of the actual value set. This default color does respond to the back and ambient intensities to enable more sophisticated simulation.
-d (c) The distance between light points.
-c (c) The number of light points to be created.
-n (c) The node name to be created.
-p (c) The parent group transform node.
-nt (c) If specified, then no parent transform is created. In this case a parent must also be specified with the –p flag.
-clr (ce) The RGB color value to be applied to all created light points. Each value should be in the range from 0.0 - 1.0. In edit mode if no light points are selected then the light point shape name must be specified using -n.
-nml (ce) The Normal to be applied to all created light points. In edit mode if no light points are selected then the light point shape name must be specified using -n.
dt (ce) Type must be one of: "OMNIDIRECTIONAL", "UNIDIRECTIONAL", or "BIDIRECTIONAL". By default, light points are omnidirectional.
-dnml (ce) Enable or Disable the display of normals (true/false
// Create 3 light points spaced 0.5 UI units apart
fltLightPoints –c 3 –d 0.5/
/ this creates a light point string with 5 light points and visible normals
fltLightPoints -c 5 -dnml true;
// this makes the normals of the selected light points string invisible and
// changes the light type to be Unidirectional.
fltLightPoints -e -dnml false -dt UNIDIRECTIONAL;
// Create 3 Red Light Points equally spaced along the selected curve
fltLightsOnCurve 3 1.0 0.0 0.0;
Arg1 An integer that specifies the number of Light points to be created.
Arg2 A float that specifies the Red component of the assigned color for the Light Points (0.0 – 1.0)
Arg3 A float that specifies the Green component of the assigned color for the Light Points (0.0 – 1.0)
Arg4 A float that specifies the Blue component of the assigned color for the Light Points (0.0 – 1.0)
All transform nodes in Maya can represent DOF nodes. They each have limit information available and by default work within their own co-ordinate space.
Maya’s LOD nodes work slightly differently from the OpenFlight LOD nodes. To simulate the behavior of OpenFlight LOD nodes, all children of an OpenFlight LOD node are grouped together under a single group transform node that is controlled by the LOD node. A null transform node can also be inserted before and/or after the controlled LOD node to satisfy Maya’s switch in/switch out requirements.
Maya’s LODs are also tied to a particular camera. When importing an OpenFlight file, a camera named fltLOD is created. To activate the LOD behavior, you must use this camera. If new LOD nodes are created from within Maya, they should likewise be associated with the LOD camera.