summaryrefslogtreecommitdiff
path: root/thirdparty/thekla_atlas/nvmesh/param/Atlas.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty/thekla_atlas/nvmesh/param/Atlas.cpp')
-rw-r--r--thirdparty/thekla_atlas/nvmesh/param/Atlas.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/thirdparty/thekla_atlas/nvmesh/param/Atlas.cpp b/thirdparty/thekla_atlas/nvmesh/param/Atlas.cpp
index 4e41e76695..98f92cef96 100644
--- a/thirdparty/thekla_atlas/nvmesh/param/Atlas.cpp
+++ b/thirdparty/thekla_atlas/nvmesh/param/Atlas.cpp
@@ -38,6 +38,7 @@ using namespace nv;
/// Ctor.
Atlas::Atlas()
{
+ failed=false;
}
// Dtor.
@@ -100,6 +101,7 @@ void Atlas::extractCharts(const HalfEdge::Mesh * mesh)
void Atlas::computeCharts(const HalfEdge::Mesh * mesh, const SegmentationSettings & settings, const Array<uint> & unchartedMaterialArray)
{
+ failed=false;
MeshCharts * meshCharts = new MeshCharts(mesh);
meshCharts->computeCharts(settings, unchartedMaterialArray);
addMeshCharts(meshCharts);
@@ -235,6 +237,8 @@ float Atlas::packCharts(int quality, float texelsPerUnit, bool blockAlign, bool
{
AtlasPacker packer(this);
packer.packCharts(quality, texelsPerUnit, blockAlign, conservative);
+ if (hasFailed())
+ return 0;
return packer.computeAtlasUtilization();
}