/Engine/Plugins/Animation/MLDeformer/MLDeformerFramework/Source/MLDeformerFrameworkEditor/Public/MLDeformerEditorModel.h
Change the skeletal mesh on a specific skeletal mesh component. This internally will not only call SkelMeshComponent->SetSkeletalMesh(Mesh), but also will reassign the materials. The reason for this is because if there are material instances set already, the skeletal mesh component will not override them to preserve changes done by the user. This helper function will force these to be updated as well. This was needed in case of Metahumans. Metahumans use a PostProcessAnimBP with a ControlRig node in it, which drives material curves. In order to drive this, material instances are needed instead of regular materials. But as mentioned before, when switching the mesh the code internally will not override the material instances. So we simply have to force this manually, hence this function.
static void ChangeSkeletalMeshOnComponent ( [USkeletalMeshComponent](API\Runtime\Engine\Components\USkeletalMeshComponent) * SkelMeshComponent, [USkeletalMesh](API\Runtime\Engine\Engine\USkeletalMesh) * Mesh )