It is currently Wed Jul 03, 2024 2:16 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Selection of a path component
PostPosted: Fri Mar 05, 2021 3:17 pm  (#1) 
Offline
GimpChat Member
User avatar

Joined: Aug 22, 2017
Posts: 72
An existing vector path consists of more than one component. I would now like to make a selection of, for example, the first and third components.

With the method
pdb.gimp_image_select_item(image, CHANNEL_OP_REPLACE, vector_id)
a selection can unfortunately only be made from the entire path.

Can I convert a stroke ID into an item ID?


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Selection of a path component
PostPosted: Sat Mar 06, 2021 5:45 am  (#2) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4752
No, you have to make a new path with the strokes (the "components") you want and then make a selection on the result path. Not that hard. For instance the code to split a path into its constituents (one path per stroke):

    for stroke in path.strokes:
        strokePath=gimp.Vectors(image,'%s [%d]' % (path.name,stroke.ID))
        points,closed=stroke.points
        gimp.VectorsBezierStroke(strokePath,points,closed)
        pdb.gimp_image_insert_vectors(image, strokePath, None,-1) 
        strokePath.visible=True

_________________
Image


Top
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) ofn-text-path-selection

14

No new posts Attachment(s) selection path help GIMP 2.10

3

No new posts Attachment(s) stroke selection/stroke path

2

No new posts Attachment(s) i struggle with the option to copy the path - the path where a file i

3

No new posts Attachment(s) Path copy rotate shift plus + Path copy rotate shift walk Play

79


cron

* Login  



Powered by phpBB3 © phpBB Group