Check if the model is empty based on the node hierarchy.

This commit is contained in:
kovacsv 2021-10-27 10:04:50 +02:00
parent fc2dd12aa0
commit 94e8f15a24

View File

@ -47,13 +47,13 @@ OV.FlipMeshTrianglesOrientation = function (mesh)
OV.IsModelEmpty = function (model) OV.IsModelEmpty = function (model)
{ {
for (let i = 0; i < model.MeshCount (); i++) { let isEmpty = true;
let mesh = model.GetMesh (i); model.EnumerateMeshInstances ((meshInstance) => {
if (mesh.TriangleCount () > 0) { if (meshInstance.TriangleCount () > 0) {
return false; isEmpty = false;
} }
} });
return true; return isEmpty;
}; };
OV.CloneMesh = function (mesh) OV.CloneMesh = function (mesh)