From 8f2986bc6a438ea9f5de912a5b76a196e7933175 Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 2 Aug 2010 21:54:47 -0700 Subject: Catch meshing error in Meshmerizer --- OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index fded95e..fb2b462 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs @@ -336,16 +336,24 @@ namespace OpenSim.Region.Physics.Meshing bool mirror = ((primShape.SculptType & 128) != 0); bool invert = ((primShape.SculptType & 64) != 0); - sculptMesh = new PrimMesher.SculptMesh((Bitmap)idata, sculptType, (int)lod, false, mirror, invert); - - idata.Dispose(); + try + { + sculptMesh = new PrimMesher.SculptMesh((Bitmap)idata, sculptType, (int)lod, false, mirror, invert); + + idata.Dispose(); - sculptMesh.DumpRaw(baseDir, primName, "primMesh"); + sculptMesh.DumpRaw(baseDir, primName, "primMesh"); - sculptMesh.Scale(size.X, size.Y, size.Z); + sculptMesh.Scale(size.X, size.Y, size.Z); - coords = sculptMesh.coords; - faces = sculptMesh.faces; + coords = sculptMesh.coords; + faces = sculptMesh.faces; + } + catch(Exception ex) + { + m_log.Error("[Meshing]: Unable to generate a Sculpty mesh. " + ex.Message); + return null; + } } else { -- cgit v1.1