将.scn文件加载为SCNNode LOSS动画

时间:2017-06-09 11:17:34

标签: ios scenekit

当我将Horse.scn加载到SCNNode时,动画会丢失。

    func addHorse(for parentNode:SCNNode, postion:SCNVector3){
    guard let virtualObjectScene = SCNScene(named: "Horse.scn") else {
        return
    }

    let wrapperNode = SCNNode()

    for child in virtualObjectScene.rootNode.childNodes {
        child.geometry?.firstMaterial?.lightingModel = .physicallyBased
        child.movabilityHint = .movable
        wrapperNode.addChildNode(child)
    }
    wrapperNode.scale = SCNVector3(0.001,0.001,0.001)
    wrapperNode.position = postion;
    parentNode.addChildNode(wrapperNode)
}

如果我从Horse.dae文件加载场景,一切都很好。将rootNode的播放属性设置为YES不起作用。

0 个答案:

没有答案