After modifying instances in InstancedFoliageActor by a script the actor will become broken.
Attached project have simple map `FoliageMap` that has two InstancedFoliageActors. InstancedFoliageActor_1_2_0 is untouched and working fine but InstancedFoliageActor_0_1_0 was modified by script `Content\Python\foliage_deleter.py` and no longer can be edited in foliage mode.
Run a python script that would use remove_instance or remove_instances method on a FoliageInstancedStaticMeshComponent (E.g. foliage_deleter.py from attached project)
Open Foliage Mode and select Lasso Tool. Use lasso tool to select any instance and you will get the crash
[Attachment Removed]
The problem comes from the fact that the foliage system is the authority on the state of the InstancedFoliageActors. The system has its own internal structures (FoliageIngo) that contains the state for a specific Mesh used in the system. When working in the foliage system, the changes are first applied to the FoliageInfo instances which propagate them to the corresponding component(s) in the InstancedFoliageActors. The Actors\components are not aware of the FoliageInfo and there is no feedback mechanism that updates the state of the FoliageInfo when you modify the component, ie remove the instances. The same problem will happen if you delete instances through the details panel.
There is unfortunately no way to access the Foliage system or the FoliageInfo through Python\BP.
You are correct! We missed those methods in AInstancedFoliageActor. The do connect to the foliage system and work from “there” and are safe to use to manipulate the instances in the foliage actor.