Wspólnotowy Serwis Informacyjny Badan i Rozwoju - CORDIS

Maya to MPEG-4 body animation exporter

The Maya-MPEG4 Exporter (Exporter) is a command plug-in. Maya has a special class to handle plugins. The following functions were used to develop it:

- InitialisePlugin:
The initializePlugin() function can be defined as either a C or C++ function. This function is the responsible to make the plugin loadable. Initialise Plugin contains the code to register any commands, tools, devices, and so on, defined by the plug-in with Maya. It is called only once-immediately after the plug-in is loaded. Once constructed, the MFnPlugin function set is used to register the contents of the plug-in file. Once done, the function returns a status code indicating whether or not it succeeded. After an unsuccessful initialisation, the plug-in is unloaded automatically.

- UninitializePlugin:
The uninitialize Plugin function also can be a C or C++ function. If you neglect to declare this function, your plug-in will not be loaded. The unitializePlugin function contains the code necessary to de-register from Maya whatever was registered through initializePlugin(). It is called once only-when the plug-in is unloaded. This function should be used for a few quick clean-up operations, such as closing files. It is not necessary for you to delete those commands, or nodes created by your plug-in when it exits since Maya takes care of them. You should therefore not be keeping a list of the Maya objects allocated by your plug-in nor freeing them when uninitializePlugin is called.

Using the Maya API MPxTranslator Class:
The Maya API has implemented a base class that can be used to implement the Maya “File Translator Plug-Ins”. A file translator plug-in allows Maya to read or write 3rd party file formats.

The Exporter uses the following routines and methods:
Reader: This routine is called when you need to load a file of a type supported by this translator.

Writer: This routine is called when it is necessary to save a file of a type supported by this translator. DefaultExtension: This routine is called by Maya whenever it needs to know the default extension of a translator. Identify File: This routine is called by Maya when a file selection dialog accesses a new directory.

Maya-MPEG4 Exporter Operation:
The operation of the exporter can be divided in three main modules:

- BDP File Generation: In this module, the exporter gathers all the necessary information to write the BDP File. The virtual human designed in Maya should be formed by one mesh and one skeleton, also it could have one or more materials and textures. The BDP file will be the VRML description of this virtual human.

The virtual human has to be described as a hierarchy of joints that can either have or no an associated segment; moreover, this segments are described as a polygonal set with information about textures and materials. So, to form the file is necessary to gain access to the DAG to know details about the joints, mesh polygons, materials and textures. Moreover, this module is responsible to divide the virtual human in appropriate segments. It uses the clusters information to create the segments.

The main methods of this module are:
JointInfo: This method is used to iterate over the DAG to find the joints.

PolygonsInfo: This method gathers information about the polygons that are part of the mesh.

JointClusters: This method finds the vertex sets that are related with each joint.
Segmentation: This method uses and links the information gathered for all the previous methods to form the segments that will be written in the BDP file.

WriteInfoSegment: This method will look for the segment related with the present joint. It will obtain the vertices list, UV list, material list, polygon List and then write the segment information.

- BAP File Generation
In this module, the exporter gathers all the necessary information to write the BAP File. The animation created in Maya is possible upon changing the rotation values of the selected joints. So, in this module each frame will be examinated in order to look for the changes in the joint’s rotation. With this information, it is possible to calculate the BAP’s and then write them in the BAP File.

The main procedures of this module are:
SearchJointChanged: This method will review the joints in the present frame in order to locate and store the angles of the joints rotated.
StoreBapInfo: This method is used to write the animation information of every frame in the BAP file. WriteBapFrame: This procedure is used to write the animation information of every frame in the BAP file.

- BDT File Generation
In this method, the exporter will use the stored information about the segments to get the vertex list of the border of two adjacent segments. This information is organized and written in a file that could be processed to form the Body Deformation Tables.

More information on the WORLDS STUDIO project can be found at:

Reported by

75003 PARIS
See on map
Śledź nas na: RSS Facebook Twitter YouTube Zarządzany przez Urząd Publikacji UE W górę