It is currently March 29th, 2024, 2:55 pm

How to speed up animation? Update=1 doesn't work. Still looks slow motion vs online GIF image.

Get help with creating, editing & fixing problems with skins
User avatar
strawberryshortcake
Posts: 79
Joined: August 27th, 2016, 12:49 am

How to speed up animation? Update=1 doesn't work. Still looks slow motion vs online GIF image.

Post by strawberryshortcake »

How to speed up animation? Update=1 doesn't work. Still looks slow motion vs online GIF image.


I want the orange butterfly (3rd one from the left) with the black shadow on my desktop. I am able to get it to animate on my desktop but just not fly around as quickly as seen on that website. Mines look like it's in slow motion (kind of the like the 2nd one from the left.)
http://bestanimations.com/Animals/Insects/Butterflys/Butterfly4.html

Code: Select all

; Note - You will need to get and install ImageMagick from:
; http://www.imagemagick.org/script/binary-releases.php

; Convert your .gif image to a "Bitmap" with the following in a cmd.exe command prompt window:
; convert -coalesce "C:\PathToInput\InputName.gif" "C:\PathToOutput\OutputName.png"



[Rainmeter]
Update=2

[Metadata]
Name=GIFFrames
Author=Rainmeter Team
Information=Displays a deconstructed .gif file (individual frames) as if it was a .gif file || Instructions: See .ini file for how to get and use ImageMagick
Version=Jan 16, 2016
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0

[ImageNumberCalc]
Measure=Calc
Formula=Counter % 100

[ImageMeter]
Meter=Image
W=150	
H=150
x=720
y=780


ImageName=#@#ImagesFrames\Frame[ImageNumberCalc].png
AntiAlias=1
DynamicVariables=1
Not a programmer, don't know much about it. But I will sometimes look at the rainmeter .ini file code, fiddle with some numbers, save file & hit the refresh button, and see what changes happen. However, I'm kind of stumped on the animation issue.

This turtle animation skin has an extra variable "speed" that allows me to make the animation speed up like how I want.
https://forum.rainmeter.net/viewtopic.php?t=15738

I tried putting this in my code above at the very beginning, but it didn't do anything. I'm assuming I need some of part of the turtle code (below) in order to get this "speed" option to work.
[Variables]
Cycle=0
Speed=100
Period=0



The image files of the turtle is in a bitmap format, and the code makes it travels across the screen. I already copied the same code and created a nice bird that flys across the screen, but now I want to create an animation where either a butterfly or bird flys staying put within a certain location.

I don't want them staying exactly in the same exact spot (example, I don't want it to stay put at x=500 and y=500 coordinate), but want them to kind of take up maybe a 5x5 inch area on my screen (but in random location). Since bitmap are frames lined up in a row single file line, how are you able to designate where you want that frame to play on your computer screen.

In addition, which part of the code would I manipulate to have the turtle go from right screen to left screen? As of right now, all it does is move from left to right.


Turtle animation skin - by balala

Code: Select all

[Variables]
Cycle=0
Speed=5
Period=0

