Python fu脚本未显示在Gimp菜单中
我一直在工作,但这对我没有帮助。以下是我一步一步尝试的: 1。我在Mac OS X 10.9.5上运行Gimp 2.8.16,命令行中使用Python fu脚本未显示在Gimp菜单中,python,gimp,gimpfu,python-fu,Python,Gimp,Gimpfu,Python Fu,我一直在工作,但这对我没有帮助。以下是我一步一步尝试的: 1。我在Mac OS X 10.9.5上运行Gimp 2.8.16,命令行中使用Gimp作为我的。bashrc文件包括 alias gimp='/Applications/GIMP.app/Contents/MacOS/GIMP --verbose --console-messages ' 我查看终端输出,我看到了很多消息,但没有任何问题(你想在这里转储吗?)。我从一开始就看到了启用内部Python…,这应该很好 2.Filters>P
Gimp
作为我的。bashrc
文件包括
alias gimp='/Applications/GIMP.app/Contents/MacOS/GIMP --verbose --console-messages '
我查看终端输出,我看到了很多消息,但没有任何问题(你想在这里转储吗?)。我从一开始就看到了启用内部Python…
,这应该很好
2.Filters>Python-Fu>Console打开控制台,带有
GIMP 2.8.16 Python Console
Python 2.7.8 (default, Dec 5 2015, 09:38:54)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
>>>
-因此,python似乎再次发挥了作用
3.因为我尝试运行Python脚本。我打开一个图像并运行过滤器>渲染>云>雾。工作起来很有魅力–在控制台中,当窗口启动时,我确实收到一些类型转换警告:
** (foggify.py:30312): WARNING **: Trying to register gtype 'GMountMountFlags' as enum when in fact it is of type 'GFlags'
** (foggify.py:30312): WARNING **: Trying to register gtype 'GDriveStartFlags' as enum when in fact it is of type 'GFlags'
** (foggify.py:30312): WARNING **: Trying to register gtype 'GSocketMsgFlags' as enum when in fact it is of type 'GFlags'
我搜索了我的计算机,发现foggify.py实际上位于/Applications/GIMP.app/Contents/Resources/lib/GIMP/2.0/plug-ins/foggify.py
中,因此这证明Python正在工作,但不是在加载脚本。我有点困惑,因为foggify.py
只有77行,而不是30312行
4.GIMP>Preferences>Folders>Scripts显示GIMP应该为脚本加载以下目录:
/Users/julio/Library/Application Support/GIMP/2.8/scripts
/Applications/GIMP.app/Contents/Resources/share/gimp/2.0/scripts
我没有使用/Applications/GIMP.app/Contents/Resources/share/GIMP/2.0/scripts
,但它有很多*.scm
文件(因此,可能都在Scheme中)。我自己从来没有在这里添加过任何东西
5.我只有一个脚本:ls-l”/Users/julio/Library/Application Support/Gimp/2.8/scripts“
total 8
-rwxr-xr-x 1 julio staff 654 25 Jun 16:25 minimal.py
(没有别的了)
6.这是我的minimal.py
:
#!/usr/bin/env python
from gimpfu import *
def minimal():
pass
register(
"python_fu_minimal", # plugin name
"Minimal plug-in example", # blurb (short description)
"Show the smallest possible Python plug-in example", # help (long description)
"Michael Schumacher", # author
"Michael Schumacher", # copyright info
"2007", # date
"<Image>/Tools/Minimal", # menu position and label
None, # image types accepted
[], # input parameters
[], # output (results)
minimal # method to call
)
main()
Python“脚本”在技术上是“插件”,因此应该位于“插件”子目录(/Users/julio/Library/Application Support/GIMP/2.8/plug-ins)。谢谢@xenoid,你刚刚救了我的命。如果你能相信的话,我昨天在这里呆了四个小时。当通过命令行启动Gimp时,它现在显示正在执行脚本:
查询插件:'/Users/julio/Library/Application Support/Gimp/2.8/plug-ins/minimal.py'
欢迎使用Gimp脚本。如果您在我的个人资料中查看GIMP答案,您将发现更多提示(可能比文档中的更多)。
#!/usr/bin/env python
from gimpfu import *
def minimal():
pass
register(
"python_fu_minimal", # plugin name
"Minimal plug-in example", # blurb (short description)
"Show the smallest possible Python plug-in example", # help (long description)
"Michael Schumacher", # author
"Michael Schumacher", # copyright info
"2007", # date
"Minimal", # menu position and label
None, # image types accepted
[], # input parameters
[], # output (results)
minimal, # method to call
menu="<Image>/Tools"
)
main()