Inkscape.org
Creating New Extensions Objects To New Layer
  1. #1
    inklinea inklinea @inklinea⛰️

    https://gitlab.com/inklinea/objects-to-new-layer

    Objects To New Layer - An Inkscape Extension

    Inkscape 1.1 +

    ▶ Creates a new layer and copies or transfers the selected objects to that layer

    ▶ Appears in 'Extensions>Arrange'

    ▶ A shortcut can be used to org.inkscape.inklinea.objects_to_new_layer.noprefs

  2. #2
    inklinea inklinea @inklinea⛰️

    I've updated the extension.

    It now allows for objects to be copied/transferred to their own individual new layers.

    It also corrects for preexisting layer transforms in 3rd party svgs.

    https://inkscape.org/~inklinea/%E2%98%85objects-to-new-layer

     

    Screenshot From 2022 02 10 22 13 52
  3. #3
    inklinea inklinea @inklinea⛰️
    🔥

    06.10.22
    -----------------------------
    Added z-order pasting sequence support.
    This allows the objects currently selected to be pasted according
    to a sequence you choose. For example if you have 3 objects selected:
    Typing 1,1,1,2,2,3 would paste 3*object 1, 2*object 2 and 1*object 3 in that z-order.

  4. #4
    inklinea inklinea @inklinea⛰️

    After being asked a question in this thread : https://inkscape.org/forums/extensions/layer-management-advanced/

    It's a question about shortening the travel path of a machine between sewing operations.

    Is it possible to move paths to layers - and have those layers stacked in an order of your choice ? 

    So for example - can you shift click select 10 paths, and move them each to a new layer, and those layers in the order ( or reverse order )  that you shift click selected ? 

    Also, can you have Inkscape autoroute the shortest path between all path objects, or selected object and optionally create a layer stack ? 

    I used https://github.com/fillipe-gsm/python-tsp 

    Should work on windows and ubuntu - Inkscape 1.2+

    I have made a new branch to this extension for testing purposes, you will have to delete the old extension if you have it installed.

    https://gitlab.com/inklinea/objects-to-new-layer/-/tree/tsp

    The extension also adds Inkscape flowchart connects between paths if you want.

    I've had to compromise to route between bounding box midpoints or endpoints or startpoints. In the real world routing should be from endpoint to startpoint - but I haven't worked that out yet.

    ** Please note it only works on paths at the moment - I may add shapes and text later - will fail on shapes.

     

     

    Tsp Route
  5. #5
    Windell Oskay Windell Oskay @oskay

    Does your extension preserve the existing Z order when moving each object to its own layer, if it does not start with any objects selected?

  6. #6
    inklinea inklinea @inklinea⛰️

    That's a good point Windell. :)

    For the original basic functionality of the extension (the settings page), then no. It just creates a list of new layers containing the object.

    It does seem like a better idea to have the option to encapsulate object in situ in a new layer.

    For the Layer Stack page, then if nothing is selected, and you have chosen 'create layer stack'  it will z-order according to either the TSP order - or the selected order. 

    I'm updating the extension - to combine it with the other layer extensions I have - export / combinations / move etc 

    Any suggestions I will incorporate before putting in the main branch.

  7. #7
    Windell Oskay Windell Oskay @oskay

    I have written several extensions that manage Z-ordering from a TSP perspective. Moving individual objects to TSP-ordered layers seems like a really useful process. 

  8. #8
    inklinea inklinea @inklinea⛰️

    Wow - I didn't even know they existed I should probably have known about them ! - maybe they could be added to the Inkscape connector tool in the gui !

    I do think to make it useful for machines - it has to be TSP with Tunnels.

    End Point to Start point. So the thread on the back of the material is minimised :)

  9. #9
    Windell Oskay Windell Oskay @oskay

    There are additional "layers" to the problem, so to speak. For some applications it's acceptable to reverse paths to minimize travel distance, and for others it is not.

    If you're restricting the extension to work with only paths (or doing the work of converting elements to paths), then for closed shapes (including circles), there's also the question of where to define the start point. It could be defined consistently (which gives an artifact when working with repeated similar shapes), randomized (to hide the emergent artifacts), or chosen to minimize "tunnel" travel distance.

    In the context of pen plotters and CNC machines, that tunnel distance is called "pen up" or "rapid" travel, and still needs to be be minimized.

  10. #10
    inklinea inklinea @inklinea⛰️

    Yes I never thought of that. I suppose in industry - efficient tool travel can be big money. 

    I will continue working - hopefully will be able to upload more layer functions soon :)

  11. #11
    arthur gonce arthur gonce @Toryar1

    Thanks :) it's really helpful

  12. #12
    NM91 NM91 @NM91

    Hi! I installed the extension. But I cannot click "Objects to New Layer..." button under Extensions>Arrange>Objects to New Layer>Objects to New Layers. It is somewhat disabled. I already selected like 3-4 objects and it is still disabled?

  13. #13
    inklinea inklinea @inklinea⛰️

    The usual cause for entries to be 'ghosted' in the extension menu:

    The .inx file cannot find the .py file.

    Is the .py file in the same folder as the .inx

    And, - which version did you install , was it the basic version or the gitlab tsp version ?