Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Ian Ross has just released a book on Anim8or. It's perect for a beginner and a good reference for experienced users. It contains detailed chapters on every aspect, with many examples. Get your own copy here: "Anim8or Tutorial Book"

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

nemyax

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

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: 2124
    • View Profile
Re: Undo support for scripts
« Reply #1 on: February 04, 2016, 04: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: 4
    • View Profile
Re: Undo support for scripts
« Reply #2 on: January 05, 2017, 04: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, 09:43:43 am »

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, 10:58:43 am by Unobtainium »
Logged

nemyax

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

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, 10:59:35 am »

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

polyGon_tError

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: Undo support for scripts
« Reply #6 on: May 27, 2018, 01:00:24 pm »

somebody mentioned me at least! ... well! thank you,
'how it is working?' - general explanation is: script that simply translate vertex (many of my script do) but do not delete or create new vertex (to alter exiting or for new edge or face) are undoable like where i mentioned (or what i observed)! :)
« Last Edit: May 27, 2018, 01:02:26 pm by polyGon_tError »
Logged