Hopelessly lost with the model importing fiasco

I know this question has been asked alot, but i have been thoroughly confused and muddled by the myraid of topic posts…I'm having issues with MD5 and Collada. The sad thing is that the actual coding is not difficult. It's the jumping from plugin to plugin, program to program, and the varying documentation about both formats.



I use maya 7.0 and milkshape. I have no desire to touch blender, mainly because it is very fickle and rarely does what i want it to do. I have both the collada exporter beta5 by feeling inc. and a MD5 exporter. (http://scripts.zbufferstudios.com/)



The Md5 exporter does not work on a simple skinned cylinder of three bones, let alone anything larger. MD5 coverage in maya in general is very spotty. There isn't much out there to make using MD5 easier. The maya exporter is beyond questionable, and there has been little documentation as to what needs to be done to get an Md5 model from maya to JMe.



the collada exporter makes a collada file that does not load in the collada viewer, loads fine in blender and milkshape. But loads the skeleton only in jme, and the strangest fact is, according to the mesh and vertice counter, there is a mesh there.



the MD5 loader does not load a mesh at all.



I really hope i'm not being to vague. I've been trying to piece together forum threads and tutorials together for hours. Where can i find some up to date documentation/tutorials and some newer advice on what to use? I'm not importing anything complicated, just a basic untextured, uv mapped mesh, five bones at most, with no animation. Help?





UPDATE 1:



hey Here's some more substance. Sorry for the delay. I'm really happy because now i at least have a mesh loading. I have no idea how to toggle the visibility MD5 bones in debug mode, so i'm not sure if the bones exporter is working properly as well. If i get help, that'd be great.

If i manage to pull MD5 exporting off after some help, i'll post a detailed wiki article about what you need to do before exporting to md5, because with maya, there was other stuff i had to do (remove history, freeze mesh, ect).



Exactly what i did:

  1. I created a polysphere
  2. I selected the polysphere
  3. I used zbuffer's md5 exporter
  4. Loaded it up in jme Cheesy -> the mesh is finally working, but…i have a pretzel mesh now (originally straight… ;_;)… i think it may be a bone problem?



    Files:

    Link to maya binary file:

    http://www.badongo.com/file/8522838



    Link to MD5Mesh file(animation file not needed because there is no animation):

    http://www.badongo.com/file/8522867

First of all, I have to say that if you post, at least, the *.md5mesh file, even if it is simple, we can help you better.



Secondly, I cannot help you about the Maya exporter you are using and I cannot help you a lot about Maya (unfortunatelly I do not have a full copy of it). Moreover I think that most of the developers using MD5 with jME are using Blender for exporting and then they refer to der_ton's exporter.

Though there could be a fine solution for you. Visit Making DOOM 3 Mods : Model Exporting you will notice that in the Animated Models chapter they explain the following:


Animated models are quite a bit more complex. The only animation system supported in Doom 3 is skeletal (no vertex animation like in Quake), and the only file format supported is .mb (Maya binary). The files have to be processed using a built in tool to convert the Maya files to .md5mesh and .md5anim files.


The tool they are talking about is probably included with the Doom 3 SDK available here: Making DOOM 3 Mods : Downloads. For Mac OS X SDK you have to search the internet I have a copy but I do not remember the location from where I downloaded it. Its filename, though, is Doom3-1.3.1-SDK.dmg. You have to compile the SDK to have access to the command line tool used to convert the files. I found an exporter.h header in the source code, though, as they explain:

You must have Maya installed on the machine that you are exporting on otherwise it won't do anything.


The SDK also includes some importers for Maya.

For an example of the command line instructions to export a Maya Binary model you can take a look at the commandline directive available in any original *.md5mesh or *.md5anim file. This is, for example, the one taken from base/animation/mp_greenarmor.md5mesh file:

commandline "mesh models/characters/male_npc/cycles/tweakedplayermoves/makemesh.mb -dest models/md5/characters/npcs_as_player/mp_greenarmor.md5mesh -game Doom -prefix MP_ -keep Lknee Rknee Lhand Lhand1 Rhand Rhand1 Body2 Body SPINNER PISTOL_ATTACHER SHOTGUN_ATTACHER MGATTACHER pgATTACHER NADE_ATTACHER CHAINSAW_ATTACHER RL_ATTACHER FL_ATTACHER BFG_ATTACHER CHAINGUN_ATTACHER PDA_ATTACHER SOUL_ATTACHER loneckadjust headcontrol neckcontrol loneckcontrol eyecontrol jawcontrol jawadjust Jaw -parent Body2 Body -parent Hips Body2 -parent SPINNER Body2 -parent Waist SPINNER -parent PISTOL_ATTACHER Rhand1 -parent SHOTGUN_ATTACHER Rhand1 -parent MGATTACHER Rhand1 -parent pgATTACHER Rhand1 -parent NADE_ATTACHER Rhand1 -parent CHAINSAW_ATTACHER Rhand1 -parent RL_ATTACHER Lhand1 -parent FL_ATTACHER Rhand1 -parent BFG_ATTACHER Rhand1 -parent CHAINGUN_ATTACHER Rhand -parent headcontrol neckcontrol -parent neckcontrol loneckcontrol -parent loneckcontrol Shoulders -parent PDA_ATTACHER Rhand -parent SOUL_ATTACHER Rhand -keepmesh npcplayermesh -keepmesh npcplayerarmmesh -keepmesh head_skullmesh -keepmesh skeletonmesh -keepmesh head_bfx1mesh -keepmesh head_bfx2mesh -keepmesh head_bfx3mesh -keepmesh head_bfx4mesh -keepmesh head_bfxflamemesh -keepmesh head_bfxmodelmesh -keepmesh head_stumpmesh -keepmesh berserkbodyfxmesh"



Options descriptions is available at the previously linked Making DOOM 3 Mods : Model Exporting page.

my artists use maya and 3d max for modeling and animating the characters. blender is free but its definitely not professioanl enough yet.



if u r using maya, the important thing is that u need to make sure ur maya file has nothing but a single mesh and the bones in it by the time u want to export the model. all the controllers, manipulators have to be removed before exporting. and there can exist only one mesh in ur model file when export. also make sure u save the maya file before running the script. besides all these, then theres the md5 requirement, u can only have one root bone per model.



all these things make it very difficult to export a character that has changable armor pieces which is y i just added the dependent child feature last night. check out the post or google code page for details.

neakor said:
if u r using maya, the important thing is that u need to make sure ur maya file has nothing but a single mesh and the bones in it by the time u want to export the model.


Are you sure?

From the previous command line example:

-keepmesh npcplayermesh -keepmesh npcplayerarmmesh -keepmesh head_skullmesh -keepmesh skeletonmesh -keepmesh head_bfx1mesh -keepmesh head_bfx2mesh //...



From the linked page from ID Software that explains the export tool options:

-keepmesh [name of mesh] Allows you to keep only a certain model during export (can only be used by itself)


The example line makes me think that I can have as many meshes as I like in my Maya file and I can decide wich of them to export. Also exploring the base/animation/mp_greenarmor.md5mesh file confirmed that supposition. Also MD5 format clearly suports multiple mesh sections in the same *.md5mesh file as you can see in the marine.md5mesh file.

And, reading documentation, I guess that bones that do not affect any mesh (like usally IK effectors are) are not exported automatically. In fact there is an option to override this behaviour:

-keep [joint name] Add joints that are kept whether they're used by a mesh or not

blender is free but its definitely not professioanl enough yet.


Saying this is kinda like saying, my Games all use Havok; there exists a product called jME but it's just not good enough yet. ;)  People will read that and immediately think jME is worthless....

Also, that's a very strong opinion, one that many professional graphic artists would argue.  You might want to check out the current features before suggesting that people disregard a open source product in favor of a VERY expensive one.  I have used to use Maya and 3dsMax; after getting comfortable with Blender, I have found it to be a extremely powerful modeling program. With benefits that actually outweigh the commercial guys.

http://www.blender.org/features-gallery/features/

The biggest hurdle for most people is the interface, which is kind of ironic; since people that work through and learn the UI generally rave about it.  While people that can't be bothered to learn how the program is operated commonly walk away from saying "Blender sux".  It took me close to a month of using blender before I felt comfortable with it, and that was after using 3DS for 3 months and Maya for 5 months, after only one month with Blender I was much more productive than with either of the other programs.


Sorry, I just wanted to get my 2 cents in about it; I am really not trying to start a flame war.
basixs said:

blender is free but its definitely not professioanl enough yet.



[...]
Blender I was much more productive than with either of the other programs.


I quote almost everything you say, basixs, though I have to add my experience in this argument.
To understand exactly what I mean I have to let you know the specs of my computer: Mac Pro 2 * QuadCore 3GHz, 4GB RAM, 2 * 500GB HD, ATI Radeon X1900 XT PCIe 16x with 512 MB VRAM.
Once I created a complex mesh with about 1000000 polygons I had problems interacting with the 3D view (orbit, zoom, pan), interface became slowly responsive.
I can assure that in the past I tested Maya, Cinema 4D and other commercial software, with more complex scenes, running on quite less performant computers, but they never had any performances problem.
So, I have to say, that apart is apparent quality, Blender is not so optimized as we could expect. And in some particular cases its limit can become a problem (for example in a Quake 4 mod pipeline you cannot use it, considering that to produce Normal Maps you have to create a really high poly version of the models > 1000000 poligons, in some cases).
Though I continue to affirm that it is a really good application. Performance can always been optimized (if anyone would like to take this task) and Blender, even if still not perfectly mature, has the advantage to have a good team and a great leader (Ton Rosendal, of course). He is able to keep the project on the right "rails", instead of loose the path, as happen to many open source projects. This aspects for me represent something I can trust for the good future of the project. So I am confident it will grow well.

hmmm, good point.  I wonder what kinda of hardware the artist use for elephants dream and such then.  There is so much detail in that that my computer (MacBook pro :)) has a hard time replaying the damn HD video alone.

