Jointcontroller overrides jointrotations (and probaly translations as well)

i've got a problem with a few models. this one is a good example:

http://radix.hopto.org/Dorf.ms3d



if you try to load the model and set a breakpoint in the fillHoles-method of JointController, you'll see that there are 3 movementinfos. (doors closed, doors opened, doors closed again)

doors opened has 10 quaterions (there are 10 doors) containing 0,0.707,0,0.707 or something like that. after fillHoles is called, all quaterions are reset to 0,0,0,1.

does anyone know why? bug? hidden feature? magic?



i'm going to sleep now and hope that someone already fixed this oneā€¦

if not, i'll do it myself tomorrow and contribute the result. (this does NOT mean you shouldn't do it yourself if you know what's wrong ;))



(this jointcontroller really starts to creep me out. the amount of time i spent in this class is more than the sum of time spent in all other classes already)

i tried:

     int lastgood = start;
      boolean allGood = true;
      for (int i = start + 2; i < movementInfo.size(); i++) {
        if (movementInfo.get(i).jointRotation[joint] != null) {
          fillQuats(joint, lastgood, i); // fills gaps
          lastgood = i;
          allGood = false;
        }
      }
      if (!allGood && lastgood != movementInfo.size() - 1) { // fills tail
        movementInfo.get(movementInfo.size() - 1).jointRotation[joint] = new Quaternion(
           movementInfo.get(lastgood).jointRotation[joint]);
        fillQuats(joint, lastgood, movementInfo.size() - 1); // fills
        // tail
      }



if i delete this part, everything is fine. according to the comments, this code tries to interpolate quaternions that are not set/initialized/loaded/whatever.
according to my experience, it overrides fine data. anybody knows what this is supposed to do or how it should work?

only overriding null values *seems* to work perfectly fine for all of my models.