When asked to change the Material for one face, change only that face; not the default material

master-beforevarregion
Oren Hurvitz 2013-12-12 15:14:24 +02:00 committed by dahlia
parent 3018b2c5d7
commit 68d83425c6
1 changed files with 5 additions and 18 deletions

View File

@ -339,27 +339,14 @@ namespace OpenSim.Region.OptionalModules.Materials
if (matsMap.ContainsKey("Face"))
{
face = matsMap["Face"].AsInteger();
if (te.FaceTextures == null) // && face == 0)
{
if (te.DefaultTexture == null)
m_log.WarnFormat("[Materials]: te.DefaultTexture is null in {0} {1}", sop.Name, sop.UUID);
else
te.DefaultTexture.MaterialID = id;
}
else
{
if (te.FaceTextures.Length >= face - 1)
{
if (te.FaceTextures[face] == null)
te.DefaultTexture.MaterialID = id;
else
te.FaceTextures[face].MaterialID = id;
}
}
Primitive.TextureEntryFace faceEntry = te.CreateFace((uint)face);
faceEntry.MaterialID = id;
}
else
{
if (te.DefaultTexture != null)
if (te.DefaultTexture == null)
m_log.WarnFormat("[Materials]: TextureEntry.DefaultTexture is null in {0} {1}", sop.Name, sop.UUID);
else
te.DefaultTexture.MaterialID = id;
}