Get coordinates of Cesium3DTileset spawned at unknown location

I want to spawn a Cesium3DTileset from URL during runtime but the URL can be any tileset that I don’t necessarily have knowledge of.

I don’t know where on the world this tileset will spawn but I want my pawn to fly there after it has spawned. My pawn itself could be anywhere in the world.

The spawning works great but I don’t really know how to get the location (or a location close to) where the new tileset is.

Is there a way or workaround to get such LatLong coordinates from a Cesium3DTileset actor?

This is how I’m spawning the tileset:

Unless and until a professional arrives, I believe the best you can do is grab the ECEF of the desired tile set location. The GPS coords resolve to ECEF anyway internally for use.

Oh and with ECEF there is a function (which name I can’t recall right now and I’m away from the dev machine) that resolves ECEF to unreal coordinates.

Ah, yes but the problem is that I don’t know where the tilesets might be. :sweat_smile: So I don’t have a desired location.

I just have the URL so the tilesets might be a volcanoe on Iceland or a hydrothermal vent somewhere in the ocean.

I don’t want the tileset to be located somewhere specific, I want my player pawn to fly to the newly placed tileset wherever that may be.

(The use case is that I would like to be able to “hotswap” tilesets e.g. by running a python script that talks to Unreal via the Unreal remote control API and says "hey I got this fresh new tileset on the file server. Please show it to me in Unreal. Here’s the URL)

There’s no API-level support for this currently, but you can take a look at the implementation we use to focus on a tileset when the user double-clicks it in the Editor. Something similar should be doable in your case.

Almost forgot. For completeness’s sake and if someone in the future finds this thread because of similar requirements: I’ve created a function that returns the approximate location of a tileset although so far there seem to be some tilesets which it doesn’t really work for.

Technically, though, this thread has a solution with the code from this pull request: Add functions to get the approximate location of a tileset during runtime by arbertrary · Pull Request #1458 · CesiumGS/cesium-unreal · GitHub

Hello,
Thank you for generating this solution! I implemented your solution to my Cesium3DTilset C++ class exactly as you did, but I am unable to see those functions in the unreal editor. Did you also run into this issue / do you have any advice for exposing your functions in the unreal editor if it is not being shown?

Hi,

if you haven’t forgotten to add “BlueprintCallable” in Cesium3DTileset.h then I’m not sure what the problem is in your case :thinking:

Have you also compiled/rebuilt the plugin after making the changes?
Unfortunately I don’t really have the time right now to dig into this further :confused:

No worries! I have tried all of that, but it still does not work. I appreciate you taking the time to respond back to me!

For anybody running into issues with exposing this solution in the unreal editor, @Kevin_Ring has given me wonderful advice to solve this.

Here was his advice “if you’re making changes to the plugin, be aware that Unreal Engine will not automatically recompile source files installed with the engine (i.e., in C:\Program Files\Epic Games\UE_5.2\Engine\Plugins\Marketplace\CesiumForUnreal or similar). You’ll need to put the plugin into your project instead.”

After placing my plugin in the project with the solution @arbertrary has provided, it should be exposed and it worked perfectly for me. Thank you guys again for the advice and this solution!