fix handling of materials maps clear and total removal with SLSL
parent
11c49c211c
commit
fb2380efd6
|
@ -10663,8 +10663,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
|
||||
FaceMaterial mat = null;
|
||||
UUID oldid = texface.MaterialID;
|
||||
|
||||
if(oldid != UUID.Zero)
|
||||
if (oldid == UUID.Zero)
|
||||
{
|
||||
if (materialAlphaMode == 1)
|
||||
return false;
|
||||
}
|
||||
else
|
||||
mat = m_materialsModule.GetMaterialCopy(oldid);
|
||||
|
||||
if(mat == null)
|
||||
|
@ -10673,7 +10677,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
mat.DiffuseAlphaMode = (byte)materialAlphaMode;
|
||||
mat.AlphaMaskCutoff = (byte)materialMaskCutoff;
|
||||
|
||||
UUID id = m_materialsModule.AddNewMaterial(mat);
|
||||
UUID id = m_materialsModule.AddNewMaterial(mat); // id is a hash of entire material hash, so this means no change
|
||||
if(oldid == id)
|
||||
return false;
|
||||
|
||||
|
@ -10717,23 +10721,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
FaceMaterial mat = null;
|
||||
UUID oldid = texface.MaterialID;
|
||||
|
||||
if(mapID != UUID.Zero)
|
||||
if (oldid == UUID.Zero)
|
||||
{
|
||||
if(oldid != UUID.Zero)
|
||||
mat = m_materialsModule.GetMaterialCopy(oldid);
|
||||
|
||||
if(mat == null)
|
||||
mat = new FaceMaterial();
|
||||
|
||||
mat.NormalMapID = mapID;
|
||||
mat.NormalOffsetX = offsetX;
|
||||
mat.NormalOffsetY = offsetY;
|
||||
mat.NormalRepeatX = repeatX;
|
||||
mat.NormalRepeatY = repeatY;
|
||||
mat.NormalRotation = rot;
|
||||
|
||||
mapID = m_materialsModule.AddNewMaterial(mat);
|
||||
if (mapID == UUID.Zero)
|
||||
return false;
|
||||
}
|
||||
else
|
||||
mat = m_materialsModule.GetMaterialCopy(oldid);
|
||||
|
||||
if(mat == null)
|
||||
mat = new FaceMaterial();
|
||||
|
||||
mat.NormalMapID = mapID;
|
||||
mat.NormalOffsetX = offsetX;
|
||||
mat.NormalOffsetY = offsetY;
|
||||
mat.NormalRepeatX = repeatX;
|
||||
mat.NormalRepeatY = repeatY;
|
||||
mat.NormalRotation = rot;
|
||||
|
||||
mapID = m_materialsModule.AddNewMaterial(mat);
|
||||
|
||||
if(oldid == mapID)
|
||||
return false;
|
||||
|
||||
|
@ -10782,28 +10789,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
FaceMaterial mat = null;
|
||||
UUID oldid = texface.MaterialID;
|
||||
|
||||
if (mapID != UUID.Zero)
|
||||
if(oldid == UUID.Zero)
|
||||
{
|
||||
if (oldid != UUID.Zero)
|
||||
mat = m_materialsModule.GetMaterialCopy(oldid);
|
||||
|
||||
if (mat == null)
|
||||
mat = new FaceMaterial();
|
||||
|
||||
mat.SpecularMapID = mapID;
|
||||
mat.SpecularOffsetX = offsetX;
|
||||
mat.SpecularOffsetY = offsetY;
|
||||
mat.SpecularRepeatX = repeatX;
|
||||
mat.SpecularRepeatY = repeatY;
|
||||
mat.SpecularRotation = rot;
|
||||
mat.SpecularLightColorR = colorR;
|
||||
mat.SpecularLightColorG = colorG;
|
||||
mat.SpecularLightColorB = colorB;
|
||||
mat.SpecularLightExponent = gloss;
|
||||
mat.EnvironmentIntensity = env;
|
||||
|
||||
mapID = m_materialsModule.AddNewMaterial(mat);
|
||||
if(mapID == UUID.Zero)
|
||||
return false;
|
||||
}
|
||||
else
|
||||
mat = m_materialsModule.GetMaterialCopy(oldid);
|
||||
|
||||
if (mat == null)
|
||||
mat = new FaceMaterial();
|
||||
|
||||
mat.SpecularMapID = mapID;
|
||||
mat.SpecularOffsetX = offsetX;
|
||||
mat.SpecularOffsetY = offsetY;
|
||||
mat.SpecularRepeatX = repeatX;
|
||||
mat.SpecularRepeatY = repeatY;
|
||||
mat.SpecularRotation = rot;
|
||||
mat.SpecularLightColorR = colorR;
|
||||
mat.SpecularLightColorG = colorG;
|
||||
mat.SpecularLightColorB = colorB;
|
||||
mat.SpecularLightExponent = gloss;
|
||||
mat.EnvironmentIntensity = env;
|
||||
|
||||
mapID = m_materialsModule.AddNewMaterial(mat);
|
||||
|
||||
if(oldid == mapID)
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue