diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/OptionalModules/Materials/MaterialsModule.cs | 23 |
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 | ||