KeyNotFoundException

Topics: User Forum
Mar 29, 2007 at 7:01 PM
With my model I created, I always get an 'Unhandled KeyNotFoundException' at this line:

animator = new ModelAnimator(this, model);

The dwarf demo worked fine but I'm having trouble with my own model.
Coordinator
Mar 29, 2007 at 10:13 PM
Right now, if the model has too many bones for the hardware, it will throw this unfortunately uninformative exception. The palette size limit is 56 bones.

There could also be other causes if you used an XML file to split the animation or have multiple animations of the same name. I'll be sure to have better error messages in the next release.
Mar 30, 2007 at 7:33 AM
I have only three bones, no xml file. Here's the animation code in th .x file:

AnimationSet AnimationSet0 {
Animation FireAnimation {
{ IK_Button }
AnimationKey {
4;
4;
12;16;0.958200,-0.286000,0.000000,0.000000,0.286000,0.958200,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,2.561100,1.445600,0.000000,1.000000;;,
17;16;0.958200,-0.286000,0.000000,0.000000,0.286000,0.958200,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,2.902600,1.322300,0.000000,1.000000;;,
20;16;0.958200,-0.286000,0.000000,0.000000,0.286000,0.958200,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,2.276500,1.464600,0.000000,1.000000;;,
22;16;0.958200,-0.286000,0.000000,0.000000,0.286000,0.958200,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,2.561100,1.445600,0.000000,1.000000;;;
}
}

Animation ReloadAnimation {
{ IK_Trigger }
AnimationKey {
4;
3;
1;16;-0.925600,0.378400,0.000000,0.000000,-0.378400,-0.925600,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,1.513900,-0.830900,0.000000,1.000000;;,
6;16;-0.884900,-0.465800,0.000000,0.000000,0.465800,-0.884900,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,1.513900,-0.830900,0.000000,1.000000;;,
11;16;-0.925600,0.378400,0.000000,0.000000,-0.378400,-0.925600,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,1.513900,-0.830900,0.000000,1.000000;;;
}
}

} // End of Animation Set
Coordinator
Mar 30, 2007 at 8:10 AM
Would you mind sending me the model then (david_astle@hotmail.com)? I'll use the debugger and let you know what's going and and see if I can fix it.
Mar 30, 2007 at 9:34 AM
Never mind. I fixed the problem. It was because of multiple root bones for which the exporter didn't create FrameTransformMatrices. I use Blender. I already downloaded the fix the other guy posted, but it didn't work because it just eleminates the root bones -.-
I fixed the exporter :D
Coordinator
Mar 30, 2007 at 11:52 PM
Ah, thanks for letting me know. Glad you fixed it.