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 6c2a954..f0580df 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));
@@ -383,19 +398,18 @@ namespace OpenSim.Framework
383 /// </remarks> 398 /// </remarks>
384 public List<AvatarAttachment> GetAttachments() 399 public List<AvatarAttachment> GetAttachments()
385 { 400 {
386 List<AvatarAttachment> alist = new List<AvatarAttachment>(); 401
387 402
388 lock (m_attachments) 403 lock (m_attachments)
389 { 404 {
405 List<AvatarAttachment> alist = new List<AvatarAttachment>();
390 foreach (KeyValuePair<int, List<AvatarAttachment>> kvp in m_attachments) 406 foreach (KeyValuePair<int, List<AvatarAttachment>> kvp in m_attachments)
391 { 407 {
392 foreach (AvatarAttachment attach in kvp.Value) 408 foreach (AvatarAttachment attach in kvp.Value)
393 alist.Add(new AvatarAttachment(attach)); 409 alist.Add(new AvatarAttachment(attach));
394 } 410 }
395 } 411 return alist;
396 412 } }
397 return alist;
398 }
399 413
400 internal void AppendAttachment(AvatarAttachment attach) 414 internal void AppendAttachment(AvatarAttachment attach)
401 { 415 {
@@ -524,7 +538,6 @@ namespace OpenSim.Framework
524 return kvp.Key; 538 return kvp.Key;
525 } 539 }
526 } 540 }
527
528 return 0; 541 return 0;
529 } 542 }
530 543
@@ -591,12 +604,14 @@ namespace OpenSim.Framework
591 OSDBinary visualparams = new OSDBinary(m_visualparams); 604 OSDBinary visualparams = new OSDBinary(m_visualparams);
592 data["visualparams"] = visualparams; 605 data["visualparams"] = visualparams;
593 606
594 // Attachments 607 lock (m_attachments)
595 List<AvatarAttachment> attachments = GetAttachments(); 608 {
596 OSDArray attachs = new OSDArray(attachments.Count); 609 // Attachments
597 foreach (AvatarAttachment attach in GetAttachments()) 610 OSDArray attachs = new OSDArray(m_attachments.Count);
598 attachs.Add(attach.Pack()); 611 foreach (AvatarAttachment attach in GetAttachments())
599 data["attachments"] = attachs; 612 attachs.Add(attach.Pack());
613 data["attachments"] = attachs;
614 }
600 615
601 return data; 616 return data;
602 } 617 }