Osg2Maya
A Maya
plug-in for importing OpenSceneGraph
format files (*.osg | *.ive)
Sung-Hee
Lee
Osg2Maya is a Maya plug-in
that imports OpenSceneGraph files ( *.osg or *.ive )
to Maya.
This lets you produce nicely
rendered images of the OSG scenes using Maya.
Osg2Maya has the
following features:
l
Most PrimitiveSet
are imported: TRIANGLES, TRIANGLE_STRIP, TRIANGLE_FAN, QUADS, and QUADS_STRIP
types are imported.
l
Some Shapes
in ShapeDrawable classes are imported: Sphere, Box, and Cylinder.
l
User can select the
default shader from Lambert, Blinn, and Phong shaders in Options.
l
Scene graph is largely
preserved on importable nodes (see
limitations below).
However, Osg2Maya
currently has some limitations:
l
osg::Group
: among osg::Group and its derived classes, only osg::MatrixTransform is
preserved and translated to “transform node” in Maya. For example, if an OSG
scene graph has 3 nodes, A (MatrixTransform), B (Group), and C(Geode).
C is B’s child, and B is A’s child. Then Osg2Maya translates A and C to A’ and
C’ respectively since A and C are the only importable nodes, and then set C’ as
the child of A’.
l
osg::Geode : among
osg::Drawables, only osg::Geometry and osg::ShapeDrawable are imported.
n
osg::Geometry
-
POINTS, LINES,
LINE_STRIP, and LINE_LOOPS are ignored.
-
Normals are
automatically computed by Maya unless they are provided with PER_VERTEX binding
in osg.
-
Colors are ignored.
Material properties should be defined through osg::StateSet.
n
osg::ShapeDrawable
-
Only Sphere, Box, and
Cylinder primitives are imported.
-
TesselationHints are
ignored.
-
Texture coodinates are
ignored.
-
Shape::color information
is ignored. Material properties should be defined through osg::StateSet.
l
osg::Material :
specular color and shininess are ignored (with Lambert shader) or imported with
naive rules(with BLINN or PHONG shader).
Osg2Maya vs. osgMaya:
l
Osg2Maya is only
importing OSG files to Maya whereas osgMaya has both import/export
functionalities.
l
However, Osg2Maya
surpasses osgMaya in importing capability. Actually I pruned exporting
functions and improved importing functions of osgMaya to create Osg2Maya.
This
plug-in has been test on Maya Unlimited 6.0 with Windows XP.
Installation:
1.
Unzip osg2maya_1p0_bin.zip to any folder you want. (Let us
assume we have unzipped files to C:\osg2maya\plug-in)
2.
In the destination folder, you should have two files:
osgImport.mll and osgImportOptions.mel
3.
Register new Environment Variables to Windows (for more
information on setting Environment Variables: http://support.microsoft.com/default.aspx?scid=kb;en-us;310519).
-
MAYA_PLUG_IN_PATH = C:\osg2maya\plug-in;
-
MAYA_SCRIPT_PATH = C:\osg2maya\plug-in;
4.
Run Maya
5.
In Maya, click on Window->Settings/Preferences->Plug-in
Manager, and then click on Browse.
6.
Load osgImport.mll from your destination folder.
7.
In Plug-in Manager window, check “osgImport.mll” box
Now, you should be able to import osg or ive format files to Maya.
Source
code:
l
The source code is distributed under GNU GPL.
l
This code is based on Pavel Moloshtan’s osgMaya (http://www.diosoft.com/soft/osgmaya/) source code.
l
In order to compile,
you need to have OpenSceneGraph and Maya libraries installed on your computer.
l
You are encouraged to
improve the code!
Downloads:
Source
code – MS Visual C++ .NET 2003
Screenshots
(OpenSceneGraph à Maya):
-
cessnafire.osg : geometries and normals are
imported.

-
skydome.osg : notice that texture map is imported.

-
cow.osg : environment map is not imported.

-
box_grn.osg : notice that Box shape is imported, but color information
is lost.

Last Update: 2006-03-27