It is currently May 21st, 2024, 11:23 pm

BitmapTransitionFrames?

Get help with creating, editing & fixing problems with skins
User avatar
wiedzmawiedzma
Posts: 112
Joined: August 18th, 2012, 5:19 pm

BitmapTransitionFrames?

Post by wiedzmawiedzma »

I used animation to display wind speed and would like to use BitmapTransitionFrames will change when the wind speed.
The bitmap is 20 frames, and at 20 is the slowest speed.
I have 6 speeds and ask for a code example: because the manual is so enigmatically explained that it could not be worse. :o
I do not know whether the number of additional frames can be used only once and only get two speeds and a couple of times and a couple of speed.
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22634
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: BitmapTransitionFrames?

Post by jsmorley »

The way to think about BitmapTransitionFrames is to visualize one of those flip clocks.

What you would measure is the right hand side of the number of minutes, (0-9 for instance) set MinValue=0 and MaxValue=9 on the measure, and create a bitmap with the numbers 0 through 9 laid out in a long horizontal image with each number next to each other, evenly spaced.

P.S. For this clock example you are going to need to create measures for all six bits of information, two each for hours, minutes and seconds to do a full clock. However, you only need one all-purpose 0-9 bitmap image.

Ok, that part is annoying to make, but simple enough in concept. However, you want the image to "flip" (or transition) from 0 to 1 with let's say 4 images in between. So you would create 4 new frames in between each number, 0 to 1, 1 to 2, 2 to 3 etc. using any effect you want to create the "morph" from the 0 image to the 1 image.

So we now have 50 evenly spaced images in our "filmstrip" instead of 10. What we do is set TransitionUpdate in the [Rainmeter] section of the skin with a value in milliseconds. This is the "speed" at which the 4 transition images will be displayed at as the meter moves from (in our example) 0 to 1. This is to allow animated transitions between bitmap values to have a much faster performance than the normal Update/UpdateDivider speed the overall skin uses, without having to set the speed of the entire skin very low, which would be a resources issue.

Now set BitmapFrames to 50 and BitmapTransitionFrames to 4. This will tell Rainmeter that every change of the meter, there will be displayed a regular frame, then four transition frames (run at TransitionUpdate speed), ending up on the next regular frame.

This would give us a digit that starts at 0, stays there until the right hand side of the minutes changes to 1, at which point it would quickly display our nice 4 transitions images and stop at the digit 1. Voila, a nice flip clock, with only 100 hours of work making images, god knows how many measures (or a Lua script) to get the left and right sides of the hours, minutes and seconds, and six bitmap meters.

Note, I'm not sure I understand all of your question, but you can only have one TransitionUpdate per skin, so any bitmap meters using BitmapTransitionFrames will all transition at the same speed.
User avatar
KreAch3R
Posts: 608
Joined: February 7th, 2011, 7:27 pm
Location: Thessaloniki, GR

Re: BitmapTransitionFrames?

Post by KreAch3R »

jsmorley wrote:...Voila, a nice flip clock, with only 100 hours of work making images, god knows how many measures (or a Lua script) to get the left and right sides of the hours, minutes and seconds, and six bitmap meters.
:lol:
Thanks for the lesson on BitmapTransitionFrames, because I didn't get it either.
Inactive, due to life changes. Send me a PM for any question.

Desktop DeviartArt
Image
User avatar
wiedzmawiedzma
Posts: 112
Joined: August 18th, 2012, 5:19 pm

Re: BitmapTransitionFrames?

Post by wiedzmawiedzma »

jsmorley wrote:

This would give us a digit that starts at 0, stays there until the right hand side of the minutes changes to 1, at which point it would quickly display our nice 4 transitions images and stop at the digit 1.
Ok! Thanks to understand but will look like when displayed here and give you an example of the clock (start and stop at 0 to 2)
As will be shown 4 transition between 0 and 1 and frame 1 and 4 of the transition between 1 and 2?
User avatar
jsmorley
Developer
Posts: 22634
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: BitmapTransitionFrames?

Post by jsmorley »

wiedzmawiedzma wrote: Ok! Thanks to understand but will look like when displayed here and give you an example of the clock (start and stop at 0 to 2)
As will be shown 4 transition between 0 and 1 and frame 1 and 4 of the transition between 1 and 2?
Not sure I understand your questions, but what would happen is that the meter would be (for instance) displaying the frame in the bitmap "filmstrip" with a "0" as the image. Then when the measure driving the meter changes from 0 to 1, the bitmap meter would display the 4 transition frames using the speed set in TransitionUpdate and end up displaying the frame with the "1" as the image.

It is important to understand the basic Bitmap meter before you dig into transition frames. The way it works is that you have something you are measuring. It could be time, hard drive space, memory, whatever. It needs to be a measure that has a MinValue and MaxValue set, (or the default 0-1 range) so Rainmeter can understand the current value as a "percentage" of MaxValue. Then what Bitmap does is divide your image "filmstrip" into equal parts, based on the value of BitMapFrames on the meter. Then on each update of the skin, it will take the "percentage" value of the measure, and use that to determine which of the "frames" it has created from the overall bitmap "filmstrip" to display. It's all just math, and done automatically by the meter.

What TransitionFrames adds is some frames in your "filmstrip" bitmap that are in effect set aside and not considered when the meter is determining which frame to display based on the percentage returned by the measure. They are instead just displayed "in between" the actual data-driven frames, using the TransitionUpdate speed you set in [Rainmeter].

So in my example above, the meter is currently displaying the "0" frame. When the value of the measure driving the meter changes from "0" to "1", the meter would normally just BAM! display the fame for "1". However with TransitionFrames, what our example does is first display the four transition image frames you created between 0 and 1 in your "filmstrip", one after the other, using the speed in TransitionUpdate, then display the final "1" image that is the actual value desired.
User avatar
wiedzmawiedzma
Posts: 112
Joined: August 18th, 2012, 5:19 pm

Re: BitmapTransitionFrames?

Post by wiedzmawiedzma »

wiedzmawiedzma wrote: Not sure I understand your questions, but what would happen is that the meter would be (for instance) displaying the frame in the bitmap "filmstrip" with a "0" as the image. Then when the measure driving the meter changes from 0 to 1, the bitmap meter would display the 4 transition frames using the speed set in TransitionUpdate and end up displaying the frame with the "1" as the image.
My question is how items are displayed in red if the measure driving the meter changes from 0 to 2
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22634
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: BitmapTransitionFrames?

Post by jsmorley »

wiedzmawiedzma wrote: My question is how items are displayed in red if the measure driving the meter changes from 0 to 2
Good question. Transitions are by their nature "linear", and it is not clear to me yet how that scenario would work. I'll try to create a quick test and see what happens. I suspect nothing good. That isn't the point of transitions in Bitmap.
User avatar
wiedzmawiedzma
Posts: 112
Joined: August 18th, 2012, 5:19 pm

Re: BitmapTransitionFrames?

Post by wiedzmawiedzma »

jsmorley wrote:
Good question. Transitions are by their nature "linear", and it is not clear to me yet how that scenario would work. I'll try to create a quick test and see what happens. I suspect nothing good. That isn't the point of transitions in Bitmap.
Also at this time I make a test! :D
User avatar
wiedzmawiedzma
Posts: 112
Joined: August 18th, 2012, 5:19 pm

Re: BitmapTransitionFrames?

Post by wiedzmawiedzma »

jsmorley wrote:
Good question. Transitions are by their nature "linear", and it is not clear to me yet how that scenario would work. I'll try to create a quick test and see what happens. I suspect nothing good. That isn't the point of transitions in Bitmap.
I did a test! Too bad! The space between the 0 and 2 is considered as a 4 transitions and display 4 frames between 0 and 2
  Here I give an example of three transitions:
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22634
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: BitmapTransitionFrames?

Post by jsmorley »

wiedzmawiedzma wrote: I did a test! Too bad! The space between the 0 and 2 is considered as a 4 transitions and display 4 frames between 0 and 2
  Here I give an example of three transitions:
Yes. Exactly what I got. The other thing that I was never aware of is that it doesn't "wrap" from say 3 to 1, but "reverses" back through 2 to get from 3 to 1, while again "skipping" transition frames as you saw. So this option is one that might be useful in some cases, for "morphing" an image based on some measure value, but probably isn't any good for "digits" due to the behavior.