Panda3D Manual: Converting from Maya
<<prev | top | next>> |
Maya's exporter can be run from the command prompt or via a graphical panel. The command line utility is called maya2egg. There are multiple versions of it corresponding to different versions of maya. For instance, the version to use for Maya 5.0 is maya2egg5, for 6.0 its maya2egg6 and for 6.5 its maya2egg65. The following is an example of how to convert a file(maya binary .mb) if using Maya 6.0 through the command line.
maya2egg6 -o eggFileName.egg mayaFileName.mb
The egg file will contain the filenames of the textures. These texture pathnames will be stored as relative paths, relative to the location of the egg file. For example, let's say that the files are laid out like this:
c:\My Models\Maya Files\Character.mb c:\My Models\Egg Files\Character.egg c:\My Models\Textures\Character.png
In that case, the command to export the model is:
c:\ cd c:\My Models\ maya2egg -o "Egg Files/Character.egg" "Maya Files/Character.mb"
Note that Panda Filename Syntax uses forward slashes, even under Windows, and this applies to the exporter as well. After doing this export, the character egg will contain the following texture reference:
"../Textures/Character.png"
Again, notice that this pathname is relative to the egg file itself. Many artists find it convenient to keep everything in the same directory, to avoid having to think about this. This approach works fine. The above conversion process will turn the character into a static model. Models which are rigged (they have bones to help them animate), skinned (polygons attached to the bones/skeleton), and are animated need to use one of the following options:
maya2egg -a model -o eggFileName.egg mayaFileName.mb maya2egg -a chan -o eggFileName.egg mayaFileName.mb maya2egg -a pose -o eggFileName.egg mayaFileName.mb maya2egg -a both -o eggFileName.egg mayaFileName.mb
The meanings of these options are:
-a model | Save only the skinned and boned model, ready for animation but with no animation attached. This is ideal for models with several event- or interaction-based animations.
-a chan | Save only the animation data on the current model, but not the model itself. This is ideal applying animations to an already-existing model egg file that is ready to receive animation. A model may have several animation channels applied to it.
-a pose | Save the model in the current key position of the animation applied to it. This position must be selected before choosing to export the file. This format does not save the animation.
-a both | This will export the model and animation out as one file.
-uo ft | This converts the units of the model to feet, which is used by Panda3D.
-bface | Exports the model as double sided. Of course, this may very well cut the rendering speed in half.
–help | to see all the parameters that may be taken by the converter.
There are many options to maya2egg. For a complete list, run maya2egg with the -h argument.
maya2egg -h
## Using the Graphical Front-End As of Panda3D 1.0.4, there is a graphical front-end to maya2egg. To run the graphical Maya exporter, drag MayaPandaTool.mel from the panda plugins directory into the Maya workspace. The UI window(below) will appear. You can alternatively load the .mel file from the script editor. To save space, the graphical tool does not have access to all of the features of the exporter. It is designed for rapid verification of assests. The features you can execute with the graphical tool are identical to the respective ones of the command line exporter listed below.
<<prev | top | next>> |