Coder Social home page Coder Social logo

Comments (2)

Seneral avatar Seneral commented on June 12, 2024

Have verified it, seems I have gotten something wrong while implementing undo (which also required a small change in how caching worked).
Working in a fix right now, sorry about that.

from node_editor_framework.

Seneral avatar Seneral commented on June 12, 2024

Ok so I found the main cause. To make clear what was happening and the new behaviour I have decided, I'll outline the problem here.

The problem occurs when you add nodes, and then load a new scene without clicking outside the window. Clicking outside the window before saving allows the node editor to add the new nodes to the cache. By skipping that, all changes you did since the last cache save are lost (after last time clicking away from the window or last automatic cache save).
This has been the case previously, as the cache itself was a working copy.

Now in the last update (undo), I added the separate, faster, not crash-resistant cache, which is essentially just a dump of the current ScriptableObjects into a file (this is the requirement of the Undo system). Again, they are not designed to be crash save, for that we still have the proper working copy cache in regular intervals. The problem is, if you add new nodes, but not let the cache system add them to the cache, it will create inconsistencies. The other nodes and canvas link to a node that only exist in memory until the next cache (click outside the window). If now a new scene loads, those inconsistencies will break the canvas.

I had intended for the lastSession (the proper, crash-save cache) to load if curSession (SO dump cache) has insonsistencies. For whatever reason I didn't fully implement that, so in those cases where the dump would break (cache, or interrupted without save - currently only switching scenes) it would try to load the broken canvas. Now I've added detection for that and delete the dump cache if it is found to be faulty, and a warning displayed.

Note that, even before last update (undo), this behaviour would just silently load the old lastSession and you would silently loose your work if you didn't give it a chance to save before switching scenes. Only now I even have a method to detect if work is lost, so I added the warning.
The amount of work we're talking about here is the work you've done after last clicking out of the window or the last auto-save (defined in NodeEditorUserCache.cacheIntervalSec, default 60 seconds).
Will update in a few minutes

from node_editor_framework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.