aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Materials
diff options
context:
space:
mode:
authorOren Hurvitz2013-12-12 15:14:24 +0200
committerdahlia2014-01-20 00:38:43 -0800
commit68d83425c6b39614210b28e97d5006a882ea3097 (patch)
tree29627536faf837a81a2bb073e342edc89d9beb58 /OpenSim/Region/OptionalModules/Materials
parentMaterials module: a) Store materials as assets; b) Finalized it (removed the ... (diff)
downloadopensim-SC_OLD-68d83425c6b39614210b28e97d5006a882ea3097.zip
opensim-SC_OLD-68d83425c6b39614210b28e97d5006a882ea3097.tar.gz
opensim-SC_OLD-68d83425c6b39614210b28e97d5006a882ea3097.tar.bz2
opensim-SC_OLD-68d83425c6b39614210b28e97d5006a882ea3097.tar.xz
When asked to change the Material for one face, change only that face; not the default material
Diffstat (limited to 'OpenSim/Region/OptionalModules/Materials')
-rw-r--r--OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs23
1 files changed, 5 insertions, 18 deletions
diff --git a/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs b/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs
index 09041e8..9779594 100644
--- a/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs
+++ b/OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs
@@ -339,27 +339,14 @@ namespace OpenSim.Region.OptionalModules.Materials
339 if (matsMap.ContainsKey("Face")) 339 if (matsMap.ContainsKey("Face"))
340 { 340 {
341 face = matsMap["Face"].AsInteger(); 341 face = matsMap["Face"].AsInteger();
342 if (te.FaceTextures == null) // && face == 0) 342 Primitive.TextureEntryFace faceEntry = te.CreateFace((uint)face);
343 { 343 faceEntry.MaterialID = id;
344 if (te.DefaultTexture == null)
345 m_log.WarnFormat("[Materials]: te.DefaultTexture is null in {0} {1}", sop.Name, sop.UUID);
346 else
347 te.DefaultTexture.MaterialID = id;
348 }
349 else
350 {
351 if (te.FaceTextures.Length >= face - 1)
352 {
353 if (te.FaceTextures[face] == null)
354 te.DefaultTexture.MaterialID = id;
355 else
356 te.FaceTextures[face].MaterialID = id;
357 }
358 }
359 } 344 }
360 else 345 else
361 { 346 {
362 if (te.DefaultTexture != null) 347 if (te.DefaultTexture == null)
348 m_log.WarnFormat("[Materials]: TextureEntry.DefaultTexture is null in {0} {1}", sop.Name, sop.UUID);
349 else
363 te.DefaultTexture.MaterialID = id; 350 te.DefaultTexture.MaterialID = id;
364 } 351 }
365 352