Allow copying of layers and sublayers

Bug #264912 reported by Mark Chernev
36
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Inkscape
Confirmed
Wishlist
Unassigned

Bug Description

Feature request: Allow copying of entire layers and sublayers from one Inkscape file to another (assuming both files are open in Inkscape at the same time).

Revision history for this message
prkos (prkos) wrote :

you mean when you select objects and copy them Inkscape should pick up layer info too and paste as a new layer(s) in the new document? What when you copy paste into the same document?

Changed in inkscape:
importance: Undecided → Wishlist
status: New → Incomplete
Revision history for this message
mahfiaz (mahfiaz) wrote :

I suspect the wanted feature is something to simplify the 2 first steps from following:
1. Open XML editor
2. Select layer group from there, <g:layer id="layer1"> for example
3. Copy
4. Paste

IMHO it would be really rare used feature and would only clutter up the useful UI space. If in Edit menu, you even wouldn't spare any mouseclicks. Only way to spare a click would be to have modifier for icons and/or for Ctrl+C shortcut.

Revision history for this message
Mark Chernev (mchernev) wrote :

prkos: No, I mean I'd like to be able to right click on a layer name in the Layers dialog and select "Copy" from the pop-up menu (alternatively, left clicking on the layer's name and hitting CONTROL-C should also work). Then I would switch to another file I have open in Inkscape, click on one of the layers in the Layers dialog and hit CONTROL-V to paste the layer I'd copied above (or below) the layer I had just left-clicked on.

Now, this copy/paste operation wouldn't just copy the objects from one the layer to another, but create a whole new layer in the destination file. This new layer should contain all of the objects and sublayers of the original layer.

If this operation was done all in the same file, then the behavior should be to create a new layer (above or below) the selected layer. If the original layer's name was "foo" the new layer name could be named "foo copy".

I hope this explanation is a bit clearer.

mahfiaz: I've never messed around with Inkscape's XML, so I couldn't say if the process you describe would achieve what I'm looking for. But, regardless, this kind of low-level file manipulation kind of defeats the purpose of using Inkscape at all. I'm sure everything Inkscape does could be done by manual low-level file manipulation, but the whole point of using Inkscape is that what the user is looking to achieve is streamlined and made much easier, quicker, and more intuitive via Inkscape's GUI. I don't think "go edit the XML" is the right answer to give to users when they ask for a new feature.

Now, as for "cluttering up the useful UI space", I don't think this feature needs clutter up the UI at all. You wouldn't even need to touch the Edit menu. The feature could be accessible by keyboard shortcut only (CONTROL-C and CONTROL-V) right after the user selects a layer by left-clicking on it in the Layers dialog. Also, adding "Copy" and "Paste" options to the layer's right-click menu wouldn't clutter it up at all since it only has four options right now (Rename, Add, Raise, and Lower Layer).

As to your claim that this feature would rarely be used, I don't see how you could possibly know that.

prkos (prkos)
Changed in inkscape:
status: Incomplete → Confirmed
Revision history for this message
Darren (5-admin-mattheson-net) wrote :

I think the importance of this should be higher than wishlist. I've been an amateur Illustrator user and the huge difference in using Inkscape was that I seemed to be working blind. In the end I think the difference came down to Illustrator automatically assigning a layer or visible title to each element that was drawn. I understand Layers to be an integral part of vector art and therefore the portability of these layers which have been produced in a deliberate heirachy should be more important than wishing it could remain intact when the component or stack of components is transferred. Adobe have an obscure option to retain the layer structure when copying. I don't know that that is so important, it should be by default.

jazzynico (jazzynico)
tags: added: clipboard layers
Revision history for this message
Elijah Lynn (elijah-lynn) wrote :

+1 to this. This has my vote too.

Revision history for this message
wadadliblue (wadadliblue) wrote :

I think Marks Idea of transplanting an entire layer to another open document is great. I'd personally be happy if I were to be able to select all from a particular layer including sublayers (the objects themselves in the layers) and then copy them to another layer in the same document. I would use this move objects between layers. For example when I start brainstorming a website then I realize everything is on one layer and I need to do the organization and grouping that I should done from the beginning (sloppy, I know). Problems with the current functionality though:

1)When you press ctrl-a objects in sublayers are not selected

2) You can't copy without changing focus from the layers window to the canvas by clicking on it, at which time selection will move to the layer the object you clicked on is in, which may not be the layer you want to select.