basixs said:

blender is free but its definitely not professioanl enough yet.


Saying this is kinda like saying, my Games all use Havok; there exists a product called jME but it's just not good enough yet. ;)  People will read that and immediately think jME is worthless....


trust me. that has nothing to do with what i said. i know forum is a place where flaming can be started so easily. but plz dont do so. and i apologize for saying something that might lead u to this conclusion.

and yet, im not a artist, so what i said there was really from my artists. and they've been working on modeling for their whole lives, so i guess they just got stuck with what they started with.
Ender said:

neakor said:
if u r using maya, the important thing is that u need to make sure ur maya file has nothing but a single mesh and the bones in it by the time u want to export the model.


Are you sure?


yeah, thats how my artists exported and told me. maybe theres a better way of doing it ha  :D. if u figure that out, ill let my aritsts know.

hey :slight_smile: Here's some more substance. Sorry for the delay :slight_smile: I'm really happy because now i at least have a mesh loading. I have no idea how to toggle the visibility MD5 bones in debug mode, so i'm not sure if the bones exporter is working properly as well. If i get help, that'd be great.

If i manage to pull MD5 exporting off after some help, i'll post a detailed wiki article about what you need to do before exporting to md5, because with maya, there was other stuff i had to do (remove history, freeze mesh, ect).



