Top / Inkscapeにっき

初期設定

  • 変形->ストローク幅を拡大縮小する->OFF
  • スクロール->スペースキー+左ボタンでキャンバスをパンする->ON
  • マウスホイールでズームをデフォルトにする->ON
  • ウィンドウ->最後のウインドウの位置とサイズを保存する->ON

extension

シンプルなドロップシャドウ

  • simpe_dropshadow.inx
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
  <_name>simple_dropshadow</_name>
  <id>fwing.net.simple_dropshadow</id>
  <param name="xofst"
         type="int"
         min="-1000"
         max="1000"
         gui-text="xofst">3</param>
  <param name="yofst"
         type="int"
         min="-1000"
         max="1000"
         gui-text="yofst">2</param>
  <effect>
    <object-type>all</object-type>
      <effects-menu>
        <submenu _name="usr01"/>
      </effects-menu>
  </effect>
  <script>
    <command reldir="extensions"
             interpreter="python">simple_dropshadow.py</command>
  </script>
 </inkscape-extension>
  • simple_dropshadow.py
#!/usr/bin/env python

import sys, copy
import inkex, simpletransform

class SimpleDropshadow(inkex.Effect):
    def __init__(self):
        inkex.Effect.__init__(self)
        opts= [("-x", "--xofst", "int", "xofst", 3, "xofst"),
               ("-y", "--yofst", "int", "yofst", 2, "yofst"),
              ]
        for o in opts:
            self.OptionParser.add_option( o[0], \
                                          o[1], \
                                          action = "store", \
                                          type   = o[2], \
                                          dest   = o[3], \
                                          default= o[4],
                                          help   = o[5])
    def effect(self):
        transformation= "translate(" \
                        + str(self.options.xofst) + ", " \
                        + str(self.options.yofst) + ")"
        transform= simpletransform.parseTransform(transformation)

        paths= [];
        for id, node in self.selected.iteritems():
            newNode= copy.deepcopy(node)
            self.current_layer.append(newNode)
            simpletransform.applyTransformToNode(transform, node)
            for child in node.iterchildren():
                child.set("style",
                          "fill:#8A9DDB;"         \
                          + "fill-opacity:1.0;"   \
                          + "stroke:#8A9DDB;"     \
                          + "stroke-width:1;"     \
                          + "stroke-opacity:1.0" )

                node= newNode

if __name__ == "__main__": #pragma: no cover
    e= SimpleDropshadow();
    e.affect()
Link: MenuBar(177d) ,
Site admin: kam1610, PukiWiki 1.4.7 Copyright © 2001-2006 PukiWiki Developers Team. License is GPL.
Based on "PukiWiki" 1.3 by yu-ji. Powered by PHP 5.2.17.