How does one access tiles?

Let’s say we want to add something dynamically to the tile material instance.
How does one accesses the tiles? So far i can access one tile(as PrimitiveComponent) via linetrace, and that’s it.
void forEachLoadedTile(const std::function<void(Tile& tile)>& callback); just crashes with nullptr on head, presumably because you need to call it when tiles have loaded, but i can’t find anything to synchronize on that time-point.

Is there some unreal way to access tiles? Various GetComponent() methods return unreal-level components of the actor, not parts of the tileset.

Hi @Alexander_Drozdoff,

I think you should be able to retrieve the material instance through Unreal APIs alone, right? You can do GetMaterial(0) on the UPrimitiveComponent. You can cast that to a UMaterialInstanceDynamic and then you should be able to set scalar / vector / texture paramaters on it that you can access in the custom tileset material. I don’t think you’ll need any Cesium API to retrieve and manipulate the material instances, but let me know if that’s not the case.

-Nithin

@Nithin_Pranesh Yes, but how do i access all UPrimitiveComponents of a tileset?

So, does anyone else knows how to do this?

I just want to get UPrimitiveComponent like you access one through LineTrace return, but i want to access all of them iteratively. Cesium’s method for that crashes with nullptr.

@Kevin_Ring maybe you know something about this?

Sure, there’s not really any Cesium-specific trick to it, just use the normal methods to ask Unreal for the ActorComponents you want. Something like:

  TArray<UCesiumGltfPrimitiveComponent*> components;
  TilesetActor->GetComponents<UCesiumGltfPrimitiveComponent>(components);