AI提供的下面这个方法提示:mesh.material.setUniforms is not a function
handleGLTFLoaded({ detail }) {
const el = detail.value.target;
const gltf = el.getComponent("gltf");
const targetMeshes = gltf.getPrimitivesByNodeName("1");
targetMeshes.forEach(mesh => {
console.log(`Mesh :`, mesh); // 输出Mesh信息
// 正确设置颜色值范围(0-1)
mesh.material.baseColorFactor = [1, 0, 0, 1];
// 必须调用setUniforms更新着色器参数
mesh.material.setUniforms();
});
}
AI提供的下面这个方法提示:
mesh.material.setUniforms is not a function