RSS/Atom feed Twitter
Site is read-only, email is disabled

how to call a plugin

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

3 of 3 messages available
Toggle history

Please log in to manage your subscriptions.

how to call a plugin Luis A. Florit 14 Mar 16:33
how to call a plugin William Skaggs 14 Mar 16:49
how to call a plugin Luis A. Florit 14 Mar 18:27
Luis A. Florit
2007-03-14 16:33:17 UTC (about 17 years ago)

how to call a plugin

Pals,

I am feeling so silly in trying to develop a plugin... I am stalling even at the most easy tasks.

Now, I just want to blur my drawable from my plugin. I tried this:

GimpParam *rreturn_vals; gint nnreturn_vals;
rreturn_vals = gimp_run_procedure("plug_in_blur", &nnreturn_vals, GIMP_PDB_INT32, GIMP_RUN_NONINTERACTIVE, GIMP_PDB_IMAGE, param[1].data.d_image, GIMP_PDB_DRAWABLE, gimp_drawable_get (param[2].data.d_drawable), GIMP_PDB_END);

However, I get the following error:

Procedure 'plug-in-blur' has been called with an invalid ID for argument 'drawable'. Most likely a plug-in is trying to work on a layer that doesn't exist any longer.

What am I doing wrong?

Sorry for the silly questions........ and thanks!

Luis.

William Skaggs
2007-03-14 16:49:46 UTC (about 17 years ago)

how to call a plugin

Luis Florit wrote:

Now, I just want to blur my drawable from my plugin. I tried this:

GimpParam *rreturn_vals; gint nnreturn_vals;
rreturn_vals = gimp_run_procedure("plug_in_blur", &nnreturn_vals, GIMP_PDB_INT32, GIMP_RUN_NONINTERACTIVE, GIMP_PDB_IMAGE, param[1].data.d_image, GIMP_PDB_DRAWABLE, gimp_drawable_get (param[2].data.d_drawable), GIMP_PDB_END);

However, I get the following error: [...]

The problem is the "gimp_drawable_get". As you can learn in the "GimpDrawable" section of the libgimp documentation, this function does not return the integer ID of the drawable, it creatss a new struct containing information about the drawable. I think you should just use param[2].data.d_drawable. (The handling of drawables in libgimp is pretty awkward, but probably shouldn't be changed at this point because it would create huge backward compatibility issues.)

-- Bill


______________ ______________ ______________ ______________ Sent via the CNPRC Email system at primate.ucdavis.edu

Luis A. Florit
2007-03-14 18:27:22 UTC (about 17 years ago)

how to call a plugin

Hi Bill,

Now, I just want to blur my drawable from my plugin. I tried this:

GimpParam *rreturn_vals; gint nnreturn_vals;
rreturn_vals = gimp_run_procedure("plug_in_blur", &nnreturn_vals, GIMP_PDB_INT32, GIMP_RUN_NONINTERACTIVE, GIMP_PDB_IMAGE, param[1].data.d_image, GIMP_PDB_DRAWABLE, gimp_drawable_get (param[2].data.d_drawable), GIMP_PDB_END);

However, I get the following error: [...]

The problem is the "gimp_drawable_get". As you can learn in the "GimpDrawable" section of the libgimp documentation, this function does not return the integer ID of the drawable, it creatss a new struct containing information about the drawable. I think you should just use param[2].data.d_drawable. (The handling of drawables in libgimp is pretty awkward, but probably shouldn't be changed at this point because it would create huge backward compatibility issues.)

Yep, it worked!
Thanks a lot!!

L.