hi, I want to change the model from html buttons here is my code
HtmlHandler.attributes.add(‘a’, {
type: ‘asset’,
assetType: ‘render’
});
HtmlHandler.attributes.add(‘b’, {
type: ‘asset’,
assetType: ‘render’
});
HtmlHandler.attributes.add(‘c’, {
type: ‘asset’,
assetType: ‘render’
});
var buttons = document.querySelectorAll(‘.v1’);
// if found
buttons.forEach(function (button, i) {
button.addEventListener('click', function (e) {
var obj = pc.app.root.findByName('box');
if (obj && obj.render) {
obj.render.asset = self.a;
}
});
});
it is change the model once time manual what should i do plz help?
Hi @ateeque ,
What do you mean it is change once time manual? Can you elaborate?
when i click the button it was changing the model once because I didnt use the loop so that problem was that is solved now the remaining issue is that
i am creating a vinity configurator and for UI i am using html&css
i have three types of shelf model and each have different matrial like lightmap etc
when i change the model it is changing but how can i change the the model lightmap here is video.
If you are using PlayCanvas runtime lightmaps, you need to regenerate them. There are several topics around the forum, do a quick search, for example:
Hi everyone!
Here’s the issue:
I have a scene with mostly light-mapped objects. When I’m switching parts of the scene on and off I call
app.lightmapper.bake();
to update lightmaps. When I do this, non-lightmapped models dissappear from the scene (with their shadows still rendering correctly into lightmaps).
The light is set to both “Affect Dynamic” and “Affect Lightmapped” and initially, the scene renders correctly.
Here’s a simple projects to demonstrate the issue:
https://playcanvas.c…