It is currently April 18th, 2024, 12:46 am

How to add an infinite loop fade in and out effect to the background blur effect

Get help with creating, editing & fixing problems with skins
User avatar
Pyuahowaito
Posts: 50
Joined: January 3rd, 2022, 2:44 pm

How to add an infinite loop fade in and out effect to the background blur effect

Post by Pyuahowaito »

Code: Select all

[Rainmeter]
Update=500

[Variables]
SkinWidth=#SCREENAREAWIDTH#
SkinHeight=#SCREENAREAHEIGHT#

[Background]
Meter=Image
W=#SkinWidth#
H=#SkinHeight#
SolidColor=0,0,0,1

[FrostedGlass]
Measure=Plugin
Plugin=FrostedGlass
Type=Acrylic
Measure=Plugin
Plugin=ActionTimer
DynamicVariables=1
ActionList1=Repeat FadeIn,15,100
FadeIn=[!SetVariable Alpha "(Clamp(#Alpha#+10,100,255))"]#U#
ActionList2=Repeat FadeOut,15,100
FadeOut=[!SetVariable Alpha "(Clamp(#Alpha#-10,100,255))"]#U#
DynamicVariables=1
Last edited by Pyuahowaito on January 12th, 2022, 5:57 pm, edited 2 times in total.
User avatar
balala
Rainmeter Sage
Posts: 16143
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to add an infinite loop fade in and out effect to the background blur effect, the current effect is very stiff

Post by balala »

The measure where you've used the ActionList options is in fact a FrostedGlass plugin measure, not an ActionTimer, because you put one single measure name ([FrostedGlass]). In this section you've added two Measure (this is not a great problem, especially that both are the same) and two Plugin options. When using twice (or more times) the same option into one single measure, Rainmeter simply ignores the second occurence of the repeated options (in this case the Plugin=ActionTimer option is ignored). Accordingly the ActionList options can't work either.
Split the posted [FrostedGlass] in two different measures, something like this:

Code: Select all

[FrostedGlass]
Measure=Plugin
Plugin=FrostedGlass
Type=Acrylic

[FrostedActionTimer]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat FadeIn,15,100
FadeIn=[!SetVariable Alpha "(Clamp(#Alpha#+10,100,255))"]#U#
ActionList2=Repeat FadeOut,15,100
FadeOut=[!SetVariable Alpha "(Clamp(#Alpha#-10,100,255))"]#U#
DynamicVariables=1
I also removed the second occurrence of the DynamicVariables=1 option from the [FrostedActionTimer] measure.
But the code is not complete. There are needed some !CommandMeasure bangs, to execute one of the two ActionLists.
User avatar
Pyuahowaito
Posts: 50
Joined: January 3rd, 2022, 2:44 pm

Re: How to add an infinite loop fade in and out effect to the background blur effect, the current effect is very stiff

Post by Pyuahowaito »

Thanks, but I'm not a professional programmer. This code is all pieced together by myself. I don't know how to write next, can you help me write the code? If it's a lot of work, then you don't have to, sorry for wasting your precious time, thank you very much for your pointers.
User avatar
CodeCode
Posts: 1365
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: How to add an infinite loop fade in and out effect to the background blur effect, the current effect is very stiff

Post by CodeCode »

Pyuahowaito wrote: January 10th, 2022, 11:53 pm Thanks, but I'm not a professional programmer. This code is all pieced together by myself. I don't know how to write next, can you help me write the code? If it's a lot of work, then you don't have to, sorry for wasting your precious time, thank you very much for your pointers.
Patients. What you are cobbling together is rather advanced - and you made decent progress on your own - just that the errors break your fade.

balala provided a good example - it is meant to help you develop your programming skills. After all rainmeter is a free hobby horse, and all of the help here is voluntary. the colored forum id's are only to designate the more advanced users, and thy can also help with posting just the right stuff to show you are indeed doing those things. You are and that helps the forum members to help you learn with examples. Google is your friend just add 'rainmeter' to your searches and there are many working examples for you to modify or borrow code from.

I find that reverse engineering working examples, until the desired outcome is clearly visible. Then you can take that example and slugit into your own skin code. Just deleting all of the stuff, and many, many refreshes - your effect is realised in a working example of a stripped down working skin.

