[ resolved]error output when loading the xxxx.bones via Bones

Started by cefengxu, November 11, 2015, 10:49:35 AM

Previous topic - Next topic

cefengxu

hi raft :
now i uses the blender to make a model with animation and export to body.skeleton.xml and body.mesh.xml.

body.skeleton.xml just including only one animation :
<animations >
<animation name="my_animation" length="1.0833333333333333" >

      <tracks >

        <track bone="root" >

          <keyframes >

            <keyframe time="0.0" >

              <translate z="0.000000" x="0.000000" y="0.000000" />
      ......
      ...
      .
</animation>
</animations >


and then transfer to body.bones via cmd and load it via Bones , as the code shown belown.

   animation =  1;
     
   if (animation > 0 && masterNinja.getSkinClipSequence().getSize() >= animation) {
      float clipTime = masterNinja.getSkinClipSequence().getClip(animation-1).getTime();
      if (animateSeconds > clipTime) {
         animateSeconds = 0;
      }
      float index = animateSeconds / clipTime;
      if (false) {
         for (AnimatedGroup group : ninjas) {
            for (Animated3D a : group)
               a.animate(index, animation);
         }
      } else {
         for (AnimatedGroup group : ninjas) {
            group.animateSkin(index, animation);

         }
      }
         
   } else {
      animateSeconds = 0f;
   }


however, when i loading  such model and the demo crash and the error output:

11-11 17:41:20.559: E/AndroidRuntime(12906): FATAL EXCEPTION: GLThread 727
11-11 17:41:20.559: E/AndroidRuntime(12906): Process: com.airhockey.android, PID: 12906
11-11 17:41:20.559: E/AndroidRuntime(12906): java.lang.ArrayIndexOutOfBoundsException: length=333; index=-1
11-11 17:41:20.559: E/AndroidRuntime(12906): at raft.jpct.bones.Animated3D.applySkeletonPose(Animated3D.java:511)
11-11 17:41:20.559: E/AndroidRuntime(12906): at raft.jpct.bones.AnimatedGroup.animateSkin(AnimatedGroup.java:178)
11-11 17:41:20.559: E/AndroidRuntime(12906): at com.airhockey.android.AirHockeyRenderer.onDrawFrame(AirHockeyRenderer.java:209)
11-11 17:41:20.559: E/AndroidRuntime(12906): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1522)
11-11 17:41:20.559: E/AndroidRuntime(12906): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1239)

cefengxu

the log with more details was shown below:

11-11 18:26:31.059: D/wangcy9-font(18758): default_File_font_path/system/fonts/LenovoFont.ttf
11-11 18:26:31.059: D/wangcy9-font(18758): curfontpath=/system/fonts/LenovoFont.ttf
11-11 18:26:31.059: D/wangcy9-font(18758): default_File_font_path/system/fonts/LenovoFont.ttf
11-11 18:26:31.059: D/wangcy9-font(18758): curfontpath=/system/fonts/LenovoFont.ttf
11-11 18:26:31.059: D/wangcy9-font(18758): default_File_font_path/system/fonts/LenovoFont.ttf
11-11 18:26:31.059: D/wangcy9-font(18758): curfontpath=/system/fonts/LenovoFont.ttf
11-11 18:26:31.089: I/Configuration(18758): Configuration getConfigurationFromSysProp name= persist.sys.font_scale value=
11-11 18:26:31.089: I/Configuration(18758): Configuration getConfigurationFromSysProp name= persist.sys.font_scale value=
11-11 18:26:31.219: D/OpenGLRenderer(18758): Render dirty regions requested: true
11-11 18:26:31.229: D/Atlas(18758): Validating map...
11-11 18:26:30.629: I/art(18758): Late-enabling -Xcheck:jni
11-11 18:26:30.699: V/appproc(18758): App process: starting thread pool.
11-11 18:26:30.759: I/Configuration(18758): Configuration getConfigurationFromSysProp name= persist.sys.font_scale value=
11-11 18:26:30.759: I/Configuration(18758): Configuration getConfigurationFromSysProp name= persist.sys.font_scale value=
11-11 18:26:30.759: E/Parcel(18758): Reading a NULL string not supported here.
11-11 18:26:30.909: I/Configuration(18758): Configuration getConfigurationFromSysProp name= persist.sys.font_scale value=
11-11 18:26:30.909: I/Configuration(18758): Configuration getConfigurationFromSysProp name= persist.sys.font_scale value=
11-11 18:26:30.909: I/Configuration(18758): Configuration getConfigurationFromSysProp name= persist.sys.font_scale value=
11-11 18:26:30.909: I/Configuration(18758): Configuration getConfigurationFromSysProp name= persist.sys.font_scale value=
11-11 18:26:30.939: I/Configuration(18758): Configuration getConfigurationFromSysProp name= persist.sys.font_scale value=
11-11 18:26:30.949: I/Configuration(18758): Configuration getConfigurationFromSysProp name= persist.sys.font_scale value=
11-11 18:26:30.969: I/Configuration(18758): Configuration getConfigurationFromSysProp name= persist.sys.font_scale value=
11-11 18:26:30.989: D/wangcy9(18758): setStatusIcon occur wrong theme!
11-11 18:26:31.049: D/wangcy9-font(18758): default_File_font_path/system/fonts/LenovoFont.ttf
11-11 18:26:31.049: D/wangcy9-font(18758): curfontpath=/system/fonts/LenovoFont.ttf
11-11 18:26:31.509: D/ViewRootImpl(18758): loadSystemProperties PersistDebugEvent: false RoDebugEvent: false
11-11 18:26:31.509: D/FontThemeManager(18758): FontThemeManager createThemeFont typefacetype=2, curfontpath=/system/fonts/LenovoFont.ttf
11-11 18:26:31.509: D/FontThemeManager(18758): FontThemeManager createThemeFont typefacetype=2, curfontpath=/system/fonts/LenovoFont.ttf
11-11 18:26:31.539: I/Adreno-EGL(18758): <qeglDrvAPI_eglInitialize:379>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LA.BR.1.1.2_RB1.05.00.02.031.021_msm8916_64_LA.BR.1.1.2_RB1__release_AU ()
11-11 18:26:31.539: I/Adreno-EGL(18758): OpenGL ES Shader Compiler Version: E031.25.03.02
11-11 18:26:31.539: I/Adreno-EGL(18758): Build Date: 03/12/15 Thu
11-11 18:26:31.539: I/Adreno-EGL(18758): Local Branch: mybranch8269035
11-11 18:26:31.539: I/Adreno-EGL(18758): Remote Branch: quic/LA.BR.1.1.2_rb1.13
11-11 18:26:31.539: I/Adreno-EGL(18758): Local Patches: NONE
11-11 18:26:31.539: I/Adreno-EGL(18758): Reconstruct Branch: AU_LINUX_ANDROID_LA.BR.1.1.2_RB1.05.00.02.031.021 +  NOTHING
11-11 18:26:31.539: I/OpenGLRenderer(18758): Initialized EGL, version 1.4
11-11 18:26:31.549: D/OpenGLRenderer(18758): Enabling debug mode 0
11-11 18:26:31.559: I/qdutils(18758): PartialUpdate status: Disabled
11-11 18:26:31.559: I/qdutils(18758): Left Align: 0
11-11 18:26:31.559: I/qdutils(18758): Width Align: 0
11-11 18:26:31.559: I/qdutils(18758): Top Align: 0
11-11 18:26:31.559: I/qdutils(18758): Height Align: 0
11-11 18:26:31.559: I/qdutils(18758): Min ROI Width: 0
11-11 18:26:31.559: I/qdutils(18758): Min ROI Height: 0
11-11 18:26:31.559: I/qdutils(18758): Needs ROI Merge: 0
11-11 18:26:31.559: I/qdutils(18758): Dynamic Fps: Disabled
11-11 18:26:31.559: I/qdutils(18758): Min Panel fps: 0
11-11 18:26:31.559: I/qdutils(18758): Max Panel fps: 0
11-11 18:26:31.619: I/jPCT-AE(18758): Wrapping input stream in a BufferedInputStream
11-11 18:26:31.779: I/Timeline(18758): Timeline: Activity_idle id: android.os.BinderProxy@3fa34959 time:28879873
11-11 18:26:34.059: I/jPCT-AE(18758): Normal vectors calculated in 166ms!
11-11 18:26:39.769: I/jPCT-AE(18758): Normal vectors calculated in 141ms!
11-11 18:26:39.779: I/jPCT-AE(18758): added new ninja: 1
11-11 18:26:39.779: I/jPCT-AE(18758): Adding Lightsource: 0
11-11 18:26:39.779: I/jPCT-AE(18758): Loading Texture...
11-11 18:26:39.799: I/jPCT-AE(18758): Texture loaded...1048576 bytes/512*512 pixels!
11-11 18:26:39.809: I/jPCT-AE(18758): GL context is 134640347
11-11 18:26:39.819: I/jPCT-AE(18758): Initializing GL20 render pipeline...
11-11 18:26:39.819: I/jPCT-AE(18758): Accessing shaders via JAR!
11-11 18:26:39.819: I/jPCT-AE(18758): Loading default shaders !
11-11 18:26:39.819: I/jPCT-AE(18758): 0 shaders in replacement map!
11-11 18:26:39.819: I/jPCT-AE(18758): Default fragment shader is: /defaultFragmentShader.src
11-11 18:26:40.009: I/jPCT-AE(18758): Loading file from InputStream
11-11 18:26:40.009: I/jPCT-AE(18758): Text file from InputStream loaded...2416 bytes
11-11 18:26:40.009: I/jPCT-AE(18758): Default vertex shader is: /defaultVertexShader.src
11-11 18:26:40.019: I/jPCT-AE(18758): Loading file from InputStream
11-11 18:26:40.019: I/jPCT-AE(18758): Text file from InputStream loaded...4496 bytes
11-11 18:26:40.019: I/jPCT-AE(18758): Compiling shader program!
11-11 18:26:40.039: I/jPCT-AE(18758): Handles of 3: 2/36/1
11-11 18:26:40.039: I/jPCT-AE(18758): Loading default shaders (Tex0Amb)!
11-11 18:26:40.039: I/jPCT-AE(18758): 0 shaders in replacement map!
11-11 18:26:40.039: I/jPCT-AE(18758): Default fragment shader is: /defaultFragmentShader.src
11-11 18:26:40.049: I/jPCT-AE(18758): Loading file from InputStream
11-11 18:26:40.049: I/jPCT-AE(18758): Text file from InputStream loaded...199 bytes
11-11 18:26:40.049: I/jPCT-AE(18758): Default vertex shader is: /defaultVertexShader.src
11-11 18:26:40.049: I/jPCT-AE(18758): Loading file from InputStream
11-11 18:26:40.049: I/jPCT-AE(18758): Text file from InputStream loaded...757 bytes
11-11 18:26:40.049: I/jPCT-AE(18758): Compiling shader program!
11-11 18:26:40.059: I/jPCT-AE(18758): Handles of 6: 2/3/1
11-11 18:26:40.059: I/jPCT-AE(18758): Loading default shaders (Tex0)!
11-11 18:26:40.059: I/jPCT-AE(18758): 0 shaders in replacement map!
11-11 18:26:40.059: I/jPCT-AE(18758): Default fragment shader is: /defaultFragmentShader.src
11-11 18:26:40.079: I/jPCT-AE(18758): Loading file from InputStream
11-11 18:26:40.079: I/jPCT-AE(18758): Text file from InputStream loaded...201 bytes
11-11 18:26:40.079: I/jPCT-AE(18758): Default vertex shader is: /defaultVertexShader.src
11-11 18:26:40.079: I/jPCT-AE(18758): Loading file from InputStream
11-11 18:26:40.079: I/jPCT-AE(18758): Text file from InputStream loaded...4020 bytes
11-11 18:26:40.079: I/jPCT-AE(18758): Compiling shader program!
11-11 18:26:40.089: I/jPCT-AE(18758): Handles of 9: 2/29/1
11-11 18:26:40.089: I/jPCT-AE(18758): Loading default shaders (Tex1)!
11-11 18:26:40.089: I/jPCT-AE(18758): 0 shaders in replacement map!
11-11 18:26:40.089: I/jPCT-AE(18758): Default fragment shader is: /defaultFragmentShader.src
11-11 18:26:40.099: I/jPCT-AE(18758): Loading file from InputStream
11-11 18:26:40.099: I/jPCT-AE(18758): Text file from InputStream loaded...997 bytes
11-11 18:26:40.099: I/jPCT-AE(18758): Default vertex shader is: /defaultVertexShader.src
11-11 18:26:40.099: I/jPCT-AE(18758): Loading file from InputStream
11-11 18:26:40.109: I/jPCT-AE(18758): Text file from InputStream loaded...4390 bytes
11-11 18:26:40.109: I/jPCT-AE(18758): Compiling shader program!
11-11 18:26:40.119: I/jPCT-AE(18758): Handles of 12: 2/34/1
11-11 18:26:40.119: I/jPCT-AE(18758): Loading default shaders (Tex0Light0)!
11-11 18:26:40.119: I/jPCT-AE(18758): 0 shaders in replacement map!
11-11 18:26:40.119: I/jPCT-AE(18758): Default fragment shader is: /defaultFragmentShader.src
11-11 18:26:40.119: I/jPCT-AE(18758): Loading file from InputStream
11-11 18:26:40.119: I/jPCT-AE(18758): Text file from InputStream loaded...201 bytes
11-11 18:26:40.119: I/jPCT-AE(18758): Default vertex shader is: /defaultVertexShader.src
11-11 18:26:40.129: I/jPCT-AE(18758): Loading file from InputStream
11-11 18:26:40.129: I/jPCT-AE(18758): Text file from InputStream loaded...1293 bytes
11-11 18:26:40.129: I/jPCT-AE(18758): Compiling shader program!
11-11 18:26:40.129: I/jPCT-AE(18758): Handles of 15: 2/7/1
11-11 18:26:40.129: I/jPCT-AE(18758): Loading default shaders (Fog)!
11-11 18:26:40.129: I/jPCT-AE(18758): 0 shaders in replacement map!
11-11 18:26:40.129: I/jPCT-AE(18758): Default fragment shader is: /defaultFragmentShader.src
11-11 18:26:40.139: I/jPCT-AE(18758): Loading file from InputStream
11-11 18:26:40.139: I/jPCT-AE(18758): Text file from InputStream loaded...328 bytes
11-11 18:26:40.139: I/jPCT-AE(18758): Default vertex shader is: /defaultVertexShader.src
11-11 18:26:40.149: I/jPCT-AE(18758): Loading file from InputStream
11-11 18:26:40.149: I/jPCT-AE(18758): Text file from InputStream loaded...4267 bytes
11-11 18:26:40.149: I/jPCT-AE(18758): Compiling shader program!
11-11 18:26:40.159: I/jPCT-AE(18758): Handles of 18: 2/32/1
11-11 18:26:40.159: I/jPCT-AE(18758): Loading default shaders (FogLight0)!
11-11 18:26:40.159: I/jPCT-AE(18758): 0 shaders in replacement map!
11-11 18:26:40.159: I/jPCT-AE(18758): Default fragment shader is: /defaultFragmentShader.src
11-11 18:26:40.159: I/jPCT-AE(18758): Loading file from InputStream
11-11 18:26:40.159: I/jPCT-AE(18758): Text file from InputStream loaded...328 bytes
11-11 18:26:40.159: I/jPCT-AE(18758): Default vertex shader is: /defaultVertexShader.src
11-11 18:26:40.169: I/jPCT-AE(18758): Loading file from InputStream
11-11 18:26:40.169: I/jPCT-AE(18758): Text file from InputStream loaded...1608 bytes
11-11 18:26:40.169: I/jPCT-AE(18758): Compiling shader program!
11-11 18:26:40.169: I/jPCT-AE(18758): Handles of 21: 2/10/1
11-11 18:26:40.179: I/jPCT-AE(18758): Loading default shaders (Depth)!
11-11 18:26:40.179: I/jPCT-AE(18758): 0 shaders in replacement map!
11-11 18:26:40.179: I/jPCT-AE(18758): Default fragment shader is: /defaultFragmentShader.src
11-11 18:26:40.179: I/jPCT-AE(18758): Loading file from InputStream
11-11 18:26:40.179: I/jPCT-AE(18758): Text file from InputStream loaded...745 bytes
11-11 18:26:40.179: I/jPCT-AE(18758): Default vertex shader is: /defaultVertexShader.src
11-11 18:26:40.189: I/jPCT-AE(18758): Loading file from InputStream
11-11 18:26:40.189: I/jPCT-AE(18758): Text file from InputStream loaded...248 bytes
11-11 18:26:40.189: I/jPCT-AE(18758): Compiling shader program!
11-11 18:26:40.189: I/jPCT-AE(18758): Handles of 24: 0/0/-1
11-11 18:26:40.189: I/jPCT-AE(18758): GL20 render pipeline initialized!
11-11 18:26:40.199: I/jPCT-AE(18758): OpenGL vendor:     Qualcomm
11-11 18:26:40.199: I/jPCT-AE(18758): OpenGL renderer:   Adreno (TM) 405
11-11 18:26:40.199: I/jPCT-AE(18758): OpenGL version:    OpenGL ES 3.0 V@100.0 AU@05.00.02.031.021 (GIT@)
11-11 18:26:40.199: I/jPCT-AE(18758): OpenGL renderer initialized (using 2/16 texture stages)
11-11 18:26:40.239: E/AndroidRuntime(18758): FATAL EXCEPTION: GLThread 742
11-11 18:26:40.239: E/AndroidRuntime(18758): Process: com.airhockey.android, PID: 18758
11-11 18:26:40.239: E/AndroidRuntime(18758): java.lang.ArrayIndexOutOfBoundsException: length=333; index=-1
11-11 18:26:40.239: E/AndroidRuntime(18758):    at raft.jpct.bones.Animated3D.applySkeletonPose(Animated3D.java:511)
11-11 18:26:40.239: E/AndroidRuntime(18758):    at raft.jpct.bones.AnimatedGroup.animateSkin(AnimatedGroup.java:178)
11-11 18:26:40.239: E/AndroidRuntime(18758):    at com.airhockey.android.AirHockeyRenderer.onDrawFrame(AirHockeyRenderer.java:209)
11-11 18:26:40.239: E/AndroidRuntime(18758):    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1522)
11-11 18:26:40.239: E/AndroidRuntime(18758):    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1239)

raft

how can that be possible??

this is the line 511, where exception is thrown:
            SimpleVector sourceMesh_i = sourceMesh[i];


inside this loop:
        for (int i = 0; i < count; i++) {

cefengxu

so , how to deal with this issue??
can you explain it  more clearly ? thanks ~ :)

raft

sorry my bad, the error is actually in another line, my copy is a bit different than yours.

interesting, never seen this before. I've sent a pm including my email, can you please send your mesh.xml and skeleton.xml to my email, let me have a check.

meanwhile you can check blender exporter options, maybe there is an option like 'use -1 for unused joint indices'? if you find sth similar to that, please uncheck it and retry



cefengxu


raft

nevermind, I've found the reason of this error. some idiot in jME assumed number of bones will never exceed 254 so he/she casts bone index to byte! >:( :o ???

it will take some time for me to fix this, meanwhile you can use a skeleton with 254 or less bones. btw, I've never seen a skeleton with this many (333) bones, do you really need that much?

edit: actually 255, including 0

cefengxu

thanks for your support.
on the other hand, i try to use the 3ds to create the animated model and export via ogreMax through lots of parameter setting.
and then, the Bones can rendering it.

may be i will writing a tutorial about  "animated model rendering pipeline for JPCT-Bones" (including cut pic)   , and shell for every body. i think it will be useful~

BTW, i got the answer why the model always lie down on the mark : have to set the direction of camera( Y or Z ) before export the model in 3ds Max;




raft


EgonOlsen


cefengxu

cool , i have send a draft to raft by email.

if the draft ok , i will public it to internet.   

a wiki account should be better.  thanks EgonOlsen.

EgonOlsen

Quote from: cefengxu on November 16, 2015, 07:22:35 AM
a wiki account should be better.  thanks EgonOlsen.
You should have received an email with the account data.

raft

Quote from: cefengxu on November 16, 2015, 07:22:35 AM
cool , i have send a draft to raft by email.

if the draft ok , i will public it to internet.   
there are some typos but that doesnt matter that much I believe. go for it. I appreciate your efforts :)