Hi
I recently upgraded to Mojave and Version 2.5.2 (1181) and some scripts which use Font.enableUpdateInterface() have been running strangely.
I am connecting buttons on the midi controller to be able to select prev/next nodes. Everything seems to run without errors and you can even see the node coordinates changing but the issue is that the new selected node is only seen after I actually move inside the glyph window.
(missing codes based on mekkablue’s selecting prev/next node scripts)
class MyThread(threading.Thread):
def run(self):
for msg in inport:
Font = Glyphs.font
selectedLayers = Font.selectedLayers
def getTheFirstPoint(selection):
[...]
def nextOnCurve(currPoint):
[...]
def prevOnCurve(currPoint):
[...]
def next():
currentLayer = Glyphs.font.selectedLayers[0] # active layers of selected glyphs
selection = currentLayer.selection # node selection in edit mode
currentPoint = getTheFirstPoint(selection)
if currentPoint:
nextOnCurveNode = nextOnCurve(currentPoint)
currentLayer.selection = (nextOnCurveNode,)
def prev():
currentLayer = Glyphs.font.selectedLayers[0] # active layers of selected glyphs
selection = currentLayer.selection # node selection in edit mode
currentPoint = getTheFirstPoint(selection)
if currentPoint:
prevOnCurveNode = prevOnCurve(currentPoint)
currentLayer.selection = (prevOnCurveNode,)
if msg.control == 61:
def process():
next()
if msg.control == 62:
def process():
prev()
Font.disableUpdateInterface()
process()
Font.enableUpdateInterface()
m = MyThread()
m.start()