Open mitchcurtis opened 6 years ago
Same issue here with the exact same error.
I ended up fixing it like this:
Hi @mitchcurtis,
I tried your code and it works pretty well!
The only problem I 've got with it is that I needed to change the default path ~/
to the absolute path on my hard drive (e.g. D:\Gamedev\mygame\raw_assets\
). I am on Windows.
Also, maybe you could rename your extension to something like Export Layers to PNG (ninepatch support)
. As for now, with the current name, I would have never thought your extension was answering my needs :)
Thanks a lot!
Hi. :)
The only problem I 've got with it is that I needed to change the default path ~/ to the absolute path on my hard drive (e.g. D:\Gamedev\mygame\raw_assets). I am on Windows.
What would you prefer happened? Your path should be remembered for the current Inkscape session at least, but I'm not sure what I can do about the default path.
Also, maybe you could rename your extension to something like Export Layers to PNG (ninepatch support). As for now, with the current name, I would have never thought your extension was answering my needs :)
I would, but it's for work, and the purpose of the extension is specifically to export 9-patch assets; exporting layers in general is just a bonus. :)
What I meant is that ~/ did not work on Windows, so I thought the extension was not working. So maybe yo could replace it with ./ or nothing or a button to browse the hard drive.
As for now, this is the only extension that exports layers on Windows. Maybe I could fork it and make few changes if you don't mind.
What I meant is that ~/ did not work on Windows, so I thought the extension was not working. So maybe yo could replace it with ./ or nothing
Would "./" work on all platforms? I'm not sure if there's a default path that will work on Windows, Mac and Linux.
Replacing it with nothing could work.
or a button to browse the hard drive.
This isn't possible currently; see: https://github.com/mitchcurtis/inkscape-9-patch-export#using-it
As for now, this is the only extension that exports layers on Windows. Maybe I could fork it and make few changes if you don't mind.
Sure, go for it. :) I'd also merge a pull request that removes the default path.
Hi @jespino , was the problem fixed? I've downloaded the newest version and still cannot export (win7). Doesn't matter if I use the direct path or "./", nothing works.
Thanks!
@kpanas what was the error you got? And what was the path you used?
@mitchcurtis I've used "D:\Dropbox\phd\gfx\vector" (the same directory that the .svg file is in). Here is the error (I cannot copy the text for some reason): Thanks.
@kpanas I don't think the issue was ever fixed in this fork in that case. You can try using https://github.com/mitchcurtis/inkscape-9-patch-export instead.
The problem is that on Windows a temporary file created for export needs cannot be opened again:
Whether the name can be used to open the file a second time, while the named temporary file is still open, varies across platforms (it can be so used on Unix; it cannot on Windows NT or later).
So the solution is quite simple: pass file objects into internal functions instead of their names.
I will prepare a pull request if there are no objections. But I'll need help with testing the solution on platforms other than Windows.
I created a folder to export to:
C:\Users\Mitch\Documents\inkscape-layer-export-test
I exported via the extension, but got this error:
I checked the permissions on the file, and they looked fine.
The .svg file I used is here: drawing.zip