Author Topic: About Bone for android  (Read 16300 times)

Offline Log

  • byte
  • *
  • Posts: 4
    • View Profile
About Bone for android
« on: August 15, 2014, 05:56:21 am »
Hi Sir,
I downloaded the Bones and Bones-Android-Ninja projects. It worked well in android phone. Now, I want to load other model like seymour (.\Bones\samples\data\seymour\seymour.group.bones) and replace the ninja.bones file with seymour.bones.In addition, I modified code in NinjaDemoActivity.java & CollisionTestActivity.java.

masterNinja = BonesIO.loadGroup(res.openRawResource(R.raw.seymour));
Texture texture = new Texture(res.openRawResource(R.raw.seymour_texture));

But it does not work.
is there anything else I miss? ???
« Last Edit: August 15, 2014, 07:13:56 am by Log »

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: About Bone for android
« Reply #1 on: August 15, 2014, 08:39:17 am »
what error do you get?

you need to convert seymour from collada format to native Bones format with the scripts provided in scripts folder.

Offline Log

  • byte
  • *
  • Posts: 4
    • View Profile
Re: About Bone for android
« Reply #2 on: August 15, 2014, 10:05:39 am »
Hi Sir,
You mean (.\Bones\samples\data\seymour\seymour.group.bones) is not native Bones format??
Could you please teach me how to convert seymour from collada format to native Bones format?

When I loaded Group, I found an error in BonesIO.java.

masterNinja = BonesIO.loadGroup(res.openRawResource(R.raw.seymour));

private static void readHeader(java.io.ObjectInputStream in, String requiredHeader) throws IOException {
      String header = in.readUTF();
      if (!requiredHeader.equals(header))
         throw new IOException("Invalid header: " + header);
      short version = in.readShort();
                   -->  if (VERSION != version)
         throw new IOException("Version mismatch. Current version: " + VERSION + ", stream version: " + version);
   }

I am not sure if the error is caused by wrong format(collada format not native Bones format ).
Thanks!!

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: About Bone for android
« Reply #3 on: August 15, 2014, 10:14:28 am »
yes, it's Bones' native format. i thougt you were using the collada file. the bones file you have is converted with an older version of Bones. you need to convert it again. assuming you are using Windows use the following command in seymour directory

Code: [Select]
../../../scripts/ardorCollada2Bones.bat -out seymour.group.bones -rotation x180 -in Seymour.dae

Offline Log

  • byte
  • *
  • Posts: 4
    • View Profile
Re: About Bones for android
« Reply #4 on: August 15, 2014, 11:05:52 am »
Hi Sir,
I was following your command, but I got an error message.
C:\Documents and Settings\myname\desktop\Bones\scripts\ardorCollada2Bones.bat -out seymour.group.bones -rotation x180 -in Seymour.dae

-->echo off
-->Error:Could not find or load main class

Could you please tell me where can I got correct native Bones except for ninja? :)

Thanks!!
« Last Edit: August 15, 2014, 11:09:37 am by Log »

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: About Bone for android
« Reply #5 on: August 15, 2014, 12:59:27 pm »
it's possibly because of the spaces in the path (Documents and Settings). try changing the second line in ardorCollada2Bones.bat to

Code: [Select]
set DIR="%~dp0\.."
if that does not work, try copying Bones to a folder where there is no space in path

Offline Log

  • byte
  • *
  • Posts: 4
    • View Profile
Re: About Bone for android
« Reply #6 on: August 18, 2014, 03:37:22 am »
Hi Sir,
You are right. The error is caused by the spaces in the path (Documents and Settings).
I got a new version of bones and it worked in android phone. Thanks for your help!! :D

One more question, if I want to use facial.group.bones(..\samples\data\facial\), I must use jmeOgre2Bones.bat to convert facial.mesh.xml to Bones format. Is it correct or not??





Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: About Bone for android
« Reply #7 on: August 18, 2014, 09:01:52 am »
correct. data for FacialAnimationSample is in Ogre3D format so you should use jmeOgre2Bones to convert it.