private void RemapWornItems(UUID botID, AvatarAppearance appearance) { // save before Clear calls List <AvatarWearable> wearables = appearance.GetWearables(); List <AvatarAttachment> attachments = appearance.GetAttachments(); appearance.ClearWearables(); appearance.ClearAttachments(); // Remap bot outfit with new item IDs foreach (AvatarWearable w in wearables) { AvatarWearable newWearable = new AvatarWearable(w); // store a reversible back-link to the original inventory item ID. newWearable.ItemID = w.ItemID ^ botID; appearance.SetWearable(newWearable); } foreach (AvatarAttachment a in attachments) { // store a reversible back-link to the original inventory item ID. UUID itemID = a.ItemID ^ botID; appearance.SetAttachment(a.AttachPoint, true, itemID, a.AssetID); } }
internal static PackedAppearance FromAppearance(AvatarAppearance avatarAppearance) { PackedAppearance app = new PackedAppearance { TextureEntry = avatarAppearance.Texture.GetBytes(), VisualParams = avatarAppearance.VisualParams, Wearables = PackedWearable.FromWearables(avatarAppearance.GetWearables()), Serial = avatarAppearance.Serial }; return app; }
internal static PackedAppearance FromAppearance(AvatarAppearance avatarAppearance) { PackedAppearance app = new PackedAppearance { TextureEntry = avatarAppearance.Texture.GetBytes(), VisualParams = avatarAppearance.VisualParams, Wearables = PackedWearable.FromWearables(avatarAppearance.GetWearables()), Serial = avatarAppearance.Serial }; return(app); }