文書化されていますが、次のクラス メソッドはライブラリMDLAsset
に存在しません。ModelIO
+ assetWithSCNScene:bufferAllocator:
+ assetWithSCNScene:
そのため、現在、.scn ファイルを読み込んでSceneKit
.scnファイルを作成する方法はありませんMDLAsset
。
回避策は何ですか?
更新 0
私はこれらをインポートしています:
import SceneKit
import ModelIO
import MetalKit
import GLKit
私のレンダラーでは、MDLAsset
からをインスタンス化しようとしていますSCNScene
:
guard let scene = SCNScene(named:"ball.scn") else {
fatalError("Error: Can not create scene")
}
let asset = MDLAsset(scnScene:scene, bufferAllocator:MTKMeshBufferAllocator(device: device))
このエラーが発生します
カテゴリが見つからないことを示します。ここで何を見逃したのですか?