← All ideas
  • Published 16 Apr 2021

Export Grease Pencil into SVG with layers

Hi dear developers, I have simple request for the next release if that is possible, the latest feature in the upcoming Blender 2.93 LTS is a fantastic new feature that make possible many things, and I've thought if you can add the support for the layer system inside SVG file format that is already supported by Inskape and I think is also a easy to implement for the GPLayer as an SVG layer . I attached a simple code of an svg file with two layers and two rectangles.

Thanks :)

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   width="210mm"
   height="297mm"
   viewBox="0 0 210 297"
   version="1.1"
   id="svg8"
   inkscape:version="1.0.2 (1.0.2+r75+1)"
   sodipodi:docname="Layer.svg">
  <defs
     id="defs2" />
  <sodipodi:namedview
     id="base"
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1.0"
     inkscape:pageopacity="0.0"
     inkscape:pageshadow="2"
     inkscape:zoom="0.7"
     inkscape:cx="423.99899"
     inkscape:cy="407.48147"
     inkscape:document-units="mm"
     inkscape:current-layer="layer1"
     inkscape:document-rotation="0"
     showgrid="false"
     inkscape:window-width="1366"
     inkscape:window-height="744"
     inkscape:window-x="0"
     inkscape:window-y="0"
     inkscape:window-maximized="1" />
  <metadata
     id="metadata5">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title></dc:title>
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     inkscape:label="Layer 1"
     inkscape:groupmode="layer"
     id="layer1"
     style="display:inline">
    <rect
       style="opacity:0.274;fill:#000000;stroke:#000000;stroke-width:0.35269;stroke-linecap:round;stroke-linejoin:round"
       id="rect834"
       width="103.89316"
       height="88.957771"
       x="50.997074"
       y="45.206497" />
  </g>
  <g
     inkscape:groupmode="layer"
     id="layer2"
     inkscape:label="Layer 2">
    <rect
       style="opacity:0.274;fill:#ff0000;fill-opacity:1;stroke:#000000;stroke-width:0.353;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none"
       id="rect836"
       width="85.004227"
       height="80.368904"
       x="80.423386"
       y="23.232075" />
  </g>
</svg>

SVG_layers.png

100%

Development Status: Open

Upvote 17 Downvote 0
paolo.furani
16 Apr 2021

3 Comments

zeauron

Currently, it is supported by 2.93 alpha.

paolo.furani Author

* @Ronan Ducluzeau * I made a test with the today build and doesn't save any layer from the export they are grouped objects but no layers info from Blender Grease pencil layers, in this test I have in Blender two line art with different occlusions and each with own layer the Visible lines are in the GP Layer Visible and for the hidden with different occlusions are in the layer Hidden and the exported file as you can see from the image has no layers.

{attachment PBR_no_layerpng}

zeauron

* @Paolo Furani *
Sorry, I made a mistake. I confused Objects panel of Inkscape with Layers panel. I suppose that what is preventing to directly have Layers is the support of multiple GPobjects that could have layers with similar names.