'Load glTF model into RealityKit scene?
I'd like to load a glTF
file generated by another program into RealityKit. I get the impression that the only way to load models into RealityKit is via USD or Reality files.
Anyone know a way to get some other model into RealityKit? Not necessarily as a file -- I'd be happy to be able to generate a MeshResource and array of Materials myself and load them in that way.
Solution 1:[1]
I ended up using GLTFKit, an open source library by Warren Moore. It does exactly what I want -- lets me load a glTF file into SceneKit/RealityKit.
Solution 2:[2]
Reality Converter
Apple discussed this in the WWDC20 video "The artist’s AR toolkit".(link)
They show how to convert FBX, OBJ, USD and GLTF files to USDZs for use in Reality Composer.
Reality Converter is still in beta and needs to be downloaded from the Apple Developer website. I used it and it is quite nice.
There is also other tools you can use on the command line if this is more your thing. At WWDC 2019, Apple announced the USDZ Tools or also called USD Python Tools.
USDZ Tools is a pre-compiled Python library containing binaries of Pixar’s USD library for macOS. This is the link. You will need to download and install the library.
I would give a try to the Reality Converter first. I think it is here to stay since probably Apple has no intention to add support for glTF files in Reality Composer in the future, since they love USBZ!
Solution 3:[3]
Alas, as you said, at the moment the only way to load your
.gltf
model in RealityKit scene – is firstly to convert it into.usdz
model via Xcode command line tools. Also in RealityKit you can use.reality
format (use it for a much faster uploading time) and.rcproject
format that can be exported from Reality Composer app. These two file formats allow you store not only PBR shaders and animation but also a dynamics.
Please, read this post for further details.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | John Brewer |
Solution 2 | multitudes |
Solution 3 |