We want to add color picker on website using API. So that end user can choose color from the predefined color picker even after end user is not satisfied with predefined colors then they should select the custom color of their choice. Please guide us how we can implement color picker.
Kindly check the below mentioned script that we are using to load the configurator on website :
window
.threekitPlayer({
authToken: "public_token",
el: document.getElementById("player"),
assetId: "asset_id",
showConfigurator: true,
showAR: true,
showShare: true
})
.then(async api => {
window.player = api;
var data = window.configurator = await api.getConfigurator();
});
The quickdemo site simply uses the HTML input color and using an event listener will set the appropriate color attribute on Threekit. You do have to make sure your Threekit item is using the attribute type of Color.
What attribute are you trying to target? Like I said, you need an attribute type of ‘color’ on Threekit to set the color from the picker. When you configurator.getAttributes() from the Mixer Demo, you can see a type: color
On the page you linked, you only have attribute types of String and Asset.
setConfiguration({Attribute_name: Attribute_Value})
I do not see an attribute called Color on your model, it seems you are trying to set an attribute that does not exist.
Yes we are trying to target the color attribute and first we need to make sure Color attributes is set or not inside threekit model panel. After that will update you soon.
I have opened a case for you Vikram, someone from Threekit will be in touch via our support channels. Please contact me if you have any questions about this topic and feel free to post a new topic with any new questions.