giertych97 Posted December 20, 2014 Share Posted December 20, 2014 Hi, I'm new in babylon.js (and the others 3d frameworks). A moment ago I exported scene from *.obj to *.babylon. Now I'm trying to load it, but im getting error: TypeError: a is undefined [babylon.min.js:2] My simple code: if (BABYLON.Engine.isSupported()) { var canvas = document.getElementById("renderCanvas"); var engine = new BABYLON.Engine(canvas, true); BABYLON.SceneLoader.Load("", "/~patrol/objects/maps/city/scene.babylon", engine, function (newScene) { // Wait for textures and shaders to be ready newScene.executeWhenReady(function () { // Attach camera to canvas inputs newScene.activeCamera.attachControl(canvas); // 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 }); } Quote Link to comment Share on other sites More sharing options...
Carlos R Posted December 21, 2014 Share Posted December 21, 2014 Hi @giertych97, can you share us your .babylon scene? or in order to get a quick look we need a repro case in the playground, can you share it? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted December 21, 2014 Share Posted December 21, 2014 Your error is on this line Bad = > BABYLON.SceneLoader.Load("", "/~patrol/objects/maps/city/scene.babylon", engine, function (newScene) { The path should be in the first argument : Good => BABYLON.SceneLoader.Load("/~patrol/objects/maps/city/", "scene.babylon", engine, function (newScene) { Quote Link to comment Share on other sites More sharing options...
RaananW Posted December 21, 2014 Share Posted December 21, 2014 This usually happens to me when the babylon scene is missing needed information. If dad's advice didn't help, paste your babylon scene file. My guess is that something is wrong there. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted December 21, 2014 Share Posted December 21, 2014 Couple of thoughts: If you are going to post about an error in Babylon.js, do yourself a favor & use the debug version. Line 2 of babylon.min.js has probably hundreds of statements. SceneLoader, is not a statement executed inside a tight loop, so if having a '/' is not valid inside the filename arg, then performing argument validation should be done. You can look at such things for a long time and not notice the issue. Temechon 1 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.