make a sublayer into a regular layer?

Post questions on how to use or achieve an effect in Inkscape.
User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

make a sublayer into a regular layer?

Postby brynn » Sun Jan 22, 2012 1:12 pm

Hi Friends,
I'm working on a really complex image, with many layers and sublayers. Now rather late in the game, I realize one of my sublayers might need to be a regular (parent?) layer. I can't seem to find any way to move it out of its "parent" layer. I've tried duplicating the layer, but the duplicate is still a sublayer. It has at least 10 to 15 objects in it.

Would it work to select everything in the layer, copy, and paste in place, except in a new regular layer? And later delete the original layer; or cut/paste? I know that funky things can happen with copying/pasting and layers -- such as copying several objects which span 2 or more layers and pasting. Then all the layers are pasted as one layer. But I think I should be ok copying all the objects in the layer, and pasting into a new one.

I've been trying to think of layers as groups, but I don't think it has any application to this problem. And I'm sure this could also be done in the XML Editor. I try to avoid using it unless it's absolutely necessary. But in this case, maybe it's just a case of deleting a word or 2.....or, well no, maybe it would need to be unindented....??

I'll save a copy of the entire image, and also make a backup. Then I'll try the copy/paste and report back. I wouldn't even post this as a problem needing help, except that I think it's an interesting question which I haven't seen addressed here, and someone else might need the answer someday.

And also I wonder, how hard would it be to put an option into the layer context menu, to make a sublayer a regular (I'm not sure if "parent layer" is the proper term?) layer? Is it just not possible, and that's why there is no such option? Or is it a difficult coding task?

I'll report back my results. But any comments are welcome. All best :D

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: make a sublayer into a regular layer?

Postby ~suv » Sun Jan 22, 2012 7:13 pm

Inkscape's GUI for managing sublayers is minimal at the moment: you can add them, but not change the level (with regard to the parent layer). Yes, it's known that these features are missing ;)

To make a sub-layer a top-level layer, use 'Edit > XML Editor…':
  1. open 'Edit > XML Editor'
  2. expand the layer in the list on the left to be able to select the sublayer group
    (in the screenshot: "<svg:g id="layer2" inkscape:label="SubL(…)")
  3. click on the '<' button in the toolbar at the top to un-indent the selected node
  4. close the XML Editor
  5. Important: deselect the current selection (using e.g. the keyboard shortcut <esc>)
  6. select the current layer to work on in the 'Layers…' dialog
unindent-layer-screenshot-1.png
unindent-layer-screenshot-1.png (127.62 KiB) Viewed 2809 times

Important: after closing the XML Editor, deselect everything (e.g. with <esc>) and choose a current layer in the 'Layers…' dialog.



Related blueprints and feature requests:

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: make a sublayer into a regular layer?

Postby brynn » Mon Jan 23, 2012 5:00 pm

Awesome, thanks ~suv!
I haven't even had a chance to try my solution yet. So I'm glad to learn how to do it from the XML Editor. I'll also be interested to read your helpful links :D


Return to “Help with using Inkscape”