Jump to content

[SOLVED] Easing exported Blender animation


babbleon
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...