Re: [Gimp-developer] GIMP python (pythonfu) plugin: How to include the PreviewArea from gimpui



On 21 July 2013 04:47, Joao S. O. Bueno <gwidion mpc com br> wrote:

On 20 July 2013 17:58, Alexandre Prokoudine
<alexandre prokoudine gmail com> wrote:
On Sat, Jul 20, 2013 at 9:22 PM, Akkana Peck <akkana shallowsky com>
wrote:
Michael Schroeder writes:
I am writing a plugin for Gimp. It works alright via the GIMP UI and
command line by registering it to gimp. But I would wish to offer also
a
Preview area in the UI, and apparently it is not so easy to add the
PreviewArea from the gimpui python package to the input dialog.

Since I haven't seen any other responses:

I don't think there's a way to add a formal preview area in Python.

AFAIK, that was one of the points of GIMP's GSoC2010 project re
Python. The one that was never merged.

That part was not complete, anyway.  :-/

But in current GIMP what makes sense is to figure out how to make GEGL
calls from GIMP-Python plug-ins, and create an on-screen preview API
using the GEGL capabilities. And while one is at that, there is the
need port Python-fu from pygtk to gobject introspection as well - I
hacked a bit on it a while ago, and I think it can be done while
keeping backwards compatibility for python-fu scripts.


GI bindings are not very well supported for GTK+2, and probably will never
be. So switching to GI makes sense to do together with GTK+3 switch, that
is GIMP 3.0. That also means that compatibility does not need to be 100%,
though it should be possible to keep most things compatible. In MyPaint we
used pygtkcompat and some compat wrappers of our own for that:
http://gitorious.org/mypaint/mypaint/blobs/master/gui/gtk2compat.py

One thing that gave us hell is that when using PyGI one cannot import
anything that uses PyGTK. Doing so led to instant crash... This might make
it neccesary to install an import handler to make sure that plugins don't
accidentially pull in PyGTK when the core/new plugins uses PyGI.

As for preview with GEGL, gegl-gtk has a widget should work just fine for
that - and will automatically handle updates and transformations.
Long-term, I hope that we can find a way for plugins to have on-canvas
preview.

-- 
Jon Nordby - www.jonnor.com


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]