繁体   English   中英

Gimp菜单中未显示Python-fu脚本

[英]Python-fu script not showing in Gimp menu

我去过Gimp:python脚本没有显示在菜单上 ,并且对我没有帮助。 这是我逐步尝试的方法:

1.我在命令行上使用gimp在Mac OS X 10.9.5上运行Gimp 2.8.16,因为我的.bashrc文件包括

alias gimp='/Applications/GIMP.app/Contents/MacOS/GIMP --verbose --console-messages '

我查看终端输出,看到很多消息,但没有出现任何问题(您是否要在此处转储?)。 我一开始就看到Enabling internal Python...这样应该很好。

2.过滤器> Python-Fu>控制台将调出控制台,

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>首选项>文件夹>脚本显示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()

7.已经在上面指示的scripts目录中运行带有minimal.py 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()

Python“脚本”在技术上是“插件”,因此应位于“插件”子目录(/ Users / julio / Library / Application Support / GIMP / 2.8 / plugins)中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM