0

I have this function def enumerategrid(image, width, height, tcolor, theight, font, startfrom)

And have it registered:

gimpfu.register(
    proc_name="enumerategrid_plugin-pdb",
    blurb="Enumera rejillas en una imagen",
    help="Enumera rejillas en una imagen",
    author="Jorge Araya Navarro <elcorreo@deshackra.com>",
    copyright="Servants of the Secret Fire Game Studios",
    date="2015",
    label="Enumerar rejilla...",
    imagetypes="*",
    params=[
        (gimpfu.PF_INT32, "width", "ancho de la reja", 32),
        (gimpfu.PF_INT32, "height", "altura de la reja", 32),
        (gimpfu.PF_COLOR, "tcolor", "Color del texto", (1.0, 1.0, 1.0)),
        (gimpfu.PF_SPINNER, "theight", "Tamaño del texto", 8, (1, 50, 1)),
        (gimpfu.PF_FONT, "font", "Tipografía", "Monospace"),
        (gimpfu.PF_SPINNER, "startfrom", "Contar desde", 0, (0, 3000, 1))
    ],
    results=[],
    function=enumerategrid,
    menu="<Image>/Desarrollo de juegos/rejillas"
)

However, when I want to run the new installed plugin, I get this error from Gimp:

enter image description here

It seems like Gimp is not passing the current image to my plug-in, so 6 arguments are passed instead of 7. How can I solve this issue?

4

2 回答 2

1

以下现在适用于我的机器。关于您需要传递的参数,我的原始答案是正确的。

另请注意,我必须将菜单更改为标签。

#!/usr/bin/env python
#https://stackoverflow.com/questions/27751506/gimp-the-current-image-is-not-passed-as-parameter-to-my-plug-in-function/27831408#27831408

from gimpfu import *
import os



def enumerategrid(image, layer, width, height, tcolor, theight, font, startfrom):

    pass



register(
        proc_name="enumerategrid_plugin-pdb",
        blurb="Enumera rejillas en una imagen",
        help="Enumera rejillas en una imagen",
        author="Jorge Araya Navarro <elcorreo@deshackra.com>",
        copyright="Servants of the Secret Fire Game Studios",
        date="2015",
        label="<Image>/Filters/Test/enumerate",
        imagetypes="*",
        params=[
            (PF_INT32, "width", "ancho de la reja", 32),
            (PF_INT32, "height", "altura de la reja", 32),
            (PF_COLOR, "tcolor", "Color del texto", (1.0, 1.0, 1.0) ),
            (PF_SPINNER, "theight", "Tamao del texto", 8, (1, 50, 1)), 
            (PF_FONT, "font", "Tipografia", "Monospace"),
            (PF_SPINNER, "startfrom", "Contar desde", 0, (0, 3000, 1)),
        ],
        results=[],
        function=enumerategrid)



main()
# to make example work, cannot use accented characters on my machine
于 2015-01-13T01:30:31.460 回答
0

这可能看起来很奇怪,但也许可以尝试

def enumerategrid(image, layer ,width, height, tcolor, theight, font, startfrom)

此处的示例可能会有所帮助。

http://registry.gimp.org/node/28124

于 2015-01-08T01:05:30.003 回答