Krita supports importing Inkscape files as long as they are saved as plain svg. The problem is that at the time of saving in this format, Inkscape group the shape... and this causes problems when I import in Krita.
Is there a way to prevent Inkscape from creating a group at save time? I looked for that option and couldn't find it...
Layers in Inkscape are special groups, so any artwork in layer 1 is in a group. It can be removed by selecting Layer 1 in the Layers and Objects dialog and ungrouping.
Layers are not part of the svg specification. They are a group with a special attribute which is read by inkscape to create the illusion of layers to the user.
So a layer is:
<g inkscape:groupmode="layer"> your content </g>
and a group is:
<g> your content </g>
It's a method of making the svg work with layers in Inkscape - but also work normally in other software such as browsers ( which ignore the extra attribute )
So if you begin by drawing on a layer - you are effectively already drawing in a group.
You can either - draw in the root svg only by deleting all layers then being drawing.
Or Edit>select all in all layers, Edit>cut, then delete all layers and paste back ( everything should be in the root then ). Of course this does not take account of sub layers or existing groups.
****
Or probably much better to File>Save a Copy - as plain svg.
Reopen that copy, Edit>Select all in all layers - then use Extension>Arrange>Deep Ungroup, then save.
• inklinea: Thanks! :) I tried deleting the layers as you suggested...and it worked. I'll describe what I did, so anyone who has the same problem will know how to solve it:
==> If you are creating a new file:
a) Before drawing, go to the layers docker, right-click the layer and choose "delete layer".
b) Create the path. If you created a polygon it must be converted to path. Make sure there is no group.
c) Select the path and go to Edit > Resize Page to selection;
d) Finally, go to File>Save as... and save the file as Plain SVG. If you close Inkscape, the program will warn you that the file has not been saved. Then it's your choice: if you want, save as a normal svg, (in another location or with another name) or close without saving.
==> If you already have a file, it's probably in Inkscape's common svg format. Make a backup of it, just in case, before proceeding.
a) Check and make the necessary corrections in the path. If you created a polygon it must be converted to path. Make sure there is no group. The entire path must be on one layer;
b) Select the entire path and go to Edit > Cut;
c) In the layers docker, right-click the layer and choose "delete layer";
d) Go to Edit > Paste in Place: the path will be pasted, it seems that nothing has changed... but it is no longer in any layer;
e) File>Save as... save the file as Plain SVG. When closing Inkscape, the program will warn that the file has not been saved. Choose what to do, as in the previous case.
Krita supports importing Inkscape files as long as they are saved as plain svg. The problem is that at the time of saving in this format, Inkscape group the shape... and this causes problems when I import in Krita.
Is there a way to prevent Inkscape from creating a group at save time? I looked for that option and couldn't find it...
Layers in Inkscape are special groups, so any artwork in layer 1 is in a group. It can be removed by selecting Layer 1 in the Layers and Objects dialog and ungrouping.
Yes I did... but is there any setting to prevent Inkscape from wrapping the path (at least in Plain SVG)?
I still don't understand why the program does this, because it's a closed path, not a set of paths...
As mentioned by Tyler:
Layers are not part of the svg specification. They are a group with a special attribute which is read by inkscape to create the illusion of layers to the user.
So a layer is:
<g inkscape:groupmode="layer">
your content</g>
and a group is:
<g>
your content</g>
It's a method of making the svg work with layers in Inkscape - but also work normally in other software such as browsers ( which ignore the extra attribute )
So if you begin by drawing on a layer - you are effectively already drawing in a group.
You can either - draw in the root svg only by deleting all layers then being drawing.
Or Edit>select all in all layers, Edit>cut, then delete all layers and paste back ( everything should be in the root then ). Of course this does not take account of sub layers or existing groups.
****
Or probably much better to File>Save a Copy - as plain svg.
Reopen that copy, Edit>Select all in all layers - then use Extension>Arrange>Deep Ungroup, then save.
Just don't save over the original of course :)
• inklinea: Thanks! :) I tried deleting the layers as you suggested...and it worked. I'll describe what I did, so anyone who has the same problem will know how to solve it:
==> If you are creating a new file:
a) Before drawing, go to the layers docker, right-click the layer and choose "delete layer".
b) Create the path. If you created a polygon it must be converted to path. Make sure there is no group.
c) Select the path and go to Edit > Resize Page to selection;
d) Finally, go to File>Save as... and save the file as Plain SVG. If you close Inkscape, the program will warn you that the file has not been saved. Then it's your choice: if you want, save as a normal svg, (in another location or with another name) or close without saving.
==> If you already have a file, it's probably in Inkscape's common svg format. Make a backup of it, just in case, before proceeding.
a) Check and make the necessary corrections in the path. If you created a polygon it must be converted to path. Make sure there is no group. The entire path must be on one layer;
b) Select the entire path and go to Edit > Cut;
c) In the layers docker, right-click the layer and choose "delete layer";
d) Go to Edit > Paste in Place: the path will be pasted, it seems that nothing has changed... but it is no longer in any layer;
e) File>Save as... save the file as Plain SVG. When closing Inkscape, the program will warn that the file has not been saved. Choose what to do, as in the previous case.