This partially solves T65303.
Details
Diff Detail
- Repository
- rB Blender
Event Timeline
Silently saving the file is not ideal either.
If the file has modifications, then I think it would be fine to free all the dependency graphs and force a full refresh that way. Basically calling BKE_scene_free_depsgraph_hash for every scene in main.
The reason we need to reload files is if any scripts were supposed to run on startup. But if it's later on that should not be a problem.
That is a bit weird have different behavior based on save state.
Quite often you open a production file, but then realize drivers are disabled, you click "Allow Execution" and you wait for the entire file to load again. Unless (after this change) you somehow managed to mark file dirty and then allow execution.
If it's for the handlers, can we simply run BLI_CB_EVT_LOAD_POST after all dependency graphs were freed (and possibly re-evaluated) ?
I don't think running BLI_CB_EVT_LOAD_POST, when we the file was not actually loaded, is a good idea. It could cause problems in addons.
I think it's mainly for scripts that run on startup (marked "Register" in the text editor). And those might add some on load handler, but add-ons might have already run their handler and running it again might cause problems.
I wouldn't mind if we can improve the on load case as well. But I don't think we have time for that now.