Inkscape Community
Help Using Inkscape => Inkscape Beginners' Questions => Topic started by: Colear on November 27, 2016, 12:23:06 PM
-
Hi,
I have an Inkscape file with a lot of layers, which contains all the part possibles for the body of a game sprite.
I have made a bash script who made a request to inkscape (inkscape -S <myFile>), select in the result all the lines begining by 'Layer' and then made for each another request for exporting this layer.
At first it's work fine, and i use this script lot of time for lots of sprite.
But today I've made heavy modifications on my svg files, and added lots of layers. And the script dont work anymore. I've found the reason : all my new layers don't have an id like "Layer<Number>", but instead of an id like "g<number>" (like all others groups).
Have you an idea of why my layers stop to be called with id "Layer<number>" ?
Thank you
-
Welcome to the forum!
I'm not sure what might have happened.
Actually, there is no such SVG standard as "layer". So Inkscape creates layers by using special groups. The "g" means "group".
Can you share either that SVG file, or some similar SVG file which shows the problem?
-
My suggestion would be to not go by id or name at all, but by
inkscape:groupmode="layer"
This is specific to layers, while names, ids, labels can all change.