GIMP Chat
http://gimpchat.com/

Difference between "real" and "python-fu" plugin
http://gimpchat.com/viewtopic.php?f=9&t=17156
Page 1 of 1

Author:  Herbie [ Thu Jan 17, 2019 5:30 am ]
Post subject:  Difference between "real" and "python-fu" plugin

After writing my first, modest plugin, I found the post "Plugins in Python - und zwar richtig" in the german "GIMP-Forum". I found this infos really great. The presented framework just seems to be more logical. Until this day I have programmed a "python-fu" plugin. Since I have previously designed my interfaces with GTK (import gtk), I immediately tried following the recommendation to work with PyGTK. Unfortunately without success, because in my current GIMP installation 2.10.8 PyGTK does not exist (error message at "import gi": ImportError: No module named gi). See attachment.
Attachment:
File comment: Real Python-Plugin
Python-Plugin_real.zip [812 Bytes]
Downloaded 107 times

That's why I have the following questions for a specialist:
- What's the difference between "*Real*" and "python-fu" plugin?
- Where can I find descriptions of methods such as "gimp.main()" or "gimp.install_procedure()"?
- I noticed that there are many examples of "python-fu" plugins, but almost no "* real *" plugins. Am I not looking right, or programming all "python-fu" plugins?
- How can I find out which modules have been installed with the latest GIMP version 2.10.8?
- For a plugin always a window surface is needed. It would be best to use a surface that was installed with the current GIMP version. How is this usually handled? What is your opinion about this? Which surface do you recommend?

I would be very grateful for your help!

Author:  ofnuts [ Thu Jan 17, 2019 8:06 am ]
Post subject:  Re: Difference between "real" and "python-fu" plugin

1. I think what the author calls a "real" plugin is a plugin that doesn't depend on the auto-generated parameter dialogs.
2. https://www.gimp.org/docs/python/index.html (and the Gimp source code)
3. Doing a decent UI is work, requires specific skills, and is often not worthwhile for small scripts, so there isn't much incentive to do the "real" ones, especially since the auto-generated dialogs are acceptable in many cases.
4. Python modules? On Windows, they should all be under the "python" subdirectory in the Gimp installation. The problem with your example is that it uses GTK3. Gimp still uses GTK2, so I you want the plugin to run on Windows in a plain Gimp you need to target GTK2 .
5. What do you mean by "surface"? If "some support for a GUI", then see 4) On Linux, it doesn't matter.

PS: My only plugin with its own GTK2 interface starts with:

from gimpfu import *
import pygtk,gtk
pygtk.require('2.0')


In addition there seem to be a problem in Gimp 2.10 that requires "gimpfu" to be imported before "pygtk" and "gtk".

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/