Skip to content
Snippets Groups Projects
Commit 63456982 authored by netpro2k's avatar netpro2k
Browse files

Allow creating an a-gltf-entity with no src set initially

parent 0e2dad69
No related branches found
No related tags found
No related merge requests found
......@@ -227,7 +227,7 @@ AFRAME.registerElement("a-gltf-entity", {
async value(src) {
try {
// If the src attribute is a selector, get the url from the asset item.
if (src.charAt(0) === "#") {
if (src && src.charAt(0) === "#") {
const assetEl = document.getElementById(src.substring(1));
const fallbackSrc = assetEl.getAttribute("src");
......@@ -246,6 +246,8 @@ AFRAME.registerElement("a-gltf-entity", {
if (src === this.lastSrc) return;
this.lastSrc = src;
if (!src) return;
const model = await cachedLoadGLTF(src);
// If we started loading something else already
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment