mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 09:45:47 +08:00
First attempt to get multiple attachments working to support viewer2.
The attachment code appears to work correctly for 1.23 viewers so, in spite of some big changes in the internal representation, there don't appear to be regressions. That being said, I still can't get a viewer2 avatar to show correctly.
This commit is contained in:
@@ -1614,12 +1614,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
}
|
||||
|
||||
// Attachments
|
||||
Dictionary<int, AvatarAttachment> attachments = avatarAppearance.Attachments;
|
||||
List<AvatarAttachment> attachments = avatarAppearance.GetAttachments();
|
||||
|
||||
foreach (KeyValuePair<int, AvatarAttachment> attachment in attachments)
|
||||
foreach (AvatarAttachment attachment in attachments)
|
||||
{
|
||||
int attachpoint = attachment.Value.AttachPoint;
|
||||
UUID itemID = attachment.Value.ItemID;
|
||||
int attachpoint = attachment.AttachPoint;
|
||||
UUID itemID = attachment.ItemID;
|
||||
|
||||
if (itemID != UUID.Zero)
|
||||
{
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
@@ -765,25 +766,19 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||
FormatPart(rdata, "UnderShirt", rdata.userAppearance.UnderShirtItem, rdata.userAppearance.UnderShirtAsset);
|
||||
FormatPart(rdata, "UnderPants", rdata.userAppearance.UnderPantsItem, rdata.userAppearance.UnderPantsAsset);
|
||||
|
||||
Hashtable attachments = rdata.userAppearance.GetAttachments();
|
||||
Rest.Log.DebugFormat("{0} FormatUserAppearance: Formatting attachments", MsgId);
|
||||
|
||||
if (attachments != null)
|
||||
rdata.writer.WriteStartElement("Attachments");
|
||||
List<AvatarAttachment> attachments = rdata.userAppearance.GetAttachments();
|
||||
foreach (AvatarAttachment attach in attachments)
|
||||
{
|
||||
|
||||
Rest.Log.DebugFormat("{0} FormatUserAppearance: Formatting attachments", MsgId);
|
||||
|
||||
rdata.writer.WriteStartElement("Attachments");
|
||||
for (int i = 0; i < attachments.Count; i++)
|
||||
{
|
||||
Hashtable attachment = attachments[i] as Hashtable;
|
||||
rdata.writer.WriteStartElement("Attachment");
|
||||
rdata.writer.WriteAttributeString("AtPoint", i.ToString());
|
||||
rdata.writer.WriteAttributeString("Item", (string) attachment["item"]);
|
||||
rdata.writer.WriteAttributeString("Asset", (string) attachment["asset"]);
|
||||
rdata.writer.WriteEndElement();
|
||||
}
|
||||
rdata.writer.WriteStartElement("Attachment");
|
||||
rdata.writer.WriteAttributeString("AtPoint", attach.AttachPoint.ToString());
|
||||
rdata.writer.WriteAttributeString("Item", attach.ItemID.ToString());
|
||||
rdata.writer.WriteAttributeString("Asset", attach.AssetID.ToString());
|
||||
rdata.writer.WriteEndElement();
|
||||
}
|
||||
rdata.writer.WriteEndElement();
|
||||
|
||||
Primitive.TextureEntry texture = rdata.userAppearance.Texture;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user