Author Topic: ArrayIndexOutOfBoundsException when playing skin animation with combined objects  (Read 16433 times)

Offline kiffa

  • long
  • ***
  • Posts: 199
    • View Profile
1, maya2012, make a scene with 2 objects:
    a, a dog - with pose animation and skin animation.
    b, a  rock - none animation.

2, OgreMax exporter:
   a, only export the dog, everything is ok when running on the phone.
   b, use maya to combine dog and rock to 1 object, then export the conbined-object, then convert it to .bones, then run on the phone.
        b.1 play pose animation: ok
        b.2 play skin animation: error like this:

07-24 15:44:04.624: E/AndroidRuntime(7086): FATAL EXCEPTION: GLThread 10
07-24 15:44:04.624: E/AndroidRuntime(7086): java.lang.ArrayIndexOutOfBoundsException
07-24 15:44:04.624: E/AndroidRuntime(7086):    at raft.jpct.bones.Animated3D.applySkeletonPose(Animated3D.java:467)
07-24 15:44:04.624: E/AndroidRuntime(7086):    at raft.jpct.bones.AnimatedGroup.animateSkin(AnimatedGroup.java:178)
07-24 15:44:04.624: E/AndroidRuntime(7086):    at bones.samples.android.NinjaDemoActivity$MyRenderer.onDrawFrame(NinjaDemoActivity.java:599)
07-24 15:44:04.624: E/AndroidRuntime(7086):    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1363)
07-24 15:44:04.624: E/AndroidRuntime(7086):    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)


3,

Offline kiffa

  • long
  • ***
  • Posts: 199
    • View Profile
I compared dog.skeleton.xml and combined.skeleton.xml, they are just the same.

And i compared dog.mesh.xml and combined.mesh.xml ,  the combined.mesh.xml has more faces、vertexs. The vertexboneassignment-info seems strange in combined.mesh.xml:   threr are only 42 bones in skeleton.xml with index 0 - 41, but there is one extra bone with index 42 and all the rock-vertexs are assigned to it.  Like:

                               <vertexboneassignment vertexindex="4436" boneindex="42" weight="1" />
                               <vertexboneassignment vertexindex="4437" boneindex="42" weight="1" />


i will check my maya and exporter's option.

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
strange. please notify me about your progress

looking at the code, that exception happens if a vertex depends on a non-existing bone. and seems as that's the situation in your case.