It is currently March 29th, 2024, 10:03 am

[Solved]Unexpected behavior of "Shape Meter" when "combining combined shapes"

Report bugs with the Rainmeter application and suggest features.
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

[Solved]Unexpected behavior of "Shape Meter" when "combining combined shapes"

Post by death.crafter »

As it happens I was working on an visualizer when I noticed this. When I tried to unite(combine) 6 combined shapes, the raw shapes in the parent shape, except for the first raw shape, were not drawn.
Here is the image:
Screenshot 2021-05-12 142526.png
Here is how it is supposed to look:
Screenshot 2021-05-12 141809.png
I hope I made myself clear. I don't know if it's a bug or it's intentional. If there is a way to overcome this situation please let me know.

Here is the code:

Code: Select all

Shape27=Combine Shape | Union Shape2 | Union Shape3 | Union Shape4 | Union Shape5 | Rotate 0, 0, 160
MyGradient0=180 | 249, 116, 31;0.0 | 242, 75, 59;1.0

Shape28=Combine Shape6 | Union Shape7 | Union Shape8 | Union Shape9 | Union Shape10 | Rotate 60, 66, 160
MyGradient1=0 | 249, 116, 31;0.0 | 242, 75, 59;1.0

Shape29=Combine Shape11 | Union Shape12 | Union Shape13 | Union Shape14 | Union Shape15 | Rotate 120, 99, 217
MyGradient2=180 | 249, 116, 31;0.0 | 242, 75, 59;1.0

Shape30=Combine Shape16 | Union Shape17 | Union Shape18 | Union Shape19 | Union Shape20 | Rotate 180, 66, 274
MyGradient3=0 | 249, 116, 31;0.0 | 242, 75, 59;1.0

Shape31=Combine Shape21 | Union Shape22 | Union Shape23 | Rotate 90, 0, 171
MyGradient4=90 | 249, 116, 31;0.0 | 242, 75, 59;1.0

Shape32=Combine Shape24 | Union Shape25 | Union Shape26 | Rotate 90, 0, 222
MyGradient5=90 | 249, 116, 31;0.0 | 242, 75, 59;1.0

Shape33=Combine Shape27 | Union Shape28 | Union Shape29 | Union Shape30 | Union Shape31 | Union Shape32
Here is the full code:
Main: https://pastebin.com/TXbhDQek
Measures: https://pastebin.com/LB4CRKMa
Visualizer: https://pastebin.com/N4CB3Rxu

If you want to look at the full code, visit the github page : https://github.com/deathcrafter/ACustomVisualizer
You do not have the required permissions to view the files attached to this post.
Last edited by death.crafter on May 27th, 2021, 3:16 am, edited 2 times in total.
from the Realm of Death
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Bug]Unexpected behavior of "Shape Meter" when "combining combined shapes"

Post by balala »

death.crafter wrote: May 12th, 2021, 8:43 am Here is the code:
Yes, you posted the code, but only the code of the Shape meter. The code of the needed [Measure1], [Measure2], .... measures are missing. Post them as well, please.
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: [Bug]Unexpected behavior of "Shape Meter" when "combining combined shapes"

Post by ikarus1969 »

From the code snippet you have posted i can not tell what's going wrong and why, but one thing i noticed ist that you coded ...Fill LinearGradient1 MyGradient....
The "1" at the end of LinearGradient1 must be removed
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: [Bug]Unexpected behavior of "Shape Meter" when "combining combined shapes"

Post by death.crafter »

ikarus1969 wrote: May 13th, 2021, 5:06 am From the code snippet you have posted i can not tell what's going wrong and why, but one thing i noticed ist that you coded ...Fill LinearGradient1 MyGradient....
The "1" at the end of LinearGradient1 must be removed
It is not an error but a feature very less know about. It is interpolated more smoothly than LinearGradient.
from the Realm of Death
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: [Bug]Unexpected behavior of "Shape Meter" when "combining combined shapes"

Post by death.crafter »

balala wrote: May 12th, 2021, 5:52 pm Yes, you posted the code, but only the code of the Shape meter. The code of the needed [Measure1], [Measure2], .... measures are missing. Post them as well, please.
Thank you for responding. I updated the post with main skin file and measures. For the scripts and stuff I felt like a link to pastebin was too much, so I just gave a link to my GitHub repo. Hope that's fine :D
from the Realm of Death
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: [Bug]Unexpected behavior of "Shape Meter" when "combining combined shapes"

Post by death.crafter »

death.crafter wrote: May 12th, 2021, 8:43 am As it happens I was working on an visualizer when I noticed this. When I tried to unite(combine) 6 combined shapes, the raw shapes in the parent shape, except for the first raw shape, were not drawn.


If you want to look at the full code, visit the github page : https://github.com/deathcrafter/ACustomVisualizer
I just wanted to know is it is a bug or a unwanted feature(a bug that can't be helped). So I am just posting a reply to my own post.
from the Realm of Death
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Possible fault in combine option in shape meter

Post by death.crafter »

[EDIT: I moved this post and next 5 posts from a different thread. - Brian]

As I posted a topic in "Bugs and Feature Suggestions" and got no reply, I am posting this in shape meter help.

I was working on a project when I noticed this. When I try to combine combined shapes, of the parent shape in final shape, only the first shape is drawn. I can't say it without it sounding weird so I will just post screen shots and code.

Screenshots:

When not combined:
Screenshot 2021-05-22 222703.png
*the colors denote different groups before combination

When combined:
Screenshot 2021-05-22 223241.png
Here is the shape meter:

Code: Select all

[MeterShape]
Meter=Shape

X=1
Y=1

Shape=Rectangle 0,0,15, 100 | Fill Color 255,0,0 | StrokeWidth 0
Shape2=Rectangle 20,0,15, 100
Shape3=Rectangle 40,0,15, 100
Shape4=Rectangle 60,0,15, 100
Shape5=Rectangle 80,0,15, 100

Shape6=Combine Shape | Union Shape2 | Union Shape3 | Union Shape4 | Union Shape5

Shape7=Rectangle 110,0,15, 100 | Fill Color 255,0,255 | StrokeWidth 0
Shape8=Rectangle 130,0,15, 100
Shape9=Rectangle 150,0,15, 100
Shape10=Rectangle 170,0,15, 100
Shape11=Rectangle 190,0,15, 100

Shape12=Combine Shape7 | Union Shape8 | Union Shape9 | Union Shape10 | Union Shape11

Shape13=Rectangle 220,0,15, 100 | Fill Color 0,0,255 | StrokeWidth 0
Shape14=Rectangle 240,0,15, 100
Shape15=Rectangle 260,0,15, 100
Shape16=Rectangle 280,0,15, 100
Shape17=Rectangle 300,0,15, 100

Shape18=Combine Shape13 | Union Shape14 | Union Shape15 | Union Shape16 | Union Shape17

Shape19=Combine Shape6 | Union Shape12 | Union Shape18
Here is a skin to demonstrate this issue:
ShapeFault_1.0.rmskin
Just left click on it to change type.
You do not have the required permissions to view the files attached to this post.
Last edited by Brian on May 24th, 2021, 6:35 am, edited 2 times in total.
Reason: I moved this post and next 5 posts from a different thread.
from the Realm of Death
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Possible fault in combine option in shape meter

Post by Yincognito »

death.crafter wrote: May 22nd, 2021, 5:15 pm As I posted a topic in "Bugs and Feature Suggestions" and got no reply, I am posting this in shape meter help.

I was working on a project when I noticed this. When I try to combine combined shapes, of the parent shape in final shape, only the first shape is drawn. I can't say it without it sounding weird so I will just post screen shots and code.
Hm... it looks like when a shape (i.e. Shape) is part of a "grandparent" shape (i.e. Shape6) in a combined scenario, the attribute modifiers of the former's "children" (i.e. Shape2 to Shape5) in its own combined scenario are lost. Depending on the implementation of Shape combinations, this might be either logical / expected or a flaw, so I'm not sure if it qualifies as a bug or not. Maybe it has to do with the small note in the manual which says:
Any Attribute modifiers on child shapes or the new combined shape are ignored.
so, if Shape continues to be the actual parent in the final Shape19 (instead of Shape6 like one would expect), then losing the attribute modifiers of its (former) children may make sense since they were replaced with new children, like Shape12 and Shape18. Either that, or stuff can't be inherited for more than one "generation" when combining shapes in a "nested" fashion.

I couldn't find a solution to this (yet) - other than combining everything in one move, i.e. give up the "nested" combination scenario - but I simplified a bit your test code, using a single meter and meter styles:

Code: Select all

[Variables]
Combine=0

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

---Styles---

[Style0]

[Style1]
Shape19=Combine Shape6 | Union Shape12 | Union Shape18

---Meters---

[MeterShape]
Meter=Shape
X=1
Y=1
Shape=Rectangle 0,0,15,100 | Fill Color 255,0,0 | StrokeWidth 0
Shape2=Rectangle 20,0,15,100
Shape3=Rectangle 40,0,15,100
Shape4=Rectangle 60,0,15,100
Shape5=Rectangle 80,0,15,100
Shape6=Combine Shape | Union Shape2 | Union Shape3 | Union Shape4 | Union Shape5
Shape7=Rectangle 110,0,15,100 | Fill Color 255,0,255 | StrokeWidth 0
Shape8=Rectangle 130,0,15,100
Shape9=Rectangle 150,0,15,100
Shape10=Rectangle 170,0,15,100
Shape11=Rectangle 190,0,15,100
Shape12=Combine Shape7 | Union Shape8 | Union Shape9 | Union Shape10 | Union Shape11
Shape13=Rectangle 220,0,15,100 | Fill Color 0,0,255 | StrokeWidth 0
Shape14=Rectangle 240,0,15,100
Shape15=Rectangle 260,0,15,100
Shape16=Rectangle 280,0,15,100
Shape17=Rectangle 300,0,15,100
Shape18=Combine Shape13 | Union Shape14 | Union Shape15 | Union Shape16 | Union Shape17
MeterStyle=Style#Combine#
LeftMouseUpAction=[!SetVariable Combine (1-#Combine#)][!Update][!Redraw]
DynamicVariables=1
It would be interesting to find out what the developers say regarding this behavior. Who knows, maybe it's normal, maybe it's not. Of course, it isn't desirable, but that's another matter... :???:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: Possible fault in combine option in shape meter

Post by death.crafter »

Yincognito wrote: May 22nd, 2021, 6:58 pm Hm... it looks like when a shape (i.e. Shape) is part of a "grandparent" shape (i.e. Shape6) in a combined scenario, the attribute modifiers of the former's "children" (i.e. Shape2 to Shape5) in its own combined scenario are lost. Depending on the implementation of Shape combinations, this might be either logical / expected or a flaw, so I'm not sure if it qualifies as a bug or not. Maybe it has to do with the small note in the manual which says:

so, if Shape continues to be the actual parent in the final Shape19 (instead of Shape6 like one would expect), then losing the attribute modifiers of its (former) children may make sense since they were replaced with new children, like Shape12 and Shape18. Either that, or stuff can't be inherited for more than one "generation" when combining shapes in a "nested" fashion.

It would be interesting to find out what the developers say regarding this behavior. Who knows, maybe it's normal, maybe it's not. Of course, it isn't desirable, but that's another matter... :???:
Attribute modifiers refer to the options like color, stroke width, stroke color and stuff like that. But another thing that transform modifiers are preserved after combining shapes. or example see this this one:

Code: Select all

[MeterShape]
Meter=Shape

X=0
Y=120

Shape=Rectangle 0,0,15, 100 | Fill Color 255,0,0 | StrokeWidth 0
Shape2=Rectangle 20,0,15, 100
Shape3=Rectangle 40,0,15, 100
Shape4=Rectangle 60,0,15, 100
Shape5=Rectangle 80,0,15, 100

Shape6=Combine Shape | Union Shape2 | Union Shape3 | Union Shape4 | Union Shape5

Shape7=Rectangle 110,0,15, 100 | Fill Color 255,0,255 | StrokeWidth 0
Shape8=Rectangle 130,0,15, 100
;------------------------------------------------------

Shape9=Rectangle 150,0,15, 100 | Rotate 20
			
;------------------------------------------------------
Shape10=Rectangle 170,0,15, 100
Shape11=Rectangle 190,0,15, 100
;------------------------------------------------------

Shape12=Combine Shape7 | Union Shape8 | Union Shape9 | Union Shape10 | Union Shape11 | Rotate 45

;------------------------------------------------------
Shape13=Rectangle 220,0,15, 100 | Fill Color 0,0,255 | StrokeWidth 0
Shape14=Rectangle 240,0,15, 100
Shape15=Rectangle 260,0,15, 100
Shape16=Rectangle 280,0,15, 100
Shape17=Rectangle 300,0,15, 100

Shape18=Combine Shape13 | Union Shape14 | Union Shape15 | Union Shape16 | Union Shape17
;-------------------------------------------------------

Shape19=Combine Shape6 | Union Shape12 | Union Shape18 | Rotate 60

;--------------------------------------------------------
Hidden=[#Combine]
Picture:
Screenshot 2021-05-23 004707.png
As you can see the ultimate (grand?)child shape preserves all the transform modifiers (rotate here). I hope it's a bug that can be fixed.
You do not have the required permissions to view the files attached to this post.
from the Realm of Death
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Possible fault in combine option in shape meter

Post by Yincognito »

death.crafter wrote: May 22nd, 2021, 7:21 pm Attribute modifiers refer to the options like color, stroke width, stroke color and stuff like that. But another thing that transform modifiers are preserved after combining shapes.
Yes, transform modifiers act a bit differently than attribute modifiers, since the transformations are operated first. There are differences like this in certain areas of Rainmeter, probably because of the time and the approach used when implementing them. I guess in your actual usage scenario you can't combine the desired shapes in one go? That might be a reasonable workaround until the issue is better looked at by the devs.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth