Artwork > Finished Works and Works in Progress

Anim8or Meshes put through Their Paces With BVH

<< < (8/11) > >>

hihosilver:
Haha a conehead!?  I sure hope not...  might get in the way of my everyday activities.  Not to mention good look ;)
Francesco, that sounds great!  I love it when people take initiative like that and help people out.  Awesome.
I'm wondering headwax, do you have motion capture software/tools?  How do you create the BVH files?

Francesco:
Thank you all people for your interest, I hope to finish it as soon as possible.

Thank you Andrew for the pointer about BVHacker, it will be good to check out if I am doing everything correctly. About setting the figure object in t-pose or in *-pose, I'm still far from having completely worked out the BVH format, but nonetheless I have a small update, and I will do my best to implement your request.

So, I've completed the AN8 project export part and most of the data conversion.

To sum up, I can feed the program with the BVH file and get a AN8 project containing all the animation data, but I'm not yet done with the nodes->bones conversion to build the AN8 figure.

It is more tricky than I thought in a first time, but I'm working it out step by step.

I've added an option to resample the animation data scaling down the frame rate. As test file I am currently using a BVH file I got from Animazoo, the one with the Capoeira flying kick. It's a 900+ frames file sampled at 120fps, and I'm getting a AN8 file with a single bone (the hips) moving and rotating in scene mode, sampled at 30fps. That's not so much but you can guess the satisfaction I felt seeing this very first export working in Anim8or.

Some loudthinking now, just in case you guys have some good advice or pointer to give.

-------

The BVH file can store more than a skeleton at once, and each rootnode, unlike Anim8or's rootbones, is able to rotate and to translate in space. I have converted this concept by building a figure for each skeleton and by adding a motion track in scene mode for each figureelement (read this as "figure+sequence in scene mode").

Conceptually I am on firm ground here with the multiple-skeleton stuff, but I need a BVH file containing a multiple skeleton, in order to feed it both to my software and to BVHacker and check out if everything is running smooth. Can somebody provide me with such a file?

-------

About stripping out more of that large amount of animation data, apart from resampling it at a lighter framerate, I thought about computing out peaks and pauses for each joint motion, but it's a tricky thing for sure and I'll leave it for later, when the raw conversion will be complete and stable.

On the way to get there, I'll add another option to pick out a fixed amount of frames per second and set the keyframes with them.

-------

I'm making the program as a console executable, you will be able to drop "file.bvh" onto it and get a "file.bvh.an8" straight away, there will be also the option to change the conversion preferences via program arguments or by interacting with the program.

-------

More to come, wish you good time Anim8ing meanwhile ;)

headwax:
Hiho, but imageine how fast you can swim in your lifesaving duties!

http://sites.google.com/a/cgspeed.com/cgspeed/motion-capture/cmu-bvh-conversion

No motion capture facilities! The motherlode of BVH files is above. Released by a university, or carnegie institute.

I've been using truespace to load them up then save them, so I can use them with Carrara. Truespace arranges them in a usable form, seems to filter them.

 Truespace is very powerful software, free, and an interface as bad as blender :)

Both truespace and carrara have non linear animation, so you can have the BVH file in one track, then make another track with the same skeleton, and override or blend or multiply the keyframes of the bones in the original BVH track with the new tracks- supposedly. You can cut and paste parts of the animation just like anim8r uses it's seequnces.

Francesco.!

Sounds like an amazing job you are doing.!!!!!!!!!!!!!!!!!!!

I haven't seen any bvh files with more than one skeleton yet. Check that link I posted above.- there might be one I have missed.

I've been translating the above bvh files through Truespace, so if you want help on that let me know.

In addition, I've been rendering at 12 frames a second which seems to give good smooth movement.

Have you seen the framerate changer available for anim8or?

That could come in handy somewhere.

cheers again, thanks for the amazing work

