autosave animation when closing editor

always save the current animation as previous_session when the editor is
closed