Unable to export font

I am writing a Python script for color fonts.
Font export process does not complete when adding layers with Python script.

Example script:

newLayer = GSLayer()
newLayer.name = 'Color 0'
newLayer.associatedMasterId = Font.masters[-1].id
Font.glyphs['A'].layers.append(newLayer)

Procedure of test:

  1. Create a new font.
  2. Add a layer with the above script.
  3. Export the font. <- Process does not complete (Spin icon keeps spinning)

*The same applies if newLayer.name is set to another name. For example (newLayer.name = 'Test’)
*This problem does not occur if you do not set a value for newLayer.name.
*This problem does not occur when adding layers manually.

I am using Glyphs 2.6.4 (1286) .
Please tell me where the problem is.

Cannot reproduce in 2.6.5 (1300).

Do you have complex shapes in your font? Disable hinting and subroutinization perhaps.

Thank you for your reply.

I checked with Glyphs 2.6.5 (1300), but could not export.

This problem also occurs with new fonts that do not have a path. It also occurs with fonts that have paths. Does not include complex paths or hints.

The export settings are as follows:
Exporting font format: OTF
Remove Overlap: off
Autohint: off
Save as TTF: off

Exporting after running the script causes problems.

Save the file after running the script, close and reopen the file. In this case, export is possible.

macOS Mojave 10.14.6, English, Japanese, and a new user environment. Export failed in all environments.

I know why this might happen. There are some pieces of data that block the app. It might help if you do this:

from GlyphsApp import objcObject

newLayer.name = objcObject('Color 0')

Thank you for your reply.

I was able to export.

Thank you very much!