restack extension for Inkscape
Tue 25 October 2016 extensions inkscape python , 0 comments

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!

Inkscape Restack2 extension Fig. 01. New Random entry in the Restack Direction parameter menu

You can grab the version I’m using here. It has the highly original name of… Restack2… and includes a new option in the dropdown menu in Restack Dimension called… Random as can be seen in Fig. 01.

With 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.

installation

You need to extract the files (just the files restack2.inx & 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 $HOME/.config.

So there you have it, enjoy a bit of randomness in Inkscape :).

extension files

Get the zipped Restack2 extension and hopefully it will help you… maybe :)