Pages

duminică, 4 august 2024

Inkscape : Create an extension for inkscape.

You can create your own extensions in inkscape with all features you need to improve the working area.
One extension can have minimum two file: the basic Python source code and another file with the graphic user interface ...
The source code of Python file can be link with the G.U.I. source code type file INX.
The source code for python can be customized and this is the main reason is no need to add it here.
Let's see the source code for the INX file:
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
    <name>Default extension example</name>
    <id>default.extensions.example</id>
    <param name="tab" type="notebook">
        <page name="Options" gui-text="Options">
            <param name="value_int" type="int" min="0" max="9" gui-text="INT type value from 0 up to 9 : ">10</param>
            <param name="value_bool" type="bool" gui-text="BOOL value set to false : ">false</param>
            <param name="value_space" type="float" gui-text="FLOAT value set to 0.1 custom range min 0.0 up max=99.0 : " min="0.0" max="99.0">0.1</param>
                <param name="option_group selection" type="optiongroup" appearance="combo" gui-text="Options :">
                <option value="1">1</option>
                <option value="2">2</option>
                <option value="3">3</option>
            </param>
		<param name="grouppick" type="bool" gui-text="selection pick ..." gui-description="This is gui-description">false</param>
            <param name="pickmode" type="optiongroup" appearance="combo" gui-text="pick values group:">
                <option value="first">first</option>
                <option value="second">second</option>
            </param> 
	</page>
        <page name="Help" gui-text="Help for default extension example">
            <label xml:space="preserve">This is example of default extension example
	You can use this INX file and PY files type named 'default_extension_example'</label>
        </page>
    </param>
    <effect>
        <object-type>all</object-type>
        <effects-menu>
            <submenu name="catafest"/>
        </effects-menu>
    </effect>
    <script>
        <command location="inx" interpreter="python">default_extension_example.py</command>
    </script>
</inkscape-extension>
Bellow you can see some screenshots with these result