Use a remap function instead a swap. Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D8739