Author Topic: [resolved]some question about the format nijia.group.bones  (Read 14617 times)

Offline cefengxu

  • int
  • **
  • Posts: 65
    • View Profile
[resolved]some question about the format nijia.group.bones
« on: November 05, 2015, 08:53:09 am »
hi raft:

Question1:
  • [size=78%]what is the format of nijia.group.bones ?[/size]
  • [/size][size=78%]how to open it ?[/size]
  • [/size][size=78%]how to make the model and export to such file ?[/size]

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:
Code: [Select]
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




« Last Edit: November 09, 2015, 10:02:05 am by cefengxu »

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: some question about the format nijia.group.bones
« Reply #1 on: November 05, 2015, 09:57:01 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.

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.

Offline cefengxu

  • int
  • **
  • Posts: 65
    • View Profile
Re: some question about the format nijia.group.bones
« Reply #2 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
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>
     .......
« Last Edit: November 05, 2015, 10:58:52 am by cefengxu »

Offline cefengxu

  • int
  • **
  • Posts: 65
    • View Profile
Re: some question about the format nijia.group.bones
« Reply #3 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

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: some question about the format nijia.group.bones
« Reply #4 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

Offline cefengxu

  • int
  • **
  • Posts: 65
    • View Profile
Re: some question about the format nijia.group.bones
« Reply #5 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][/b]
« Last Edit: November 06, 2015, 09:55:24 am by cefengxu »

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: some question about the format nijia.group.bones
« Reply #6 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