This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Krita Scripter Undo Point

Tags: None
(comma "," separated)
User avatar
X-Raym
Registered Member
Posts
33
Karma
0

Krita Scripter Undo Point

Thu Mar 29, 2018 12:38 am
Hi !

How to create undo points within a Krita Script launch in the brand new Scripter window ?

Currently, it seems that it doesn't create any undo point, so you have to be very careful with your scripts :<

Thanks !


User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS

Re: Krita Scripter Undo Point

Thu Mar 29, 2018 7:11 am
Yes. Undo is one of the things that nobody mentioned when I was canvassing for input on what should be accessible for scripting, so I didn't design support for it. I need some real, practical input to implement that.
User avatar
X-Raym
Registered Member
Posts
33
Karma
0

Re: Krita Scripter Undo Point

Thu Mar 29, 2018 9:09 am
Ok so here my 2 cents on this:

On REAPER (audio software which huge API for which I script a lot), the undo points are done this way:

  • By default, a script create an new undo points at the end of its execution, undo point named with the end of the script. this allow to make CTRL-Z to reverse the script action, even if the script doesn't have undo instructions.
  • There is a function which allows to create custom undo points right within the script (so a script can generate several undo points. This function allows to add custom name for the Undo points
  • There is also functions to create Undo blocks (one function for Undo start and one for Undo end) for even more fine tunnig on what can be reverse and what cannot
  • If the script calls native actions, you can either let it create its undo point as usual, or don't add this extra undo points it it is wrap inside Undo blocks

I found this methods highly effective and as script can be very powerful, having a way to to set Undo point would be very welcome to avoid any problem and let the user experiment more freely :)


User avatar
X-Raym
Registered Member
Posts
33
Karma
0

Re: Krita Scripter Undo Point

Sat Mar 31, 2018 10:05 am
In Photoshop JS API, as far as I understood, the concept is that it create an undo point for the script and one for each actions it contains,
but you can also add a way to suspend history to merge the following actions undo points together.

It is a different concept than undo blocks but it is good too.

I need some real, practical input to implement that.

Are these exposed concepts enough ? Do you need more ? How can we help for that ?


User avatar
TheraHedwig
KDE Developer
Posts
1794
Karma
10
OS

Re: Krita Scripter Undo Point

Sat Mar 31, 2018 10:23 am
I think the resource that is most necessary at this moment is time so that Boudewijn can recover from the 4.0 release :p

We'll be doing a development sprint in May, perhaps it is an idea to bump this thread at the start of May. Because, we're contemplating whether we should rewrite all of our undo system as the current system is very fragile. The new system would be based on shallow clones instead of actions, so that would definitely affect the resultant API.
User avatar
X-Raym
Registered Member
Posts
33
Karma
0

Re: Krita Scripter Undo Point

Sat Mar 31, 2018 10:27 am
Oh, yes of course ! Take time to rest and enjoy the v4.0 version ! :)

Ok for undo points improvements.
Meanwhile, Scripter has to be used very carefully.

Thanks for your support !


User avatar
X-Raym
Registered Member
Posts
33
Karma
0

Re: Krita Scripter Undo Point

Tue Apr 17, 2018 5:47 pm
Do you want me to open a ticket about that on the Krita tracker ?


User avatar
X-Raym
Registered Member
Posts
33
Karma
0

Re: Krita Scripter Undo Point

Fri May 25, 2018 6:15 pm
According to last Krita.org post:

Wolthera will work on Collecting information about missing scripting API


How to contact Wolthera to point this Undo Point function ?

Thanks !


User avatar
Quiralta
Registered Member
Posts
301
Karma
5
OS

Re: Krita Scripter Undo Point

Sat May 26, 2018 2:26 am
X-Raym wrote:According to last Krita.org post:

Wolthera will work on Collecting information about missing scripting API


How to contact Wolthera to point this Undo Point function ?

Thanks !


Fastest way to get in touch with the devs is the IRC at the #krita channel (just need to be in sync with Europe time zone : )


Self educated by a very bad teacher!
My Stuff
User avatar
kamathraghavendra
Registered Member
Posts
234
Karma
4
OS

Re: Krita Scripter Undo Point

Sun May 27, 2018 1:09 pm
X-Raym wrote:
How to contact Wolthera to point this Undo Point function ?

Thanks !


Well Wolthera is TheraHedwig , the person who posted two comments above your comment asking how to contact them :)




Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]