Delete all paths in background

That would be perfect @Tosche!

I’ve made a UI mockup. Does it look like what you need?

@Tosche Thanks!

I think delete paths (and anchors) in all selected glyphs in the current master (and re-run in the other masters if necessary) would be sufficient, but this mockup would cover any imaginable scenario, so yes, even better!

Done, it’s available on my Github repository as Clear Background blah blah (also G3 plugin manager)

3 Likes

Sorry the script is not working, I’m working on it now.

@GeorgSeifert Upon debugging the script, I noticed there are things I can no longer do straight with GSPath. I cannot clear paths by doing layer.paths = [] for example. RemoveLayer and removeComponent are also no longer to be seen, etc
 I understand that treating them as the same can be convenient sometimes, but I do not see the benefit of removing such functions. I do not think the distinction between path and component has become somehow less important. Could you elaborate on the change or point me where you have already?

@Tosche Awesome! Thanks for being so quick.

Yes, was just about to post that I can’t get it to work.

Installed via the Plugin Manager, Glyphs 3066. I have all the modules installed. Macro window doesn’t output any errors.

Sorry, it’s my bad habit of releasing before testing :sweat_smile:

1 Like

It’s done and functional!

2 Likes

Perfect, thanks so much! :clap:

The distinction is still there. Both are in the same list now. I did that to be able to mix them. This is important for color glyphs and for masking (using paths to mask components and the other way around.

The layer.paths accessor is there for convenience but is read only (for now).

I understand the benefit of treating paths and components the same, it is indeed useful in many occasions. I just do not like that what used to be possible is no longer, and I cannot think of a good reason. It’s great if shapes was an addition, not replacement (that’s kinda how it feels like now).

I could make the .paths and .components proxies behave similar to the old way. Except index based insertion. That limitation would be even more confusing.

Hi, sorry to revive this (again), I just find it crazy that there’s no easy option to delete all background stuff on Glyphs. The Clear Background option is not working and Tosche’s script seems to do nothing, I don’t understand why. I work on Glyphs 3.0.5 (3124) and installed Toschi’s script through the Plugin manager.

Is it possible to add an easy built-in “Delete background” directly in Glyphs?

Clear Background (from Paths menu with Option key depressed) is working for me.

1 Like

macOS 10.13.6, G3.0.5 [3124] – FWIW, Clear Background works for me – on paths and components. If it is images to be cleared, I use one of mekkablue’s two scripts, Remove Images or Remove All Images. I have not encountered any issues.

1 Like

It works for me, too. Can you maybe make a screencast of what you are doing?

I would not add images to the background layer. Put them in the foreground.

Here is the screencast:
https://bit.ly/3ybvYzF

Nothing happens when I click on Clear background.

That’s because you are looking to clean a layer not a background.
Press Cmd+B to edit background.

If you want to remove all non master layers, you can run “Delete all non-Master Layers” by Jens Kutílek

Ah thanks the script by Juns KutĂ­lek worked fine.

But I don’t get this Cmd+B feature though. The letter disappears and it gets red.
I cannot edit the vectors, I don’t see anything so what’s the point? :man_shrugging:t2:

Background is typically same as if you print a letter on tracing paper, and place another version behind it.
You can toggle Background with Cmd+MAJ+B.

Check Page 44 of Glyphs3 handbook :

1 Like