(10-10-2019, 05:33 PM)carmen Wrote: Hello!
My first attempt in phyton, and... plugin doesn't register.Suspect fault is something very basic...
![]()
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)