Replace a path by another in G3

Hi,
I’m trying to update a G2 script to G3, but it keeps crashing or returning this error.
I basically trying to change the path of a glyph by another (as a part of a bigger script).

This is the error that I’m getting:

And this is the part of the code that is not working anymore:

tempLayer = instanceFont.glyphs[self.modelGlyphName].layers[0].copyDecomposedLayer()
l.clear()

#v.0 - What used to work in G2, it now returns error in G3
l.paths = tempLayer.paths

# v0.1 - I tried this based on the documentation, but it returns an error too
l.paths = copy.copy(tempLayer.paths)

# v0.2 - What seemed to be the correct solution in G3, but crashes the app
l.shapes.append(tempLayer.paths[0])

I checked if the layer l and the tempLayer were good, and they are.
I also tried to update only l.bezierPath but it returns an error too.

Do you know what is the way to do this in G3?

There is a change in pyobjc that messed up the error reporting. The latest cutting edge version should fix this. Then the error should tell you what’s wrong.

I’m on the latest cutting edge already: 3.0.5

The problem is not so much about the error message. I think that I’m getting it because I sending the wrong object (layer.paths instead of layer.paths[0]).
But when I pass layer.paths[0], I get an instant crash of the app. Same behaviour when using layer.shape

Can you send me the script that crashes the app?

1 Like

I sent it to the office glyphsapp mail.

Did you receive it?