Is there a way from a python extension to export groups to bitmaps, other than starting a new inkscape process with --export-id --export-id-only flags? Ideally for my effect I would like to have the user enter a directory name as parameter to the effect, and then some images will be generated from parts of the drawing and put as png in that directory.
If starting a new inkscape process is the only way, is there a good platform independent way of figuring out what name to use for the binary (inkscape, inkscape.exe, etc)?
bitmaps from python
Re: bitmaps from python
I don't really know the answer to this, but it does seem that invoking Inkscape is the most feasible option at present.
The name of the Inkscape binary shouldn't be a problem unless the user has changed it. (The extra ".exe" on Windows doesn't matter, as it's implicit.) I don't think there's much you can do if they have changed it.
I suggest looking at scripts that invoke Inkscape (summersnight.py, perspective.py, gimp_xcf.py, and maybe others), and see how they do things. (Best to look at the current versions in SVN rather than older versions.)
The name of the Inkscape binary shouldn't be a problem unless the user has changed it. (The extra ".exe" on Windows doesn't matter, as it's implicit.) I don't think there's much you can do if they have changed it.
I suggest looking at scripts that invoke Inkscape (summersnight.py, perspective.py, gimp_xcf.py, and maybe others), and see how they do things. (Best to look at the current versions in SVN rather than older versions.)
Re: bitmaps from python
Thank! I will have a look. I guess I could add the name of the command to invoke as a parameter if I want it to be easily configurable. But right now I will just invoke it by the name inkscape (only having a parameter to say what directory to put the output bitmaps in).