zmahomedy Posted November 20, 2015 Share Posted November 20, 2015 Hi I am trying to figure out my why my import babylon scene file is always not found.I included it in the same location as my html files I am not running it off a web server, its running of my browser.var canvas = document.getElementById("3dCanvas"); var engine = new BABYLON.Engine(canvas, true); var scene; BABYLON.SceneLoader.Load("", "t.babylon", engine, function (newScene){ scene = newScene; var c = scene.getMeshByName("tetrahedron"); //Do what you want });XMLHttpRequest cannot load file:///C:/Users/zmm/lifeprint/new/t.babylon.manifest?1448032895642. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.t.checkManifestFile @ babylon.js:2babylon.js:3 XMLHttpRequest cannot load file:///C:/Users/zmm/lifeprint/new/t.babylon. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.h @ babylon.js:3babylon.js:3 Uncaught Error: Error status: 0 - Unable to load t.babylon Quote Link to comment Share on other sites More sharing options...
Temechon Posted November 20, 2015 Share Posted November 20, 2015 Hi, I am not running it off a web server, its running of my browser. That's the problem here. You cannot load external assets without a webserver. Quote Link to comment Share on other sites More sharing options...
dbawel Posted November 21, 2015 Share Posted November 21, 2015 Temechon is correct, as always - and there is practically no way around this - I said practically, which means that you'll never be able to use the switches and to "trick" your browser into believing it's operating off a remote web server. I've found a few basic operations which allow some exchange of elements locally - such as using this command line parameter in Chrome: --allow-file-access-from-files along with other formatting "tricks", but this is at all worth trying. It's simply a security function (feature) in all browsers, which won't provide the local access necessary to serve your scenes locally on the same system. Please don't put any time in attempting to make this work, as it simply will not. You must be working off of a remote server - even if it's in the next room or sitting next to your local system. If you aren't yet hosting a server, then it's time to do so. Quote Link to comment Share on other sites More sharing options...
RaananW Posted November 21, 2015 Share Posted November 21, 2015 I recently found this nice trick with python:python.exe -m SimpleHTTPServerThis will start a local server in the directory you are running it at. Could be helpful here.Of course, you need python installed :-) 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.