0
votes
<a-sphere color="#EF2D5E" material="color:#EF2D5E;src:#abc" geometry="primitive:sphere;" src="#abc"></a-sphere>

The texture works and references "#abc" in a-assets.

Now when I change the src attribute to:

src=""

The texture doesn't seem to change. If I remove the attribute it goes black.

A-Frame 0.5.0

Example: https://codepen.io/msj121/pen/JNrWxg

1

1 Answers

1
votes

In your HTML...

<a-sphere color="#EF2D5E"
          material="color:#EF2D5E;
                    src:#abc"
          geometry="primitive:sphere;"
          src="#abc"></a-sphere>

... note that you have both a src attribute, and a material.src property. These are actually the same thing: src="#foo" is a shorthand for material="src: #foo;". I'm not sure what happens when you try to set both, but it might cause issues. So, I'd pick one of those and stick with it.

Depending on which you pick, you can unset the texture in one of these two ways:

el.setAttribute('material', {src: ''});
el.setAttribute('src', '');

If neither of those work, you probably have found a bug; please report it on GitHub. :)