Hello, I am new to scripting and I am trying to understand some stuff I’ve stumbled upon. I don’t understand why the following code depends on if the removeOverlap line is before or after the selection of the node and it’s rounding. The following code successfully rounds the (250, 250) corner :
Font = Glyphs.font
thisLayer = Font.selectedLayers[0]
path = Layer.shapes[0]
for thisNode in path.nodes:
#we know that a single node.x == 250
if thisNode.x == 250:
nodesToSelect.append((thisNode))
thisLayer.selection = nodesToSelect
GlyphsFilterRoundCorner.roundLayer_radius_checkSelection_visualCorrect_grid_(
thisLayer, corner_radius, True, True, 1.0
)
thisLayer.removeOverlap()
While this code fails to do so :
Font = Glyphs.font
thisLayer = Font.selectedLayers[0]
path = Layer.shapes[0]
thisLayer.removeOverlap()
for thisNode in path.nodes:
#we know that a single node.x == 250
if thisNode.x == 250:
nodesToSelect.append((thisNode))
thisLayer.selection = nodesToSelect
GlyphsFilterRoundCorner.roundLayer_radius_checkSelection_visualCorrect_grid_(
thisLayer, corner_radius, True, True, 1.0
)
If someone could explain this to me, it would help a lot !
edit : indentation doesn’t seem to work, sorry