4.12 - CameraRig_Crane meshes crash packaged builds

I think I tracked this down to a Simpygon change, I assumed it was an error in our integration merge but if other people are running into it too it might be a bigger issue.

The culprit on our end was the Simplygon changes inside UStaticMesh::Serialize, StaticMesh.cpp around line 2588.

//@third party BEGIN SIMPLYGON
if (Ar.UE4Ver() >= VER_UE4_STATIC_MESH_GUID_SUPPORT)
{
	Ar << Id;
}
//@third party END SIMPLYGON

This is happening inside “WITH_EDITORONLY_DATA” ifdef’s and as a result this GUID gets serialized inside the static mesh while cooking.

When the packaged client is ran and is loading the static mesh it skips the WITH_EDITORONLY_DATA ifdef meaning that “Id” is never unserialized and resulting sizes don’t match.

I took the shotgun approach to fixing this and moved all the Simplygon Id changes outside of the editor ifdef’s and it stopped crashing (I also regenerated STATICMESH_DERIVEDDATA_VER so that everything was rebuilt though it might not be needed).

A better solution has been provided below by TheDrunkenBunny, excluding the Simplygon Id from UStaticMesh::Serialize when Ar.IsCooking() is true fixes the serialization issue