我正在尝试编写python-fu脚本,以简单地将警告打印到错误控制台。我在schema-fu中也能正常工作。
但是它没有显示在python-fu菜单上。
我在gimp中为插件配置的目录中具有脚本:/ Users / myusername / Library / Application Support / GIMP / 2.10 / plugin-ins
该文件名为:python-fu-hello-warning.py
[在MacOS Catalina版本10.15.3中运行此程序。GIMP的版本是2.10.14。
这是代码:
#!/usr/bin/env python
# Hello Warning
from gimpfu import *
def hello_warning():
pdb.gimp_message("hello warning")
register(
"python_fu_hello_warning",
"Hello warning",
"Hello warning TO ERROR CONSOLE",
"Walter Moore",
"Walter Moore",
"2020",
"Hello warning (Py)...",
"",
[],
[],
hello_warning,
menu="<Image>/File/HelloWarning"
)
main()
我在做什么错?
为我工作,所以我能想到的唯一原因是:
chmod +x ...
)。在OSX和Linux上,Gimp仅扫描插件目录中标记为可执行的文件。一般情况下,如果您的插件未注册:
python pluginfile.py
,那里也会显示明显的错误。当它抱怨gimpfu
时,您很高兴。print '*************************'
,这将在每次插件运行时执行,并使其更容易发现脚本中的其他输出。您也可以使用更多信息的打印行。