Page 1 of 1

Ping Pong animation of abc

Unread postPosted: Mon Nov 11, 2019 4:19 am
by qinyao
Hi, friends:
I have a plant with 5seds wind animation, how can I make it to a ping pong loop? Need I use some expression on the frame attr of abc?

Thanks!

Re: Ping Pong animation of abc

Unread postPosted: Tue Nov 12, 2019 10:26 am
by dboude
Hi,

There is no ping pong loop behavior for animation. I guess it would be doable with expressions.

Cheers ;)

Re: Ping Pong animation of abc

Unread postPosted: Thu Oct 14, 2021 11:02 am
by machieb
Hello,

I need this ping pong animation of abc files behavior in a project. Is there a way with an expression in the animation behavior option to get this working?
Please help!

Thanks Marcus

Re: Ping Pong animation of abc

Unread postPosted: Mon Oct 18, 2021 9:05 am
by mdkai
You can utilize expressions to ping pong any animation.
Code: Select all
abs((abs(F)+(25)-2)%(((25)-1)*2)-(25)+1)+1

Where 25 is the range so it will go 23,24,25,24,23 etc.

Feel free to adjust is as needed

Cheers
Kai

Re: Ping Pong animation of abc

Unread postPosted: Mon Oct 18, 2021 10:13 am
by aaute
you can also use this expression :
Code: Select all
rangeStart = 0;
rangeEnd = 25;
currentRangeId = ceil(F / rangeEnd);
fwd = cycle(F, rangeStart, rangeEnd );
bck = rangeEnd - fwd;

if (currentRangeId % 2) {
output = fwd;
} else {
output = bck;
}
output


And change the rangeStart and rangeEnd base on your animation range. You may need to change the code if the animation doesn't start at 0 to identify the proper chunk.

You can multi-select all the components inside your reference and paste this expression or do it on one and copy this expression get_double("NAME_OF_THE_OBJECT_WITH_EXPRESSION.frame")

Cheers

Re: Ping Pong animation of abc

Unread postPosted: Tue Oct 19, 2021 3:28 pm
by machieb
Thank you very much!
I will try these expressions!

Cheers Marcus

Re: Ping Pong animation of abc

Unread postPosted: Sat Oct 23, 2021 1:20 pm
by flansrjf
qinyao wrote:Hi, friends:
I have a plant with 5seds wind animation, how can I make it to a ping pong loop? Need I use some expression on the frame attr of abc?

Thanks!

abs(313*sin(F*PI/rand(20,30))) 313是总帧数,我是用来模拟树的延时摄影,不知道是不是这个意思