Hide isolation option when there is only one mesh in the model.

This commit is contained in:
kovacsv 2021-07-30 13:29:44 +02:00
parent 64ef4491cb
commit bffb791696
2 changed files with 15 additions and 8 deletions

View File

@ -213,6 +213,11 @@ OV.Navigator = class
this.UpdateInfoPanel ();
this.Resize ();
}
MeshCount ()
{
return this.modelData.MeshCount ();
}
IsMeshVisible (meshIndex)
{

View File

@ -165,7 +165,6 @@ OV.Website = class
}
} else {
let meshIndex = meshUserData.originalMeshIndex;
let isMeshIsolated = this.navigator.IsMeshIsolated (meshIndex);
items.push ({
name : 'Hide mesh',
icon : 'assets/images/context/hide.svg',
@ -180,13 +179,16 @@ OV.Website = class
this.navigator.FitMeshToWindow (meshIndex);
}
});
items.push ({
name : isMeshIsolated ? 'Remove isolation' : 'Isolate mesh',
icon : isMeshIsolated ? 'assets/images/context/deisolate.svg' : 'assets/images/context/isolate.svg',
onClick : () => {
this.navigator.IsolateMesh (meshIndex);
}
});
if (this.navigator.MeshCount () > 1) {
let isMeshIsolated = this.navigator.IsMeshIsolated (meshIndex);
items.push ({
name : isMeshIsolated ? 'Remove isolation' : 'Isolate mesh',
icon : isMeshIsolated ? 'assets/images/context/deisolate.svg' : 'assets/images/context/isolate.svg',
onClick : () => {
this.navigator.IsolateMesh (meshIndex);
}
});
}
}
this.dialog = OV.ShowListPopup (items, {
calculatePosition : (contentDiv) => {