Jump to content

New to blender and babylon.js


Recommended Posts

Hi everybody, I have an animation that works fine inside Blender. It's a bvh that use with a Makehuman model.  The problem:  I am able after several minutes to get a .babylon file.  But when I drag it to the Sandbox, I get an eternal spinning disk.  If somebody could help me, It's kind of a big project and I want to use blender and babylon.








Link to comment
Share on other sites

I don't know if it make a difference but I have used MakeWalk


Benoit, I used MakeWalk for the Blue Lady (and MakeClothes for the dress) Should be no big deal.


The link is in the first message......


Happy thangsgiving !!!!


I tried the link - but I have to "apply for access" which I have done. I assume you have to grant it somehow.


Et merci beaucoup pour les voeux.


cheers, gryff :)

Link to comment
Share on other sites

Well Benoit I got the file TY.


And I took a look at it. First question I have is: what rig did you export from Make Human?


What I see is a very complex rig with both FK,  IK and various control bones. Below is a screen grab showing just the bones in the right foot selected. In the yellow box, Blender tells me that I have 9 of 263 (!!!) selected. (The big bone at the base of the foot is an IK bone)


When I export you figure and rig, it exports all the 263 bones as far as I can tell. An example:


{"name":"toe.L","index":254,"matrix":[1.0000,0.0000,0.0000,0.0000,-0.0000,0.8890,-0.4579,0.0000,-0.0000,0.4579,0.8890,0.0000,-0.0000,1.3150,-0.0000,1.0000],"parentBoneIndex":246,"animation": {"dataType":3,"framePerSecond":24,"keys":[{"frame":1,"values":[1.0000,0.0000,0.0000,0.0000,-0.0000,0.8890,-0.4579,0.0000,-0.0000,0.4579,0.8890,0.0000,-0.0000,1.3150,-0.0000,1.0000]},{"frame":250,"values":[1.0000,0.0000,0.0000,0.0000,-0.0000,0.8890,-0.4579,0.0000,-0.0000,0.4579,0.8890,0.0000,-0.0000,1.3150,-0.0000,1.0000]}],"loopBehavior":1,"name":"anim","property":"_matrix"}}



Note  the index 254 for bone named "toe.L"


It does not appear to be exporting the animation apart from a start and end frame.


cheers, gryff :)




Link to comment
Share on other sites

I was alway chosing none so I was having a super complex rigging.....  Now I just have 33 bones.... And still working on my model....


Benoit, You chose the "game rig" - with 33 bones - right?


Now I am able to open my .babylon file in the sandbox but the animation isn't working....  My character is in t-pose without having the bvh file working....


Do you have a server that you can use? If so  set up your babylon file as part of a web page that you can then browse to


Create a webpage by grabbing  the scene loading code from my Blue Lady example (the index.html). Then just change the name of the babylon file to your file and delete all the code that refers to the music (the howler.js stuff).


Should work.


cheers, gryff :)

Link to comment
Share on other sites

Benoit : tutorial here : Loading your.babylon file inside your page app  by David Catuhe (AKA Deltakosh who runs  this forum)


Build an HTML page from the two blocks of code you find on that page when you scroll down. Something like below:

<html xmlns="http://www.w3.org/1999/xhtml"><head>    <title>Using babylon.js - How to load a scene</title>    <script src ="../hand.js"></script>    <script src= "../babylon.1.14-beta.js"></script>    <style>        html, body {            width: 100%;            height: 100%;            padding: 0;            margin: 0;            overflow: hidden;        }        #renderCanvas {            width: 100%;            height: 100%;        }    </style></head><body>    <canvas id="renderCanvas"></canvas>    <script>    if (BABYLON.Engine.isSupported()) {        var canvas = document.getElementById("renderCanvas");        var engine = new BABYLON.Engine(canvas, true);        BABYLON.SceneLoader.Load("", "xxxxxxx.babylon", engine, function (newScene) {            // Wait for textures and shaders to be ready            newScene.executeWhenReady(function () {                            // Attach camera to canvas inputs                newScene.activeCamera.attachControl(canvas);                //code to play animation                    var skeleton = newScene.getSkeletonById(0);                    newScene.beginAnimation(skeleton, 1, 499, true, 1);                // Once the scene is loaded, just register a render loop to render it                engine.runRenderLoop(function() {                    newScene.render();                });            });        }, function (progress) {            // To do: give progress feedback to user        });    }</script>             </body></html> 

Change the xxxxxxx to the name of your babylon file. Make sure you add the two lines of code to play the animation. Then save as index html. Upload to your webserver and view in your browser.


 See the tutorial for more on  setting up the files.


Make sure that all scripts, images, and the babylon file are all in their proper folders.


cheers, gryff :)

Link to comment
Share on other sites

The exporter can auto animate the rotation, position, & scaling of python sub-classes of FCurveAnimatable  : Mesh(all 3), Camera(no scaling), Light(only position).  I do not have a copy of the old, flat static class, legacy code on this machine, but I do not think it was dropped skeletal animation.  For .babylon files, enabling this may more than changing the exporter.

Link to comment
Share on other sites

  • 1 month later...

I want to stop the animation but this code doesn't work
please help my.

var createScene = function () {
var scene = new BABYLON.Scene(engine);

var camera = new BABYLON.ArcRotateCamera("Camera", 3 * Math.PI / 2, Math.PI / 8, 50, BABYLON.Vector3.Zero(), scene);

camera.attachControl(canvas, false);

var light = new BABYLON.HemisphericLight("hemi", new BABYLON.Vector3(0, 1, 0), scene);

BABYLON.SceneLoader.ImportMesh("a", "scenes/", "ww.babylon", scene, function (newMeshes) {

newMeshes[0].position = BABYLON.Vector3.Zero();
newMeshes[0].autoAnimate = false;
newMeshes[0].autoAnimateLoop = false;


return scene;

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.

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.


  • Recently Browsing   0 members

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