Query mesh item count from navigator.

This commit is contained in:
kovacsv 2021-10-25 06:42:57 +02:00
parent f5cedf6842
commit d35a23bb43
3 changed files with 16 additions and 1 deletions

View File

@ -213,6 +213,11 @@ OV.Navigator = class
this.Resize ();
}
MeshItemCount ()
{
return this.navigatorItems.MeshItemCount ();
}
IsMeshVisible (meshIndex)
{
let meshItem = this.navigatorItems.GetMeshItem (meshIndex);

View File

@ -65,6 +65,11 @@ OV.NavigatorItems = class
this.meshIndexToItem = {};
}
MaterialItemCount ()
{
return Object.keys (this.materialIndexToItem).length;
}
GetMaterialItem (materialIndex)
{
return this.materialIndexToItem[materialIndex];
@ -75,6 +80,11 @@ OV.NavigatorItems = class
this.materialIndexToItem[materialIndex] = materialItem;
}
MeshItemCount ()
{
return Object.keys (this.meshIndexToItem).length;
}
GetMeshItem (meshIndex)
{
return this.meshIndexToItem[meshIndex];

View File

@ -190,7 +190,7 @@ OV.Website = class
this.navigator.FitMeshToWindow (meshIndex);
}
});
if (this.model.MeshCount () > 1) {
if (this.navigator.MeshItemCount () > 1) {
let isMeshIsolated = this.navigator.IsMeshIsolated (meshIndex);
items.push ({
name : isMeshIsolated ? 'Remove isolation' : 'Isolate mesh',