Fwd: Automatically set Z-order
Woo-Hoo
Thanks to Kurt I was able to pull together an extension. It is ungainly slow because of the whole "calling another instance of Inkscape" deal , but it does work. This provides an option of restacking the selected objects in a direction (left to right, right to left, top to bottom, or bottom to top) as well as the point of each object to compare (top left, bottom middle, etc).
Attached are before and after samples, as well as the extension. It registers as "Effects->Modify Path->Restack"
I am running on Inkscape 0.46dev+devel, built Apr 28 2007, so ymmv if running .45
-Rob A>
Very cool, you demonstration's a good one but I suspect there are all sorts of other applications for such a tool. I have a making-slides-in-inkscape program that also creeps along because of invoking inkscape many times to get positions of things... on my todo list is a patch to add a switch for inkscape to dump x,y,w,h for everything - hopefully that would help you too?
Cheers -Terry
On Thu, 29 Nov 2007 11:23:42 -0500 "Rob Antonishen" <rob.antonishen@...155...> wrote:
Woo-Hoo
Thanks to Kurt I was able to pull together an extension. It is ungainly slow because of the whole "calling another instance of Inkscape" deal , but it does work. This provides an option of restacking the selected objects in a direction (left to right, right to left, top to bottom, or bottom to top) as well as the point of each object to compare (top left, bottom middle, etc).
Attached are before and after samples, as well as the extension. It registers as "Effects->Modify Path->Restack"
I am running on Inkscape 0.46dev+devel, built Apr 28 2007, so ymmv if running .45
-Rob A>
On Nov 29, 2007 11:44 AM, Terry Brown <terry_n_brown@...12...> wrote:
Very cool, you demonstration's a good one but I suspect there are all sorts of other applications for such a tool. I have a making-slides-in-inkscape program that also creeps along because of invoking inkscape many times to get positions of things... on my todo list is a patch to add a switch for inkscape to dump x,y,w,h for everything - hopefully that would help you too?
Excellent! Terry, do you think you can do this before 0.46? Looks like the lack of this prevents a lot of nice extension from appearing, so the earlier we fix this the better.
It would speed things up, for sure. The code currently iterated through every item in the selections, calling inkscape once to get this information then parsing through it to extract the selected nodes would be great.
Even better would be if the x,y,w,h could be exposed via DOM so that no shell out to inkscape would be required.
Also, I think this extension should work in .45 if the optiongroup was not used... say a number choice 1-4 for the direction and 1-9 for the anchor. But that is ugly :)
-Rob A>
On Nov 29, 2007 11:44 AM, Terry Brown <terry_n_brown@...12...> wrote:
Very cool, you demonstration's a good one but I suspect there are all sorts of other applications for such a tool. I have a making-slides-in-inkscape program that also creeps along because of invoking inkscape many times to get positions of things... on my todo list is a patch to add a switch for inkscape to dump x,y,w,h for everything - hopefully that would help you too?
Cheers -Terry
Just an update, to work with the lxml parser (in the current development version) the extension has changed . I have attached the new file (no changes to the .inx)
-Rob A>
On Jan 9, 2008 11:52 AM, Rob Antonishen <rob.antonishen@...155...> wrote:
Just an update, to work with the lxml parser (in the current development version) the extension has changed . I have attached the new file (no changes to the .inx)
Thanks, so has anyone tested it? Is it good for including into the distribution?
On Jan 9, 2008 11:52 AM, Rob Antonishen <rob.antonishen@...155...> wrote:
Just an update, to work with the lxml parser (in the current development version) the extension has changed . I have attached the new file (no changes to the .inx)
-Rob A>
Sorry I never replied. I didn't notice the first two messages you sent. Good to see you got it figured out.
Also note that this fixed bug: https://bugs.launchpad.net/inkscape/+bug/174701
added a new command line switch to get all four important aspects of an object at once (x, y, width, height), instead of having to query each one separately. By rewriting to use that switch, it should make the script about 4 times as fast. Unfortunately, I don't have a development version to test how to make it work correctly, so I don't have any rewriting tips.
On Jan 9, 2008 1:49 PM, Kurt Hutchinson wrote:
Also note that this fixed bug: https://bugs.launchpad.net/inkscape/+bug/174701
added a new command line switch to get all four important aspects of an object at once (x, y, width, height), instead of having to query each one separately. By rewriting to use that switch, it should make the script about 4 times as fast. Unfortunately, I don't have a development version to test how to make it work correctly, so I don't have any rewriting tips.
"This patch adds the command line switch --query-all which dumps id,x,y,w,h for all objects with an Id."
I'm thinking this will return a list of every ID's item in the svg file, so I would have to parse out the x,y,height and width of the objects in the selected group from the list of all objects.
-Rob A>
On Jan 9, 2008 2:52 PM, Rob Antonishen <rob.antonishen@...155...> wrote:
"This patch adds the command line switch --query-all which dumps id,x,y,w,h for all objects with an Id."
I'm thinking this will return a list of every ID's item in the svg file, so I would have to parse out the x,y,height and width of the objects in the selected group from the list of all objects.
-Rob A>
Ah, could be. I should have read the patch notes closer.
Thanks Kurt-
Attached is the updated extension that used the --querry-all command line switched introduced here: https://bugs.launchpad.net/inkscape/+bug/174701
This only works for the latest development versions...
-Rob A>
I have updated the restack z-order extension with three more options: specifying an arbitrary angle (rather than the four orthogonal choices), radial inward, and radial outward.
A zip of the extension and sample images are attached to the wishlist bug I created at launchpad. This needs a recent .46 devel versionof inkscape as it relies on a couple of features only in devel.
https://bugs.launchpad.net/inkscape/+bug/182002
-Rob A>
Rob Antonishen wrote the following on 11/29/2007 11:23 AM:
Woo-Hoo
Thanks to Kurt I was able to pull together an extension. It is ungainly slow because of the whole "calling another instance of Inkscape" deal , but it does work. This provides an option of restacking the selected objects in a direction (left to right, right to left, top to bottom, or bottom to top) as well as the point of each object to compare (top left, bottom middle, etc).
Attached are before and after samples, as well as the extension. It registers as "Effects->Modify Path->Restack"
I am running on Inkscape 0.46dev+devel, built Apr 28 2007, so ymmv if running .45
-Rob A>
Hey, congratulations. That could be a handy plug-in.
heathenx
participants (5)
-
bulia byak
-
heathenx
-
Kurt Hutchinson
-
Rob Antonishen
-
Terry Brown