On Thu, Aug 18, 2005 at 03:02:06PM -0700, Ted Gould wrote:
Karol Kreński wrote:
On Wed, Aug 17, 2005 at 08:06:02AM -0500, Aaron and Sarah Spike wrote:
Karol Kreński wrote:
I would like to try and write an extension in perl. I have never writen any plugin, but it looks possible for me to complete.
After a quick look at perl dropshadow plugin and SpSVG.pm, the only problem I seem to have is how I should ask inkscape to pass the coordinates of selected nodes. It will have to be passed to my script together with object id. Can anybody help?
Inkscape passes your script the SVG file and the ids of selected objects. So tthe coord of all points are available to you. There isn't any way to pass selected nodes yet. And I guess I personally don't think we should try to hammer something in. That sort of tightly coupled behavior should be possible when internal extensions are finished.
Any expectation how much time it is going to take before a plugin has access to selected nodes coords? Can't figure it out based on roadmap document.
I think there is an approach that will solve your problems today rather than waiting. If you use the SVG.pm Perl module (or even the XML one really) you can get the coordinates out of the SVG file that is passed in. Yes, this isn't Inkscape giving you those values, but you can adequately get them for most applications. If you need bounding boxes (which you'd need a renderer for) you can recursively call Inkscape using the Inkscape command line interface to have Inkscape calculate them.
Are we talking about *currently selected / active* nodes? Say a path made of 10 nodes and only 2 of them are now selected by the user, just before he calls my plugin. I need just those two, not all the nodes on path of id=xyz.
Karol