I am currently working with similar calculations to apply a sliding panel - I am barely there, but taking time to think about things and writing my goals and barriers - it helps to write things down, or even as you move along here in the forums.

Happy Coding!
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
balala
Rainmeter Sage
Posts: 16143
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to add an infinite loop fade in and out effect to the background blur effect, the current effect is very stiff

Post by balala »

Pyuahowaito wrote: January 10th, 2022, 11:53 pm Thanks, but I'm not a professional programmer. This code is all pieced together by myself. I don't know how to write next, can you help me write the code? If it's a lot of work, then you don't have to, sorry for wasting your precious time, thank you very much for your pointers.
Let's see if I understood your intention: would you like to have a fade-in, then a fade-out, then a fade-in again and so on effects on a meter? Have i understood well your need?
And no, there will be not too much to work, don't worry. Just have to clarify first the aspects.
User avatar
CodeCode
Posts: 1365
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: How to add an infinite loop fade in and out effect to the background blur effect, the current effect is very stiff

Post by CodeCode »

There are actually a couple ways to do what it seems you want.

The way that I think of is this:

Code: Select all

[MeasureBounce]
Measure=Loop
StartValue=25
EndValue=255
Increment=5
IfCondition=MeasureBounce = 255
IfTrueAction=[!SetOption MeasureBounce Invertmeasure "1"][!Update]
IfCondition2=MeasureBounce = 25
IfTrueAction2=[[!SetOption MeasureBounce Invertmeasure "0"][!Update]
DynamicVariables=1

[MeterFade]
Meter=Image
ImageAlpha=[MeasureBounce]
...
SolidColor=50,50,50
DynamicVariables=1
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
balala
Rainmeter Sage
Posts: 16143
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to add an infinite loop fade in and out effect to the background blur effect, the current effect is very stiff

Post by balala »

CodeCode wrote: January 11th, 2022, 1:51 pm The way that I think of is this:
Unfortunately there is a small problem with this approach, namely that you can't dynamically set the InvertMeasure option of a such Loop measure, due to this:
Any dynamic change to any of the four measure options, or dynamically changing InvertMeasure on the measure, will cause the loop to be reset and start over with the new values.
Or in fact you can, but this causes the measure to reset, which leads to a not proper increment in all cases.
User avatar
Pyuahowaito
Posts: 50
Joined: January 3rd, 2022, 2:44 pm

Re: How to add an infinite loop fade in and out effect to the background blur effect, the current effect is very stiff

Post by Pyuahowaito »

That's right, the background blur effect fades in and out repeatedly, similar to the effect in the animated GIF below. This is what I made by adding a Gaussian blur effect to Pr, but I want this effect to be generated in real time, but I can't achieve it due to my limited ability
User avatar
balala
Rainmeter Sage
Posts: 16143
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to add an infinite loop fade in and out effect to the background blur effect, the current effect is very stiff

Post by balala »

Pyuahowaito wrote: January 11th, 2022, 4:13 pm That's right, the background blur effect fades in and out repeatedly, similar to the effect in the animated GIF below. This is what I made by adding a Gaussian blur effect to Pr, but I want this effect to be generated in real time, but I can't achieve it due to my limited ability
I'd say it's not really possible. I might be wrong, didn't work too much with the FrostedGlass plugin, but as far as I know, this is not something possible.
Maybe someone else who knows better the plugin may say something else.
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: How to add an infinite loop fade in and out effect to the background blur effect, the current effect is very stiff

Post by death.crafter »

Pyuahowaito wrote: January 11th, 2022, 4:13 pm That's right, the background blur effect fades in and out repeatedly, similar to the effect in the animated GIF below. This is what I made by adding a Gaussian blur effect to Pr, but I want this effect to be generated in real time, but I can't achieve it due to my limited ability
It's not possible with FrostedGlass.

You could use adobe ae to generate the frames and use them in a bitmap meter to achieve something similar, but it wouldn't be dynamic.

Also, another possibility would be using imagemagick and a powershell script to generate the frames. Just saying, never used imagemagick.
from the Realm of Death