3) When objects are pasted they do not retain their original position.
My workaround for this is that I select all in the current layer with ctrl-a then group them, cut or copy then paste in the layer I want them to be in and then realign them using guides I placed previously (just realized I can set the x and y coordinates too!) and finally ungroup

I suggest maybe an option called "select all objects" in the layer right-click menu

I think it would be a great help to be able to move objects between layers and move entire layers between documents.

Thanks Mark for suggesting it and thanks to the Inscape team for continuing to make a great product

Revision history for this message
wadadliblue (wadadliblue) wrote :

Just realized my suggestion would also be very useful for nudging objects in different sublayers

Revision history for this message
pRototype (regeir) wrote :

I support this feature too.

However, it turns out that even if the layer structure is completely identical between two files, copying objects in multiple layers between them will still just paste all objects in the active layer. Bug #170526

Revision history for this message
sdaau (sd-imi) wrote :

Just wanted to say thanks to @mahfiaz for noting that it's possible to use the XML editor - worked for me in inkscape 0.48.1; note that with two open documents, there is still only one XML editor, which changes its contents depending on which document window has focus; only Ctrl-C does copying in XML editor, and there is no feedback - and finally the trickiest: when you paste the layer node in the target document, if you have nothing selected in the XML editor - or if you have the root selected, then nothing will be pasted in the target doc upon Ctrl-V! What one needs to do, is to select an actual group node before Ctrl-V pasting - while that may imply that the layer will be pasted as a child of the selected group node, it won't - it will be properly pasted as a child of root. Note also that upon successful paste, some sort of a transform is added to the pasted layer node - that can be just deleted as an attribute from the XML editor, and the layer will be shown as it was in the source document (provided source and target document are the same size)

Revision history for this message
Jonathan Brian Francoeur (goedible) wrote :

Yes, the feature Mark Chernev (mchernev) suggests would save me a lot of time. Thanks to the programers, I like inkscape.
I'm making solar maps, so I have a layer hiearchy that looks like this

Sun
-Winter Solstice
--9am
--12pm
--3pm
-Equinox
--9am
--12pm
--3pm
-Summer Solstice
--6am
--9am
--12pm
--3pm
--6pm

I'm creating about 20 templates that I will use for making solar maps from one 8"X11" page to 5X5 8"X11" pages.
If I could copy the first Layer "Sun" and paste it into each of my 20 templates it would save hours of work.
***It would only be 20 cut and paste opperations.
Currently I have to manually create each new layer and sub layer and then copy and paste the graphics from each layer and sub layer one at a time.
***This is like 300 cut and paste opperations plus the creation and typing of 300 layer names.

Revision history for this message
L-reimann (l-reimann) wrote :

+1

Revision history for this message
Geoff (geoffrogers42) wrote :

I couldn't agree more. The ability to duplicate layer structures is integral to my workflow as a graphic designer in Illustrator , and is one of the biggest hurdles to my complete transition to Inkscape. There are workarounds like editing with a text-editor, but making it a feature of the program would be so much simpler. Illustrator's implementation is very slick, you simply drag the layer you want to duplicate onto the "new layer" button. This, combined with the ability to drag layers around in the layers panel (and sublayers in and out of other layers) would make Inkscape 100% more useful in my opinion.

Revision history for this message
Timtro (timtro) wrote :

+1

Revision history for this message
Erik M (erik-martens) wrote :

Jessyink users, for instance, would also love this feature. I greatly miss the ability to copy paste layers into new documents.

Revision history for this message
Kevin Markwell (kevinmarkwell) wrote :

Even on 2017-06-05, I cannot find other pages about how to do this. Even Select All In All Layers does not have anything like a complementary Paste All In All Layers. But I've just discovered, in Inkscape 0.91, that the Import feature can be used as a workaround instead. It works for two separate SVG files, each with many layers and sub-layers.
If one file is LastPart.svg and the other is NearlyFinished.svg, first close LastPart.svg (to reduce memory use and confusion), open NearlyFinished.svg, choose File, then Import, then choose LastPart.svg. All of LastPart's layers should appear, although probably not in the same position on the original page, and LastPart's layer's names appear at the top of the Layers list. On my average PC, it took several seconds with a 34K LastPart.svg and 532K NearlyFinished.svg file. These layers can be dragged to re-arrange like others. This process can be undone and re-done. If instead you first select (highlight) one of the NearlyFinished layers in the list just before importing, all of LastPart's layers and sub-layers should load within that selected layer. The import allows multiple layers with the same name, as Inkscape does, which can get confusing. I'm only a beginner, and have not experimented much, but nodes, fills, opacities, names, and visibilities seem to be preserved.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.