I would like to implement a CTRL+Z feature, and I would like to use the SceneRecorder to do it. But how can I get an event where the scene has changed (mesh added, position of a mesh changed, and so on) in order to register the state of the scene in some way?
What I was looking for was some event on the scene that is called when something significant changes, but looking on the documentation I just found events like “onAfterRenderObservable” that are too heavy called. The purpouse is to save the last “state” of the scene, do you think I am following the right path?
You have all the on mesh added observable and so on that tou could rely on. But may I ask what is your use case exactly ? It might help finding the best strategy.
I want to implement a CTRL+Z command to undo the operation made on the scene. I was thinking about making a “snapshot” every time the scene changes, and so I can keep a “storyboard” of the changes and apply them on the reverse order.
Yes, I was trying to do the same in effect, but I was wondering if there’s a global event I can use intead of putting code everywhere in my lib. If you think it’s difficult to trap such a situation, I will stay with the original idea and insert the “snapshot” whenever I need. Just I was thinking, if I want to undo some changes just on the movement of an object or something like that?