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

gimp_run_procedure() not working

This discussion is connected to the gimp-user-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.

gimp_run_procedure() not working cypher2k12 05 Jan 21:52
  gimp_run_procedure() not working Shlomi Fish 06 Jan 10:59
   gimp_run_procedure() not working cypher2k12 06 Jan 15:51
2017-01-05 21:52:26 UTC (almost 8 years ago)
postings
2

gimp_run_procedure() not working

Hey guys, can somebody please tell me where I am going wrong? I am trying to use the 'gimp_run_procedure()' function to call the normal map plug-in, but I can not for the life of me get it to work. It builds without errors. Just doesn't work in GIMP.

Here is a snippet of the code:

gint n_return_vals;

gimp_run_procedure("plug-in-normalmap", &n_return_vals, GIMP_PDB_INT32, 1,
GIMP_PDB_IMAGE, param[1].data.d_image, GIMP_PDB_DRAWABLE, param[2].data.d_drawable, GIMP_PDB_INT32, 0,
GIMP_PDB_FLOAT, 0,
GIMP_PDB_FLOAT, 10,
GIMP_PDB_INT32, 0,
GIMP_PDB_INT32, 0,
GIMP_PDB_INT32, 0,
GIMP_PDB_INT32, 0,
GIMP_PDB_INT32, 0,
GIMP_PDB_INT32, 0,
GIMP_PDB_INT32, 0,
GIMP_PDB_INT32, 0,
GIMP_PDB_FLOAT, 0,
GIMP_PDB_DRAWABLE, param[2].data.d_drawable, GIMP_PDB_END
);

Shlomi Fish
2017-01-06 10:59:58 UTC (almost 8 years ago)

gimp_run_procedure() not working

Hi cypher2k12,

On Thu, 05 Jan 2017 22:52:26 +0100 cypher2k12 wrote:

Hey guys, can somebody please tell me where I am going wrong? I am trying to use the 'gimp_run_procedure()' function to call the normal map plug-in, but I can not for the life of me get it to work. It builds without errors. Just doesn't work in GIMP.

Here is a snippet of the code:

gint n_return_vals;

gimp_run_procedure("plug-in-normalmap", &n_return_vals, GIMP_PDB_INT32, 1,
GIMP_PDB_IMAGE, param[1].data.d_image, GIMP_PDB_DRAWABLE, param[2].data.d_drawable, GIMP_PDB_INT32, 0,
GIMP_PDB_FLOAT, 0,

This will likely pass the "0" as an integer instead of a float or double - you may need to do ((double)0).

Otherwise, see these pages - http://sscce.org/ ; http://catb.org/~esr/faqs/smart-questions.html ; https://github.com/shlomif/Freenode-programming-channel-FAQ/blob/master/FAQ.mdwn. You may wish to provide the sources for the SSCCE in a public git/etc. repository or a .zip file or whatever.

Regards,

Shlomi Fish

GIMP_PDB_FLOAT, 10,
GIMP_PDB_INT32, 0,
GIMP_PDB_INT32, 0,
GIMP_PDB_INT32, 0,
GIMP_PDB_INT32, 0,
GIMP_PDB_INT32, 0,
GIMP_PDB_INT32, 0,
GIMP_PDB_INT32, 0,
GIMP_PDB_INT32, 0,
GIMP_PDB_FLOAT, 0,
GIMP_PDB_DRAWABLE, param[2].data.d_drawable, GIMP_PDB_END
);

-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
NSA Factoids - http://www.shlomifish.org/humour/bits/facts/NSA/

E‐mail, web feeds, and doing something productive — choose two.

Please reply to list if it's a mailing list post - http://shlom.in/reply .
2017-01-06 15:51:29 UTC (almost 8 years ago)
postings
2

gimp_run_procedure() not working

Hi cypher2k12,

On Thu, 05 Jan 2017 22:52:26 +0100 cypher2k12 wrote:
This will likely pass the "0" as an integer instead of a float or double - you
may need to do ((double)0).

Otherwise, see these pages - http://sscce.org/ ; http://catb.org/~esr/faqs/smart-questions.html ; https://github.com/shlomif/Freenode-programming-channel-FAQ/blob/master/FAQ.mdwn. You may wish to provide the sources for the SSCCE in a public git/etc. repository or a .zip file or whatever.

Regards,

Shlomi Fish

Good news! That was the issue! I just had to stick the decimal point on the ends of the floating point numbers. God, that's some anal code there! I've gotten a bit too comfortable with C++! :D

Thank you! That was driving me mad!