-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSelect all anchors and nodes.py
35 lines (25 loc) · 1 KB
/
Select all anchors and nodes.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#MenuTitle: Select all Anchors and Paths
# -*- coding: utf-8 -*-
__doc__="""
Select all Anchors and Paths 90 left in the current glyph.
"""
thisFont = Glyphs.font # frontmost font
thisFontMaster = thisFont.selectedFontMaster # active master
listOfSelectedLayers = thisFont.selectedLayers # active layers of selected glyphs
thisDoc = Glyphs.currentDocument # the frontmost document
def process( thisLayer ):
thisLayer.clearSelection()
for thisAnchor in thisLayer.anchors:
thisAnchor
thisLayer.addSelection_(thisAnchor)
for thisPath in thisLayer.paths:
for thisNode in thisPath.nodes:
thisLayer.addSelection_(thisNode)
thisFont.disableUpdateInterface() # suppresses UI updates in Font View
for thisLayer in listOfSelectedLayers:
thisGlyph = thisLayer.parent
print "Selecting all anchors and paths in: %s." % thisGlyph.name
thisGlyph.beginUndo() # begin undo grouping
process( thisLayer )
thisGlyph.endUndo() # end undo grouping
thisFont.enableUpdateInterface() # re-enables UI updates in Font View