Assertion when encoding lightmaps

I am using the Procedural Foliage system to place grass, trees, and rocks in my scene so I have a very large Instanced Foliage Actor that contains all of these meshes. I can’t use material-driven grass since it can’t be light-baked and I am working in VR so dynamic lighting isn’t an option. When I go to build lights it will complete a full build but then I get an assertion when encoding lightmaps. The assertion is on line 1945 of Lightmap.cpp:

verify(Texture->AddElement(PendingGroup));

This function says that if the element to be added doesn’t fit on the Texture it will return false, so I assume that the lightmap atlas for the Instanced Foliage Actor is too large to fit on one lightmap, is this correct?

I have reduced the lightmap resolution for my static meshes considerably and my max lightmap size is 4096 so it seems like I should be able to get quite a few objects on one lightmap. Is there a way for me to break up the Instanced Foliage Actor into smaller actors so it doesn’t all have to fit on one lightmap?

Will I have to resort to hand-placing static meshes instead of using an Instanced Mesh Actor?

I have figured out a solution.

For anyone wondering about this in the future: it seems meshes are required to be on the same lightmap if they were placed with the same Procedural Foliage System. So if you want a lot of meshes you will need to break them up into many PFS actors. Even though they all end up in the same Instanced Foliage Actor they will end up on different lightmaps if they were generated with different PFS actors.

Hope this helps anyone struggling with the same issue.