Inkscape.org
Creating New Extensions Selection Plus
  1. #1
    inklinea inklinea @inklinea⛰️

    Hello Friends,

    I think this may be a first in the world of Inkscape extensions.

    [ unless there is someone secretly building them and not posting :) ]

    The ability for an extension to re-select objects.

    It's now possible,  thanks to the Inkscape developers rewriting 'dbus' actions for Inkscape 1.2+   ( it might require the latest 1.21 on windows ? ) 

    I've uploaded a simple proof of concept extension here:

    https://gitlab.com/inklinea/selection-plus

    This is just to test if it works across Windows and Ubuntu machines - before I put anymore work in.

    I have added a 'selection delay' value box - set at 0.5 seconds, if you have no problems you should be able to reduced this to 0.2  or even 0.1 seconds.

    The selection options at the moment are quite simple - if it all works I will add lots more options.

    Appears under Extensions>Arrange>Selection Plus

     

     

     

     

  2. #2
    Hum Hum @Hum

    Thank you, Inklinea.

    I will test this later today on my Windows 10 computer and report back.

    More importantly, thank you sincerely for this and all the other work you do. You enrich us with your heart, your skills, and kindness.

  3. #3
    Hum Hum @Hum
    *

    Hi. I have Windows 10 and version 1.21 installed (since it was first released months ago.)

    I tested your extension and unfortunately, it does not seem to work. Perhaps my expectations are wrong. So, please correct me if I am wrong or using the wrong approach.

    I hane created both a circle and a rectangle, then duplicated them and on the duplicates only, converted each one to a path.

    Yet, no make what option I select from your pop up panel - be it a path, or a circle or a rectangle when applying the extension, none of the objects are selected.

    Just so you know, I created all above objects as strokes only, no fills used. I do not think that should matter.

    Before I used your extension, no objects were selected. I even tried it by first selecting one or more obiects, and then running your extension. But the results were the same. Nothing selected by running this extenzion.

    All the files you shared in your zip file were first unzipped and the resulting files placed into the proper folder.

    No errors nor warnings are generated.

    I thank you for many of your previous extensions, which work wonderfully and benefit me.

    I hope my feedback will help. And I welcome any correction in my process and  my expectations.

    Thank you truly, Inklinea

  4. #4
    inklinea inklinea @inklinea⛰️

    Hello Ken, 

    Thanks for you reply and kind words as always :) and many thanks for the testing.

    That's the nature of writing extensions of this type - sometimes they fail ! 

    It's what happens when you move away from being 100% a user to trying to write code.

    There are 3 possibilities why it might not have worked:

    1. The code doesn't work reliably full stop, which is more than possible

    2. I set the Inkscape python path to be 

    'c:/program files/inkscape/bin/python.exe' 
    

    Which is fairly standard, but not always the case if you have installed elsehwhere

    3. There was for a short time a problem *just on windows release* of Inkscape.

     I think it was the very first release of 1.2.1, which had a bug in some things related to gi / gtk3 / etc It was fixed quickly and another 1.2.1 released. It affected some extensions.

     

    However - there is a merge request - put in by a developer yesterday ! to add passback selection for objects and nodes ! there is a possibility it may make it in 1.3, but it's all subject to being reviewed etc.

     

  5. #5
    Hum Hum @Hum
    *

    Thank you so much for responding. You are innovative, creative, and a real champion in helping folks ... us Inkscapers and others. Even the manner of your reply has lifted me up this morning. Keep exploring and bringing out the good and the great, for that is who you are! Enjoy a marvelous day! 

  6. #6
    Tyler Durden Tyler Durden @TylerDurden

    Windows 8.1, Inkscape 1.2.1 (9c6d41e410, 2022-07-14)

     

    👏

  7. #7
    inklinea inklinea @inklinea⛰️

    Well, I am pleased it worked for you Tyler. 

    Sorry it didn't work on Kens :( - but I will keep looking at it.

    I think maybe I need to add something to be able to change the path for Inkscape python - so that it works if the standard install location has not be used.

    Selection passback can be sent to any list of ids - so I lots of options to make that list. 

  8. #8
    Hum Hum @Hum
    *

    I am very glad that Tyler shows this workibg on his system.

    Based on what you shared, Inklinea, I did see that my path does differ from the one in your selection_plus.inx file. So, I backed up that original file and changed the path in the inx file to match mine. And placed the modified inx file into the proper folder. Then, I fired up Inkscape 1.21 again but still no change. For me, this extension initates fine, including the pop-up panel with the various options, but nothing appears selected, neither in the preview nor in the Apply result.

    No worries. It could very well be because of my unique set up (in a different file location).

  9. #9
    inklinea inklinea @inklinea⛰️

    I've made a slight change to the extension.

    It should be able to autodetect the python path on windows now. 

    Hopefully.

  10. #10
    Hum Hum @Hum
    😀

    Wonderful work, Inklines. This works great on my Windows setup. Thank you.

    Question  - I did not try this but = could one be allowed to tab through from one selection to another? For example, after your extension zelectd all the rectangles, could I press the Tab key to select the next rectangle seen? Or if there 5 ellipses, after being selected, could "tab key" from one ellipse to another?

    If not,  o not freet about this request or idea. You have made this extension a success!!

     

  11. #11
    inklinea inklinea @inklinea⛰️

    Thanks Ken, at the moment - just a proof that the selection passback works.

    User Kaalleen, showed me how to find the python executable being used to launch the extension system on windows. So if you have installed to G:\my custom folder\on my drive\Inkscape it can still be found :)

    Now that I know it works a lot more options are available - including custom selection lists / navigation - :)

    Thanks for testing 

  12. #12
    inklinea inklinea @inklinea⛰️

    I've made an update to include:

    - selection by bounding box ( width / height / diagonal / area / width-height ratio / height-width ratio )

    - basic xpath selection : https://en.wikipedia.org/wiki/XPath

    Does not work with text at the moment - will add that later.

     

    Screenshot From 2023 02 25 17 14 09
    Screenshot From 2023 02 25 17 14 01
  13. #13
    inklinea inklinea @inklinea⛰️

    I've made an update, now includes:

    - Xpath selection

    - Path lengths / node count / path area

    - Bounding box ( width / height / diagonal / area / width-height ratio / height-width ratio )  * does not include text at the moment.

    - Some selection order sorting for the above

    - Colour selection - ( limit / range / distance )

     

     I've uploaded the new version to this branch - https://gitlab.com/inklinea/selection-plus/-/tree/210323

     

  14. #14
    inklinea inklinea @inklinea⛰️

    I've posted a version here:

    https://inkscape.org/~inklinea/%E2%98%85selection-plus

    It now supports text.

  15. #15
    Hum Hum @Hum

    Another winning update. Thank you.

  16. #16
    inklinea inklinea @inklinea⛰️
    *

    Hopefully I can add this soon. ( Lasso Select like in gimp / photoshop )

    I will not work for text however unless I make it much more complex.

     

    Lasso Select
  17. #17
    inklinea inklinea @inklinea⛰️

    Another update, the extension does have 0.5 second delay built in to allow for dbus on windows.

     

    Lasso 270323
  18. #18
    inklinea inklinea @inklinea⛰️

    I've posted a standalone version of the Lasso Tool for testing here:

    Appears Under Extensions>Arrange>Ink Lasso

    https://gitlab.com/inklinea/ink-lasso/-/tree/030423

     

  19. #19
    inklinea inklinea @inklinea⛰️

    I've updated https://inkscape.org/~inklinea/%E2%98%85selection-plus

    to include the lasso tool, which appears under Extensions>Arrange>Ink Lasso 

  20. #20
    GwenaëlQ. GwenaëlQ. @GwenaëlQ.

    Hello Inklinea

    Thanks for your great work !

    Something that I would find very useful is a random selection mode. Let say user selects a layer or group and ask your extension to select randomly a given proportion of objects inside the group or layer...

    This would be very useful with great groups of hundreds/thousands of object !!

    Thanks for listening

     

     

     

  21. #21
    inklinea inklinea @inklinea⛰️

    Yes it can be done.

    However, I need to rewrite the extension first. There is still a problem on some machines. 

    Probably - a master random filter which either just grabs a weighted random or collects from the other page options - then applies the weighted random. 

    I will post an update here if I get around to it :)

     

  22. #22
    inklinea inklinea @inklinea⛰️
    *

    Okay.

    I think it's now working again on Inkscape 1.3 ( and 1.2 )

    I've uploaded a new branch yesterday 090524

    https://gitlab.com/inklinea/selection-plus/-/tree/090524

    If you delete the old version and try this one - should work on windows / linux

    If it does work - I will replace the main branch with this version.

    [ The Ink Lasso tool extension bundled with this should also be working ]

  23. #23
    inklinea inklinea @inklinea⛰️

    Well I've updated the main branch.

    Also uploaded to the main Inkscape extension gallery.

    The Ink Lasso tool is working as  well :)

  24. #24
    M Ꭰɪɴᴇsʜ M Ꭰɪɴᴇsʜ @ddineah0

    Add colour based selection 

  25. #25
    inklinea inklinea @inklinea⛰️

    Can you explain what you mean ? 

    There is colour based selection on the Colour Tab, or do you want something different ? 

     

     

    Screenshot From 2024 08 09 13 11 16