Home » Community » Forums » » How to Write a Simple Maya Model Exporter
  Intel sponsors gamedev.net search:   
[Control Panel] [Register] [Bookmarks] [Who's Online] [Active Topics] [Stats] [FAQ] [Search]

Add Forum to Favorites |  Send Topic To a Friend | View Forum FAQ | Track this topic


 Last Thread Next Thread 
 How to Write a Simple Maya Model Exporter
Post Reply 
This is a great article. But I just started programming, and was wondering what programming language this is. Some things resemble C++. Or is this a MAYA programming language (MEL). If somebody could tell me I would appreciate it.

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

Im pretty sure its C++ using Maya functions (hence the Maya API)

Maya supports both a C++ like Mel scripting and C++ as far as I have heard

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

It's using C++. All of the types proceded with M are just C++ classes definied by the Maya API. Mel scripts look quite a bit different.

 User Rating: 2088   |  Rate This User  Send Private MessageView ProfileView Journal Report this Post to a Moderator | Link

As far as I know, maya included a standalone program with source code to be able to process animation data.

I can't quite remember the format it was in, I think it was .Mov, but you can export animation data straight from maya into a seperate file, and then use this program to evaluate the data over time, exactly like maya does it.

I got that code, modified it, and put it in my engine to be able to read and evaluate maya animation curves exactly the way it happens in maya, with all the features, like loops, ping-pong, relative, etc, etc..

With an exporter, you can grab all the keyframes and save their data directly. Then, within you engine, you load the keyframes, and construct the animation curve, and you're ready to evaluate the curve at whatever time you wish. The only drawback is that's optimized for forward playback only, going back is slower, hardly noticable, but still.

Oh, and the maya code is a bloody nightmare!! :D

I got the code somewhere, if anyone wants it.



// talsit de cod

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

There appears to be an undeclared variable 'comp' in extractPolygons()

MItMeshPolygon piter( dagPath, comp );

The components list should be retrieved with a call to "MFnMesh:: getConnectedSetsAndMembers" first, comp is an element in the MObjectArray

BTW, great article, it's about time someone wrote a tutorial on exporting game art from Maya!

 User Rating: 1012   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

I am trying to compile this example but I get an error on
getFileNameToLoad() function. Where is this function located ? Do I have to write it myself ?

Thank you

Nitzan

 User Rating: 1005   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

Does anyone have any info on what this error means?

***** Error: line 1: Could not make connection; could not find source plug 'ikRPsolver.msg'

I did have something working but then when I started fresh and tried to write an exporter I started to get this error message. I don't get it in my old project (using the same .mb) just my new one even though the new one has the exact same code copied over.

I just tried to create a project using the "Simple Example" from the article and I get the same error.

It happens somewhere in this code:

MStatus stat = MLibrary::initialize ( "myExporter" );
if ( !stat )
return false;

// figure out the file name to open
char* fileName = "C:/dude walk.mb";

// prepare Maya to read a new scene file
MFileIO::newFile( true );

// read the scene file
stat = MFileIO::open( fileName );
if ( !stat )
return false;

// remove any temporary data created by Maya while loading
// things like the undo list which we won't be using
stat = MGlobal::executeCommand( "delete -ch" );
if ( !stat )
return false;

Any help would be GREATLY appreciated.

Great article by the way, I probably wouldn't have attempted to look at the Maya API otherwise. Thanks again.


Edited: OK, I've compiled the app "asciiToBinary" that comes with maya and passed it the same file, I get the same errors. I would say file corruption but it opens fine in maya in the first place and I also have another app i wrote that can open it fine. Who knows?

[edited by - tris on May 25, 2004 6:30:59 AM]

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

All times are ET (US)

Post Reply
 Last Thread Next Thread 
Forum Rules:
You may not post new threads
You may post replies
You may not edit your posts
You may not use HTML in your posts
Jump To:
Administrative Options: