RSS/Atom feed Twitter
Site is read-only, email is disabled

[Script-fu] How to convert a path to a selection? (grafxuser)

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

1 of 1 message available
Toggle history

Please log in to manage your subscriptions.

[Script-fu] How to convert a path to a selection? (grafxuser) Saul Goode 05 Mar 04:45
Saul Goode
2012-03-05 04:45:31 UTC (over 12 years ago)

[Script-fu] How to convert a path to a selection? (grafxuser)

The procedure returns a list containing a count and an array of path IDs.

I would recommend converting this to a list using the R5RS function 'vector->list'. Mind that the "vector" in 'vector->list' is what Scheme chooses to call an array; it is completely unrelated to the GIMP concept of vectors/paths. To avoid confusion, I use the older "path" terminology for my user-defined functions and variables.

(let ((paths (vector->list (cadr (gimp-vectors-import-from-file image filename FALSE scale-to-imagesize ))))) ; we now have a list of 'paths' that have been imported. ; To select from the first path in the list, use the 'car' function (gimp-vectors-to-selection (car paths) 2 TRUE FALSE 0 0)
)

If more than one path has been imported, you could loop through the list of path IDs, adding each selection.