It is currently October 4th, 2024, 12:16 am

Help to assemble a formula

Get help with creating, editing & fixing problems with skins
User avatar
arcanosa84
Posts: 173
Joined: May 21st, 2023, 1:47 am

Re: Help to assemble a formula

Post by arcanosa84 »

balala wrote: September 18th, 2023, 6:02 pm Can. You have to use nesting variables. For instance: ImageTint=[#Color[#Planet]Pla]. Here the [#Planet] element is the variable representing the name of the planets (Venus or Earth for example). In the [#Color[#Planet]Pla] variable (yep, this is a variable) the [#Planet] element is replaced by either Venus or Earth (or any other value it can take). When this has been done, the variable will be [#ColorVenusPla] or [#ColorEarthPla], which is the same as #ColorVenusePla# or #ColorEarthPla#.


There is no other way to rotate a Bitmap meter (what [MeterGlobe] is in the Mirage\RotatingGlobe\RotatingGlobe.ini skin), than TransformationMatrix. This is applied there as well. See the TranformationMatrix option of the [MeterGlobe] meter. Looks complicated? Might be, the math behind it is indeed not to easy. But if you are interested, you have an exceptionel description of all those stuffs here.

This depends on how are you using the skin:
  • If you're using continuous rotation, you have to reduce the 75 element in the Update=((#ContinuousRotation#>=1)?75:1000) option of the [Rainmeter] section, to speed up the rotation. Take care: the lower the value is, the higher rotation speed you get.
  • If you're not using continuous rotation, you have to decrease the 25 value in the ActionList1=Repeat Rotate,25,120 option of the [MeasureSlide] measure.
Don't worry, you are not. This is the purpose of this forum: folks out there to can ask for help. We're replying only when have time and energy. So don't worry, just ask when questions arise. Just take into account that sometimes takes us a little bit more time to reply. That's all...
In variables I set it up this way, understanding what you explained to me, just by changing the name of the planet and having the folders with the images in the correct place, only with that change I can count the number of images in the folder, and adjust the code with its corresponding variables for its operation.
Thank you, it is clarified with your explanation. :great: :great: :great:

Code: Select all

[Variables]
Planet=Venus
FolderAtm=#@#/Images/#Planet#/
FolderPla=#FolderAtm#/#Planet#
ColorPlanet=[#Color[#Planet]Pla]
ColorAtm=[#Color[#Planet]Atm]
:Whistle :Whistle Learning is the most complete art of life. Just enjoy it. :bow: :bow:
User avatar
arcanosa84
Posts: 173
Joined: May 21st, 2023, 1:47 am

Re: Help to assemble a formula

Post by arcanosa84 »

Yincognito wrote: September 18th, 2023, 7:27 pm Might worth to note that if the OP was instead using a ColorPlanet variable in the code (like he did before editing his post), making use of escaping variables to literal with * and declaring ColorPlanet=[#*Color[#*Planet*]Pla*] in [Variables], followed by using a standard ImageTint=#ColorPlanet#, would have achieved the same thing. This would be true in bangs as well, where setting the Planet variable wouldn't need to be followed by setting ColorPlanet to [#Color[#Planet]Pla] again, to get the desired result.

In such a case, ColorPlanet would automatically parse to the desired value even if written in its standard form in the option, since it was basically declared as a nested syntax STRING (in which variables weren't resolved aka replaced with their actual values).

P.S. The caps are for the OP here, not for you, by the way. It's far from ideal (to put it mildly) to jump to complex stuff like nesting or escaping variables (AND possibly measures, by the way), ActionTimer or TransformationMatrix, when you can't tell the difference between measures, meters and variables yet.
Last night, after several attempts, I had to update what I had published because it did not translate as I wanted, so I edited it to show what it really was.
Here I am going to leave the complete code so you can see how it turned out complete.
It is true that sometimes I managed to get confused, but I am studying, perhaps the opposite of how I should, but the important thing is to clarify, since the measurements are what recover information to be used by the meters in visual elements to be shown, since That is very clear to me, since my friend Balala also corrected me because he had it described incorrectly in the code of the configuration skin, but little by little I am changing everything that is wrong.
I know that what I asked about changing the angle of the image is complex, since I was reviewing it, but I want to understand it. In this code that I show, I would like the planets to be at a correct inclination and at an adjusted speed.
Might worth to note that if the OP was instead using a ColorPlanet variable in the code (like he did before editing his post), making use of escaping variables to literal with * and declaring ColorPlanet=[#*Color[#*Planet*]Pla*] in [Variables], followed by using a standard ImageTint=#ColorPlanet#, would have achieved the same thing. This would be true in bangs as well, where setting the Planet variable wouldn't need to be followed by setting ColorPlanet to [#Color[#Planet]Pla] again, to get the desired result.

In such a case, ColorPlanet would automatically parse to the desired value even if written in its standard form in the option, since it was basically declared as a nested syntax STRING (in which variables weren't resolved aka replaced with their actual values).
I am going to try it this way now, although I wanted to compose the variable manually, so that when changing the name of the planet everything would be configured at once. :great: :great: :great:

Code: Select all

[RainMeter]
Update=70
Author=AlexSoft

[Variables]
@Include=#@#\Config\Variables.inc
@Include2=#@#\Config\Styles.inc
@Include3=#@#\Config\Links.inc

Planet=Venus
FolderAtm=#@#/Images/#Planet#/
FolderPla=#FolderAtm#/#Planet#
ColorPlanet=[#Color[#Planet]Pla]
ColorAtm=[#Color[#Planet]Atm]

[MeasureFolder]
Measure=Plugin
Plugin=FolderInfo
Folder=#FolderPla#
InfoType=FolderSize
IncludeHiddenFiles=1
IncludeSubFolders=1
IncludeSystemFiles=1
RegExpFilter=.png
UpdateDivider=10

[MeasureFileCount]
Measure=Plugin
Plugin=FolderInfo
Folder=[MeasureFolder]
InfoType=FileCount
UpdateDivider=10

[Atm]
Meter=Image
X=0
Y=0
W=122
H=117
ImageTint=#ColorAtm#
ImageName=#FolderAtm#/atmospher.png

[MeasureFrameCalc]
measure=Calc
formula=counter % [MeasureFileCount]
substitute=".00000":""
disabled=0
dynamicVariables=1

[MeterFrame]
meter=Image
x=-5r
y=9r
H=97
W=130
ImageTint=#ColorPlanet#
ImageName="#FolderPla#/#Planet#[MeasureFrameCalc].png"
DynamicVariables=1

:Whistle :Whistle Learning is the most complete art of life. Just enjoy it. :bow: :bow:
User avatar
arcanosa84
Posts: 173
Joined: May 21st, 2023, 1:47 am

Re: Help to assemble a formula

Post by arcanosa84 »

balala wrote: September 18th, 2023, 4:19 pm Most probably you have enabled the hardware acceleration in Rainmeter settings. Try disabling it. For this click the Rainmeter icon in the Notification Area, go to the last (fourth - Settings) tab in the opening Manage Rainmeter dialog and uncheck the Use hardware acceleration checkbox. You have to restart Rainmeter.
Does the rotation go on properly this way?

Yep, it is quite complex. This is why most users dislike it.
That was true, I already disabled the hardware acceleration option and it works correctly, I don't know when I had activated that option again, I normally have it removed, so I hoped it would be that way, but that was the detail. Thank you and I'm sorry. :great: :great: :great:

With what you sent me to review, it is impossible for me to implement a variable in my code myself to change the angle of rotation of my planet skin. I only uploaded 2 because otherwise it won't let me load it here, it weighs more than 10 Mb. Guide me How could I put it to change the angle of this code, since editing the image, as you can see, is much more difficult for me.
And as my friend Yincognito says, that is still too much for me, I will get there but not for now. :-( :-( :-(

On the other hand, I tried to find a way to do this to apply it to what I'm doing and I couldn't figure out your code, something crazy trying to get a way to do it from there, super code for me.
Image
I want to apply it to something I'm doing for the size of the planets, I thought about doing it by entering the value of the variable, but this looks cooler.
Add a variable Size=1 up to 15 for the size of the planet, doing a multiplication, but I had to change the images so that they looked good with each other.
W=(30*#Size#)
H=(30*#Size#)
This way I managed to increase the size of the planets in the code that I published, but I am fixing the images first so I can add the data to the code. :thumbup:

Code: Select all

[RainMeter]
Update=70
Author=AlexSoft

[Variables]
@Include=#@#\Config\Variables.inc
@Include2=#@#\Config\Styles.inc
@Include3=#@#\Config\Links.inc

Planet=Venus
FolderAtm=#@#/Images/#Planet#/
FolderPla=#FolderAtm#/#Planet#
ColorPlanet=[#Color[#Planet]Pla]
ColorAtm=[#Color[#Planet]Atm]

[MeasureFolder]
Measure=Plugin
Plugin=FolderInfo
Folder=#FolderPla#
InfoType=FolderSize
IncludeHiddenFiles=1
IncludeSubFolders=1
IncludeSystemFiles=1
RegExpFilter=.png
UpdateDivider=10

[MeasureFileCount]
Measure=Plugin
Plugin=FolderInfo
Folder=[MeasureFolder]
InfoType=FileCount
UpdateDivider=10

[Atm]
Meter=Image
X=0
Y=0
W=122
H=117
ImageTint=#ColorAtm#
ImageName=#FolderAtm#/atmospher.png

[MeasureFrameCalc]
measure=Calc
formula=counter % [MeasureFileCount]
substitute=".00000":""
disabled=0
dynamicVariables=1

[MeterFrame]
meter=Image
x=-5r
y=9r
H=97
W=130
ImageTint=#ColorPlanet#
ImageName="#FolderPla#/#Planet#[MeasureFrameCalc].png"
DynamicVariables=1

You do not have the required permissions to view the files attached to this post.
:Whistle :Whistle Learning is the most complete art of life. Just enjoy it. :bow: :bow:
User avatar
balala
Rainmeter Sage
Posts: 16623
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help to assemble a formula

Post by balala »

arcanosa84 wrote: September 19th, 2023, 2:05 am Thank you, it is clarified with your explanation. :great: :great: :great:
Great. I'm glad.
arcanosa84 wrote: September 19th, 2023, 2:33 am That was true, I already disabled the hardware acceleration option and it works correctly, I don't know when I had activated that option again, I normally have it removed, so I hoped it would be that way, but that was the detail. Thank you and I'm sorry. :great: :great: :great:
Great once again. The hardware acceleration can cause lot of troubles, in many cases. It has to be treated carefuly.
But don't apologize. You don't have to be sorry...
arcanosa84 wrote: September 19th, 2023, 2:33 am With what you sent me to review, it is impossible for me to implement a variable in my code myself to change the angle of rotation of my planet skin. I only uploaded 2 because otherwise it won't let me load it here, it weighs more than 10 Mb. Guide me How could I put it to change the angle of this code, since editing the image, as you can see, is much more difficult for me.
And as my friend Yincognito says, that is still too much for me, I will get there but not for now.
No, editing the image is completely non-sense. What if anytime after releasing the skin, you get the idea to rotate it to another angle? Do you edit the images (74 images in case of Venus, for instance) once again? No, this doesn't really make sense.
You have to apply a proper option to get the images rotated into the code of your skin. In this case for example, add the following option to the [MeterFrame] meter: TransformationMatrix=(Cos(Rad(#InclinationAngle#)));(-Sin(Rad(#InclinationAngle#)));(Sin(Rad(#InclinationAngle#)));(Cos(Rad(#InclinationAngle#)));(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)-(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Cos(Rad(#InclinationAngle#)))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Sin(Rad(#InclinationAngle#))));(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)+(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Sin(Rad(#InclinationAngle#)))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Cos(Rad(#InclinationAngle#)))) (this is a simplified option from my RotatingGlobe skin).
In order this to work, you need to add a InclinationAngle variable to the [Variables] section, which represents the angle of rotation, in degrees. Note that positive values rotate the image anticlockwise, while negative values rotate it clockwise.
arcanosa84 wrote: September 19th, 2023, 2:33 am This way I managed to increase the size of the planets in the code that I published, but I am fixing the images first so I can add the data to the code. :thumbup:
To be honest now, I'm not sure I can follow you at this point. Did you succeed in adding the Size variable or didn't? I assume you didn't, the skin not having this variable, but I didn't really understand your explanation. Please come back with some details if you need help on this.
Additionally I recommend you to take small steps at a time. As a beginner, don't try to make everything at once. Wait to finish in adding / setting the rotation angle and in understanding it, then make another step and add the size setting. At least this is my recommendetion...
User avatar
arcanosa84
Posts: 173
Joined: May 21st, 2023, 1:47 am

Re: Help to assemble a formula

Post by arcanosa84 »

balala wrote: September 19th, 2023, 2:32 pm Great. I'm glad.

Great once again. The hardware acceleration can cause lot of troubles, in many cases. It has to be treated carefuly.
But don't apologize. You don't have to be sorry...

No, editing the image is completely non-sense. What if anytime after releasing the skin, you get the idea to rotate it to another angle? Do you edit the images (74 images in case of Venus, for instance) once again? No, this doesn't really make sense.
You have to apply a proper option to get the images rotated into the code of your skin. In this case for example, add the following option to the [MeterFrame] meter: TransformationMatrix=(Cos(Rad(#InclinationAngle#)));(-Sin(Rad(#InclinationAngle#)));(Sin(Rad(#InclinationAngle#)));(Cos(Rad(#InclinationAngle#)));(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)-(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Cos(Rad(#InclinationAngle#)))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Sin(Rad(#InclinationAngle#))));(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)+(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Sin(Rad(#InclinationAngle#)))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Cos(Rad(#InclinationAngle#)))) (this is a simplified option from my RotatingGlobe skin).
In order this to work, you need to add a InclinationAngle variable to the [Variables] section, which represents the angle of rotation, in degrees. Note that positive values rotate the image anticlockwise, while negative values rotate it clockwise.

To be honest now, I'm not sure I can follow you at this point. Did you succeed in adding the Size variable or didn't? I assume you didn't, the skin not having this variable, but I didn't really understand your explanation. Please come back with some details if you need help on this.
Additionally I recommend you to take small steps at a time. As a beginner, don't try to make everything at once. Wait to finish in adding / setting the rotation angle and in understanding it, then make another step and add the size setting. At least this is my recommendetion...
Yes, that's how I was doing it, those images of Venus are edited to give it the correct inclination according to astronomers, I have not changed the direction of rotation due to the code, I do it according to the order of the images, but little by little.
I already tried the turning angle thing, it works perfectly. Thanks, it would be impossible to follow your code or the manual, I didn't understand much of the explanation, but I won't torment myself with that, I'll be able to understand it at some point.
I was telling you about the size of the planet, I already did that, but I didn't send it to you that way because I was editing the images, the image of the planet and the image of the atmosphere that surrounds them were not the same, and to center the 2 images It was going to present more problems, and that's just a one-time fix. I show you how the complete code looks adding the size of the planets.
What I wanted was to achieve that instead of writing the variable as I have done in my configuration skin, use that idea of yours of selecting it directly, but it happens to me that I still can't decipher it from your code.
Image
But if it is very complex, there is no problem, I do it as I have it applied, already writing the variable directly. It was just something aesthetic, which looks very good. :great: :great: :great: :great:
Thanks for the formula for modifying the angle of rotation. it's great. :bow: :bow: :bow:
:Whistle :Whistle Learning is the most complete art of life. Just enjoy it. :bow: :bow:
User avatar
Yincognito
Rainmeter Sage
Posts: 8324
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help to assemble a formula

Post by Yincognito »

arcanosa84 wrote: September 19th, 2023, 2:20 am Last night, after several attempts, I had to update what I had published because it did not translate as I wanted, so I edited it to show what it really was.
Here I am going to leave the complete code so you can see how it turned out complete.
It is true that sometimes I managed to get confused, but I am studying, perhaps the opposite of how I should, but the important thing is to clarify, since the measurements are what recover information to be used by the meters in visual elements to be shown, since That is very clear to me, since my friend Balala also corrected me because he had it described incorrectly in the code of the configuration skin, but little by little I am changing everything that is wrong.
I know that what I asked about changing the angle of the image is complex, since I was reviewing it, but I want to understand it. In this code that I show, I would like the planets to be at a correct inclination and at an adjusted speed.



I am going to try it this way now, although I wanted to compose the variable manually, so that when changing the name of the planet everything would be configured at once. :great: :great: :great:

Code: Select all

[RainMeter]
Update=70
Author=AlexSoft

[Variables]
@Include=#@#\Config\Variables.inc
@Include2=#@#\Config\Styles.inc
@Include3=#@#\Config\Links.inc

Planet=Venus
FolderAtm=#@#/Images/#Planet#/
FolderPla=#FolderAtm#/#Planet#
ColorPlanet=[#Color[#Planet]Pla]
ColorAtm=[#Color[#Planet]Atm]

[MeasureFolder]
Measure=Plugin
Plugin=FolderInfo
Folder=#FolderPla#
InfoType=FolderSize
IncludeHiddenFiles=1
IncludeSubFolders=1
IncludeSystemFiles=1
RegExpFilter=.png
UpdateDivider=10

[MeasureFileCount]
Measure=Plugin
Plugin=FolderInfo
Folder=[MeasureFolder]
InfoType=FileCount
UpdateDivider=10

[Atm]
Meter=Image
X=0
Y=0
W=122
H=117
ImageTint=#ColorAtm#
ImageName=#FolderAtm#/atmospher.png

[MeasureFrameCalc]
measure=Calc
formula=counter % [MeasureFileCount]
substitute=".00000":""
disabled=0
dynamicVariables=1

[MeterFrame]
meter=Image
x=-5r
y=9r
H=97
W=130
ImageTint=#ColorPlanet#
ImageName="#FolderPla#/#Planet#[MeasureFrameCalc].png"
DynamicVariables=1

Regarding the inclination, if I correctly understand what you mean (i.e. the inclination like the 23.45 degree inclination of Earth to the orbital plane around the Sun), this is only possible in Rainmeter when done around the Z axis plane from the XYZ 3D system (this would correspond to how the limbs of a classic clock rotate on the screen, and has probably been covered by balala in his posts). My point is, in case you wonder, 3D manipulation in plain Rainmeter is not possible, for that you would have to use the WebView plugin by khanhas and program stuff in a 3D library in Javascript, like I did for my Earth skin from my avatar description (yep, it's way too complex for you to even try to use it, I only said this in case you were thinking about it).

As for the code you posted, it's by no means required to do it like that, it's just another way to do what balala advised. By the way, in that code, you didn't escape ColorPlanet and ColorAtm using * like I mentioned - just saying. Anyway, you don't have to bother with it if you're OK with how you do things now.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
arcanosa84
Posts: 173
Joined: May 21st, 2023, 1:47 am

Re: Help to assemble a formula

Post by arcanosa84 »

Yincognito wrote: September 19th, 2023, 4:34 pm Regarding the inclination, if I correctly understand what you mean (i.e. the inclination like the 23.45 degree inclination of Earth to the orbital plane around the Sun), this is only possible in Rainmeter when done around the Z axis plane from the XYZ 3D system (this would correspond to how the limbs of a classic clock rotate on the screen, and has probably been covered by balala in his posts). My point is, in case you wonder, 3D manipulation in plain Rainmeter is not possible, for that you would have to use the WebView plugin by khanhas and program stuff in a 3D library in Javascript, like I did for my Earth skin from my avatar description (yep, it's way too complex for you to even try to use it, I only said this in case you were thinking about it).

As for the code you posted, it's by no means required to do it like that, it's just another way to do what balala advised. By the way, in that code, you didn't escape ColorPlanet and ColorAtm using * like I mentioned - just saying. Anyway, you don't have to bother with it if you're OK with how you do things now.
Yes, I was really reading how to do the inclination thing and it surpassed me a lot, that's why I didn't make the attempt, and I asked for help to rotate my planets since it would be very complex to do it myself, I'm already arranging the images because the atmosphere and the planet were not the same size and I should look for the center as you show me in the other skins, but in the end I would end up editing the photos so I arrange the photos only once and make them more standard to use, which I am not done with yet. all. and the angle as Balala shared it with me is great, since it achieved the objective.
I'm reading your answers and I'm directly testing the options or experimenting, that's why I made the balala option in that code, the one you gave me, and I already have it installed in another one, testing it the same way. I have not yet assembled that code where it goes, even the size and rotation will use variables that will be in the variables file, to be controlled by the configuration skin.
Both options work perfectly for me, which I understand is that the option you give me has another benefit.
thanks for the help as always.
I am very satisfied to be able to count on the attention of experts like you. :great: :great: :bow: :bow:

Code: Select all

[RainMeter]
Update=70
Author=AlexSoft

[Variables]
@Include=#@#\Config\Variables.inc
@Include2=#@#\Config\Styles.inc
@Include3=#@#\Config\Links.inc

Size=4

InclinationAngle=25

Planet=Venus
FolderAtm=#@#/Images/#Planet#/
FolderPla=#FolderAtm#/#Planet#
ColorPlanet=[#*Color[#*Planet*]Pla*]
ColorAtm=[#*Color[#*Planet*]Atm*]

[MeasureFolder]
Measure=Plugin
Plugin=FolderInfo
Folder=#FolderPla#
InfoType=FolderSize
IncludeHiddenFiles=1
IncludeSubFolders=1
IncludeSystemFiles=1
RegExpFilter=.png
UpdateDivider=10

[MeasureFileCount]
Measure=Plugin
Plugin=FolderInfo
Folder=[MeasureFolder]
InfoType=FileCount
UpdateDivider=10

[MeasureFrameCalc]
measure=Calc
formula=counter % [MeasureFileCount]
substitute=".00000":""
disabled=0
dynamicVariables=1

[Atm]
Meter=Image
X=0
Y=0
W=(30*#Size#)
H=(30*#Size#)
ImageTint=#ColorAtm#
ImageName=#FolderAtm#/atmospher.png
DynamicVariables=1

[MeterFrame]
meter=Image
X=0
Y=0
W=(30*#Size#)
H=(30*#Size#)
ImageTint=#ColorPlanet#
ImageName="#FolderPla#/#Planet#[MeasureFrameCalc].png"
TransformationMatrix=(Cos(Rad(#InclinationAngle#)));(-Sin(Rad(#InclinationAngle#)));(Sin(Rad(#InclinationAngle#)));(Cos(Rad(#InclinationAngle#)));(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)-(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Cos(Rad(#InclinationAngle#)))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Sin(Rad(#InclinationAngle#))));(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)+(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Sin(Rad(#InclinationAngle#)))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Cos(Rad(#InclinationAngle#))))
DynamicVariables=1
:Whistle :Whistle Learning is the most complete art of life. Just enjoy it. :bow: :bow:
User avatar
Yincognito
Rainmeter Sage
Posts: 8324
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help to assemble a formula

Post by Yincognito »

arcanosa84 wrote: September 19th, 2023, 6:02 pm Yes, I was really reading how to do the inclination thing and it surpassed me a lot, that's why I didn't make the attempt, and I asked for help to rotate my planets since it would be very complex to do it myself, I'm already arranging the images because the atmosphere and the planet were not the same size and I should look for the center as you show me in the other skins, but in the end I would end up editing the photos so I arrange the photos only once and make them more standard to use, which I am not done with yet. all. and the angle as Balala shared it with me is great, since it achieved the objective.
I'm reading your answers and I'm directly testing the options or experimenting, that's why I made the balala option in that code, the one you gave me, and I already have it installed in another one, testing it the same way. I have not yet assembled that code where it goes, even the size and rotation will use variables that will be in the variables file, to be controlled by the configuration skin.
Both options work perfectly for me, which I understand is that the option you give me has another benefit.
thanks for the help as always.
I am very satisfied to be able to count on the attention of experts like you. :great: :great: :bow: :bow:

Code: Select all

[RainMeter]
Update=70
Author=AlexSoft

[Variables]
@Include=#@#\Config\Variables.inc
@Include2=#@#\Config\Styles.inc
@Include3=#@#\Config\Links.inc

Size=4

InclinationAngle=25

Planet=Venus
FolderAtm=#@#/Images/#Planet#/
FolderPla=#FolderAtm#/#Planet#
ColorPlanet=[#*Color[#*Planet*]Pla*]
ColorAtm=[#*Color[#*Planet*]Atm*]

[MeasureFolder]
Measure=Plugin
Plugin=FolderInfo
Folder=#FolderPla#
InfoType=FolderSize
IncludeHiddenFiles=1
IncludeSubFolders=1
IncludeSystemFiles=1
RegExpFilter=.png
UpdateDivider=10

[MeasureFileCount]
Measure=Plugin
Plugin=FolderInfo
Folder=[MeasureFolder]
InfoType=FileCount
UpdateDivider=10

[MeasureFrameCalc]
measure=Calc
formula=counter % [MeasureFileCount]
substitute=".00000":""
disabled=0
dynamicVariables=1

[Atm]
Meter=Image
X=0
Y=0
W=(30*#Size#)
H=(30*#Size#)
ImageTint=#ColorAtm#
ImageName=#FolderAtm#/atmospher.png
DynamicVariables=1

[MeterFrame]
meter=Image
X=0
Y=0
W=(30*#Size#)
H=(30*#Size#)
ImageTint=#ColorPlanet#
ImageName="#FolderPla#/#Planet#[MeasureFrameCalc].png"
TransformationMatrix=(Cos(Rad(#InclinationAngle#)));(-Sin(Rad(#InclinationAngle#)));(Sin(Rad(#InclinationAngle#)));(Cos(Rad(#InclinationAngle#)));(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)-(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Cos(Rad(#InclinationAngle#)))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Sin(Rad(#InclinationAngle#))));(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)+(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Sin(Rad(#InclinationAngle#)))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Cos(Rad(#InclinationAngle#))))
DynamicVariables=1
Right. Rainmeter can only do rotations on the plane corresponding to the computer screen, that's all. If you want more, you can try doing it in a program like Blender (you would need an image to use as the texture for the planet sphere, like the 2D map of Earth or any other body, for example), then export the images from there, and play them frame by frame in a Rainmeter skin.

P.S. You defined the variables correctly this time, in the code above. I suppose the rest of the code is correct top, as per balala's advice.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16623
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help to assemble a formula

Post by balala »

arcanosa84 wrote: September 19th, 2023, 4:03 pm I already tried the turning angle thing, it works perfectly. Thanks, it would be impossible to follow your code or the manual, I didn't understand much of the explanation, but I won't torment myself with that, I'll be able to understand it at some point.
Not sure about your math skills, but the TransformationMatrx option is extremely well described here (I think I already posted the link, however...). Specifically the rotation is described into the Transformations section. According to this description, the first four elements of the TransformationMatrix option have to be the following ones:
  • a = cos(angle)
  • b = -sin(angle)
  • c = sin(angle)
  • d = cos(angle)
Obviously angle is the rotation angle, which in my code is used as #InclinationAngle#. Additionally I added a Rad(#InclinationAngle#) function, to convert the degree-expressed angle into radians.
The last two (fifth and sixth - tx and ty) elements of the above TransformationMatrix option are taken from the What the heck is Rainmeter doing?! section. The formulas used there has been adapted to our needs. The x, x', y and y' parameters are set to the horizontal respectively vertical center of the image. For the horizontal center for instance I used the ([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2) expression. In this expression #CURRENTSECTION# represents the section in which this variable is used (in this case [MeterFrame]). [#CURRENTSECTION#:X] is the horizontal position of the meter (this is a section variable), while [#CURRENTSECTION#:W] is the width of the same meter. Adding together the horizontal position of a meter and half of its width, we get the position of the center of that image (or meter). Same applies for the vertical position as well.
These parameters have been used to calculate the tx and ty parameters of the TransformationMatrix option.
Finally the six above elements have been added to form the TransformationMatrix option.
arcanosa84 wrote: September 19th, 2023, 4:03 pm I was telling you about the size of the planet, I already did that, but I didn't send it to you that way because I was editing the images, the image of the planet and the image of the atmosphere that surrounds them were not the same, and to center the 2 images It was going to present more problems, and that's just a one-time fix. I show you how the complete code looks adding the size of the planets.
What I wanted was to achieve that instead of writing the variable as I have done in my configuration skin, use that idea of yours of selecting it directly, but it happens to me that I still can't decipher it from your code.
Instead of Size, I used a Scale variable. It is handled by the following sections of the Mirage\Settings\Settings.ini skin:

Code: Select all

[MenuFieldStringStyle]
FontColor=0,0,0
FontEffectColor=220,220,220
StringEffect=Shadow
FontFace=#FontName#
StringStyle=BOLD
ClipString=1
AntiAlias=1
Hidden=1

[MenuButtonStyle]
MyModifiers1=Fill Color #ButtonColor#
MyModifiers2=StrokeWidth 1
MyModifiers3=Stroke Color #ButtonStrokeColor#

[MeterScaleField]
Meter=Shape
MeterStyle=FieldStyle
X=0
Y=0
Shape=Rectangle 0,0,60,18 | Extend CheckModifiers
CheckModifiers=Fill Color 225,225,225 | StrokeWidth 1 | Stroke Color #CheckStrokeColor#
MouseScrollUpAction=[!SetVariable Size "(Clamp((#Size#+1),1,15))"]...
MouseScrollDownAction=[!SetVariable Size "(Clamp((#Size#-1),1,15))"]...
LeftMouseUpAction=[!CommandMeasure "MeasureInputScale" "ExecuteBatch 1"]
DynamicVariables=1
Group=General

[MeterScaleValue]
Meter=STRING
MeterStyle=MenuFieldStringStyle
X=33r
Y=0r
FontSize=10
StringAlign=RIGHT
Text=#Size#
DynamicVariables=1
Group=General

[MeterScaleUp]
Meter=Shape
MeterStyle=MenuButtonStyle
X=9r
Y=0r
Shape=Rectangle 0,0,18,9 | Extend MyModifiers1 | Extend MyModifiers2 | Extend MyModifiers3
LeftMouseUpAction=[!SetVariable Size "(Clamp((#Size#+1),1,15))"]...

[MeterScaleUpLabel]
Meter=String
X=9r
Y=4r
FontColor=220,220,220
FontEffectColor=0,0,0
SolidColor=0,0,0,1
StringEffect=Shadow
FontFace=Arrows
StringStyle=BOLD
AntiAlias=1
FontSize=8
StringAlign=CENTERCENTER
DynamicVariables=1
Text=S
Group=General

[MeterScaleDown]
Meter=Shape
MeterStyle=MenuButtonStyle
X=-9r
Y=5r
Shape=Rectangle 0,0,18,9 | Extend MyModifiers1 | Extend MyModifiers2 | Extend MyModifiers3
LeftMouseUpAction=[!SetVariable Size "(Clamp((#Size#-1),1,15))"]...
Group=General

[MeterScaleDownLabel]
Meter=String
X=9r
Y=4r
FontColor=220,220,220
FontEffectColor=0,0,0
SolidColor=0,0,0,1
StringEffect=Shadow
FontFace=Arrows
StringStyle=BOLD
AntiAlias=1
FontSize=8
StringAlign=CENTERCENTER
DynamicVariables=1
Text=T
Group=General
This is a quite simplified code, but it doesn't use images. But it requires to have the Arrows.ttf font into the @Resources\Fonts folder. If you place the above file there, Rainmeter will be able to use it.
Not too easy, definitely. Try to implement it if you want and if any question arises, pack the config you have and upload the package here, along with a description of the issue. Will try to take a look.
User avatar
arcanosa84
Posts: 173
Joined: May 21st, 2023, 1:47 am

Re: Help to assemble a formula

Post by arcanosa84 »

Yincognito wrote: September 19th, 2023, 6:20 pm Right. Rainmeter can only do rotations on the plane corresponding to the computer screen, that's all. If you want more, you can try doing it in a program like Blender (you would need an image to use as the texture for the planet sphere, like the 2D map of Earth or any other body, for example), then export the images from there, and play them frame by frame in a Rainmeter skin.

P.S. You defined the variables correctly this time, in the code above. I suppose the rest of the code is correct top, as per balala's advice.
Help, using these forms does not write the variable correctly, I know something went wrong, but I can't figure out what, since the value does appear correctly. As before, the SizeVenus variable must be created there to write the value of that variable in the Variables file, then update the skin of that planet, the latter if done correctly. Are you telling me what I'm doing wrong??? :-( :-( :-(

Applying it this way
ButtonCommand=[!WriteKeyValue Variables "[#*Size[#*Planet*]]" "#Size#" "#@#\Config\Variables.inc"][!Refresh "@AL\Planetas\#Planet#" "#Planet#.ini"]
The written variable
[#*Size[#Planet]]=7


Applying it this way
ButtonCommand=[!WriteKeyValue Variables [#Size[#Planet]] "#Size#" "#@#\Config\Variables.inc"][!Refresh "@AL\Planetas\#Planet#" "#Planet#.ini"]
The written variable
5=9

I already managed to create a separate code to vary the size of the planets and the angle of rotation, writing this in the corresponding variable in the Variables file. but with a single planet it works perfectly, now I want to use a variable that will be called PlanetSelect for when. I select planet Venus from a button PlanetSelect=Venus
From there I want the button that I show in the photo, the one that says ok, to write the selected value for the size on the correct planet. I would use this line ButtonCommand=[!WriteKeyValue Variables [#*Size[#*Planet*]] "#Size#" "#@#\Config\Variables.inc"][!Refresh
"@AL\Planets\#Planet#" "#Planet#.ini"]
but I can't get it to write to the variable that I am creating.
Image
I'm doing all this so as not to make the code so extensive, having to make the buttons for each planet in the configuration mask, and use them only once. Is it possible or am I inventing too much??? :confused: :confused:
PD:I am writing to both of you to notify you both of the publication.
You do not have the required permissions to view the files attached to this post.
:Whistle :Whistle Learning is the most complete art of life. Just enjoy it. :bow: :bow: