1

I am trying to add some AR 3D models on my website with the CartMagician plugin for WooCommerce. For iPhones I have created a USDZ file. When i start the AR from Safari i get the error Zero KB. The path to the file is correct. The USDZ file has less than 20mb. I have also tested the USDZ file with Model Viewer AR plugin an there was the same problem so, probably, there is a problem with the model not with the platform. I was unable to find anything about the error Zero Kb anywhere.

I have uploaded the model here, USDZ and BLEND files. I have also uploaded a video with the error message.

I have created the USDZ file in 3 different ways. With a Blender export addon, with Pixar's USD Tools and with CartMagician converter. The models i try to use now was made with CartMagician conveter.

Can you, please, provided some tips about the file preparation process for conversion to USDZ and about how it should be used? also any information about the error Zerok Kb.

Thank you!

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
EPurpl3
  • 682
  • 7
  • 25

1 Answers1

3

Your USDZ model has more than 400K polygons and has several 4K textures. It's the main problem of your QuickLook app, because CPU/GPU processing is TOO HIGH. Even macOS Quick Look opens such a file with a considerable time lag.

Apple recommendations are the following – A total number of polygons in your AR scene must be not greater than 100K and size of any texture must be not greater than 2K.

Also, check whether your code is like mine:

import ARKit
import QuickLook

extension ViewController: QLPreviewControllerDelegate,
                          QLPreviewControllerDataSource {
    
    func numberOfPreviewItems(in controller: QLPreviewController) -> Int {
        return Int(1)
    }
    
    func previewController(_ controller: QLPreviewController, 
                    previewItemAt index: Int) -> QLPreviewItem {
        
        guard let path  = Bundle.main.path(forResource: "BannerESX5000",
                                                ofType: "usdz")
        else { fatalError("Couldn't find a model") }
        
        let url = URL(fileURLWithPath: path)           
        return url as QLPreviewItem
    }
}

class ViewController: UIViewController {
    
    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        
        let previewController = QLPreviewController()
        previewController.delegate = self
        previewController.dataSource = self            
        self.present(previewController, animated: true, completion: nil)
    }
}
Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
  • 1
    Thank you for the answer, after i have wrote this i have tested the model on iPhone 11 and iPhone 12 was working, the problem was on iPhone 7. I have decreased the textures to 512x512px and now is working fine on iPhone 7 as well. I cant decrease the number of poly without breaking the model so i am happy that decreasing the textures did the trick. On iPhone 6 it doesnt work, the model looks... strange as a 3D preview and i cant activate AR. On Android is another story, i have tested the model, as *.glb, on a Android as low as Galaxy S3 and it was working fine. Thanks again. – EPurpl3 Mar 23 '21 at 10:48