It is currently March 29th, 2024, 5:16 am

Animated Skin Update Value

Get help with creating, editing & fixing problems with skins
User avatar
shAdowz
Posts: 63
Joined: May 15th, 2015, 9:30 am

Animated Skin Update Value

Post by shAdowz »

Been a while since I posted here. :welcome:

Anyways, I'm recently learned how to create animated skins by using a GIF then extracting the frames from that GIF and using a counter calc measure (As explained in the Tips & Tricks section of the Rainmeter Manual). My question is, if I have X number of frames in my gif, what would be the corresponding value for the Update in order for the animation speed to be the same as the gif? I tried as low as 16 for the Update but sometimes, especially when the gif has a few frames only, the animation is faster than in the gif.

Also, I did a little research in here and found a reply on a thread which says it's preferable to use ActionTimer for animations instead of giving very low values for Update. How do you use ActionTimer for animations?

Thanks for any reply!
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Animated Skin Update Value

Post by jsmorley »

Not sure there is any sure way to get the timing the same, as one of the elements embedded in the .gif file, that is not captured when the frames are extracted, is the number of milliseconds between each frame, and any other delays that might be in it.

I think you just have to "eyeball" it.

Here are two ways to animate your frames.

1) Using a Loop measure, driven by Update
2) Using an ActionTimer measure, driven by the variable #W# (wait time). Update doesn't matter in this case, and can be 1000.

BOTH are using a timing of 20 milliseconds between frames... Update=20 and #W# is 20. Change those values to change the speed.

Code: Select all

[Rainmeter]
Update=20
DynamicWindowSize=1
AccurateText=1

[Variables]
Frame=0
W=20
U=[!UpdateMeasure MeasureActionTimer][!UpdateMeter MeterAnimateTimer][!Redraw]

[MeasureLoop]
Measure=Loop
StartValue=0
EndValue=89
LoopCount=1
Disabled=1

[MeterAnimateLoop]
Meter=Image
MeasureName=MeasureLoop
ImagePath=#@#Images\
ImageName=Frame-%1.png
LeftMouseUpAction=[!EnableMeasure MeasureLoop][!CommandMeasure MeasureLoop "Reset"]

[MeasureActionTimer]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat CountUp, #W#, 89 | Wait #W# | StartOver
CountUp=[!SetVariable Frame "(Clamp(#Frame#+1,0,89))"]#U#
StartOver=[!SetVariable Frame "0"]#U#
DynamicVariables=1

[MeterAnimateTimer]
Meter=Image
X=10R
ImagePath=#@#Images\
ImageName=Frame-#Frame#.png
DynamicVariables=1
LeftMouseUpAction=[!CommandMeasure MeasureActionTimer "Execute 1"]
Looks something like this:
GIF.gif
AnimatedGif_1.0.rmskin
The both work more or less identically, I guess the determining factor is whether you want to have a low Update rate in your skin, and have to set UpdateDivider on a bunch of other stuff you don't want that fast. No doubt that while probably minor unless the skin is huge and complicated, an Update of 20, no matter how you manage all other measures and meters, will be a bit less efficient than a skin with an Update of 1000, with the animation isolated in its own thread, driven by ActionTimer.

However: If you intend for this animation to be in an endless repeat cycle, then DON'T use ActionTimer. It's not designed or intended for endless animations. You don't want an endless animated .gif on your desktop anyway. That's just the most annoying thing I have ever heard of...
You do not have the required permissions to view the files attached to this post.
User avatar
shAdowz
Posts: 63
Joined: May 15th, 2015, 9:30 am

Re: Animated Skin Update Value

Post by shAdowz »

Thanks for the quick reply!

I hate to be a bummer but I do want an animated gif as a wallpaper. lol

So I guess I won't have to use ActionTimer for this one. But isn't it better to use ActionTimer? Based on what I have learned, having a low Update value is very costly for the CPU.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Animated Skin Update Value

Post by jsmorley »

shAdowz wrote:Thanks for the quick reply!

I hate to be a bummer but I do want an animated gif as a wallpaper. lol

So I guess I won't have to use ActionTimer for this one. But isn't it better to use ActionTimer? Based on what I have learned, having a low Update value is very costly for the CPU.
There is no way we recommend to have an endless animation with ActionTimer. That is just not what it is designed for. So you are going to have to do your annoying "kill me now" animated wallpaper using a Loop measure, and live with the fact that you are going to use probably 10-15% of your CPU driving a full-screen animation.
User avatar
shAdowz
Posts: 63
Joined: May 15th, 2015, 9:30 am

Re: Animated Skin Update Value

Post by shAdowz »

Hmm. I've observed the usage by looking at the Task Manager. It does take a lot of CPU. Well then I think I have to find another way to afford an animated wallpaper. Or maybe not.

Anyway thanks for the tips on doing animation. Atleast it added to my knowledge of what Rainmeter can and can not do.