/// <summary>
 /// Remove the specified animation
 /// </summary>
 /// <param name='animID'></param>
 /// <param name='allowNoDefault'>
 /// If true, then the default animation can be entirely removed.
 /// If false, then removing the default animation will reset it to the simulator default (currently STAND).
 /// </param>
 public bool Remove(UUID animID, bool allowNoDefault)
 {
     lock (m_animations)
     {
         if (m_defaultAnimation.AnimID == animID)
         {
             if (allowNoDefault)
             {
                 m_defaultAnimation = new OpenSim.Framework.Animation(UUID.Zero, 1, UUID.Zero);
             }
             else
             {
                 ResetDefaultAnimation();
             }
         }
         else
         {
             for (int i = 0; i < m_animations.Count; i++)
             {
                 if (m_animations[i].AnimID == animID)
                 {
                     m_animations.RemoveAt(i);
                     return(true);
                 }
             }
         }
     }
     return(false);
 }
Exemplo n.º 2
0
 /// <summary>
 /// The default animation is reserved for "main" animations
 /// that are mutually exclusive, e.g. flying and sitting.
 /// </summary>
 public bool SetDefaultAnimation(UUID animID, int sequenceNum, UUID objectID)
 {
     if (m_defaultAnimation.AnimID != animID)
     {
         m_defaultAnimation = new OpenSim.Framework.Animation(animID, sequenceNum, objectID);
         return(true);
     }
     return(false);
 }
Exemplo n.º 3
0
 public OpenSim.Framework.Animation[] ToArray()
 {
     OpenSim.Framework.Animation[] theArray = new OpenSim.Framework.Animation[m_animations.Count];
     uint i = 0;
     try
     {
         foreach (OpenSim.Framework.Animation anim in m_animations)
             theArray[i++] = anim;
     }
     catch 
     {
         /* S%^t happens. Ignore. */ 
     }
     return theArray;
 }
        public void FromOSDArray(OSDArray pArray)
        {
            this.Clear();

            if (pArray.Count >= 1)
            {
                m_defaultAnimation = new OpenSim.Framework.Animation((OSDMap)pArray[0]);
            }
            if (pArray.Count >= 2)
            {
                m_implicitDefaultAnimation = new OpenSim.Framework.Animation((OSDMap)pArray[1]);
            }
            for (int ii = 2; ii < pArray.Count; ii++)
            {
                m_animations.Add(new OpenSim.Framework.Animation((OSDMap)pArray[ii]));
            }
        }
Exemplo n.º 5
0
 public OpenSim.Framework.Animation[] ToArray()
 {
     OpenSim.Framework.Animation[] theArray = new OpenSim.Framework.Animation[m_animations.Count];
     uint i = 0;
     try
     {
         foreach (OpenSim.Framework.Animation anim in m_animations)
             theArray[i++] = anim;
     }
     catch 
     {
         /* S%^t happens. Ignore. */ 
     }
     return theArray;
 }
Exemplo n.º 6
0
 /// <summary>
 /// The default animation is reserved for "main" animations
 /// that are mutually exclusive, e.g. flying and sitting.
 /// </summary>
 public bool SetDefaultAnimation(UUID animID, int sequenceNum, UUID objectID)
 {
     if (m_defaultAnimation.AnimID != animID)
     {
         m_defaultAnimation = new OpenSim.Framework.Animation(animID, sequenceNum, objectID);
         return true;
     }
     return false;
 }
 // Called from serialization only
 public void SetImplicitDefaultAnimation(UUID animID, int sequenceNum, UUID objectID)
 {
     m_implicitDefaultAnimation = new OpenSim.Framework.Animation(animID, sequenceNum, objectID);
 }
Exemplo n.º 8
0
        public void FromOSDArray(OSDArray pArray)
        {
            this.Clear();

            if (pArray.Count >= 1)
            {
                m_defaultAnimation = new OpenSim.Framework.Animation((OSDMap)pArray[0]);
            }
            if (pArray.Count >= 2)
            {
                m_implicitDefaultAnimation = new OpenSim.Framework.Animation((OSDMap)pArray[1]);
            }
            for (int ii = 2; ii < pArray.Count; ii++)
            {
                m_animations.Add(new OpenSim.Framework.Animation((OSDMap)pArray[ii]));
            }
        }
Exemplo n.º 9
0
 // Called from serialization only
 public void SetImplicitDefaultAnimation(UUID animID, int sequenceNum, UUID objectID)
 {
     m_implicitDefaultAnimation = new OpenSim.Framework.Animation(animID, sequenceNum, objectID);
 }
Exemplo n.º 10
0
 /// <summary>
 /// Remove the specified animation
 /// </summary>
 /// <param name='animID'></param>
 /// <param name='allowNoDefault'>
 /// If true, then the default animation can be entirely removed. 
 /// If false, then removing the default animation will reset it to the simulator default (currently STAND).
 /// </param>
 public bool Remove(UUID animID, bool allowNoDefault)
 {
     lock (m_animations)
     {
         if (m_defaultAnimation.AnimID == animID)
         {
             if (allowNoDefault)
                 m_defaultAnimation = new OpenSim.Framework.Animation(UUID.Zero, 1, UUID.Zero);
             else
                 ResetDefaultAnimation();
         }
         else if (HasAnimation(animID))
         {
             for (int i = 0; i < m_animations.Count; i++)
             {
                 if (m_animations[i].AnimID == animID)
                 {
                     m_animations.RemoveAt(i);
                     return true;
                 }
             }
         }
     }
     return false;
 }