It is currently Thu Jul 04, 2024 5:22 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Difference between "real" and "python-fu" plugin
PostPosted: Thu Jan 17, 2019 5:30 am  (#1) 
Offline
GimpChat Member
User avatar

Joined: Aug 22, 2017
Posts: 72
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 106 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!


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Difference between "real" and "python-fu" plugin
PostPosted: Thu Jan 17, 2019 8:06 am  (#2) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4756
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".

_________________
Image


Top
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Difference between "Python-Fu" and "Python" plugin

6

No new posts Attachment(s) pm_rusty_text_effect plugin (almost real)

3

No new posts Convert GIMP plugin from Python 2 to Python 3

4

No new posts Attachment(s) Macbook User and Python plugin

14

No new posts Unable to get simple python plugin to show up

8



* Login  



Powered by phpBB3 © phpBB Group