RSS/Atom feed Twitter
Site is read-only, email is disabled

How to make a PyGimp plugin rerunnable?

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

4 of 5 messages available
Toggle history

Please log in to manage your subscriptions.

How to make a PyGimp plugin rerunnable? David Gowers 11 Aug 11:26
  How to make a PyGimp plugin rerunnable? Kevin Cozens 11 Aug 21:03
4243d4c60608110452l2aba4b4b... 07 Oct 20:24
  How to make a PyGimp plugin rerunnable? David Gowers 12 Aug 05:33
   How to make a PyGimp plugin rerunnable? Carol Spears 22 Aug 19:47
David Gowers
2006-08-11 11:26:09 UTC (over 17 years ago)

How to make a PyGimp plugin rerunnable?

I've written several PyGimp plugins, but when I go to the 'recent filters' menu or try to rerun one, it is disabled. I can run it okay and it produces the expected results, but I can't rerun it.

to clarify, I'm using the simple gimpplugin.plugin class (GimpFu is far too heavyweight and slow for something with no UI needed)

Here's a super-simplified plugin just to demonstrate this. How do I get it to be rerunnable?

(pasted here as well as attached, in case the attachment is filtered out by the mailing list software.)

#!/usr/bin/python import gimp,gimpplugin
from gimpfu import PLUGIN, PF_INT, PF_IMAGE, PF_DRAWABLE, PDB_SUCCESS pdb = gimp.pdb
import os

class Simple(gimpplugin.plugin): def query(self):
d = ''
gimp.install_procedure('plug_in_simple', d,d,d,d,d,'/File/Simple_Test', '',PLUGIN, [( PF_INT, 'run_mode', "run mode"),(PF_IMAGE, 'image', 'Image'), (PF_DRAWABLE, 'drawable', 'Drawable')]
, [])

def plug_in_simple(self, run_mode, image, drawable): return # returning PDB_SUCCESS doesn't help, nor does returning None (as gimpfu.py does)

def start(self): gimpplugin.plugin.start(self)

if __name__ == '__main__': Simple().start()

Kevin Cozens
2006-08-11 21:03:11 UTC (over 17 years ago)

How to make a PyGimp plugin rerunnable?

David Gowers wrote:

I've written several PyGimp plugins, but when I go to the 'recent filters' menu or try to rerun one, it is disabled. I can run it okay and it produces the expected results, but I can't rerun it.

You don't need to do anything in your plug-in. It was a limitation within GIMP that prevented most (all?) of the script-based plug-ins from appearing in the 'recent filters' list. This has been fixed in the current GIMP source.

David Gowers
2006-08-12 05:33:57 UTC (over 17 years ago)

How to make a PyGimp plugin rerunnable?

On 8/11/06, Seth Burgess wrote:

I think the better question is why is it runnable at all? The install_procedure call has an argument of '' for image types it can work on; since you're under the , this should be dynamically changed based upon the characteristics of the image under it. Try using a type of '*' instead, or RGB* if you want to be more specific, and see if that helps.

Yes, that was exactly what's needed. Looks like '' means 'image is irrelevant' while '*' means 'all'.

Kevin: Nope; read more carefully. it did show up, it just wasn't rerunnable

Carol Spears
2006-08-22 19:47:22 UTC (over 17 years ago)

How to make a PyGimp plugin rerunnable?

On Sat, Aug 12, 2006 at 03:33:57AM +0000, David Gowers wrote:

Yes, that was exactly what's needed. Looks like '' means 'image is irrelevant' while '*' means 'all'.

it has been my experience that '*' always creates a script that will only run once and sit there grayed out in the menu as you described while '' always works if there is no image or if it is all image types.

only put something there if you need to limit it to certain image formats.

unless something has changed since i changed the way i write scripts.

crol