and more changes on uuid gatherer and libomv
parent
42b75021b6
commit
8ac70b6155
|
@ -849,6 +849,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
int st = -1;
|
int st = -1;
|
||||||
while ((st = data.IndexOf('<')) >= 0)
|
while ((st = data.IndexOf('<')) >= 0)
|
||||||
{
|
{
|
||||||
|
if (st > 0 && data[st - 1] == (byte)'\\')
|
||||||
|
data.osUTF8SubStringSelf(st + 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (st < 0)
|
if (st < 0)
|
||||||
|
@ -857,6 +859,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
int ed = -1;
|
int ed = -1;
|
||||||
while ((ed = data.IndexOf('>')) >= 0)
|
while ((ed = data.IndexOf('>')) >= 0)
|
||||||
{
|
{
|
||||||
|
if (data[st - 1] == (byte)'\\')
|
||||||
|
data.osUTF8SubStringSelf(st + 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (ed < 0)
|
if (ed < 0)
|
||||||
|
@ -984,24 +988,27 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void RecordMaterialAssetUuids(AssetBase materialAsset)
|
private void RecordMaterialAssetUuids(AssetBase materialAsset)
|
||||||
{
|
{
|
||||||
OSDMap mat;
|
osUTF8 data = new osUTF8(materialAsset.Data);
|
||||||
try
|
int next;
|
||||||
|
while ((next = getxmlheader(data, out osUTF8 header)) > 0)
|
||||||
{
|
{
|
||||||
mat = (OSDMap)OSDParser.DeserializeLLSDXml(materialAsset.Data);
|
data.osUTF8SubStringSelf(next);
|
||||||
}
|
if (header.StartsWith("/"))
|
||||||
catch (Exception e)
|
continue;
|
||||||
|
if (header.StartsWith("uuid"))
|
||||||
{
|
{
|
||||||
m_log.WarnFormat("[Materials]: cannot decode material asset {0}: {1}", materialAsset.ID, e.Message);
|
if(header.EndsWith((byte)'/'))
|
||||||
return;
|
continue;
|
||||||
|
int indx = data.IndexOf((byte)'<');
|
||||||
|
if(indx < 0)
|
||||||
|
continue;
|
||||||
|
osUTF8 tmp = data.osUTF8SubString(0, indx);
|
||||||
|
tmp.SelfTrim();
|
||||||
|
if(UUID.TryParse(tmp.ToString(), out UUID id) && id != UUID.Zero)
|
||||||
|
GatheredUuids[id] = (sbyte)AssetType.Texture;
|
||||||
|
data.osUTF8SubStringSelf(indx + 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UUID normMap = mat["NormMap"].AsUUID();
|
|
||||||
if (normMap != UUID.Zero)
|
|
||||||
GatheredUuids[normMap] = (sbyte)AssetType.Texture;
|
|
||||||
|
|
||||||
UUID specMap = mat["SpecMap"].AsUUID();
|
|
||||||
if (specMap != UUID.Zero)
|
|
||||||
GatheredUuids[specMap] = (sbyte)AssetType.Texture;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue