-1

I am writing an SCNScene to FBX exporter and would like to identify which SCNNodes have animations added to them. Specifically I am interested in explicit animations through CAAnimation.

The method animation(forKey:) has been deprecated and animationKeys seems to rely on animations being added with an optional, and arbitrary key, so I can't tell which key paths are being animated.

Is there anyway to get a list of all CAAnimation that have been attached to a SCNNode?

freakTheMighty
  • 1,172
  • 1
  • 12
  • 27

1 Answers1

1

you should be able to use something like

for (NSString *key in scnView.scene.rootNode.animationKeys) {
    SCNAnimationPlayer *player = [scnView.scene.rootNode animationPlayerForKey:key];
    CAAnimation *animation = [CAAnimation animationWithSCNAnimation:player.animation];
}
mnuages
  • 13,049
  • 2
  • 23
  • 40
  • Thank you very much. The documentation is painfully sparse. – freakTheMighty Sep 19 '18 at 18:27
  • @mnuages Sorry to bother you…… I'm struggling with a SceneKit problem could you help me out? Question:https://stackoverflow.com/questions/52428397/confused-about-orthographic-projection-of-camera-in-scenekit – ooOlly Sep 23 '18 at 12:11