Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Draw a path by script-fu
#1
Hi! Is it possible to draw a path by script-fu? Can u link me a tutorial or documentations?
Reply
#2
I don't use script-fu so I cannot tell you the exact syntax, but in python it goes likes this:

Code:
pdb.gimp_context_set_line_width(self.lineWidth)
pdb.gimp_context_set_line_cap_style(self.capStyle)
pdb.gimp_context_set_line_join_style(self.joinStyle)
pdb.gimp_context_set_line_miter_limit(float(self.miterLimit))
pdb.gimp_context_set_antialias(self.antiAlias)
pdb.gimp_context_set_stroke_method(STROKE_LINE)  # requires 2.10!
pdb.gimp_edit_stroke_vectors(layer,path)

The really important bits are gimp_context_set_stroke_method(STROKE_LINE) (so it uses the Line mode instead of painting ti the brush), and gimp_edit_stroke_vectors(layer,path) to do the actual operation. The rest may or may not be useful.

For script-fu, drop pdb. and replace the underscores with dashes (so pdb.gimp_context_set_line_miter_limit becomes gimp-context-set-line-miter-limit)
Reply


Forum Jump: