ildsarria
ildsarria

Reputation: 291

IOS11 Beta ARKit can't scale Scene object

I created a basic scene, and added an dae file. First every time i run or save the project i get the popup: The document “billboard.dae” could not be saved.

It still runs though but is annoying.

But the issue is I can't scale the object. I have tried different values 0.5s and also > 1 but nothing seems to work. Here is my code

  override func viewDidLoad()
    {
        super.viewDidLoad()

        sceneView.delegate = self
        sceneView.showsStatistics = true

        let scene = SCNScene(named: "art.scnassets/billboard.dae")!
        let billboardNode = scene.rootNode.childNode(withName: "billboard", recursively: true)

        //  billboardNode?.position = SCNVector3Make(0, 0, 1)
        billboardNode?.position.z = 10
        billboardNode?.scale.z = 0.5
        //  billboardNode?.scale = SCNVector3Make(0.4,0.4, 0.4)

        sceneView.scene = scene
    }

Any ideas?

Thanks

Upvotes: 2

Views: 675

Answers (1)

Joshua Nozzi
Joshua Nozzi

Reputation: 61228

Have you verified billboardNode is not nil? You're sending an optional (the result of looking for a child node with a given name) position and scaling messages but if it's nil (because finding the child node failed) it won't have any impact.

The error suggests to me there was some problem converting the .dae file, which might explain why the scene can't locate the asset by name. Or it might be as simple as "billboard" vs. "Billboard".

Upvotes: 2

Related Questions