Assigning multiple textures with one button/selection? #3771
-
Hello! I've had to re-work my previous configurator from having all the textures shipping with each model, to now assigning them from an external source. Reason being my company has a ton of color options that eventually made it to where the file size was getting too big to load quick enough for a good user experince. I've got the baseColorTexture to switch on 'click', but having trouble on how to go about assigning the normal and ORM texture at the same time. (the customer won't be able to switch this individually, just the overall material. Here is an example of what I've go thus far:
I'm assuming I probably need to go more of the route of innerHTML instead of querySelector in order to get the different values of the buttons? Greatly appreciate the help! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
No need for innerHTML, just set e.g. However, you also need to change your |
Beta Was this translation helpful? Give feedback.
-
Hey so after playing around with it more, I got it to work! However, I was wondering if this is the correct way of doing it? I'm sure there's a more condensed way of doing this, so I figured I'd ask here/Stack, as well as keep playing around with it. Eventually I have to incorporate this into my MERN stack and get rid of the embedded variants. I tried using "if, else if, else" but kept getting errors.
|
Beta Was this translation helpful? Give feedback.
Hey so after playing around with it more, I got it to work! However, I was wondering if this is the correct way of doing it? I'm sure there's a more condensed way of doing this, so I figured I'd ask here/Stack, as well as keep playing around with it. Eventually I have to incorporate this into my MERN stack and get rid of the embedded variants. I tried using "if, else if, else" but kept getting errors.