Exactly what i did:

  1. I created a polysphere
  2. I selected the polysphere
  3. I used zbuffer's md5 exporter
  4. Loaded it up in jme :smiley: -> the mesh is finally working, but…i have a pretzel mesh now (originally straight… ;_;)… i think it may be a bone problem?



    Files:

    Link to maya binary file:

    http://www.badongo.com/file/8522838



    Link to MD5Mesh file(animation file not needed because there is no animation):

    http://www.badongo.com/file/8522867





    :DD Hopefully this provides a little more detail about the problem. Btw the links really are helping alot. By referring to what everyone said and the provided links i actually got the md5exporter to work!




neakor said:

Ender said:

Are you sure?


yeah, thats how my artists exported and told me. maybe theres a better way of doing it ha  :D. if u figure that out, ill let my aritsts know.


I have already written everything in previous posts. I do not know what kind of exporter you use. Though I refered to the official page of ID Software. All links are there. Read their pages they are really interesting...

faraway said:
[...]
:DD Hopefully this provides a little more detail about the problem. Btw the links really are helping alot. By referring to what everyone said and the provided links i actually got the md5exporter to work!


Happy to ear that.

About bone debug with MD5 Reader I have to say it is broken. We always had bigger problems then the bone debug, like model twitching and texture flickering.
Moreover after some new discovering, reading documentation, and making some tests in the latest few days I can say that the whole MD5 Reader (=old code, the one that most of developers are using currently) is broken. Even if it basically works (and it is usable) it is really error prone because of some foundamental mistakes made in the code (no programmers error just simple MD5 format misunderstood) before I started maintaining the MD5 Reader 2 project.

