Animate rigged model according to given commands

Started by aeroxr1, June 05, 2014, 10:14:22 PM

Previous topic - Next topic

aeroxr1

The conversion is done. Now I try to put it in LoadBonesFormatSample :)

aeroxr1

#31
THANKS TO EVERYONE :)

Now it work  ;)
Skeleton is correctly loaded :)
I also have finded the errors that I did with blender -.-""" It's my fault and not exporter's fault  ::)
I had added the .bones file in wrong folder because eclipse had copied all the bones folder in its workspace  :-[
I'm very stupid .. sorry -.-"
I have an other question , my model has .tga texture. I try to import it by editing this following code lines :

Texture texture = new Texture("./samples/data/ninja/Vincent_new_UV.tga");
TextureManager.getInstance().addTexture("ninja", texture);

for (Animated3D o : skinnedGroup) {
o.setTexture("ninja");
o.build();
o.discardMeshData();
}


but it not works. There are some rules to set the texture ? dimension , extension ecc ecc ? :)

AGP

It will only open a format that Java opens. Export your texture as a PNG. That's the best format for it (and the file will be smaller, to boot).

aeroxr1


aeroxr1

Quote from: AGP on August 21, 2014, 07:03:29 PM
If you have no animations listed under "Object Settings>Mesh Animations" there won't be a skeleton (or there will, but it won't describe any animations) and Bones won't load your model.

Personally, I think that it should load any model with a .seleton.xml file, whether or not there are animations, so that you could animate your models programmatically...

Hi it's me again :)
I correctly exported the 3ds rigged model to bones format , but now I want to programmatically animate it.
Which bones's functions do I have to look at ?
Which are the steps that I have to follow ?
( I have to move the leg of the human model )

raft

have a look at ProceduralAnimationSample. it does something similar

aeroxr1

yes but in procedural example it imports collada model while I have model in bones format .
If I import the file .bones, the bones and joints are automattically imported ?
If I want to refer to determinated joint or bone what do I have to do ?


raft

either way they are converted into same java objects :)

you can find a joint by index (if you now) or by name (again if you now)

Skeleton.getJoint(int)
Skeleton.findJointByName(String)

aeroxr1

I use this function to load my models :
private AnimatedGroup loadNinja() throws Exception {
FileInputStream fis = new FileInputStream("./samples/data/ninja/vincent.group.bones");
try {
AnimatedGroup skinnedGroup = BonesIO.loadGroup(fis);

Texture texture = new Texture("./samples/data/ninja/Vincent_new_UV.png");
TextureManager.getInstance().addTexture("ninja", texture);

for (Animated3D o : skinnedGroup) {
o.setTexture("ninja");
o.build();
o.discardMeshData();
}
return skinnedGroup;
} finally {
fis.close();
}
}


After I have imported it, do I have to use this following functions to refer to index ?


SkeletonPose currentPose=animatedGroup.get(0).getSkeletonPose();
currentPose.getSkeleton().getJoint(index);

raft

yes, that's one way of accesing the skeleton. you can also access it by:

Animated3D.getSkeleton


aeroxr1

#41
Another question  ;D

Where I have to put the .bones file in an Android project ?

In the asset folder right ? :)

raft


aeroxr1

and you refer to it using R.raw.yourfile . Perfect :)

raft