MD5reader2 bug

I used der_ton's exporter but in JME the model is messed up like the follow: (some IK is added to bones) - model is working fine in MD5 Modelviewer though:



http://www.oniva.com/upload/1356/man.jpg

http://www.oniva.com/upload/1356/man2.jpg

http://www.oniva.com/upload/1356/man3.jpg



the model in 3ds max was like this:

http://www.oniva.com/upload/1356/man4.jpg

http://www.oniva.com/upload/1356/man5.jpg



some animation moving the left arm is created like follow:

http://www.oniva.com/upload/1356/man6.jpg



if I delete all animation keyframes in 3ds max and export again, the model loaded correctly:

http://www.oniva.com/upload/1356/man7.jpg



MD5 model animation is working fine under MD5 modelViewer:

http://www.oniva.com/upload/1356/man8.jpg



MD5 files is uploaded:

http://www.oniva.com/upload/1356/aaa.md5anim

http://www.oniva.com/upload/1356/aaa.md5mesh



java code to load the model + animation:


import com.jme.app.SimpleGame;

import com.jme.light.PointLight;

import com.jme.math.*;
import com.jme.math.Vector3f;

import com.jme.renderer.ColorRGBA;

import md5reader.MD5AnimReader;
import md5reader.MD5MeshReader;

import model.Model;
import model.SkeletalModelInstance;

import model.animation.Animation;
import model.animation.AnimationAnimator;
import model.animation.AnimationController;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

public class FishTest extends SimpleGame {
    private static final String BODYMODEL2 = "models/aaa.md5mesh";
    private static final String BODYANIM2 = "models/aaa.md5anim";

    //    private static final String BODYMODEL = "models/fish/fish.md5mesh";
    //    private static final String BODYANIM = "models/fish/fish.md5anim";
    private Model bodyModel2;
    private Animation bodyAnimation2;
    private AnimationController bodyAnimator2;
    private SkeletalModelInstance bodyInstance2;

    public FishTest() throws IOException {
        bodyModel2 = loadModel(BODYMODEL2);

        bodyAnimation2 = loadAnimation(BODYANIM2);
    }

    public static void main(String[] args) throws IOException {
        final FishTest app = new FishTest();

        app.setDialogBehaviour(SimpleGame.ALWAYS_SHOW_PROPS_DIALOG);

        // Turn the logger off so we can see the XML later on
        app.start();
    }

    protected void simpleInitGame() {
        lightState.get(0).setAmbient(new ColorRGBA(1.5f, 1.5f, 1.5f, 1.0f));

        bodyInstance2 = new SkeletalModelInstance(bodyModel2);

        bodyAnimator2 = bodyInstance2.addAnimationController();

        AnimationAnimator anim = bodyAnimator2.addAnimation(bodyAnimation2);

        anim.setInterpolationThreshold(0f);

        Quaternion rotate3 = new Quaternion();
        // angle in radian no degree
        rotate3.fromAngleAxis(3.14f, new Vector3f(1, 1, 0));
        bodyInstance2.setLocalRotation(rotate3);

        bodyAnimator2.update(0f);
       
        bodyInstance2.setLocalTranslation(0, 0, 0);
        bodyInstance2.updateModelBound();

        bodyInstance2.setLocalScale(0.5f);


//        rootNode.detachAllChildren();

        rootNode.attachChild(bodyInstance2);

       
       
       
        cam.setLocation(bodyInstance2.getLocalTranslation().add(200.0f, 0.0f, 0.0f));

        cam.lookAt(bodyInstance2.getLocalTranslation(), new Vector3f(0.0f, 1.0f, 0.0f));
       
       
       
       
       
       
       
        lightState.detachAll();

        PointLight pl = new PointLight();
        pl.setAmbient(new ColorRGBA(0.5f, 0.5f, 0.5f, 1));
        pl.setDiffuse(new ColorRGBA(1, 1, 1, 1));
        pl.setLocation(new Vector3f(100, 0, 0));
        pl.setEnabled(true);
        lightState.attach(pl);
    }

    private Model loadModel(String path) throws IOException {
        InputStream in = getClass().getResourceAsStream("/" + path);

        if (in == null) {
            throw new FileNotFoundException("Cannot find " + path);
        }

        MD5MeshReader reader = new MD5MeshReader();

        reader.setProperty(MD5MeshReader.CLASSLOADER, getClass().getClassLoader());

        return reader.readModel(in);
    }

    private Animation loadAnimation(String path) throws IOException {
        InputStream in = getClass().getResourceAsStream("/" + path);

        if (in == null) {
            throw new FileNotFoundException("Cannot find " + path);
        }

        MD5AnimReader animReader = new MD5AnimReader();

        Animation animation = animReader.readAnimation(in);

        return animation;
    }
}



any one has this problem? and what's the cause of it?

Most likely it is a problem with the bones setup. Check that you don't have unasigned bones, and the like.

