It is currently April 19th, 2024, 2:49 pm

ActionTimer plugin; FadeOut not working

Get help with creating, editing & fixing problems with skins
Derenaya
Posts: 13
Joined: January 7th, 2018, 3:14 am

ActionTimer plugin; FadeOut not working

Post by Derenaya »

So while I was working on my new launcher I implemented a simple black background picture with an alpha of 100 that would activate via a MouseOverAction when hovering over one of the icons. The effect I wanted to achieve with it was to darken the whole screen while simultaneously having the icon I'm hovering over "light" up to stand out more. Since that whole action was instant and I have a pretty bright background it was quite strenuous for the eyes which is why I was looking for a way to fade it into existence instead. For this I discovered this post here which was super helpful: https://forum.rainmeter.net/viewtopic.php?t=33017

I'm fairly new to Rainmeter in general and especially making Skins myself but I think I more or less understood how the application of the ActionTimer plugin in this case works (well apparently not since it doesn't work as I want it to :-( ) and I've implemented the example of the above mentioned post into my launcher skin which brings me to my problem:

1. FadeOut not working (https://www.youtube.com/watch?v=2p7OOXELVPY | Warning: flashing lights in the last 5 seconds of the video)
I'm not sure if you can see it on the video I've linked but while the FadeIn works as desired the FadeOut does not but instead instantly transitions back to the desktop, which although not as bad as an instant transition on the FadeIn, is still kinda hard to look at. Now I'm mostly unsure why it's doing that and how to fix it as the MouseLeaveAction and the Stop 1 as well as Execute 2 seem to be implemented correctly (to me that is). Any ideas?

On top of that I noticed that when I transition and hover over different icons very fast the FadeIn background does not reset from its full 100 alpha but instead stays there, skipping the FadeIn effect. Further since the FadOut isn't working this turns into kind of an strobe light effect. My theory here is that I start the new FadeIn of the next icon before it even had time to reset. In which case my question would be if there's a way to prevent that without just making the action faster? Or maybe I'm wrong and it's due to the FadOut not working :???:

Anyway here's the my code:

Code: Select all

[Rainmeter]
Update=100

[MeasureFade]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat FadeIn,20,10
FadeIn=[!SetVariable Alpha "(Clamp((#Alpha#+12.75),0,255))"]#Fade#
ActionList2=Repeat FadeOut,20,10
FadeOut=[!SetVariable Alpha "(Clamp((#Alpha#-12.75),0,255))"]#Fade#
DynamicVariables=1

[Variables]
Fade=[!UpdateMeasure "MeasureFade"][!UpdateMeterGroup "Hover"] [!Redraw]
Alpha=255

[Background]
Meter=Image
ImageName="Background.png"
H=336
W=48
X=0
Y=0
ImageAlpha=1
Meters for each of my programs. All six are identical which is why I'm only posting the first one:

Code: Select all

[MeterLaunchChrome]
Meter=Image
ImageName=Icons\Chrome.png
W=48		
H=48
X=300
Y=820
OnHover=1
LeftMouseUpAction=["%windir%\Brave"]
MouseOverAction=[!ShowMeter MouseHover] [!ShowMeter LightUpChrome] [!CommandMeasure "MeasureFade" "Execute 1"] [!CommandMeasure "MeasureFade" "Stop 2"] [!Redraw]
MouseLeaveAction=[!HideMeter MouseHover] [!HideMeter LightUpChrome] [!CommandMeasure "MeasureFade" "Stop 1"] [!CommandMeasure "MeasureFade" "Execute 2"] [!Redraw]
The black background with alpha 100 that appears while hovering over the icon:

Code: Select all

[LightUpChrome]
Meter=Image
ImageName=Icons\Chrome.png
W=48		
H=48
X=300
Y=820
Hidden=1
The code to make the icons "light up" when hovering over the icon. One per icon, all six are identical which is why I'm only posting the first one:

Code: Select all

[LightUpChrome]
Meter=Image
ImageName=Icons\Chrome.png
W=48		
H=48
X=300
Y=820
Hidden=1
I hope I could properly describe / show my issue and hope someone has an idea how to fix this :thumbup:
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: ActionTimer plugin; FadeOut not working

Post by balala »

Derenaya wrote: December 26th, 2022, 3:16 am I hope I could properly describe / show my issue
Sorry, you couldn't. What is the most important problem is that I don't see how the transparency of any element is affected. I mean that you have an Alpha variable introduced, but doesn't seem to be used. This is the variable which should control the transparency, so accordingly this should set the transparency of the meters like [MeterLaunchChrome] (this is the meter which you're hovering the mouse over to start the fade effect) or probably [Background] (I just assume this). But as said none of these meters is using the #Alpha# variable, which could could control their transparency. To be honest I doubt the posted video has anything to do with the posted code, due to what did I describe above (unless there are some parts of the code which you didn't post).
If the code has some not posted parts, please post the whole code, or even better would be you to pack the config which contains this skin and upload the package here.
Derenaya
Posts: 13
Joined: January 7th, 2018, 3:14 am

Re: ActionTimer plugin; FadeOut not working

Post by Derenaya »

Thank you very much for the quick reply. From what you've wrote I'm starting to think I understood way less than I thought :( Anyway I've attached the whole folder with the launcher in it (first time packing a skin so if I did something wrong don't hesitate to call me out).
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: ActionTimer plugin; FadeOut not working

Post by balala »

Derenaya wrote: December 26th, 2022, 1:07 pm Anyway I've attached the whole folder with the launcher in it (first time packing a skin so if I did something wrong don't hesitate to call me out).
The package is perfect, nothing wrong with it.
The meter which is darkening the screen is the [MouseHover] meter. This meter uses the #Alpha# variable in its ImageAlpha option (ImageAlpha=#Alpha#). This is perfectly right done, nothing wrong with it either. However you're somehow right when you say the fade out effect is not working while the fade in does. In fact the fade out efect is working as well, but you don't see it, because when you're leaving the appropriate meters which are meant to fade out the [MouseHover] meter ([MeterLaunchChrome], [MeterLaunchHideVolumeOSD], [MeterLaunchDiscord] and so on), the [MouseHover] meter is immediately hidden by the first bangs of all MouseLeaveAction options (their first bang is [!HideMeter MouseHover]).
  • First solution: don't hide the meter when you're leaving the meters. For this you can remove the [!HideMeter MouseHover] bangs from all MouseLeaveAction options of all those meters. If you do this, remove the [!ShowMeter MouseHover] bangs from the appropriate MouseOverAction options as well, because if you have no !HideMeter bangs, these become useless.
    If you removed these bangs, remove the Hidden=1 option from the [MouseHover] meter as well, otherwise the meter remains hidden.
    The disadvantage of this approach is that the screen remains dark all the time.
  • A better solution in my opinion is to hide the [MeterHover] meter ONLY when its transparency becomes less than 128. This way you have it visible as long as needed in order to see both effects, but when the fade out effect is completed, the meter is hidden. This is less complicated than it seems at a first look. You have to add only the following options to the [MeasureFade] measure:

    Code: Select all

    [MeasureFade]
    ...
    IfCondition=(#Alpha#<128)
    IfTrueAction=[!HideMeter "MouseHover"][!Redraw]
    IfFalseAction=[!ShowMeter "MouseHover"][!Redraw]
    (Take care not to modify or remove the existing options, just add these ones).
There are a few other things you should take into account related to the code. But first please try to implement the above ones and let me know if you find any of them useful. If you do, I'll be back with the other things as well.
Derenaya
Posts: 13
Joined: January 7th, 2018, 3:14 am

Re: ActionTimer plugin; FadeOut not working

Post by Derenaya »

Thank you very much for your solutions. I've looked at them and decided to go with the second one since that's more in the direction I want to go. However maybe I've misunderstood but don't I have to remove the [!HideMeter MouseHover] either way? I tried it with them still in the code and I'd have the issue that you were mentioning where due to the [MouseHover] being instantly hidden the FadeOut would also not be shown. Also considering that the IfTrueAction now hides the "MouseHover" this seems like logical thing to do.

After removing the !Hide/ShowMeter bangs and adding your conditions the Fades now both work although I've noticed some things that I'd like to iron out if possible:

1. When loading the Launcher Skin / refreshing it the [MouseHover] is active by default. I think this is because I've removed the Hidden=1 from it and the condition only hides if it the Alpha variable falls bellow 128 (which it doesn't without hovering over the icon once)? I tried to get around this by adding the Measure bellow which worked almost perfectly. This seems to cause an issue where both when I first load the skin and also when I refresh it a similar problem described in 2. happens. Basically the [Background] seems to to be gone and in order to hover over an icon I have to hit the exact pixels of it. After doing this once it fixes itself, I'm assuming because of the [!Redraw] bang from the IfEqualAction. Is there a workaround for that / a better way to solve this in general?

Code: Select all

[MeasureOnLoad]
Measure=Calc
Formula=Counter
IfEqualValue=1
IfEqualAction=[!HideMeter "MouseHover"][!Redraw]
IfAboveValue=1
IfAboveAction=[!HideMeter "MouseHover"][!Redraw]
UpdateDivider=-1
2. Hovering my cursor over the icon from one side and then leaving it again at the same side seems to work without any problems. However sometimes when going across the icon (or other cases without a clear reproduction) the [Background] seems to "disappear" leaving me with having to hit the exact pixels of the icons to activate it. This sometimes fixes itself again but often doesn't until I refresh the skin. I'm assuming this is caused by the same / a similar issue that's also responsible for what I wrote at the end of 1.? I uploaded a video of this here: https://www.youtube.com/watch?v=zfszzuKwUVM, also this was recorded before I implemented 1. (still happens in the exact same way though).

One idea I had to fix this is instead of relying on the [Background] to just "fill out" the currently empty part of the icon with the background. Basically making it so the icon is a completely filled icon instead of the current lines with a void next to them. I would like to avoid this though if possible as the current transparent icons would be easier to use with different backgrounds. Is there a different solution? Or maybe I'm completely wrong anyway? :???:

3. I might just be super sensitive but the current transition from the 128 Alpha to the bright desktop is still a bit strenuous to me. Is there a way to make the jump smaller or something?

Here's my current full code:

Code: Select all

[Rainmeter]
Update=100

