Vertex + Bone Animation

Posted By: draculaFactory

Vertex + Bone Animation - 05/21/09 04:40

I know that you can do this with code, I *have* done it before, a long time ago and it was with WDL anyhow. I need to know how to combine vertex and bone animation for a specific purpose.

My model is animated using vertex animation, I want to add one bone for the character's head and rotate that bone to face the mouse to allow the character to look at the mouse pointer. The problem is that when I do this, the character will not animate using the vertex animations, even though there are no actual bones animations in the model.

I just need to know how to animate it using vertex animations while being able to modify the bone rotation at the same time. Everything else works great, that's the only thing that I need help with.
Posted By: KiwiBoy

Re: Vertex + Bone Animation - 05/21/09 05:19

Hi, you need to animate via script with something like this,

Code:
 if (key_a ==1)&&(key_w-key_s == 0)//Stationary turning
				{
					ent_bonerotate(my,"wheelFL",vector(0,key_a - key_d*  15 * time,0));
					ent_bonerotate(my,"wheelBL",vector(0,key_a - key_d*  15 * time,0));
					ent_bonerotate(my,"wheelFR",vector(0,key_d - key_a*  15 * time,0));
					ent_bonerotate(my,"wheelBR",vector(0,key_d - key_a*  15 * time,0));
				}
				if (key_d ==1)&&(key_w-key_s == 0)
				{
					ent_bonerotate(my,"wheelFL",vector(0,key_a - key_d* 15* time,0));
					ent_bonerotate(my,"wheelBL",vector(0,key_a - key_d* 15* time,0));
					ent_bonerotate(my,"wheelFR",vector(0,key_d - key_a* 15* time,0));
					ent_bonerotate(my,"wheelBR",vector(0,key_d - key_a* 15* time,0));
				}


Where the id file name "wheelFR" is object manipulated.
Posted By: draculaFactory

Re: Vertex + Bone Animation - 05/21/09 05:38

Thank you, but this solution is not what I was looking for. I thought I explained it good, I don't need code to animate bones, I know how to do it great. What I need is to know how to combine vertex and bone animation through script so that my character can animate using the regular vertex animation while I rotate the bone seperately. The result could be like a character walking forward while the bone controlling the head rotates to face the mouse. I know how to script everything else, I just need to know how to allow vertex animation to play while the bone rotates through code.
Posted By: draculaFactory

Re: Vertex + Bone Animation - 05/29/09 16:27

*bump*
Posted By: Pappenheimer

Re: Vertex + Bone Animation - 05/30/09 00:20

This thread is the only information that I remember about this:

http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=213631

In ancient times of acknex there has been a developer who faked a bones animation to combine it with vertex animation.
Posted By: Locoweed

Re: Vertex + Bone Animation - 05/30/09 03:59

I don't think that is possible, sorry.

First, you have to have the bone weighted to the mesh for the mesh to turn with bone.

Secondly, unless the bone is at the same position during the entire vertex animation, it isn't going to move anywhere with the model's vertex animation.

I just don't see it happening.

Now, for a non-animated model like a spaceship, you could place a bone on top of it, and then place and rotate another seperate model, like a turrent model on that bone. That you can do.

Loco
Posted By: draculaFactory

Re: Vertex + Bone Animation - 05/30/09 04:02

Thanks for the reply, but I *have* done this before, the manual actually says you can. I just dont remember how I did it a long time ago. The bone is weighted to the mesh and does in fact work, I just wanted to be able to get the head to turn to face the mouse while a vertex animation is running.
Posted By: Locoweed

Re: Vertex + Bone Animation - 05/30/09 04:10

I can't think of anyway to do it. Wish you luck.
Posted By: KiwiBoy

Re: Vertex + Bone Animation - 05/30/09 04:26

As I indicated earlier, you use bone animate.
In the meantime, vertices animation is still running.
So while player is happily running off to the war, its head with bone animation is loooking around, while it is running!
Posted By: Locoweed

Re: Vertex + Bone Animation - 05/30/09 04:37

Originally Posted By: KiwiBoy

So while player is happily running off to the war,


Lol.
Posted By: EvilSOB

Re: Vertex + Bone Animation - 05/30/09 04:38

How? Add soon as I add a bone (in MED) to the model,
all the vertex-animation states no longer work with ent_animate in any fashion.

PS :: Alas, I know not this "bone weighting" of which your people speak.
Also, I have done VERY little vertex-animation myself, but I am interested in this issue.
Posted By: bart_the_13th

Re: Vertex + Bone Animation - 05/30/09 04:59

Correct me if I'm wrong but, I think the manual states that you cant use Vertex animation and Bones animation at the same time. The vertex animation will come first then the bone animation, thus rendering the vertex animation useless...
I'm using Lite-C Free, BTW...
Posted By: draculaFactory

Re: Vertex + Bone Animation - 06/01/09 21:29

Yes Loco very funny. The problem is not getting the bone to rotate, I keep telling you guys this. I *have* used bone rotate to rotate the head, but the vertex animation will not play WHILE the bone is rotating. How many times do I have to rewrite this post? I do NOT need code to rotate the bone, I know how to do this, I need to know how to play vertex animation WHILE the bone is being rotated. This is why I don't even bother coming to this site anymore, usually. Geez...
Posted By: Pappenheimer

Re: Vertex + Bone Animation - 06/01/09 22:04

Maybe, you should post your problem in Ask the Developers, because it is an issue that one can't use vertex animation and bones animation at once.
Posted By: draculaFactory

Re: Vertex + Bone Animation - 06/02/09 15:13

Ok, I actually went to the manual, this is a quote from the ent_animate section, read the last line.

Quote:

If the scene contains bones animation, the instruction does not alter the frame and next_frame parameters, but modifies the entity's skeleton. Only bones affected by the given scene are set to their new orientation; bones not affected by this scene keep their old state. By executing this instruction several times for different animation scenes, bones animations are combined. Bones animation can also be combined with vertex animation.

Posted By: boyax

Re: Vertex + Bone Animation - 06/02/09 16:26


First, in MED you need to find the name of the bone (parent bone), that's probably the neck, in your case. Try rotating the neck bone in MED just to verify.

Then, in your code, while playing vertex animation (or frame animation) achieve via ent_animate(), add your code to rotate the "neck" bone achieve via bone_rotate()

try to look in my thread, for reference:

http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Main=32805&Number=267788#Post267788

Hope that helps. smile
Posted By: draculaFactory

Re: Vertex + Bone Animation - 06/02/09 19:30

Again, I already know how to rotate the bone using cude, I have it all set up with contraints and everything. Whenever I try to get the vertex animation to play while the bone is rotating, it does not work. It only allows me to have one or the other currently, when the manual states otherwise.
© 2024 lite-C Forums