Open feritarou opened 1 year ago
Thanks, can you revert chore: build package so the PR is just about Mesh.ts
@klevron Sure, just did so (wasn't sure how long it would take you to note/merge this PR but I needed that change urgently so I just built my fork without thinking - sorry for that)
Thanks
setMaterial
won't be called with an array of materials : https://github.com/troisjs/trois/blob/master/src/materials/Material.ts#L50
I think it should be :
setMaterial(material: Material) {
if (Array.isArray(this.material)) {
this.material.push(material)
} else {
if (this.material) {
this.material = [this.material, material]
} else {
this.material = material
}
}
if (this.mesh) this.mesh.material = material
}
But there should be some HMR problem, I don't have time to test for the moment.
Made in reaction to #89