SVG as background image

I’m having trouble adding SVG files as background images via scripting.

Using the GUI, I can do Glyph > Add Image… and select my SVG file, which is then correctly rendered as a background image.

However, nothing happens when I try to do it via scripting (i.e. layer.backgroundImage = GSBackgroundImage(‘path/to/svg’)).

It works with PNG and JPG files, but not SVG. Maybe GSBackgroundImage does not support SVG files?

There is a small issue with the wrapper. Until the next update, use this code:

backgroundImage = GSBackgroundImage()
backgroundImage.setImagePath_("path/to/svg")
Layer.backgroundImage = backgroundImage
1 Like

That works, thanks!