[MeasureFade]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat FadeIn,20,10
FadeIn=[!SetVariable Alpha "(Clamp((#Alpha#+12.75),0,255))"]#Fade#
ActionList2=Repeat FadeOut,20,10
FadeOut=[!SetVariable Alpha "(Clamp((#Alpha#-12.75),0,255))"]#Fade#
IfCondition=(#Alpha#<128)
IfTrueAction=[!HideMeter "MouseHover"][!Redraw]
IfFalseAction=[!ShowMeter "MouseHover"][!Redraw]
DynamicVariables=1

[Variables]
Fade=[!UpdateMeasure "MeasureFade"][!UpdateMeterGroup "Hover"] [!Redraw]
Alpha=255

[Background]
Meter=Image
ImageName="Background.png"
H=336
W=48
X=0
Y=0
ImageAlpha=1

[MeterLaunchChrome]
Meter=Image
ImageName=Icons\Chrome.png
W=48		
H=48
X=300
Y=820
OnHover=1
LeftMouseUpAction=["%windir%\Brave"]
MouseOverAction=[!ShowMeter LightUpChrome] [!CommandMeasure "MeasureFade" "Execute 1"] [!CommandMeasure "MeasureFade" "Stop 2"] [!Redraw]
MouseLeaveAction=[!HideMeter LightUpChrome] [!CommandMeasure "MeasureFade" "Stop 1"] [!CommandMeasure "MeasureFade" "Execute 2"] [!Redraw]

[MeterLaunchHideVolumeOSD]
Meter=Image
ImageName=Icons\HideVolumeOSD.png
W=48
H=48
X=300
Y=(820+(48+10))
LeftMouseUpAction=["%windir%\HideVolumeOSD"]
MouseOverAction=[!ShowMeter LightUpHideVolumeOSD] [!CommandMeasure "MeasureFade" "Execute 1"] [!CommandMeasure "MeasureFade" "Stop 2"] [!Redraw]
MouseLeaveAction=[!HideMeter LightUpHideVolumeOSD] [!CommandMeasure "MeasureFade" "Stop 1"] [!CommandMeasure "MeasureFade" "Execute 2"] [!Redraw]

[MeterLaunchDiscord]
Meter=Image
ImageName=Icons\Discord.png
W=48
H=48
X=300
Y=(820+((48*2)+20))
LeftMouseUpAction=["%windir%\Discord"]
MouseOverAction=[!ShowMeter LightUpDiscord] [!CommandMeasure "MeasureFade" "Execute 1"] [!CommandMeasure "MeasureFade" "Stop 2"] [!Redraw]
MouseLeaveAction=[!HideMeter LightUpDiscord] [!CommandMeasure "MeasureFade" "Stop 1"] [!CommandMeasure "MeasureFade" "Execute 2"] [!Redraw]

[MeterLaunchDownloads]
Meter=Image
ImageName=Icons\Downloads.png
W=48
H=48
X=300
Y=(820+((48*3)+30))
LeftMouseUpAction=["%windir%\Downloads"]
MouseOverAction=[!ShowMeter LightUpDownloads] [!CommandMeasure "MeasureFade" "Execute 1"] [!CommandMeasure "MeasureFade" "Stop 2"] [!Redraw]
MouseLeaveAction=[!HideMeter LightUpDownloads] [!CommandMeasure "MeasureFade" "Stop 1"] [!CommandMeasure "MeasureFade" "Execute 2"] [!Redraw]

[MeterLaunchPictures]
Meter=Image
ImageName=Icons\Pictures.png
W=48
H=48
X=300
Y=(820+((48*4)+40))
LeftMouseUpAction=["%windir%\Pictures"]
MouseOverAction=[!ShowMeter LightUpPictures] [!CommandMeasure "MeasureFade" "Execute 1"] [!CommandMeasure "MeasureFade" "Stop 2"] [!Redraw]
MouseLeaveAction=[!HideMeter LightUpPictures] [!CommandMeasure "MeasureFade" "Stop 1"] [!CommandMeasure "MeasureFade" "Execute 2"] [!Redraw]

[MeterLaunchDocuments]
Meter=Image
ImageName=Icons\Documents.png
W=48
H=48
X=300
Y=(820+((48*5)+50))
LeftMouseUpAction=["%windir%\Documents"]
MouseOverAction=[!ShowMeter LightUpDocuments] [!CommandMeasure "MeasureFade" "Execute 1"] [!CommandMeasure "MeasureFade" "Stop 2"] [!Redraw]
MouseLeaveAction=[!HideMeter LightUpDocuments] [!CommandMeasure "MeasureFade" "Stop 1"] [!CommandMeasure "MeasureFade" "Execute 2"] [!Redraw]

[MouseHover]
Meter=Image
ImageName="MouseHover.png"
H=1440
W=2560
ImageAlpha=#Alpha#
DynamicVariables=1 
Group=Hover

[LightUpChrome]
Meter=Image
ImageName=Icons\Chrome.png
W=48		
H=48
X=300
Y=820
Hidden=1

[LightUpHideVolumeOSD]
Meter=Image
ImageName=Icons\HideVolumeOSD.png
W=48
H=48
X=300
Y=(820+(48+10))
Hidden=1

[LightUpDiscord]
Meter=Image
ImageName=Icons\Discord.png
W=48
H=48
X=300
Y=(820+((48*2)+20))
Hidden=1

[LightUpDownloads]
Meter=Image
ImageName=Icons\Downloads.png
W=48
H=48
X=300
Y=(820+((48*3)+30))
Hidden=1

[LightUpPictures]
Meter=Image
ImageName=Icons\Pictures.png
W=48
H=48
X=300
Y=(820+((48*4)+40))
Hidden=1

[LightUpDocuments]
Meter=Image
ImageName=Icons\Documents.png
W=48
H=48
X=300
Y=(820+((48*5)+50))
Hidden=1

[MeasureOnLoad]
Measure=Calc
Formula=Counter
IfEqualValue=1
IfEqualAction=[!HideMeter "MouseHover"][!Redraw]
IfAboveValue=1
IfAboveAction=[!HideMeter "MouseHover"][!Redraw]
UpdateDivider=-1
There are a few other things you should take into account related to the code. But first please try to implement the above ones and let me know if you find any of them useful. If you do, I'll be back with the other things as well.
I'd also be very interested to hear any other comments and / or ideas you have :thumbup:
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: ActionTimer plugin; FadeOut not working

Post by balala »

Derenaya wrote: December 26th, 2022, 11:10 pm However maybe I've misunderstood but don't I have to remove the [!HideMeter MouseHover] either way? I tried it with them still in the code and I'd have the issue that you were mentioning where due to the [MouseHover] being instantly hidden the FadeOut would also not be shown. Also considering that the IfTrueAction now hides the "MouseHover" this seems like logical thing to do.
Yep, obviously you have to remove them. My bad I wrote this only on the first method, but I see you've realized what to do. Good job, congratulations and sorry for my mistake.
Derenaya wrote: December 26th, 2022, 11:10 pm 1. When loading the Launcher Skin / refreshing it the [MouseHover] is active by default. I think this is because I've removed the Hidden=1 from it and the condition only hides if it the Alpha variable falls bellow 128 (which it doesn't without hovering over the icon once)? I tried to get around this by adding the Measure bellow which worked almost perfectly. This seems to cause an issue where both when I first load the skin and also when I refresh it a similar problem described in 2. happens. Basically the [Background] seems to to be gone and in order to hover over an icon I have to hit the exact pixels of it. After doing this once it fixes itself, I'm assuming because of the [!Redraw] bang from the IfEqualAction. Is there a workaround for that / a better way to solve this in general?
Adding such a measure is one possibility, however instead I recommend to add the following OnRefreshaction option to the [Rainmeter] section: OnRefreshAction=[!HideMeter "MouseHover"][!Redraw]. With this option you get the meter hidden right when you refresh / activate the skin. No need for an extra measure.
Derenaya wrote: December 26th, 2022, 11:10 pm 2. Hovering my cursor over the icon from one side and then leaving it again at the same side seems to work without any problems. However sometimes when going across the icon (or other cases without a clear reproduction) the [Background] seems to "disappear" leaving me with having to hit the exact pixels of the icons to activate it. This sometimes fixes itself again but often doesn't until I refresh the skin. I'm assuming this is caused by the same / a similar issue that's also responsible for what I wrote at the end of 1.? I uploaded a video of this here: https://www.youtube.com/watch?v=zfszzuKwUVM, also this was recorded before I implemented 1. (still happens in the exact same way though).
Try adding a SolidColor=0,0,0,1 option to all icons ([MeterLaunchChrome], [MeterLaunchHideVolumeOSD], [MeterLaunchDiscord] and so on).
Derenaya wrote: December 26th, 2022, 11:10 pm 3. I might just be super sensitive but the current transition from the 128 Alpha to the bright desktop is still a bit strenuous to me. Is there a way to make the jump smaller or something?
Actually there is an issue with the value of the Alpha variable, set by the !SetVariable bangs of the FadeIn and FadeOut options of the [MeasureFade] measure. With the posted values, the lowest value of the Alpha variable when you're leaving the icons is 127.5. Instead I'd prefere to get it going down to 127. There is an extremely simple solution to get this: you have to replace the constant which is added / extracted to / from the Alpha variable into the two !SetVariable bangs mentioned above to 12.8, instead of the used 12.75:

