Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
procedure not found
#1
Good day to everybody...
I'm trying to call a G'MIC pluging from a pyhon-fu plugin with the following line:

pdb.gimp_run_procedure("script_fu_engrave", [image, layer])

The script I'm trying to call is:

(define (script_fu_engrave image drawable)
  (plug-in-gmic-qt RUN-NONINTERACTIVE image drawable 0 0 "fx_engrave 0.04,40,0,2,45,-1,1,0,10,1,0,0,0,1,0,50,50")
)
(script-fu-register "script-fu-engrave"
                    "<Image>/Filters/Custom/Engrave"
                    "Apply the Engrave filter"
                    "Your Name"
                    "Your Name"
                    "2024"
                    ""
                    SF-IMAGE "Image" 0
                    SF-DRAWABLE "Drawable" 0)

Script and plugin are into the right directories but the code return to me the following error:

Traceback (most recent call last):
  File "C:\Program Files\GIMP 2\lib\gimp\2.0\python/gimpfu.py", line 741, in response
    dialog.res = run_script(params)
  File "C:\Program Files\GIMP 2\lib\gimp\2.0\python/gimpfu.py", line 362, in run_script
    return apply(function, params)
  File "C:\Program Files\GIMP 2\lib\gimp\2.0\plug-ins\GammaCorr1.py", line 66, in python_fu_custom_function
    pdb.gimp_run_procedure("script_fu_engrave", [image, layer])
error: procedure not found

I spent a full day to try to fix it and I am very frustrated... Is there someone who kindly help me?
Reply
#2
Why go thru the script-fu thing when you can a call GMIC directly from Python?

Code:
pdb.plug_in_gmic_qt(image,image.active_layer,1, 0, "fx_engrave 0.04,40,0,2,45,-1,1,0,10,1,0,0,0,1,0,50,50")

(changed your "input" parameter to "1" because "0" does not show any effect).

If you want to pursue with the intermediate script, check that it is registered correctly. If it is, it should show up in the PDB browser in the Python console, and be part of the PDB so you can call it directly: pdb.script_fu_engrave(image...)
Reply


Forum Jump: