18

What 3D model formats are supported by ARKit? Does someone know all supported formats for using in ARKit, and which format Xcode can export to use in app?

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
user3371261
  • 185
  • 1
  • 1
  • 5

3 Answers3

16

DAE and OBJ/MTL are automatically supported, in the sense that you can just drop the files in the .scnassets folder and it will handle them for you. Personally, I had fewer issues with OBJ/MTL but I'm not well versed in 3D.

The documentation for Model I/O states that you can import 3D assets from the following files

The set of supported formats includes Alembic (.abc), Wavefront Object (.obj), Polygon (.ply), and Standard Tessellation Language (.stl). Additional formats may be supported as well.

I've not worked with this framework though, so can't tell you how well does it work with ARKit.

And you may want to have a look at AssimpKit which allows to export several formats to .scn SceneKit scenes

leandrodemarco
  • 1,552
  • 1
  • 15
  • 22
  • You have missed (.scn) file format, One question is what about .fbx file format ? is this supported in ARKit or not ? – Akhzar Nazir Aug 31 '18 at 11:19
  • Well, I do mention scn in the last sentence of my answer. I had assumed OP knew about it as it's the default format XCode manages (it may have been a wrong assumption though). Regarding FBX, when I did try it about a year ago it was not directly supported. I tried to use AssimpKit to export it to scn but it did not work well. – leandrodemarco Aug 31 '18 at 14:16
10

ARKit 2023+

ARKit itself doesn't read any 3D formats. Only rendering engines can do it. SceneKit and RealityKit frameworks are satellites of ARKit in AR app, so they can read in poly geometry supporting several popular 3D file formats at the moment. If SceneKit or RealityKit can't read a file, you can convert it into USDZ using usdzconvert Terminal command. Here's a list of supported formats:

  • Collada's Digital Asset Exchange .dae (SceneKit)

  • Pixar's Zipped Universal Scene Description .usdz (SceneKit and RealityKit)

  • Pixar's ASCII Universal Scene Description .usda (needs conversion)

  • Pixar's Binary Universal Scene Description .usd and .usdc (needs conversion)

  • Reality Composer format .rcproject (RealityKit in Xcode 14–)

  • Reality Composer Pro format .realitycomposerpro (RealityKit in Xcode 15+)

  • Apple's proprietary .reality format (loads faster in RealityKit)

  • Wavefront Object .obj along with material .mtl (needs conversion)

  • Alembic Interchange File Format .abc (needs conversion)

  • Polygon File Format .ply (needs conversion)

  • Autodesk Filmbox Format .fbx (needs conversion)

  • Graphics Library Transmission Format .glTF (needs conversion)

  • Stereolithography File Format .stl (needs conversion)

  • Native Scene Format .scn (SceneKit)

USDZ loading

You can use USDZ directly in SceneKit and RealityKit and moreover, you can use it as MDLAsset:

import RealityKit

var model = try! Entity.loadModel(named: "model.usdz")

import SceneKit

let scene = SCNScene(named: "model.usdz")!

import SceneKit.ModelIO

guard let url = Bundle.main.url(forResource: file, withExtension: "usdz") 
else { fatalError() }

let mdlAsset = MDLAsset(url: url)
let scene = SCNScene(mdlAsset: mdlAsset)
Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
1

The full set of file types documented as supported by the Model I/O framework can be found here:

https://developer.apple.com/documentation/modelio/mdlasset/1391813-canimportfileextension

The set of supported extensions and formats includes:

  • .abc Alembic
  • .usd, .usda, .usdc Universal Scene Description
  • .usdz Universal Scene Description (Mobile)
  • .ply Polygon
  • .obj Wavefront Object
  • .stl Standard Tessellation Language

Additional formats may be supported as well.

It looks like Apple's new preferred file type for ARKit on iOS (as of iOS 12) is their own usdz:

https://developer.apple.com/augmented-reality/quick-look/

Ian Terrell
  • 10,667
  • 11
  • 45
  • 66