Code: Select all

[MeasureFade]
...
FadeIn=[!SetVariable Alpha "(Clamp((#Alpha#+12.8),0,255))"]#Fade#
...
FadeOut=[!SetVariable Alpha "(Clamp((#Alpha#-12.8),0,255))"]#Fade#
...
But there is even more you can do. You can increase the number of repetitions when varying the variable. Right now you get the increasing / decreasing of the Alpha variable in 10 steps. You can modify a little bit the [MeasureFade] measure for instance this way:

Code: Select all

[MeasureFade]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat FadeIn,20,20
FadeIn=[!SetVariable Alpha "(Clamp((#Alpha#+6.4),0,255))"]#Fade#
ActionList2=Repeat FadeOut,20,20
FadeOut=[!SetVariable Alpha "(Clamp((#Alpha#-6.4),0,255))"]#Fade#
IfCondition=(#Alpha#<128)
IfTrueAction=[!HideMeter "MouseHover"][!Redraw]
IfFalseAction=[!ShowMeter "MouseHover"][!Redraw]
DynamicVariables=1
See that I replaced the previous value of the constant (was 12.75 initially and has been modified above to 12.8), by 6.4. But with this you have to get more iterations (or consecutive executions of the ActionTimer plugin measure) to can get the same final values for the variable as previously. This is why the last number set in the FadeIn and FadeOut options have been also increased from 10 to 20.
Obviously you can set any other - greater or lower - value for these parameters. Just keep in mind to get the proper final values for the Alpha variable, after executing the measure in any direction.
Derenaya wrote: December 26th, 2022, 11:10 pm I'd also be very interested to hear any other comments and / or ideas you have :thumbup:
  • Why did you use such a low Update value in the [Rainmeter] section (Update=100)? I think using the normal or default Update=1000 is much better (Update=100 means one update per 100 milliseconds, so 10 updates per second, while Update=1000 means one update per second - a perfectly good value). The variation of the variable being controlled by an ActionTimer plugin measure, no need for a too low Update.
  • OnHover is not a valid option on meters. You did use this option on the [MeterLaunchChrome] meter, but can be used only on the Skins sections of the Rainmeter.ini settings file (accessible for instance when you right click the Rainmeter icon in the Notification Area and click Edit settings). Even if it doesn't cause any trouble, recommend removing it.
  • Not sure why did you add the second set of icons ([LightUpChrome], [LightUpHideVolumeOSD], [LightUpDiscord] and so on). Or in fact I think I know, but this is a completely not needed thing. The less measures and meters you have, the better. There is another way to get the meters light up when the [MouseHover] meter is hidden. But if you don't know how to do this, I think it's better to be discussed next time.
Derenaya
Posts: 13
Joined: January 7th, 2018, 3:14 am

Re: ActionTimer plugin; FadeOut not working

Post by Derenaya »

Code: Select all

Adding such a measure is one possibility, however instead I recommend to add the following OnRefreshaction option to the [Rainmeter] section: OnRefreshAction=[!HideMeter "MouseHover"][!Redraw]. With this option you get the meter hidden right when you refresh / activate the skin. No need for an extra measure.
Oh. Well that is certainly a way easier, thanks :D Unsure if related but after loading / refreshing the skin the [FadeMeasure] doesn't seem to work for the first time hovering over an icon. Probably because the [MouseHover] now starts out hidden and the IfFalseAction=[!ShowMeter "MouseHover"][!Redraw] from the [MeasureFade] doesn't get triggered until it ran through the cycle at least once? Even if that's the case I'm not sure how to fix it :???:

Code: Select all

Try adding a SolidColor=0,0,0,1 option to all icons ([MeterLaunchChrome], [MeterLaunchHideVolumeOSD], [MeterLaunchDiscord] and so on).
This worked, thank you. :thumbup: Honestly looking back I should have thought of this myself, especially since I also saw it in other skins.

Code: Select all

Obviously you can set any other - greater or lower - value for these parameters. Just keep in mind to get the proper final values for the Alpha variable, after executing the measure in any direction.
I see, this is certainly very useful for playing around with the values. However I probably didn't properly describe what I meant with the "jump". From my understanding the FadOut "animation" currently works like this:
Mouse cursor leaves the icon -> FadeOut starts with 20 steps until it reaches an Alpha value of 128 -> the [MouseHover] is instantly hidden by the IfTrueAction=[!HideMeter "MouseHover"][!Redraw] command in the [MeasureFade]
The first (green) part of the FadOut looks perfect to me but then the [MouseHover] gets hidden as soon as the Alpha variable hits <128 it causes a "jump" to the desktop. Basically compared to my first attempt doesn't this only add a fade from the Alpha 255 -> 128 and the 128 -> 0 happens instantly? In my mind this would be fixed with a continual fade animation from Alpha=255 to Alpha=0 but I'm unsure if that's possible / I'm seeing this correctly and not mixing stuff up.

Code: Select all

Why did you use such a low Update value in the [Rainmeter] section (Update=100)? I think using the normal or default Update=1000 is much better (Update=100 means one update per 100 milliseconds, so 10 updates per second, while Update=1000 means one update per second - a perfectly good value). The variation of the variable being controlled by an ActionTimer plugin measure, no need for a too low Update.
I think when I started to work on the skin the [MouseHover] part worked better with an Update of 100. This might just have been placebo though but at the end I just forgot to change it back. Since I also have a Ryzen 9 5900X I'm not worried about performance, especially since when I use the launcher I don't have anything open that would require my CPU. However better efficiency is of course always better and since it now works the same on 1000 I changed it back :thumbup:

Code: Select all

OnHover is not a valid option on meters. You did use this option on the [MeterLaunchChrome] meter, but can be used only on the Skins sections of the Rainmeter.ini settings file (accessible for instance when you right click the Rainmeter icon in the Notification Area and click Edit settings). Even if it doesn't cause any trouble, recommend removing it.
That's what I get for not properly reading the documentation I guess :oops: Thanks for the heads up!

Code: Select all

Not sure why did you add the second set of icons ([LightUpChrome], [LightUpHideVolumeOSD], [LightUpDiscord] and so on). Or in fact I think I know, but this is a completely not needed thing. The less measures and meters you have, the better. There is another way to get the meters light up when the [MouseHover] meter is hidden. But if you don't know how to do this, I think it's better to be discussed next time.
When I was thinking about how I'd get the effect of my icons "lighting up" when hovering over them that was the first solution that I could think of and since it also worked as intended I just kept it that way. But if there's a better way to have this effect then I'd be interested in learning about it.

Current code:

Code: Select all

[Rainmeter]
Update=1000
OnRefreshAction=[!HideMeter "MouseHover"][!Redraw]

[MeasureFade]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat FadeIn,20,20
FadeIn=[!SetVariable Alpha "(Clamp((#Alpha#+6.4),0,255))"]#Fade#
ActionList2=Repeat FadeOut,20,20
FadeOut=[!SetVariable Alpha "(Clamp((#Alpha#-6.4),0,255))"]#Fade#
IfCondition=(#Alpha#<128)
IfTrueAction=[!HideMeter "MouseHover"][!Redraw]
IfFalseAction=[!ShowMeter "MouseHover"][!Redraw]
DynamicVariables=1

[Variables]
Fade=[!UpdateMeasure "MeasureFade"][!UpdateMeterGroup "Hover"] [!Redraw]
Alpha=255

[MeterLaunchChrome]
Meter=Image
ImageName=Icons\Chrome.png
W=48		
H=48
X=300
Y=820
LeftMouseUpAction=["%windir%\Brave"]
MouseOverAction=[!ShowMeter LightUpChrome] [!CommandMeasure "MeasureFade" "Execute 1"] [!CommandMeasure "MeasureFade" "Stop 2"] [!Redraw]
MouseLeaveAction=[!HideMeter LightUpChrome] [!CommandMeasure "MeasureFade" "Stop 1"] [!CommandMeasure "MeasureFade" "Execute 2"] [!Redraw]
SolidColor=0,0,0,1

[MeterLaunchHideVolumeOSD]
Meter=Image
ImageName=Icons\HideVolumeOSD.png
W=48
H=48
X=300
Y=(820+(48+10))
LeftMouseUpAction=["%windir%\HideVolumeOSD"]
MouseOverAction=[!ShowMeter LightUpHideVolumeOSD] [!CommandMeasure "MeasureFade" "Execute 1"] [!CommandMeasure "MeasureFade" "Stop 2"] [!Redraw]
MouseLeaveAction=[!HideMeter LightUpHideVolumeOSD] [!CommandMeasure "MeasureFade" "Stop 1"] [!CommandMeasure "MeasureFade" "Execute 2"] [!Redraw]
SolidColor=0,0,0,1

[MeterLaunchDiscord]
Meter=Image
ImageName=Icons\Discord.png
W=48
H=48
X=300
Y=(820+((48*2)+20))
LeftMouseUpAction=["%windir%\Discord"]
MouseOverAction=[!ShowMeter LightUpDiscord] [!CommandMeasure "MeasureFade" "Execute 1"] [!CommandMeasure "MeasureFade" "Stop 2"] [!Redraw]
MouseLeaveAction=[!HideMeter LightUpDiscord] [!CommandMeasure "MeasureFade" "Stop 1"] [!CommandMeasure "MeasureFade" "Execute 2"] [!Redraw]
SolidColor=0,0,0,1

[MeterLaunchDownloads]
Meter=Image
ImageName=Icons\Downloads.png
W=48
H=48
X=300
Y=(820+((48*3)+30))
LeftMouseUpAction=["%windir%\Downloads"]
MouseOverAction=[!ShowMeter LightUpDownloads] [!CommandMeasure "MeasureFade" "Execute 1"] [!CommandMeasure "MeasureFade" "Stop 2"] [!Redraw]
MouseLeaveAction=[!HideMeter LightUpDownloads] [!CommandMeasure "MeasureFade" "Stop 1"] [!CommandMeasure "MeasureFade" "Execute 2"] [!Redraw]
SolidColor=0,0,0,1

[MeterLaunchPictures]
Meter=Image
ImageName=Icons\Pictures.png
W=48
H=48
X=300
Y=(820+((48*4)+40))
LeftMouseUpAction=["%windir%\Pictures"]
MouseOverAction=[!ShowMeter LightUpPictures] [!CommandMeasure "MeasureFade" "Execute 1"] [!CommandMeasure "MeasureFade" "Stop 2"] [!Redraw]
MouseLeaveAction=[!HideMeter LightUpPictures] [!CommandMeasure "MeasureFade" "Stop 1"] [!CommandMeasure "MeasureFade" "Execute 2"] [!Redraw]
SolidColor=0,0,0,1

[MeterLaunchDocuments]
Meter=Image
ImageName=Icons\Documents.png
W=48
H=48
X=300
Y=(820+((48*5)+50))
LeftMouseUpAction=["%windir%\Documents"]
MouseOverAction=[!ShowMeter LightUpDocuments] [!CommandMeasure "MeasureFade" "Execute 1"] [!CommandMeasure "MeasureFade" "Stop 2"] [!Redraw]
MouseLeaveAction=[!HideMeter LightUpDocuments] [!CommandMeasure "MeasureFade" "Stop 1"] [!CommandMeasure "MeasureFade" "Execute 2"] [!Redraw]
SolidColor=0,0,0,1

[MouseHover]
Meter=Image
ImageName="MouseHover.png"
H=1440
W=2560
ImageAlpha=#Alpha#
DynamicVariables=1 
Group=Hover

[LightUpChrome]
Meter=Image
ImageName=Icons\Chrome.png
W=48		
H=48
X=300
Y=820
Hidden=1

[LightUpHideVolumeOSD]
Meter=Image
ImageName=Icons\HideVolumeOSD.png
W=48
H=48
X=300
Y=(820+(48+10))
Hidden=1

[LightUpDiscord]
Meter=Image
ImageName=Icons\Discord.png
W=48
H=48
X=300
Y=(820+((48*2)+20))
Hidden=1

[LightUpDownloads]
Meter=Image
ImageName=Icons\Downloads.png
W=48
H=48
X=300
Y=(820+((48*3)+30))
Hidden=1

[LightUpPictures]
Meter=Image
ImageName=Icons\Pictures.png
W=48
H=48
X=300
Y=(820+((48*4)+40))
Hidden=1

[LightUpDocuments]
Meter=Image
ImageName=Icons\Documents.png
W=48
H=48
X=300
Y=(820+((48*5)+50))
Hidden=1
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: ActionTimer plugin; FadeOut not working

Post by balala »

Derenaya wrote: December 28th, 2022, 1:04 am Unsure if related but after loading / refreshing the skin the [FadeMeasure] doesn't seem to work for the first time hovering over an icon. Probably because the [MouseHover] now starts out hidden and the IfFalseAction=[!ShowMeter "MouseHover"][!Redraw] from the [MeasureFade] doesn't get triggered until it ran through the cycle at least once? Even if that's the case I'm not sure how to fix it :???:
I assume by [FadeMeasure] you meant [MeasureFade], right? Just because a [FadeMeasure] measure doesn't exist (sorry, definitely don't want to nitpick, hope you don't mind).
It does, but there is another problem. The initial value of the Alpha variable is set to 255 (Alpha=255 in the [Variables] section). When you're hovering the mouse over any icon the value of this variable should increase from 127 to 255. But it being set from the beginning to 255, nothing happens. You don't see the [MouseHover] meter, because you got it hidden by the OnRefreshaCtion option of the [Rainmeter] section (but see my second reply below as well).
Derenaya wrote: December 28th, 2022, 1:04 am Honestly looking back I should have thought of this myself, especially since I also saw it in other skins.
The explanation of this trick is extremely simple: by adding a SolidColor=0,0,0,1 you get a not completely transparent color on the icons (the transparency of these colors is set to 1 from 255), which however can't be seen with naked eye. But this is completely enough to interact with the mouse operations (for instance mouse hovering) (sorry if you know this).
Derenaya wrote: December 28th, 2022, 1:04 am I see, this is certainly very useful for playing around with the values. However I probably didn't properly describe what I meant with the "jump". From my understanding the FadOut "animation" currently works like this:
Mouse cursor leaves the icon -> FadeOut starts with 20 steps until it reaches an Alpha value of 128 -> the [MouseHover] is instantly hidden by the IfTrueAction=[!HideMeter "MouseHover"][!Redraw] command in the [MeasureFade]
The first (green) part of the FadOut looks perfect to me but then the [MouseHover] gets hidden as soon as the Alpha variable hits <128 it causes a "jump" to the desktop. Basically compared to my first attempt doesn't this only add a fade from the Alpha 255 -> 128 and the 128 -> 0 happens instantly? In my mind this would be fixed with a continual fade animation from Alpha=255 to Alpha=0 but I'm unsure if that's possible / I'm seeing this correctly and not mixing stuff up.
Right, now I see what did you talk about.
The solution is pretty simple: replace the value added and substracted to / from the Alpha variable into the FadeIn and FadeOut options of the [MeasureFade] measure, to get the variable varying from 0 to 255 (and vice-versa, when needed). Replace the 6.4 value of this parameter by 12.75:

Code: Select all

[MeasureFade]
...
FadeIn=[!SetVariable Alpha "(Clamp((#Alpha#+12.75),0,255))"]#Fade#
...
FadeOut=[!SetVariable Alpha "(Clamp((#Alpha#-12.75),0,255))"]#Fade#
...
The Alpha variable varied between 127 and 255 in your first code, posted in your initial post, this is why I assumed these are the limits between which you want to vary the variable.
Anyway if you did this, replace the comparation of the value of Alpha variable in the IfCondition option of the [MeasureFade] by 0: IfCondition=(#Alpha#=0) (take care that I also replaced the < symbol by = and marked it red above).
At this point, I'd also replace the initial value of this variable by 0 in the [Variables] section. So replace the Alpha=255 by Alpha=0. This step makes completely useless both, the OnRefreshAction and the IfCondition / IfTrueAction / IfFalseAction options of the [Rainmeter] and [MeasureFade] sections. Much - much more simple and natural in my opinion. So, if you replaced the Alpha variable remove the OnRefreshAction and the IfCondition set as well, as described, they not being needed anymore.
Derenaya wrote: December 28th, 2022, 1:04 am When I was thinking about how I'd get the effect of my icons "lighting up" when hovering over them that was the first solution that I could think of and since it also worked as intended I just kept it that way. But if there's a better way to have this effect then I'd be interested in learning about it.
Ok, let's leave this once again for a next time (hope you don't mind, but I think there have been lot of things discussed above).

One more trick: when you want to quote something, don't use the Code display button:
Code.png
Instead click the Reply with quote button, directly in the post you want to quote:
Quote.png
It's looking much better and even more, it can be seen better what did you reply to.
You do not have the required permissions to view the files attached to this post.
Derenaya
Posts: 13
Joined: January 7th, 2018, 3:14 am

Re: ActionTimer plugin; FadeOut not working

Post by Derenaya »

Okay, your explanation make a lot of sense and after changing what you've mentioned it now works perfectly, thanks a lot :thumbup:
As for the codes instead of quotes, I know but uh, yeah not sure what to say. I guess it was just too late and I didn't notice it, sorry for that :?
Ok, let's leave this once again for a next time (hope you don't mind, but I think there have been lot of things discussed above).
I was thinking of some other ways to get the light up effect but they either didn't use less meters or I didn't know how to go about it in practice (using a !SetOption bang for example) so I'd be very interested to see how you'd do it.

Current code:

Code: Select all

[Rainmeter]
Update=1000

[MeasureFade]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat FadeIn,20,20
FadeIn=[!SetVariable Alpha "(Clamp((#Alpha#+12.75),0,255))"]#Fade#
ActionList2=Repeat FadeOut,20,20
FadeOut=[!SetVariable Alpha "(Clamp((#Alpha#-12.75),0,255))"]#Fade#
IfTrueAction=[!HideMeter "MouseHover"][!Redraw]
IfFalseAction=[!ShowMeter "MouseHover"][!Redraw]
DynamicVariables=1

[Variables]
Fade=[!UpdateMeasure "MeasureFade"][!UpdateMeterGroup "Hover"] [!Redraw]
Alpha=0

[MeterLaunchChrome]
Meter=Image
ImageName=Icons\Chrome.png
W=48		
H=48
X=300
Y=820
LeftMouseUpAction=["%windir%\Brave"]
MouseOverAction=[!ShowMeter LightUpChrome] [!CommandMeasure "MeasureFade" "Execute 1"] [!CommandMeasure "MeasureFade" "Stop 2"] [!Redraw] [!SetOption MeterLauncherChrome Alpha 255]
MouseLeaveAction=[!HideMeter LightUpChrome] [!CommandMeasure "MeasureFade" "Stop 1"] [!CommandMeasure "MeasureFade" "Execute 2"] [!Redraw]
SolidColor=0,0,0,1

[MeterLaunchHideVolumeOSD]
Meter=Image
ImageName=Icons\HideVolumeOSD.png
W=48
H=48
X=300
Y=(820+(48+10))
LeftMouseUpAction=["%windir%\HideVolumeOSD"]
MouseOverAction=[!ShowMeter LightUpHideVolumeOSD] [!CommandMeasure "MeasureFade" "Execute 1"] [!CommandMeasure "MeasureFade" "Stop 2"] [!Redraw]
MouseLeaveAction=[!HideMeter LightUpHideVolumeOSD] [!CommandMeasure "MeasureFade" "Stop 1"] [!CommandMeasure "MeasureFade" "Execute 2"] [!Redraw]
SolidColor=0,0,0,1

[MeterLaunchDiscord]
Meter=Image
ImageName=Icons\Discord.png
W=48
H=48
X=300
Y=(820+((48*2)+20))
LeftMouseUpAction=["%windir%\Discord"]
MouseOverAction=[!ShowMeter LightUpDiscord] [!CommandMeasure "MeasureFade" "Execute 1"] [!CommandMeasure "MeasureFade" "Stop 2"] [!Redraw]
MouseLeaveAction=[!HideMeter LightUpDiscord] [!CommandMeasure "MeasureFade" "Stop 1"] [!CommandMeasure "MeasureFade" "Execute 2"] [!Redraw]
SolidColor=0,0,0,1

[MeterLaunchDownloads]
Meter=Image
ImageName=Icons\Downloads.png
W=48
H=48
X=300
Y=(820+((48*3)+30))
LeftMouseUpAction=["%windir%\Downloads"]
MouseOverAction=[!ShowMeter LightUpDownloads] [!CommandMeasure "MeasureFade" "Execute 1"] [!CommandMeasure "MeasureFade" "Stop 2"] [!Redraw]
MouseLeaveAction=[!HideMeter LightUpDownloads] [!CommandMeasure "MeasureFade" "Stop 1"] [!CommandMeasure "MeasureFade" "Execute 2"] [!Redraw]
SolidColor=0,0,0,1

[MeterLaunchPictures]
Meter=Image
ImageName=Icons\Pictures.png
W=48
H=48
X=300
Y=(820+((48*4)+40))
LeftMouseUpAction=["%windir%\Pictures"]
MouseOverAction=[!ShowMeter LightUpPictures] [!CommandMeasure "MeasureFade" "Execute 1"] [!CommandMeasure "MeasureFade" "Stop 2"] [!Redraw]
MouseLeaveAction=[!HideMeter LightUpPictures] [!CommandMeasure "MeasureFade" "Stop 1"] [!CommandMeasure "MeasureFade" "Execute 2"] [!Redraw]
SolidColor=0,0,0,1

[MeterLaunchDocuments]
Meter=Image
ImageName=Icons\Documents.png
W=48
H=48
X=300
Y=(820+((48*5)+50))
LeftMouseUpAction=["%windir%\Documents"]
MouseOverAction=[!ShowMeter LightUpDocuments] [!CommandMeasure "MeasureFade" "Execute 1"] [!CommandMeasure "MeasureFade" "Stop 2"] [!Redraw]
MouseLeaveAction=[!HideMeter LightUpDocuments] [!CommandMeasure "MeasureFade" "Stop 1"] [!CommandMeasure "MeasureFade" "Execute 2"] [!Redraw]
SolidColor=0,0,0,1

[MouseHover]
Meter=Image
ImageName="MouseHover.png"
H=1440
W=2560
ImageAlpha=#Alpha#
DynamicVariables=1 
Group=Hover

[LightUpChrome]
Meter=Image
ImageName=Icons\Chrome.png
W=48		
H=48
X=300
Y=820
Hidden=1

[LightUpHideVolumeOSD]
Meter=Image
ImageName=Icons\HideVolumeOSD.png
W=48
H=48
X=300
Y=(820+(48+10))
Hidden=1

[LightUpDiscord]
Meter=Image
ImageName=Icons\Discord.png
W=48
H=48
X=300
Y=(820+((48*2)+20))
Hidden=1

[LightUpDownloads]
Meter=Image
ImageName=Icons\Downloads.png
W=48
H=48
X=300
Y=(820+((48*3)+30))
Hidden=1

[LightUpPictures]
Meter=Image
ImageName=Icons\Pictures.png
W=48
H=48
X=300
Y=(820+((48*4)+40))
Hidden=1

[LightUpDocuments]
Meter=Image
ImageName=Icons\Documents.png
W=48
H=48
X=300
Y=(820+((48*5)+50))
Hidden=1
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: ActionTimer plugin; FadeOut not working

Post by balala »

Derenaya wrote: December 29th, 2022, 12:37 am Okay, your explanation make a lot of sense and after changing what you've mentioned it now works perfectly, thanks a lot :thumbup:
:thumbup:
Derenaya wrote: December 29th, 2022, 12:37 am As for the codes instead of quotes, I know but uh, yeah not sure what to say. I guess it was just too late and I didn't notice it, sorry for that :?
Don't worry, it happens anyone from time to time. Just me couldn't keep my mouth shut...
Derenaya wrote: December 29th, 2022, 12:37 am I was thinking of some other ways to get the light up effect but they either didn't use less meters or I didn't know how to go about it in practice (using a !SetOption bang for example) so I'd be very interested to see how you'd do it.
The first and simplest solution is to remove the [LightUp...] meters ([LightUpChrome], [LightUpHideVolumeOSD], [LightUpDiscord] and so on) - or at least comment them out. Obviously accordingly the appropriate [!ShowMeter LightUp...] and [!HideMeter LightUp...] bangs should also be removed from the MouseOverAction and MouseLeaveAction options of the "main" meters ([MeterLaunchChrome], [MeterLaunchHideVolumeOSD], [MeterLaunchDiscord] and so on), but for first leave them there, just to see how this solution works.
Now move the [MouseHover] meter before [MeterLaunchChrome]. This way the [MouseHover] meter doesn't hides the icons when it's darkened.