Kevin192291 Posted February 16, 2015 Share Posted February 16, 2015 Hello, I have been trying to get a .babylon file to load, but just can't seem to get it to show up.Here is an example of my code: var canvas = document.getElementById("renderCanvas"); var engine = new BABYLON.Engine(canvas, true); var createScene = function () { var scene = new BABYLON.Scene(engine); var light = new BABYLON.PointLight("Omni", new BABYLON.Vector3(20, 20, 100), scene); var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0.8, 100, BABYLON.Vector3.Zero(), scene); camera.attachControl(canvas, false); BABYLON.SceneLoader.ImportMesh("", "", "/webGL/textures/Link/Car.babylon", scene, function (newMeshes) { camera.target = newMeshes[0]; }); // Move the light with the camera scene.registerBeforeRender(function () { light.position = camera.position; }); return scene; } var scene = createScene(); engine.runRenderLoop(function () { scene.render(); }); // Resize window.addEventListener("resize", function () { engine.resize(); });The problem seems to be that the manifest loads as /Car.babylon.manifest?1424064684181200but I don't see Car.babylon loading after. In the examples I see 2 objects loading in my console; the manifest, and the .babylon.If you guys could give me some direction with this, I would really appreciate it.Thanks -Kevin Quote Link to comment Share on other sites More sharing options...
iiceman Posted February 16, 2015 Share Posted February 16, 2015 Hi and welcome to the forum! Did you already try if the babylon file works when you upload it here: http://www.babylonjs.com/sandbox/ ? Just to make sure the file is okay in the first place... Quote Link to comment Share on other sites More sharing options...
RaananW Posted February 16, 2015 Share Posted February 16, 2015 just wondering - does the manifest load correctly ? does it exist? how does it look like? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 16, 2015 Share Posted February 16, 2015 this not correct signature: BABYLON.SceneLoader.ImportMesh("", "", "/webGL/textures/Link/Car.babylon", scene, function (newMeshes) { camera.target = newMeshes[0];});this correct: (signature: (name, path, file, scene ...)BABYLON.SceneLoader.ImportMesh("", "./webGL/textures/Link/", "Car.babylon", scene, function (newMeshes) { camera.target = newMeshes[0];}); Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted February 16, 2015 Share Posted February 16, 2015 This is not the first time someone has posted with the path in the name. Perhaps logging an error when '/' found in the file name arg? Lag from initial post to answer in this case was 8 hours. This does not count trying over - and - over first. Quote Link to comment Share on other sites More sharing options...
MarianG Posted February 16, 2015 Share Posted February 16, 2015 When you use function "ImportMesh", babylon first try to load your "manifest" file. If it doesn't exist, it'll load your "babylon" file. This is not a problem, but if you want that your files load from cache not from server directly, you need to create manifest file, like that :{ "version" : 1, "enableSceneOffline" : true, "enableTexturesOffline" : true}and save as : Car.babylon.manifest. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 17, 2015 Share Posted February 17, 2015 You're right JCPalmer, I'll add an error log when name stats with a "/" 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.