Help loading an md5 model

I have just made a bike in blender, wich I want to use in jME using md5reader



I use the following lib and example code, changing only the md5-filenames

md5reader.cvs.sourceforge.net



(ps I followed this tutorial)

http://www.jmonkeyengine.com/wiki/doku.php?id=exporting_animated_.md5_models_from_blender



And I use the following exporter for blender:

http://home.tiscali.de/der_ton/blender2md5.rar



The model now loads fine into blender again (after export and import)

Even with the animation



The model also loads into jME, but the animation looks broken.

It seems to move like it's supposed to, but it also shakes a lot.



I noticed even the example md5's shake a little bit



Why?





these are my files

http://fredrik1.com/blender/bike.blend

http://fredrik1.com/blender/bike.md5mesh

http://fredrik1.com/blender/bike.md5anim

This is something that has recently come up (been noticed?). I think there is a thorough discussion going on about it here:

http://www.jmonkeyengine.com/jmeforum/index.php?topic=4702.msg37775#msg37775



I used der tons code not to long ago, about october last year, and didn’t have any problems with jitter. I do beleive I was using a jME nighlty build, not cvs.

I checked the loader with a nightly build, dont get "wild' shakes but the textures on the marine did seem to flicker a bit might be the shaking issue just subtle. will take crack at it over the long weekend…4 days…whole da…um… any how will have a good look, see if I can come up with something, in the meantime use kman's it shiould keep u going for the time being.

Thanks for quick answers



I didn't follow and read those discussions in detail,

but I found a solution for my model.



I took a close look on the marine (shipped with the md5reader) ( opened in blender ),

and noticed that it had one bone placed at the origin.

All the other bones were children of the "origin" bone.



So I added an "origin" bone to my bike, and the shaking stopped.



Wohoo :slight_smile:

hmm… Thats an interesting tidbit of info. Maybe thats why I havn't experienced this shaking stuff, I've only really used on model which I built and it has this so called "origin" bone.

oh right that's why… it seems that the loader depends a bit on the origin bone like doom, I beliave its used ( by doom3) to translate and determine a models position on the floor.







edit clarification

the textures on the marine did seem to flicker a bit


I also notice this, when the bounding box is showing the flickering stops though.  :? not sure why

i changed fish.md5mesh to



joints {

"origin" -1 ( 0 0 0 ) ( -0.5 -0.5 -0.5 )

"Bone1" 0 ( 0.046053 0.001212 0.000000 ) ( -0.000000 -0.000000 -0.698215 ) //

"Bone2" 1 ( -0.065689 0.004006 0.000000 ) ( -0.000000 -0.000000 -0.700276 ) // Bone1

"Bone3" 2 ( -0.210955 0.006799 0.000000 ) ( -0.000000 -0.000000 -0.707108 ) // Bone2

"Bone4" 3 ( -0.353426 0.006799 0.000000 ) ( -0.000000 -0.000000 -0.687760 ) // Bone3

}



still shutters, is that not enough correct? is the origin bone not to problem?



Edit:



I just tried the showing bound and wireframe and normals and all of those but none of them fixed the shaking.

I'm running the MD5Test2

I just tried the showing bound and wireframe and normals and all of those but none of them fixed the shaking.

actually I was referring to the flickering not the shaking

also ive found if you remove line

bodyInstance.setLocalScale( 5.00f );

from the test class the flickering stops.

The origin bone fixes the shaking by me. (just tried for the fish.blend)



But editing the mesh-file without making a new md5anim

doesn't help. Make a new md5anim too.



is there any good alternatives to setLocalScale?

Scaling within blender?

texture flickering

  fixed by displaying bounds or normals

  removing setLocalScale from test file

model shaking

  origin bone



I tried these fixes for myself but I don't like it. These fixes seem bad, like the code is unstable, like I have to baby MD5. argh :expressionless:

ok, after some testing I got the shaking model to stand still. It seems the origin bone needs to be at the same location as the model. In blender I selected model then snapped cursor to selection then selected bone and snapped selection to cursor. now I need to figure out why my tga images only appear black in jme  :expressionless:



edit: figured out the black texture, I had to save as targa raw instead of targa in blender. tutorial has been updated  :wink:

can you post your new bike blender file after the origin bone add?

I want to temporally join in this thread all my considerations about MD5 Reader 2 bug tracking. I come from the Md5 twitching? thread.



About all the problems you experienced, I have to say that I have tested MD5 Reader 2 yesterday with success. But I used an old CVS snapshot. Consider that in the MD5 Reader 2 CVS tree there are all dependencies. Please, try to run the original marine with them and tell me if it works.



If my guess (that, in this last 5 month, something have been changed in jME source, influencing MD5 Reader 2 behavior) were confirmed, I would decide to wait untill the next official release of  Java Monkey Engine to release a stable version of MD5 Reader 2.



Meanwhile, please try to track bugs, requests and other things using the MD5 Reader 2 project tracking page. It seems that there is no need to be registered users.



We also need help! I saw many people interested about this loader. I read in this thread that Fungi, for example, try some fix. Why don’t you join us? Also mud2005 could be one of us and of course anyone else interested. Also modelers and animators for testing models are required.



For informations, please PM me.



Thanks.



Marco Frisan, Trieste, Italy

The bike

http://fredrik1.com/blender/bike_textured.blend

I posted the 2 bugs in the MD5 Reader 2 tracking page.

Read this, please.

EDIT: I decided to reopen the bug tracker about model twitching. I tested the bike animation with another loader (Doom 3’s MD5 Viewer at http://tfc.duke.free.fr/, you can download it at http://tfc.duke.free.fr/old/models/md5loader-09.tar.bz2) written in C++, and it works.



OLD: I think that the model shaking/twitching problem can be considered just a model setup problem. I have closed the bug track on MD5 Reader 2 project page about it, because I have not experienced any model shaking/twitching with the marine example. The only little shake was in the fish example, and it is probably caused by the absence of an “origin” bone (I exported the fish without any “origin” bone because I did not know that it is necessary).



About texture flickering, I am still investigating for a real solution. But I have to say that I have never experienced that problem with any model I tested. I will test the various bike models from this thread trying to understand what’s happening.

It seems that I have been able to fix the model shaking/twitching bug.



Updated code is available at SourceForge CVS repository.

Do not use the ./dist/md5r2.jar package to test the library. It is not up to date. If you want to use it, compile it with Eclipse from source.



Marine, now, is back to its original behavior.



There is a lot of uneeded code in Chaosdeathfish implementation… it have been hard to understand what that code did.



Feedback is wellcome.



In the Model shaking/twitching Traker thread you can see the story of this fix with all the explanations I have been able to write.