diff --git a/README.md b/README.md index ca74f8f5..479783e2 100644 --- a/README.md +++ b/README.md @@ -49,3 +49,22 @@ npm start ``` Then navigate to __[http://localhost:3333/examples/](http://localhost:3333/examples/)__ + +## Self-hosting the sample-assets directory + +The textures modal is using https://aframe.io/sample-assets/dist/images.json +to get the available textures. +The GitHub repository for those assets is https://github.com/aframevr/sample-assets + +If you want to self-host this directory, do the following: + +```bash +cd examples +git clone git@github.com:aframevr/sample-assets.git +``` + +edit `index.html` and define before any script tag this global variable: + +```html + +``` diff --git a/examples/index.html b/examples/index.html index a8eb189e..bea83746 100644 --- a/examples/index.html +++ b/examples/index.html @@ -3,6 +3,7 @@ Example Scene + diff --git a/src/lib/assetsLoader.js b/src/lib/assetsLoader.js index af6300e6..9feab8b5 100644 --- a/src/lib/assetsLoader.js +++ b/src/lib/assetsLoader.js @@ -1,6 +1,7 @@ import Events from './Events'; -const assetsBaseUrl = 'https://aframe.io/sample-assets/'; +const assetsBaseUrl = + window.AFRAME_SAMPLE_ASSETS_ROOT || 'https://aframe.io/sample-assets/'; const assetsRelativeUrl = { images: 'dist/images.json' }; /**