Thanks @Kevin_Ring
I’ve dug into it a bit more. and it seems like the Remove from Tileset
blueprint node isn’t working as I expected it to.
I expected the node to reset the component, i.e. clear the Polygons array and also reset for example Invert Selection
to the default value. Also (unrelated to Cesium) it doesn’t seem to be that easy to destroy a component. This caused my blueprint code to add additional components each time I’m spawning my clipping box.
Here is a video that shows what happens if I use the blueprint I posted above to remove the clipping overlay. As you can see the Polygons array is not being reset to an empty array.
I have now found a solution for both my initial removal problem and the strange flickering/missing of parts of the Cesium3DTileset after removal of the Clipping Polygon.
- I am not adding the
CesiumPolygonRasterOverlay
Component during runtime anymore. I have added this component to the persistent Tileset(s) in the Level. During runtime I’m just adding/removing theCartographic Polygon
actor to the Polygons array - On
Event Destroyed
I’m now callingRemoveFromTileset
, then clearing thePolygons
array and I also have to setInvert Selection
to false. - Afterwards I can call
Refresh Tileset
which solves the flickering issue.
Edit: Ok, point 1. isn’t necessary if the blueprint to add the CesiumPolygonRasterOverlay
component is set up e.g. like in the post by @Riwa_Unreal here i.e. checking if the component already exists.