but in MD5 model viewer it animated perfectly fine:

http://www.oniva.com/upload/1356/man8.jpg



the thing i notice is there are some box instead of bones at the hand:

http://www.oniva.com/upload/1356/man9.jpg



how to fix this?

We are investigating this problem, thanks for posting this problem. Stay tuned.

Thanks your help!



I also notice there are "CONTROLS" in the export like the follow:

http://www.oniva.com/upload/1356/man10.jpg



also there are "IK" or "POINT" stuff added to the foot / hand (i highly suspect "IK" or "GREEN BOX" or "Point" is messing up the hand + foot)

http://www.oniva.com/upload/1356/man11.jpg



(see the green box - point added to the model)



ORIGINAL MAX FILE is uploaded:

http://www.oniva.com/upload/1356/Man.max



if I remove all the "POINT" / "CONTROLS" / "HELPER" then it works like the follow:

http://www.oniva.com/upload/1356/man12.jpg



else if there are "POINT" and other stuff it won't work like follow:

http://www.oniva.com/upload/1356/man13.jpg

I just found that follow will fix the problem:


  1. remove skin modifier
  2. re-add skin modifier
  3. re-add all bones to skin



    not sure what cause the problem earlier though but it fixes the problem. but all envelope seem deleted too
tobycraftse said:

I also notice there are "CONTROLS" in the export like the follow:


In the *.md5mesh and *.md5anim file those "CONTROLS" seem to be not exported. Can you confirm?


