SceneKit SCNNode pivot property does not animate

Originator:miles.chris
Number:rdar://13204729 Date Originated:13-Feb-2013 02:25 PM
Status:Duplicate Resolved:16-Feb-2013
Product:Mac OS X SDK Product Version:10.8.2
Classification:Other Bug Reproducible:Always
 
Summary:

In the SceneKit SDK, the SCNNode pivot property is documented as animatable. However, any attempt to animate a change to this property results in the property value not changing at all (and no animation taking place).


Steps to Reproduce:

Create any SCNNode instance. Assign a new value to the pivot property, wrapped in a SCNTransaction. Run the app. Observe no change to the pivot point. Whereas, with the SCNTransaction lines removed (for no animation) the pivot point does change (non-animated).

Example:

    SCNTorus *torus = [SCNTorus torusWithRingRadius:8.0f pipeRadius:3.0f];
    SCNNode *torusNode = [SCNNode nodeWithGeometry:torus];
    [scene.rootNode addChildNode:torusNode];
    
    [SCNTransaction begin];
    [SCNTransaction setAnimationDuration:1.0];
    [SCNTransaction setAnimationTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
    
    torusNode.pivot = CATransform3DMakeTranslation(0.0f, 8.0f, 0.0f);
    
    [SCNTransaction commit];

The same result is observed if an explicit animation is used on the pivot point. For example:

    CABasicAnimation *pivotAnimation = [CABasicAnimation animationWithKeyPath:@"pivot"];
    pivotAnimation.fromValue = [NSValue valueWithCATransform3D:torusNode.pivot];
    pivotAnimation.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeTranslation(0.0f, 8.0f, 0.0f)];
    pivotAnimation.duration = 1.0;
    [torusNode addAnimation:pivotAnimation forKey:@"pivot"];


Expected Results:

The pivot property value should change with animation, as the API documentation for SCNNode pivot states that the property is animatable. Quote: "The SCNNode object’s pivot. Animatable."


Actual Results:

The pivot property value does not change and does not animate.


Regression:

n/a


Notes:

n/a

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!