Yincognito wrote: ↑October 15th, 2020, 2:31 am
Yeah, I know why that happens, actually - will take a look at it tomorrow. It's not that the animation doesn't start, because it does - it's just that it only plays 1 frame (because that's what my scenario looked like), while in your case playing the animation once means playing all 36 frames one time. This is why it appears to not work.
Couldn't help it but solve this "today":
Code: Select all
[Variables]
Frame=0
FrameCount=36
Speed=50
U=[!UpdateMeasure MeasureSlider][!UpdateMeter MeterButterflies][!UpdateMeter MeterFrame][!Redraw]
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
BackgroundMode=2
SolidColor=0,0,0,1
---Measures---
[MeasureSlider]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Reset | Wait #Speed# | Repeat Slide,#Speed#,#FrameCount# | Wait #Speed#
ActionList2=Repeat Slide,#Speed#,#FrameCount# | Wait #Speed# | Rerun | Wait #Speed#
Reset=[!SetVariable Frame 0]#U#
Slide=[!SetVariable Frame ((#Frame#+1)%#FrameCount#)]#U#
Rerun=[!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Execute 2"]
UpdateDivider=-1
DynamicVariables=1
---Meters---
[MeterButterflies]
Meter=Image
ImageName=#@#tmp-#Frame#.png
UpdateDivider=-1
LeftMouseUpAction=[!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Execute 2"]
MiddleMouseUpAction=[!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!CommandMeasure MeasureSlider "Execute 1"]
RightMouseUpAction=[!CommandMeasure MeasureSlider "Stop 1"][!CommandMeasure MeasureSlider "Stop 2"][!SetVariable Frame 0]#U#
DynamicVariables=1
[MeterFrame]
Hidden=0
Meter=String
X=([MeterButterflies:W]/2)r
FontFace=Segoe UI
FontSize=8
FontWeight=700
StringAlign=Center
FontColor=220,220,220,255
SolidColor=0,0,0,150
AntiAlias=1
Text="Frame#CRLF##Frame#"
UpdateDivider=-1
DynamicVariables=1
As you can see, the difference is mainly that I replaced the single
Slide in the two action lists with a
Repeat Slide,#Speed#,#FrameCount#, so that a full animation is performed in both cases. That being said, when the animation is arbitrarily stopped, the
Frame variable was left unchanged, so if I stopped the animation when
Frame was 25 and then start a "one time" animation, that animation would start at 25 and continue until 36 frames after 25 ... which was again 25. I imagined that was not the desired behavior, so I added a
[!SetVariable Frame 0]#U# part, to reset the
Frame variable to 0. This should be normally used either after the actions have been stopped, between the stop and a subsequent execution, or simply before any execution. Because I didn't know how you prefer it, I left one instance at the end of the action stopping in
RightMouseUpAction, but I also included as an action name named
Reset in the Action Timer measure itself. Basically, it's up to you to choose how to use the
[!SetVariable Frame 0]#U# part:
- if you want to reset the frame to 0 after stop, then add it after stopping the 2nd action, outside the ActionTimer measure
- if you want the "drop" to stay in the air (so to speak) when stopping the animation (e.g. a "pause" effect) and only reset the frame to 0 when starting a subsequent animation, then either add before executes, outside the ActionTimer measure, or keep it as the action named
Reset in the ActionTimer measure
- or, you can keep them both as they are, even though it's a bit redundant as it is, since the reset now happens both at the end of stopping the actions and also at the start of a one time animation (though it doesn't affect the functionality in any way)
P.S. You probably noticed that I had to add another mouse action to the mix in the sample, so since the right click up is taken, you'll have to hold the CTRL key to access the skin context menu. In any case, feel free to adapt it and integrate it in your skin as you like.
And yes, executing an action can only be expressed by the
[!CommandMeasure SomeMeasure "Execute N"] bangs. Me adding the action list name or action name in the earlier post was just to make it clearer what happened in those bangs, that's all. It was not meant to suggest that there are alternative syntaxes to the bang above.