joints {
   "L_Hip"   -1 ( 0.0025720670 -0.0000088512 131.1694335937 ) ( 0.6517735481 -0.2742096185 -0.2742096900 )      //
   "L_Thigh"   0 ( 10.3771800994 0.0162696113 120.9841003417 ) ( -0.7065370559 0.0283817052 0.7065422058 )      // L_Hip
   "L_Shin"   1 ( 10.3764486312 -3.9590487480 71.4595031738 ) ( 0.7069002151 0.0171035265 -0.7068960189 )      // L_Thigh
   "L_Ankle"   2 ( 10.3770751953 -1.0252060890 11.1106719970 ) ( 0.7063570499 0.0325609707 -0.7063497543 )      // L_Shin
   "L_Heel"   3 ( 10.3771696090 -0.5642379760 6.1319637298 ) ( 0.4490561008 -0.5462650775 0.4494328022 )      // L_Ankle
   "L_Ball"   4 ( 10.3600339889 -21.8140087127 1.9585247039 ) ( 0.4947435855 -0.5053255558 0.4944384574 )      // L_Heel
   "L_Toe"   5 ( 10.3671607971 -41.9731369018 1.5246136188 ) ( 0.4947435855 -0.5053255558 0.4944384574 )      // L_Ball
   "R_Hip"   -1 ( 0.0025720670 -0.0000088512 131.1694335937 ) ( -0.2742096900 -0.6517738342 0.6517734527 )      //
   "R_Thigh"   7 ( -10.0591754913 -0.0147796049 120.9841003417 ) ( -0.7062058448 0.0348129463 0.7062964916 )      // R_Hip
   "R_Shin"   8 ( -10.0658168792 -4.8949837684 71.5429229736 ) ( 0.7066981792 0.0227225494 -0.7067820549 )      // R_Thigh
   "R_Ankle"   9 ( -10.0727443695 -1.0064010620 11.2480659484 ) ( 0.7060336589 0.0381448745 -0.7061156749 )      // R_Shin
   "R_Heel"   10 ( -10.0732898712 -0.4670946121 6.2770833969 ) ( -0.5469666481 0.4479615211 0.5463140487 )      // R_Ankle
   "R_Ball"   11 ( -10.0356216430 -21.6694488525 2.0557813644 ) ( -0.5029115200 0.4967375278 0.5032298564 )      // R_Heel
   "R_Toe"   12 ( -10.0351552963 -41.8901977539 1.8066226005 ) ( -0.5029115200 0.4967375278 0.5032298564 )      // R_Ball
   "Spine_01"   -1 ( -0.0000066757 0.4551543235 131.1837768554 ) ( -0.0099262685 0.7070371627 0.0099275598 )      //
   "Spine_02"   14 ( -0.0000130333 0.0000123679 147.3900604248 ) ( -0.0000007607 0.7071066856 0.0000007363 )      // Spine_01
   "Spine_03"   15 ( -0.0000179381 -0.0000187595 162.0000000000 ) ( 0.0000003351 0.7071066379 0.0000003767 )      // Spine_02
   "Spine_04"   16 ( -0.0000224006 -0.0000190922 174.0000000000 ) ( 0.0056511745 0.7070841789 -0.0056487760 )      // Spine_03
   "Spine_Top"   17 ( -0.0000265621 0.2085509061 187.0502319335 ) ( 0.0072748923 0.7070693492 -0.0072708797 )      // Spine_04
   "L_Clavicle"   18 ( -0.0000271099 0.3114447116 192.0491790771 ) ( -0.7028262138 -0.0611483955 0.0614362716 )      // Spine_Top
   "L_Shoulder"   19 ( 18.2329788208 0.2966122150 188.8521728515 ) ( -0.6297283649 -0.2985322475 0.3190673589 )      // L_Clavicle
   "L_Bicep"   20 ( 24.1254749298 -0.0262739658 181.3659973144 ) ( 0.9994327545 -0.0029860984 0.0032143626 )      // L_Shoulder
   "L_Forearm"   21 ( 53.1358184814 -0.2056707859 181.5466156005 ) ( 0.9993496894 0.0037025265 0.0033468632 )      // L_Bicep
   "L_Wrist"   22 ( 82.7413406372 0.0063450188 181.7524719238 ) ( 0.9991542816 0.0031054425 0.0200399732 )      // L_Forearm
   "L_Palm"   23 ( 83.7376785278 -0.0071164550 181.9010314941 ) ( -0.0007730624 -0.0088208026 -0.0199235324 )      // L_Wrist
   "L_Indx01"   24 ( 97.3954391479 -6.3408117294 182.2392730712 ) ( 0.0021423399 -0.0038527652 0.1967750167 )      // L_Palm
   "L_Indx02"   -1 ( 101.4997024536 -8.2209262847 182.2133483886 ) ( 0.0028775360 0.0007031695 0.2131281852 )      //
   "L_Indx03"   -1 ( 104.6260299682 -9.6953983306 182.2175750732 ) ( 0.0027782106 0.0002477334 0.2131117820 )      //
   "L_Mid01"   24 ( 98.0200881958 -2.5748679637 182.2352752685 ) ( -0.0008728941 -0.0037969949 -0.0199193973 )      // L_Palm
   "L_Mid02"   -1 ( 103.2909774780 -2.5409162044 182.1998748779 ) ( -0.0011649377 0.0012155033 -0.0032138171 )      //
   "L_Mid03"   -1 ( 108.0291519165 -2.5103695392 182.1588592529 ) ( -0.0011652386 0.0012182463 -0.0032087566 )      //
   "L_Pink01"   24 ( 96.0003051757 4.8216390609 182.2848968505 ) ( -0.0053376917 -0.0033702218 -0.3446736812 )      // L_Palm
   "L_PInk02"   -1 ( 99.4744338989 7.5443325042 182.2777252197 ) ( -0.0068352832 0.0001911155 -0.3289397239 )      //
   "L_Pink03"   -1 ( 102.8049468994 10.0575704574 182.2596435546 ) ( -0.0064848709 -0.0008164167 -0.3289061069 )      //
   "L_Ring01"   24 ( 97.1343383789 1.4453062057 182.2584991455 ) ( -0.0034306311 -0.0036056663 -0.2053787708 )      // L_Palm
   "L_Ring02"   -1 ( 101.6781311035 3.2348899841 182.2353820800 ) ( -0.0045646615 0.0008728637 -0.1890014553 )      //
   "L_Ring03"   -1 ( 105.7225570678 4.7353367805 182.2045288085 ) ( -0.0044996457 0.0005334835 -0.1889785957 )      //
   "L_Thumb01"   24 ( 86.8617248535 -4.8730797767 180.0712738037 ) ( -0.0671835994 -0.1199030399 0.5001575946 )      // L_Palm
   "L_Thumb02"   37 ( 89.0144729614 -9.0283832550 178.7467041015 ) ( -0.0691953229 -0.1188198451 0.5143667221 )      // L_Thumb01
   "L_Thumb03"   38 ( 91.2002487182 -13.2474422454 177.4018096923 ) ( -0.0691953182 -0.1188198566 0.5143668174 )      // L_Thumb02
   "Neck"   18 ( -0.0000271317 0.3114112615 192.0491638183 ) ( -0.5000812530 0.4976181507 -0.4999054908 )      // Spine_Top
   "Head"   40 ( 0.0491321277 0.3570729732 201.9986877441 ) ( -0.5063758373 0.5001597404 -0.4935104846 )      // Neck
   "R_Clavicle"   18 ( -0.0000272311 0.2884812355 192.0495910644 ) ( 0.0612937211 -0.7044446945 -0.7044457912 )      // Spine_Top
   "R_Shoulder"   42 ( -18.2330303192 0.2884204387 188.8525390625 ) ( -0.2993826866 -0.6311402320 0.6407714366 )      // R_Clavicle
   "R_Bicep"   43 ( -24.1209487915 -0.0000262856 181.3649597167 ) ( 0.0050388002 0.7071835994 0.7069991111 )      // R_Shoulder
   "R_Forearm"   44 ( -53.1298828125 0.0323301982 181.7461090087 ) ( 0.0044726347 0.7071775913 0.7070030689 )      // R_Bicep
   "R_Wrist"   45 ( -82.7341308593 0.0045420937 182.1484985351 ) ( -0.0162823925 -0.7071647167 -0.7068296432 )      // R_Forearm
   "R_Palm"   46 ( -83.7207412719 0.0495667743 182.6810302734 ) ( 0.0161937770 0.9998669624 -0.0003636067 )      // R_Wrist
   "R_Indx01"   47 ( -97.3203506469 -6.3848800659 183.3238525390 ) ( -0.2004468917 0.9797043800 0.0004319535 )      // R_Palm
   "R_Indx02"   -1 ( -101.4902801513 -8.2346429824 183.3270111083 ) ( 0.2167823791 -0.9762177467 -0.0011348152 )      //
   "R_Indx03"   -1 ( -104.6055068969 -9.7324447631 183.3203582763 ) ( 0.2167796611 -0.9762184143 -0.0011271033 )      //
   "R_Mid_01"   47 ( -97.9730911254 -2.6237025260 183.3263549804 ) ( -0.0161930632 -0.9998687744 0.0003941276 )      // R_Palm
   "R_Mid_02"   -1 ( -103.2385101318 -2.4531047344 183.3309631347 ) ( 0.0005092477 -0.9999979972 0.0000545243 )      //
   "R_Mid_03"   -1 ( -107.9768981933 -2.4579329490 183.3080444335 ) ( 0.0005095725 -0.9999979019 0.0000545215 )      //
   "R_Pink01"   47 ( -96.0080871582 4.7877049446 183.3190612792 ) ( -0.3412016630 -0.9399887084 0.0016036290 )      // R_Palm
   "R_Pink02"   -1 ( -99.5022811889 7.4845991134 183.3204193115 ) ( -0.3254540920 -0.9455551147 0.0017718479 )      //
   "R_Pink03"   -1 ( -102.8513946533 9.9730348587 183.3130035400 ) ( -0.3254492759 -0.9455576896 0.0015749647 )      //
   "R_Ring01"   47 ( -97.1171417236 1.4029858112 183.3231811523 ) ( -0.2017463684 -0.9794370651 0.0010891993 )      // R_Palm
   "R_Ring02"   -1 ( -101.6741714477 3.1587364673 183.3267517089 ) ( -0.1853601455 -0.9826683998 0.0010846677 )      //
   "R_Ring03"   -1 ( -105.6903228759 4.7297415733 183.3054962158 ) ( -0.1853593444 -0.9826689720 0.0010383868 )      //
   "R_Thumb01"   47 ( -86.8468170166 -4.8431639671 180.9276580810 ) ( 0.5027073860 -0.8543867111 -0.0721732997 )      // R_Palm
   "R_Thumb02"   -1 ( -91.1788253784 -13.2548656463 178.3672485351 ) ( 0.5168618202 -0.8458425521 -0.0743407058 )      //
   "R_Thumb02"   -1 ( -91.1788253784 -13.2548656463 178.3672485351 ) ( 0.5168618202 -0.8458425521 -0.0743407058 )      //
}



tobycraftse said:

1) remove skin modifier
2) re-add skin modifier
3) re-add all bones to skin


Are these steps done in Max?

I used der_ton's exporter.



ORIGINAL MAX FILE is uploaded:

http://www.oniva.com/upload/1356/Man.max



just do an export in MAX 9.0 by running der_ton's exporter script.



I get the Man.max file from a tutorial video.



"In the *.md5mesh and *.md5anim file those "CONTROLS" seem to be not exported. Can you confirm?"



I don't understand MD5 file detail, I just use the exporter export mesh + anim



It seems all the "CONTROLS" "HELPER" … etc are OK just do the following is fine:



Just do the following will fix the problem:

  1. remove Skin modifier
  2. re-add Skin modifier
  3. re-add bone to Skin
tobycraftse said:

"In the *.md5mesh and *.md5anim file those "CONTROLS" seem to be not exported. Can you confirm?"

I don't understand MD5 file detail, I just use the exporter export mesh + anim


You only have to read the joints names and see if there is any CONTROLS in the list. No need for MD5 format knowledge.

Moreover, I would like to understand if the model is animated correctly by MD5 Reader 2, if you export it using the steps you wrote:
tobycraftse said:

Just do the following will fix the problem:
1) remove Skin modifier
2) re-add Skin modifier
3) re-add bone to Skin


I am not able to open *.max files. I have not 3D Studio Max.
tobycraftse said:

ORIGINAL MAX FILE is uploaded:
http://www.oniva.com/upload/1356/Man.max


Furthermore I analyzed the *.md5mesh file, the part regarding joints (bones) declaration. And I found that several bones/joints are root joints: they have no parent.


