Dataset won't load from Reality Capture to Unreal Engine!

Hello,
I am unable to use data exported from Reality Capture into UE5 using the following path:
file:///C:/Users/Francis/Documents/EndCap/tileset.json
I get this error in the Output Log:

LogCesium: Loading tileset from URL file:///C:/Users/Francis/Documents/EndCap/tileset.json
LogCesium: Loading tileset from URL file:///C:/Users/Francis/Documents/EndCap/tileset.json done
LogHttp: Warning: 00000AAAF0829B00: request failed, libcurl error: 37 (Couldn't read a file:// file)
LogHttp: Warning: 00000AAAF0829B00: libcurl info message cache 0 (Couldn't open file /C:/Users/Francis/Documents/EndCap/tileset_Salinas_End_Cap_(Just_Pad)/Geometry/lod4_0.b3dm)
LogHttp: Warning: 00000AAAF0829B00: libcurl info message cache 1 (Closing connection -1)
LogCesium: Error: [2022-08-16 15:27:52.523] [error] [Tile.cpp:497] An exception occurred while loading tile: Request failed.

Is there some guide to show how to export data from Reality Capture to UE5? I am using the built-in option for Cesium 3D Tiles. Any help would be greatly appreciated as I am on a time crunch for a project!
image

Here is another issues that is occuring:

LogCesium: Loading tileset from URL file:///C:/Users/Francis/Documents/EndCap/tileset_EndCap.json
LogCesium: Loading tileset from URL file:///C:/Users/Francis/Documents/EndCap/tileset_EndCap.json done
LogCesium: Warning: [2022-08-16 16:03:26.898] [warning] [TileContentFactory.cpp:112] No loader registered for tile with content type '' and magic value '?

@Shehzan_Mohammed and @Kevin_Ring, could you please help me out? I would really appreciate it.

Until Shehzan or Kevin can chime in here: The file name ...Cap_(Just_Pad)/Geo.... might cause trouble due to the ( brackets ). These are reserved characters for URLs, and I don’t know from the tip of my head how well libcurl handles these. (Some escaping might be necessary, and maybe that does not work so smoothly when accessing files).

If it is possible to do this with reasonable effort, you could try creating the tileset with file names that do not contain reserved characters.

Hi @Marco13,
Thanks for the reply. What about the example in the second post I made? I used this path here:

file:///C:/Users/Francis/Documents/EndCap/tileset_EndCap.json

UE5 was still not able to import it for some reason. It gave me the following error:

LogCesium: Warning: [2022-08-16 16:03:26.898] [warning] [TileContentFactory.cpp:112] No loader registered for tile with content type '' and magic value '?

The screenshot in the second case looks like it did load the tileset_EndCap.json file. The error message comes from the TileContentFactory, and the tile contents are, for example, B3DM files.

My guess was mainly based on the first output log, which said

Couldn't open file /C:/Users/Francis/Documents/EndCap/tileset_Salinas_End_Cap_(Just_Pad)/Geometry/lod4_0.b3dm

(This error might cause other errors later - maybe even the one that came from the TileContentFactory. In doubt, this would have to be investigated further, if the (brackets) do not turn out to be the root cause here…)


Edit, maybe as a clarification:

The JSON file contains URLs that refer to the tile content. So the JSON file may contain something like

uri: path/to/file(with brackets)/example.b3dm

In this case, it could load the JSON file, but might have difficulties loading the file from the path with the (brackets). But again: This is a guess for now.

This seems to be a similar issue? Issues getting World Terrain data from Ion

The error code is “almost” identical.

The message itself is not unexpected when there really is an unknown content type. But indeed, when it mentions a content type and magic value that involves strange characters (like in your screenshot), then this indicates that it received garbage data.

You could try out the workaround that was mentioned in the thread that you linked to, but … if the problem is originally caused by libcurl not being able to access the path with (brackets), then the same error might appear again.

Is it possible (with reasonable effort) to export the data with paths that do not involve special characters?

(Otherwise, Kevin or maybe @agallegos might have further ideas about the reason for the error, and possible workarounds or solutions…)

I am going to try re-exporting the data to my Documents folder to see if that resolves the issue. I will exclude any special or reserved characters. If that does not work, any suggestions?

I will post updates soon.

Thank you!

If it does not work after re-exporting, you might try deleting the cesium-request-cache.sqlite file as well (handwavingly: for the case that it has cached garbage data there, when it tried to access the path that it couldn’t access). After that, … I’d be out of ideas for now (I’m currently not sooo deeply involved in CesiumForUnreal), but maybe someone else could give further hints then.

@FrancisCheck can you try serving this tileset from a local web server, instead of using file URLs? Unfortunately, the file URL support in Unreal’s version of libcurl is shaky at best.

One problem we’ve seen - but I’m not sure if ContextCapture does this - is that some tools will generate files with extensions like .b3dm, but under the hood they’re gzipped. Cesium for Unreal has no way of knowing this, so it treats the compressed data and uncompressed and ends up reading garbage. The solution in that case would be to gunzip the generated files in bulk before pointing Cesium for Unreal at them. Or maybe change a setting in ContextCapture so it doesn’t do that. But again, this is only a shot in the dark.

I didn’t have that on the radar. And one could argue about the naming here, and consider this as a “bad practice”. But … the question about “how to determine the type of data” is indeed subtle. The current order is

  • by magic bytes
  • by response content type
  • by file extension

and I think this makes sense. But wouldn’t it make sense to extend the loader detection with something like

if (startsWithGzipHeader(data)) { // or 'while' ;-) 
    data = unzip(data);
}

?
(one could also check the content type, but with caveats)

Yeah doing something like that would be reasonable @Marco13. At the moment, though, all the gunzipping is handled automatically by Unreal’s libcurl according to HTTP response headers. So to add something like that, we would first need to integrate a gunzip implementation that we can call from cesium-native. Or perhaps add the necessary indirection so that we can use Unreal’s.