MD5 Loader

I had some free time to kill and in order to compare md5 with cal3d capabilities i modified chaosdeathfish’s md5 loader to work with the currect cvs version of jme.

I tested the loader with some quake4 md5 models and at its current version it cannot load them.

So if anyone is interested in the code you can grab it at http://myjavaserver.com/~kman/md5/jme-md5.zip

Expect the alpha version of cal3d loader next week. Sorry for the delay bu i’m in the process of setting up my personal site.

After playing a little with 3dsmax importers and exporters i found that md5 models imported in 3dsmax can easilly be exported to cal3d format, i did not tested the vice versa way since there is no cal3d importer  for 3dsmax but i believe there shall be no problem. So artists can work without worrying about the export format for skeletal animation at the moment.

that strange I've been loading my md5 effects meshes with no worries in in pre .9 jme does it still load the example model.

Yes the example model is loaded.

thanks

it was my understanding that generally quake4 seem a bit different from the doom3 variety I'm on oom3world.org often aswell and for the longest time they've unsuccessfully to load custom models into quake4 I think one guy was successful though



how easy will your system be compared to this one I'm a novice coder but work well with the md5 stuff.

really interesting thread



Md5 from doom3…was v. 10 format specs, wasn't it. they were at some point at doom3 world forums. there's a fantastic viewer for it at the sme place , too. Indeed, a pair of flavours of viewers, and many tools. I would expect quake4 version is an adapated to new quake4 game engine needs…Yet though, the standard which tools do follow, is oficial one, the md5 version 10 …of doom3 game. If you make it compliant with it, feel sure that it must be all ok :slight_smile:



md5 is great for artists also as is ascii and allows a lot of checking and stuff…

please, keep this effort alive…

here's a page of specs…



MD5Mesh and MD5Anim files formats specifications (Doom 3's models)





but maybe outdated





another one is at doom3world.org forums

http://www.doom3world.org/phpbb2/viewtopic.php?t=2884





and surely at id software sdk from http://www.iddevnet.com/doom3/






hello…





If I understood well, this loader works now with animation and all in jme, but just you couldn't get the quake4 model to work?



I don't know a word about programming, only artwork, and my friend is just getting into jME world…



So i made a test of md5 export from Blender, using the Der_ton fantastic md5 exporter (reallly good)



Please, if you could grab it here and telll me if you are so kind if works with your loader and jme  0.9…

savefile.com - This website is for sale! - File Sharing Resources and Information.



many thanks in advance…



The export, if worked in jme, would be really a revolution for artists using Blender, I''l say why :



-This animation sample I made is using all sort of constraints, complex rig, through the model is very simple and fast done, no good weights. Der ton made the fantastic thing of supporting the pose module so to avoid the artist to bake the animation.Allowing also, this way, to export really light in memory animations… besides, is absolutely wysiwyg. Same texturing, same animation speed, same curves of interpolation…absolutely what I did in Blender!!  So, whenever md5 gets to work fully in jME, with Blender at least, there's absolutely ensured the success. Also, if the man makes plugin of this quality, I'd expect his md5 exporter for max , which I havent tested yet,  to kick as as well. He made it too. he also made a n md5 max importer, and md5 blender importer. :o There's also an md5 exporter for Gmax which I have not tested yet, but that one is made by berzeker, who also made another md5 exporter(main difference to me is that it allows multiple meshes in same md5).


  • I tested also his md5 viewer, which is simply fantastic too. I used it to test the md5 exported by blender, as I don't know of programming to use jME. Well, it loaded perfectly as I said above. So, having the artist such a great viewer, there's ensured productivity at maximum.



    -Memory. Finally!!!  This is my point on about bones and weights. the great Hevee's vertex animation export, is good but I need less memory. I think loosing accuracy in the animation, I got to reduce it to like 400 ks, I don't remember, but in that point, it did not resemble teh animation a lot… (when games are for other sort of distribution, though, vertex animation is as good, and better as does not ask for 3d cards being of less than 3 or 4 years old(as to speak, I don't know exactly, but a gf2mx cold be the limit…). Can be older.) …well…now I look at this fantastic thing of the md5 format…yay…mesh is separated of animation…which is quite convinient… mesh  is same I used for hevee's and md3 tests (both logically not very light as is vertex animation, and it wouldbe impossible to weight less) , so is one of almost 2,000 triangles.

    ok, md5mesh is 158ks, ascii uncompressed, which is quite good already…but that's loaded only once…as the md5anim mesh…is, without compression, the sensational weight of 29ks. Just what I was pursuiting. even bettter, compresing with 7zip, but not to havily cause dont wanna think of extra times or problems in decompressing for the player…lol, it comes down to…5 ks…as it'd be compressed as all in an install…An animation that…well, havent thought, but maybe like a walkcycle, or a it more even, is weighting 5 ks of download!!! Fantastic. I can add as much animations as I want to the game, so to make the character real fun to watch :slight_smile:






snaga the md5 loader failed to load your model. I don’t have much time to debug it to find what the fault is,

but i imported your mesh in 3dsmax and exported it to cal3d and the mesh and animation shows fine,

i don’t know if the texture coordinates are presented correct so here is a screenshot of the mesh loaded with cal3d loader.



using 3dsmax it is a pretty easy task to convert md5 to cal3d and te result is working with the current version of my cal3d loader. I’ll try to find out what is the problem with the md5 loader next week. Thanks for your interest and the test model. can you also post the blender file so that i work a little with exporting cal3d from blender?

snaga the md5 loader failed to load your model. I don't have much time to debug it to find what the fault is,


I understand, it didnt show nothing in the engine, just gave back an error...as if you actually mean that it looks like in that pick you show, well, it indeed must look so. the mesh I made is very bad, as I just did a quick test mesh having the needed features, but weights are incorrect, and uv mapping is just an automatic one, to test uvs.


i don't know if the texture coordinates are presented correct so here is a screenshot of the mesh loaded with cal3d loader.


yes, what you show in the pic, is exactly what should appear, if I am not wrong. It's just an automatic uv, and one of those textures made for check distortion. But I did in five seconds, as was enough in that part.With what i see, is enough to say uvs and texture loaded correct in that screenshot. Not sure if there'sopengl illumination though..But that is not related to the format or loader, I guess.

using 3dsmax it is a pretty easy task to convert md5 to cal3d and te result is working with the current version of my cal3d loader


There's indeed a working exporter for cal3d for Blender 2.41, also :) My scene is done with Blender 2.41, qas I only use that, fo ris much more powerful than older ones.

I'll dig now for that 2.41 cal3d exporter, I think i found the other day.

I'll try to find out what is the problem with the md5 loader next week


Absolutely great :) Thanks a lot! :)

Thanks for your interest and the test model.


Thanks to you 8)

