Change Material property using API

Hi. I am happy to post a problem which is occurred in my end.
I am trying to change material property like the emission of my model using API.
Because I love sketchfab 3D setting function and I edited my model on it.
so I have to access to model setting using API in my project.
But I couldn’t find a way to implement this.
I want to know how it can be implemented.
Thanks, everybody to read my post.

Hi there @ProminenceHome . Here’s an example I just made: https://codepen.io/klaasnienhuis/pen/ExwGVQE. And here’s an example from the Sketchfab docs: Viewer API - Examples - Sketchfab

It really helps when you take a bit of time to study the structure of a Sketchfab material. You can see the materials logged into the console in my example. Basically, a material has an array of channels (e.g. roughness, emission, opacity). Each channel contains the settings which are specific for that channel.
In my example, I modify the factor of the RoughnessPBR channel of the material with the name Pot
The emission channel is called EmitColor

2 Likes

Thanks for your post.
It works amazingly. simple and best sample I have ever seen.
:smile:

2 Likes