GIMP Script-FU - 错误:没有足够的参数

时间:2011-11-08 14:46:33

标签: arguments gimp script-fu

GIMP script-fu-newbie here。

我无法在GIMP 2.6的文档中看到为什么这不起作用:

;Define the main function
(define (script-fu-rubber-stamp img drawable)
      (gimp-image-undo-group-start img)
      (plug-in-randomize-pick 1 img drawable 90 7 FALSE 10)
      (plug-in-oilify 1 img drawable 5 0)
      (gimp-image-undo-group-end img)
)

;Register the script w/ GIMP.
(script-fu-register
      "script-fu-rubber-stamp"            ;func name
      "Rubber Stamp"                      ;menu label
      "Image to rubberstamp"              ;description
      "Me"                                ;author
      "Copyright 2011, Me"                ;copyright notice
      "Nov. 2011"                         ;date created
      ""                                  ;image type that the script works on
)

(script-fu-menu-register "script-fu-rubber-stamp" "<Image>/Script-Fu")

它出现在GIMP中,但当我运行它时,它说:

Error: not enough arguments

但是,如果我查看Script-FU控制台,它似乎是正确的......除非我的方式错误不在函数调用中...

1 个答案:

答案 0 :(得分:1)

ARGH自然...脚本fu-register需要说明img和drawable是什么:

(script-fu-register
  "script-fu-rubber-stamp"            ;func name
  "Rubber Stamp"                      ;menu label
  "Image to rubberstamp"              ;description
  "Me"                                ;author
  "Copyright 2011, Me"                ;copyright notice
  "Nov. 2011"                         ;date created
  ""                                  ;image type that the script works on
  SF-IMAGE "Input Image" 0
  SF-DRAWABLE "Input Drawable" 0
)