Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

An update to Anim8or, v1.00b, is available with a few bug fixes. Get your copy HERE. See the "ReadMe" file for details.

Author Topic: Undo support for scripts  (Read 1923 times)

nemyax

  • Full Member
  • ***
  • Posts: 215
    • View Profile
Undo support for scripts
« on: February 04, 2016, 04:13:47 pm »

What's the situation with undo support for scripted actions? Apparently they cannot generally be undone, but polyGon_tError mentions that some script of his is fully undoable. How does it really stand? Are there plans to change it?
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 1547
    • View Profile
Re: Undo support for scripts
« Reply #1 on: February 04, 2016, 09:38:26 pm »

Adding a well designed, general Undo for scripts is an enormous task.  You can literally change anything an Object.  Simply saving a copy of the entire Object, all materials, etc. is less work but that would be a rather inelegant solution and would use a great deal of memory.
Logged

tazdij

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Undo support for scripts
« Reply #2 on: January 05, 2017, 09:28:54 am »

What about a function that a script can leverage to set a checkpoint? Then in your script VM, track the commands issued from that point. Just an idea, without knowing how this is implemented I really don't know what the options are.
Logged

Unobtainium

  • Newbie
  • *
  • Posts: 22
  • Engineer dabbling in various technical arts
    • View Profile
Re: Undo support for scripts
« Reply #3 on: March 20, 2017, 01:43:43 pm »

I'd say an inelegant undo function is better than no function.
Steve, what about one of the following:
- Save everything at each point in the Undo history and let the user choose between keeping it in RAM OR on the HDD/SSD. I'm on 32 GB RAM but wouldn't really mind Anim8or having to load from disk if it meant the Undo support would at least be there.
- More work, but; an Undo system that saves the differences, aka delta-patching of sorts. Could still have the choice of keeping history in RAM or on the disk.
- As tazdij suggests; track every command & script with their used parameters (run them in a macro-like fashion upon undo / redo, would be problematic with very demanding scripts timewise, though)

Could at least be a temporary solution, I'm sure users would like just having the possibility to undo scripts at all. :)
« Last Edit: March 20, 2017, 02:58:43 pm by Unobtainium »
Logged

nemyax

  • Full Member
  • ***
  • Posts: 215
    • View Profile
Re: Undo support for scripts
« Reply #4 on: March 20, 2017, 01:55:53 pm »

Incidentally, which would be more work: a C API that supports Anim8or's native undo, or an undo-enabled script VM? =)
Logged

Unobtainium

  • Newbie
  • *
  • Posts: 22
  • Engineer dabbling in various technical arts
    • View Profile
Re: Undo support for scripts
« Reply #5 on: March 20, 2017, 02:59:35 pm »

Incidentally, which would be more work: a C API that supports Anim8or's native undo, or an undo-enabled script VM? =)

A C API sounds rad. :)
Logged