Animation problems

Started by Gatobot14, September 15, 2015, 12:24:01 AM

Previous topic - Next topic

Gatobot14

Ive make an object with 6 keyframe animation , 4 of them run fine but with the remaining 2 i got this exception

java.lang.ArrayIndexOutOfBoundsException: 131
at com.threed.jpct.Animation.interpolateLinear(Animation.java:752)
at com.threed.jpct.Animation.doAnimation(Animation.java:379)
at com.threed.jpct.Object3D.animate(Object3D.java:1494)


it happens when i call for the first time "object.animate(index, id);" where index=0 and id its a valid animation retrieve by "id=object.getAnimationSequence().getSequence("win");"

i really dont have clue, all animations have only 3 frames.

this happens with the 3 and 5 animation.

EgonOlsen

Looks like as if the number of vertices in the keyframes don't match. You should get some log output about that. If that's the case, the reason might be that some vertices are collapsed by the importer. Try to use this to avoid this and see if it helps: http://www.jpct.net/doc/com/threed/jpct/Loader.html#setVertexOptimization(boolean)

Gatobot14

following a post from raft i use the method you suggest with false argument, in order to load the model, because i was having trouble from the loading and the log ouput you mention was showing,
but if you say its the vertices count i gues my model must have an error.

EgonOlsen

Scan you log output. If that causes the problem, it should be printed out somewhere.

EgonOlsen

BTW: To catch such problems earlier, it's a good idea to do a

Logger.setOnError(Logger.ON_ERROR_THROW_EXCEPTION);

early in your code. That's the default behaviour for jPCT-AE anyway. Desktop jPCT is more forgiving for compatibility reasons with older versions.

Gatobot14

alright i will use that, but it was a error on the model  ::) some missing vertex.....