Professional Documents
Culture Documents
As part of our new graphics engine for our game I've been researching about writing
max4 exporter plugins for a skeletal animation system and for the world format.
I'll be sharing a lot of my new found knowledge here. Why? Because I'm such a nice guy
:-)
Quick Links
Getting Started
Sample code
Skeletal animation
World format
External tutorials
Open Source Projects
Where to begin?
There are numerous approaches to developing a 3dsmax exporter. Listed below are some
of the open source projects aimed at making the task simpler. By all means, take a look at
those, but if you want to create a really good file format, then you will need a good
understanding of the max sdk, and that means spending a long time reading though the
max sdk help files.
So if you think you are ready to begin coding an exporter, there are two ways to start up
your VC++ project; you could read "Plug-In Project" in the max sdk for instructions on
how to set it a VC++ max plugin project, and code from scratch, or follow the "Using the
Appwizard" and "first coding steps" instructions to get started the easy way.
A word of caution, don't go blindly rushing to do your exporter before you've got a good
idea of what you want to be exporting. Suppose you are doing a skeletal animation
format.
On line 116, below the line that says "Return the 'i-th' file name extension (i.e.
"3DS")", type in the filename extension you want to use for your format (between the
quotes)
Go down filling in the relevant text whenever you see: return _T("");
Click Build in the menu, and build the .dle file
Copy the file to your 3dsmax plugins directory and load up 3dsmax
Load up a max file and click export. You filename extension should be listed, select
it.
You will see the following window:
The export fails because you need to write more code before it exports anything.
We'll come back to this soon, but right now you are probably wondering...
Sample Code
The source code to the 3DS exporter is located in
3dsmax4\maxsdk\Samples\ImpExp
The Direct3D exporters are downloadable here. It includes the source code for both
max3 and max4 exporters.
The book "Game Programming Gem 2" contains the source code to a 3ds max skin
exporter and animation toolkit (for max3 and character studio 2.2)
Cal3D, the free skeletal animation library, includes the exporter source code
One of the best sources of information on this is nvidia's paper Efficient Animation,
which argues that VS matrix palette skinning is the best way to do character animation in
directx8.
If you want to do your own VS skinning you should read the entire article, but one of the
important points is the limit on the number of bones in the mesh; limited memory on the
GeForce 3 means the maximum is 32 (for 4x3 matrices) or 24 (for 4x4 matrices).
You need to decide whether or not you want to support weighted vertices, i.e. vertices are
influenced by (the average of) more than one bone's movement. Supporting this may
result in smoother, more realistic animation, but the implementation is more complex.
World/Level file format
The .3ds format is a good place to start.
I'll be writing more on this soon.
Discreet Knowledgebase
A library of 3DS Max info is available here
Back to...
http://www.cyberloonies.com/3dsmax-sdk.html