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)
{
for (let i = 0; i < model.MeshCount (); i++) {
let mesh = model.GetMesh (i);
if (mesh.TriangleCount () > 0) {
return false;
let isEmpty = true;
model.EnumerateMeshInstances ((meshInstance) => {
if (meshInstance.TriangleCount () > 0) {
isEmpty = false;
}
}
return true;
});
return isEmpty;
};
OV.CloneMesh = function (mesh)