Update Raster Overlay at Runtime (BP)


I was wondering if it would be possible to allow access to the variables for Ion Asset ID on the Ion Raster Overlay component vis BP.

I’ve built a widget the allows me to cycle through a set of DEMs in my depot by simply setting the “Ion Asset ID” variable on the “Cesium3DTileset” actor. I was hoping to do the same for the Raster Overlay however when referencing this component, there is no way to set any of these variables.

I looked at Spawn Cesium3DTileset at runtime and the solution of “Add Ion Raster Overlay Component” doesn’t work as this node is only exposed in the Level Blueprint and only acts as a way to add a single overlay rather than changing to a new one.

Any help would be greatly appreciated!

The relevant variables of the raster overlay (namely the IonAssetID and the IonAccessToken) are not accessible via Blueprints, because changing these values at runtime is currently not possible.

(I’m omitting some technical details here, but roughly speaking: Just changing these values would not automatically reload and re-apply the overlay images to the tileset).

These values can only be set when the overlay is created. So for now, the only reasonable way to change the overlay at runtime via blueprints is to 1. destroy the old overlay and 2. add a new overlay with the new IonAssetID.

In order to destroy/remove such an overlay, you can use the DestroyComponent function.

Important: This function has to be called on the actor. You can not do this with a “standalone” DestroyComponent node! If you try that, you’ll receive an error of the form “LogActorComponent:Error: May not destroy component […component name…] owned by […actor…]”.

So you have to drag out a connection from the actor pin (the tileset, in this case), and search for “DestroyComponent” - note that you have to disable the “Context Sensitive” checkbox for this entry to appear:

Afterwards, you can add the new overlay component. (The steps for adding a raster overlay to a tileset via blueprints is described in the post that you already linked to ).

So the following is an example of a blueprint that

  1. creates the tileset with a certain raster overlay
  2. destroys the raster overlay after a few seconds
  3. assigns a new raster overlay (with a different IonAssetId) after a few seconds:

1 Like