Generate Procedural Mesh

Has anyone had any luck generating a procedural mesh as a static mesh? My procedural mesh actor is a child of AStaticMeshActor, and I’ve tried:



	GenerateCube(triangles, cubeSize, cubeSize, cubeSize, FVector(0.f, 0.f, 0.f), false, false, false);
	mesh->SetProceduralMeshTriangles(triangles);
	StaticMeshComponent->SetStaticMesh(Cast<UStaticMesh>(mesh));

with no luck. Ideally I’d like to be able to bake lighting on the mesh which isn’t possible as a procedural mesh. Is this even possible?