public OSDMap Pack()
{
OSDMap data = new OSDMap();
data["serial"] = OSD.FromInteger(m_serial);
data["height"] = OSD.FromReal(m_avatarHeight);
data["hipoffset"] = OSD.FromReal(m_hipOffset);
// Wearables
OSDArray wears = new OSDArray(AvatarWearable.MAX_WEARABLES);
for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
wears.Add(m_wearables[i].Pack());
data["wearables"] = wears;
// Avatar Textures
OSDArray textures = new OSDArray(AvatarAppearance.TEXTURE_COUNT);
for (uint i = 0; i < AvatarAppearance.TEXTURE_COUNT; i++)
{
if (m_texture.FaceTextures[i] != null)
textures.Add(OSD.FromUUID(m_texture.FaceTextures[i].TextureID));
else
textures.Add(OSD.FromUUID(AppearanceManager.DEFAULT_AVATAR_TEXTURE));
}
data["textures"] = textures;
// Visual Parameters
OSDBinary visualparams = new OSDBinary(m_visualparams);
data["visualparams"] = visualparams;
// Attachments
OSDArray attachs = new OSDArray(m_attachments.Count);
foreach (AvatarAttachment attach in GetAttachments())
attachs.Add(attach.Pack());
data["attachments"] = attachs;
return data;
}