Failed loading .usda/.usdz from RealityKitContent package

I was trying to load an Entity by Entity(named: sceneName, in: realityKitContentBundle), which works for many of my .usda file. But this time I got an error:

Error loading asset from scene PinballTable.usda: failed to load '7058602595919186152 Scene (RealityFileAsset)Bundle/RealityKitContent-RealityKitContent-resources/RealityKitContent.reality/Scene_14.compiledscene' (Asset provider load failed: type 'RealityFileAsset' -- Failed to load compiled data for asset path 'Scene_14.compiledscene', due to error: Failed to deserialize asset data.)

Any ideas on why this won't work? I have checked the size of my .usda file it's around 42kb so I won't think it's sake of file size. Due to many .usda reference inside of this scene, I suspect that it might be the case the bundle cannot locate other usda reference. So I export the whole scene into .usdz file and it turns to 118kb. Wonder if this could be the only issue here that affect the loading result but this is what I have tried so far.

visionOS System: visionOS beta 2/simulator 1.1 (neither works) XCode: 15.4/16.0 beta (neither works)

Answered by milanowth in 795074022

Solved by my own. It turns out one .usda scene has a custom component which causes failing to deserialize the whole scene. I have implemented Codable and Component protocol but forget to implement Decodable I guess.

Accepted Answer

Solved by my own. It turns out one .usda scene has a custom component which causes failing to deserialize the whole scene. I have implemented Codable and Component protocol but forget to implement Decodable I guess.

Failed loading .usda/.usdz from RealityKitContent package
 
 
Q