How to changes the second material of model? #3917
-
Hi, I created the material color changer but its working on only first material. How can I change the other materials colors? Thanks |
Beta Was this translation helpful? Give feedback.
Answered by
WadeMorrison
Nov 2, 2022
Replies: 1 comment 1 reply
-
Hello! If I understand correctly, when you do: Depending on how many and where the colors you want to change you just simply add [1] to the end like so: Hope this helps! |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
salii15
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello! If I understand correctly, when you do:
const [material] = modelViewerColor.model.materials;
it will default to the [0] color.
Depending on how many and where the colors you want to change you just simply add [1] to the end like so:
const [material] = modelViewerColor.model.materials[0];
const [material1] = modelViewerColor.model.materials[1];
Hope this helps!