diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index e5ff27a6d8..039b926720 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -324,10 +324,25 @@ namespace OpenSim.Framework } /// - /// Debug utility function to convert unbroken strings of XML into something human readable for occasional debugging purposes. - /// - /// Please don't delete me even if I appear currently unused! + /// Debug utility function to convert OSD into formatted XML for debugging purposes. /// + /// + /// A + /// + /// + /// A + /// + public static string GetFormattedXml(OSD osd) + { + return GetFormattedXml(OSDParser.SerializeLLSDXmlString(osd)); + } + + /// + /// Debug utility function to convert unbroken strings of XML into something human readable for occasional debugging purposes. + /// + /// + /// Please don't delete me even if I appear currently unused! + /// /// /// public static string GetFormattedXml(string rawXml) diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index be4ee41054..38b911266a 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs @@ -366,6 +366,8 @@ namespace OpenSim.Region.Physics.Meshing // physics_shape is an array of OSDMaps, one for each submesh if (decodedMeshOsd is OSDArray) { +// Console.WriteLine("decodedMeshOsd for {0} - {1}", primName, Util.GetFormattedXml(decodedMeshOsd)); + decodedMeshOsdArray = (OSDArray)decodedMeshOsd; foreach (OSD subMeshOsd in decodedMeshOsdArray) { @@ -373,6 +375,14 @@ namespace OpenSim.Region.Physics.Meshing { OSDMap subMeshMap = (OSDMap)subMeshOsd; +// Console.WriteLine("subMeshMap for {0} - {1}", primName, Util.GetFormattedXml((OSD)subMeshMap)); + + // As per http://wiki.secondlife.com/wiki/Mesh/Mesh_Asset_Format, some Mesh Level + // of Detail Blocks (maps) contain just a NoGeometry key to signal there is no + // geometry for this submesh. + if (subMeshMap.ContainsKey("NoGeometry") && ((OSDBoolean)subMeshMap["NoGeometry"])) + continue; + OpenMetaverse.Vector3 posMax = ((OSDMap)subMeshMap["PositionDomain"])["Max"].AsVector3(); OpenMetaverse.Vector3 posMin = ((OSDMap)subMeshMap["PositionDomain"])["Min"].AsVector3(); ushort faceIndexOffset = (ushort)coords.Count;