Remove clipping CesiumPolygonRasterOverlay added during runtime

Thanks @Kevin_Ring :slight_smile:

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.

https://youtu.be/zHYo3LGzgmc

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.

  1. 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 the Cartographic Polygon actor to the Polygons array
  2. On Event Destroyed I’m now calling RemoveFromTileset, then clearing the Polygons array and I also have to set Invert Selection to false.
  3. 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.