I've finished working on the first iteration of the SVG Synfig exporter. The essential features are there and a lot of bugs are fixed, so I think now would be a good time to consider including a copy with Inkscape. I committed the files into a personal branch of inkscape: "lp:~nikitakit/inkscape/svg2sif". (Disclaimer: I'm a git advocate and don't know much about bzr)
My work was all done on Ubuntu natty with Python version "2.7.1+", testing against Inkscape 0.48.1, Inkscape trunk build, and a large collection of OpenClipArt files made with various (older) versions of Inkscape. It would be good if someone could test it on Windows and Mac (especially if the python versions are different).
~Nikita
On 3/10/11 21:27, Nikita Kitaev wrote:
I've finished working on the first iteration of the SVG Synfig exporter. The essential features are there and a lot of bugs are fixed, so I think now would be a good time to consider including a copy with Inkscape. I committed the files into a personal branch of inkscape: "lp:~nikitakit/inkscape/svg2sif". (Disclaimer: I'm a git advocate and don't know much about bzr)
My work was all done on Ubuntu natty with Python version "2.7.1+", testing against Inkscape 0.48.1, Inkscape trunk build, and a large collection of OpenClipArt files made with various (older) versions of Inkscape. It would be good if someone could test it on Windows and Mac (especially if the python versions are different).
1) (Legacy) Mac OS X 10.5.8 Leopard (i386) Quick test with two small SVG files (some basic shapes, and a text converted to path), exported *.sif verified with Synfigstudio 0.63.00 (installed with MacPorts):
a) Inkscape 0.48.2 (official package), Python 2.5.1 (Apple, default) Both sample files fail to export to *.sif:
File "synfig_output.py", line 1340 except MalformedSVGError as e: ^ SyntaxError: invalid syntax
b) Inkscape 0.48.2 (local build), Python 2.6.7 (MacPorts) Both sample files export ok to *.sif
c) Inkscape 0.48+devel r10660 (GTK+/Quartz), Python 2.7.2 (MacPorts) Both sample files export ok to *.sif
2) For current versions of OS X (not personally verified):
a) Mac OS X 10.6 Snow Leopard: The extension should work fine with the prebuilt package (0.48.2-1) on Snow Leopard which has Python 2.6 installed as default system version.
b) OS X 10.7 Lion: None of Inkscape's python-based extensions currently work out-of-the-box with the prebuilt package (0.48.2-1) on Lion, see Bug #819209 "Extensions do not work with Mac OS X Lion" https://bugs.launchpad.net/inkscape/+bug/819209. This will also affect svg2sif. The workaound/fix described in the bug report has been confirmed (enforce the use of Python 2.6 (32bit)), but there is no updated package of Inkscape 0.48.2 available for download.
If you need additional tests, maybe you could provide details or files? (I'm not familiar with Synfig yet, and can only compare visually whether the converted file looks the same in Synfigstudio as it does in Inkscape on-canvas).
hth, ~suv
On Mon, Oct 3, 2011 at 2:17 PM, ~suv <suv-sf@...58...> wrote:
On 3/10/11 21:27, Nikita Kitaev wrote:
I've finished working on the first iteration of the SVG Synfig exporter. The essential features are there and a lot of bugs are fixed, so I think now would be a good time to consider including a copy with Inkscape. I committed the files into a personal branch of inkscape: "lp:~nikitakit/inkscape/svg2sif". (Disclaimer: I'm a git advocate and don't know much about bzr)
My work was all done on Ubuntu natty with Python version "2.7.1+", testing against Inkscape 0.48.1, Inkscape trunk build, and a large collection of OpenClipArt files made with various (older) versions of Inkscape. It would be good if someone could test it on Windows and Mac (especially if the python versions are different).
- (Legacy) Mac OS X 10.5.8 Leopard (i386)
Quick test with two small SVG files (some basic shapes, and a text converted to path), exported *.sif verified with Synfigstudio 0.63.00 (installed with MacPorts):
a) Inkscape 0.48.2 (official package), Python 2.5.1 (Apple, default) Both sample files fail to export to *.sif:
File "synfig_output.py", line 1340 except MalformedSVGError as e: ^ SyntaxError: invalid syntax
b) Inkscape 0.48.2 (local build), Python 2.6.7 (MacPorts) Both sample files export ok to *.sif
c) Inkscape 0.48+devel r10660 (GTK+/Quartz), Python 2.7.2 (MacPorts) Both sample files export ok to *.sif
- For current versions of OS X (not personally verified):
a) Mac OS X 10.6 Snow Leopard: The extension should work fine with the prebuilt package (0.48.2-1) on Snow Leopard which has Python 2.6 installed as default system version.
b) OS X 10.7 Lion: None of Inkscape's python-based extensions currently work out-of-the-box with the prebuilt package (0.48.2-1) on Lion, see Bug #819209 "Extensions do not work with Mac OS X Lion" https://bugs.launchpad.net/inkscape/+bug/819209. This will also affect svg2sif. The workaound/fix described in the bug report has been confirmed (enforce the use of Python 2.6 (32bit)), but there is no updated package of Inkscape 0.48.2 available for download.
If you need additional tests, maybe you could provide details or files? (I'm not familiar with Synfig yet, and can only compare visually whether the converted file looks the same in Synfigstudio as it does in Inkscape on-canvas).
hth, ~suv
I just noticed a really odd bug: saving anything using as .sif makes the "Open Recent" menu completely unusable. Every one of the links is trying to open the same sif file, which has no importer.
Did I make a mistake in the extension files, or is it an Inkscape problem?
~Nikita
On 4/10/11 01:00, Nikita Kitaev wrote:
I just noticed a really odd bug: saving anything using as .sif makes the "Open Recent" menu completely unusable. Every one of the links is trying to open the same sif file, which has no importer.
Did I make a mistake in the extension files, or is it an Inkscape problem?
I don't think it's related to the code if the extension:
1) Could it be that you hit this known bug with Unity without having noticed it before?: Bug #708185 https://bugs.launchpad.net/inkscape/+bug/708185 "all recent items open the same recent image no matter what is selected"
2) Use 'Save a copy as...' instead of 'Save as...': this is similar to a real 'Export' and does not reload the saved file in the current document window, and thus not add an entry in the 'Open Recent...' list.
~suv
On Mon, Oct 3, 2011 at 4:00 PM, Nikita Kitaev <nikitakit@...400...> wrote:
I just noticed a really odd bug: saving anything using as .sif makes the "Open Recent" menu completely unusable. Every one of the links is trying to open the same sif file, which has no importer.
Did I make a mistake in the extension files, or is it an Inkscape problem?
Are you using Ubuntu? We do have a known issue with Ubuntu and the Open Recent menu.
Cheers, Josh
On Mon, Oct 3, 2011 at 4:16 PM, Josh Andler <scislac@...400...> wrote:
On Mon, Oct 3, 2011 at 4:00 PM, Nikita Kitaev <nikitakit@...400...> wrote:
I just noticed a really odd bug: saving anything using as .sif makes the "Open Recent" menu completely unusable. Every one of the links is trying to open the same sif file, which has no importer.
Did I make a mistake in the extension files, or is it an Inkscape problem?
Are you using Ubuntu? We do have a known issue with Ubuntu and the Open Recent menu.
Cheers, Josh
That's definitely it. I hope the next Ubuntu version will fix the problem.
On Mon, Oct 3, 2011 at 4:22 PM, Nikita Kitaev <nikitakit@...400...> wrote:
That's definitely it. I hope the next Ubuntu version will fix the problem.
Using 11.10 here and it is not fixed still. They're saying it's an Inkscape problem. Hopefully we can get it fixed before 12.04 since it's an LTS release.
Cheers, Josh
On Mon, Oct 3, 2011 at 2:17 PM, ~suv <suv-sf@...58...> wrote:
On 3/10/11 21:27, Nikita Kitaev wrote:
I've finished working on the first iteration of the SVG Synfig exporter. The essential features are there and a lot of bugs are fixed, so I think now would be a good time to consider including a copy with Inkscape. I committed the files into a personal branch of inkscape: "lp:~nikitakit/inkscape/svg2sif". (Disclaimer: I'm a git advocate and don't know much about bzr)
My work was all done on Ubuntu natty with Python version "2.7.1+", testing against Inkscape 0.48.1, Inkscape trunk build, and a large collection of OpenClipArt files made with various (older) versions of Inkscape. It would be good if someone could test it on Windows and Mac (especially if the python versions are different).
- (Legacy) Mac OS X 10.5.8 Leopard (i386)
Quick test with two small SVG files (some basic shapes, and a text converted to path), exported *.sif verified with Synfigstudio 0.63.00 (installed with MacPorts):
a) Inkscape 0.48.2 (official package), Python 2.5.1 (Apple, default) Both sample files fail to export to *.sif:
File "synfig_output.py", line 1340 except MalformedSVGError as e: ^ SyntaxError: invalid syntax
b) Inkscape 0.48.2 (local build), Python 2.6.7 (MacPorts) Both sample files export ok to *.sif
c) Inkscape 0.48+devel r10660 (GTK+/Quartz), Python 2.7.2 (MacPorts) Both sample files export ok to *.sif
- For current versions of OS X (not personally verified):
a) Mac OS X 10.6 Snow Leopard: The extension should work fine with the prebuilt package (0.48.2-1) on Snow Leopard which has Python 2.6 installed as default system version.
b) OS X 10.7 Lion: None of Inkscape's python-based extensions currently work out-of-the-box with the prebuilt package (0.48.2-1) on Lion, see Bug #819209 "Extensions do not work with Mac OS X Lion" https://bugs.launchpad.net/inkscape/+bug/819209. This will also affect svg2sif. The workaound/fix described in the bug report has been confirmed (enforce the use of Python 2.6 (32bit)), but there is no updated package of Inkscape 0.48.2 available for download.
If you need additional tests, maybe you could provide details or files? (I'm not familiar with Synfig yet, and can only compare visually whether the converted file looks the same in Synfigstudio as it does in Inkscape on-canvas).
hth, ~suv
Besides python versions the only other feature I worry about is launching an Inkscape subprocess to do some conversions. A simple test would be to draw a rectangle and export the file. Correct behavior is to launch another Inkscape window that converts the rectangle to a path. Incorrect behavior includes failing to run the "inkscape" command.
The Mac OS X Lion problem isn't something I can fix. I'll worry about that system once the bug is resolved.
Leopard is another question. Does the code run if all the "except ExceptionName as e" statements are replaced with "except ExceptionName, e"? If syntax is the only problem I can fix it.
~Nikita
On 5/10/11 19:49, Nikita Kitaev wrote:
On Mon, Oct 3, 2011 at 2:17 PM, ~suv <suv-sf@...58...> wrote:
On 3/10/11 21:27, Nikita Kitaev wrote:
I've finished working on the first iteration of the SVG Synfig exporter. The essential features are there and a lot of bugs are fixed, so I think now would be a good time to consider including a copy with Inkscape. I committed the files into a personal branch of inkscape: "lp:~nikitakit/inkscape/svg2sif". (Disclaimer: I'm a git advocate and don't know much about bzr)
My work was all done on Ubuntu natty with Python version "2.7.1+", testing against Inkscape 0.48.1, Inkscape trunk build, and a large collection of OpenClipArt files made with various (older) versions of Inkscape. It would be good if someone could test it on Windows and Mac (especially if the python versions are different).
- (Legacy) Mac OS X 10.5.8 Leopard (i386)
Quick test with two small SVG files (some basic shapes, and a text converted to path), exported *.sif verified with Synfigstudio 0.63.00 (installed with MacPorts):
a) Inkscape 0.48.2 (official package), Python 2.5.1 (Apple, default) Both sample files fail to export to *.sif:
File "synfig_output.py", line 1340 except MalformedSVGError as e: ^ SyntaxError: invalid syntax
b) Inkscape 0.48.2 (local build), Python 2.6.7 (MacPorts) Both sample files export ok to *.sif
c) Inkscape 0.48+devel r10660 (GTK+/Quartz), Python 2.7.2 (MacPorts) Both sample files export ok to *.sif
- For current versions of OS X (not personally verified):
a) Mac OS X 10.6 Snow Leopard: The extension should work fine with the prebuilt package (0.48.2-1) on Snow Leopard which has Python 2.6 installed as default system version.
b) OS X 10.7 Lion: None of Inkscape's python-based extensions currently work out-of-the-box with the prebuilt package (0.48.2-1) on Lion, see Bug #819209 "Extensions do not work with Mac OS X Lion" https://bugs.launchpad.net/inkscape/+bug/819209. This will also affect svg2sif. The workaound/fix described in the bug report has been confirmed (enforce the use of Python 2.6 (32bit)), but there is no updated package of Inkscape 0.48.2 available for download.
If you need additional tests, maybe you could provide details or files? (I'm not familiar with Synfig yet, and can only compare visually whether the converted file looks the same in Synfigstudio as it does in Inkscape on-canvas).
Besides python versions the only other feature I worry about is launching an Inkscape subprocess to do some conversions. A simple test would be to draw a rectangle and export the file. Correct behavior is to launch another Inkscape window that converts the rectangle to a path. Incorrect behavior includes failing to run the "inkscape" command.
Launching another instance of Inkscape from the python script in a subprocess does work with the osx-packaged application bundle - other extensions, (e.g. 'Arrange > Restack') use it too, though without gui because they don't need to use verbs.
The Mac OS X Lion problem isn't something I can fix. I'll worry about that system once the bug is resolved.
Leopard is another question. Does the code run if all the "except ExceptionName as e" statements are replaced with "except ExceptionName, e"? If syntax is the only problem I can fix it.
AFAICT it's simply a syntax error in Python 2.5.1 - export and preparing for export works without failure in the osx-packaged Inkscape.app (0.48.2) and Python 2.5.1 after applying the small change as you described (see attached diff). The diff also includes a fix for the vim modeline (else current vim complains when opening the the script).
hth, ~suv
--- synfig_output.py-orig 2011-10-03 21:49:48.000000000 +0200 +++ synfig_output.py 2011-10-05 20:21:13.000000000 +0200 @@ -1337,7 +1337,7 @@ try: e = SynfigExport() e.affect(output=False) - except MalformedSVGError as e: + except MalformedSVGError, e: errormsg(e)
-# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 encoding=utf-8 textwidth=99 +# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99 --- synfig_prepare.py-orig 2011-10-03 21:49:48.000000000 +0200 +++ synfig_prepare.py 2011-10-05 20:21:16.000000000 +0200 @@ -487,8 +487,8 @@ try: e = SynfigPrep() e.affect() - except MalformedSVGError as e: + except MalformedSVGError, e: errormsg(e)
-# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 encoding=utf-8 textwidth=99 +# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99
On Wed, Oct 5, 2011 at 11:50 AM, ~suv <suv-sf@...58...> wrote:
On 5/10/11 19:49, Nikita Kitaev wrote:
On Mon, Oct 3, 2011 at 2:17 PM, ~suv <suv-sf@...58...> wrote:
Besides python versions the only other feature I worry about is launching an Inkscape subprocess to do some conversions. A simple test would be to draw a rectangle and export the file. Correct behavior is to launch another Inkscape window that converts the rectangle to a path. Incorrect behavior includes failing to run the "inkscape" command.
Launching another instance of Inkscape from the python script in a subprocess does work with the osx-packaged application bundle - other extensions, (e.g. 'Arrange > Restack') use it too, though without gui because they don't need to use verbs.
The Mac OS X Lion problem isn't something I can fix. I'll worry about that system once the bug is resolved.
Leopard is another question. Does the code run if all the "except ExceptionName as e" statements are replaced with "except ExceptionName, e"? If syntax is the only problem I can fix it.
AFAICT it's simply a syntax error in Python 2.5.1 - export and preparing for export works without failure in the osx-packaged Inkscape.app (0.48.2) and Python 2.5.1 after applying the small change as you described (see attached diff). The diff also includes a fix for the vim modeline (else current vim complains when opening the the script).
hth, ~suv
Good to hear! Hopefully that takes care of all the Python 2.5 incompatibilities. Thanks for the patch.
I posted a merge proposal on launchpad. If anyone has feedback on the code I can make changes.
I think something should be done about the "Prepare for Export" menu option. It adds another menu that 99% of people won't need. Any ideas where I can put it? (I could remove it altogether, of course. It's just a convenience, and I don't really know how useful it is.)
~Nikita
participants (3)
-
Josh Andler
-
Nikita Kitaev
-
~suv