From 5c593f3892d3de0bc3dab25c9298a3f31d3d86c1 Mon Sep 17 00:00:00 2001 From: dahlia Date: Sun, 4 Oct 2009 20:01:44 -0700 Subject: only cache mesh if meshing was successful re-enable sculpt mesh caching --- OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index 0e29ccc..1ea08e2 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs @@ -498,12 +498,9 @@ namespace OpenSim.Region.Physics.Meshing // If this mesh has been created already, return it instead of creating another copy // For large regions with 100k+ prims and hundreds of copies of each, this can save a GB or more of memory - if (! primShape.SculptEntry) - { - key = GetMeshKey(primShape, size, lod); - if (m_uniqueMeshes.TryGetValue(key, out mesh)) - return mesh; - } + key = GetMeshKey(primShape, size, lod); + if (m_uniqueMeshes.TryGetValue(key, out mesh)) + return mesh; if (size.X < 0.01f) size.X = 0.01f; if (size.Y < 0.01f) size.Y = 0.01f; @@ -525,10 +522,9 @@ namespace OpenSim.Region.Physics.Meshing // trim the vertex and triangle lists to free up memory mesh.TrimExcess(); - } - if (!primShape.SculptEntry) m_uniqueMeshes.Add(key, mesh); + } return mesh; } -- cgit v1.1