hihosilver:
Haha!  Perfect aerodynamics there!
Oh wow, I just took a look at one of the subcategories and just in one there is a ridiculous amount of different files!  That really is the motherload.
Ahh, blending animations, I believe 3ds max has that feature now, seems nice.
That could be something fun to look into.  Heck, I could even probably use those as references to learn realistic animation!

Francesco:
Another small update.

Maybe it is all only working in my mind, or maybe I'm just a single step away from having a working solution.

Sorry if I get into technical details, but the problem I'm stuck on is pretty technical.

The concept a BVH file relies on is:
- a hierarchy of joints whose distances are stored as relative XYZ offsets
- each joint starts as "non rotated"
- each frame rotates each joint by a certain roll, pitch and yaw angles

Now to get this into anim8or I could either:
- go with the best, longer way of converting each joint to a bone and recompute all the motion angles, frame by frame;
- go with the work-it-around, shorter way of recreating non-rotated joints with zero-length rotating bones, interleaving them with fixed bones to represent offsets, and direct-stream copy the RPY angles from BVH motion into AN8 sequence;

I took the workaround way, and as I said above, I miss one single step to close the process.

The thing I miss is converting joint offsets to quaternion orientation, in order to set it into the figure section, inside of the an8 project. Or better, I have a chunk of code for that, but the quaternions I'm getting seem to be wrong, when I feed them to anim8or.

To have an example of the final result, take a look to the bvh and an8 files attached, they show the same skeleton and the same animation in both programs (bvhacker and anim8or), but the orientation of the anim8or bones is the result of manual editing - hence the name, "desired result.an8".

This is the code I'm using to convert XYZ offsets to RPY angles, which get then converted to a quaternion. Anyone has enough trig and quat knowledge to tell me what's going wrong with it?



/*
Radians(x, y) returns the angle between the positive X axis and the
line connecting origin and P(x,y).
This function work correctly, hence I'm not reporting it here
*/

/*
heading, attitude and bank are only other names for roll, pitch and yaw
I'm using this function as taken from
http://www.euclideanspace.com/maths/geometry/rotations/conversions/eulerToQuaternion/index.htm
*/

quaternion RadRPYtoQuat(float heading, float attitude, float bank) {
  // Assuming the angles are in radians.
  float c1 = cos(heading/2);
  float s1 = sin(heading/2);
  float c2 = cos(attitude/2);
  float s2 = sin(attitude/2);
  float c3 = cos(bank/2);
  float s3 = sin(bank/2);
  float c1c2 = c1*c2;
  float s1s2 = s1*s2;
  quaternion result;
  result.w = c1c2*c3 - s1s2*s3;
  result.x = c1c2*s3 + s1s2*c3;
  result.y = s1*c2*c3 + c1*s2*s3;
  result.z = c1*s2*c3 - s1*c2*s3;
  return result;
}


point3 BoneRPY(point3 p) {
  float roll, pitch, yaw;
  yaw = -Radians(p.y, p.x);
  p.y = p.y * cos(yaw) - p.x * sin(yaw);
  roll = Radians(p.y, p.z);
  pitch = 0;
  return point3(roll, pitch, yaw);
}

int main() {

/*
  parse the BVH file, get nodes and so on
  then:
*/

  point3 p = BVH_Node.Offset;
  p = BoneRPY(p);
  quaternion q = RadRPYtoQuat(p.x, p.y, p.z);
  AN8_Bone.orientation = q;

/*
  store bone into figure hierarchy, print out the an8 file and so on
  end of the story
*/

}


The BoneRPY() function is the part I'm not sure about. In my mind, I'm getting the yaw from a mere projection, I'm rotating a coordinate to avoid angle misrepresenting and I'm getting roll. Two euler's angles should be enough to get every possible orientation, isn't it?

I feel lost, really, hope somebody could help me sorting this out.

PS: rename "test.bvh.txt" removing the ".txt" part, I've added it to let the forum accept it as attachment. It's a trivial issue, just matter of clarity.


[Edit: Anim8or expects quaternions to be stored in xyzw order, am I right? It seems to be so, but I ask to be sure]

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version