After successfully setting vertex colors for model elements added via STL loader, I am now facing an issue with changing these colors using the code below. Despite my efforts, the colors remain unchanged. Can anyone provide guidance on how to fix this?
let geometry = this.scene.getObjectByName("myFile.stl").geometry
const color = new THREE.Color(0xFF0000);
// @ts-ignore
for(let idx = 0; idx < geometry.attributes.color.count; idx++)
{
// @ts-ignore
geometry.getAttribute("color").setXYZ( idx, color.r, color.g, color.b )
}