Jump to content
blackburnrus

any way to cut/rewind animation?

Recommended Posts

Some animations are very long, and I want to use only final 2seconds from 30sec animation.

Is there any way to cut animation to the last to seconds? Or there is only way to  use setAnimSpeedCoef with right hight coef and preparations, and manualy rewind it and then set default coef to that segment, that I need ?

 

Share this post


Link to post
Share on other sites

I'm guessing not.   But if its for a cutscene, you could make a twin of the unit off camera (same face, uniform, etc.), and start the animation on the twin.  Then wait X seconds until animation is at point you want, and setpos camera unit away, and replace him with the unit that is playing the animation.  Of course the transition from first unit to second unit will be abrupt.  But if you have multiple things happening in your scene you can cut away to some other camera target while you replace the unit with the animation unit, then cut back.

  • Thanks 1

Share this post


Link to post
Share on other sites
10 hours ago, pierremgi said:

anyUnit switchMove ""  cuts the animation but you need to broadcast (remoteExec) it in MP.

 

 

The OP just wants the last 2 secs of a long animation. I don't think there's any way to do that short of modifying the animation file itself and repacking it into your own animation config. I think @Kydoimos had an animation tutorial on his website, but that site seems to be down now.

Share this post


Link to post
Share on other sites
30 minutes ago, AZCoder said:

 

The OP just wants the last 2 secs of a long animation. I don't think there's any way to do that short of modifying the animation file itself and repacking it into your own animation config. I think @Kydoimos had an animation tutorial on his website, but that site seems to be down now.

 

As you want. I just used with success this code to stop any healing animation and give hand to attacked player instead of be killed during healing.

Share this post


Link to post
Share on other sites
1 hour ago, pierremgi said:

 

As you want. I just used with success this code to stop any healing animation and give hand to attacked player instead of be killed during healing.

You can interrupt an animation, I do this as well, but can you play only the last 2 secs of the animation? So if it's a 10 sec animation, you start it at 8 secs?

 

Share this post


Link to post
Share on other sites

hmm, sorry, I didn't find any variable for the elapsed time in animation.

Share this post


Link to post
Share on other sites
On 19.03.2018 at 1:51 AM, johnnyboy said:

I'm guessing not.   But if its for a cutscene, you could make a twin of the unit off camera (same face, uniform, etc.), and start the animation on the twin.  Then wait X seconds until animation is at point you want, and setpos camera unit away, and replace him with the unit that is playing the animation.  Of course the transition from first unit to second unit will be abrupt.  But if you have multiple things happening in your scene you can cut away to some other camera target while you replace the unit with the animation unit, then cut back.

 

Hm. If I making SP mission, and every player who will play it has  his own face. I dont want set one face for everyone.

How can I import face of the player, when mission starts and export it to AI-understudy?

--

oh god, there is face command

  • Like 1

Share this post


Link to post
Share on other sites

It isn't possible to play certain part of animation only. Unless the part you want is like at the start. Then you can do as @pierremgi said and use switchMove command.

Share this post


Link to post
Share on other sites

You could probably find a way around this using setAnimSpeedCoef and sleep, doubt sleep is precise enough to warrant extremely fast almost instant switches, also you'd need to find out the exact duration when you want the animation to return to regular speed.

Unfortunately animationPhase doesn't work on infantry units, could be a solution otherwise.

 

Cheers

Share this post


Link to post
Share on other sites

I found a solution, I'm using moveTime and setAnimSpeedCoef

When I brouse animations in  animationlist and find acceptable timing for me (example 12.4)

I'm pausing animation with  setAnimSpeedCoef 0 when animation reaches acceptable timing.

StopAnim01_PalecAndShag = {
_a = moveTime twin1;
if (_a > 12.4) exitWith {twin1 setAnimSpeedCoef 0;};

call StopAnim01_PalecAndShag;
};

 

When I want to start animation with this place - Im using

setAnimSpeedCoef 1;

 

And I'm using twins, like @johnnyboy said

  • Like 4
  • Thanks 1

Share this post


Link to post
Share on other sites

Nice going.  Way to be persistent.  Thanks for posting the solution to benefit others.

  • Like 1

Share this post


Link to post
Share on other sites

Oh wow, I was convinced it wasn't possible, I stand corrected then. Good work!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×