SceneView / sceneview-android

SceneView is a 3D and AR Android Composable and View with Google Filament and ARCore. This is a Sceneform replacement in Kotlin
Apache License 2.0
815 stars 159 forks source link

Animate Node transform/How to create Node Animations #534

Closed ThomasGorisse closed 17 hours ago

ThomasGorisse commented 3 months ago

Discussed in https://github.com/SceneView/sceneview-android/discussions/482

Originally posted by **paricleu** April 4, 2024 I've ran into a problem animating Node transforms. Transforms without animations work well e.g. `node.transform(position, rotation, scale)` and even smooth transformation are fine e.g. ``` node.transform(position, rotation, scale, true, 1.0) ``` Even tho it is nowhere documented what the "smoothSpeed" is referencing to. Is is seconds? It does not seem to be. What I am trying to achieve is animating a node and also be able to stop the animation if it is not finished yet. I came across ``` fun animatePositions(vararg positions: Position): ObjectAnimator = NodeAnimator.ofPosition(this, *positions) fun animateQuaternions(vararg quaternions: Quaternion): ObjectAnimator = NodeAnimator.ofQuaternion(this, *quaternions) fun animateRotations(vararg rotations: Rotation): ObjectAnimator = NodeAnimator.ofRotation(this, *rotations) fun animateScales(vararg scales: Scale): ObjectAnimator = NodeAnimator.ofScale(this, *scales) fun animateTransforms(vararg transforms: Transform): AnimatorSet = NodeAnimator.ofTransform(this, *transforms) ``` in Node.kt but I have no clue how to use it. `node.animateRotations(rotation).start()` does nothing. How can I create a node animation so it is cancelable?
github-actions[bot] commented 1 week ago

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 17 hours ago

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.