[Rainmeter]
Update=100
OnRefreshAction=!execute [!SetVariable RefreshSkin #CURRENTCONFIGX#][!Move "0" "0" ]

[Timer1]
Measure=Calc
Formula=( Timer1 + 1 )
DynamicVariables=1

[Timer2]
Measure=Calc
Formula=( Timer2 + 1 )
DynamicVariables=1
UpdateDivider=2

[MeasureAnimation1]
Measure=Calc
Formula=( Timer1 % 6 )

[MeasureAnimation2]
Measure=Calc
Formula=( Timer2 % 4 )

[PositionX1]
Measure=Calc
Formula=( #Speed# * Timer1 - ( #SCREENAREAWIDTH# - #CURRENTCONFIGX# ) * #Cycle# )
IfAboveAction=!execute [!SetVariable Cycle "( #Cycle# + 1 )"][!UpdateMeasure "MeasureRand"][!UpdateMeasure "MeasureImage"][!SetVariable Period "(( #Period# = 0 ) ? [Timer1] : #Period# )"]
IfAboveValue=( #SCREENAREAWIDTH# - #CURRENTCONFIGX# )
DynamicVariables=1

[PositionX2]
Measure=Calc
Formula=( Abs ( 178 * ( 1 - ( PositionX1 / ( #SCREENAREAWIDTH# - #CURRENTCONFIGX# )))))

[PositionX]
Measure=Calc
Formula=( PositionX1 - PositionX2 )

[PositionY]
Measure=Calc
Formula=((( #SCREENAREAHEIGHT# - #CURRENTCONFIGY# - 187 ) / 10 ) * MeasureRand )

[MeasureRand]
Measure=Calc
Formula=Random
LowBound=1
HighBound=10
UpdateRandom=1
UpdateDivider=300

[MeasureImage]
Measure=Calc
Formula=( Random % 2 )
IfAboveAction=!execute [!HideMeter MeterAnimation1][!ShowMeter MeterAnimation2]
IfAboveValue=0
IfEqualAction=!execute [!ShowMeter MeterAnimation1][!HideMeter MeterAnimation2]
IfEqualValue=0
LowBound=1
HighBound=100
UpdateRandom=1
UpdateDivider=300

[MeterAnimation1]
Meter=BITMAP
X=[PositionX]
Y=[PositionY]
MeasureName=MeasureAnimation1
BitmapImage=right.png
BitmapFrames=6
BitmapExtend=1
DynamicVariables=1

[MeterAnimation2]
Meter=BITMAP
X=[PositionX]
Y=[PositionY]
MeasureName=MeasureAnimation2
BitmapImage=right2.png
BitmapFrames=4
BitmapExtend=1
DynamicVariables=1

[MeasureRefresh]
Measure=Calc
Formula=( Abs ( #RefreshSkin# - #CURRENTCONFIGX# ))
IfAboveAction=!Refresh
IfAboveValue=0
DynamicVariables=1
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to speed up animation? Update=1 doesn't work. Still looks slow motion vs online GIF image.

Post by balala »

strawberryshortcake wrote:How to speed up animation? Update=1 doesn't work. Still looks slow motion vs online GIF image.
The smallest possible value for the Update is 16 (second paragraph here). A smaller value will determine the skin to work with Update=16.
strawberryshortcake wrote:I want the orange butterfly (3rd one from the left) with the black shadow on my desktop. I am able to get it to animate on my desktop but just not fly around as quickly as seen on that website. Mines look like it's in slow motion (kind of the like the 2nd one from the left.)
http://bestanimations.com/Animals/Insects/Butterflys/Butterfly4.html
strawberryshortcake wrote:I don't want them staying exactly in the same exact spot (example, I don't want it to stay put at x=500 and y=500 coordinate), but want them to kind of take up maybe a 5x5 inch area on my screen (but in random location). Since bitmap are frames lined up in a row single file line, how are you able to designate where you want that frame to play on your computer screen.
Probably not impossible, I'll take a look to see how can we make it to work. The random route will be a bit difficult, I think, but maybe neither that isn't impossible.
Will come back later with a solution (I hope).
strawberryshortcake wrote:This turtle animation skin has an extra variable "speed" that allows me to make the animation speed up like how I want.
https://forum.rainmeter.net/viewtopic.php?t=15738
I'm glad if you like my Turtle.
That Speed variable uses a trick: when it is increased, the skin will be updated at the same interval, just the turtle will make bigger "steps" (will move on a larger distance in one update cycle).
strawberryshortcake wrote:In addition, which part of the code would I manipulate to have the turtle go from right screen to left screen? As of right now, all it does is move from left to right.
A first, quick reply would be to use the following formula in the [PositionX] measure: Formula=( #SCREENAREAWIDTH# - PositionX1 + PositionX2 - 178 ).
User avatar
strawberryshortcake
Posts: 79
Joined: August 27th, 2016, 12:49 am

Re: How to speed up animation? Update=1 doesn't work. Still looks slow motion vs online GIF image.

Post by strawberryshortcake »

Can't wait to see your response and see if you could get it to work.

Scondly, I managed to get it to go from right to left screen. Cool.

Using the "Speed" variable and the "update" variable. Also used the code (simply pasted picture of bird flying), I was able to make the animation move faster across the screen. Is there a variable that I can change to make the animation play the same "fast" speed, but also randomly come on screen. Say maybe the animation (same fast speed) comes on at the 30 seconds mark, then 15 seconds mark later, then 1 minute mark later, then 3 minutes later, then 10 minutes later, etc.

Changing the update unfortunately makes the bird fly in slow motion (i.e. update=1000). Any part of the code allows for varying the time when the animation shows up.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to speed up animation? Update=1 doesn't work. Still looks slow motion vs online GIF image.

Post by balala »

strawberryshortcake wrote:Can't wait to see your response and see if you could get it to work.
First attempt: see the attached package.
Note that the images in the @Resources folder are not the best. I'm not good at all in image processing, so you (or someone who is better in this kind of tasks) will have to get better quality images, maybe with transparent background.
strawberryshortcake wrote:Scondly, I managed to get it to go from right to left screen. Cool.
I forgot to say, but I think it's obvious, that if you do so, you also have to rotate the turtles with 180 degrees, otherwise the turtle would go back. Did you?
strawberryshortcake wrote:Using the "Speed" variable and the "update" variable. Also used the code (simply pasted picture of bird flying), I was able to make the animation move faster across the screen. Is there a variable that I can change to make the animation play the same "fast" speed, but also randomly come on screen. Say maybe the animation (same fast speed) comes on at the 30 seconds mark, then 15 seconds mark later, then 1 minute mark later, then 3 minutes later, then 10 minutes later, etc.

Changing the update unfortunately makes the bird fly in slow motion (i.e. update=1000). Any part of the code allows for varying the time when the animation shows up.
In the images I got from the downloaded animated gif, the butterflies are moving on curved paths (but not randomly, because after each cycle, the butterflies repeat their previous path). You would like to place the image randomly on the screen? To be honest I don't really understand what you mean by "comes on at the 30 seconds mark" (and so on).
You do not have the required permissions to view the files attached to this post.
User avatar
strawberryshortcake
Posts: 79
Joined: August 27th, 2016, 12:49 am

Re: How to speed up animation? Update=1 doesn't work. Still looks slow motion vs online GIF image.

Post by strawberryshortcake »

balala wrote:First attempt: see the attached package.
Note that the images in the @Resources folder are not the best. I'm not good at all in image processing, so you (or someone who is better in this kind of tasks) will have to get better quality images, maybe with transparent background.

I forgot to say, but I think it's obvious, that if you do so, you also have to rotate the turtles with 180 degrees, otherwise the turtle would go back. Did you?

In the images I got from the downloaded animated gif, the butterflies are moving on curved paths (but not randomly, because after each cycle, the butterflies repeat their previous path). You would like to place the image randomly on the screen? To be honest I don't really understand what you mean by "comes on at the 30 seconds mark" (and so on).
Appreciate the effort. The gif animation effect unfortunately still doesn't have that "snap" to it.

(A) Is it possible for you to add the "variable "SPEED"" (at the very top of the turtle .ini file, which uses a BITMAP single file line of pictures layout) also to the butterfly .ini file (which uses individual .png images to create a .GIF file)? Because this "SPEED" variable really does the trick that I want. I can use "speed" to make the turtle go lightning fast if I wanted to.

In other words, is there a way to use that "speed" variable with GIF images or is that simply reserved for BITMAPS?


OR better, yet, can I use the butterfly images and put them in a BITMAP CONFIGURATION layout? This is where I am stumped. Because in a bitmap configuration layout single file straight line, would the butterfly simply move or fly in a straight line when the animation plays out?



In other words, where would I add that "SPEED" variable from the turtle.ini file to the below code?

Code: Select all

; Note - You will need to get and install ImageMagick from:
; http://www.imagemagick.org/script/binary-releases.php

; Convert your .gif image to a "Bitmap" with the following in a cmd.exe command prompt window:
; convert -coalesce "C:\PathToInput\InputName.gif" "C:\PathToOutput\OutputName.png"

[Rainmeter]
Update=20

[Metadata]
Name=GIFFrames
Author=Rainmeter Team
Information=Displays a deconstructed .gif file (individual frames) as if it was a .gif file || Instructions: See .ini file for how to get and use ImageMagick
Version=Jan 16, 2016
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0

[ImageNumberCalc]
Measure=Calc
Formula=Counter % 59

[ImageMeter]
Meter=Image
W=820
H=150
x=500
y=400

ImageName=#@#ImagesFrames\Frame[ImageNumberCalc].png
AntiAlias=1
DynamicVariables=1





(B) Yep, had to switch the object around so it goes the proper way.

(C) Randomly on screen and 30 second mark. To better illustrate this. Notice how the animation stays in one spot, same "Y" and "X" Coordinate. This is a bitmap file. If this was a flying bird, this would look funny just flapping his wings, staying in one spot without moving left to right. 30 second mark, example, if I wanted the below animation to play.

I want it to play at time 0:00 (animation will play for 5 seconds), then disappear from screen.
Then 30 seconds later (time: 0:30 sec), I want it to reappear on screen, play the same animation for 5 seconds, then disappear from screen.
Then 2 minutes later, I want it to reappear on screen, play the same animation for 5 seconds, then disappear from screen.
Then maybe 5 minutes later, I want it to reappear on screen, play the same animation for 5 seconds, then disappear from screen.
Then maybe 3 minutes later, I want it to reappear on screen, play the same animation for 5 seconds, then disappear from screen.
Then maybe 10 minutes later, I want it to reappear on screen, play the same animation for 5 seconds, then disappear from screen.

Just basically random time/moments when the animation actually comes on screen.

BitmapAnim

Another use of the Bitmap meter is to display an animation. For this use, you simply create a bitmap image with as many "frames" as you want in your animation, and loop through them one at a time.

BitmapAnim.gif - The animation with a face and percentage sign. Since it's not showing up, the 2nd GIF animation in that link.
( https://forum.rainmeter.net/viewtopic.php?t=17960 )

Code: Select all

[Rainmeter]
Update=45

[MeasureAnimLoop]
Measure=Calc
Formula=(MeasureAnimLoop + 1) % 37
MinValue=0
MaxValue=38

[MeterAnim]
Meter=Bitmap
MeasureName=MeasureAnimLoop
BitmapImage=#@#Images\XAnim.png
BitmapFrames=37
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to speed up animation? Update=1 doesn't work. Still looks slow motion vs online GIF image.

Post by balala »

strawberryshortcake wrote:(A) Is it possible for you to add the "variable "SPEED"" (at the very top of the turtle .ini file, which uses a BITMAP single file line of pictures layout) also to the butterfly .ini file (which uses individual .png images to create a .GIF file)? Because this "SPEED" variable really does the trick that I want. I can use "speed" to make the turtle go lightning fast if I wanted to.

In other words, is there a way to use that "speed" variable with GIF images or is that simply reserved for BITMAPS?
strawberryshortcake wrote:
In other words, where would I add that "SPEED" variable from the turtle.ini file to the below code?
It's not so simple, but maybe neither impossible isn't. That's because the turtles moved in a straight line, but the butterflies don't move at all. They seem to be moving due the frames obtained from the initial animation.
The Speed variable, in case of the Turtles, determined the length of a "step" (the path made into one update cycle). Here we don't have a such thing.
So, the Speed variable, as it was in case of Turtles, is not reserved to bitmaps, but to the liniar movement of the turtles and it's not applicable here. It would be to any kind of meter (image, bitmap, string, etc.), if it would have to move in straight line.
But in a bit different way, maybe it's applicable, see the reply of your question (C), below.
strawberryshortcake wrote:OR better, yet, can I use the butterfly images and put them in a BITMAP CONFIGURATION layout? This is where I am stumped. Because in a bitmap configuration layout single file straight line, would the butterfly simply move or fly in a straight line when the animation plays out?[/color][/b]
Yes, you can. In the "Method Two: Converting a .gif to a multiple frame "Bitmap" image" section of this trick, you can read how to do it. It would be best to get that bitmap with transparent background, if it's possible (as I said, I'm not good at all in image processing, sorry).
Then you can use the Bitmap meter.
If you don't know how to do it, just upload the bitmap if you got it and I'll try to help.
strawberryshortcake wrote:(C) Randomly on screen and 30 second mark. To better illustrate this. Notice how the animation stays in one spot, same "Y" and "X" Coordinate. This is a bitmap file. If this was a flying bird, this would look funny just flapping his wings, staying in one spot without moving left to right. 30 second mark, example, if I wanted the below animation to play.

I want it to play at time 0:00 (animation will play for 5 seconds), then disappear from screen.
Then 30 seconds later (time: 0:30 sec), I want it to reappear on screen, play the same animation for 5 seconds, then disappear from screen.
Then 2 minutes later, I want it to reappear on screen, play the same animation for 5 seconds, then disappear from screen.
Then maybe 5 minutes later, I want it to reappear on screen, play the same animation for 5 seconds, then disappear from screen.
Then maybe 3 minutes later, I want it to reappear on screen, play the same animation for 5 seconds, then disappear from screen.
Then maybe 10 minutes later, I want it to reappear on screen, play the same animation for 5 seconds, then disappear from screen.
For a such task, I'd use the ActionTimer plugin, which is a new, but extremely useful plugin, introduced on December 27, 2015, with Rainmeter 3.3 r2493. This would also solve the question of the Speed variable.
Take a look at the attached package. In its code you'll have to replace the numerical values in the IfCondition option of the [Timer] measure, with the moments when you want to show and start the animation (obviously you can add further ||(Timer=XXX) values, if you need).
What you think?
You do not have the required permissions to view the files attached to this post.
User avatar
strawberryshortcake
Posts: 79
Joined: August 27th, 2016, 12:49 am

Re: How to speed up animation? Update=1 doesn't work. Still looks slow motion vs online GIF image.

Post by strawberryshortcake »

balala wrote:It's not so simple, but maybe neither impossible isn't. That's because the turtles moved in a straight line, but the butterflies don't move at all. They seem to be moving due the frames obtained from the initial animation.
The Speed variable, in case of the Turtles, determined the length of a "step" (the path made into one update cycle). Here we don't have a such thing.
So, the Speed variable, as it was in case of Turtles, is not reserved to bitmaps, but to the liniar movement of the turtles and it's not applicable here. It would be to any kind of meter (image, bitmap, string, etc.), if it would have to move in straight line.
But in a bit different way, maybe it's applicable, see the reply of your question (C), below.

Yes, you can. In the "Method Two: Converting a .gif to a multiple frame "Bitmap" image" section of this trick, you can read how to do it. It would be best to get that bitmap with transparent background, if it's possible (as I said, I'm not good at all in image processing, sorry).
Then you can use the Bitmap meter.
If you don't know how to do it, just upload the bitmap if you got it and I'll try to help.

For a such task, I'd use the ActionTimer plugin, which is a new, but extremely useful plugin, introduced on December 27, 2015, with Rainmeter 3.3 r2493. This would also solve the question of the Speed variable.
Take a look at the attached package. In its code you'll have to replace the numerical values in the IfCondition option of the [Timer] measure, with the moments when you want to show and start the animation (obviously you can add further ||(Timer=XXX) values, if you need).
What you think?
I'll have to look at that bitmeter later this week, but first...

Absolutely incredible work with the second attempt, but I do have a few concerns.
:party: :beer: :yahoo: :bounce: :cake:

First, I have to give you a standing ovation for getting the butterflies to move with a "snappiness" that I wanted. That's exactly how I wanted with the ability to adjust the "speed" variable. Even without doing anything to your newly written code, the butterflies are moving finally at a realistic speed. I can also make them go lightning fast if I drop the speed=25 or something, very cool exactly what I wanted.

It also seems like there's an "inverse effect going on" compared to the "turtle" speed variable. When I increase the speed of the turtle from say Speed=50 to Speed=150 it gets faster, but with this "butterfly" speed variable, when I increase the speed=50 to Speed=150 it goes in slow motion. Not a big deal, but just an interesting observation.



My concerns (3 situations that I'm looking to create) and something else:


Something else: Is there a place where I could add in W= and H= so I can change the size of the butterfly image? Oh yes, I do know how to get the transparency going. Very easy with photoshop and the magic wand function.


3 situations:

Situation 1:
-Animals/creatures that stays animated on my computer screen always
-sort of like a pet dog, always inside your house, you can always see it.
-I'm guessing it's already in the code, but I just can't seem to change the values to make it to work (I've provided a few examples below of what I did with IfCondition.

Situation 2:
-Animals/birds that travels across my computer screen at different points in time.
-sort of like out in real nature. you might see the animal for 1 minute, then it disappears behind a bush, then returns, but he doesn't just magically disappear out of sight (sort of like your turtle situation, he enters from one side of the screen and leaves on the other side of the screen.)
-I'm also guessing this is also already in the code and all I need to do is add in more animation frames that shows that character moving off screen and then reappearing. How do I change the IfCondition so it happens immediately. The bird flies offscreen, then 2 seconds later flies back onto screen in view. or the other way around, the bird flies offscreen, then 30 seconds later flies back onto screen.


Situation 3:

Is it more difficult to code something moving from the left side and leaving on the right of screen, and then returning from the right side and moving to the left side and leaving, and then moving from the left to right side again, and basically rinse and repeat. Two subsituations:
(Situation 3A) They can go offscreen or stay put on screen. Left to right, then offscreen, then right to left, then offscreen, then left to right, then offscreen. rinse and repeat.
(Situation 3B) They can go left to right, stay on screen, then circle back moving from left to right, stay on screen. rinse and repeat.



Topics

(A) How do I get the animation to continuously play on screen without disappearing? (think dog in the same room, you can always see it). I tried tinkering with the IfCondition, but it doesn't seem to work because I guess I don't know what it actually means in laymans term. More explaination way down below..

(B) This is pretty much the code you created for the second butterfly attempt. All I have to change here would be to add in extra frames that show the butterfly flying off screen. The reason why I wanted the animation to disappear is specifically only for birds flying. Sort of creating an effect where it looks like the bird has flown across my computer screen, done his business offscreen, and later flying back to make an appearance on my screen and flying out of sight again. Think of my computer screen as a window. I see the bird flying back and forth, back and forth, gathering food for the little ones back at the nest and flying back out again to grab more food but the flying bird isn't going to be flying across my window always at the same time. It varies. I could see the bird across my window at 8:00 am, then maybe I see the bird again at 8:30 am, and then 12:00 pm noon, then maybe 12:05 pm, then maybe 12:15 pm, then maybe 3pm. Something like that. And to make it with more immediate gratification. I would want to see the bird flying across the computer "window" screen at 12:01 pm, then 12:02 pm, then maybe 12:02 pm and 10 seconds, then maybe 12:02 pm and 15 seconds later (SITUATION#2) . This would obviously only apply to animations where the bird actually flies off screen (SITUATION#2). If the bird stays onscreen, then a SITUATION#1 code would work best.

(C) I tried changing values of the IfCondition, but I couldn't exactly figure out how the values change the animation appearance. The animation also kind of stopped playing after awhile.
It wouldn't even show up after a while. I hit refresh on the rainmeter manager, then I think it played three times and then stopped. Oddly enough, the animation sometimes would only play once and never play again.

(D) Not exactly sure how to "read' this:

[Timer]
Measure=Calc
Formula=( Timer +1 )
IfCondition=((Timer=30)||(Timer=120)||(Timer=150))
IfTrueAction=[!CommandMeasure MeasureSlider "Execute 1"][!ShowMeter "MeterButterflies"][!Redraw]




What would I have to do so the animation staysing playing in a loop without it disappearing? Do I just delete the IfCondition line?


Does the above mean the animation plays the very first time at time = 0 seconds (when you first load the skin). Then it plays 30 seconds later, and then 120 seconds later, and then 150 seconds later, and then completely stops playing the animation?

I tried changing IfCondition=((Timer=1)||(Timer=2)||(Timer=3), but I think the animation only played once and didn't play again. I thought this would mean the butterfly animation would play immediately at time =0 when you first load the skin, then 1 second later, it'll play the animation again. Then 2 seconds later, it'll play the animation again, then 3 seconds later it'll play the animation again and finally stop playing. But all it did was play the animation once I think, not three times.

I also just tried changing IfCondition=((Timer=5)||(Timer=4)||(Timer=2)). The animation played once when I loaded the skin (or refreshed the skin). Then it never played again.

How do you keep the animation in a loop without it disappearing?



And then this part. Do I even touch any of this or just leave it alone?


[MeasureSlider]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat One,#Speed#,100
One=[!SetVariable Frame "(#Frame#+1)"]#U#
DynamicVariables=1

[MeasureEnd]
Measure=Calc
Formula=#Frame#
IfCondition=(MeasureEnd=100)
IfTrueAction=[!CommandMeasure MeasureSlider "Stop 1"][!SetVariable Frame "0"][!UpdateMeasure "MeasureSlider"][!UpdateMeasure "MeasureEnd"][!HideMeter "MeterButterflies"][!Redraw]
DynamicVariables=1
UpdateDivider=-1



If only I can get a you a smoothie or something for helping me because you're absolutely amazing.
User avatar
strawberryshortcake
Posts: 79
Joined: August 27th, 2016, 12:49 am

Re: How to speed up animation? Update=1 doesn't work. Still looks slow motion vs online GIF image.

Post by strawberryshortcake »

balala wrote:
It's not so simple, but maybe neither impossible isn't. That's because the turtles moved in a straight line, but the butterflies don't move at all. They seem to be moving due the frames obtained from the initial animation.
The Speed variable, in case of the Turtles, determined the length of a "step" (the path made into one update cycle). Here we don't have a such thing.
So, the Speed variable, as it was in case of Turtles, is not reserved to bitmaps, but to the liniar movement of the turtles and it's not applicable here. It would be to any kind of meter (image, bitmap, string, etc.), if it would have to move in straight line.
But in a bit different way, maybe it's applicable, see the reply of your question (C), below.

Yes, you can. In the "Method Two: Converting a .gif to a multiple frame "Bitmap" image" section of this trick, you can read how to do it. It would be best to get that bitmap with transparent background, if it's possible (as I said, I'm not good at all in image processing, sorry).
Then you can use the Bitmap meter.
If you don't know how to do it, just upload the bitmap if you got it and I'll try to help.
For a such task, I'd use the ActionTimer plugin, which is a new, but extremely useful plugin, introduced on December 27, 2015, with Rainmeter 3.3 r2493. This would also solve the question of the Speed variable.
Take a look at the attached package. In its code you'll have to replace the numerical values in the IfCondition option of the [Timer] measure, with the moments when you want to show and start the animation (obviously you can add further ||(Timer=XXX) values, if you need).
What you think?


Do you know how I could change the IfCondition so that the animation stays on screen and doesn't disappear? I tried messing with the IfCondition number when you first posted it, and the butterfly animation keeps disppearing and it only plays a maximum of about 3 times. I love the "speed" variable added, but not sure how to keep the animation on screen..





dvo wrote:tis is code i used for a cat that is walking over my screen :D
Maybe it's just me, but I couldn't get the codes to work. I'm still a novice at this rainmeter coding stuff. Can you upload the file? It's easier for me to do it that way because then I could simply rename my .png images the same as the cat and just swap them out and see the effects.

Also can you speed up the animation like what balala did with the butterfly (2nd try) above. Do you know how I could change balala's butterfly code so it stays on screen and continuously plays in a loop, because I absolutely love his code, it allows me to finally adjust the speed of the butterfly so it looking realistically with proper speed physics.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to speed up animation? Update=1 doesn't work. Still looks slow motion vs online GIF image.

Post by balala »

strawberryshortcake wrote:First, I have to give you a standing ovation for getting the butterflies to move with a "snappiness" that I wanted. That's exactly how I wanted with the ability to adjust the "speed" variable. Even without doing anything to your newly written code, the butterflies are moving finally at a realistic speed. I can also make them go lightning fast if I drop the speed=25 or something, very cool exactly what I wanted.
Herein lies the power of the ActionTimer plugin, which is a very-very good and (at least for me) useful plugin. Many thanks to the developer.
strawberryshortcake wrote:It also seems like there's an "inverse effect going on" compared to the "turtle" speed variable. When I increase the speed of the turtle from say Speed=50 to Speed=150 it gets faster, but with this "butterfly" speed variable, when I increase the speed=50 to Speed=150 it goes in slow motion. Not a big deal, but just an interesting observation.
You're right. When I wrote the code, I missed that in this case the Speed is not exactly a speed, but exactly opposite something: increasing it will decrease the speed and decreasing it will increase the speed. I'll try to find a good solution to this issue and will come back with it.
Sorry for this inattention of mine...
strawberryshortcake wrote:My concerns (3 situations that I'm looking to create) and something else:

Something else: Is there a place where I could add in W= and H= so I can change the size of the butterfly image? Oh yes, I do know how to get the transparency going. Very easy with photoshop and the magic wand function.
Yes, add them to the [MeterButterflies] meter. Eg the following options, added to this meter (and leaving everything else untouched) will double the size of the image:

Code: Select all

[MeterButterflies]
Meter=Image
...
W=960
H=540
strawberryshortcake wrote:
My concerns (3 situations that I'm looking to create) and something else:


Something else: Is there a place where I could add in W= and H= so I can change the size of the butterfly image? Oh yes, I do know how to get the transparency going. Very easy with photoshop and the magic wand function.


3 situations:

Situation 1:
-Animals/creatures that stays animated on my computer screen always
-sort of like a pet dog, always inside your house, you can always see it.
-I'm guessing it's already in the code, but I just can't seem to change the values to make it to work (I've provided a few examples below of what I did with IfCondition.
Sorry, but from your previous post, that's what I understood: that you want to have the animation for a while, then it disappear, then come back and so on.
If you want to see it all the time, you have two solutions:
  • completely remove the ActionTimer plugin measure, decrease the Update value in the [Rainmeter] section and modify the Formula option of the [Timer] measure and the ImageName option of the [MeterButterflies] meter:

    Code: Select all

    [Rainmeter]
    Update=75
    BackgroundMode=2
    SolidColor=0,0,0,1
    DynamicWindowSize=1
    
    [Variables]
    
    [Timer]
    Measure=Calc
    Formula=(( Timer + 1 ) % 100 )
    [MeterButterflies]
    Meter=Image
    ImageName=#@#tmp-[Timer].png
    X=0
    Y=0
    DynamicVariables=1
    Advantage: more simple code.
    Disadvantage: smaller Update value (which means more resource usage) and the absence of the Speed variable.
  • replace the ActionList1 and One options of the [MeasureSlider] measure with the following ones:

    Code: Select all

    [MeasureSlider]
    ...
    ActionList1=Repeat One,#Speed#,100000000
    One=[!SetVariable Frame "((#Frame#+1)%100)"]#U#
    and remove the [!HideMeter "MeterButterflies"] bang from the IfTrueAction option of the [MeasureEnd] measure.
    Advantage: less resource usage, because the ActionTimer plugin is in use.
    Disadvantage: although the 100000000 value in the ActionList1 option of the [MeasureSlider] measure is large enough, after a while it will be reached and that will block the animation.
strawberryshortcake wrote:Situation 2:
-Animals/birds that travels across my computer screen at different points in time.
-sort of like out in real nature. you might see the animal for 1 minute, then it disappears behind a bush, then returns, but he doesn't just magically disappear out of sight (sort of like your turtle situation, he enters from one side of the screen and leaves on the other side of the screen.)
-I'm also guessing this is also already in the code and all I need to do is add in more animation frames that shows that character moving off screen and then reappearing. How do I change the IfCondition so it happens immediately. The bird flies offscreen, then 2 seconds later flies back onto screen in view. or the other way around, the bird flies offscreen, then 30 seconds later flies back onto screen.
But that's exactly the Turtle, isn't it?

More replies later.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to speed up animation? Update=1 doesn't work. Still looks slow motion vs online GIF image.

Post by balala »

strawberryshortcake wrote:(D) Not exactly sure how to "read' this:

[Timer]
Measure=Calc
Formula=( Timer +1 )
IfCondition=((Timer=30)||(Timer=120)||(Timer=150))
IfTrueAction=[!CommandMeasure MeasureSlider "Execute 1"][!ShowMeter "MeterButterflies"][!Redraw]

This calc measure will start to increase when the skin is refreshed. In paralel, according to the bangs of the OnRefreshAction, the ActionList1 of the [MeasureSlider] measure will be executed and the [MeterButterflies] meter will be shown. When the Frame variable reaches 100, the bangs of the IfTrueAction option of the [MeasureEnd] measure will stop the execution of the ActionList1 and will hide the [MeterButterflies] meter.
The ActionTimer1 should restart when some period is passing. These periods can be found on the IfCondition. When the value of the [Timer] measure reaches any of these values, the ActionList1 is restarted and the [MeterButterflies] is shown again.