When placed in the world inside an Editor build, there are no issues. This only occurs in a cooked/packaged build. Has anyone else run into this and discovered a solution?
I just tried reproducing the issue in a new blank project by adding a Camera Rig Crane to the scene and packaging for Windows 64 bit, but did not get the crash to occur.
Could you provide me with a repro so I can get this crash to occur in a clean blank project using a minimal test case?
Are you receiving a Crash Reporter window after the cooked/packaged build crashes? If so, please provide me with the logs from the crash so I can take a look at the callstack and other relevant information as well.
The only repro I can offer is that I upgraded the engine to 4.12.3, built Development config, cooked/packaged content, and tried to run the packaged build. The crash window displays immediately upon running the .exe. I’ve attached the log and a copy of the callstack.
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
Strange, I didn’t get around to cleaning up the fix but that’s what I was going to try.
It would be nice to find a way that fixes this without having to have the 16 byte Simplygon GUID be saved & loaded with static meshes but better than it not working I guess.
Was there any other code you moved outside the WITH_EDITORDATAONLY blocks other than the FGuid Id; declaration, the lines where the Id is set, and the serialization?
Nope, my changes were updating STATICMESH_DERIVEDDATA_VER and then moving UStaticMesh::PostDuplicate, the Id serialization and the GUID generation beneath FixupLegacySettings outside of the editor ifdefs.
After making those changes and rebuilding the editor, the next cook didn’t have the Id serialized and the meshes were no longer 16 bytes off.