MD5 reader fixed

I'l lsee if I can upload test model

mcbeth said:
I'l lsee if I can upload test model


Thanks.
White_Flame said:


  • I did not make Bone derive from Node.  I went back and forth on this for a while, but the general case is that Bones do not have non-Bone children.  For a Bone to have a general Node child would be a special case.  Nodes carry along a lot of state, and calling down the scene graph every frame would run a lot of stuff in those skeleton nodes that wouldn't affect the skinned model at all.  So I opted for a lightweight skeleton-specific Bone class.  In my system, if you want to hang things off your skinned model, you can ask it to create a Node that keeps itself locked to a Bone.  This Node is directly under the skinned model's root node, keeping the scene graph heirarchy a lot more flat.  My skeleton also updates in a linear fashion (ArrayList of Bones, pre-sorted in descending heirarchy order), instead of traversing a tree.



Maybe you could explain this a bit more?  If by states you mean renderstates, they do not get updated or calculated except when specifically called.  The only other "states" I can think you might mean is rotation, translation and scale which are things animated bones will need updated in either case.  By not having them in a tree, you still have to track the dependencies somehow in order to push down movement of a root bone to its dependant bones (say rotation of a shoulder down to a hand.)  I assume you are doing that via your sorted array...  how do you track a complex hierarchy of bones in a single arraylist without storing additional data on each bone about child count, etc?  And if you have to keep data like that on each bone, you're still going to be doing mutiple looping on various subsets of that arraylist to update your bones.

Perhaps I'm missing something.

There's render states, bounding volumes, collision stuff, locks, and the various settings and flags, but as you said they generally don't get run.

Cool, well, will be interesting to see the proof in the pudding once we can see the same model under multiple methods.  There's always room for improvement on any code.

To ease my burden, I'm writing my importer to convert from the "official" bone classes into mine, so I don't have to deal with file formats, so side-by-side comparisons are a given. :slight_smile:



But you know what?  Game programming is always all about taking the core hook of your game and writing custom code to do it better than a general-purpose routine would, so there's no problem with multiple skeletal options optimized for different cases and a nice generalized standard implementation to fall back on.

Well said.

Ender said:


In the source files there is a MD5Test2.java that is quite easy too understand and can be considered an HelloMD5.java.

Though your code seams to be correct, even if I would like to see the output.


This was the point from where I started from. Unfortunately I'm a Newbie in Modelling(Bones/MD5) and in JME. Maybe there is somebody who can provide an example md5 model.

snaga said:

@mcbeth/ender .  Do you really need marine? cant use any homemade md5? I only have a weighted and complex-rigged/constrainted cilinder(which proved to work with Kman's and jme) with some anim...We went 2d at the end for a first project...


I don't need marine only a simple model with a few bones inside, which will be displayed after using MD5 Loader.
This was the point from where I started from. Unfortunately I'm a Newbie in Modelling(Bones/MD5) and in JME. Maybe there is somebody who can provide an example md5 model.

I don't need marine only a simple model with a few bones inside, which will be displayed after using MD5 Loader.


I will provide some model as soon as possible. I the meanwhile you can download some example from some Blender 3D resource and convert it in MD5 format with the der_ton's exporter for Blender 3D. You can find the links with some search like "blender md5 exporter der_ton".

Thanks for the hint. I allready use the "blender md5 exporter der_ton".



The idea with the example model is to use a model which works for sure by other jme users.

If it not work on my program, I'm sure I made a mistake by coding. E.g. I use light in the wrong way or loading textures failed, or I don't know.

If it works on my program, I'm sure I made a mistake by modelling or by using the MD5 format. E.g.


mcbeth said:

unfortunately the loader does not have a default material renderstate so if their is no texture in the file's shader definition or the texture cannot be found nothing will display, thats one of the things I want to "try" adding, not the best coder :'( ://


And I try to adopt my models so I can see it in my program on screen.
JTroll said:
mcbeth said:
unfortunately the loader does not have a default material renderstate so if their is no texture in the file's shader definition or the texture cannot be found nothing will display, thats one of the things I want to "try" adding, not the best coder :'( ://


And I try to adopt my models so I can see it in my program on screen.


I suggest you to investigate if the der_ton's exporter supports correctly textures and/or if is needed to store textures images in some particular place.
Anyway I will do some tests and maybe I will upload an'example model.

Anyway considering what mcbeth said you could try to create a dummy material renderstate to apply to the loaded object. I am not sure but I think it could work.

ensure your texture was mapped with UV coordinates. Procedural blender textures wont get exported.



this file has:



-smoothing normals (not hard edges, anyway)

-uv coordinates.

-texture asigned to the uvs.

-Bones and weights rig.

-constraints applied to the rig, so to restrict skeleton handling for avodi sinking feet, sliding, knees crazy rolling, etc.

-Some animation. Surely not baked, tho it says so in Action Editor. i think it was not baked, to test that actually it doesnt need that with md5 exporter by der ton. i could load well with the available md5 jme tools by then.i saw it ok at Jme.



http://www.filesend.net/download.php?f=bf3c786c398a1d8a23a1213d0f4806f7


I already wrote this message 2 times but something goes wrong with the jME forum server.



Anyway, this is what I have been able to see, loading the fish.blend file included in der_ton’s blender2md5 exporter, and after i press “B” to see boundings (thanks to the fixes made by mcbeth :D).







I am almost sure that this is caused by what have been exported by the blender2md5 exporter. As der_ton wrote in the README included, blender2md5 is based on blender2cal3d and I guess it suffers the same problems.



I already fixed blender2cal3d and I could fix also blender2md5… may be! :slight_smile:



P.S. Take in to consideration to bake animations with Blender before you export your models. I still have not tryed this solution, I will do it later, now I go to sleep  :stuck_out_tongue: .

:slight_smile: Thats looks promising.  Unfortunately I'm away from keyboard for about one week from now. So I give feedback after my trip.

…the point is with der_ton's exporter and his use of coding module "pose", baking is not necesary, luckily for the artist.  I did an export with no bake and checked it went ok in a jme viewer…with old kman stuff.

snaga said:
..the point is with der_ton's exporter and his use of coding module "pose", baking is not necesary, luckily for the artist.  I did an export with no bake and checked it went ok in a jme viewer...with old kman stuff.


So I should release the marine mesh :) . That works in Chaosdeathfish's MD5 Reader. The der_ton's exporter meshes does not. Why?
May be that Kman's MD5 Reader have support for things that Chaosdeathfish's MD5 Reader does not?

there is nithing wrong with the model if u are not getting crashes then the loader can't find the shader I had help snaga debug this file already I think, it is important that the shader path in the mesh file be

  1. relative
  2. match the folder locations on your system



    simple open the the mesh file in a text editor and look for shader "" the path should be like

Always keep in mind that the loader was designed to read and automatically load the textures based on the shader path

oh!



true



yup



I forgot. Was just a fast edit in the exported mesh file. For the texture thingie (the "shader"…i dunno, I would have not used that name, but ID software would know… :wink: )



Yup, mcbeth pointed me directly to the issue and was loaded correctly then.Eons ago…

mcbeth said:
simple open the the mesh file in a text editor and look for shader "" the path should be like  shader "res/myimage"

.tga is the image format requirred but the extension should not be part of the shader path


Thanks for the help, mcbeth.
I quickly tryed to modify the path of the texture, in the fish.md5mesh, taking as an example the md5mesh file of the marine. But, unfortunatelly, I got the same result of the image above.
I think it is time for me to investigate better the specification of MD5 and both the MD5 Reader and der_ton's exporter source code.