can you also post the blender file so that i work a little with exporting cal3d from blender?


of course!

here it is :

I took the freedom to include the latest cal3d plugin that I found for blender 2.41. ;)  (I think I found hidden in some very recent blender thread)

http://www.savefile.com/files/3340299


Though I am way more interested now in md5 than in any other thing, after so fantastic tests about memory. But all bones and weights formats are really wellcome. :)
I think that the latest md5 exporter from der_ton I included in a text window in that blender scene, so, I think both great exporters are there in that zip, also :) And included again the texture.









Some numbers regarding filesizes for worm testmodel:

md5mesh 162523 bytes

md5anim  30560 bytes

cal3d skeleton 405 bytes

cal3d mesh 80476 bytes

cal3d anim 16216 bytes



cal3d skeletons and anims may be shared across different models. As a file format i prefer cal3d since the cal3d loader has some kind of physics engine simulating cloth or hair movement. The main advantage of  md5 is the more advanced support for texturing and shaders!

@ snaga there's something wrong with that mesh when compared to mine

this caught my eye



mesh {

shader ""



numverts 0



numtris 0



numweights 0

}

that seems wrong to me



edit: yes thats it delete that and change numMeshes to 1 and it loads



p.s your shader name/path is bad to should be relative and file name should preferable have no extension use somthing like  e.g models/augBG





@ kman sounds nice will there tests/ instructions / doc and stuff

when you release


@kman



interesting memory numbers…

As I understood, md5 also could share several anims among models, but unsure on that…

I have more tools for md5 than I have for cal3d.

The physicis engine features in the loader can come very handy in the cal3d, though.

I guess I will test strongly both formats for our purposes, as one never knows. Some very small issue can be giantly bad for a project, so, I feel safer having both possibilities.

Indeed, strange aspects as how much cpu(even worse, gpu) overload does each format forces the engine to have, is esential for me.

About advanced stuff on shaders, etc, when you do a low machine targeted game, that doesn't count much, but surely will for others.





@mcbeth

the shader and all what you see in the ascii format exported…I did not generate it in anyway. Neither am the author of the plugin. I just mounted fast an scene in blender and hit alt+p in the text editor window.perhaps there's some special material stuff to be done in the blender scene so it writes that into the exported file.

So, i understand that if kman changes that in the scene sample it willload in jme, right?

then, finally a working md5 loader for jm 0.9… :slight_smile:



About the relative path…i thought it made it relative if took in same filder.No prob, I'll dig for it in every exprot and edit to be relative.



The shader name path…you mean again in the exported assii, scene? oke, I'll edit it also in exported files…



Oh, about if docs and instructions are included, well, more or less all is clear, no? unless you mean for loading in jme engine (the code side of things)


snaga you misunderstand me you need to open the mesh file your self and change these thing for the object to load correctly in jme

if you the .md5mesh in a text editor you need then to delete that block of ascii in my first post and perhaps the drive (E:) letter in the shader path if you don't understand me have your friend take look.



the mesh file needs editing to clean this up as the loader was not tested as derton's viewer was to catch these exceptions



there is one more thing to change see my post above

Thanks…



sorry, I think I understood well, but maybe in my english you understood I was thinking of changing the mesh inside blender.





Blender has a text editor inside of it. I use it or I use just notepad.



What understood is… I should:



-delete that block of text you posted.

-change the number of meshes to 1. (somewhere in the ascii file, I guess)

-somewhere in the asciii file, change the absolute path of the texture file, to point to a relative path.





isn't it? That was what i understood firstly :slight_smile:




snaga said:

-delete that block of text you posted.

yes

snaga said:

-change the number of meshes to 1. (somewhere in the ascii file, I guess)

yes numMeshes located at or close to the top

snaga said:

-somewhere in the asciii file, change the absolute path of the texture file, to point to a relative path.

yes look for "shader"


Thanks a million mcbeth! :slight_smile: