It is currently March 28th, 2024, 9:47 am

Rotator not working - HELP

Get help with creating, editing & fixing problems with skins
tnpan
Posts: 7
Joined: November 24th, 2017, 7:41 am

Rotator not working - HELP

Post by tnpan »

I have 3 F* nights tring to make an analog clock component

Boddy works, time Temperature works, digital clock, date and Day all works except the F****ing analog component around it.

I've tryed EVERYTHING and I cant find a tutorial on rotator or anything else but the F***ing Rotator documentation that has no use....
Tryed modifiying the pngs and resize them and I stll got them missplaced, rotated, missing or in place but not moving.

Hour, Minutes and Seconds are there but WAY BIG, offset(ed) and croped. seems like H and W are just cropping the image instead of resize it like the body that works as a wonder!

If you could PLEASE help me finish the clock I would appreciate it a LOT!

I tryed just the analog without digital and everything but its just not working, did the d*mn code change in last update? or am I too stupid to make a simple analog clock move propperly in rainmeter?

*sorry for coursing, and misspells, this was written at night angry also I speak spanish...

Code used for component...

Code: Select all

;________________ Clockface working___________

[MeterClockFace]
Meter=Image
ImageName=#@#00 - Body.png
X=0
Y=0
W=270
H=270

;________________ Hour missing, missplaced________

[MeterHoursHand]
Meter=ROTATOR
MeasureName=MeasureTime
ImageName=#@#01 - Hour.png
X=0
Y=0
W=280
H=280
OffsetY=140
OffsetX=140
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=43200

;_____________________Notice that just like in Rotator documentation, i use valuereminder and everything
;_____________________Not even copying and pasting the code works.

[MeterMinutesHand]
Meter=ROTATOR
MeasureName=MeasureTime
ImageName=#@#02 - Minutes.png
X=0
Y=0
W=280
H=280
OffsetY=140
OffsetX=140
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=3600

;_______________________Seconds, working missplaced

[MeterSecondsHand]
Meter=ROTATOR
MeasureName=MeasureTime
ImageName=#@#03 - Seconds.png
X=0
Y=0
W=280
H=280
OffsetY=140
OffsetX=140
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=60

::::::::::::::::::::::::::::::::::: SOLVED: Sumary Coming Soon ::::::::::::::::::::::::::::::::::::::
Attachments
Widget Clock V1 - FLAT REFERENCE.jpg
How the clock should look like at the end. with all working meters.
03 - Seconds.png
Seconds PNG image used
02 - Minutes.png
Minutes PNG image used
01 - Hour.png
Hour PNG image used
00 - Body.png
Body PNG image used
Last edited by tnpan on November 27th, 2017, 12:49 pm, edited 1 time in total.
User avatar
CyberTheWorm
Posts: 860
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Re: Rotator not working - HELP

Post by CyberTheWorm »

Well it looks like the location to the image file is not correct. Rainmeter does not like spaces without quotes.

Either rename the image file names

Code: Select all

ImageName=#@#Hour.png
Or add Quotes

Code: Select all

ImageName=#@#"01 - Hour.png"
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Rotator not working - HELP

Post by jsmorley »

CyberTheWorm wrote:Well it looks like the location to the image file is not correct. Rainmeter does not like spaces without quotes.

Either rename the image file names

Code: Select all

ImageName=#@#Hour.png
Or add Quotes

Code: Select all

ImageName=#@#"01 - Hour.png"
No, that is not needed... Quotes are only needed when a string is a parameter in a bang or Windows command action, and has spaces. They are never needed on option values.

Quotes not needed:

Code: Select all

[MeterImage]
Meter=Image
ImageName=#@#Images\This is a test image.png
Note that in this case quotes would be "allowed", but they are just stripped off and ignored by Rainmeter. They are a waste of time.

Quotes needed:

Code: Select all

LeftMouseUpAction=[!SetOption MyImageMeter ImageName "#@#Images\This is a test image.png"]
LeftMouseUpAction=["C:\Program Files\ccleaner\ccleaner.exe"]
In the first action, the quotes are not about quoting the option value, that is just never needed. It's about allowing the bang to be properly parsed by Rainmeter, as without them it can't tell the end of the ImageName parameter and the start of an optional "config to act on" parameter in the bang itself. In the second action the quotes are needed by Windows, to parse the command line correctly. Spaces are "separators" in Windows/cmd commands.

The exceptions are the Substitute option, where quotes are part of the functionality, and the RunCommand plugin, where Windows/cmd often needs quotes passed to it to parse commands correctly.

Another rare exception would be where you want to set an option value in such a way that the value itself has starting and ending quotes.

Code: Select all

Text=""This is some text with quotes around it!""
So we have two "" double-quotes at the beginning and end. The first set are stripped off and ignored as always, and the second set are actually used in the string value.

That is not to say that the location of the image might not be incorrect, that is certainly possible, but it's not about quotes.
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Rotator not working - HELP

Post by balala »

CyberTheWorm wrote:Well it looks like the location to the image file is not correct. Rainmeter does not like spaces without quotes.

Either rename the image file names

Code: Select all

ImageName=#@#Hour.png
Or add Quotes

Code: Select all

ImageName=#@#"01 - Hour.png"
No, I don't think this would be the problem. Beside jsmorley's reply, I should add that the ImageName=#@#[color=#FF0000]"[/color]01 - Hour.png" option, as you've posted it, doesn't even work. Have you tried it? Because the ImageName=[color=#00FF80]"[/color]#@#01 - Hour.png" option works, but as you've posted it, doesn't. But in such cases the quotes are not needed, see jsmorley's reply above.
Something else is wrong in tnpan's code. The W and H options can't be used in the Rotator meters to resize them. The help doesn't specify this very well, but in a Rotator meter using not the proper values for these options can create a lot of problems.
A first and simplest solution would be to not resize the clock. Remove the W and H options of the [MeterClockFace] meter (and here just as a side note I'd say to also add an UpdateDivider=-1 option to this meter, because you don't have to continuously update it). Then replace the W, H, OffsetX and OffsetY options of the [MeterHoursHand], [MeterMinutesHand] and [MeterSecondsHand] meters with the following values:

Code: Select all

W=400
H=400
OffsetY=200
OffsetX=200
This will increase the size of the whole clock. I think there are solutions to reduce it, but first try this options and let us know if now, excepting the size, everything is ok.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5380
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: Rotator not working - HELP

Post by eclectic-tech »

@ tnpan

Let's get to resolving your problem...

First, all your TIME images need to be rotated 90 degrees to the right; zero degrees in Rotator meters is at 3 o'clock, NOT 12 o'clock.
EDIT: You could alternately use balala's suggestion below to change the start angle of those meters.

After doing that "Refresh All".

Now the problem with your code was trying to resize Rotator meters using W & H, but as balala pointed out, you cannot do use those values in this type of meter; the center of rotation will be located at the center of the height and width specified for the meter.

To make a scaleable skin that contains Rotator meters, you need to use TransformationMatrix codes to scale the Rotator meters. I wrote a journal several years ago with some examples. Here is your code with the modifications to allow scaling.

Code: Select all

[Variables]
Scaler=0.33

[MeasureTime]
Measure=Time

;________________ Clockface working___________

[MeterClockFace]
Meter=Image
ImageName=#@#00 - Body.png
W=(1229*#Scaler#)
H=(1229*#Scaler#)

;________________ Hour missing, missplaced________

[MeterHoursHand]
Meter=ROTATOR
MeasureName=MeasureTime
ImageName=#@#01 - Hour.png
X = ([MeterClockFace:W] / 2)
Y = ([MeterClockFace:H] / 2)
OffsetX = (1229 / 2)
OffsetY = (1229 / 2)
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=43200
TransformationMatrix=#Scaler#;0;0;#Scaler#;((1-#Scaler#)*[#CURRENTSECTION#:X]);((1-#Scaler#)*[#CURRENTSECTION#:Y])
DynamicVariables=1

;_____________________Notice that just like in Rotator documentation, i use valuereminder and everything
;_____________________Not even copying and pasting the code works.

[MeterMinutesHand]
Meter=ROTATOR
MeasureName=MeasureTime
ImageName=#@#02 - Minutes.png
X = ([MeterClockFace:W] / 2)
Y = ([MeterClockFace:H] / 2)
OffsetX = (1229 / 2)
OffsetY = (1229 / 2)
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=3600
TransformationMatrix=#Scaler#;0;0;#Scaler#;((1-#Scaler#)*[#CURRENTSECTION#:X]);((1-#Scaler#)*[#CURRENTSECTION#:Y])
DynamicVariables=1

;_______________________Seconds, working missplaced

[MeterSecondsHand]
Meter=ROTATOR
MeasureName=MeasureTime
ImageName=#@#03 - Seconds.png
X = ([MeterClockFace:W] / 2)
Y = ([MeterClockFace:H] / 2)
OffsetX = (1229 / 2)
OffsetY = (1229 / 2)
StartAngle=4.7124
RotationAngle=6.2832
ValueRemainder=60
TransformationMatrix=#Scaler#;0;0;#Scaler#;((1-#Scaler#)*[#CURRENTSECTION#:X]);((1-#Scaler#)*[#CURRENTSECTION#:Y])
DynamicVariables=1
Let us know if you have any questions. :welcome:
Last edited by eclectic-tech on November 24th, 2017, 6:30 pm, edited 1 time in total.
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Rotator not working - HELP

Post by balala »

eclectic-tech wrote:First, all your images need to be rotated 90 degrees to the right; zero degrees in Rotator meters is at 3 o'clock, NOT 12 o'clock.

After doing that "Refresh All".
Good point, eclectic-tech, it seems I've omitted this detail. :thumbup:
Just to say how to do this, the StartAngle=4.7124 options of the [MeterHoursHand], [MeterMinutesHand] and [MeterSecondsHand] meters should be replaced with StartAngle=6.2832.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5380
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: Rotator not working - HELP

Post by eclectic-tech »

balala wrote:Good point, eclectic-tech, it seems I've omitted this detail. :thumbup:
Just to say how to do this, the StartAngle=4.7124 options of the [MeterHoursHand], [MeterMinutesHand] and [MeterSecondsHand] meters should be replaced with StartAngle=6.2832.
Yes, changing the start angle of the rotator meters is another option, rather than editing the images.
Good point! As always, there are many ways to achieve the same results. :D
tnpan
Posts: 7
Joined: November 24th, 2017, 7:41 am

Re: Rotator not working - HELP

Post by tnpan »

YESS!! it now works! just final touches ahead now :)

Sumary:

About Images loading, no Quotes ("simething") are necessary, documentation states that as long as the images are saved in a relative folder or an absolute path is set for it, it will load, spaces in the name are no issue either. :D

Hours, minutes and seconds isssue was not the image not loading, actually removing measurements and setting it as < Meter=image >, just like the working boddy would load, so code was all the mess, Documentation IMO needs to be updated, Rorator example depicted there is no use for custom builds, now that I checked out some other meters (yeah stealing code :oops: ) i noticed that no one is using that example, but Transformation matrix as sugested.

Thank you everyone for your help! I really appreciate it!

now i only need to add a 5 seconds mark, a circle and a Dot (still frame rotating) to make it look as the meter I designed.

a constant speed is needed to make make spin this cicle and dot, the 5 second mark needs to rotate every 72 degrees starting from top (12 o'clock)

My assumption was to use seconds code to make it move and change the rotation angle like this:

Code: Select all


[MeasureTimec]
Measure=Time

[Meter5SecondsHand]
Meter=ROTATOR
MeasureName=MeasureTimec
ImageName=#@#03 - 5 Seconds mark.png
X = ([MeterClockFace:W] / 2)
Y = ([MeterClockFace:H] / 2)
OffsetX = (1229 / 2)
OffsetY = (1229 / 2)
StartAngle=4.7124
RotationAngle=72
ValueRemainder=60
TransformationMatrix=#Scaler#;0;0;#Scaler#;((1-#Scaler#)*[#CURRENTSECTION#:X]);((1-#Scaler#)*[#CURRENTSECTION#:Y])
DynamicVariables=1
*notice I use "MeasureTimeC" as I have loaded that code several times with different configs, that helped to use it independantly with each meter i load in the same *.ini file.

I'll uplad the full Rainmeter skinn once its finished, could you help me with those last 2
- Rotate every second 72 degrees starting from 12 o'clock and,
- rotating an image at a constant speed (1 revolution per second for the dot and 2 for another dotted-line circle)
Attachments
01 a example.jpg
what do you think? looks awesome isn't it? :)
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5380
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: Rotator not working - HELP

Post by eclectic-tech »

tnpan wrote:now i only need to add a 5 seconds mark, a circle and a Dot (still frame rotating) to make it look as the meter I designed.

a constant speed is needed to make make spin this cicle and dot, the 5 second mark needs to rotate every 72 degrees starting from top (12 o'clock)
You have not included the images for these meters; it would help to see what you desire.

Not sure what you are looking for, but looking at your original desired clock I see red lines around the outer clock. If this is what you want to rotate 72 degrees, I would suggest a loop measure and a shape meter with stroke dash patterns for the lines that rotate 72 degrees every second. Add these 2 sections to your code.

Code: Select all

[MeasureTime72]
Measure=Loop
StartValue=0
EndValue=288
Increment=72

[MeterShapeEllipse]
Meter=Shape
X=0
Y=0
; Shape=Ellipse CenterX, CenterY, RadiusX, {RadiusY}
Shape=Ellipse (614*#Scaler#),(614*#Scaler#),(480*#Scaler#) | StrokeWidth 2 | StrokeColor 255,0,0,220 | StrokeDashes (100*#Scaler#),(15*#Scaler#) | Fill Color 0,0,0,1 | Rotate [MeasureTime72]
DynamicVariables=1
For the image you want to rotate all the way around every second will require a much lower skin Update to provide the animation speed. This means you would need to add dividers to other meters and will probably increase the CPU load considerably. Are you sure you want that additional load? You are already using a visualizer, together that is going to cause performance issues.

EDIT: I added scaling to the stroke dashes. You can modify that parameter for different styles. See: StrokeDashes
tnpan
Posts: 7
Joined: November 24th, 2017, 7:41 am

Re: Rotator not working - HELP

Post by tnpan »

Yes! Indeed, all the red stuff are details, the red triangle marks 5 seconds, the image is similarnto the ones showed before.

I've scale it and make it move for a whilr but never thought i only had to use 288 of 360 degrees, i'll try that asap.

About the dashed line, is beter to use that code o a static png set to rotate at a constant speed?

Lastly the dot, you can see it in the refference image at 8, originaly was made to spin every second non-stop. An echo of the seconds again. As mentioned before by eclectic-tech, the dot don't spins, it jumps, seems i'll have to redesign that one :/
Post Reply