www.jpct.net

Bones - Skeletal and Pose Animations for jPCT/jPCT-AE => Bones => Topic started by: Log on August 15, 2014, 05:56:21 am

Title: About Bone for android
Post by: Log 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? ???
Title: Re: About Bone for android
Post by: raft 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.
Title: Re: About Bone for android
Post by: Log 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!!
Title: Re: About Bone for android
Post by: raft 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
Title: Re: About Bones for android
Post by: Log 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!!
Title: Re: About Bone for android
Post by: raft 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
Title: Re: About Bone for android
Post by: Log 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??




Title: Re: About Bone for android
Post by: raft on August 18, 2014, 09:01:52 am
correct. data for FacialAnimationSample is in Ogre3D format so you should use jmeOgre2Bones to convert it.