Interesting  thanks.
It is currently January 26th, 2020, 10:31 pm
Syncing skins

 Posts: 684
 Joined: February 27th, 2015, 2:38 pm

 Rainmeter Sage
 Posts: 9540
 Joined: October 11th, 2010, 6:27 pm
 Location: Gheorgheni, Romania
Re: Syncing skins
Ok, I found the problem. There is a small issue with the TransformationMatrix options of the [MeterLeft2], [MeterCenter] and [MeterRight2] meters. Replace them with the following ones (don1t replace anything else):
Code: Select all
[MeterLeft2]
...
TransformationMatrix=((#Balls#>=1)?(Cos(([MeasureTimerLeft]+(#Balls#>=3)*[MeasureTimerRight])*PI/8)):1);((#Balls#>=1)*(Sin(([MeasureTimerLeft]+(#Balls#>=3)*[MeasureTimerRight])*PI/8)));((#Balls#>=1)*Sin(([MeasureTimerLeft]+(#Balls#>=3)*[MeasureTimerRight])*PI/8));((#Balls#>=1)?(Cos(([MeasureTimerLeft]+(#Balls#>=3)*[MeasureTimerRight])*PI/8)):1);((#Balls#>=1)*(([MeterLeft2:X]+([MeterLeft2:W]/2))([MeterLeft2:X]+([MeterLeft2:W]/2))*Cos(([MeasureTimerLeft]+(#Balls#>=3)*[MeasureTimerRight])*PI/8)(0.022*#Width#)*Sin(([MeasureTimerLeft]+(#Balls#>=3)*[MeasureTimerRight])*PI/8)));((#Balls#>=1)*((0.022*#Width#)+([MeterLeft2:X]+([MeterLeft2:W]/2))*Sin(([MeasureTimerLeft]+(#Balls#>=3)*[MeasureTimerRight])*PI/8)(0.022*#Width#)*Cos(([MeasureTimerLeft]+(#Balls#>=3)*[MeasureTimerRight])*PI/8)))
...
[MeterCenter]
...
TransformationMatrix=((#Balls#>=2)?(Cos(([MeasureTimerLeft]+[MeasureTimerRight])*PI/8)):1);((#Balls#>=2)*(Sin(([MeasureTimerLeft]+[MeasureTimerRight])*PI/8)));((#Balls#>=2)*Sin(([MeasureTimerLeft]+[MeasureTimerRight])*PI/8));((#Balls#>=2)?(Cos(([MeasureTimerLeft]+[MeasureTimerRight])*PI/8)):1);((#Balls#>=2)*(([MeterCenter:X]+([MeterCenter:W]/2))([MeterCenter:X]+([MeterCenter:W]/2))*Cos(([MeasureTimerLeft]+[MeasureTimerRight])*PI/8)(0.022*#Width#)*Sin(([MeasureTimerLeft]+[MeasureTimerRight])*PI/8)));((#Balls#>=2)*((0.022*#Width#)+([MeterCenter:X]+([MeterCenter:W]/2))*Sin(([MeasureTimerLeft]+[MeasureTimerRight])*PI/8)(0.022*#Width#)*Cos(([MeasureTimerLeft]+[MeasureTimerRight])*PI/8)))
...
[MeterRight2]
...
TransformationMatrix=((#Balls#>=1)?(Cos(([MeasureTimerRight]+(#Balls#>=3)*[MeasureTimerLeft])*PI/8)):1);((#Balls#>=1)*(Sin(([MeasureTimerRight]+(#Balls#>=3)*[MeasureTimerLeft])*PI/8)));((#Balls#>=1)*Sin(([MeasureTimerRight]+(#Balls#>=3)*[MeasureTimerLeft])*PI/8));((#Balls#>=1)?(Cos(([MeasureTimerRight]+(#Balls#>=3)*[MeasureTimerLeft])*PI/8)):1);((#Balls#>=1)*(([MeterRight2:X]+([MeterRight2:W]/2))([MeterRight2:X]+([MeterRight2:W]/2))*Cos(([MeasureTimerRight]+(#Balls#>=3)*[MeasureTimerLeft])*PI/8)(0.022*#Width#)*Sin(([MeasureTimerRight]+(#Balls#>=3)*[MeasureTimerLeft])*PI/8)));((#Balls#>=1)*((0.022*#Width#)+([MeterRight2:X]+([MeterRight2:W]/2))*Sin(([MeasureTimerRight]+(#Balls#>=3)*[MeasureTimerLeft])*PI/8)(0.022*#Width#)*Cos(([MeasureTimerRight]+(#Balls#>=3)*[MeasureTimerLeft])*PI/8)))
...
Now I hope it does work well. Does it?

 Rainmeter Sage
 Posts: 9540
 Joined: October 11th, 2010, 6:27 pm
 Location: Gheorgheni, Romania
Re: Syncing skins
Yeah, there indeed is an occasional slight stuttering. I'm not sure if there is anything to be done, to get rid of it. Probably the skin is set to a too small Update value and there are too many relatively complex calculations to be done (all those TransformationMatrices). Unfortunately no solutions yet.

 Rainmeter Sage
 Posts: 9540
 Joined: October 11th, 2010, 6:27 pm
 Location: Gheorgheni, Romania
Re: Syncing skins
Some sort of syncronization can be done, however it's not perfect. But for this, the clock MUST be included into the pendulum skin.
Here is a solution, which uses an ActionTimer plugin measure to move the pendulum. The ActionTimer plugin measure is started when the seconds is changing on the Time measure and is calculated in a way to end up before the next cycle should start. This is an important limitation, because if this doesn't happen, you'll get one error message on every cycle.
This code uses the default Update=1000, because (as I said before) the ActionTimer plugin measure can update the elements of the skin much more frequently then the update set on the skin.
I rewrote your code. Here is what I got:
Code: Select all
[Rainmeter]
Update=1000
AccurateText=1
[Variables]
skinWidth=274
skinHeight=50
cornerRoundness=7
; pendulumHeight: height of pendulum skin.
; pendulumBorder: size of pendulum border.
pendulumHeight=50
pendulumBorder=2
pendulumLEDBorder=1
pendulumLEDSize=5
pendulumSpan=(#skinWidth##pendulumBorder#((#pendulumLEDSize#+#pendulumLEDBorder#+2)*2))
pendulumLEDSpacing=(Trunc(#pendulumSpan#/9))
pendulumStartX=((#skinWidth#(#pendulumLEDSpacing#*9))/2)
colorPendulumBackground=0,10,36,255
colorPendulumBorder=0,64,192,255
colorPendulumTitleBar=0,64,192,255
;colorLEDBorder=255,255,255,255
colorLEDBorder=0,10,36,255
colorLEDOff=0,10,36,255
colorLEDOn=255,063,063,255
U=[!UpdateMeasure "MeasureSlide"][!UpdateMeasure "msrPendulumWrap"][!UpdateMeterGroup "PendulumLED"][!UpdateMeter "Uptime"][!Redraw]
Num=1
W=38
[MeasureSlide]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat Forth,#W#,10  Wait #W#  Repeat Back,#W#,10
Forth=[!SetVariable Num "(Clamp((#Num#+1),1,10))"]#U#
Back=[!SetVariable Num "(Clamp((#Num#1),1,10))"]#U#
DynamicVariables=1
[msrPendulumWrap]
Measure=Calc
DynamicVariables=1
Formula=#Num#
IfConditionMode=1
IfCondition=1
IfTrueAction=[!SetOptionGroup PendulumLED PendulumFillColor "Fill Color #*colorLEDOff*#"][!SetOption mtrLED[&msrPendulumWrap] PendulumFillColor "Fill Color #*colorLEDOn*#"]
IfCondition2=(#CURRENTSECTION#=1)
IfTrueAction2=[!CommandMeasure "MeasureSlide" "Stop 1"]
;IfAboveValue=9
;IfAboveAction=[!SetOption msrPendulumWrap Formula "msrPendulumWrap1"]
;IfBelowValue=2
;IfBelowAction=[!SetOption msrPendulumWrap Formula "msrPendulumWrap+1"]
[MeasureTime]
Measure=Time
Format=%#H:%M:%S
OnChangeAction=[!CommandMeasure "MeasureSlide" "Execute 1"]
;[msrPendulumArc1]
;Measure=Calc
;DynamicVariables=1
;Formula=msrPendulumArc+1
;IfConditionMode=1
;ifCondition=1
;IfTrueAction=[!SetVariable PendulumLEDNum "[msrPendulumArc]"]
;IfAboveValue=9
;IfAboveAction=[!SetOption msrPendulumArc Formula "msrPendulumArc1"]
;IfBelowValue=2
;IfBelowAction=[!SetOption msrPendulumArc Formula "msrPendulumArc+1"]
;
;[msrPendulumArc2]
;Measure=Calc
;DynamicVariables=1
;Formula=Clamp(msrPendulumArc+2,2,21)
;IfConditionMode=1
;ifCondition=1
;IfTrueAction=[!SetVariable PendulumLEDNum "(Clamp(Trunc([msrPendulumArc]/2), 1, 10))"]
;IfAboveValue=20
;IfAboveAction=[!SetOption msrPendulumArc Formula "Clamp(msrPendulumArc2,2,21)"]
;IfBelowValue=3
;IfBelowAction=[!SetOption msrPendulumArc Formula "Clamp(msrPendulumArc+2,2,21)"]
;
;[msrPendulumSwing]
;Measure=Calc
;DynamicVariables=1
;Formula=1
;IfConditionMode=1
;ifCondition=1
;IfTrueAction=[!SetOptionGroup PendulumLED PendulumFillColor "Fill Color #*colorLEDOff*#"][!SetOption mtrLED#PendulumLEDNum# PendulumFillColor "Fill Color #*colorLEDOn*#"]
[mtrPendulumBackground]
Meter=Shape
Shape=Rectangle 0,0,#skinWidth#,#skinHeight#,#cornerRoundness#  StrokeWidth #pendulumBorder#  Stroke Color #colorPendulumBorder#  Fill Color #colorPendulumBackground#
AntiAlias=1
X=0
Y=0
W=#skinWidth#
H=#skinHeight#
;[mtrArc]
;Meter=Shape
;Shape=Arc 0,0,(#pendulumLEDSpacing#*9),0,41,10,*,1  StrokeWidth 1  Stroke Color #colorWhite#
;X=#pendulumStartX#
;Y=10
;DynamicVariables=1
[mtrLED1]
Meter=Shape
Group=PendulumLED
Shape=Ellipse 0,0,#pendulumLEDSize#  StrokeWidth #pendulumLEDBorder#  Stroke Color #colorLEDBorder#  Extend PendulumFillColor
PendulumFillColor=Fill Color #colorLEDOn#
X=#pendulumStartX#
Y=10
DynamicVariables=1
[mtrLED2]
Meter=Shape
Group=PendulumLED
Shape=Ellipse 0,0,#pendulumLEDSize#  StrokeWidth #pendulumLEDBorder#  Stroke Color #colorLEDBorder#  Extend PendulumFillColor
PendulumFillColor=Fill Color #colorLEDOn#
X=(#pendulumLEDSpacing#6)r
Y=26
DynamicVariables=1
[mtrLED3]
Meter=Shape
Group=PendulumLED
Shape=Ellipse 0,0,#pendulumLEDSize#  StrokeWidth #pendulumLEDBorder#  Stroke Color #colorLEDBorder#  Extend PendulumFillColor
PendulumFillColor=Fill Color #colorLEDOn#
X=(#pendulumLEDSpacing#+0)r
Y=34
DynamicVariables=1
[mtrLED4]
Meter=Shape
Group=PendulumLED
Shape=Ellipse 0,0,#pendulumLEDSize#  StrokeWidth #pendulumLEDBorder#  Stroke Color #colorLEDBorder#  Extend PendulumFillColor
PendulumFillColor=Fill Color #colorLEDOn#
X=(#pendulumLEDSpacing#+3)r
Y=38
DynamicVariables=1
[mtrLED5]
Meter=Shape
Group=PendulumLED
Shape=Ellipse 0,0,#pendulumLEDSize#  StrokeWidth #pendulumLEDBorder#  Stroke Color #colorLEDBorder#  Extend PendulumFillColor
PendulumFillColor=Fill Color #colorLEDOn#
X=(#pendulumLEDSpacing#+3)r
Y=40
DynamicVariables=1
[mtrLED6]
Meter=Shape
Group=PendulumLED
Shape=Ellipse 0,0,#pendulumLEDSize#  StrokeWidth #pendulumLEDBorder#  Stroke Color #colorLEDBorder#  Extend PendulumFillColor
PendulumFillColor=Fill Color #colorLEDOn#
X=#pendulumLEDSpacing#r
Y=40
DynamicVariables=1
[mtrLED7]
Meter=Shape
Group=PendulumLED
Shape=Ellipse 0,0,#pendulumLEDSize#  StrokeWidth #pendulumLEDBorder#  Stroke Color #colorLEDBorder#  Extend PendulumFillColor
PendulumFillColor=Fill Color #colorLEDOn#
X=(#pendulumLEDSpacing#+3)r
Y=38
DynamicVariables=1
[mtrLED8]
Meter=Shape
Group=PendulumLED
Shape=Ellipse 0,0,#pendulumLEDSize#  StrokeWidth #pendulumLEDBorder#  Stroke Color #colorLEDBorder#  Extend PendulumFillColor
PendulumFillColor=Fill Color #colorLEDOn#
X=(#pendulumLEDSpacing#+3)r
Y=34
DynamicVariables=1
[mtrLED9]
Meter=Shape
Group=PendulumLED
Shape=Ellipse 0,0,#pendulumLEDSize#  StrokeWidth #pendulumLEDBorder#  Stroke Color #colorLEDBorder#  Extend PendulumFillColor
PendulumFillColor=Fill Color #colorLEDOn#
X=(#pendulumLEDSpacing#+0)r
Y=26
DynamicVariables=1
[mtrLED10]
Meter=Shape
Group=PendulumLED
Shape=Ellipse 0,0,#pendulumLEDSize#  StrokeWidth #pendulumLEDBorder#  Stroke Color #colorLEDBorder#  Extend PendulumFillColor
PendulumFillColor=Fill Color #colorLEDOn#
X=(#pendulumLEDSpacing#6)r
Y=10
DynamicVariables=1
[MeterTime]
Meter=STRING
MeasureName=MeasureTime
X=(#SkinWidth#/2)
Y=0
Padding=15,5,15,5
FontColor=220,220,220
FontEffectColor=0,0,0
StringEffect=Shadow
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=Center
AntiAlias=1
Text=%1
You can freely change the format of the [MeasureTime] measure, if needed. Doesn't matter too much how is its Format, the only limitation is that this format has to contain the seconds, too (the %S format code).
You do not have the required permissions to view the files attached to this post.

 Posts: 182
 Joined: April 10th, 2014, 12:31 am
 Location: Canada
Re: Syncing skins
Yes, and I've about come to the conclusion that that is correct.
By setting Update=100 (for the pendulum) and DefaultUpdateDivider=9 (instead of 10), and then changing the pendulum back to the first measure (in the previously posted code), I thought it to be a solution. In this case, the pendulum appeared to stay in sync with the clock, and the clock appeared to be free of skipping. It really looked good. But when watching it steadily for an extended period, it turns out that there is still a slight skipping (of one second) that occurs only once every several minutes. So it is much better than before, but still not perfect, alas.
So, I'm going to study up on ActionTimer, which you mentioned earlier. Do you see it as possibly being a solution to this issue? If not, I won't bother pursuing the "pendulum problem" any further.You simply can't synchronize the ticking of the clock, which can only be measured at a granularity of one second, with an animation that by its nature must be measured at a granularity of less than one second, when the animation uses an "approximate" measure of time, and is impacted by other things that Rainmeter is trying to do at the same moment.

 Posts: 182
 Joined: April 10th, 2014, 12:31 am
 Location: Canada
Re: Syncing skins
It looks like we were posting at the same time! Okay, your attachment looks very goodlet me try your code and get back to you.

 Rainmeter Sage
 Posts: 9540
 Joined: October 11th, 2010, 6:27 pm
 Location: Gheorgheni, Romania
Re: Syncing skins
Ok, please do so and let me know.

 Posts: 182
 Joined: April 10th, 2014, 12:31 am
 Location: Canada
Re: Syncing skins
Yes, it does indeed. Well done.balala wrote: ↑March 14th, 2019, 4:55 pmOk, I found the problem. There is a small issue with the TransformationMatrix options of the [MeterLeft2], [MeterCenter] and [MeterRight2] meters. Replace them with the following ones (don1t replace anything else):
I rewrote the first and the fourth elements of all three TransformationMatrix options.
Now I hope it does work well. Does it?
Still no sound, though. And turning shadows on/off in settings, doesn't cause any visible change that I can see. Those are minor points, though. The animation is great, and I think it must have been a great deal of work to get it that way!

 Posts: 182
 Joined: April 10th, 2014, 12:31 am
 Location: Canada
Re: Syncing skins
Terrific! I watched it for several minutes, and it appeared that the pendulum stayed in sync with the clock, and that the clock did not skip or stutter at all! One thing, though. The pendulum is swinging fully right and fully left each second. My original intention was that the pendulum would swing lefttoright in one second, and righttoleft in the next second. Can that be changed?

 Rainmeter Sage
 Posts: 9540
 Joined: October 11th, 2010, 6:27 pm
 Location: Gheorgheni, Romania
Re: Syncing skins
Thanks.
I'm surprised, because I have both sound and the shadows. The balls have also been disappearing for me too (before have been fixed), but the sound is played and the shadows are there. So:
 About the sound: have you turned on the speakers (if needed)? (I hope you did). Are other skins playing the sounds?
 About the shadows: click the clock to hide it. You should have to see the shadows on the horizontal plane of the base (see the attached screenshot). Aren't they there?
You do not have the required permissions to view the files attached to this post.