It is currently April 19th, 2024, 1:04 am

Rotating image (circle) choppy

Get help with creating, editing & fixing problems with skins
Vikerules
Posts: 3
Joined: May 2nd, 2017, 7:32 am

Rotating image (circle) choppy

Post by Vikerules »

Code: Select all

[Rainmeter]
Update=300
DynamicWindowSize=1

[Variables]
ImageW=500
ImageH=500

[MeasureRotate]
Measure=Calc
Formula=(MeasureRotate % 360) + 1
MaxValue=360

[MeterRotate]
Meter=Rotator
MeasureName=MeasureRotate
ImageName=Circle.png
OffsetX=(#ImageW# / 2)
OffsetY=(#ImageH# / 2)
W=#ImageW#
H=#ImageH#
this is pretty much how slow i want the circle to rotate > https://i.gyazo.com/6594858a5319f91a515d347838b1ef26.mp4

but i have no idea how to make the rotation smoother... if i decrease Update= it becomes smoother but way too fast. is it possible to do this?
Last edited by fonpaolo on May 2nd, 2017, 8:05 am, edited 1 time in total.
Reason: Please use the [code] tags
User avatar
Bananorpion
Posts: 40
Joined: April 16th, 2017, 8:35 pm

Re: Rotating image (circle) choppy

Post by Bananorpion »

Have you tried increasing the [MeasureRotate] MaxValue?

instead of

Code: Select all

[MeasureRotate]
Measure=Calc
Formula=(MeasureRotate % 360) + 1
MaxValue=360
add it as a variable

Code: Select all

[Variables]
Degree=1080
then refactor the rest

Code: Select all

[MeasureRotate]
Measure=Calc
Formula=(MeasureRotate % #Degree#) + 1
MaxValue=#Degree#
so you can easily change the speed, or even change it dynamically

(Not tested because I'm lazy)
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Rotating image (circle) choppy

Post by jsmorley »

As with any animation, the "smoothness" and "speed" are a balance of the rate at which the "frames" are displayed (speed) and the number of frames (smoothness).

Try:

Code: Select all

[Rainmeter]
Update=75
DynamicWindowSize=1

[Variables]
ImageW=500
ImageH=500

[MeasureRotate]
Measure=Calc
Formula=(MeasureRotate % 1440) + 1
MaxValue=1440

[MeterRotate]
Meter=Rotator
MeasureName=MeasureRotate
ImageName=Circle.png
OffsetX=(#ImageW# / 2)
OffsetY=(#ImageH# / 2)
W=#ImageW#
H=#ImageH#
That has 4 times as many frames, while displaying them 4 times as fast, to achieve more smoothness with the same speed.

There is nothing magical about "360" in a Rotator meter. It's not about compass degrees, only a percentage based on the current value as a percentage of the MaxValue.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Rotating image (circle) choppy

Post by jsmorley »

BTW, just as an aside, I prefer:

Code: Select all

[MeasureRotate]
Measure=Loop
StartValue=0
EndValue=1440
Over:

Code: Select all

[MeasureRotate]
Measure=Calc
Formula=(MeasureRotate % 1440) + 1
MaxValue=1440
Not only is it a bit simpler, but it is "0-based" rather than "1-based" as that Calc measure is. I think for a rotation, it makes more sense, particularly if you are basing the measure values in any way on compass degrees, to start with "0" rather than "1". If you think about it, 1-1440 is 1439 "steps". 0-1440 is 1440 "steps". While that may not matter in a purely circular image that doesn't have any visible "orientation", that missing "step" is going to be an issue in other cases, and in this case for instance, you would likely need to use 1441 as the value, not 1440, in order to really get 1440 "steps".
Vikerules
Posts: 3
Joined: May 2nd, 2017, 7:32 am

Re: Rotating image (circle) choppy

Post by Vikerules »

jsmorley wrote:BTW, just as an aside, I prefer:

Code: Select all

[MeasureRotate]
Measure=Loop
StartValue=0
EndValue=1440
Over:

Code: Select all

[MeasureRotate]
Measure=Calc
Formula=(MeasureRotate % 1440) + 1
MaxValue=1440
Not only is it a bit simpler, but it is "0-based" rather than "1-based" as that Calc measure is. I think for a rotation, it makes more sense, particularly if you are basing the measure values in any way on compass degrees, to start with "0" rather than "1". If you think about it, 1-1440 is 1439 "steps". 0-1440 is 1440 "steps". While that may not matter in a purely circular image that doesn't have any visible "orientation", that missing "step" is going to be an issue in other cases, and in this case for instance, you would likely need to use 1441 as the value, not 1440, in order to really get 1440 "steps".
[MeasureRotate]
Measure=Loop
StartValue=0
EndValue=1440

worked wonders, exactly what i was looking for however i ended up with 25 update and 3000 EndValue since it looks insanly smooth. will these numbers impact performance more or will it be of no impact?
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Rotating image (circle) choppy

Post by jsmorley »

Vikerules wrote:[MeasureRotate]
Measure=Loop
StartValue=0
EndValue=1440

worked wonders, exactly what i was looking for however i ended up with 25 update and 3000 EndValue since it looks insanly smooth. will these numbers impact performance more or will it be of no impact?
A lower Update value in [Rainmeter] will always use a bit more CPU than a higher value. There is no way to quantify this, it's just a question of how much work you are asking Rainmeter to do in a skin within a given number of milliseconds. It can be very little indeed for a simple skin that is displaying one animation, or it can bring your system to its knees if you have a complicated skin doing a lot of things with a low Update. In general, I consider an Update less than 100 to be "low", and if I needed to set an Update less than that, I would give some thought and analysis (you can look at what Rainmeter is using in TaskManager among other tools) on how much I am asking the skin to do.

Not saying that a low Update is a bad thing. There are times when you might need it and that's fine. All I'm saying is that there is a cost, and when you use a low Update it is time to look carefully at your skin to be sure you have "optimized" it as much as you can.

One good way to do that is setting UpdateDivider on all measures and meters that DON'T need the fast update.

Another thing to be cautious about is Image meters that you are "resizing" using W and H. The resizing is done during the "redraw" event of the skin update cycle, and can't be avoided. No UpdateDivider will make any difference in that case. This resizing is not done as a part of the "meter update", but as part of the "skin update", specifically the "redraw". Resizing an image is relatively "costly" in CPU, and with a low Update you are doing it more often... Again, with an image or two this is a trivial issue. With a skin with a low Update and a lot of images being resized with W and H on the Image meters, it can be very costly indeed. The best solution is to resize images permanently outside of Rainmeter with a graphics program of some kind, and avoid W and H on the Image meters. Note that the "difference" between the actual image size and what you are using in W and H is a big factor in this. The more you are changing the size, the more work is done.
KrupeshAnadkat
Posts: 3
Joined: January 5th, 2018, 4:30 am

Re: Rotating image (circle) choppy

Post by KrupeshAnadkat »

[MeasureRotate]
Measure=Calc
Formula=(MeasureRotate % 360) + 1
MaxValue=360

Change your formula for faster rotation make it "2" instead of "1" at last, or increase to a greater no., experiment it.