Author Topic: Animate rigged model according to given commands  (Read 10310 times)

Offline aeroxr1

  • int
  • **
  • Posts: 82
    • View Profile
Re: Animate rigged model according to given commands
« Reply #30 on: August 21, 2014, 07:32:52 pm »
The conversion is done. Now I try to put it in LoadBonesFormatSample :)

Offline aeroxr1

  • int
  • **
  • Posts: 82
    • View Profile
Re: Animate rigged model according to given commands
« Reply #31 on: August 21, 2014, 07:51:19 pm »
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 :

Code: [Select]
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 ? :)
« Last Edit: August 21, 2014, 07:56:20 pm by aeroxr1 »

Offline AGP

  • quad
  • ******
  • Posts: 1525
    • View Profile
Re: Animate rigged model according to given commands
« Reply #32 on: August 21, 2014, 08:00:14 pm »
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).

Offline aeroxr1

  • int
  • **
  • Posts: 82
    • View Profile
Re: Animate rigged model according to given commands
« Reply #33 on: August 21, 2014, 08:07:18 pm »
THANKS !!!!

it works !!!!!!!!  ;D

Offline aeroxr1

  • int
  • **
  • Posts: 82
    • View Profile
Re: Animate rigged model according to given commands
« Reply #34 on: September 02, 2014, 03:49:58 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 )

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1971
    • View Profile
    • http://www.aptalkarga.com
Re: Animate rigged model according to given commands
« Reply #35 on: September 02, 2014, 03:55:20 pm »
have a look at ProceduralAnimationSample. it does something similar

Offline aeroxr1

  • int
  • **
  • Posts: 82
    • View Profile
Re: Animate rigged model according to given commands
« Reply #36 on: September 02, 2014, 04:12:29 pm »
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 ?


Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1971
    • View Profile
    • http://www.aptalkarga.com
Re: Animate rigged model according to given commands
« Reply #37 on: September 02, 2014, 04:21:03 pm »
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)

Code: [Select]
Skeleton.getJoint(int)
Skeleton.findJointByName(String)

Offline aeroxr1

  • int
  • **
  • Posts: 82
    • View Profile
Re: Animate rigged model according to given commands
« Reply #38 on: September 02, 2014, 04:47:32 pm »
I use this function to load my models :
Code: [Select]
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 ?

Code: [Select]
SkeletonPose currentPose=animatedGroup.get(0).getSkeletonPose();
currentPose.getSkeleton().getJoint(index);

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1971
    • View Profile
    • http://www.aptalkarga.com
Re: Animate rigged model according to given commands
« Reply #39 on: September 02, 2014, 04:53:19 pm »
yes, that's one way of accesing the skeleton. you can also access it by:

Code: [Select]
Animated3D.getSkeleton

Offline aeroxr1

  • int
  • **
  • Posts: 82
    • View Profile
Re: Animate rigged model according to given commands
« Reply #40 on: September 02, 2014, 06:35:15 pm »
thanks :D

Offline aeroxr1

  • int
  • **
  • Posts: 82
    • View Profile
Re: Animate rigged model according to given commands
« Reply #41 on: September 03, 2014, 02:56:33 pm »
Another question  ;D

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

In the asset folder right ? :)
« Last Edit: September 03, 2014, 03:00:54 pm by aeroxr1 »

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1971
    • View Profile
    • http://www.aptalkarga.com
Re: Animate rigged model according to given commands
« Reply #42 on: September 03, 2014, 03:08:10 pm »
i prefer putting them into /res/raw folder

Offline aeroxr1

  • int
  • **
  • Posts: 82
    • View Profile
Re: Animate rigged model according to given commands
« Reply #43 on: September 03, 2014, 03:23:26 pm »
and you refer to it using R.raw.yourfile . Perfect :)

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1971
    • View Profile
    • http://www.aptalkarga.com
Re: Animate rigged model according to given commands
« Reply #44 on: September 03, 2014, 03:24:38 pm »
yes, right :)