Disable Dialog on MSceneMessage.kBeforeSaveCheck Callback


Does anyone know how to disable this dialog when using om2.MSceneMessage.addCheckCallback(om2.MSceneMessage.kBeforeSaveCheck, before_save_check). OR does any one know another way i can run code on save, check stuff and stop it saving should I need to? (if the answer is, override SaveScene and SaveSceneAs in defaultRunTimeCommands.mel, then sure, but I need this on a shared script path, and thus, can i set maya version specific scripts on a shared path? guess I’d need to setup that up on startup getting the version?)

I know how to change the text in this dialog, but would love to disable it and show my own / do whatever i want.



So I’d personally take option 2 from part B: Setting up maya version specific scripts paths.

IMO, the easiest way to do that is using .mod files and the MAYA_MODULE_PATH environment variable. Set the environment variable on all your machines to point to some shared module path just once, and you’re good to go. Then you can add as many mod files to that shared folder as you want.

Each mod file can add to the script/plugin/shelf paths based on the current version of Maya. So not only is it a good way to handle different versions of scripts per maya version, distributing plugins for multiple maya versions is a breeze as well.

And here’s some documentation to get you started.


Sounds great thanks. I guess the only issue with that is that python calls to save won’t trigger it, but that might be an ok compromise (or if not, putting up with the dialogue, or using kBeforeSave and putting up with it being saved)