How to switch a mesh between sockets

Some shots of the code.