Hi,
Many thanks for the answer, but I did already went there, and, as I asked, I would just like a simple example.
Here for example, there are four samples that are perfect to show the use of some stuff :
http://gimpfr.org/contrib_template.phpWhat I mean is that there may be just one or two lines I can't find an example how to create (not use,
create) in a few lines (like the 4 examples above) a path then stroke.
I've already written an article on
"how to write python fu plugin" with three hints that made me loose one day. One day for small hints
![crying :cry](./images/smilies/022.gif)
.
And I guess this is probably the same: it's very easy once you know how to do it, but it will take ages to find that hint.
That's why I'm asking here: I just want to avoid loosing a lot of time if someone already know that "hint".
Thank you very much for your help
![Thankful :tyspin](./images/smilies/thankyouspin.gif)
, and your site helped me a lot, so if I get no answer, I'll spend some hours trying to find how to create a path then stroke.
![crying :cry](./images/smilies/022.gif)
By the way I didn't manage to "use" your source code because you need params:
(PF_IMAGE, "image", "Input image", None),
(PF_VECTORS, "refpath", "Input path", None),
I don't know how to precise "refpath". If I start from an empty picture, what are the steps needed to be able to precise "refpath"?
/Update/
Ok I've found what I needed:
Here's a part of my code that works: it creates the image, add the layers, creates new "vectors":
new_image = pdb.gimp_image_new( new_image_width, new_image_height, RGB )
new_layer = pdb.gimp_layer_new(
new_image, new_image.width, new_image.height,
RGBA_IMAGE, _("Background"), 100, NORMAL_MODE)
pdb.gimp_image_add_layer(new_image, new_layer, -1)
pdb.gimp_drawable_fill(new_layer, fill_type )
new_layer = gimp.Layer(
new_image, _("New Layer"),
new_image.width, new_image.height,
RGBA_IMAGE, 100, NORMAL_MODE)
pdb.gimp_image_add_layer(new_image, new_layer, -1)
pdb.gimp_drawable_fill(new_layer, fill_type )
new_vectors=pdb.gimp_vectors_new(new_image, 'Vectors!')
t = int(round(step / 1.5))
pdb.gimp_vectors_stroke_new_from_points(
new_vectors,
0, # 0 = Beziers Curve
30,
# {controle1} {centre} {controle2}
[ x-(step-t), y, x-step, y, x-(step-t), y,
x, y+(step-t), x, y+step, x, y+(step-t),
x+(step-t), y, x+step, y, x+(step-t), y,
x, y-(step-t), x, y-step, x, y-(step-t),
x-(step-t), y, x-step, y, x-(step-t), y],
False) # Closed = True
pdb.gimp_image_add_vectors(new_image, new_vectors, 0)
pdb.gimp_context_set_foreground( (255,255,255) )
pdb.gimp_context_set_brush( "Circle (07)" )
pdb.gimp_edit_stroke_vectors(new_layer, new_vectors)
gimp.Display( new_image )