From 05d0e65ce7504b7205e8ba9d2d5a98b8e5ca89cc Mon Sep 17 00:00:00 2001 From: kovacsv Date: Sun, 20 Jun 2021 11:38:34 +0200 Subject: [PATCH] Add texture maps. --- website/o3dv/sidebar.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/website/o3dv/sidebar.js b/website/o3dv/sidebar.js index e81942d..d5a1e1c 100644 --- a/website/o3dv/sidebar.js +++ b/website/o3dv/sidebar.js @@ -47,7 +47,9 @@ OV.Sidebar = class let valueColumn = $('').addClass ('ov_property_table_value').appendTo (row); nameColum.html (property.name).attr ('title', property.name); let valueText = null; - if (property.type === OV.PropertyType.Integer) { + if (property.type === OV.PropertyType.Text) { + valueText = property.value; + } else if (property.type === OV.PropertyType.Integer) { valueText = property.value.toLocaleString (); } else if (property.type === OV.PropertyType.Percent) { valueText = parseInt (property.value * 100, 10).toString () + '%'; @@ -79,9 +81,23 @@ OV.Sidebar = class AddMaterialProperties (material) { + function AddTextureMap (properties, name, map) + { + if (map === null || map.name === null) { + return; + } + let fileName = OV.GetFileName (map.name); + properties.push (new OV.Property (OV.PropertyType.Text, name, fileName)); + } + let properties = []; properties.push (new OV.Property (OV.PropertyType.Color, 'Color', material.diffuse)); properties.push (new OV.Property (OV.PropertyType.Percent, 'Opacity', material.opacity)); + AddTextureMap (properties, 'Diffuse Map', material.diffuseMap); + AddTextureMap (properties, 'Specular Map', material.specularMap); + AddTextureMap (properties, 'Bump Map', material.bumpMap); + AddTextureMap (properties, 'Normal Map', material.normalMap); + AddTextureMap (properties, 'Emissive Map', material.emissiveMap); this.AddProperties (properties); }