I have a UHierarchicalInstancedStaticMeshComponent with 321489 instances. If I do an UpdateInstanceTransform(…) on around 10000 instances the game freezes for a second and I get the following output after it’s finished.
LogStaticMesh:Display: Discarded foliage hierarchy of 321489 elements build due to concurrent removal (0.2s)
LogStaticMesh:Display: Copied 321489 transforms in 0.022s.
LogStaticMesh:Display: Built a foliage hierarchy with 321489 of 321489 elements in 0.3s.
To me it looks like it rebuilds all the instances after a UpdateInstanceTransform. I’m not sure how, but would it be possible to only apply the transform on the affected instances?
PS: It would be nice to have the ability to add a GroupIndex to an instance, and this way group the instances based on your own index. This way only the affected groups would rebuild.
Here is a video showing the problem: https://www.youtube.com/watch?v=6xeiXoR3uYg