Skip to content

How can I get the default texture uri from a material? #2957

Answered by ghost
discodevl asked this question in Q&A
Discussion options

You must be logged in to vote

Textures loaded from a .glb have no URI because they are loaded from a buffer inside the .glb so there is no way to address them directly. You can check the type of the texture (modelviewer.model.materials[0].normalTexture.source.type for instance) if it's 'embedded' there will be no URI, and if it's 'external' there should be a defined URI.

What are you aiming to do? I might be able to provide some other suggestions with a little more detail.

Replies: 4 comments 16 replies

Comment options

You must be logged in to vote
7 replies
@discodevl
Comment options

@canberka
Comment options

@elalish
Comment options

@canberka
Comment options

@discodevl
Comment options

Answer selected by discodevl
Comment options

You must be logged in to vote
5 replies
@ghost
Comment options

@buddy90210
Comment options

@elalish
Comment options

@buddy90210
Comment options

@adesidaseyi
Comment options

Comment options

You must be logged in to vote
1 reply
@elalish
Comment options

Comment options

You must be logged in to vote
3 replies
@elalish
Comment options

@elalish
Comment options

@WadeMorrison
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
7 participants