Code

Extensions. Consistency fix and UI improvements (Generate from path submenu).
authorJazzyNico <nicoduf@yahoo.fr>
Mon, 6 Sep 2010 17:28:38 +0000 (19:28 +0200)
committerJazzyNico <nicoduf@yahoo.fr>
Mon, 6 Sep 2010 17:28:38 +0000 (19:28 +0200)
share/extensions/extrude.inx
share/extensions/generate_voronoi.inx
share/extensions/generate_voronoi.py
share/extensions/interp.inx
share/extensions/motion.inx
share/extensions/pathalongpath.inx
share/extensions/pathalongpath.py
share/extensions/pathscatter.inx
share/extensions/pathscatter.py

index b282fe0d9899913dc97f3a96f98b216305654645..dfae5d82540e7ae521a5f94bca592375c28c4a46 100644 (file)
@@ -4,15 +4,15 @@
     <id>org.greygreen.inkscape.effects.extrude</id>
        <dependency type="executable" location="extensions">extrude.py</dependency>
        <dependency type="executable" location="extensions">inkex.py</dependency>
-  <param name="mode" type="optiongroup" _gui-text="Mode:">
-     <_option>Lines</_option>
-     <_option>Polygons</_option>
-  </param>
+    <param name="mode" type="enum" _gui-text="Mode:">
+        <_item>Lines</_item>
+        <_item>Polygons</_item>
+    </param>
     <effect>
                <object-type>path</object-type>
-                <effects-menu>
-                    <submenu _name="Generate from Path"/>
-                </effects-menu>
+            <effects-menu>
+                <submenu _name="Generate from Path"/>
+            </effects-menu>
     </effect>
     <script>
         <command reldir="extensions" interpreter="python">extrude.py</command>
index dc0dde07daf04ed5bc67ea94e9b2d9d9b00d0c2b..0c1e827aaf4d0e5c58da9af00c18fef1b9603412 100644 (file)
@@ -5,10 +5,17 @@
        <dependency type="executable" location="extensions">generate_voronoi.py</dependency>
        <dependency type="executable" location="extensions">voronoi.py</dependency>
        <dependency type="executable" location="extensions">inkex.py</dependency>
-       <_param name="title1" type="description">Generate a random pattern of Voronoi cells. The pattern will be accessible in the Fill and Stroke dialog. You must select an object or a group.</_param>
-       <_param name="title2" type="description">If border is zero, the pattern will be discontinuous at the edges. Use a positive border, preferably greater than the cell size, to produce a smooth join of the pattern at the edges. Use a negative border to reduce the size of the pattern and get an empty border.</_param>
-       <param name="size" type="int" min="2" max="200" _gui-text="Average size of cell (px)">10</param>
-       <param name="border" type="int" min="-200" max="200" _gui-text="Size of Border (px)">0</param>
+       <param name="tab" type="notebook">
+        <page name="Options" _gui-text="Options">
+               <param name="size" type="int" min="2" max="200" _gui-text="Average size of cell (px):">10</param>
+               <param name="border" type="int" min="-200" max="200" _gui-text="Size of Border (px):">0</param>
+        </page>
+        <page name="Help" _gui-text="Help">
+               <_param name="title" type="description" xml:space="preserve">Generate a random pattern of Voronoi cells. The pattern will be accessible in the Fill and Stroke dialog. You must select an object or a group.
+
+If border is zero, the pattern will be discontinuous at the edges. Use a positive border, preferably greater than the cell size, to produce a smooth join of the pattern at the edges. Use a negative border to reduce the size of the pattern and get an empty border.</_param>
+        </page>
+    </param>
        <effect>
                <object-type>all</object-type>
                <effects-menu>
index 3d5d5e9a88b88150fe97af90ce3a8d86c32aebe6..6c317c348324c27e6385427631cb38336894c8c2 100644 (file)
@@ -78,6 +78,10 @@ class Pattern(inkex.Effect):
                         action="store", type="int", 
                         dest="border", default=0,
                         help="Size of Border (px)")
