On 15/06/14 23:45, SeldomNeedy wrote:
Obviously, normal fault-hunting can be done via gimp.pdb.message(someMessage)
once a plugin is successfully registered. Windows/Dockable dialogs/Error console
is obviously very helpful once an extension is up-and-running, HOWEVER I found
registration fairly trying and had a number of problems getting this to work
with basically no feedback about what I might be doing wrong. Ideally, getting
started should be the easiest part of the process, not the hardest. Thanks for
posting the guide. I'll definitely consider using that approach in future. I
came across an alternative which you may consider adding (though I haven't
compared the techniques for getting error-output so I don't know which one is

Anyways, for the reference of other users developing GIMP Pythonfu plugins under
Windows, I'll repeat some information which I found very helpful when I was
searching. At the very top of the .py file, it's can be useful to do something

import sys
sys.stderr = open("C:\\tmp\\errs.txt",'a')

This will cause the python environment to show some otherwise-hidden startup and
register-registration errors by outputting / printing them to the specified
location. The example I saw used mode 'a' to append errors, rather than
overwrite. Doing this allowed me to spot a mistake I was making.

In addition, one can also do

import sys
sys.stout = open("C:\\"tmp\\msgs.txt",'a')

if it's more convenient to receive output this way.

Additionally, Toolbox-prefix category is deprecated (since at least Gimp 2.6).
should be putting your menu entry in Image-prefix category (the window
the current image), or in Layers-prefix category (the right-click menu in the
layers list), but the latter requires your plug-in to take image and drawable
Can you link to where this deprecation is publicly documented? The information
available on GIMP Python-fu is often out-of-date and extremely disparate, I've
found. Even http://www.gimp.org/docs/python/ is out of date in some respects, at
least comparing it stylistically to some examples I've seen here and elsewhere.
It would be helpful to know what calls are deprecated or now broken between
versions so users will have some idea of whether they're looking at an outdated
(and possibly broken or unreliable) way of doing things.

Your response also makes me wonder what of the other plugin-categories are (the
ones that get specified in angle brackets) still work, and what their
requirements are. An (outdated?) list of them I wrote down at some point went:
"Toolbox", "Image", "Layers", "Channels", "Vectors", "Colormap", "Load", "Save",
"Brushes", "Gradients", "Palettes", "Patterns" or "Buffers".


IIRC in 2.6 you got a "Location deprecated" message in the startup messages (but of course you see this on Linux only :)). Anything you put in <Toolbox> actually went to <Image>. In 2.8 you don't get the message at all and the registration seems ignored.

Expect for <Image> (and, I think, <Load> and <Save>) all others correspond the 
menu of the dockable dialog of the same name.

When the object is specific to an image (Layer/Channel/Path) the registered function should take an image as the first parameter, and the relevant object type as a second one. They are automatically filled with the image and the object on which you right-clicked). Other menus don't require any specific parameters.

gimp-user-list mailing list
List address:    gimp-user-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list

Reply via email to