[Gimp-developer] Image history access from python

2014-01-15 Thread Paco Garcia
hi, it would be very helpful to have access to the history of each image object
from python, at least to the coordinates where the user has pressed, for
example in two of my scripts to take coordinates from the user I force them
to create paths of only use the coordinates of two nodes, if I had access
to the user history clicks only have to access the last two clicks, for
example:
img = gimp.image_list () [0]
h = img.History
x1, y1 = h.mousePos [h.Length-1]
x2, y2 = h.mousePos [h.Length]
Or something like this
Currently forced the user to create paths which then has to clear, the
examples are:
http://www.arakne.es/en/dessign/gimp-python-plugin-rotate-image-using-paths/
http://www.arakne.es/en/dessign/gimp-script-stitch-layers/
Paco García
___
gimp-developer-list mailing list
List address:gimp-developer-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list


Re: [Gimp-developer] Image history access from python

2014-01-15 Thread Joao S. O. Bueno
Hi Pacco-

yes, subverting Path creation for getting user coordinates is currently the only
way GIMP plug-ins have to get them. (You could however, clear the
paths on the plug-in call if in your workflow clearing them become a
burden)


It is interesting to note that even the C plug-ins that ship with GIMP can only
get image coordinates by re-creating an image preview inside their window
(that could be done from Python plug-ins as well). But this is done by
old-style plug-ins  - new style plug-ins, using GEGL, don have much
of an UI definition yet, besides automatically generated UIs from the
GEGL-operation parameters.

I had proposed a couple of times in the past (distant past by now) to have
a way to call-back plug-ins upon user
actions on the images. Such a discussion should pop back
anytime soon, since on-dialog image previews for plug-ins
are now a thing of the past.

I don't think your proposal as is should fly though - I can't see
how to define
an image click from within a plug-in like you do. A click using what
tool? What settings?

Maybe a plug-in tool that would give a plug-in (or Gegl-op ) access
to all stroke parameters, more or less as specified in the ink markup
language would be a
more solid approach for GIMP (http://www.w3.org/TR/InkML/) in the
foreseable future.

  js
 --

On 15 January 2014 07:42, Paco Garcia jfga...@gmail.com wrote:
 hi, it would be very helpful to have access to the history of each image 
 object
 from python, at least to the coordinates where the user has pressed, for
 example in two of my scripts to take coordinates from the user I force them
 to create paths of only use the coordinates of two nodes, if I had access
 to the user history clicks only have to access the last two clicks, for
 example:
 img = gimp.image_list () [0]
 h = img.History
 x1, y1 = h.mousePos [h.Length-1]
 x2, y2 = h.mousePos [h.Length]
 Or something like this
 Currently forced the user to create paths which then has to clear, the
 examples are:
 http://www.arakne.es/en/dessign/gimp-python-plugin-rotate-image-using-paths/
 http://www.arakne.es/en/dessign/gimp-script-stitch-layers/
 Paco García
 ___
 gimp-developer-list mailing list
 List address:gimp-developer-list@gnome.org
 List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
 List archives:   https://mail.gnome.org/archives/gimp-developer-list
___
gimp-developer-list mailing list
List address:gimp-developer-list@gnome.org
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list