"L_Hip"   -1
"R_Hip"   -1
"Spine_01"   -1
"L_Indx02"   -1
"L_Indx03"   -1
"L_Mid02"   -1
"L_Mid03"   -1
"L_PInk02"   -1
"L_Pink03"   -1
"L_Ring02"   -1
"L_Ring03"   -1
"R_Indx02"   -1
"R_Indx03"   -1
"R_Mid_02"   -1
"R_Mid_03"   -1
"R_Pink02"   -1
"R_Pink03"   -1
"R_Ring02"   -1
"R_Ring03"   -1
"R_Thumb02"   -1
"R_Thumb02"   -1



This skeleton structure is quite strange for a human model. -1 means that the bone/joint has no parent.

I think model is fine, see MD5 model viewer perfectly loading model animation:

http://www.oniva.com/upload/1356/man8.jpg



but same model is loading messed up using MD5reader2:

http://www.oniva.com/upload/1356/man.jpg



That lead me to think something wrong with MD5reader2.



I use nothing magic in the code, I just re-use the FistTest.java and change it to load my model.



I suggest you repeat the same step by:

  1. download the Man.max
  2. mess around Man.max by add / delete stuff
  3. re-export using der_ton's exporter for MAX



    I did alot of trail and error includes:
  4. delete controls
  5. delete helpers
  6. delete lights
  7. delete face stuff



    but above cannot fix it and finally I found everything can stay in the Man.max and have no problem except need to do the following:
  8. remove Skin modifier
  9. re-add Skin modifier
  10. re-add bone to Skin

Also I tried another model from:

http://www.turbosquid.com/FullPreview/Index.cfm/ID/341150



the model is exported using exporter script in MAX 9.0



the model also works in MD5 model viewer but messed up in MD5reader2



MD5 files is uploaded:

http://www.oniva.com/upload/1356/bbb.md5anim

http://www.oniva.com/upload/1356/bbb.md5mesh

tobycraftse said:

I think model is fine, see MD5 model viewer perfectly loading model animation:
http://www.oniva.com/upload/1356/man8.jpg

but same model is loading messed up using MD5reader2:
http://www.oniva.com/upload/1356/man.jpg


I understood this. What I wanted to know is if the joints names list, in the *.md5mesh file, corresponds to the joints names that should be exported.

tobycraftse said:

I suggest you repeat the same step by:
1) download the Man.max
2) mess around Man.max by add / delete stuff
3) re-export using der_ton's exporter for MAX


As I already told you, in the previous post, I haven't 3D Studio Max so I cannot do those steps.

from the joints part in MD5 file, there are "BONES" "POINTS/HELPERS" and "CONTROLS", see below list


joints {
   "L_Hip"   -1 ( 0.0025720670 -0.0000088512 131.1694335937 ) ( 0.6517735481 -0.2742096185 -0.2742096900 )      //
   "L_Thigh"   0 ( 10.3771800994 0.0162696113 120.9841003417 ) ( -0.7065370559 0.0283817052 0.7065422058 )      // L_Hip
   "L_Shin"   1 ( 10.3764486312 -3.9590487480 71.4595031738 ) ( 0.7069002151 0.0171035265 -0.7068960189 )      // L_Thigh
   "L_Ankle"   2 ( 10.3770751953 -1.0252060890 11.1106719970 ) ( 0.7063570499 0.0325609707 -0.7063497543 )      // L_Shin
   "L_Heel"   3 ( 10.3771696090 -0.5642379760 6.1319637298 ) ( 0.4490561008 -0.5462650775 0.4494328022 )      // L_Ankle
   "L_Ball"   4 ( 10.3600339889 -21.8140087127 1.9585247039 ) ( 0.4947435855 -0.5053255558 0.4944384574 )      // L_Heel
   "L_Toe"   5 ( 10.3671607971 -41.9731369018 1.5246136188 ) ( 0.4947435855 -0.5053255558 0.4944384574 )      // L_Ball
   "R_Hip"   -1 ( 0.0025720670 -0.0000088512 131.1694335937 ) ( -0.2742096900 -0.6517738342 0.6517734527 )      //
   "R_Thigh"   7 ( -10.0591754913 -0.0147796049 120.9841003417 ) ( -0.7062058448 0.0348129463 0.7062964916 )      // R_Hip
   "R_Shin"   8 ( -10.0658168792 -4.8949837684 71.5429229736 ) ( 0.7066981792 0.0227225494 -0.7067820549 )      // R_Thigh
   "R_Ankle"   9 ( -10.0727443695 -1.0064010620 11.2480659484 ) ( 0.7060336589 0.0381448745 -0.7061156749 )      // R_Shin
   "R_Heel"   10 ( -10.0732898712 -0.4670946121 6.2770833969 ) ( -0.5469666481 0.4479615211 0.5463140487 )      // R_Ankle
   "R_Ball"   11 ( -10.0356216430 -21.6694488525 2.0557813644 ) ( -0.5029115200 0.4967375278 0.5032298564 )      // R_Heel
   "R_Toe"   12 ( -10.0351552963 -41.8901977539 1.8066226005 ) ( -0.5029115200 0.4967375278 0.5032298564 )      // R_Ball
   "Spine_01"   -1 ( -0.0000066757 0.4551543235 131.1837768554 ) ( -0.0099262685 0.7070371627 0.0099275598 )      //
   "Spine_02"   14 ( -0.0000130333 0.0000123679 147.3900604248 ) ( -0.0000007607 0.7071066856 0.0000007363 )      // Spine_01
   "Spine_03"   15 ( -0.0000179381 -0.0000187595 162.0000000000 ) ( 0.0000003351 0.7071066379 0.0000003767 )      // Spine_02
   "Spine_04"   16 ( -0.0000224006 -0.0000190922 174.0000000000 ) ( 0.0056511745 0.7070841789 -0.0056487760 )      // Spine_03
   "Spine_Top"   17 ( -0.0000265621 0.2085509061 187.0502319335 ) ( 0.0072748923 0.7070693492 -0.0072708797 )      // Spine_04
   "L_Clavicle"   18 ( -0.0000271099 0.3114447116 192.0491790771 ) ( -0.7028262138 -0.0611483955 0.0614362716 )      // Spine_Top
   "L_Shoulder"   19 ( 18.2329788208 0.2966122150 188.8521728515 ) ( -0.6297283649 -0.2985322475 0.3190673589 )      // L_Clavicle
   "L_Bicep"   20 ( 24.1254749298 -0.0262739658 181.3659973144 ) ( 0.9994327545 -0.0029860984 0.0032143626 )      // L_Shoulder
   "L_Forearm"   21 ( 53.1358184814 -0.2056707859 181.5466156005 ) ( 0.9993496894 0.0037025265 0.0033468632 )      // L_Bicep
   "L_Wrist"   22 ( 82.7413406372 0.0063450188 181.7524719238 ) ( 0.9991542816 0.0031054425 0.0200399732 )      // L_Forearm
   "L_Palm"   23 ( 83.7376785278 -0.0071164550 181.9010314941 ) ( -0.0007730624 -0.0088208026 -0.0199235324 )      // L_Wrist
   "L_Indx01"   24 ( 97.3954391479 -6.3408117294 182.2392730712 ) ( 0.0021423399 -0.0038527652 0.1967750167 )      // L_Palm
   "L_Indx02"   -1 ( 101.4997024536 -8.2209262847 182.2133483886 ) ( 0.0028775360 0.0007031695 0.2131281852 )      //
   "L_Indx03"   -1 ( 104.6260299682 -9.6953983306 182.2175750732 ) ( 0.0027782106 0.0002477334 0.2131117820 )      //
   "L_Mid01"   24 ( 98.0200881958 -2.5748679637 182.2352752685 ) ( -0.0008728941 -0.0037969949 -0.0199193973 )      // L_Palm
   "L_Mid02"   -1 ( 103.2909774780 -2.5409162044 182.1998748779 ) ( -0.0011649377 0.0012155033 -0.0032138171 )      //
   "L_Mid03"   -1 ( 108.0291519165 -2.5103695392 182.1588592529 ) ( -0.0011652386 0.0012182463 -0.0032087566 )      //
   "L_Pink01"   24 ( 96.0003051757 4.8216390609 182.2848968505 ) ( -0.0053376917 -0.0033702218 -0.3446736812 )      // L_Palm
   "L_PInk02"   -1 ( 99.4744338989 7.5443325042 182.2777252197 ) ( -0.0068352832 0.0001911155 -0.3289397239 )      //
   "L_Pink03"   -1 ( 102.8049468994 10.0575704574 182.2596435546 ) ( -0.0064848709 -0.0008164167 -0.3289061069 )      //
   "L_Ring01"   24 ( 97.1343383789 1.4453062057 182.2584991455 ) ( -0.0034306311 -0.0036056663 -0.2053787708 )      // L_Palm
   "L_Ring02"   -1 ( 101.6781311035 3.2348899841 182.2353820800 ) ( -0.0045646615 0.0008728637 -0.1890014553 )      //
   "L_Ring03"   -1 ( 105.7225570678 4.7353367805 182.2045288085 ) ( -0.0044996457 0.0005334835 -0.1889785957 )      //
   "L_Thumb01"   24 ( 86.8617248535 -4.8730797767 180.0712738037 ) ( -0.0671835994 -0.1199030399 0.5001575946 )      // L_Palm
   "L_Thumb02"   37 ( 89.0144729614 -9.0283832550 178.7467041015 ) ( -0.0691953229 -0.1188198451 0.5143667221 )      // L_Thumb01
   "L_Thumb03"   38 ( 91.2002487182 -13.2474422454 177.4018096923 ) ( -0.0691953182 -0.1188198566 0.5143668174 )      // L_Thumb02
   "Neck"   18 ( -0.0000271317 0.3114112615 192.0491638183 ) ( -0.5000812530 0.4976181507 -0.4999054908 )      // Spine_Top
   "Head"   40 ( 0.0491321277 0.3570729732 201.9986877441 ) ( -0.5063758373 0.5001597404 -0.4935104846 )      // Neck
   "R_Clavicle"   18 ( -0.0000272311 0.2884812355 192.0495910644 ) ( 0.0612937211 -0.7044446945 -0.7044457912 )      // Spine_Top
   "R_Shoulder"   42 ( -18.2330303192 0.2884204387 188.8525390625 ) ( -0.2993826866 -0.6311402320 0.6407714366 )      // R_Clavicle
   "R_Bicep"   43 ( -24.1209487915 -0.0000262856 181.3649597167 ) ( 0.0050388002 0.7071835994 0.7069991111 )      // R_Shoulder
   "R_Forearm"   44 ( -53.1298828125 0.0323301982 181.7461090087 ) ( 0.0044726347 0.7071775913 0.7070030689 )      // R_Bicep
   "R_Wrist"   45 ( -82.7341308593 0.0045420937 182.1484985351 ) ( -0.0162823925 -0.7071647167 -0.7068296432 )      // R_Forearm
   "R_Palm"   46 ( -83.7207412719 0.0495667743 182.6810302734 ) ( 0.0161937770 0.9998669624 -0.0003636067 )      // R_Wrist
   "R_Indx01"   47 ( -97.3203506469 -6.3848800659 183.3238525390 ) ( -0.2004468917 0.9797043800 0.0004319535 )      // R_Palm
   "R_Indx02"   -1 ( -101.4902801513 -8.2346429824 183.3270111083 ) ( 0.2167823791 -0.9762177467 -0.0011348152 )      //
   "R_Indx03"   -1 ( -104.6055068969 -9.7324447631 183.3203582763 ) ( 0.2167796611 -0.9762184143 -0.0011271033 )      //
   "R_Mid_01"   47 ( -97.9730911254 -2.6237025260 183.3263549804 ) ( -0.0161930632 -0.9998687744 0.0003941276 )      // R_Palm
   "R_Mid_02"   -1 ( -103.2385101318 -2.4531047344 183.3309631347 ) ( 0.0005092477 -0.9999979972 0.0000545243 )      //
   "R_Mid_03"   -1 ( -107.9768981933 -2.4579329490 183.3080444335 ) ( 0.0005095725 -0.9999979019 0.0000545215 )      //
   "R_Pink01"   47 ( -96.0080871582 4.7877049446 183.3190612792 ) ( -0.3412016630 -0.9399887084 0.0016036290 )      // R_Palm
   "R_Pink02"   -1 ( -99.5022811889 7.4845991134 183.3204193115 ) ( -0.3254540920 -0.9455551147 0.0017718479 )      //
   "R_Pink03"   -1 ( -102.8513946533 9.9730348587 183.3130035400 ) ( -0.3254492759 -0.9455576896 0.0015749647 )      //
   "R_Ring01"   47 ( -97.1171417236 1.4029858112 183.3231811523 ) ( -0.2017463684 -0.9794370651 0.0010891993 )      // R_Palm
   "R_Ring02"   -1 ( -101.6741714477 3.1587364673 183.3267517089 ) ( -0.1853601455 -0.9826683998 0.0010846677 )      //
   "R_Ring03"   -1 ( -105.6903228759 4.7297415733 183.3054962158 ) ( -0.1853593444 -0.9826689720 0.0010383868 )      //
   "R_Thumb01"   47 ( -86.8468170166 -4.8431639671 180.9276580810 ) ( 0.5027073860 -0.8543867111 -0.0721732997 )      // R_Palm
   "R_Thumb02"   -1 ( -91.1788253784 -13.2548656463 178.3672485351 ) ( 0.5168618202 -0.8458425521 -0.0743407058 )      //
   "R_Thumb02"   -1 ( -91.1788253784 -13.2548656463 178.3672485351 ) ( 0.5168618202 -0.8458425521 -0.0743407058 )      //
}



