Sign in to follow this  
GrosSacASacs

How to use multiple animation on 1 mesh at will ?

Recommended Posts

I import mesh from a json babylon file into BabylonJS with BABYLON.SceneLoader.ImportMesh, I then use scene.beginAnimation(allMeshes[meshName], 0, 100, true);

This works well for 1 animation. How can I have multiple animation for 1 mesh ( walking, running, idle, laughing) and use it in Babylon ? In Blender you can give names to the different actions. I searched the docs but didn't found an answer.

1 temporary solution I see, import the same mesh with 1 different animation multiples times, and when we want to start an animation we replace the mesh with the same at the same position except it has a different animation and then call scene.beginAnimation .

Share this post


Link to post
Share on other sites

Hello we are supporting named animations (actions) from blender (suing  AnimationRang):

scene.executeWhenReady(function () {
     // Attach camera to canvas inputs
     scene.activeCamera.attachControl(canvas);

     // Once the scene is loaded, register a render loop
     engine.runRenderLoop(function() {
         scene.render();
     });
     var skeleton1 = scene.getSkeletonByName("Armature");

     skeleton1.beginAnimation("walk");         
});

Just search the forum for "AnimationRange" to get more example

Share this post


Link to post
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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.