修复材质导入问题
This commit is contained in:
@@ -167,15 +167,17 @@ export class MaterialEditor
|
||||
private Material: PhysicalMaterialRecord;
|
||||
setMaterial(mat: PhysicalMaterialRecord)
|
||||
{
|
||||
console.log("set", mat.Material);
|
||||
this.Material = mat;
|
||||
this._MeshMaterial.copy(mat.Material);
|
||||
// for (const child of this.ShowObject.children) {
|
||||
// if (child instanceof Mesh) {
|
||||
// child.material = mat.Material;
|
||||
// }
|
||||
// }
|
||||
|
||||
let mtl = this._MeshMaterial;
|
||||
console.log("set2", this._MeshMaterial)
|
||||
console.log(mat.Material);
|
||||
|
||||
this.ShowMesh.material = mtl;
|
||||
|
||||
this._MeshMaterial.copy(mat.Material);
|
||||
let mtl = this._MeshMaterial;
|
||||
if (mtl.metalness > 0.8)
|
||||
this.LoadMetalEnv().then(env =>
|
||||
{
|
||||
@@ -214,6 +216,7 @@ export class MaterialEditor
|
||||
|
||||
async Update()
|
||||
{
|
||||
console.log("copy:", this.Material.Material.metalness);
|
||||
let mat = this.ShowMesh.material as MeshPhysicalMaterial;
|
||||
mat.needsUpdate = true;
|
||||
|
||||
|
Reference in New Issue
Block a user