Jump to content

Blender animation not working in Babylon.JS


Recommended Posts


I'm currently working on a simple weapon animation using Blender (2.77a / 2.69) with the Babylon.JS exporter 4.5.0 and it's failing.
The animation is working perfectly in blender but when exporting to a babylon structure the mesh / armatures spread around the rifle in a "random" way.
In Babylon.JS (or even in the sandbox) the exported file isn't working properly.

Are there any step-by-step tutorials getting started for using Babylon.JS with blender animations?
Or are there some important checkboxes I need to enable to get this animation working?

I've attached two screenshots, one showing the animation in blender and one show the result of an export. The blend file is in the attachments too.

Thanks for every answer, Simon




Link to comment
Share on other sites

var createScene = function () {
    var scene = new BABYLON.Scene(engine);
	scene.clearColor = new BABYLON.Color3(0.1, .3,.3)

    // This creates a light, aiming 0,1,0 - to the sky (non-mesh)
    var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), scene);
	light.specular = new BABYLON.Color3(0, 0, 0)
    var camera = new BABYLON.ArcRotateCamera("ArcRotateCamera",1.8, 1.5, 15, new BABYLON.Vector3(0, 0, 0), scene);
    camera.target = new BABYLON.Vector3(0, -1, 0);
BABYLON.SceneLoader.ImportMesh("", "pathtoyourfile", "hunting_rifle.babylon", scene, function (newMeshes) {
	scene.executeWhenReady(function () {
	scene.activeCamera.attachControl(canvas, false);
	scene.beginAnimation(scene.getSkeletonById(0), 1, 61, !0, 1);});
	return scene;

I don't know if Blender   2.77a is supported by babylon. it works with 2.75)


Link to comment
Share on other sites

7 hours ago, smatt said:

Blender (2.77a / 2.69) with the Babylon.JS exporter 4.5.0 and it's failing.

As @Nabroski says Blender 2.77a is not supported. It is a "Release Candidate(RC)". There is a second RC : Blender 2.77b. All trying to find bugs.

@JCPalmer who writes the exporter does not write a new exporter for Blender versions that may contain bugs. Also Blender 2.77 no longer supports Windows XP - so we have no idea  what changes have been made "under the hood".

Use Blender 2.76 and the exporter 4.6.1 - the most up to date combo.

cheers, gryff :)

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...