Skip to content

How to change Material property of .GlTF files on Android #4109

Answered by romainguy
murielK asked this question in Q&A
Discussion options

You must be logged in to vote

It crashes because you are creating an empty material. A Material needs to be built by loading a file compiled with matc (you can see examples of materials in our sample apps).

An entity with a renderable component (from RenderManager) is made of several "primitives" (think submeshes with different materials, for instance a sword would have a primitive for the blade made of metal, and another primitive for the hilt made of leather). The primitive index is simply which primitive you want to modify.

In the particular case of glTF instead of creating new materials you could simply get the existing materials and modify their properties.

Replies: 1 comment 3 replies

Comment options

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

@romainguy
Comment options

@murielK
Comment options

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