www.jpct.net

Bones - Skeletal and Pose Animations for jPCT/jPCT-AE => Bones => Topic started by: cefengxu on November 05, 2015, 08:53:09 AM

Title: [resolved]some question about the format nijia.group.bones
Post by: cefengxu on November 05, 2015, 08:53:09 AM
hi raft:

Question1:

Question2:
i try to copy the cylinder.group.bone & stone.jpg from "Bones/res/raw/" to" Bones-Android-Ninjia/res/raw/"
but the error was outputed as follown:
11-05 15:31:03.730: E/AndroidRuntime(7988): FATAL EXCEPTION: GLThread 402
11-05 15:31:03.730: E/AndroidRuntime(7988): Process: com.airhockey.android, PID: 7988
11-05 15:31:03.730: E/AndroidRuntime(7988): java.lang.RuntimeException: java.io.IOException: Version mismatch. Current version: 4, stream version: 2
11-05 15:31:03.730: E/AndroidRuntime(7988):    at com.airhockey.android.AirHockeyRenderer.onSurfaceCreated(AirHockeyRenderer.java:126)
11-05 15:31:03.730: E/AndroidRuntime(7988):    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1500)
11-05 15:31:03.730: E/AndroidRuntime(7988):    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1239)
11-05 15:31:03.730: E/AndroidRuntime(7988): Caused by: java.io.IOException: Version mismatch. Current version: 4, stream version: 2
11-05 15:31:03.730: E/AndroidRuntime(7988):    at raft.jpct.bones.BonesIO.readHeader(BonesIO.java:104)
11-05 15:31:03.730: E/AndroidRuntime(7988):    at raft.jpct.bones.BonesIO.loadGroup(BonesIO.java:85)
11-05 15:31:03.730: E/AndroidRuntime(7988):    at com.airhockey.android.AirHockeyRenderer.onSurfaceCreated(AirHockeyRenderer.java:120)
11-05 15:31:03.730: E/AndroidRuntime(7988):    ... 2 more





Title: Re: some question about the format nijia.group.bones
Post by: raft on November 05, 2015, 09:57:01 AM
it's Bones' binary format which is based on Java serialization.
BonesIO.loadGroup (http://aptalkarga.com/bones/api/raft/jpct/bones/BonesIO.html#loadGroup(java.io.InputStream)) is the way to load it. see LoadBonesFormatSample.
you can programmatically save to Bones format with BonesIO or use the scripts in scripts folder which behind the scenes use BonesIO class.

the exception you saw is caused by a version mismatch as it says. that is, files in Bones format should be written and read with the same version of BonesIO. just replace bones.jar in the ninja demo with a recent one and it will be ok.
Title: Re: some question about the format nijia.group.bones
Post by: cefengxu on November 05, 2015, 10:40:34 AM
it's Bones' binary format which is based on Java serialization.
BonesIO.loadGroup is the way to load it. see LoadBonesFormatSample.you can programmatically save to Bones format with BonesIO or use the scripts in scripts folder which behind the scenes use BonesIO class

How does it work?

1- i follow the step from http://www.jpct.net/wiki/index.php?title=Exporting_from_Blender_to_Bones (http://www.jpct.net/wiki/index.php?title=Exporting_from_Blender_to_Bones)
2- four different file was exported:
    blender2ogre-export.scene
    cube.mesh.xml
    cube.scene   
    Material.material
3- Pass all of them into the Bones/scripts/
4- and then i use the command:
     jmeOgre2Bones -out cube.bones -in cube.mesh.xml
     and the error output:
     Exception in thread "main" java.lang.NoClassDefFoundError: com/jmex/model/orgrexml/OgreLoader
     at raft.jpct.bones.util.JMEOgreImporter.loadGroup<JMEOgreImporter.java:109>
     .......
Title: Re: some question about the format nijia.group.bones
Post by: cefengxu on November 05, 2015, 10:42:51 AM
just replace bones.jar in the ninja demo with a recent one and it will be ok.

which one ? where i can download it ?? i have down load the lastest version from the webpage
Title: Re: some question about the format nijia.group.bones
Post by: raft on November 05, 2015, 06:57:21 PM
for NoClassDefFoundError, do you have jmeXX jars in your Bones/lib folder?

for recent jar, just copy Bones/build/bones.jar to Android project
Title: Re: some question about the format nijia.group.bones
Post by: cefengxu on November 06, 2015, 04:32:49 AM
thanks for your support raft.
the step to expo as follow :
0 - to keep the bones is the newest ~!
1-  to copy the ninja.mesh.xml  ninja.skeleton.xml   into Bones\scripts\
2-  input command : jmeOgre2Bones -out ninja.bones -in ninja.mesh.xml
3- and then ,the file named ninja.bones was output;


Question: however, why the file could be name  [size=78%]ninja.bones or ninja.group.bones ? what's different between them ?[/size]
Title: Re: some question about the format nijia.group.bones
Post by: raft on November 06, 2015, 11:04:39 AM
actually you dont need to copy mesh and skeleton files to Bones/scripts folder. scripts can be run from any folder (unless they are not broken) and can operate on xml files in any folder.

for file name, there is no difference. you can given any name to bones binary files. it seemed suitable for me to name them xx.group.bones