+        self.OptionParser.add_option("--tab",
+                        action="store", type="string",
+                        dest="tab",
+                        help="The selected UI-tab when OK was pressed")
 
     def effect(self):
         if not self.options.ids:
index 6c83f8a21c74a025aea4027352dfbadd7fc50c1f..cd5d32343759e99ce0ea987a78feb4133a8b8579 100644 (file)
@@ -4,9 +4,9 @@
     <id>org.ekips.filter.interp</id>
        <dependency type="executable" location="extensions">interp.py</dependency>
        <dependency type="executable" location="extensions">inkex.py</dependency>
-       <param name="exponent" type="float" min="-100.0" max="100.0" _gui-text="Exponent">0.00</param>
-       <param name="steps" type="int" min="1" max="1000" _gui-text="Interpolation steps">5</param>
-       <param name="method" type="int" min="1" max="2" _gui-text="Interpolation method">2</param>
+       <param name="exponent" type="float" min="-100.0" max="100.0" _gui-text="Exponent:">0.00</param>
+       <param name="steps" type="int" min="1" max="1000" _gui-text="Interpolation steps:">5</param>
+       <param name="method" type="int" min="1" max="2" _gui-text="Interpolation method:">2</param>
        <param name="dup" type="boolean" _gui-text="Duplicate endpaths">true</param>
        <param name="style" type="boolean" _gui-text="Interpolate style">false</param>
     <effect>
index effeb39375d551fe2c5cb574977a3b6a38db30be..8ffeb16ce759feceb6c837557278beba4bfcae74 100644 (file)
@@ -4,8 +4,8 @@
     <id>org.ekips.filter.motion</id>
        <dependency type="executable" location="extensions">motion.py</dependency>
        <dependency type="executable" location="extensions">inkex.py</dependency>
-       <param name="magnitude" type="float" min="0" max="1000" _gui-text="Magnitude">100</param>
-       <param name="angle" type="float" min="0.0" max="360.0" _gui-text="Angle">45</param>
+       <param name="magnitude" type="float" min="0" max="1000" _gui-text="Magnitude:">100</param>
+       <param name="angle" type="float" min="0.0" max="360.0" _gui-text="Angle:">45</param>
     <effect>
                <object-type>path</object-type>
                 <effects-menu>
