It is currently April 23rd, 2024, 5:30 am

How to display animation in Rainmeter

Tips and Tricks from the Rainmeter Community
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: How to display animation in Rainmeter

Post by jsmorley »

Might want to look at something like:

Code: Select all

[ImageNumberCalc]
Measure=Loop
StartValue=0
EndValue=7080
RegExpSubstitute=1
Substitute="^(\d)$":"0000\1","^(\d\d)$":"000\1","^(\d\d\d)$":"00\1","^(\d\d\d\d)$":"0\1"

[ImageMeter]
Meter=Image
ImageName=#@#ImagesFrames\IMG[ImageNumberCalc].bmp
AntiAlias=1
DynamicVariables=1
That will loop from 0 to 7080, it will then use substitute to add the correct number of leading zeroes on the number, so when you use the measure's string value appended to "IMG" in the file name, it should be correct.

https://docs.rainmeter.net/manual-beta/measures/loop/
https://docs.rainmeter.net/manual-beta/measures/general-options/substitute/#RegExpSubstitute
https://docs.rainmeter.net/manual-beta/skins/option-types/#RegExp
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: How to display animation in Rainmeter

Post by jsmorley »

P.S. The Counter function will work as well, the main difference is that Counter is not reset on a refresh of the skin, but only starts with "0" when the skin is first loaded. The Loop measure will restart on any refresh of the skin. Depends on the behavior you want.

https://docs.rainmeter.net/manual-beta/measures/calc/#Formulas
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: How to display animation in Rainmeter

Post by ikarus1969 »

jsmorley wrote:Might want to look at something like:

Code: Select all

...
Substitute="^(\d)$":"0000\1","^(\d\d)$":"000\1","^(\d\d\d)$":"00\1","^(\d\d\d\d)$":"0\1"
...
as often there are more than 1 way to code. So another approach for the substitute could be:

Code: Select all

Substitute="^(\d*)$":"00000\1","^.*(\d{5,5})$":"\1"
xTurtleZ
Posts: 3
Joined: December 21st, 2016, 12:29 pm

Re: How to display animation in Rainmeter

Post by xTurtleZ »

ohh

that made it work! thanks!!
looks real good, the lower fps actually makes it look less spacey.

heres a short clip ofwhat it looks like now: https://gyazo.com/7f708c68b3269a5f7fa6d5eedb3966a1

and where i got it from: https://www.youtube.com/watch?v=ddJiP3jRVJ8

and you guys for helping out ofcourse :)

i'd like to get more into making these things myself, not much free time lately..

thanks again
:welcome:
Wiebenor
Posts: 4
Joined: June 14th, 2018, 5:11 am

Re: How to display animation in Rainmeter

Post by Wiebenor »

So... I have a problem that I'd like anyone who has any information on filmstrips in general, and specifically filmstrips in relation to rainmeter animations to try and help me with... for backstory, I have a homemade rainmeter skin based off of another skin, basically a-la script kiddie style, where I am editing a copy of the script folder and subfolders, as well as files, with a new name and a filmstrip made in GIMP, of a set of images, to create the look of a girl walking... it's rather large though, at 641 pixels high, (assuming 1080p monitor settings) and I've found that for whatever reason, if I make it smaller I get a slight sideways movement of my desktop animation, at the end of my filmstrip...

My question is, is there a way to combat this issue I'm having where scaling down the GIMP image, to half the original dimensions? Here's basically what my rainmeter script file looks like, for anyone who is wondering, assuming that it might help... Of course, the easiest thing would be to just enable widget resizing in rainmeter, but I digress...

As promised here's what my rainmeter skin config file looks like...

*Rainmeter script top*

Code: Select all

[Rainmeter]
Update=50

[MeasureAnimation]
Measure=CALC
Formula=Counter % 35

[MeterAnimation]
Meter=BITMAP
MeasureName=MeasureAnimation
BitmapImage=#@#Images\filmstrip\girl.tif
BitmapFrames=35
BitmapExtend=35
*Rainmeter script bottom*


remember, this is basically just a copied script from another animation skin, where the only substantive change is the number of frames, (which changes depending on which figure I am using that I have access to) and the (script/base folder) names. Is there something I can do to combat the moving filmstrip look, or do I have to just start over with a new set of (smaller dimension) files, and recreate the filmstrip from scratch? I'd really rather just edit filmstrip dimensions, or something that easy, over wasting time with editing a copy of every single picture and creating a new filmstrip.

Also, another question or two... I've made the filmstrips I'm currently using have transparent background, but I'm wondering if that could cause my current issue, and I'm also wondering, speaking of different sized filmstrips, if (since I'm relatively new to rainmeter script settings files) I can just copy the settings file with a new name, and have multiple settings files, labeled "smallgirl", "largegirl", etc, for switching to different sizes of the animation file, labeled for instance, "smallgirl.tif" and "largegirl.tif" respectively, or perhaps there's a way for a single script settings file to be used, where it selects a certain.tif file based on current screen size?


I'll truly understand if I have to just go through the process of remaking the filmstrips I decide to use (again my "girl" filmstrip in this case) and it's not that big a deal if I have to have multiple settings files for different size animations, it's just that well, I'd like to get this streamlined to being as easy as possible for me... I have a screenshot of what the girl animation is supposed to look like on my desktop, if anyone wants a reference for what I'm talking about here, and I'll try and post a link to it...

If anyone wants a copy of it, this is only my test version I'm working on now, and well, I'd need the original files as some of my anime girl png files have the startings of some changes, specifically I've taken 5 or 6 of them and played with removing the shorts, thereby ruining the finished product until I either finish THAT endeavor, or replace the affected pictures with the original unmodified versions. (Then again, who in their right minds would want an animation of nothing more than an anime girl walking wearing (what amounts to) a 2 piece running outfit, eh?) Seriously though, would there really be a, er, market for something like that?(the original not edited version I mentioned) I'm curious now...


(I'll try a couple of different methods, so if there's multiple links, it's just the same picture)

Image


https://ibb.co/hF45vK3
Last edited by Brian on October 25th, 2023, 5:58 am, edited 1 time in total.
Reason: Please use [code] tags. It's the </> button.
User avatar
Yincognito
Rainmeter Sage
Posts: 7148
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: How to display animation in Rainmeter

Post by Yincognito »

Wiebenor wrote: October 25th, 2023, 4:33 am So... I have a problem that I'd like anyone who has any information on filmstrips in general, and specifically filmstrips in relation to rainmeter animations to try and help me with... for backstory, I have a homemade rainmeter skin based off of another skin, basically a-la script kiddie style, where I am editing a copy of the script folder and subfolders, as well as files, with a new name and a filmstrip made in GIMP, of a set of images, to create the look of a girl walking... it's rather large though, at 641 pixels high, (assuming 1080p monitor settings) and I've found that for whatever reason, if I make it smaller I get a slight sideways movement of my desktop animation, at the end of my filmstrip...

My question is, is there a way to combat this issue I'm having where scaling down the GIMP image, to half the original dimensions? Here's basically what my rainmeter script file looks like, for anyone who is wondering, assuming that it might help... Of course, the easiest thing would be to just enable widget resizing in rainmeter, but I digress...

As promised here's what my rainmeter skin config file looks like...

*Rainmeter script top*

Code: Select all

[Rainmeter]
Update=50

[MeasureAnimation]
Measure=CALC
Formula=Counter % 35

[MeterAnimation]
Meter=BITMAP
MeasureName=MeasureAnimation
BitmapImage=#@#Images\filmstrip\girl.tif
BitmapFrames=35
BitmapExtend=35
*Rainmeter script bottom*


remember, this is basically just a copied script from another animation skin, where the only substantive change is the number of frames, (which changes depending on which figure I am using that I have access to) and the (script/base folder) names. Is there something I can do to combat the moving filmstrip look, or do I have to just start over with a new set of (smaller dimension) files, and recreate the filmstrip from scratch? I'd really rather just edit filmstrip dimensions, or something that easy, over wasting time with editing a copy of every single picture and creating a new filmstrip.

Also, another question or two... I've made the filmstrips I'm currently using have transparent background, but I'm wondering if that could cause my current issue, and I'm also wondering, speaking of different sized filmstrips, if (since I'm relatively new to rainmeter script settings files) I can just copy the settings file with a new name, and have multiple settings files, labeled "smallgirl", "largegirl", etc, for switching to different sizes of the animation file, labeled for instance, "smallgirl.tif" and "largegirl.tif" respectively, or perhaps there's a way for a single script settings file to be used, where it selects a certain.tif file based on current screen size?


I'll truly understand if I have to just go through the process of remaking the filmstrips I decide to use (again my "girl" filmstrip in this case) and it's not that big a deal if I have to have multiple settings files for different size animations, it's just that well, I'd like to get this streamlined to being as easy as possible for me... I have a screenshot of what the girl animation is supposed to look like on my desktop, if anyone wants a reference for what I'm talking about here, and I'll try and post a link to it...

If anyone wants a copy of it, this is only my test version I'm working on now, and well, I'd need the original files as some of my anime girl png files have the startings of some changes, specifically I've taken 5 or 6 of them and played with removing the shorts, thereby ruining the finished product until I either finish THAT endeavor, or replace the affected pictures with the original unmodified versions. (Then again, who in their right minds would want an animation of nothing more than an anime girl walking wearing (what amounts to) a 2 piece running outfit, eh?) Seriously though, would there really be a, er, market for something like that?(the original not edited version I mentioned) I'm curious now...


(I'll try a couple of different methods, so if there's multiple links, it's just the same picture)

Image


https://ibb.co/hF45vK3
The issue you're having could be caused by various reasons (no, it's not transparency), so it's hard to tell without a working sample (code and sample filmstrips, a large working version and a small issue prone version - they don't necessarily need to be the originals, just stuff that illustrate the problem). Based on what you described though, I'd suspect you didn't precisely scale the filmstrip image so that the image width is exactly 35 times its height.

Somewhat related to that, yes, you can switch between different sizes or set size based on screen resolution, all from the same skin without duplicating it to multiple variants, but not while using a Bitmap meter. Such a meter cannot be resized besides editing the actual image file, but if you're using an Image meter iterating through individual frame image files, that restriction is removed and you can resize them dynamically.

Some references:
https://docs.rainmeter.net/tips/animated-gif-files/
https://docs.rainmeter.net/manual/meters/image/
https://docs.rainmeter.net/manual/variables/built-in-variables/#MonitorVariables
https://docs.rainmeter.net/manual/meters/general-options/#WH
https://docs.rainmeter.net/manual/variables/#DynamicVariables
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Wiebenor
Posts: 4
Joined: June 14th, 2018, 5:11 am

Re: How to display animation in Rainmeter

Post by Wiebenor »

Ok... So this, "Based on what you described though, I'd suspect you didn't precisely scale the filmstrip image so that the image width is exactly 35 times its height." What is that referring to? The "formula=counter 35%" thing?

If so, IDK exactly what that does, aside from the fact that I just have it set for a certain number of frames (generally the number in the strip) and everything generally "just works" provided the image dimensions aren't shrunk too much, or at least appears to work... Maybe it's just something that is so small at large dimensions that it's unnoticeable, yet gets bigger the smaller the dimensions go, but IDK, since I'm not very familiar with filmstrips. I honestly don't mind using separate file "variations" so we're good there, but to be honest, I didn't know that being "35x the height" or whatever was something I genuinely needed to be worried about, as I just figured that any matching sized photos would work without a certain size ratio requirement. I do know that moving from 35 to 34 or 36 doesn't seem to fix the issue, as the needed % is between those digits, like 34.5 or 35.7, or some similar number, but unfortunately rainmeter doesn't seem to work with anything other than whole numbers, if what I tried is anything to go by, so that's not something I can easily fix.

I suppose that I could take "height x 35" and compare the resulting number to my width, and find out if I need to add or subtract height, but still, the whole point of the original question would be to try and avoid needing extra work to get something to work properly in a smaller size...

All that said, I'll try the ideas you've given me, and ones I've come up with myself since reading the good answers and guesses I've received here, and who knows, perhaps I'll upload a copy somewhere, at some point, for you all to check out. It would still be a preliminary work, but anyone wanting to use it would be welcome to, as I reckon I don't mind (if and when I upload a rmskin package).


**Edit**

Instead of having the dimensions 7000x641, I instead shrunk the canvas to 7000x636, before shrinking that in half and that kinda seems to have done the trick, at least in what little testing I know how to do using rainmeter... thanks to anyone and everyone who has helped me somewhat figure this all out. To be clear, I'm more or less still clueless, but what I'm doing is working now for whatever reason, so that's good at least
User avatar
Yincognito
Rainmeter Sage
Posts: 7148
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: How to display animation in Rainmeter

Post by Yincognito »

Wiebenor wrote: October 27th, 2023, 11:31 pm Ok... So this, "Based on what you described though, I'd suspect you didn't precisely scale the filmstrip image so that the image width is exactly 35 times its height." What is that referring to? The "formula=counter 35%" thing?

If so, IDK exactly what that does, aside from the fact that I just have it set for a certain number of frames (generally the number in the strip) and everything generally "just works" provided the image dimensions aren't shrunk too much, or at least appears to work... Maybe it's just something that is so small at large dimensions that it's unnoticeable, yet gets bigger the smaller the dimensions go, but IDK, since I'm not very familiar with filmstrips. I honestly don't mind using separate file "variations" so we're good there, but to be honest, I didn't know that being "35x the height" or whatever was something I genuinely needed to be worried about, as I just figured that any matching sized photos would work without a certain size ratio requirement. I do know that moving from 35 to 34 or 36 doesn't seem to fix the issue, as the needed % is between those digits, like 34.5 or 35.7, or some similar number, but unfortunately rainmeter doesn't seem to work with anything other than whole numbers, if what I tried is anything to go by, so that's not something I can easily fix.

I suppose that I could take "height x 35" and compare the resulting number to my width, and find out if I need to add or subtract height, but still, the whole point of the original question would be to try and avoid needing extra work to get something to work properly in a smaller size...

All that said, I'll try the ideas you've given me, and ones I've come up with myself since reading the good answers and guesses I've received here, and who knows, perhaps I'll upload a copy somewhere, at some point, for you all to check out. It would still be a preliminary work, but anyone wanting to use it would be welcome to, as I reckon I don't mind (if and when I upload a rmskin package).
No, I was referring to the resolution of the bitmap file you're using: in your particular case, its width must be exactly 35 times its height after scaling, for the 35 frames to be displayed without that sideways movement you mentioned (if that's even the reason, since you didn't offer much details about the other parts of the skin). FYI, the % sign is the modulo operator (the modulo operation is basically the remainder of a division), and it's used to continuously iterate between 0 and 34 in the measure, since it's returning the remainder of the division of an ever increasing number (i.e. the COUNTER function) to 35.

Other than that, you will always need extra work and extra info to get something done, nothing comes out of thin air, you know. Also, with just the description of the issue provided and no way to replicate it, the help you'll get will mostly be guesswork. :confused:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Wiebenor
Posts: 4
Joined: June 14th, 2018, 5:11 am

Re: How to display animation in Rainmeter

Post by Wiebenor »

Either way, thanks for your information, as it kinda helped me even if I didn't 100% understand everything.

For anyone who's wants to test a (seemingly working) copy, I uploaded a copy to deviantart/Google drive. Here's my deviantart link, just follow the Google drive link in the description to find it .. I think it uploaded by now, or I hope so anyway...

https://www.deviantart.com/wiebenor/art/Girl-Walk-990808367
User avatar
Yincognito
Rainmeter Sage
Posts: 7148
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: How to display animation in Rainmeter

Post by Yincognito »

Wiebenor wrote: October 28th, 2023, 4:33 am Either way, thanks for your information, as it kinda helped me even if I didn't 100% understand everything.

For anyone who's wants to test a (seemingly working) copy, I uploaded a copy to deviantart/Google drive. Here's my deviantart link, just follow the Google drive link in the description to find it .. I think it uploaded by now, or I hope so anyway...

https://www.deviantart.com/wiebenor/art/Girl-Walk-990808367
You're welcome, glad if it helped you in any way. Just curious, does the uploaded skin still have the sideways movement issue you described, or did you manage to fix it somehow? :???:

EDIT: Nevermind, I checked it out, all working fine. Made a mistake earlier when saying that the bitmap width must be 35 times its height since I assumed that frames would be square like. What I should have said is that the bitmap width must be in this case exactly 35 times the width of the individual frame you envision (200 for your large variant, 100 for your small one). Sorry for the inaccurate statement earlier.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth