AvatarAppearance avatarAppearance = new AvatarAppearance(); // Set properties of the avatar's appearance avatarAppearance.SetHeight(1.8f); avatarAppearance.SetSkinColor(new Color(255, 255, 255)); avatarAppearance.SetHairStyle("Short Bob"); // Attach an object to the avatar avatarAppearance.AttachObject("Sword", new UUID("231a638a-d292-11ea-87d0-0242ac130003"), Vector3.Zero, Vector3.Zero, 1.0f); // Add the appearance to an existing avatar ScenePresence avatar = GetAvatar(); avatar.Appearance = avatarAppearance;
// Get the appearance of an existing avatar ScenePresence avatar = GetAvatar(); AvatarAppearance avatarAppearance = avatar.Appearance; // Get properties of the avatar's appearance float height = avatarAppearance.GetHeight(); Color skinColor = avatarAppearance.GetSkinColor(); string hairStyle = avatarAppearance.GetHairStyle(); // Get all attachments of the avatar DictionaryIn this example, we retrieve the AvatarAppearance object from an existing avatar object, and then retrieve various appearance properties such as height, skin color, and hair style. We also retrieve the list of attachments currently attached to the avatar. Package library: OpenSim.Framework.attachments = avatarAppearance.GetAttachments();