From 7bfab03c42dc1259194b80e684d5014fcff5378f Mon Sep 17 00:00:00 2001 From: kovacsv Date: Wed, 29 Dec 2021 11:59:52 +0100 Subject: [PATCH] Do not list material colors when vertex colors are applied. --- website/o3dv/js/sidebardetailspanel.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/website/o3dv/js/sidebardetailspanel.js b/website/o3dv/js/sidebardetailspanel.js index b02a252..e9b5216 100644 --- a/website/o3dv/js/sidebardetailspanel.js +++ b/website/o3dv/js/sidebardetailspanel.js @@ -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));