You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implemented a first draft of serialization / deserialization. It works on a morph. The morph can be complex (e.g. be a frame with multiple inspectors inside), but for the time being it needs to be self-contained to be functional (e.g. no references to morphs outside the hierarchy of the selected morph).
Since JSON doesn't handle closures, quite a lot of refactoring was needed of the callback system here davidedc/Fizzygum@c33275e and here davidedc/Fizzygum@da0d3d2 . (Closures in callbacks can be just transformed into "normal" method and accompanying parameters to be passed at call time).
Serialisation now hinges on a more generic deepCopy mechanism which replaces the previous "fullCopy" implementation here davidedc/Fizzygum@3e7dfee .
JSON doesn't handle cyclic data structures, or preserve the identity of shared references (i.e. two references to a single object will be restored as references to two equal, but not identical copies), so some work was done to cater for both here davidedc/Fizzygum@6a63643
Improvements will follow to a) allow for "notable" references to Morphs outside the hierarchy of the selected morph (e.g. references to the world morph) b) letting Morphs to pre-process and post/process their state before/after serialisation as they see fit (e.g. to discard transient data that can/should be recalculated, etc.)
Little example animation of one of the tests is attached, note that serialisation / deserialisation at the moment can only be triggered via the console - proper menus and export to file will follow. A frame here is created containing a rectangle and its inspector. The frame is serialized, the world is cleaned, then the frame is deserialized and lastly it's added to the world. All buffers and references work fine.
Note a little glitch: in the deserialised frame, the inspector still has the label containing the ID of the original rectangle (#1), even though it's correctly pointing to a second, new, independent rectangle (#2). In the next iterations the Inspector will have to be given a chance to update its contents based on the state of the new world it appears in...
The text was updated successfully, but these errors were encountered:
Implemented a first draft of serialization / deserialization. It works on a morph. The morph can be complex (e.g. be a frame with multiple inspectors inside), but for the time being it needs to be self-contained to be functional (e.g. no references to morphs outside the hierarchy of the selected morph).
Since JSON doesn't handle closures, quite a lot of refactoring was needed of the callback system here davidedc/Fizzygum@c33275e and here davidedc/Fizzygum@da0d3d2 . (Closures in callbacks can be just transformed into "normal" method and accompanying parameters to be passed at call time).
Serialisation now hinges on a more generic deepCopy mechanism which replaces the previous "fullCopy" implementation here davidedc/Fizzygum@3e7dfee .
JSON doesn't handle cyclic data structures, or preserve the identity of shared references (i.e. two references to a single object will be restored as references to two equal, but not identical copies), so some work was done to cater for both here davidedc/Fizzygum@6a63643
Improvements will follow to a) allow for "notable" references to Morphs outside the hierarchy of the selected morph (e.g. references to the world morph) b) letting Morphs to pre-process and post/process their state before/after serialisation as they see fit (e.g. to discard transient data that can/should be recalculated, etc.)
Little example animation of one of the tests is attached, note that serialisation / deserialisation at the moment can only be triggered via the console - proper menus and export to file will follow. A frame here is created containing a rectangle and its inspector. The frame is serialized, the world is cleaned, then the frame is deserialized and lastly it's added to the world. All buffers and references work fine.
Note a little glitch: in the deserialised frame, the inspector still has the label containing the ID of the original rectangle (#1), even though it's correctly pointing to a second, new, independent rectangle (#2). In the next iterations the Inspector will have to be given a chance to update its contents based on the state of the new world it appears in...
The text was updated successfully, but these errors were encountered: