arturitu / threejs-animation-workflow

A basic example of how to import from Blender multiple animated 3D models with three.js
MIT License
179 stars 37 forks source link

Cross origin issues #1

Open miquael opened 7 years ago

miquael commented 7 years ago

Getting 2 cross origin request issues when running this locally:

three.min.js:386 XMLHttpRequest cannot load file:///Users/mac/_DEV/_LAB/threejs-animation-workflow/textures/ground.png. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.

three.min.js:386 XMLHttpRequest cannot load file:///Users/mac/_DEV/_LAB/threejs-animation-workflow/models/eva-animated.json. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.

dcoollx commented 7 years ago

This is a common issue with threejs. Modern day browsers block scripts from accessing local files as a security features. The two ways to fix it are to host all files on a web server. Or launch chrome from cmd with the --allow-file-acess-from-files flag. The latter is somewhat dangerous tho