You can still use it, of course, and many users have been able to work around the previously mentioned problems with little adjustments in the code.

Though, to test your model I suggest you to use another software. For example the MD5 Viewer (there are 2 version one in C and one in C++) available at this address: David Henry's homepage. Compiling them is really easy.

As an exporter, instead, I still suggest to download Doom 3 SDK (it is free). So that you can test using original tools. Only with them you can be sure that you are preparing your models correctly.

I will give a look at the MD5 file you posted. Stay tuned. ;)

thank you for all your help so far ender & neakor :slight_smile: If you have the time, i was wondering if you can help me out with some of these questions/clarify some of my assumptions:



-for a MD5Skeleton, bones are parented by id, and are not spatials, so a md5bone cannot parent another mesh and set of bones without connecting to the root bone of the mesh.



-how exactly do the animation classes work? They look like they're optimized for generating an animation from a file. I was wondering how plausible it would be to have the bone animations coded in jme instead of read off a file. (my main concern is that if i shift the bones to distort the proportion of the mesh, the loaded animation would put the bones back to thier original position.)



I'm not sure if this bit of info helps with the nature of my questions, but i am importing very basic limbs, appendages, legs, ect into jme using the md5importer so that one can add appendages as they please. (so the base torso MD5 model will have appendage MD5 models coming off of its joints). Then it will use the movement trends for each appendage and coordinate them in a certain order to animate the body.

faraway said:

-how exactly do the animation classes work? They look like they're optimized for generating an animation from a file. I was wondering how plausible it would be to have the bone animations coded in jme instead of read off a file. (my main concern is that if i shift the bones to distort the proportion of the mesh, the loaded animation would put the bones back to thier original position.)


if u r using md5importer, it is definitely possible to code the animation or mesh. all the setter methods under Joint, Mesh, Triangle, Vertex and Weight are all u need to code ur own thing. but i do not recommand doing so. what u could do is simply change whatever u need to change in jme, then export ur model into jme binary. in the source code package, i have some examples for that. then the next time u load it back from the jme binary, all the changes u made will still be there even though ur original model files r untouched. this is sort like store dynamic world data into database (project darkstar).
faraway said:

-for a MD5Skeleton, bones are parented by id, and are not spatials, so a md5bone cannot parent another mesh and set of bones without connecting to the root bone of the mesh.


There is no MD5Skeleton class in any of the importers, for what I know, then I assume you refer to the general concept of the skeleton as it is stored in the MD5 file format. Then, what you are saying seems to be correct. Though there could be some workaround. If you need to connect some other jME nodes hierarchy to a particular bone, you can set the new nodes hierarchy position and rotation to the bone coordinates (relative to its SkeletalModelInstance parent). This have to be done, of course, for every frame, in one of the update methods provided by jME API like simpleUpdate() or simpleRender().

faraway said:

-how exactly do the animation classes work? They look like they're optimized for generating an animation from a file. I was wondering how plausible it would be to have the bone animations coded in jme instead of read off a file. (my main concern is that if i shift the bones to distort the proportion of the mesh, the loaded animation would put the bones back to thier original position.)


Yes you can use the classes in the model package of MD5 Reader 2 with every data you like. So you can programmatically pass vertex, triangles, UV, weights, meshes, ecc...
You can also get this informations from another format. Of course, to do that you have to write your custom parser, or trying overriding the current one (in the md5reader package). Though, in my opinion, the more feasible solution is to write your custom parser.
You will surelly encounter the problem of converting your data to properly adapt to MD5 format. In MD5 format, vertex data are stored in a "per joint" way (from the point of view of skinning) there are formats that are stored in a "per vertex" way.