Re: [Gimp-developer] undoo history and automatic script creation

2006-10-04 Thread Sven Neumann
Hi,

On Wed, 2006-10-04 at 18:07 -0700, Saul Goode wrote:

> I am unaware of any PDB function that would permit and would be
> interested in any input as to how this might be accomplished --
> including which code in the core I might avail if I were to create such
> a PDB function.

The undo functionality is intentionally not exported to the PDB because
it would be too easy for scripts and plug-ins to mess with the fragile
internals of it then. What you described as a possible use case seems to
be a very special case and I expect that anyone but the script author
himself would only find it confusing.


Sven


___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] undoo history and automatic script creation

2006-10-04 Thread Emile Snyder
On Thu, 2006-10-05 at 01:32 +0200, Michael Schumacher wrote:
> Saul Goode wrote:
> > A macro recorder would basically have to be a different implementation
> > than the UNDO history. I imagine certain simple actions (such as
> > changing the opacity of a layer, select->none, etc) are already recorded
> > in the UNDO history as "actions" and you might examine how those are
> > handled if you are interested in implementing a macro recorder.

Ahh, guess I should have dug a little deeper before mouthing off ;)

> There is an enhancement request about a script/macro recoder with
> several good entries describing possible approaches and the respective
> problems:
> 
> http://bugzilla.gnome.org/show_bug.cgi?id=51937

Thanks, I'll check it out.

-emile


___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] undoo history and automatic script creation

2006-10-04 Thread Saul Goode
On a related note to this thread, I was wondering if there was any way
to have a script "perform" an Undo or to go back a few steps in the Undo
history. 

I have a script which chops a layer up into multiple pieces and the
result is a layer that is centered relative to the original layer. In
many situations, it would be desirable to have the generated layer
aligned to the corners of the original layer. I had considered
performing the additional alignment steps and then the user could
perform UNDOs until he achieved the alignment he desired, but this would
make it very tedious (and unintuitive) to perform an actual UNDO. 

However, if I could perform the four alignments in the script and
subsequently set the UNDO history back to the "centered" result, then
the user could perform REDOs to attain his alignment while retaining the
intuitive, one-step UNDO (or alternately, just continue with his editing).

I am unaware of any PDB function that would permit and would be
interested in any input as to how this might be accomplished --
including which code in the core I might avail if I were to create such
a PDB function.


"It is amazing what you can accomplish if you do 
not care who gets the credit." -- Harry S. Truman

___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] undoo history and automatic script creation

2006-10-04 Thread Michael Schumacher
Saul Goode wrote:
>> Am I missing something about why this is hard to do, or has it just
>> never been a priority to provide "record to script" capability?

> A macro recorder would basically have to be a different implementation
> than the UNDO history. I imagine certain simple actions (such as
> changing the opacity of a layer, select->none, etc) are already recorded
> in the UNDO history as "actions" and you might examine how those are
> handled if you are interested in implementing a macro recorder.

There is an enhancement request about a script/macro recoder with
several good entries describing possible approaches and the respective
problems:

http://bugzilla.gnome.org/show_bug.cgi?id=51937


HTH,
Michael

-- 
GIMP > http://www.gimp.org  | IRC: irc://irc.gimp.org/gimp
Wiki > http://wiki.gimp.org | .de: http://gimpforum.de
Plug-ins > http://registry.gimp.org |
___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer


Re: [Gimp-developer] undoo history and automatic script creation

2006-10-04 Thread Saul Goode

> Am I missing something about why this is hard to do, or has it just
> never been a priority to provide "record to script" capability?

If my understanding is correct, the UNDO history does not record the
actions you take, merely the result of those actions (by saving the
portions of the image that were modified. The difficulty of providing a
"record to script" functionality (AKA macro recorder) is that you would
have to maintain a record of the specific actions taken (otherwise your
recorded script would not work on a different image). 

A macro recorder would basically have to be a different implementation
than the UNDO history. I imagine certain simple actions (such as
changing the opacity of a layer, select->none, etc) are already recorded
in the UNDO history as "actions" and you might examine how those are
handled if you are interested in implementing a macro recorder.



"It is amazing what you can accomplish if you do 
not care who gets the credit." -- Harry S. Truman

___
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer