Merge branch 'sidebar' of https://github.com/kovacsv/Online3DViewer into sidebar
This commit is contained in:
commit
eb55ec80a0
@ -47,7 +47,9 @@ OV.Sidebar = class
|
|||||||
let valueColumn = $('<td>').addClass ('ov_property_table_value').appendTo (row);
|
let valueColumn = $('<td>').addClass ('ov_property_table_value').appendTo (row);
|
||||||
nameColum.html (property.name).attr ('title', property.name);
|
nameColum.html (property.name).attr ('title', property.name);
|
||||||
let valueText = null;
|
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 ();
|
valueText = property.value.toLocaleString ();
|
||||||
} else if (property.type === OV.PropertyType.Percent) {
|
} else if (property.type === OV.PropertyType.Percent) {
|
||||||
valueText = parseInt (property.value * 100, 10).toString () + '%';
|
valueText = parseInt (property.value * 100, 10).toString () + '%';
|
||||||
@ -79,9 +81,23 @@ OV.Sidebar = class
|
|||||||
|
|
||||||
AddMaterialProperties (material)
|
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 = [];
|
let properties = [];
|
||||||
properties.push (new OV.Property (OV.PropertyType.Color, 'Color', material.diffuse));
|
properties.push (new OV.Property (OV.PropertyType.Color, 'Color', material.diffuse));
|
||||||
properties.push (new OV.Property (OV.PropertyType.Percent, 'Opacity', material.opacity));
|
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);
|
this.AddProperties (properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user