"Open Corner" command to work on multiple selected nodes

Could the "Open Corner" command in the right-click menu work on multiple selected nodes, not just one? I’m working on a font that has many lines (about 10 per glyph) that I have to extend (then offset, for a subtract operation afterwards), and selecting nodes one by one for each glyph is slowing things down considerably.


Maybe I can script something. Let me try.

Thumbs up for multiple selected nodes

I try to only show stuff in the context menu when it makes sense. Otherwise the menu would be to long and you would not find the stuff you need.
It does not happen often, that you need to run that command a lot but it seems in this rare occasions. So the the script seems to be a good solution.

OK, but if all the selected nodes are at the end of a path it would make sense IMO, and inserting “Open Corner” along the 3 node-editing commands doesn’t make the menu too long – it would be 4 (four) menu commands (not 5, not 6), just like when you select a single node at the end of a path.

(Not meant to say a script is not welcome, of course)

Actually on reflection shouldn’t “Make Node First” drop out as an option with multiple nodes selected?

1 Like

Make Node First currently works on the node exactly under the mouse pointer. Doesn’t even need to be selected.

Update on the script: I am on to something, but for it to work, Georg needs to change something in the code. So it will still take a little while.

Update: Everything is in place for a scripting solution, but I think the best solution would be a context menu extension. That is what I am working on now.

If someone wants to roll their own:

thisFont = Glyphs.font
thisMaster = Font.selectedFontMaster
theseLayers = Font.selectedLayers
thisLayer = theseLayers[0]
width = 150.0
if thisMaster.verticalStems:
	width = thisMaster.verticalStems[0]

selectedCornerNodes = ( item for item in thisLayer.selection if type(item) == GSNode and n.connection == GSSHARP )
for thisNode in selectedCornerNodes:
	thisLayer.openCornerAtNode_offset_( thisNode, width  )

I extended the “Open Corner” and “Reconnect Nodes” command to work on multiple selected nodes.


Alright, then I don’t need to follow up on the extension. :smile:

Sorry for resurrecting an old thread, but only recently I got around to test the new updates.

It’s great that ‘Open Corners’ works on multiple selected nodes now—thank you for that—but now I see that ‘Open Corners’ doesn’t work for endnodes anymore. OK, I know endnodes are not corners, but can you make available the code that worked on endnodes with a different name, like “Extend Path” or something, and of course make it work on multiple selected nodes? To me at least it was useful as an intermediary step in extending the paths that were then going to be transformed into stripes with the “Offset Curve” effect, and I was asking for it to work on multiple nodes. If not, let me know, and I will revert to an older version.

Do you say that the old version would work on the end of open paths? That would have been a bug.
But to have the ability to extend a path would be useful. I see where to put it.

Yes, it also worked when selecting the path point (node) at the end of a path—it extended the path—and I needed it to be able to work on multiple endnodes at once, not just one by one.