About Bone for android

Started by Log, August 15, 2014, 05:56:21 AM

Previous topic - Next topic

Log

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? ???

raft

what error do you get?

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

Log

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!!

raft

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

../../../scripts/ardorCollada2Bones.bat -out seymour.group.bones -rotation x180 -in Seymour.dae

Log

#4
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!!

raft

it's possibly because of the spaces in the path (Documents and Settings). try changing the second line in ardorCollada2Bones.bat to

set DIR="%~dp0\.."

if that does not work, try copying Bones to a folder where there is no space in path

Log

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??





raft

correct. data for FacialAnimationSample is in Ogre3D format so you should use jmeOgre2Bones to convert it.