babbleon Posted January 8, 2018 Share Posted January 8, 2018 Hello, I have a very simple animation in Babylon.js using an exported Blender scene; a cube that starts at 0°, rotates 90° then back to 0°. I start this animation using using a function containing this: scene.beginAnimation(scene.getMeshByName("Cube"), 0, 60, false); The Blender file has 3 keyframes and I do not want to bake them before exporting - all easings need to be in Babylon. How to I apply easing to an easing function, say, QuadraticEase() using EASINGMODE_EASEINOUT to this in Babylon? Any help would really be appreciated. Thank you. Quote Link to comment Share on other sites More sharing options...
babbleon Posted January 8, 2018 Author Share Posted January 8, 2018 Sorted it.. and for anyone else struggling with this, here's what I did: var easingFunction = new BABYLON.QuadraticEase(); easingFunction.setEasingMode(BABYLON.EasingFunction.EASINGMODE_EASEINOUT); scene.getMeshByName("Cube.001").animations[0].setEasingFunction(easingFunction); scene.beginAnimation(scene.getMeshByName("Cube.001"), 0, 60, false, 1.0); animations[0] in this case is rotation, found by running this in the console: scene.getMeshByName("Cube.001").animations Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 8, 2018 Share Posted January 8, 2018 Well done Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.