Error Loading USDZ File in Vision Pro Application

Hi everyone,

I'm working on a Vision Pro application and encountering an issue while trying to load a USDZ file. Here are the details:

File Path: /Users/siddharthpatel/Library/Developer/CoreSimulator/Devices/31F10013-50B6-4CEF-9388-9094087FAEBF/data/Containers/Data/Application/EB260F0A-A84F-4E95-876D-08199D2A4998/Documents/hive1.usdz

Code: do { try await modelEntityForCollider = ModelEntity(contentsOf: fileURL!) } catch { print("Error loading model: (error)") } Error: Thread 1: Fatal error: Failed to import entity from "/Users/siddharthpatel/Library/Developer/CoreSimulator/Devices/31F10013-50B6-4CEF-9388-9094087FAEBF/data/Containers/Data/ ... ve1.usdz"

I've verified that the file path is correct and the USDZ file exists at the specified location. What could be causing this error and how can I resolve it?

Thanks in advance for your help!

Siddharth

Answered by SidAura in 793059022

Hi Vision Pro Engineer,

Thanks for all your suggestions and assistance! I managed to resolve the issue on my own. Your input was valuable and helped me troubleshoot the problem more effectively.

Best regards, Siddharth

I want to rule out an error in the USDZ file. Can you add the file to your project and load it using ModelEntity(named: "USDZ-Name")? If that works then we know the USDZ file is working and we can focus on troubleshooting why ModelEntity(contentsOf:) is not.

Accepted Answer

Hi Vision Pro Engineer,

Thanks for all your suggestions and assistance! I managed to resolve the issue on my own. Your input was valuable and helped me troubleshoot the problem more effectively.

Best regards, Siddharth