Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Install Script Extension on Inkscape

Papoj
2014-04-03
2014-04-05
  • Papoj
    Papoj
    2014-04-03

    Hi, I am a newbie here learning how to write extensions on Inkscape. Right now I'm learning how to make Python extensions. In the long run, if things go well, I would like to also step up and write extensions in C++.

    I am on OS X 10.9 (Mavericks).

    I have managed to compile and run Inkscape successfully using MacPorts' inkscape-devel port file. Now, I have a quick question about how to install script extensions on Inkscape. Based on the wiki here I can just copy and paste my script files onto extensions dir (~/.config/inkscape/extensions). I did that by starting with my hello world example based on this page. After copying two files, INX and .py onto my extensions dir, I was expected to find my extension in Effects -> Examples menu, but I didn't find anything, not even the Effects menu once I started Inkscape from Terminal. Is there something I'm missing here?

    Possibilities:
    - Inkscape-devel loads extensions from somewhere else entirely, instead of the directory I listed above, but I am not sure.
    - I probably need to "execute" my script somehow before I can start Inkscape.

    Any helps appreciated!

     
    Last edit: Papoj 2014-04-03
  • ~suv
    ~suv
    2014-04-03

    The 'Effects' menu had been renamed to 'Extensions' a couple of years ago, right before the release of Inkscape 0.47:
    http://wiki.inkscape.org/wiki/index.php/Release_notes/0.47#Extensions

    If the INX file has correct syntax and was parsed correctly, you should find the extension under
    'Extensions > Examples > Hello World!'

    If it doesn't load, you can find error messages related to the loading of extensions in
    ~/.config/inkscape/extension-errors.log

    Edit: the renaming is only in the GUI - you do not have to change INX-internal tags.

     
    Last edit: ~suv 2014-04-03
  • Papoj
    Papoj
    2014-04-04

    Hi ~suv,

    Thank you for these tips! I have got the Hello World example running now.

    Is there any way to re-load the extension (if I modify the code) without having to close and re-open inkscape from Terminal?

     
    Last edit: Papoj 2014-04-04
  • ~suv
    ~suv
    2014-04-04

    If you modify INX files, you need to restart Inkscape to reload the new version.

    Wrt script files: As long as the name of the extension script hasn't changed, there is no need to relaunch inkscape: the next run of the extension will launch the latest version (the content of the script itself is not cached AFAIU, only the path & file name).

     
  • Papoj
    Papoj
    2014-04-05

    Thanks ~suv!