Download

FStaticMeshLODResources.IndexBuffer.GetArrayView() fails in package build

Hello,

I have a system running that works well and looks great when PIE.

However if I attempt to package the project my system crashes.

It crashes because this line returns NULL:


AnalyseMesh::AnalyseMesh(
	UStaticMesh *	meshToHandle)
{
	FStaticMeshLODResources& RenderMesh = meshToHandle->RenderData->LODResources[0];
	FIndexArrayView RawIndices = RenderMesh.IndexBuffer.GetArrayView(); // Return NULL
}

I am finding that RawIndicies is coming back as NULL. I have based this code on \Engine\Source\Editor\UnrealEd\Private\Fbx\FBXMainExport.cpp

I desperately need the triangle data in a packaged game.

However the data appears to be available when playing in the editor. Is there a way to get the triangle data? Perhaps, in a worst case, add it to the object as part of the cook process?

If I can’t get the triangle data then the last 4 weeks of work will have been wasted!

Appears it’s not just me: https://answers.unrealengine.com/questions/128613/why-getarrayview-is-null-in-standalone.html