OpenSim.Framework.AvatarAppearance.GetAttachments C# (CSharp) Method

GetAttachments() public method

Get a list of the attachments, note that there may be duplicate attachpoints
public GetAttachments ( ) : List
return List
        public List<AvatarAttachment> GetAttachments()
        {
            List<AvatarAttachment> alist = new List<AvatarAttachment>();
            foreach (KeyValuePair<int, List<AvatarAttachment>> kvp in m_attachments)
            {
                foreach (AvatarAttachment attach in kvp.Value)
                    alist.Add(new AvatarAttachment(attach));
            }

            return alist;
        }

Usage Example

        public AvatarAppearance(AvatarAppearance appearance, bool copyWearables)
        {
            //            m_log.WarnFormat("[AVATAR APPEARANCE] create from an existing appearance");

            if (appearance == null)
            {
                m_serial = 1;
                m_owner = UUID.Zero;

                SetDefaultWearables();
                SetDefaultTexture();
                SetDefaultParams();
                SetHeight();

                m_attachments = new Dictionary<int, List<AvatarAttachment>>();

                return;
            }

            m_serial = appearance.Serial;
            m_owner = appearance.Owner;

            m_wearables = new AvatarWearable[AvatarWearable.MAX_WEARABLES];
            for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
                m_wearables[i] = new AvatarWearable();
            if (copyWearables && (appearance.Wearables != null))
            {
                for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
                    SetWearable(i, appearance.Wearables[i]);
            }

            m_texture = null;
            if (appearance.Texture != null)
            {
                byte[] tbytes = appearance.Texture.GetBytes();
                m_texture = new Primitive.TextureEntry(tbytes, 0, tbytes.Length);
            }

            m_visualparams = null;
            if (appearance.VisualParams != null)
                m_visualparams = (byte[])appearance.VisualParams.Clone();

            // Copy the attachment, force append mode since that ensures consistency
            m_attachments = new Dictionary<int, List<AvatarAttachment>>();
            foreach (AvatarAttachment attachment in appearance.GetAttachments())
                AppendAttachment(new AvatarAttachment(attachment));
        }
All Usage Examples Of OpenSim.Framework.AvatarAppearance::GetAttachments