Gimp Python脚本未显示在菜单中
我正在尝试编写一个python fu脚本,以简单地向错误控制台打印一条警告。我有同样的东西可以很好地使用 但是它没有显示在菜单上 我在gimp中为插件配置了目录中的脚本: /Users/myusername/Library/Application Support/GIMP/2.10/plug-ins 文件名为: python-fu-hello-warning.py 在MacOS Catalina版本10.15.3中运行此功能。 GIMP的版本是2.10.14 代码如下:Gimp Python脚本未显示在菜单中,python,gimp,gimpfu,Python,Gimp,Gimpfu,我正在尝试编写一个python fu脚本,以简单地向错误控制台打印一条警告。我有同样的东西可以很好地使用 但是它没有显示在菜单上 我在gimp中为插件配置了目录中的脚本: /Users/myusername/Library/Application Support/GIMP/2.10/plug-ins 文件名为: python-fu-hello-warning.py 在MacOS Catalina版本10.15.3中运行此功能。 GIMP的版本是2.10.14 代码如下: #!/usr/bin/e
#!/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()
#/usr/bin/env python
#你好,警告
从gimpfu进口*
def hello_warning():
pdb.gimp_消息(“你好警告”)
登记册(
“python\u fu\u hello\u警告”,
“你好,警告”,
“错误控制台的Hello警告”,
“沃尔特·摩尔”,
“沃尔特·摩尔”,
"2020",
“你好,警告(Py)…”,
"",
[],
[],
你好,警告,,
menu=“/File/HelloWarning”
)
main()
我做错了什么?对我有效,所以我能想到的唯一原因是:
- 该文件不在Gimp扫描的目录中(编辑>首选项>文件夹>插件)
- 您没有将文件设置为可执行文件(
)。在OSX和Linux上,Gimp只扫描插件目录中标记为可执行文件的文件chmod+x…
python pluginfile.py
,明显的错误将显示在那里。当它抱怨gimpfu时,你就可以走了print'************************'
,这将在每次插件运行时执行,从而更容易从脚本中发现其他输出。您还可以使用更具信息性的打印行我想我可以通过MacOS上的文件管理器设置权限。但我不是。我必须打开一个终端和cd到插件目录并运行“chmod ugo+x*py”。然后,一旦我重新启动gimp,我就能够看到脚本已经加载。感谢您提供可能的问题和调试提示!