CesiumGS / cesium-native

Apache License 2.0
391 stars 200 forks source link

Spaces at end of file path of instanced objects don't get truncated #916

Closed Doenerlord closed 2 weeks ago

Doenerlord commented 1 month ago

It seems that the added spaces at the end of the filename in my .i3dm file are not being truncated, causing Unreal to not find the specified object.

LogHttp: Warning: ProcessRequest failed. The URL '../../proto_0.glb ' is not a valid HTTP request.

Padding is a recommended practice when generating .i3dm files, as can be found here: https://github.com/CesiumGS/3d-tiles/tree/62832c3d8294e2c530ac928f6ef4ccc62f4d176f/specification/TileFormats/Instanced3DModel#padding

Using Cesium for Unreal 2.6 with a instanced 3D-Tileset which is working outside of Unreal

kring commented 1 month ago

Thanks @Doenerlord, that does sound like a bug to me. @timoore please let me know if you disagree.

timoore commented 2 weeks ago

This is actually bug in cesium-native, so I'm going to (try to!) transfer the issue to that repository.

timoore commented 2 weeks ago

@Doenerlord I think there's some ambiguity in the spec as to whether the byteLength in the i3dm header should include padding after the URL. Clearly padding after binary glb data is not included in byteLength; I concede that the paragraph that begins "otherwise, if the glTF field is a UTF-8 string..." implies that whitespace is stripped from the end of the string that is specified by the byteLength.

When you say that the tileset "is working outside of Unreal," does that mean CesiumJS? Could you provide an example?

timoore commented 2 weeks ago

This is addressed in #916, but I don't have a great way to test the fix as we don't generate i3dm files with this kind of padding. if @Doenerlord could test this or provide test data, that would be awesome.

Doenerlord commented 1 week ago

Sorry I'm only now getting around to testing the fix, but it's working fine now. Thank you very much!