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

Always open PDB from Python console not Help -> Procedure Browser

Sat Dec 10, 2016 1:25 am

I was reading a tutorial and it said that the Gimp user could double-click a procedure in the PDB and a statement for that function would be created in the Python console (underscores and all). That sounded neat, but it didn't work for me. Nothing happened.

Code:
>>>pdb.gimp_desaturate_full(drawable, desaturate_mode)


But I figured it out. If you open the PDB from the Python Console, it works :-) Besides double-click, there is an "Apply" button. It works differently if you open from Help -> Procedure Browser. I usually start with the PDB to find something... and then wanting to try it out, I'd open the Python Console. To be honest, it is documented: https://docs.gimp.org/en/gimp-filters-python-fu.html, but it didn't sink in until I started using it.

New to Gimp Python scripting should definitely use the PDB from the Python Console, if using Python.
I see script-fu also has a browse from the console.

One suggestion for the Procedure Browser: a checkbox to exclude deprecated functions. It would eliminate 188 procedures or a little over 13%.

Re: Always open PDB from Python console not Help -> Procedure Browser

Sat Dec 10, 2016 4:07 am

vA+6Q-Hv[BX] wrote:....One suggestion for the Procedure Browser: a checkbox to exclude deprecated functions. It would eliminate 188 procedures or a little over 13%.


If you start Gimp with compatibility off then the deprecated procedures are not shown.

Code:
gimp --pdb-compat-mode=off

pdb-compat-mode=off breaks xsane plugin

Sat Dec 10, 2016 11:12 pm

I changed the gimp desktop file command to:
gimp-2.8 %U --no-splash --pdb-compat-mode=off

Cool. The option got rid of all deprecated functions except two (script-fu-copy-visible, script-fu-selection-round).

Update:

Using "--pdb-compat-mode=off" broke the XSane plugin.

By broke, I mean, no scanned image appeared and there was an error in the Gimp log, "Calling error for procedure 'gimp-image-add-layer':
Procedure 'gimp-image-add-layer' not found". If I remove the option, all is fine. Oh well...
Post a reply