Coder Social home page Coder Social logo

Comments (1)

Seneral avatar Seneral commented on June 12, 2024

Theoretically if they are different windows that properly use different cache paths (e.g. two different tools), then already yes. However the default window currently does not support that.

It also depends on what you expect it to do. Do you want it to be tabs in a single window, so that when you close the window and reopen it, all tabs reopen as well? Or just multiple window instances each with their own single canvas? Then what happens if you close one of these instances (or unity crashes) - do you expect to be able to reopen these canvases, just as you would when you have only one window? Unlikely, since the system would have no way to know which previously closed canvases you expect to work on again, and you can't store them infinitely, so likely you'd have to give up on that functionality, at least partially.

So I see two options: A tabbed window (with correspondingly a lot of effort to adjust the UI) that behaves as you would expect it to, or multiple windows, but only the last window to close actually stores the working canvas so you can reopen it.

For option 1 (tabbed canvas):
Give each tab an own NodeCanvasUserCache with unique but deterministic cache path (e.g. _1, _2, ... postfix). Then on window open, check the cache paths and reopen all tabs.
Then of course create the tabbing UI. Since I expect you want multiple views at the same time, also add split view support. Technically no problem, the backend should support all that, but that is quite some extra effort designing the UI...

For option 2 (multiple instances):

  1. Allow multiple windows unity-side, and on creation find all open instances, and assign a unoccupied ID to the new window. If there is a cache file without an assigned open instance, assume the editor crashed or something and you're reopening the instances one by one, and use that cache's ID. This also covers the case of reopening the canvas the last window had open.
  2. Use the cache path with your ID as suffix, so you have several cache files (last+cur Session) with unique suffixes.
  3. On window close, if you are NOT the last window to close, delete your cache file, thus always leaving exactly one cache file (or if the editor crashed, all cache files) for the next opened instance to reopen.
    Note that the cache files are still required to exist for the other instances, especially the curSession, since that is required for the Undo to survive playmode changes, scene changes and script recompiles.

So yeah, there's no one good solution I'd be happy going with. If you want to implement either, these should be the steps required for it. I'd be happy to help you with it, but currently I do not have the time to do such an endeavor, sorry.

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.