This page describes how Maya geometric models are converted to OSG and vice versa.
Some test models serve to verify the working of the exporter and the importer. The test data sets are explained in more detail in the page [Test_models].
Maya stores polygonal objects in a DAG node called polyShape, polySurfaceShape or just mesh. Its internal structure and operation is explained in this page of the Maya Help.
Maya2OSG convert this Mesh into an
osg::Geode
(OSG node) that contains an
osg::Geometry
(OSG drawable).
Maya mesh vertex array is directly translated to the
osg::Geometry
vertex array. Maya per face vertex normals are stored in the
osg::Geometry
normal array. Normal binding is set as
BIND_PER_VERTEX
. This allows any combination of hard and soft edges. If any mesh polygon has color assigned, color per face-vertex is exported to the
osg::Geometry
color array. Color binding is set to
BIND_PER_VERTEX
.
Maya UV sets fill the texture coordinates for OpenGL texturing units.
Current version exports Maya geometry as is. However, some optimizations could help to improve real-time rendering performance and reduce storage needs.
Geometry accepted by osg2maya is contained in the
osg::Geometry
drawable. Primitive sets can be of any type:
DrawArraysPrimitiveType
,
DrawArrayLengthsPrimitiveType
,
DrawElementsUBytePrimitiveType
,
DrawElementsUShortPrimitiveType
or
DrawElementsUIntPrimitiveType
. Primitive types
POINTS
,
LINES
,
LINE_STRIP
and
LINE_LOOP
are not supported. They will be simply ignored by the importer. All the other surface (not line or point) primitives are supported:
TRIANGLES
,
TRIANGLE_STRIP
,
TRIANGLE_FAN
,
QUADS
,
QUAD_STRIP
or
POLYGON
. osg2maya currently imports normals bound with
BIND_OVERALL
or
BIND_PER_VERTEX
.
BIND_PER_PRIMITIVE
and
BIND_PER_PRIMITIVE_SET
will be implemented in the future.
Multiple texture coordinate sets are imported to Maya UV sets.