Question

I am trying to load .babylon file. But it doesn't load any thing, the page is blank.

I was using the following links:

  1. Import a 3d scene into babylonJS
  2. How to load Babylon file produced with blender

The sample files provided by the second link didn't work on my machine. Then I found that they need to be hosted on a server. After uploading the files on dropbox.com they started working but my file is still not working.

The code on the link:

BABYLON.SceneLoader.Load("", "scene.babylon", engine, function (newScene) {

I just changed it to:

BABYLON.SceneLoader.Load("", "myscene.babylon", engine, function (newScene) {

The error in the browser's console is:

Uncaught TypeError: Cannot read property '0' of undefined                 babylon.js:1
BABYLON.Vector3.FromArray                                                 babylon.js:1
(anonymous function)                                                      babylon.js:11
request.onreadystatechange                                                babylon.js:1

Additional Information:

myscene.babylon is exported from blender using Babylon Exporter available on GitHub official link.

It only contains a cube and a plane.

Was it helpful?

Solution 2

I also added the step to define MIME type on your webserver to this article (Thanks to David Rousset): How to load a .babylon file

OTHER TIPS

Does your file work in our online sandbox: http://www.babylonjs.com/sandbox ?

You just have to drag'n'drop your .babylon file into the sandbox. If it works, this means you have a webserver configuration issue.

Bye,

David

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top