Knight Posted May 23, 2017 Share Posted May 23, 2017 I have two .babylon files. One with meshes and skeletons, but no animation. The other one has skeletons and animation, but no meshes. Turns out BABYLON.SceneLoader.ImportMesh doesn't load the skeletons at all, because there's no mesh in the file. Is there any way to import .babylon file with just skeletons and animation? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 23, 2017 Share Posted May 23, 2017 You must use createAnimationRange and copyAnimationRange BABYLON.SceneLoader.ImportMesh("", "http://www.babylon.actifgames.com/anim/", "walk.babylon", scene, function (newMeshesFactice, particleSystems, skeletonsWalk) { var meshFactice = newMeshesFactice[0]; // Character lowpoly factice avec anim walk BipWalk = skeletonsWalk[0];// skeleton for anim walk BipWalk.createAnimationRange("walk", 0, 40); if (BipWalk) { meshFactice.position.x = 100; meshFactice.dispose();// delete mesh lowpoly factice // Import character hightpoly BABYLON.SceneLoader.ImportMesh("", "http://www.babylon.actifgames.com/anim/", "man.babylon", scene, function (newMeshesPerso, particleSystems, skeletonsPerso) { skeletonsPerso[0].copyAnimationRange(BipWalk, "walk", true); skeletonsPerso[0].beginAnimation("walk", true, 1.0); }); } }); I did this a while ago. The first importMesh, load the mesh with the animation and I put the movie in createanimationRange Then the second importMesh, load mesh with Skeleton without animation and I'll get the animation with copyAnimationRange This loads the animation on the fly PG exemple: http://www.babylonjs-playground.com/#GA8XI#12 Post here : http://www.html5gamedevs.com/topic/20768-loading-animations-on-the-fly/?do=findComment&comment=119347 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.