Skip to content

Commit 72b0feb

Browse files
modify the method of usdz load to load texture correctly (#10)
1 parent c322671 commit 72b0feb

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

common/Common.swift

+1-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ extension SCNNode {
8484

8585
func loadUsdz(name: String) {
8686
guard let url = Bundle.main.url(forResource: name, withExtension: "usdz") else { fatalError() }
87-
let mdlAsset = MDLAsset(url: url)
88-
let scene = SCNScene(mdlAsset: mdlAsset)
87+
let scene = try! SCNScene(url: url, options: [.checkConsistency: true])
8988
for child in scene.rootNode.childNodes {
9089
child.geometry?.firstMaterial?.lightingModel = .physicallyBased
9190
addChildNode(child)

0 commit comments

Comments
 (0)