Show/Hide objects to export in command-line
Hi, I'm using inkscape for various projects, and I'm now concerned about automatically rendering graphics for my game project.
However, several images are rendered from the same SVG file, with different layers/objects visibles. While --export-id (and --export-id-only) is helpful in some cases, it's not always sufficient.
Therefore, I think hiding certain objects with a new command-line option such as --hide-id would be a worthy improvement. Allowing multiple --export-id might be useful too.
Regards, Thibaut Girka.
On Jun 16, 2011, at 10:31 AM, Thibaut Girka wrote:
Hi, I'm using inkscape for various projects, and I'm now concerned about automatically rendering graphics for my game project.
However, several images are rendered from the same SVG file, with different layers/objects visibles. While --export-id (and --export-id-only) is helpful in some cases, it's not always sufficient.
Therefore, I think hiding certain objects with a new command-line option such as --hide-id would be a worthy improvement. Allowing multiple --export-id might be useful too.
There is a simple alternative, especially if you are running things from the command line.
Since SVG files are just XML, it's usually fairly simple to create XSLT to run over the SVG and tweak the specific results the way you need them.
So you start with a "source" SVG that has different items set with specific id's and/or on specific layers.
For each pass, use XSLT to create a temporary SVG with the items you want toggled visible or not.
Then take that temporary SVG and export to bitmap from that.
Eventually it might be handy to add some such batch export support to Inkscape, but it is very much within the realm of common command-line work.
Jon Cruz <jon@...18...> writes:
On Jun 16, 2011, at 10:31 AM, Thibaut Girka wrote:
Hi, I'm using inkscape for various projects, and I'm now concerned about automatically rendering graphics for my game project.
However, several images are rendered from the same SVG file, with different layers/objects visibles. While --export-id (and --export-id-only) is helpful in some cases, it's not always sufficient.
Therefore, I think hiding certain objects with a new command-line option such as --hide-id would be a worthy improvement. Allowing multiple --export-id might be useful too.
There is a simple alternative, especially if you are running things from the command line.
Since SVG files are just XML, it's usually fairly simple to create XSLT to run over the SVG and tweak the specific results the way you need them.
So you start with a "source" SVG that has different items set with specific id's and/or on specific layers.
For each pass, use XSLT to create a temporary SVG with the items you want toggled visible or not.
Then take that temporary SVG and export to bitmap from that.
Eventually it might be handy to add some such batch export support to Inkscape, but it is very much within the realm of common command-line work.
Since I've been using the DBUS interfare for similar things I'd like to suggest that approach.
EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev
Le vendredi 17 juin 2011 à 08:20 +0200, joakim@...1974... a écrit :
Jon Cruz <jon@...18...> writes:
On Jun 16, 2011, at 10:31 AM, Thibaut Girka wrote:
Hi, I'm using inkscape for various projects, and I'm now concerned about automatically rendering graphics for my game project.
However, several images are rendered from the same SVG file, with different layers/objects visibles. While --export-id (and --export-id-only) is helpful in some cases, it's not always sufficient.
Therefore, I think hiding certain objects with a new command-line option such as --hide-id would be a worthy improvement. Allowing multiple --export-id might be useful too.
There is a simple alternative, especially if you are running things from the command line.
Since SVG files are just XML, it's usually fairly simple to create XSLT to run over the SVG and tweak the specific results the way you need them.
So you start with a "source" SVG that has different items set with specific id's and/or on specific layers.
For each pass, use XSLT to create a temporary SVG with the items you want toggled visible or not.
Then take that temporary SVG and export to bitmap from that.
Eventually it might be handy to add some such batch export support to Inkscape, but it is very much within the realm of common command-line work.
Since I've been using the DBUS interfare for similar things I'd like to suggest that approach.
Doesn't it require a running inkscape instance (possibly requiring a X connection itself)?
Thibaut Girka <thib@...2636...> writes:
Le vendredi 17 juin 2011 à 08:20 +0200, joakim@...1974... a écrit :
Jon Cruz <jon@...18...> writes:
On Jun 16, 2011, at 10:31 AM, Thibaut Girka wrote:
Hi, I'm using inkscape for various projects, and I'm now concerned about automatically rendering graphics for my game project.
However, several images are rendered from the same SVG file, with different layers/objects visibles. While --export-id (and --export-id-only) is helpful in some cases, it's not always sufficient.
Therefore, I think hiding certain objects with a new command-line option such as --hide-id would be a worthy improvement. Allowing multiple --export-id might be useful too.
There is a simple alternative, especially if you are running things from the command line.
Since SVG files are just XML, it's usually fairly simple to create XSLT to run over the SVG and tweak the specific results the way you need them.
So you start with a "source" SVG that has different items set with specific id's and/or on specific layers.
For each pass, use XSLT to create a temporary SVG with the items you want toggled visible or not.
Then take that temporary SVG and export to bitmap from that.
Eventually it might be handy to add some such batch export support to Inkscape, but it is very much within the realm of common command-line work.
Since I've been using the DBUS interfare for similar things I'd like to suggest that approach.
Doesn't it require a running inkscape instance (possibly requiring a X connection itself)?
Yes. From my point of view theres no big difference. I haven't looked at what the Inkscape batch mode does to handle things in a headless way but that ought to be doable in a dbus scenario also. Also dbus creates an inkscape instance if needed so it wouldn't be so inconvenient.
A script could then maybe look like this in pseudo code:
DESKTOP=`inkscape --headless-dbus-server file.svg` dsend DESKTOP "hide rect-13131" dsend DESKTOP "save" dsend DESKTOP "close"
etc..
Some of this would need to be added to Inkscape but I'm currently adding functions to the Inkscape Dbus branch so if you need anything in that regard you can add tickets linked to the branch.
EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
participants (3)
-
unknown@example.com
-
Jon Cruz
-
Thibaut Girka