Recently I needed a way to rearrange the order of objects in Inkscape, but I found there was no way to achieve this. I did find that there is this extension called Restack (it’s a quite old web page and might not be up to date). For more details there’s also this.
Anyway, the problem is that this extension is used to arrange object order, but it doesn’t have an option for randomly arranging objects. Lucky it was written in Python so I didn’t have to learn much in terms of coding, I poke at it and voila, I modified it for my needs!
Fig. 01. New
Random entry in the
Restack Direction parameter menu
Random selected all other input parameters are ignored and the extension just randomly arranges the selected objects. And if you must really know why I made this… it’s because I needed a way to prototype a game idea I’m working on with someone. It’s a card game, we’re not living in the same country so it would be a bit cumbersome to do it with paper… plus I’m an adept of not killing trees if not necessary. So I thought about Inkscape as you can move things around, you can have a very simple design… but then I thought, how could I simulate shuffling the deck of cards?! Well that’s when I found about the Restack extension and so I immediately modified it to my needs.
You need to extract the files (just the files
restack2.py, without any folder structure) and place them in
inkscape/extensions folder. I don’t know where this folder is on Windows, but on Linux machines it can be found in
So there you have it, enjoy a bit of randomness in Inkscape :).