Gimp-Forum.net

Full Version: Gimp Python script to do same thing as Free Select Tool
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I can use the  'Free Select Tool'  to draw polygons.How do I use Gimp Python-fu to do the same thing?

Should I use this?:  pdb.gimp_edit_stroke_vectors(drawable, vectors)

If so, I don't know what to do for the vectors parameter. I tried treating it like an array of coordinates, or an array of arrays of coordinates but that does not work.  So far I have learned to create an image, open an image in a layer, copy a layer and more. I am not making good progress on polygons.
You are on the wrong track, pdb.gimp_edit_stroke_vectors(drawable, vectors) is the API to "Edit>Stroke Path".

What you need is pdb.gimp_image_select_polygon(image, operation, num_segs, segs).