Home > Mobile >  RealityKit – Loading USDC model fails with RealityKit.Entity.LoadError error 0
RealityKit – Loading USDC model fails with RealityKit.Entity.LoadError error 0

Time:06-01

Loading machine (USDC) ends with Fatal error: The operation couldn’t be completed. (RealityKit.Entity.LoadError error 0.). No more details are provided about the issue.

This is a nonAR RealityKit scene. Loading the model while blocking the main thread is intentional here.

Any suggestions what the error may mean? I can't find any explanation.

func loadMachine() {
    do {
        machine = try Entity.load(named: "Machine")
    } catch let error {
        fatalError(error.localizedDescription) 

        //  Fatal error: The operation couldn’t be completed. 
        //  (RealityKit.Entity.LoadError error 0.)
    }
}

CodePudding user response:

Use .usdz model (also known as binary-encoded zero-compression zip file), not .usdc. While Apple's Quick Look is capable of showing USDA (ascii) and USDC (binary) models, RealityKit 2.0 and Reality Composer 1.5 read in just USDZ models from the USD family.

The .usdz format was specifically created by Pixar in collaboration with Apple for AR.

let machine = try! ModelEntity.load(named: "Machine.usdz")

To convert USDC to USDZ, use command line tools, or Autodesk Maya 2020 with USD plug-in.

  • Related