aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/AvatarAppearance.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/AvatarAppearance.cs')
-rw-r--r--OpenSim/Framework/AvatarAppearance.cs39
1 files changed, 27 insertions, 12 deletions
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs
index 4f598b0..3a0b861 100644
--- a/OpenSim/Framework/AvatarAppearance.cs
+++ b/OpenSim/Framework/AvatarAppearance.cs
@@ -240,6 +240,21 @@ namespace OpenSim.Framework
240// } 240// }
241 } 241 }
242 242
243 /// <summary>
244 /// Invalidate all of the baked textures in the appearance, useful
245 /// if you know that none are valid
246 /// </summary>
247 public virtual void ResetBakedTextures()
248 {
249 SetDefaultTexture();
250
251 //for (int i = 0; i < BAKE_INDICES.Length; i++)
252 // {
253 // int idx = BAKE_INDICES[i];
254 // m_texture.FaceTextures[idx].TextureID = UUID.Zero;
255 // }
256 }
257
243 protected virtual void SetDefaultTexture() 258 protected virtual void SetDefaultTexture()
244 { 259 {
245 m_texture = new Primitive.TextureEntry(new UUID(AppearanceManager.DEFAULT_AVATAR_TEXTURE)); 260 m_texture = new Primitive.TextureEntry(new UUID(AppearanceManager.DEFAULT_AVATAR_TEXTURE));
@@ -390,19 +405,18 @@ namespace OpenSim.Framework
390 /// </remarks> 405 /// </remarks>
391 public List<AvatarAttachment> GetAttachments() 406 public List<AvatarAttachment> GetAttachments()
392 { 407 {
393 List<AvatarAttachment> alist = new List<AvatarAttachment>(); 408
394 409
395 lock (m_attachments) 410 lock (m_attachments)
396 { 411 {
412 List<AvatarAttachment> alist = new List<AvatarAttachment>();
397 foreach (KeyValuePair<int, List<AvatarAttachment>> kvp in m_attachments) 413 foreach (KeyValuePair<int, List<AvatarAttachment>> kvp in m_attachments)
398 { 414 {
399 foreach (AvatarAttachment attach in kvp.Value) 415 foreach (AvatarAttachment attach in kvp.Value)
400 alist.Add(new AvatarAttachment(attach)); 416 alist.Add(new AvatarAttachment(attach));
401 } 417 }
402 } 418 return alist;
403 419 } }
404 return alist;
405 }
406 420
407 internal void AppendAttachment(AvatarAttachment attach) 421 internal void AppendAttachment(AvatarAttachment attach)
408 { 422 {
@@ -531,7 +545,6 @@ namespace OpenSim.Framework
531 return kvp.Key; 545 return kvp.Key;
532 } 546 }
533 } 547 }
534
535 return 0; 548 return 0;
536 } 549 }
537 550
@@ -598,12 +611,14 @@ namespace OpenSim.Framework
598 OSDBinary visualparams = new OSDBinary(m_visualparams); 611 OSDBinary visualparams = new OSDBinary(m_visualparams);
599 data["visualparams"] = visualparams; 612 data["visualparams"] = visualparams;
600 613
601 // Attachments 614 lock (m_attachments)
602 List<AvatarAttachment> attachments = GetAttachments(); 615 {
603 OSDArray attachs = new OSDArray(attachments.Count); 616 // Attachments
604 foreach (AvatarAttachment attach in GetAttachments()) 617 OSDArray attachs = new OSDArray(m_attachments.Count);
605 attachs.Add(attach.Pack()); 618 foreach (AvatarAttachment attach in GetAttachments())
606 data["attachments"] = attachs; 619 attachs.Add(attach.Pack());
620 data["attachments"] = attachs;
621 }
607 622
608 return data; 623 return data;
609 } 624 }