更新编辑模型,添加材质名支持

This commit is contained in:
2025-05-30 11:58:55 +08:00
parent 074ad202a9
commit 696e8b294e
5 changed files with 17 additions and 19 deletions

View File

@@ -168,14 +168,7 @@ export class MaterialEditor
setMaterial(mat: PhysicalMaterialRecord)
{
this.Material = mat;
// for (const child of this.ShowObject.children) {
// if (child instanceof Mesh) {
// child.material = mat.Material;
// }
// }
console.log(mat.Material);
this._MeshMaterial.copy(mat.Material);
let mtl = this._MeshMaterial;
if (mtl.metalness > 0.8)
@@ -216,7 +209,6 @@ export class MaterialEditor
async Update()
{
console.log("copy:", this.Material.Material.metalness);
let mat = this.ShowMesh.material as MeshPhysicalMaterial;
mat.needsUpdate = true;