Do not list material colors when vertex colors are applied.

This commit is contained in:
kovacsv 2021-12-29 11:59:52 +01:00
parent 15b49457af
commit 7bfab03c42

View File

@ -78,12 +78,15 @@ OV.SidebarDetailsPanel = class extends OV.SidebarPanel
}
this.AddProperty (table, new OV.Property (OV.PropertyType.Text, 'Source', material.isDefault ? 'Default' : 'Model'));
this.AddProperty (table, new OV.Property (OV.PropertyType.Text, 'Type', typeString));
this.AddProperty (table, new OV.Property (OV.PropertyType.Color, 'Color', material.color));
if (material.type === OV.MaterialType.Phong) {
this.AddProperty (table, new OV.Property (OV.PropertyType.Color, 'Ambient', material.ambient));
this.AddProperty (table, new OV.Property (OV.PropertyType.Color, 'Specular', material.specular));
if (material.vertexColors) {
this.AddProperty (table, new OV.Property (OV.PropertyType.Text, 'Color', 'Vertex colors'));
} else {
this.AddProperty (table, new OV.Property (OV.PropertyType.Color, 'Color', material.color));
if (material.type === OV.MaterialType.Phong) {
this.AddProperty (table, new OV.Property (OV.PropertyType.Color, 'Ambient', material.ambient));
this.AddProperty (table, new OV.Property (OV.PropertyType.Color, 'Specular', material.specular));
}
}
this.AddProperty (table, new OV.Property (OV.PropertyType.Boolean, 'Vertex Colors', material.vertexColors));
if (material.type === OV.MaterialType.Physical) {
this.AddProperty (table, new OV.Property (OV.PropertyType.Percent, 'Metalness', material.metalness));
this.AddProperty (table, new OV.Property (OV.PropertyType.Percent, 'Roughness', material.roughness));