-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gltf-model update not working with assets #4341
Comments
I'm Facing this same issue with v1.0.4. I was updating some code from v.0.8.0 and setAttribute to update the model with an asset id doesn't work anymore. I managed to "solve" it by removing the atttribute and then setting the new model.
|
Hi fcor, After more digging I found out that the problem occurs only with components that have isSingleProperty === true I tested and transformed gltf-model schema in more properties from this:
and the update is working as expected. As mentioned in the first comment, before buildData was done always and now only the first time during initialization. Another solution could be to force parse of singleProperties schemas like it happens for multiProperties or be more selective and do it only for assets.
to this:
As you can notice |
Great job on digging into it! I managed to make it work as I mentioned earlier and worked fine locally, but when deploying the app to Firebase, GLTF files doesn't load and I'm always getting:
Even in the first load, before trying to update. Also, when trying to load a .obj I get this:
Weird thing is that everything works as expected running a local server. @dmarcos Any suggestion 😃 ? |
That seems more like a Firebase problem about resolving the src of the assets correctly. |
Yes, that was it. Firebase was unable to resolve the src of the assets. It's working now, thanks! |
It seems you figured out and everything is working. I close this and can reopen if necessary. Thanks |
Description:
Since AFrame 0.9 it seems that gltf-model component is not working when using setAttribute to update the model with an asset id.
How to replicate:
The problem can be replicated here:
https://glitch.com/edit/#!/serious-sunspot?path=index.html:10:0
We have 2 models in the assets: stool and sofa.
We have 4 aframe versions available:
removed this // this.data = attrValue; with this this.data = this.buildData(attrValue);
The procedure to update the model can be done via console with:
let model = document.querySelector('[gltf-model]')
model.setAttribute('gltf-model', '#sofa')
If you change aframe versions, you will see that this will work on 0.8.2 (1) and the modified master (4) but it will not work with 0.9.2 (2) and latest master (3).
After some logging I found out that, when it works, the data of the gltf-model component is https://..
while when it does not work, the data is #asset-id
I found out that this.buildData is responsible for converting #asset-id to https://..
I think that this commit
5759e99#diff-af69d6ecdd80a14b4e4df0784d3dc8d9
might be responsible for this.
I look forward your response.
Regards, Marco
The text was updated successfully, but these errors were encountered: