Maxscript or C++: is last event in undo queue an import event?


As title says.


Hi everyone!

I am working on a maxscript integration where you can browse our object catalog right in 3dsmax and edit / save them to server and stuff in realtime.

For loading objects I download, then reset scene, then import them, but this makes users possibly lose data.
Currently this is what I do: always ask the user if he is sure to load the file. This is fine, but while debugging I so much enjoyed the speed without this extra question: it was immediate as c++ plugin works in background so I could literally just double-click models and they were there.

Is there a way to tell if the scene is “changed” after an import? I guess something like “is the last event in the undo stack/queue an import operation” is what I want to ask.

I write both C++ and Maxscript parts of our plugins and thus interested in solutions on both sides: I can easily make a simple function to check this from maxscript if only doable in C++ or is better done there, just I am not sure this is doable and where to look for info. Would be a nice improvement to this feature as then the product will feel extra fast to operate.


Ah… never mind… as I asked it, finally found the solution:


^^I see it exists on both sides. All I do is that on MY own import I set this to false and check in before all import from backend. Now it is silky-smooth :wink: