Collection of mostly command line tools / PHP scripts. Somewhat out of date.

āŒˆāŒ‹ āŽ‡ branch:  scripts + snippets


Artifact [9fad31e85d]

Artifact 9fad31e85d428995b352624799ea9309aef97341:

  • File inkscape/animate_yo.inx — part of check-in [33dbf985e5] at 2022-10-10 07:45:34 on branch trunk — translatable=no for combo boxes (user: mario size: 10240)

<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
  <name>Animate Yo</name>
  <description>Attach an ā®animateāÆ tag to selected object</description>
  <!--<schema:softwareVersion xmlns:schema="https://schema.org/">0.5</schema:softwareVersion>-->
  <category>Animation</category>
  <id>org.include-once.inkscape.animate-yo</id>
  <dependency type="executable" location="inx">animate_yo.py</dependency>
  <label appearance="header">Attach an ā®animateāÆ tag to selected object</label>
  <hbox>
    <vbox>
      <param name="general" type="notebook" gui-text="Timing and control settings">
        <page name="timing" gui-text="timing">
          <param name="start" type="string" gui-description="Can be a numeric `1s` or an expression and reference events `click + 1s` or other animations `animXY.end - 1s`." gui-text="Start time">0s</param>
          <param name="duration" type="string" gui-description="Static value or expression again." gui-text="Duration">5s</param>
        </page>
        <page name="repeat" gui-text="repeat">
          <param name="repeat_count" type="optiongroup" appearance="combo" gui-description="How often this animation loops. (Ignored by gif_export, where animations are generally per-frame.)" gui-text="repeatCount">
            <option value="indefinite">indefinite</option>
            <option value="0">0</option>
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
            <option value="4">4</option>
            <option value="5">5</option>
            <option value="10">10</option>
            <option value="15">15</option>
            <option value="20">20</option>
            <option value="25">25</option>
            <option value="50">50</option>
            <option value="100">100</option>
          </param>
          <param name="repeat_fill" type="optiongroup" appearance="combo" translatable="no" gui-description="Animation can either stay at last state, or reset to value before animation. (gif_export always reverts to previous slide state)" gui-text="repeatFill">
            <option translatable="no" value="freeze">freeze</option>
            <option translatable="no" value="remove">remove</option>
          </param>
        </page>
        <page name="calc" gui-text="calc">
          <param name="calc_mode" type="optiongroup" appearance="combo" gui-description="Defines if values in animation are traversed in a straight from-to progression (linear), jump from start to end (discrete), slowly speed up (paced), or use a list of values/keyTimes (spline)." gui-text="calcMode">
            <option value="linear">linear</option>
            <option value="discrete">discrete</option>
            <option value="paced">paced</option>
            <option value="spline">spline</option>
          </param>
          <param name="key_values" type="string" gui-description="Spline mode: Instead of a single to= attribute, can give a list of values `12px;20px;50px` or `#f33;#77cc99;#03F` for use with keyTimes/Splines." gui-text="(key)values"/>
          <param name="key_times" type="string" gui-description="Spline mode: Lists the time lapse positions `0.0; 0.3; 0.9; 1.0` when point in values= list should be approached." gui-text="keyTimes"/>
          <param name="key_splines" type="string" gui-description="Spline mode: defines bezier curves for use with keyTimes. (Ignored by gif_export)" gui-text="keySplines"/>
        </page>
        <page name="id" gui-text="id">
          <param name="set_id" type="string" gui-description="Animation itself can have an #id for referencing." gui-text="Assign #id"/>
        </page>
      </param>
      <param name="remove_child" type="bool" mode="checkbox" gui-description="Remove any existing ļ¹¤animate*ļ¹„ tags from selected object. (Else use the XML editor Ctrl+Shift+X.)" gui-text="Strip previous animation">false</param>
    </vbox>
    <image width="220" height="220">animate_yo.svg</image>
  </hbox>
  <param name="mode" type="notebook" gui-description="Animation" gui-text="Animation mode">
    <page name="style" gui-text="style">
      <param name="style" type="optiongroup" appearance="combo" translatable="no" gui-description="Can change either colors, opacity, or width." gui-text="Attribute">
        <option translatable="no" value="fill">fill</option>
        <option translatable="no" value="stroke">stroke</option>
        <option translatable="no" value="fill-opacity">fill-opacity</option>
        <option translatable="no" value="stroke-opacity">stroke-opacity</option>
        <option translatable="no" value="stroke-width">stroke-width</option>
      </param>
      <param name="color" type="color" mode="color" appearance="colorbutton" translatable="no" gui-description="Target color" gui-text="Color">#ff5555</param>
      <param name="style_val" type="string" gui-description="Use a fraction 0.75 for opacity. Or an integer 25 for widths." gui-text="Opacity/width"/>
    </page>
    <page name="scale" gui-text="scale">
      <param name="scale" type="string" gui-description="Scales both width and height. Specify fractions each. For example 0.0 will vanish the object, or 2.0 double it per dimension. Beware that this transform can 'scale' x= and y= positions alongside. Can also be a single value `2.5` to scale both width and height." gui-text="Scaling">1.0 1.0</param>
    </page>
    <page name="rotate" gui-text="rotate">
      <param name="rotate" type="int" min="-360" max="360" precision="1" appearance="full" gui-description="Just in degrees." gui-text="Rotation">0</param>
    </page>
    <page name="translate" gui-text="translate">
      <label>Arguments for translate(x y) or matrix(a b c d e f)</label>
      <param name="translate" type="string" translatable="no" gui-description="Should usually be a tuple like 20 30." gui-text="Translate"/>
    </page>
    <page name="skewxy" gui-text="skewXY">
      <label>Either or</label>
      <param name="skew_x" type="string" gui-description="numeric value, like -20 or 50" gui-text="X direction"/>
      <param name="skew_y" type="string" gui-description="only used if _x is empty" gui-text="Y direction"/>
    </page>
    <page name="attrib" gui-text="attrib">
      <param name="attr_name" type="string" gui-description="Could be any of x, cy, or height, or other SVG tag attributes." gui-text="Attribute name">x</param>
      <param name="attr_from" type="string" gui-description="numeric or string" gui-text="Start value"/>
      <param name="attr_to" type="string" gui-description="numeric or string" gui-text="Final value"/>
    </page>
    <page name="move" gui-text="move">
      <label>Select a path alongside the main object.</label>
      <label>Itā€™ll be applied as transition path.</label>
      <param name="move_relative" type="bool" mode="checkbox" gui-description="Usually the animation path is best drawn at page origin (top left, x=0 y=0). This option tries to make it relative (to top left corner or center of animated object). // Alternatively to a selected path, you can define a `M0,0 L20,20` in the [translate] tab." gui-text="Convert to relative path. (No displacement in export_gif).">false</param>
    </page>
  </param>
  <effect needs-live-preview="false">
    <object-type>all</object-type>
    <effects-menu>
      <submenu name="Animation"/>
    </effects-menu>
    <menu-tip>Attach an ā®animateāÆ tag to selected object</menu-tip>
  </effect>
  <script>
    <command location="inx" interpreter="python">animate_yo.py</command>
  </script>
  <!--
        pars.add_argument("-"+"-general", type=str, dest="general", default="time", help="Timing and control settings")
        pars.add_argument("-"+"-start", type=str, dest="start", default="0s", help="Start time")
        pars.add_argument("-"+"-duration", type=str, dest="duration", default="5s", help="Duration")
        pars.add_argument("-"+"-repeat_count", type=str, dest="repeat_count", default="style", help="repeatCount")
        pars.add_argument("-"+"-repeat_fill", type=str, dest="repeat_fill", default="freeze", help="repeatFill")
        pars.add_argument("-"+"-calc_mode", type=str, dest="calc_mode", default="linear", help="calcMode")
        pars.add_argument("-"+"-key_values", type=str, dest="key_values", default="", help="(key)values")
        pars.add_argument("-"+"-key_times", type=str, dest="key_times", default="", help="keyTimes")
        pars.add_argument("-"+"-key_splines", type=str, dest="key_splines", default="", help="keySplines")
        pars.add_argument("-"+"-set_id", type=str, dest="set_id", default="", help="Assign #id")
        pars.add_argument("-"+"-remove_child", type=inkex.Boolean, dest="remove_child", default=False, help="Strip previous animation")
        pars.add_argument("-"+"-mode", type=str, dest="mode", default="style", help="Animation mode")
        pars.add_argument("-"+"-style", type=str, dest="style", default="style", help="Attribute")
        pars.add_argument("-"+"-color", type=inkex.Color, dest="color", default="#ff5555", help="Color")
        pars.add_argument("-"+"-style_val", type=str, dest="style_val", default="", help="Opacity/width")
        pars.add_argument("-"+"-scale", type=str, dest="scale", default="1.0 1.0", help="Scaling")
        pars.add_argument("-"+"-rotate", type=int, dest="rotate", default=0, help="Rotation")
        pars.add_argument("-"+"-translate", type=str, dest="translate", default="", help="Translate")
        pars.add_argument("-"+"-skew_x", type=str, dest="skew_x", default="", help="X direction")
        pars.add_argument("-"+"-skew_y", type=str, dest="skew_y", default="", help="Y direction")
        pars.add_argument("-"+"-attr_name", type=str, dest="attr_name", default="x", help="Attribute name")
        pars.add_argument("-"+"-attr_from", type=str, dest="attr_from", default="", help="Start value")
        pars.add_argument("-"+"-attr_to", type=str, dest="attr_to", default="", help="Final value")
        pars.add_argument("-"+"-move_relative", type=inkex.Boolean, dest="move_relative", default=False, help="Convert to relative path. (No displacement in export_gif).")
-->
</inkscape-extension>