SVG Export problem

Hello,
I am trying to export an SVG of an animation frame according to the instructions in the Reference, section Single Frame from an Animation (With Screen Display) , but when I press the mouse button to export, I get the error “RuntimeException: No set() for PGraphicsSVG”.
I found this topic dealing with the error, but they work around the problem rather than solve it.

What does this error mean? How do I solve it? I do not have “pixel operations”, such as “set” in my code.

I am running Processing 4.3 on Windows 10 x64.

1 Like

Hello @appas.

You will get that error for any of the functions here:

This prints the exception to console:

 protected void nope(String function) {
    throw new RuntimeException("No " + function + "() for PGraphicsSVG");
  }

The guidelines here may help:

Try to generate a Minimum, Complete, Verifiable Example as per the guidelines and you may narrow things down.

Start whittling away at your code until you just have code that generates the error.

:)

Hi @appas, I think I noticed at some point that you can only export a single SVG per sketch, I don’t remember exactly the reason, and I think it is an awful limitation, but I think this is it. I’ll see if I can gather some reference. A code sample of what you are doing will help people help you.

Hello @villares ,

From what I glean from the library reference you can only export a single frame at a time; that could be each frame, the last frame or with some control statements for a frame you select.

Reference:
https://processing.org/reference/libraries/svg/index.html

:)

1 Like

It was because I had a raster image as background. Commenting out the background(bg); call made SVG export happen.

thanks for the reference @glv!

I don’t recall seeing the .dispose() method before, maybe using some PGraphics strategy with this can allow multiple exports…