Workflow Considerations
 
 
 

The following are workflow issues you should consider when working with OpenFlight files in Maya.

When importing files

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.

When exporting files

Here are some of the limitations to consider when exporting an OpenFlight file from Maya:

Shading Models

Flat Shading

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.

Illumination

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.

When using Switch Nodes

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.

Switch node attributes

Name Long (Short) Type Default Flags

outputVis (out)

Tint32

0

R

curMask (in)

Tint32

0

RWSK

maskWidth (mkw)

Tint32

0

RWS

numMasks (nmk)

Tint32

0

RWS

masks (mks)

Tint32

0

ARWS

fltSwitch Command

Synopsis

FltSwitch [flags]

Return Value

[string[]] (object name or node name on create)

Description

This command is used to create, edit or query Switch Nodes from within Maya.

Flags

-p (c) The parent group transform node.

-cm (eq) Set or query the current switch node mask.

-n (ceq) The name of the node to be operated on.

-am (e) Append a mask based on the current object selection.

-em (e) Edit the currently active mask based on the current object selection.

-dm (e) Delete the current mask.

Example

// 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;

When using Light Points

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

Import

Export

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 attributes

Name Long (Short) Type Default Flags

LightPointsMin (lpmn)

double3

0

RWS

LightPointsMax (lpmx)

double3

0

RWS

SurfaceMaterialCode (smc)

Tint16

0

RWS

FeatureId (fid)

Tint16

0

RWS

BackColor (bc)

Tint32

0

RWS

DisplayMode (dm)

Enum

0

RWS

Intensity (ity)

Float

0

RWS

BackIntensity (bit)

Float

0

RWS

MinimumDefocus (mndf)

Float

0

RWS

MaximumDefocus (mxdf)

Float

0

RWS

FadingMode (fm)

Tint32

0

RWS

FogPunchMode (fpm)

Tint32

0

RWS

DirectionalMode (drm)

Tint32

0

RWS

RangeMode (rm)

Tint32

0

RWS

MinimumPixelSize (mnps)

Float

0

RWS

MaximumPixelSize (mxps) Float 0 RWS
ActualSize (aps) Float 0 RWS
TransparentFalloffPixelSize (tfps) Float 0 RWS
TransparentFalloffExponent (tfe) Float 0 RWS
TransparentFalloffScalar (tfs) Float 0 RWS
TransparentFalloffClamp (tfc) Float 0 RWS
FogScalar (fs) Float 0 RWS
SizeDifferenceThreshold (sdt) Float 0 RWS
DirectionalType (drt) Enum 0 RWS
HorizontalLobeAngle (hla) Float 0 RWS
VerticalLobeAngle (vla) Float 0 RWS
DirectionalFallofExponent (dfe) Float 0 RWS
DirectionalAmbientIntensity (dai) Float 0 RWS
AnimationPeriod (ap) Float 0 RWS
AnimationPhaseDelay (apd) Float 0 RWS
AnimationEnabledPeriod (aep) Float 0 RWS
Significance (sig) Float 0 RWS
Calligraphic (call) Tint32 0 RWS
Flags (flgs) Tint32 0 RWS
XanimRotateAxis (xra) Float 0 RWS
YanimRotateAxis (yra) Float 0 RWS
ZanimRotateAxis (zra) Float 0 RWS
LightColors (lc) Double3 0 ARWS
LightNormals (ln) Double3 0 ARWS
InputLightPoints (ilp) 0x58000014 0 RW
OutputLightPoints (olp) 0x58000014 0 RS
WorldLightPoints (wlp) 0x58000014 0 ARS
CachedLightPoints (clp) 0x58000014 0 RWS
DisplayNormals (dn) Boolean false RWSK
DisplayLobe (dl) Boolean false RWSK

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.

fltLightPoints Command

Synopsis

fltLightPoints [flags]

Return Value

[string[]] (object name or node name)

Description

This command is used to create Light Points from within Maya.

Flags

-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

Example

// 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;

fltLightsOnCurve Script

Synopsis

fltLightsOnCurve [arguments]

Return Value

None

Description

This script uses an existing curve and creates a given number of Light Points using the currently selected curve as a placement guide. The Light Points are evenly spaced along the curve.

Note—The curve is used for construction purposes only and is modified by this script.

To use this script

  1. Create a curve to use as a placement guide for the Light Points.
  2. Select the curve and then execute the script.

Example

// Create 3 Red Light Points equally spaced along the selected curve
fltLightsOnCurve 3 1.0 0.0 0.0;
Arguments

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)

Degree Of Freedom (DOF) Nodes

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.

To create a DOF from a Maya transform node

Level Of Detail (LOD) Nodes

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.

NoteDeleting these nodes cause the LOD to behave incorrectly.

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.