a-cubemap as asset in component
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 17.6k
- Forks
- 4.4k
- PR merge metrics
- No merged PRs in 30d
Description
Description:
- A-Frame Version: 0.9.2 (Date 2019-05-06, Commit #f57a1fa)
- Platform / Device: all
- Reproducible Code Snippet or URL:
When defining a schema type as asset and providing the id of an a-cubemap the asset in the component is null.
Expected:
Expected a node that I could use .srcs and get the cubemap images.
What I've figured out so far.
Updating the assetParse function to include A-CUBEMAP would pass the el through as expected.
https://github.com/aframevr/aframe/blob/f863f01206a25951eb39b389ae7031885153143a/src/core/propertyTypes.js#L90
if (value.charAt(0) === '#') {
el = document.getElementById(value.substring(1));
if (el) {
// Pass through media elements. If we have the elements, we don't have to call
// three.js loaders which would re-request the assets.
if (el.tagName === 'CANVAS' || el.tagName === 'VIDEO' || el.tagName === 'IMG' || el.tagName === 'A-CUBEMAP') {
return el;
}
return el.getAttribute('src');
}
warn('"' + value + '" asset not found.');
return;
}
If there is no specific reason why not to do this, then I will fork and do a pr
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/core/propertyTypes.js at the assetParse function and review how an asset reference is resolved for an a-cubemap element. Reproduce the reported schema case and verify that resolving its id returns the a-cubemap node, including its usable srcs property.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, three.js
- Domain
- computer-graphics, frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100