I am supporting a tool that works alongside PlayerCollision view mode that overrides the engine material to show some specific details. When swapping, this tool also hides static meshes and performs a few other changes. Currently, the user has to use a specific “deactivate” path to undo all the changes that are applied when entering the mode, and swapping back to Lit manually does not properly restore settings.
There does not appear to be a callback on the viewport for when viewmode changes. My current plan is that when my tool enters its special mode it will register the viewport to an editor subsystem. Then I have my editor subsystem tick and detect if any viewports are not in player collision mode any more, and if so it adjusts their settings and removes them from the list.
If there a is a better way to do this, please let me know. I have considered adding a “viewmode changed” callback to the engine but that seems like overkill