It is currently August 17th, 2019, 11:47 am

[D2D][Resolved] Shape Meter ~ Path ~ 'ClosePath 0'

Backwards compatibility issues related to the conversion of Rainmeter to D2D.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3476
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

[D2D][Resolved] Shape Meter ~ Path ~ 'ClosePath 0'

eclectic-tech » August 7th, 2018, 10:13 pm

ClosePath 0 seems to be ignored; shapes are closed and filled even if set to zero.

Test skin: AudioDimensia_III

Selecting 'Close and Fill' to 'NO' in the settings skin ('ClosePath 0' in the skin) has no affect in 4.3.0.3218
closepath4_3_3218.png
Works normally in 4.2.0.3111
closepath4_2_3111.png
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 19368
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Shape Meter ~ Path ~ 'ClosePath 0'

jsmorley » August 7th, 2018, 10:31 pm

I'm not getting that... Can you demonstrate with something a bit less... uhm... involved?

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

[MeterShape]
Meter=Shape
Shape=Path MyPath | StrokeWidth 4
MyPath=10,10 | LineTo 10,100 | LineTo 100,100 | ClosePath 1
Shape2=Path MyPath2 | StrokeWidth 4
MyPath2=10,110 | LineTo 10,200 | LineTo 110,200 | ClosePath 0
1.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3476
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Shape Meter ~ Path ~ 'ClosePath 0'

eclectic-tech » August 7th, 2018, 11:03 pm

jsmorley wrote:I'm not getting that... Can you demonstrate with something a bit less... uhm... involved?
Hmm... I will try to simplify the code and see if I can duplicate what is happening with my skin, but it may take me some time :D
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3476
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Shape Meter ~ Path ~ 'ClosePath 0'

eclectic-tech » August 7th, 2018, 11:54 pm

I eliminated three-quarters of the shapes and measures and replaced all @includes sections with code, so skin includes all needed options. One shape with associated 24 audio measures...

Play some music with 'bass' tones.
Changing the variable "ShapeClosed" between 0 and 1 does close the shape path, but the fill is applied even if the shape path is not closed...

Code: Select all

[Metadata]
Name=Audio Dimensia III
Author=Eclectic Tech
Information=Audio visualizer with 4 perspective layers of sound visualization. It is a tool that lets you experiment with stroke patterns, fill shades, and colors in a dimensional environment to create unique audio visualizers.
License=Creative Commons Share-Alike NC BY 3
Version=1.2018.06.25

[Rainmeter]
Group=#RootConfig#
Update=16
DynamicWindowSize=1
AccurateText=1

[Variables]
; 0 = Solid/ 1 = Gradient Strokes (Removed!)
StrokeType=0

DrawColor4=65,138,217

FillColor4=24,38,74

; Fill Shade angle (0 = 3 o'clock)
ShadeAngle=270

; Fill Transparency 0~255
FillAlphaLevel=300

; Close shape paths set to 1 will show more shapes along the grid, and allow filling
; 0 is default, fewer shapes, no fill, better vertical sound representation
ShapeClosed=0

; Drawing stroke thickness and dots
SetStrokeWidth=2

; Dot/diamond/String alpha
DotAlpha=225

; Display Width
GridWidth=256

; Automatically calculate gap size
Spacing=(#GridWidth#/26)

; Display Height
Height=128

; Maximum Width (used for bounding box)
MW=(SQRT((#GridWidth#*#GridWidth#)+(#Height#*#Height#)))

; Maximum Height (used for bounding box)
MH=(SQRT((#GridWidth#*#GridWidth#)+(#Height#*#Height#)))

; Vertical tilt of grid lines
OffsetY=6

; Angle of display
TiltAngle=0

; Distance between baselines
Separation=-165.12

; Vertical positioning correction 
; This can be used to position the display closer to the screen top. Use negative values to raise the display. Can cause clipping or lose of display; default value is zero
VerticalShift=0

; Free/Joined Ends
FreeEnd=1

[MeasureAudioLevel]
Group=AL
Measure=Plugin
Plugin=AudioLevel
Port=Output
RMSAttack=0
RMSDecay=0
RMSGain=1
PeakAttack=0
PeakDecay=0
PeakGain=1
FFTSize=4096
FFTOverlap=2048
FFTAttack=25
FFTDecay=75
Bands=100
FreqMin=30
FreqMax=19000
Sensitivity=30
; ID=
; Documentation: https://docs.rainmeter.net/manual-beta/plugins/audiolevel/

[Measure0]
Group=AL
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudioLevel
Channel=Sum
Type=Band
BandIdx=0
AverageSize=#AvgSoundLevel#
InvertMeasure=#Flip#

[Measure1]
Group=AL
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudioLevel
Channel=Sum
Type=Band
BandIdx=1
AverageSize=#AvgSoundLevel#
InvertMeasure=#Flip#

[Measure2]
Group=AL
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudioLevel
Channel=Sum
Type=Band
BandIdx=2
AverageSize=#AvgSoundLevel#
InvertMeasure=#Flip#

[Measure3]
Group=AL
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudioLevel
Channel=Sum
Type=Band
BandIdx=3
AverageSize=#AvgSoundLevel#
InvertMeasure=#Flip#

[Measure4]
Group=AL
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudioLevel
Channel=Sum
Type=Band
BandIdx=4
AverageSize=#AvgSoundLevel#
InvertMeasure=#Flip#

[Measure5]
Group=AL
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudioLevel
Channel=Sum
Type=Band
BandIdx=5
AverageSize=#AvgSoundLevel#
InvertMeasure=#Flip#

[Measure6]
Group=AL
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudioLevel
Channel=Sum
Type=Band
BandIdx=6
AverageSize=#AvgSoundLevel#
InvertMeasure=#Flip#

[Measure7]
Group=AL
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudioLevel
Channel=Sum
Type=Band
BandIdx=7
AverageSize=#AvgSoundLevel#
InvertMeasure=#Flip#

[Measure8]
Group=AL
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudioLevel
Channel=Sum
Type=Band
BandIdx=8
AverageSize=#AvgSoundLevel#
InvertMeasure=#Flip#

[Measure9]
Group=AL
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudioLevel
Channel=Sum
Type=Band
BandIdx=9
AverageSize=#AvgSoundLevel#
InvertMeasure=#Flip#

[Measure10]
Group=AL
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudioLevel
Channel=Sum
Type=Band
BandIdx=10
AverageSize=#AvgSoundLevel#
InvertMeasure=#Flip#

[Measure11]
Group=AL
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudioLevel
Channel=Sum
Type=Band
BandIdx=11
AverageSize=#AvgSoundLevel#
InvertMeasure=#Flip#

[Measure12]
Group=AL
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudioLevel
Channel=Sum
Type=Band
BandIdx=12
AverageSize=#AvgSoundLevel#
InvertMeasure=#Flip#

[Measure13]
Group=AL
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudioLevel
Channel=Sum
Type=Band
BandIdx=13
AverageSize=#AvgSoundLevel#
InvertMeasure=#Flip#

[Measure14]
Group=AL
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudioLevel
Channel=Sum
Type=Band
BandIdx=14
AverageSize=#AvgSoundLevel#
InvertMeasure=#Flip#

[Measure15]
Group=AL
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudioLevel
Channel=Sum
Type=Band
BandIdx=15
AverageSize=#AvgSoundLevel#
InvertMeasure=#Flip#

[Measure16]
Group=AL
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudioLevel
Channel=Sum
Type=Band
BandIdx=16
AverageSize=#AvgSoundLevel#
InvertMeasure=#Flip#

[Measure17]
Group=AL
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudioLevel
Channel=Sum
Type=Band
BandIdx=17
AverageSize=#AvgSoundLevel#
InvertMeasure=#Flip#

[Measure18]
Group=AL
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudioLevel
Channel=Sum
Type=Band
BandIdx=18
AverageSize=#AvgSoundLevel#
InvertMeasure=#Flip#

[Measure19]
Group=AL
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudioLevel
Channel=Sum
Type=Band
BandIdx=19
AverageSize=#AvgSoundLevel#
InvertMeasure=#Flip#

[Measure20]
Group=AL
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudioLevel
Channel=Sum
Type=Band
BandIdx=20
AverageSize=#AvgSoundLevel#
InvertMeasure=#Flip#

[Measure21]
Group=AL
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudioLevel
Channel=Sum
Type=Band
BandIdx=21
AverageSize=#AvgSoundLevel#
InvertMeasure=#Flip#

[Measure22]
Group=AL
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudioLevel
Channel=Sum
Type=Band
BandIdx=22
AverageSize=#AvgSoundLevel#
InvertMeasure=#Flip#

[Measure23]
Group=AL
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudioLevel
Channel=Sum
Type=Band
BandIdx=23
AverageSize=#AvgSoundLevel#
InvertMeasure=#Flip#

[Measure24]
Group=AL
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudioLevel
Channel=Sum
Type=Band
BandIdx=24
AverageSize=#AvgSoundLevel#
InvertMeasure=#Flip#


[Shape]
Meter=Shape
Group=Shapes
X=(#MW#/2.85)
Y=(#Height#+#VerticalShift#)
DynamicVariables=1

Shape=Path MyPath4 | StrokeWidth #SetStrokeWidth# | Fill LinearGradient1 MyGradient4#StrokeType# | Extend MyStroke4#StrokeType#

MyGradient40=#ShadeAngle# | #FillColor4#,(Clamp(#FillAlphaLevel#*0.85,0,255)) ; 0.0 | #FillColor4#,(Clamp(#FillAlphaLevel#*0.85,0,255)) ; 1.0
MyStroke40=Stroke Color #DrawColor4#,#DotAlpha#

; PathName StartX, StartY | {at least 1 of the following} {LineTo EndX, EndY} {ArcTo EndX, EndY} {CurveTo EndX, EndY, ControlX1, ControlY1} | {SetRoundJoin 0 or 1) | {SetNoStroke 0 or 1} | {ClosePath 0 or 1}
MyPath4=(#FreeEnd#=0? #Spacing#*1.0:#Spacing#*6.5),(#Height#-#OffsetY#*(#FreeEnd#=0? 0.5:4)) | LineTo (#Spacing#*6.5),(#Height#-#OffsetY#*4)-([Measure0]*#Height#) | LineTo (#Spacing#*7.04),(#Height#-#OffsetY#*4)-([Measure1]*#Height#) | LineTo (#Spacing#*7.58),(#Height#-#OffsetY#*4)-([Measure2]*#Height#) | LineTo (#Spacing#*8.12),(#Height#-#OffsetY#*4)-([Measure3]*#Height#) | LineTo (#Spacing#*8.66),(#Height#-#OffsetY#*4)-([Measure4]*#Height#) | LineTo (#Spacing#*9.20),(#Height#-#OffsetY#*4)-([Measure5]*#Height#) | LineTo (#Spacing#*9.74),(#Height#-#OffsetY#*4)-([Measure6]*#Height#) | LineTo (#Spacing#*10.28),(#Height#-#OffsetY#*4)-([Measure7]*#Height#) | LineTo (#Spacing#*10.82),(#Height#-#OffsetY#*4)-([Measure8]*#Height#) | LineTo (#Spacing#*11.36),(#Height#-#OffsetY#*4)-([Measure9]*#Height#) | LineTo (#Spacing#*11.91),(#Height#-#OffsetY#*4)-([Measure10]*#Height#) | LineTo (#Spacing#*12.45),(#Height#-#OffsetY#*4)-([Measure11]*#Height#) | LineTo (#Spacing#*13),(#Height#-#OffsetY#*4)-([Measure12]*#Height#) | LineTo (#Spacing#*13.54),(#Height#-#OffsetY#*4)-([Measure13]*#Height#) | LineTo (#Spacing#*14.08),(#Height#-#OffsetY#*4)-([Measure14]*#Height#) | LineTo (#Spacing#*14.62),(#Height#-#OffsetY#*4)-([Measure15]*#Height#) | LineTo (#Spacing#*15.16),(#Height#-#OffsetY#*4)-([Measure16]*#Height#) | LineTo (#Spacing#*15.71),(#Height#-#OffsetY#*4)-([Measure17]*#Height#) | LineTo (#Spacing#*16.25),(#Height#-#OffsetY#*4)-([Measure18]*#Height#) | LineTo (#Spacing#*16.79),(#Height#-#OffsetY#*4)-([Measure19]*#Height#) | LineTo (#Spacing#*17.33),(#Height#-#OffsetY#*4)-([Measure20]*#Height#) | LineTo (#Spacing#*17.87),(#Height#-#OffsetY#*4)-([Measure21]*#Height#) | LineTo (#Spacing#*18.41),(#Height#-#OffsetY#*4)-([Measure22]*#Height#) | LineTo (#Spacing#*18.95),(#Height#-#OffsetY#*4)-([Measure23]*#Height#) | LineTo (#Spacing#*19.5),(#Height#-#OffsetY#*4)-([Measure24]*#Height#) | LineTo (#FreeEnd#=0? #Spacing#*25:#Spacing#*19.5),(#Height#-#OffsetY#*(#FreeEnd#=0? 0.5:4)) | ClosePath #ShapeClosed#

This should be easier to follow and demonstrates the issue for me... and hopefully for you too :welcome:
User avatar
jsmorley
Developer
Posts: 19368
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Shape Meter ~ Path ~ 'ClosePath 0'

jsmorley » August 8th, 2018, 2:03 am

https://docs.rainmeter.net/manual/meters/shape/#Path
Notes on Path:
All Attribute and Transform modifiers may be used on the shape, but they may only be defined once on the Shape(N) option line. Individual path segments may not be modified, and the named path definition may only contain the starting point, one or more segment definitions, any optional SetLineJoin or SetNoStroke segment commands, and an optional ClosePath value.

Closed shapes are automatically filled with the default white fill color. Open shapes are not filled by default, although in both instances this may be changed or forced with a Fill attribute modifier on the shape.

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

[MeterShape]
Meter=Shape
Shape=Path MyPath | StrokeWidth 4 | Fill Color 0,255,0,255
MyPath=10,10 | LineTo 10,100 | LineTo 100,100 | ClosePath 1
Shape2=Path MyPath2 | StrokeWidth 4 | Fill Color 0,255,0,255
MyPath2=10,110 | LineTo 10,200 | LineTo 110,200 | ClosePath 0
1.jpg
This is the behavior I would expect?

Left: 4.2 | Right: 4.3
2.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3476
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Shape Meter ~ Path ~ 'ClosePath 0'

eclectic-tech » August 8th, 2018, 4:08 am

Alright, but I am left wondering why the defined Fill attribute in my skin is not applied in v4.2.0.3111 with an open shape (it only draws the stroke), but works as you described in v4.3.0.3218 (fills the open shape)... is the current v4.2.0.3111 is broken?

The skin I posted will not fill the shape on v4.2.0.3111, even though a fill parameter is in the extend parameter. According to the manual, it should fill the open shape... ??

I can "fix" this in the skin, but am curious why it does not work the same in both versions for my skin.
User avatar
jsmorley
Developer
Posts: 19368
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Shape Meter ~ Path ~ 'ClosePath 0'

jsmorley » August 8th, 2018, 1:01 pm

eclectic-tech wrote:Alright, but I am left wondering why the defined Fill attribute in my skin is not applied in v4.2.0.3111 with an open shape (it only draws the stroke), but works as you described in v4.3.0.3218 (fills the open shape)... is the current v4.2.0.3111 is broken?

The skin I posted will not fill the shape on v4.2.0.3111, even though a fill parameter is in the extend parameter. According to the manual, it should fill the open shape... ??

I can "fix" this in the skin, but am curious why it does not work the same in both versions for my skin.
I'm not sure. To be honest I have not had the strength of will to dig into that complex skin you have, I was hoping to isolate the problem in some simple, demonstrable way... ;-)

This works as expected for me, in both 4.2 and 4.3:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

[Variables]
ClosePath=1

[MeterShape]
Meter=Shape
Shape=Path MyPath | Extend MyStyle
MyPath=10,10 | LineTo 10,100 | LineTo 100,100 | ClosePath #ClosePath#
MyStyle=StrokeWidth 4 | Fill Color 0,255,0,255
LeftMouseUpAction=[!SetVariable ClosePath (1-#ClosePath#)][!UpdateMeter *][!Redraw]
DynamicVariables=1
GIF.gif
You do not have the required permissions to view the files attached to this post.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3476
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Shape Meter ~ Path ~ 'ClosePath 0'

eclectic-tech » August 8th, 2018, 7:50 pm

So apparently there has been a unknown issue with v4.2.0.3111 that does not fill when a fill is specified using a linear gradient as the fill and ClosePath is zero.
Solid Colors, as you showed, work as described in the manual.

The issue is visible when you set the Fill to a LinearGradient.

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
BackgroundMode=2
SolidColor=0,0,0,1

[Variables]
ClosePath=0

[MeterShape]
Meter=Shape
Shape=Path MyPath | Extend MyStyle
MyPath=10,10 | LineTo 10,100 | LineTo 100,100 | ClosePath #ClosePath#
MyStyle=StrokeWidth 4 | Fill LinearGradient1 MyGradient4
MyGradient4=135 | 220,220,20,255 ; 0.0 | 220,220,20,0 ; 1.0
LeftMouseUpAction=[!SetVariable ClosePath (1-#ClosePath#)][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeterString]
Meter=String
X=10
Y=R
FontWeight=600
Text=ClosePath=#ClosePath#
FontColor=255,255,255
DynamicVariables=1

Version 4.2.0.3111
closepath_Linear_4.2.0.3111.gif
Version 4.3.0.3218
closepath_Linear_4.3.0.3218.gif
If I find time I will test with RadialGradient to see if that exhibits the same issue.
EDIT: The Radial gradient also ignores the fill when ClosePath is zero. :bow:
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 19368
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Shape Meter ~ Path ~ 'ClosePath 0'

jsmorley » August 8th, 2018, 9:49 pm

Ok, the code monkeys are on it!

User avatar
eclectic-tech
Rainmeter Sage
Posts: 3476
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Shape Meter ~ Path ~ 'ClosePath 0'

eclectic-tech » August 8th, 2018, 11:20 pm

Those monkey's needed something to keep them busy! :lol:

I already modified my skins to work as described in the manual in regard to FILL and CLOSEPATH.
Thanks for clarifying that for me. :thumbup:

Just wanted to make sure things work the same in both versions :great: