It is currently September 29th, 2024, 11:22 pm

!SetOption with TransformationMatrix isn't dynamic?

General topics related to Rainmeter.
User avatar
AlC
Posts: 329
Joined: June 9th, 2011, 6:46 pm

!SetOption with TransformationMatrix isn't dynamic?

Post by AlC »

First, you don't have to know how TransformationMatrix works :)

It's hard to explain my problem, so the best would be to create a new skin with this code
(Important: You have to edit ImageName to any Wallpaper on your system)

Code: Select all

[Rainmeter]
Author=
Update=100
DynamicWindowSize=1

[Metadata]
Name=
Version=0
Information=
License=Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported

[Background]
Meter=Image
SolidColor=100,100,100,100
X=0
Y=0
W=800
H=600
DynamicVariables=1

;;====================================================
;;  Measures
;;====================================================

[cCounter]
Measure=Calc
Formula=(cCounter+1)%100
	
[cOpen]
Measure=Calc
Formula=[cCounter]/100
DynamicVariables=1
IfAboveValue=0.98
IfAboveAction=[!EnableMeasureGroup Close][!SetOption "Image1" "TransformationMatrix" "[cClose];0;0;1;[cCloseX];0" "#CURRENTCONFIG#"][!DisableMeasureGroup Open]
Group=Open

[cOpenX]
Measure=Calc
Formula=(1-([cCounter]/100))*400
DynamicVariables=1
Group=Open

[cClose]
Measure=Calc
Formula=(1-([cCounter]/100))
DynamicVariables=1
Group=Close
Disabled=1

[cCloseX]
Measure=Calc
Formula=([cCounter]/100)*400
DynamicVariables=1
Group=Close
Disabled=1

;;====================================================
;;  Meters
;;====================================================

[Image1]
Meter=Image
ImageName=...
Y=0
W=400
H=250
DynamicVariables=1
PreserveAspectRatio=2
TransformationMatrix=[cOpen];0;0;1;[cOpenX];0

[Image2]
Meter=Image
ImageName=...
X=200
Y=R
W=400
H=250
Hidden=0
DynamicVariables=1
PreserveAspectRatio=2
TransformationMatrix=[cClose];0;0;1;[cCloseX];0
So what should this simple skin do?
It should "open" (increase the Width with TransformationMatrix) Image1 and when Image1 is normal (normal Width) it should "close" (decrease the Width with TransformationMatrix).
At the moment when Image1 is "normal" the bang will be fired.

Code: Select all

IfAboveAction=[!EnableMeasureGroup Close][!SetOption "Image1" "TransformationMatrix" "[cClose];0;0;1;[cCloseX];0" "#CURRENTCONFIG#"][!DisableMeasureGroup Open]
The bang disables the "OpenCounters" and enables the "CloseCounters" and CHANGE the TransformationMatrix code from Image1.

As I said you don't have to know how TransformationMatrix works, I added an Image2 (for control purpose).
So after the bang, Image1 and Image2 have the same TransformationMatrix code, but only Image2 is "closing".


What could be the problem?

The bang works, because if we change the bang to

Code: Select all

IfAboveAction=[!EnableMeasureGroup Close][!SetOption "Image1" "TransformationMatrix" "2;0;0;1;0;0" "#CURRENTCONFIG#"][!DisableMeasureGroup Open]
we can see that the image is stretched. (2;0;0;1;0;0)

---
I found one thing that is strange, and that's why I'm thinking this whole thing isn't really dynamic.
When we delete [!DisableMeasureGroup Open] in the bang, the "Open-Counters" counting further.
The second time when the bang will be fired then Image1 change his Width to a very small amount, that's because of the code (at the fire-moment the "Close-Counters" are almost 0), so maybe the TransformationMatrix works only when the bang will be fired = TransformationMatrix is not dynamic in this case)

[The first time when the bang will be fired the "Close-Counters" are disabled -> value=0 and TransformationMatrix=0;0;0;1;0;0 that means the image is just normal]

But the best would be to try it because it's hard to explain.
---

So maybe someone has some minutes time to look at this thing, because I absolute have no idea why this isn't working. :)
Rainmeter - You are only limited by your imagination and creativity.
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: !SetOption with TransformationMatrix isn't dynamic?

Post by smurfier »

Unless you escape the [*MeasureName*] with astricks, then the value of the measure is used by the bang.

IfAboveAction=[!EnableMeasureGroup Close][!SetOption "Image1" "TransformationMatrix" "[*cClose*];0;0;1;[*cCloseX*];0" "#CURRENTCONFIG#"][!DisableMeasureGroup Open]
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
User avatar
AlC
Posts: 329
Joined: June 9th, 2011, 6:46 pm

Re: !SetOption with TransformationMatrix isn't dynamic?

Post by AlC »

Yep, you are right, that all makes sense now.

Thank you smurfier.
Rainmeter - You are only limited by your imagination and creativity.