If you take a look at the mesh and animation file i uploaded in pervious post

As you can see, some of the above "ARE NOT BONES", see the green boxes in follow picture, they are box/points.
http://www.oniva.com/upload/1356/man10.jpg

but the green boxes (NOT BONES) is exported as joints too

P.S. Is Joints in MD5 files same as Bones? i notice they have same names
stmarsp5910 said:

If you take a look at the mesh and animation file i uploaded in pervious post

As you can see, some of the above "ARE NOT BONES", see the green boxes in follow picture, they are box/points.
http://www.oniva.com/upload/1356/man10.jpg

but the green boxes (NOT BONES) is exported as joints too


In the image there is a hieracy tree expanded. The first name I notice is Slider01; the second EyeTarget. Are they the green boxes (helpers, controlls)? And their siblings are helpers/controls too?
I ask that because there is no Slider01 or EyeTarget in the *.md5mesh file.

stmarsp5910 said:

P.S. Is Joints in MD5 files same as Bones? i notice they have same names


Joints are Bones in the syntax of MD5 format. But there are no other entities called Bones. Joints are Bones. It is simply a different way to call them. Probably they refer to the fact that they basically rapresent only the root of a bone.
Ender said:

In the image there is a hieracy tree expanded. The first name I notice is Slider01; the second EyeTarget. Are they the green boxes (helpers, controlls)? And their siblings are helpers/controls too?
I ask that because there is no Slider01 or EyeTarget in the *.md5mesh file.


