Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
ent_blend to ent_blendpose conversion? #359690
02/19/11 06:55
02/19/11 06:55
Joined: Jul 2009
Posts: 85
A
Altarius Offline OP
Junior Member
Altarius  Offline OP
Junior Member
A

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?


Quote:
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 Offline
Serious User
painkiller  Offline
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

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1