pathogen Posted January 12, 2017 Share Posted January 12, 2017 I have imported a Blender scene which has a mesh with an animation (consisting of just a few keyframes) and I am looking to control the animation, however I have been unsuccessful. The only resources I have been able to find relate to using skeletons imported from Blender, not basic keyframe animations (unless I am missing something?). Example playground: http://www.babylonjs-playground.com/#ONZNB The animation data is located on line 20 of the playground. I have tried calling scene.beginAnimation('rotation animation', 0, 30, true); in the scene.executeWhenReady function to no avail. Hopefully somebody can help? Thanks! Quote Link to comment Share on other sites More sharing options...
pathogen Posted January 12, 2017 Author Share Posted January 12, 2017 Aha! The answer is to pass in the mesh itself to scene.beginAnimation, not the name of the mesh's animation! eg. scene.beginAnimation(rotatingMesh, 0, 30, true); Updated example playground: http://www.babylonjs-playground.com/#ONZNB#1 eps 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 12, 2017 Share Posted January 12, 2017 Well done Quote Link to comment Share on other sites More sharing options...
eps Posted November 20, 2018 Share Posted November 20, 2018 Thanks for this - I initially struggled to work out what you'd done - but then realised.... 1) extract the JSON text out of the babylon file from Blender and then add the mesh elements to be animated. I've now got a 4 mesh model with 3 parts which are animated and one which isn't all loaded and working..! Cheers, thanks for sharing! Sebavan 1 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.