GEGL operation as a GIMP plugin with UI builder

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

GEGL operation as a GIMP plugin with UI builder

Developers mailing list

Hello,

I'm still in the quest of creating a pixel based gimp plugin.

Also this question is both for gimp and gegl, but pippin from gegl, directed
me more towards gimp list (here).

I've managd to create a gegl operation - which seems to work fine (apart
some detail). The catch is that my implementation currently has the form of
directly altering gegl source code, recompiling whole gegl, installing that
and loading that into a gimp as a 'Tools-GEGL Operation', which is a lot
unwieldy.

Is there a way to implement a gegl operation in the form of a modular gimp
plugin, so it would work with ui builder widgets, like proprerty_double(),
auxulary inputs, etc? (see https://gitlab.gnome.org/GNOME/gegl/blob/master/
operations/common/exposure.c#L26 for example). All the plugins in /plugins/
seems to build its ui from scratch instead uf using gegl-like widgets.

Hte second issue I have is that most of the enums from here https://gitlab.
gnome.org/GNOME/gegl/blob/master/gegl/gegl-op.h#L271 work, apart from
property_curve() from #L282. Is there a way to enable property_curve in gimp
()

Thanks
_______________________________________________
gimp-developer-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list
Reply | Threaded
Open this post in threaded view
|

Re: GEGL operation as a GIMP plugin with UI builder

Developers mailing list


On 1/31/20 1:07 PM, JonnyRobbie via gimp-developer-list wrote:

>
> Hello,
>
> I'm still in the quest of creating a pixel based gimp plugin.
>
> Also this question is both for gimp and gegl, but pippin from gegl, directed
> me more towards gimp list (here).
>
> I've managd to create a gegl operation - which seems to work fine (apart
> some detail). The catch is that my implementation currently has the form of
> directly altering gegl source code, recompiling whole gegl, installing that
> and loading that into a gimp as a 'Tools-GEGL Operation', which is a lot
> unwieldy.
>
> Is there a way to implement a gegl operation in the form of a modular gimp
> plugin, so it would work with ui builder widgets, like proprerty_double(),
> auxulary inputs, etc? (see https://gitlab.gnome.org/GNOME/gegl/blob/master/
> operations/common/exposure.c#L26 for example). All the plugins in /plugins/
> seems to build its ui from scratch instead uf using gegl-like widgets.

Plug-ins and GEGL operations are two separate things.  Essentially,
plug-ins get a much higher-level access to GIMP -- they understand stuff
like images and layers -- while GEGL operations are filters that
transform an input buffer (or buffers) into an output.  If what you're
making fits into the model of a filter, you're much better off
implementing it as a GEGL operation, for the reasons pippin mentioned in
his mail.  Namely, better integration (e.g., a live on-canvas preview,
and, in the future, non-destructive editing), and much less boilerplate.
Most of the old plug-ins that implemented filters have been converted to
GEGL ops.

The main gotcha right now is the inability of GEGL ops to register a
menu item.  The ones that do show in the menu are hard-coded, while
other operations can only be accessed through the GEGL operation tool.
That's indeed pretty clunky, and it's something we want to fix, along
with better support for applying GEGL operations in scripts and plug-ins.

Plug-ins in general don't get an auto-generated UI right now (other than
scripts and python plug-ins), though the entire plug-in framework is
undergoing major changes for GIMP 3, with support for auto-generated UI
being one of them.

As for building GEGL ops, you can do it out-of-tree, without having to
build it as part of GEGL.  Essentially, if you start with one of the ops
from the GEGL tree, remove the `#include "config.h"` line, and compile
it as a shared library against GEGL (e.g., using `pkg-config --cflags
--libs gegl-0.4`; also, make sure the directory containing your source
file is in the include path), you should be able to get a standalone
library containing your op.

> Hte second issue I have is that most of the enums from here https://gitlab.
> gnome.org/GNOME/gegl/blob/master/gegl/gegl-op.h#L271 work, apart from
> property_curve() from #L282. Is there a way to enable property_curve in gimp
> ()

Nope, there's no UI for property_curve() in GIMP right now.

--
Ell
_______________________________________________
gimp-developer-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list