GIMP Vectors Object Documentation
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.
GIMP Vectors Object Documentation | Barton | 04 Sep 06:00 |
GIMP Vectors Object Documentation | Simon Budig | 04 Sep 12:17 |
GIMP Vectors Object Documentation | Barton | 06 Sep 07:37 |
GIMP Vectors Object Documentation | Barton | 09 Sep 19:37 |
GIMP Vectors Object Documentation | Simon Budig | 10 Sep 11:45 |
GIMP Vectors Object Documentation | Barton | 11 Sep 06:04 |
GIMP Vectors Object Documentation | Sven Neumann | 11 Sep 08:03 |
GIMP Vectors Object Documentation | Simon Budig | 11 Sep 10:53 |
GIMP Vectors Object Documentation | Sven Neumann | 12 Sep 08:39 |
GIMP Vectors Object Documentation | David Gowers | 12 Sep 09:01 |
GIMP Vectors Object Documentation | Barton | 15 Sep 21:45 |
GIMP Vectors Object Documentation
Hi All,
I've been doing a little python-fu lately and find that in 2.3.18 stroking paths uses vector objects. So far I haven't turned up any practical examples of the use of the various pdb vectors functions in the source or on the Web, nor had any success through trial and error.
Could someone point me to documentation for the pdb vectors procedures and/or post a brief sample python-fu snippet that creates a circular path and then draws a circle by stroking the path/vector?
Thanks,
Barton
GIMP Vectors Object Documentation
Barton (bartonbosch@gmail.com) wrote:
I've been doing a little python-fu lately and find that in 2.3.18 stroking paths uses vector objects. So far I haven't turned up any practical examples of the use of the various pdb vectors functions in the source or on the Web, nor had any success through trial and error.
Could someone point me to documentation for the pdb vectors procedures and/or post a brief sample python-fu snippet that creates a circular path and then draws a circle by stroking the path/vector?
Here is a simple script-fu script to construct an circle and stroke it, It should be possible to convert it to python easily.
Note that you right now cannot control every aspect of stroking, since the gimp context does not yet store stuff like e.g. a dash pattern.
I hope this helps. Simon
GIMP Vectors Object Documentation
Simon Budig wrote:
Barton (bartonbosch@gmail.com) wrote:
I've been doing a little python-fu lately and find that in 2.3.18 stroking paths uses vector objects. So far I haven't turned up any practical examples of the use of the various pdb vectors functions in the source or on the Web, nor had any success through trial and error.
Could someone point me to documentation for the pdb vectors procedures and/or post a brief sample python-fu snippet that creates a circular path and then draws a circle by stroking the path/vector?
Here is a simple script-fu script to construct an circle and stroke it, It should be possible to convert it to python easily.
Note that you right now cannot control every aspect of stroking, since the gimp context does not yet store stuff like e.g. a dash pattern.
Thanks Simon, that is exactly what I was after. After I've had a chance to translate scheme->python and try some things out I'll feed it back to the list.
Have a good one,
Barton
GIMP Vectors Object Documentation
Simon Budig wrote:
Barton (bartonbosch@gmail.com) wrote:
I've been doing a little python-fu lately and find that in 2.3.18 stroking paths uses vector objects. So far I haven't turned up any practical examples of the use of the various pdb vectors functions in the source or on the Web, nor had any success through trial and error.
Could someone point me to documentation for the pdb vectors procedures and/or post a brief sample python-fu snippet that creates a circular path and then draws a circle by stroking the path/vector?
Here is a simple script-fu script to construct an circle and stroke it, It should be possible to convert it to python easily.
Note that you right now cannot control every aspect of stroking, since the gimp context does not yet store stuff like e.g. a dash pattern.
I've tried translating the draw_circle script-fu to python, and also checked the script-fu itself in my 2.3.18 installation without success; the circular path is created but it isn't stroked.
Simon, did you write your sample script-fu for 2.3.19?
Thanks for the help,
Barton
GIMP Vectors Object Documentation
Barton (bartonbosch@gmail.com) wrote:
I've tried translating the draw_circle script-fu to python, and also checked the script-fu itself in my 2.3.18 installation without success; the circular path is created but it isn't stroked.
Simon, did you write your sample script-fu for 2.3.19?
I created it for the current svn version. It shouldn't be a that big difference, but I found a bug while writing it, which is fixed in current SVN - this bug created artefacts in the created stroke, but you should get a visible somethign.
Make sure that the context you're using for stroking is set up correctly and make sure you're not stroking white on white or whatever.
Hope this helps, Simon
GIMP Vectors Object Documentation
Simon Budig wrote:
Barton (bartonbosch@gmail.com) wrote:
I've tried translating the draw_circle script-fu to python, and also checked the script-fu itself in my 2.3.18 installation without success; the circular path is created but it isn't stroked.
Simon, did you write your sample script-fu for 2.3.19?
I created it for the current svn version. It shouldn't be a that big difference, but I found a bug while writing it, which is fixed in current SVN - this bug created artefacts in the created stroke, but you should get a visible somethign.
Make sure that the context you're using for stroking is set up correctly and make sure you're not stroking white on white or whatever.
Ok, testing your scheme script-fu again with a few additional settings does turn up a different result. Apparently the stroke is being made with the background color though the pdb for gimp-edit-stroke-vectors says:
"This procedure strokes the specified vectors object, painting along the path with the active brush and foreground color"
That's the gotcha that got me on this one. Another minor issue is that immediately after running draw_circle, the stroke appears in the layer dialog but it does not appear in the image itself unless you toggle the layer's visibility off and on. So far I haven't gotten the python version to draw anything yet but I'll let you know if I get it figured out.
Cheers,
Barton
GIMP Vectors Object Documentation
Hi,
On Mon, 2007-09-10 at 21:04 -0700, Barton wrote:
That's the gotcha that got me on this one. Another minor issue is that immediately after running draw_circle, the stroke appears in the layer dialog but it does not appear in the image itself unless you toggle the layer's visibility off and on.
Does your script call gimp-drawable-flush()? If it doesn't, then it's not surprising that the image view is not updated.
Sven
GIMP Vectors Object Documentation
Sven Neumann (sven@gimp.org) wrote:
On Mon, 2007-09-10 at 21:04 -0700, Barton wrote:
That's the gotcha that got me on this one. Another minor issue is that immediately after running draw_circle, the stroke appears in the layer dialog but it does not appear in the image itself unless you toggle the layer's visibility off and on.
Does your script call gimp-drawable-flush()? If it doesn't, then it's not surprising that the image view is not updated.
Right, I forgot about this - The script I posted did not have the (gimp-displays-flush) in it.
Also note that for general bezier paths it is a bit different - there
you would create a new stroke using
gimp-vectors-bezier-stroke-new-moveto and then pass its return values to
functions like gimp-vectors-bezier-stroke-lineto, -curveto, -conicto
etc. to iteratively construct the stroke in the vectors object.
I hope this helps, Simon
GIMP Vectors Object Documentation
Hi Simon,
what about the other issue that Barton reported?
Apparently the stroke is being made with the background color though the pdb for gimp-edit-stroke-vectors says:
"This procedure strokes the specified vectors object, painting along the path with the active brush and foreground color"
This sounds like a bug to me.
Sven
GIMP Vectors Object Documentation
I converted the script to python (useful script, btw -- thanks Simon.), and I cannot reproduce this. I did, however, find that I was occasionally tripped up by paint mode -- for example, if Addition mode was selected rather than Normal, then drawing black on a white background had no effect. The other condition that can cause this appearance is when the selection masks out all of the area you are stroking.
On 9/12/07, Sven Neumann wrote:
Hi Simon,
what about the other issue that Barton reported?
Apparently the stroke is being made with the background color though the pdb for gimp-edit-stroke-vectors says:
"This procedure strokes the specified vectors object, painting along the path with the active brush and foreground color"
This sounds like a bug to me.
Sven
GIMP Vectors Object Documentation
On 9/12/07, Sven Neumann wrote:
Hi Simon,
what about the other issue that Barton reported?
Apparently the stroke is being made with the background color though the pdb for gimp-edit-stroke-vectors says:
"This procedure strokes the specified vectors object, painting along the path with the active brush and foreground color"
David Gowers wrote:
I converted the script to python (useful script, btw -- thanks Simon.), and I cannot reproduce this.
Going back and repeating my earlier tests I find that I cannot reproduce the background color issue I reported either.
I believe that I have identified the problem however: my installation of 2.3.18 is defaulting to the erase tool at start-up. When I open 2.3.18 and run Simon's draw_circle script (in scheme or python) without first selecting the paintbrush tool from the toolbox the path is stroked with the erase tool.
Surely this is the intended behavior, but it wasn't obvious to me that the erase tool is considered a paint brush. Would it be helpful to note this in the pdb blurb, or would that amount to clutter?
Long story short, I ran my tests on an image with no alpha channel and a white background color and probably jumped to the incorrect conclusion with regard to the cause of the missing circle. FWIW my adaptation to Python of Simon's script-fu is attached.
Thanks all,
Barton