Author Topic: Problem with layer id in command line  (Read 2334 times)

November 27, 2016, 12:23:06 PM
Read 2334 times

Colear

  • Newbie

  • Offline
  • *

  • 1
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

November 27, 2016, 09:02:42 PM
Reply #1

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
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?
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

November 28, 2016, 10:36:51 AM
Reply #2

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
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.