Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with plugin
#2
(10-10-2019, 05:33 PM)carmen Wrote: Hello!
My first attempt in phyton, and... plugin doesn't register. Huh Suspect fault is something very basic... Sad
Can somebody help, please?
Many  thanks!

First thing to do is to run your script outside of Gimp. This weeds out the worst mistakes:

Code:
22:17:31 @ python/ : >python group-text2path.py
  File "group-text2path.py", line 25
    path = pdb.gimp-vectors-new-from-text-layer(image,textLayer)
                                   ^
SyntaxError: invalid syntax

So, pitfall #1: the doc for Python is a somewhat verbatim copy of the Scheme doc. But if in Scheme you can have symbols-with-dashes, these are not allowed in Python (undistinguishable from a subtraction). So in the Python API, symbols-with-dashes are really symbols_with_underscores.  Use the Apply button in the PDB browser to get a Python-acceptable version of the call copied to the Python console.


Other problems:
  • you are using image is a function but you didn't pass it as a parameter
  • pdb.gimp_image_add_vectors(...) doesn't return anything. So to make the path visible, just use yourpath variable: pdb.gimp_item_set_visible(path,TRUE)
Once you have done that, it works, congratulations!
Reply


Messages In This Thread
Help with plugin - by carmen - 10-10-2019, 05:33 PM
RE: Help with plugin - by Ofnuts - 10-10-2019, 08:36 PM
RE: Help with plugin - by carmen - 10-10-2019, 10:03 PM
RE: Help with plugin - by Ofnuts - 10-11-2019, 06:22 AM
RE: Help with plugin - by carmen - 10-11-2019, 05:24 PM

Forum Jump: