|
|
Easy animations
#326551
06/01/10 16:18
06/01/10 16:18
|
Joined: May 2009
Posts: 5,377 Caucasus
3run
OP
Senior Expert
|
OP
Senior Expert
Joined: May 2009
Posts: 5,377
Caucasus
|
jcl please can you make the way we make smooth blending between scenes easier? Most of people need smooth changing between animations, not terrible like ent_animate works  please can you make ent_blend(or ent_blendframe for bones) work like ent_animate? I mean, we just call it, and it will work smoother? Not for blending animations, but for smoother changing between them. I'm just asking for some thing like vec_set and vec_lerp. For me they work same, but in vec_lerp you can set the speed and force of the setting vector. So I'm asking for staff like that. So it can work just like this:
ent_animate(my,"walk",walk_,ANM_CYCLE,0.5);
// so 0.5 is a smooth changing between animations
// but if you do not want smooth you can play with 0.5
And I already asked to help me with working with ent_blendframe, but no one carries... So what I suppose to do then? I can make simple smooth animations between walk,run and stand with ent_blend (for vertex and bone animations), but it is really hard for me to add more animations to it(and not only for me, but for all beginners I guess), it needs state machine, that tells ent_blend (or ent_blendframe for bones) when to start and when to stop each animations.... but if I have 100 animations?? I'll need to tell ent_blend when to start and stop for each animations?! I think better just to make it easier for every one. Thank you and sorry for bad English. With hope greetings TRACER.
|
|
|
Re: Easy animations
[Re: 3run]
#326553
06/01/10 16:24
06/01/10 16:24
|
Joined: Oct 2007
Posts: 5,211 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
|
sooo... what is the diffrence between this and ent_blendframe?
3333333333
|
|
|
Re: Easy animations
[Re: Quad]
#326560
06/01/10 16:50
06/01/10 16:50
|
Joined: May 2009
Posts: 5,377 Caucasus
3run
OP
Senior Expert
|
OP
Senior Expert
Joined: May 2009
Posts: 5,377
Caucasus
|
I do not know how to work with ent_blendframe dude. But I heard that is just the same as ent_blend, but only for bone animations. That means that it will need state machine too... the thing that I'm asking for, will work just simple like this:
///////////////////////
if(key_w)
{
ent_animate(my,"walk",walk_,ANM_CYCLE,0.5);
walk_ += 5 * time_step;
}
else
{
ent_animate(my,"stand",stand_,ANM_CYCLE,0.5);
stand_ += 2 * time_step;
}
///////////////////////
As you see, it is just simple as usual ent_animate, but there will be smooth blending between scenes. And it is really easy to use it this way. If you do not need smooth blending between scenes, but need ugly changing between them, then just play with "0.5". No need to make state macine for it, no need to tell ent_blend (or ent_blendframe for bone animatios) exactly when to start and when to stop animations. Very easy and fast.
|
|
|
Re: Easy animations
[Re: 3run]
#326564
06/01/10 16:59
06/01/10 16:59
|
Joined: Oct 2007
Posts: 5,211 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
|
hmm i understand your consideration about state machines but you can overcome this easily
define all your scene names as STRING* and then use ie.
STRING* anim_frame; STRING* anim_frame_old; STRING* anim_walk = "walk"; STRING* anim_stand = "stand"; ... and so on then:
if(key_w){ if(anim_frame!=anim_frame_old)anim_frame_old = anim_frame; anim_frame = walk; } else{ if(anim_frame!=anim_frame_old)anim_frame_old = anim_frame; anim_frame = stand; }
and at the end of your action
if(anim_frame_old!=NULL){ start blending here if( blending finishes) anim_frame_old = NULL; }
ent_animate(..,anim_frame,..,..);
etc.
you can create a system of yourself for easy blending....
and if you do not want to repeat same lines either write a macro or a function like
void set_anim(STRING* animpointer){ if(anim_frame!=anim_frame_old)anim_frame_old = anim_frame; anim_frame = animpointer; }
and use set_anim(walk); etc...
3333333333
|
|
|
Re: Easy animations
[Re: 3run]
#326587
06/01/10 19:00
06/01/10 19:00
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Please ignore this meaningless ramble..... Have you tried smaller steps than 0.5? Like 0.1 or even lower? Or am I completely off the track here?
[EDIT] And as a point of interest, in your example you have PERCENT and MODE backwards. Mode is last, Percent second last. ie "ent_animate(my,"walk",walk_,0.5,ANM_CYCLE);"
If this is just a posting typo, just ignore me. But IF this sort of typo is in your code, the compiler may not notice, but it certainly wont work correctly...
[EDIT-2] I was wrong, the parameters arent in the wrong order, there is just too many! I would expect that to fail to compile, but it is in the thread too many times to be a mere typo I think...
Last edited by EvilSOB; 06/01/10 19:53.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
|