Gimp Path

gimp-path.png

メンバー

パス情報をゲットするには?

関数の引数にしてしまえばok

Pathのところにスクリプトを乗せるには?

いくつか気をつける点があります

#!/usr/bin/python
#coding: UTF-8
from gimpfu import *
def plugin_miffy(image,path):#引数をimageとpathにすること!
    pdb.gimp_message("Miffy sora")
register("triangulate-miffy","blurb","help","author","copyright","2013","Triangluete miff","*",
    [(PF_IMAGE,'image','Input image', None),(PF_VECTORS,'path','Input path', None),],#引数をコレにすること!
    [],
    plugin_miffy,
    menu="<Vectors>/Triangulate")#メニュー情報はlabelじゃなくてここにすること!
 
main()

パスの点座標を次々と表示するスクリプト

#!/usr/bin/python
#coding: UTF-8
from gimpfu import *
def plugin_miffy(image,tdrawable):
    pdb.gimp_message("PathInfo:"+str(path.name))
    for stroke in path.strokes:
        points,closed=stroke.points
        for i in range(0,len(points)/2):
            pdb.gimp_message("p:"+str(points[i*2])+","+str(points[i*2+1]))
 
    #type, num_points, controlpoints, closed = pdb.gimp_vectors_stroke_get_points(vectors, stroke_id)
register("triangulate-miffy","blurb","help","author","copyright","2013","Triangluete miff","*",
    [(PF_IMAGE,'image','Input image', None),(PF_VECTORS,'path','Input path', None),],
    [],
    plugin_miffy,
    menu="<Vectors>/Triangulate")
 
main()

サポートサイト Wikidot.com