Slider01 and EyeTarget when selected is show in the follow
1) Slider01 is not a box it's a 3 axis slider thing that i don't know what's use for
http://www.oniva.com/upload/1356/con1.jpg
http://www.oniva.com/upload/1356/con2.jpg

2) EyeTarge is the write box the eye is looking at when selected
http://www.oniva.com/upload/1356/con3.jpg

All controls when selected in 3ds max are show below in white boxes
http://www.oniva.com/upload/1356/con4.jpg



What I was asking you was to help me verifying if the controllers/handlers names appear also in the .md5mesh joints hierarchy.



Though, looking at the last image (http://www.oniva.com/upload/1356/con4.jpg) consider for example the L_TOE name in the Select Objects window; in the .md5mesh
file there is a “L_Toe” but different character case, so I think it is not one of white boxes selected in the last image.



This, in conclusion make me think that der_ton’s exporter did not exported controller and handlers. So the problem remain how you constructed your bone hierarchy.



I still do not know what the MD5 Viewer (C or C++) does, that MD5 Reader 2 does not. But it would be really helpful if you try to add a “origin” bone placed at (0, 0, 0) and parent to it all the bones that still do not have a parent. In a previous post I listed all of them.



NOTE: I have a little new idea about this known bug. I will test it, meanwhile.

What do you mean by exceding root bones? can you clarified?



From 3Ds max, it seem there is no bone hierarchy.

In animation rigging, usally, human characters are rigged with a hierarchy summarized here.



Basicaly only one bone is at the root of the herarchy. In this case the Hips bone.



For example, Doom 3 models have one root bone: you can open marine.md5mesh with a text editor and easily see that it has one bone named “origin” as its root bone. In a *.md5mesh file you can easily verify wich one is the root bone by reading the first number next the bone name: if it is equal to -1 it means that the bone has no parent bone, that means that it is a root bone.



In your file there are about 10 bones with the number -1.

Yes, you are correct.



The problem is on the -1 ( no parent )



I tested it to re-assign the Hip (L_Hip and R_Hip re-assign to ROOT instead of -1) + Hand (all fingers re-assign to Palm instead of -1) like the following, then the model loaded and animated correct:



http://www.oniva.com/upload/1356/man23.jpg



Can MD5reader2 be modified to deal with the -1 values?  since MD5 model viewer program display the model animation perfectly, Is this an easy fix for MD5reader2?

The link is broken…


tobycraftse said:

Can MD5reader2 be modified to deal with the -1 values?  since MD5 model viewer program display the model animation perfectly, Is this an easy fix for MD5reader2?


Consider that having more than one root bone is not a good rigging approach. If you need to have more then one indipendent bones you can parent them to a single root bone and move them in the root bone space. That is the same that happens to legs and first spine bone, that are alla parented to hips in a standard human rigging.

If I correctly analyzed the problem, the C and C++ MD5 Viewers work because they are engines made from scratch. No dependencies. Just OpenGL code. So the author coded them to make the world axis orientation matching the MD5 world axis orientation.
Furthermore, there is a remote possibility. I remember that somewhere in this board Renanse or Mojomonkey were talking about the possibility to setup differently jME applications (or jME camera?) axis orientation when system/game are initialized.
But, the right approach would be to modify der_ton's exporter (or make another one from scratch) that supports user custom axis conversions during export.

Moreover, there is a part of the MD5 Reader 2 that I have still not explored. It is animation part. In his MD5 specification rules, the author of the C, C++ viewers, explains that joints transformations of the skeleton bind pose (rest position saved in the joints section of all *.md5mesh file) are saved in object space, and are indipendent from each other. There is no need for more computations. So, I guess that each bone/joint is placed relatively to the model local space. In jME to have a local space it is needed to parent the bones/joints to a Node object (SkeletalModelInstance is a class extending Node). This means that I have to investigate how MD5 Reader 2 sets up this Node object.

There is also the possibility that MD5 Reader 2 converts each bone transformation to its parent bone local space. That means each bone is relative to its parent bone (or Node in the case of the root bone). This could be useful for interpolations, ragdoll and other uses where is needed to have a scene graph like bone hierarchy. But this last possibility, for me, is quite remote, considering the positive result of the last experiment and the fact that MD5 Reader 2 joints are not scene graph objects.

For me the bug you (and many others) experimented is caused only by the different axis system.