需要使用用戶可能尚未打開的圖像文件。儘管看起來我只限於在圖像已經打開的情況下啓用插件。 Gimp 2.8附帶的所有Python插件在圖像打開之前都會被禁用。通過很多示例進行搜索,似乎每個定位的示例都需要在插件可以執行之前打開一個圖像。Gimp Python插件不需要當前打開的圖像? (插件是通過FileChooserDialog打開/導出/關閉圖像)
下面是一個基本helloworld.py
#!/usr/bin/env python
import gtk
from gimpfu import *
def plugin_main() :
message = gtk.MessageDialog(type=gtk.MESSAGE_ERROR, buttons=gtk.BUTTONS_OK)
message.set_markup("Please Help")
message.run()
gimp.quit()
register(
"helloworld",
"Saying Hi",
"Saying Hello to the World",
"William Crandell <[email protected]>",
"William Crandell <[email protected]>",
"2015",
"Hello Gimp",
"*",
[],
[],
plugin_main,
menu = "<Toolbox>/Hello/"
)
main()
幾乎相關的問題GIMP, python-fu: How to disable "Input image" and "Input drawable"