2 registered members (7th_zorro, 1 invisible),
942
guests, and 7
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Animation bledning problem
#425013
06/25/13 14:37
06/25/13 14:37
|
Joined: Oct 2011
Posts: 1,082 Germany
Ch40zzC0d3r
OP
Serious User
|
OP
Serious User
Joined: Oct 2011
Posts: 1,082
Germany
|
Hey guys. Today I tried to blend my animations to get a better result in endgame. However, in firstperson I got everything to work but in thirdperson it doesnt work, because I use ANM_ADD too:
if(mv_lastMode != 1) mv_fpsBlend = 0;
mv_lastMode = 1;
ent_blendframe(pLocal, pLocal, "stand", 0, mv_fpsBlend);
mv_fpsBlend = clamp(mv_fpsBlend + 4*time_step, 0, 100);
if(mv_fpsBlend >= 25)
{
ent_animate(pLocal, "stand", mv_fpsAnim, ANM_CYCLE);
mv_fpsAnim += 3*time_step;
}
else
{
mv_fpsAnim = 0;
}
.......
ent_animate(pLocal, "r_pose", 0, ANM_ADD); //<- this results in a weird behaaviour while the first 25% of the frame is blending :(
I hope someone can help me a little Thanks in advance!
|
|
|
Re: Animation bledning problem
[Re: Ch40zzC0d3r]
#425043
06/25/13 19:37
06/25/13 19:37
|
Malice
Unregistered
|
Malice
Unregistered
|
manual ent_animate(entity,NULL,0,0) resets all bones poses of the entity manual ent_animate code example
// reset skeletion and then compose the animation (order is important):
ent_animate(me,NULL,0,0); // reset all bones
// first, shake the arms during running
ent_animate(me,"run_torso",my.skill1,ANM_CYCLE);
// then blend over to, or blend back from shooting (only affects the arms)
if (my.skill3 > 0) { ent_blend("shoot",0,my.skill3); }
// finally animate the legs (only affects the legs)
ent_animate(me,"run_legs",my.skill2,ANM_CYCLE+ANM_ADD);
Of course I'm still half asleep so I might misunderstand your question.
|
|
|
Re: Animation bledning problem
[Re: Ch40zzC0d3r]
#425095
06/26/13 17:40
06/26/13 17:40
|
Malice
Unregistered
|
Malice
Unregistered
|
It works just like it should, But there is a little odd pop in it, that I think would be fixed by putting the blend into a if() block.
while(1)
{
ent_animate(me,NULL,0,0);
if(key_w)
{
mv_lastMode = 2;
ent_animate(me, "walk", animationCount, ANM_CYCLE);
animationCount += 5*time_step;
}
else
{
//ent_animate(me,NULL,0,0);/// NOT NEEDED
ent_animate(me, "walk", animationCount, ANM_CYCLE);
if(mv_lastMode != 1) mv_fpsBlend = 0;
mv_lastMode = 1;
ent_blendframe(me, me, "stand", 0, mv_fpsBlend);
mv_fpsBlend = clamp(mv_fpsBlend + 3*time_step, 0, 100);
if(mv_fpsBlend >= 25)
{
ent_animate(me, "stand", mv_fpsAnim, ANM_CYCLE);
mv_fpsAnim += 3*time_step;
}
else
{
mv_fpsAnim = 0;
}
}
ent_animate(me, "r_pose", 0, ANM_ADD); //Comment out this line to see the expected result
wait(1);
}
EDITED
Last edited by Malice; 06/26/13 18:23.
|
|
|
Re: Animation bledning problem
[Re: Ch40zzC0d3r]
#425098
06/26/13 18:30
06/26/13 18:30
|
Malice
Unregistered
|
Malice
Unregistered
|
Your welcome , It seemed a odd question. You already knew the answer. You can remove the second empty ent_animate() inside the else. Also I didn't try but you should be able to do the logic on the animation variables in the if()else() blocks and then put all the animation instructions in a block at the end with a little logic, like the example from ent_animate. EDIT* Looking at the manual I think the ent_blendpose() would end up being better as you can compose pose layers. It looks like you are going to end up with many ANM_ADD's like Shooting, Reloading, Middle-finger-in-the-air , ect...
Last edited by Malice; 06/26/13 19:03.
|
|
|
|