index a4ee408525609d73f64dbac55b3233478df96570..b555b9445fb7d09a32c69044e5c07f9e0a7742b4 100644 (file)
@@ -1,33 +1,39 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
-  <_name>Pattern along Path</_name>
-  <id>math.univ-lille1.barraud.pathdeform</id>
-  <dependency type="executable" location="extensions">pathmodifier.py</dependency>
-  <dependency type="executable" location="extensions">pathalongpath.py</dependency>
-  <dependency type="executable" location="extensions">inkex.py</dependency>
-  <_param name="title" type="description">This effect bends a pattern object along arbitrary "skeleton" paths. The pattern is the topmost object in the selection. (groups of paths/shapes/clones... allowed)</_param>
-  <param name="copymode" type="enum" _gui-text="Copies of the pattern:">
-    <_item value="Single">Single</_item>
-    <_item value="Single, stretched">Single, stretched</_item>
-    <_item value="Repeated">Repeated</_item>
-    <_item value="Repeated, stretched">Repeated, stretched</_item>
-  </param>
-  <param name="kind" type="enum" _gui-text="Deformation type:">
-    <_item value="Snake">Snake</_item>
-    <_item value="Ribbon">Ribbon</_item>
-  </param>
-  <param name="space" type="float" _gui-text="Space between copies:" min="-10000.0" max="10000.0">0.0</param>
-  <param name="noffset" type="float" _gui-text="Normal offset" min="-10000.0" max="10000.0">0.0</param>
-  <param name="toffset" type="float" _gui-text="Tangential offset" min="-10000.0" max="10000.0">0.0</param>
-  <param name="vertical" type="boolean" _gui-text="Pattern is vertical">false</param>
-  <param name="duplicate" type="boolean" _gui-text="Duplicate the pattern before deformation">true</param>
-  <effect>
+    <_name>Pattern along Path</_name>
+    <id>math.univ-lille1.barraud.pathdeform</id>
+    <dependency type="executable" location="extensions">pathmodifier.py</dependency>
+    <dependency type="executable" location="extensions">pathalongpath.py</dependency>
+    <dependency type="executable" location="extensions">inkex.py</dependency>
+       <param name="tab" type="notebook">
+        <page name="Options" _gui-text="Options">
+        <param name="copymode" type="enum" _gui-text="Copies of the pattern:">
+            <_item value="Single">Single</_item>
+            <_item value="Single, stretched">Single, stretched</_item>
+            <_item value="Repeated">Repeated</_item>
+            <_item value="Repeated, stretched">Repeated, stretched</_item>
+        </param>
+        <param name="kind" type="enum" _gui-text="Deformation type:">
+            <_item value="Snake">Snake</_item>
+            <_item value="Ribbon">Ribbon</_item>
+        </param>
+        <param name="space" type="float" _gui-text="Space between copies:" min="-10000.0" max="10000.0">0.0</param>
+        <param name="noffset" type="float" _gui-text="Normal offset:" min="-10000.0" max="10000.0">0.0</param>
+        <param name="toffset" type="float" _gui-text="Tangential offset:" min="-10000.0" max="10000.0">0.0</param>
+        <param name="vertical" type="boolean" _gui-text="Pattern is vertical">false</param>
+        <param name="duplicate" type="boolean" _gui-text="Duplicate the pattern before deformation">true</param>
+        </page>
+        <page name="Help" _gui-text="Help">
+            <_param name="title" type="description">This effect bends a pattern object along arbitrary "skeleton" paths. The pattern is the topmost object in the selection (groups of paths/shapes/clones... allowed).</_param>
+        </page>
+    </param>
+    <effect>
     <object-type>all</object-type>
-    <effects-menu>
-      <submenu _name="Generate from Path"/>
-    </effects-menu>
-  </effect>
-  <script>
-    <command reldir="extensions" interpreter="python">pathalongpath.py</command>
-  </script>
+        <effects-menu>
+            <submenu _name="Generate from Path"/>
+        </effects-menu>
+    </effect>
+    <script>
+        <command reldir="extensions" interpreter="python">pathalongpath.py</command>
+    </script>
 </inkscape-extension>
index be2e5bc19e863a5cc132051c0f0349805c0f5446..b39f29c3a9623c8fd3863f1a5f6ed326854c03ba 100644 (file)
@@ -117,6 +117,10 @@ class PathAlongPath(pathmodifier.Diffeo):
                         action="store", type="inkbool", 
                         dest="duplicate", default=False,
                         help="duplicate pattern before deformation")
+        self.OptionParser.add_option("--tab",
+                        action="store", type="string",
+                        dest="tab",
+                        help="The selected UI-tab when OK was pressed")
 
     def prepareSelectionList(self):
 
