|
3 registered members (AndrewAMD, Grant, Neb),
908
guests, and 6
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
ent_blend to ent_blendpose conversion?
#359690
02/19/11 06:55
02/19/11 06:55
|
Joined: Jul 2009
Posts: 85
Altarius
OP
Junior Member
|
OP
Junior Member
Joined: Jul 2009
Posts: 85
|
Hi, Since a couple of day i try to figure out how to blend a character animation whit a upper_body and a lower_body. I have tried a lot of thing but each i got wierd result. So.. i got this code on the forum...anyone have a idea how to modify it for combine the blending of a upper & lower character body animation... Maybe i need to convert it into a ent_blendpose blending? if(key_w ==0) { if(str_cmpi(anim_name, "l_stand") == 1) //if we already blended to the standing animation { ent_animate(my, "l_stand", anim_per, ANM_CYCLE); //animate it in its "stand" animation anim_per += 5 * time_step; //change 5 if you want str_cpy(anim_name, "l_stand"); //change the actual animation to the stand animation blend_per =0; } else //if we are in another animation, we will blend! { ent_animate(my, anim_name, anim_per, ANM_ADD); //animate him in his last position with its last animation percentage ent_blendpose(me,1, 2, blend_per); //blend it to the first frame of the other animation blend_per += 10 * time_step; //change the 30 if needed anim_per += 5 * time_step; //still animate in the old anim (change 5 if wanted) blend_per = clamp(blend_per, 0, 100); //clamp it between 0 and 100 if(blend_per == 100) //if the blending is finished { str_cpy(anim_name, "l_walk"); //change the actual animation to the stand animation anim_per = 0; //and change the animation percentage to 0 } } } if(key_w ==1) { if(str_cmpi(anim_name, "l_walk") == 1) //if we already blended to the standing animation { ent_animate(my, "l_walk", anim_per, ANM_CYCLE); //animate it in its "stand" animation my.pose =2; anim_per += 5 * time_step; //change 5 if you want str_cpy(anim_name, "l_walk"); //change the actual animation to the stand animation blend_per =0; } else //if we are in another animation, we will blend! { ent_animate(my, anim_name, anim_per, ANM_ADD); //animate him in his last position with its last animation percentage ent_blendpose(me,1, 2, blend_per); //blend it to the first frame of the other animation blend_per += 10 * time_step; //change the 30 if needed anim_per += 5 * time_step; //still animate in the old anim (change 5 if wanted) blend_per = clamp(blend_per, 0, 100); //clamp it between 0 and 100 if(blend_per == 100) //if the blending is finished { str_cpy(anim_name, "l_walk"); //change the actual animation to the stand animation anim_per = 0; //and change the animation percentage to 0 } } } thx
|
|
|
Re: ent_blend to ent_blendpose conversion?
[Re: Altarius]
#359739
02/19/11 10:26
02/19/11 10:26
|
Joined: Aug 2009
Posts: 1,438 Spain
painkiller
Serious User
|
Serious User
Joined: Aug 2009
Posts: 1,438
Spain
|
use first an ent_animate to animate the legs, so you can do this to smooth blend walk and stand:
my.pose=1; ent_animate(my,"stand",stand_animation,ANM_CYCLE); my.pose=2; ent_animate(my, "walk",walk_percentage, ANM_CYCLE); ent_blendpose(my,1,2,move_blend);
and then animate the arms: my.pose=1; ent_animate(my,"bodypose",pose_animation,ANM_CYCLE+ANM_ADD);
3D Gamestudio A8 Pro AMD FX 8350 4.00 Ghz 16GB RAM Gigabyte GeForce GTX 960 4GB
|
|
|
|