Switch to full style
Post all Gimp scripts and script writing questions here
Post a reply

AIMS? Selecting Points from withing a plugin...

Fri Nov 10, 2017 5:07 pm

AIMS: Am I Missing Something?

I'm a systems programmer new to GIMP code, so it's quite possible that I'm missing something obvious because I zipped along thinking I knew all I needed to know. I've written a plugin to do a simple transformation but currently the user must select a region with the poly select tool to define the transformation before calling the plugin. I'd much rather the user select the polygon from within the plugin, but I cannot for love nor money figure out how to do anything UI related from within a plugin! If this is by design, I'm curious to know why. If there is a way to select points from within a plugin I'd love to see how it's done!

I just feel it's more seemly to allow the user to define a transformation and have it apply only to a selection, as for the other image transformations and filters generally.

I appreciate anyone's attention to my little problem :)

Cheers

Re: AIMS? Selecting Points from withing a plugin...

Fri Nov 10, 2017 10:08 pm

I don't think you can start a plugin and then user picks polygon.
All the scripts that i have written that had to do with selection always had the user select the selection first and then script runs.

Re: AIMS? Selecting Points from withing a plugin...

Sun Nov 12, 2017 11:05 am

I've re-written it as a C plugin using sample points to define the quadrialteral, but I'm still not very happy with not being able to select points from within the plugin. Does anyone know anything about how one might do this with libgimp?

Re: AIMS? Selecting Points from withing a plugin...

Mon Nov 13, 2017 7:26 pm

Plugin cannot interact directly with the Canvas/UI, only "Tools" can, but there is no plugin mechanism for add your tools.

What you can do is require a path. You can extract a collection of points from it, and this doesn't force the user the create a selection. It is also easier to adjust than a polygon selection in case your plugin did't produce the expected result.

Re: AIMS? Selecting Points from withing a plugin...

Fri Dec 01, 2017 5:41 pm

ofnuts wrote:What you can do is require a path. You can extract a collection of points from it, and this doesn't force the user the create a selection. It is also easier to adjust than a polygon selection in case your plugin did't produce the expected result.


As stated by ofnuts, that is the technique I have used in the past. Have the user create a path then have a path selection as the input.

-Rob A>
Post a reply