index 19d2e081066fa9e21db4eb9c40526acfed093f96..02d00a3caa4377709d98a59394cb4d912c1de5e5 100644 (file)
@@ -1,35 +1,41 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
-  <_name>Scatter</_name>
-  <id>math.univ-lille1.barraud.pathScatter</id>
-  <dependency type="executable" location="extensions">pathmodifier.py</dependency>
-  <dependency type="executable" location="extensions">pathscatter.py</dependency>
-  <dependency type="executable" location="extensions">inkex.py</dependency>
-  <_param name="title" type="description">This effect scatters a pattern along arbitrary "skeleton" paths. The pattern must be the topmost object in the selection. Groups of paths, shapes, clones are allowed.</_param>
-  <param name="follow" type="boolean" _gui-text="Follow path orientation">false</param>
-  <param name="stretch" type="boolean" _gui-text="Stretch spaces to fit skeleton length">false</param>
-  <param name="space" type="float" _gui-text="Space between copies:" min="-10000.0" max="10000.0">0.0</param>
-  <param name="noffset" type="float" _gui-text="Normal offset" min="-10000.0" max="10000.0">0.0</param>
-  <param name="toffset" type="float" _gui-text="Tangential offset" min="-10000.0" max="10000.0">0.0</param>
-  <param name="vertical" type="boolean" _gui-text="Pattern is vertical">false</param>
-  <param name="copymode" type="optiongroup" _gui-text="Original pattern will be:">
-    <_option value="move">Moved</_option>
-    <_option value="copy">Copied</_option>
-    <_option value="clone">Cloned</_option>
-  </param>
-  <param name="duplicate" type="boolean" _gui-text="Duplicate the pattern before deformation">true</param>
-  <param name="grouppick" type="boolean" _gui-text="If pattern is a group, pick group members">false</param>
-  <param name="pickmode" type="optiongroup" _gui-text="Pick group members:">
-    <_option value="rand">Randomly</_option>
-    <_option value="seq">Sequentially</_option>
-  </param> 
-  <effect>
-    <object-type>all</object-type>
-    <effects-menu>
-      <submenu _name="Generate from Path"/>
-    </effects-menu>
-  </effect>
-  <script>
-    <command reldir="extensions" interpreter="python">pathscatter.py</command>
-  </script>
+    <_name>Scatter</_name>
+    <id>math.univ-lille1.barraud.pathScatter</id>
+    <dependency type="executable" location="extensions">pathmodifier.py</dependency>
+    <dependency type="executable" location="extensions">pathscatter.py</dependency>
+    <dependency type="executable" location="extensions">inkex.py</dependency>
+       <param name="tab" type="notebook">
+        <page name="Options" _gui-text="Options">
+            <param name="follow" type="boolean" _gui-text="Follow path orientation">false</param>
+            <param name="stretch" type="boolean" _gui-text="Stretch spaces to fit skeleton length">false</param>
+            <param name="space" type="float" _gui-text="Space between copies:" min="-10000.0" max="10000.0">0.0</param>
+            <param name="noffset" type="float" _gui-text="Normal offset:" min="-10000.0" max="10000.0">0.0</param>
+            <param name="toffset" type="float" _gui-text="Tangential offset:" min="-10000.0" max="10000.0">0.0</param>
+            <param name="vertical" type="boolean" _gui-text="Pattern is vertical">false</param>
+            <param name="copymode" type="enum" _gui-text="Original pattern will be:">
+                <_item value="move">Moved</_item>
+                <_item value="copy">Copied</_item>
+                <_item value="clone">Cloned</_item>
+            </param>
+            <param name="duplicate" type="boolean" _gui-text="Duplicate the pattern before deformation">true</param>
+            <param name="grouppick" type="boolean" _gui-text="If pattern is a group, pick group members">false</param>
+            <param name="pickmode" type="enum" _gui-text="Pick group members:">
+                <_item value="rand">Randomly</_item>
+                <_item value="seq">Sequentially</_item>
+            </param> 
+        </page>
+        <page name="Help" _gui-text="Help">
+            <_param name="title" type="description">This effect scatters a pattern along arbitrary "skeleton" paths. The pattern must be the topmost object in the selection. Groups of paths, shapes, clones are allowed.</_param>
+        </page>
+    </param>
+    <effect>
+        <object-type>all</object-type>
+        <effects-menu>
+            <submenu _name="Generate from Path"/>
+        </effects-menu>
+    </effect>
+    <script>
+        <command reldir="extensions" interpreter="python">pathscatter.py</command>
+    </script>
 </inkscape-extension>
index a7a77e1eca9fc1b1547e03a95dc6afec947c8d5a..b8b8e31bc8f27e01a642149e19d1360e3bf9d926 100644 (file)
@@ -142,6 +142,10 @@ class PathScatter(pathmodifier.Diffeo):
                         action="store", type="string", 
                         dest="copymode", default="clone",
                         help="duplicate pattern before deformation")
+        self.OptionParser.add_option("--tab",
+                        action="store", type="string",
+                        dest="tab",
+                        help="The selected UI-tab when OK was pressed")
 
     def prepareSelectionList(self):