Inkscape.org
Beyond the Basics Move Layer into other Layer
  1. #1
    wieke wieke @wieke
    *

    I often want to change my layer structure when I am working in Inkscape. Of course it is easy to move a layer up or down within its parent, but it would be nice to be able to move it into another layer.

    If I want to do that (for instance layer 1 is a child of layer A and I want to make it a child of layer B) I change layer 1 into a group, then right-click on it in the layers pane and choose Move to Layer and move the group into layer B. Then I change the group back into a Layer. 

    It works, but it seems to be a detour. Is there a better way to do this?

  2. #2
    Marcos González Marcos González @mrks9

    Hi. Simply grab the layer and drag it to another layer of your choice.

  3. #3
    wieke wieke @wieke

    Yes, that is what I do if the layer structure is simpel. But if it is (very) complicated the result can be rather unpredictable.  

  4. #4
    Paddy_CAD Paddy_CAD @Paddy_CAD

    Possible workflow: In the Layers and Objects dialog [right_click > Move to Layer...] and select the new parent layer.

  5. #5
    wieke wieke @wieke
    *

    No, that works for groups and all other objects, but not for layers. If you right click on a layer there is no option Move to layer.

    That is why I change the layer into a group, than move it and than change it back to layer.

  6. #6
    Paddy_CAD Paddy_CAD @Paddy_CAD

    You're right. My mistake. I have no better suggestions.

  7. #7
    inklinea inklinea @inklinea⛰️

    Are you on Windows / Linux ? and Which version of Inkscape ? 

  8. #8
    wieke wieke @wieke

    I am on Windows, version 1.2

  9. #9
    inklinea inklinea @inklinea⛰️

    My attempt at a workaround, however not sure it saves that much time.

    Seems to work fine, however be careful before saving over your finest artwork :)

    https://gitlab.com/inklinea/move-layer

  10. #10
    wieke wieke @wieke
    *

    Hello Inklinea, Yes It works!  But every time I move a layer I get the message:

    <frozen importlib._bootstrap>:671: ImportWarning: DynamicImporter.exec_module() not found; falling back to load_module()
     

  11. #11
    inklinea inklinea @inklinea⛰️

    Yes that is an error msg which pops up with gtk3 windows at the moment.

    It also affects the extension manager and the Import Web Image extension

    I've asked if there is a way to suppress it.

  12. #12
    wieke wieke @wieke
    *

    Hello Inklinea, thank you for your effords. 
    Yesterday I only tried it in a small test file.

    Just now I tried it in one of my large files, and there is another problem.

    If you right click on a group and choose Move to Layer you choose your layer in a window that has the same structure as the Layers panel in Inkscape.You can fold out the tree you need. It is small when it pops up, but you can make it larger.

    In your extension you get a list of all layers.

    In my file there are so many layers that only a small part of them fit on my screen. I cannot scroll the list so I cannot choose the one I want.

  13. #13
    inklinea inklinea @inklinea⛰️

    I've updated it to allow scrolling.

    Also if you start typing after clicking on the scroll window, it should scroll to matches.

    I've also made the window bigger by default.

    If you want to make it a different size - It is not dynamic - however if you want to make permanently a different size:

    # Values below can be changed to change size of scrolled layer window
    min_content_width = 300
    min_content_height = 300

    The error message however - is not fixable at the moment for Gtk3 extensions.

     

    Move To Layer
  14. #14
    wieke wieke @wieke

    Thank you very much! This works fine and it is faster than what I used to do. Typing some letters works very good!

    .

  15. #15
    inklinea inklinea @inklinea⛰️

    ....and thanks to some help from doctormo :)

    The error message, should now be gone too !  I've had problems with that error for a while - now it is solved :)

    I've updated if you want to install again.

  16. #16
    wieke wieke @wieke
    *

    Yes, the error message has disappeared!

    But now I tried to really use it I have another problem I didn't see before..

    I make city maps for a series of cyclist routes. I use the program Maperitive (from http://maperitive.net/) to make the map. It makes an Inkscape file with very many layers. .
    From that file I use just a part (for instance roads, buildings, rivers , railways), but I throw away texts (names of streets, places..) and icons
    On top of this reduced map I put selected information for the cyclists.I made an Inkscape file with a set of layers and other elements for the information (icons, styles etc) 

    I import that file into the map from Maperitive.

    To get the finale layers structure I have to move some layers from the Maperitive structure to the imported structure.and other layers the other way.

    But if I do that with the extension from the Maperitive to the imported layers all the objects in the moved layers become much smaller than they were!
    That doesn't happen if I move from my structure to another layer within my structure, and neither when I move within the Inkscape structure. When I move from the imported structure to the Maperitive structure the objects become larger.

     

     

  17. #17
    inklinea inklinea @inklinea⛰️

    There's a couple of things at work here 

    1. Moving objects / layers to other layers in which the parent layer has a transform on it.

    This is commonly the case, if you use Edit>Resize Page to Selection any existing layers at that point end up with transforms on them. Which is quite a frustration :)

    New layers created after the page resize do not however. It seems Inkscape does take account of this when moving objects between layers - so I  will have to have a look at that.

    My extension does not take account of parent layer transforms etc

    2. The size / transforms on the layers of the imported document

    hmm well to match the size you do a Edit>Paste Width or height -- from another object - which could be a rectangle the same size as the page, or a group of objects. You have to have the padlock clicked on the select tool command bar for it to be in proportion.

     

    Things for me to look at - I'll update if I manage to fix it.

  18. #18
    wieke wieke @wieke
    *

    I never used Edit>Resize Page to Selection not in my map nor when I made the imported file, So if that is in the file I am working in it must come from the file made by Maperitive, I do use: File – Document Properties select the Mapframe and resize to content, but only after I changed the layer structure.

    So if that is in the file it must come from Maperitive

    Would it help you if I send you a Maperitive file?

  19. #19
    inklinea inklinea @inklinea⛰️

    Yes, I can have a look at it. 

    Whether I can solve it is another question :)

  20. #20
    wieke wieke @wieke
    *

    I made very small map with very few items on it,in order do reduce the size of the file to send you..
    But how can I send it to you?

    I could put it on wetransfer and give you the link, is that ok?

    Here is the link: https://we.tl/t-Ixo5oR27ba

  21. #21
    inklinea inklinea @inklinea⛰️

    I've had a look, it's related to a transform matrix on the group which contains the layers when the svg is imported. 

    I will look at fixing it and also for the fact that the target layer might have a transform too 

  22. #22
    wieke wieke @wieke

    I have seen that when I import the file there is a group that contains the layers. The first thing I do after draging the objects in the file to their place is ungroup that group..

    I send you the file as it is just before I start moving the layers.

    Here is the link: https://we.tl/t-zvH3nUT5RY

  23. #23
    inklinea inklinea @inklinea⛰️

    It's still something that needs to be accounted for. 

    Otherwise you have to pre edit every single file etc - and it is difficult.

    I've written 5 different layer type extensions now - they all do different things. I really need to combine them into one extension.

  24. #24
    inklinea inklinea @inklinea⛰️
    *

    If you update, it should mostly be fixed for transforms now. 

    [ hmm still a couple of errors on transformed target layers - but I will solve it eventually ]

  25. #25
    wieke wieke @wieke

    Hello Inklinea,

    I just started a new city map and used your extension. For me it is perfect now.  Very nice, thank you!