Full filename is not known in extensions

Bug #1359471 reported by Tony Manero
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
New
Wishlist
Unassigned

Bug Description

After removing sodipodi:docbase from svg (for security reasons, this happened many years ago) there is still no alternative to actually pass a full filename (with absolute directory) into extension/scripts (filename there is sodipodi:docname). The only workaround is to setup an environment variable with the absolute path of filename before starting inkscape, but the user must quit Inkscape before opening of another file. Quite a drawback.

There are a lot of situations where inkscape is in chain of cooperating programs and it should inform others about actually processing a SVG file. For these reasons this is reported as small bug.

description: updated
Revision history for this message
Tony Manero (ased) wrote :

It looks to me that extensions principles are deeply neglected in inkscape.
Missing functionality (understanding today as bug):
- full filename of currently edited file is not known in script extensions
- missing info about selected nodes of each object in case if applicable, extensions cannot modify selected nodes
- informations about selected objects are passed in extension in random order, correct ordering requires full svg scanning
- very poor one way data transfer between inkscape and extension, there is no way to fill data specified in extension .inx file
  with selected objects data if needed

Possible solution is to use two phase model:
- inkscape first call extension with name of .inx file and .svg file
- extension fill/modify proper data into .inx data objects and output .inx file to stdout
- inkscape offer dialog with data from this .inx to user
- after that inkscape can call extension with modified .inx file and .svg file and output .svg file
On python side only inkex.py should be modified to keep all current extension working as before

Besides more data may be transfered to extensions as part of .inx file:
- full pathname of edited file
- selected nodes of each selected objects if relevant
- saved status
- and maybe other time consuming data: bounding boxes, transformation matrices with inverted matrices of each object ...

One motivation is eg. cutter machine, where one need to specify for each object the size and type of used cutter.
When user selects object and calls cutter_setup script one need to know about actually used cutter
somewhere stored as attribute in svg file so user can change it for another. Currently there is no way
to offer user current data from svg file.

su_v (suv-lp)
tags: added: extensions-plugins
Changed in inkscape:
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.