Help with formula for "breathing" effect every second?

Hi,

I’m wondering if it’s possible to create a “breathing” effect for an image element in WFS, that’s repeated exactly each second.
More specifically, a repeated action each second, where an image would be displayed 100% opacity, then slowly fade to let’s say 20%, then immediately show 100% the next second, and so on.

I’ve tried the following formula on an image with 20% opacity, but this one just “jumps” from 100% to 20% each second, without the “slowly fading” look I’d like to achieve:

[SEC_MSEC]%1<0.5?80:0

Any help would be much appreciated! :v:
I know some people here are good with these things, I’m clearly not :sweat_smile:

Hello,
if you want to make the element smoothly fade to 20% and then reapear to 100% with every new second,
I would modify that expression like: (1-[SEC_MSEC]%1)*80

Since the [SEC_MSEC] does not work as it should (does not return the data on the flow but somehow jerky), the transition could be better, but not so smooth either.

For symetrical fading (smooth breathing in and out and if the msec part worked right) you could also try to use 60+
40*sin([SEC_MSEC]*6.284)

Thank you for your help Peter!

That’s definitely much better, although not perfectly smooth, like you said.

Still, it’s probably the closest I can get to what I’d imagined without using animations (which can’t be made to start and repeat perfectly each second, unfortunately).
Thanks again! :+1:

EDIT:
The last formula actually looks a lot smoother on the physical watch, then it does in WFS preview. :slightly_smiling_face:

1 Like