add LSL_Integer osClearObjectAnimations() to remove all animations on a prim, returning the number it had; some clean on sending

master
UbitUmarov 2020-03-03 23:21:05 +00:00
parent 6684c35bb0
commit 248d56d3ad
6 changed files with 31 additions and 22 deletions

View File

@ -5170,16 +5170,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
SceneObjectPart part = (SceneObjectPart)eu.Entity;
shouldCreateSelected = part.CreateSelected;
if (eu.Flags.HasFlag(PrimUpdateFlags.Animations))
{
if (m_SupportObjectAnimations && part.Animations != null)
{
if (ObjectAnimationUpdates == null)
ObjectAnimationUpdates = new List<SceneObjectPart>();
ObjectAnimationUpdates.Add(part);
}
eu.Flags &= ~PrimUpdateFlags.Animations;
}
CreatePrimUpdateBlock(part, mysp, zc);
}
if (zc.Position < LLUDPServer.MAXPAYLOAD - 300)
@ -5336,17 +5326,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
shouldCreateSelected = sop.CreateSelected;
if (eu.Flags.HasFlag(PrimUpdateFlags.Animations))
{
if (m_SupportObjectAnimations && sop.Animations != null)
{
if (ObjectAnimationUpdates == null)
ObjectAnimationUpdates = new List<SceneObjectPart>();
ObjectAnimationUpdates.Add(sop);
}
eu.Flags &= ~PrimUpdateFlags.Animations;
}
lastpos = zc.Position;
lastzc = zc.ZeroCount;

View File

@ -5688,6 +5688,24 @@ namespace OpenSim.Region.Framework.Scenes
return false;
}
public int ClearObjectAnimations()
{
int ret = 0;
if(Animations != null)
{
ret = Animations.Count;
Animations.Clear();
AnimationsNames.Clear();
}
else
{
Animations = new Dictionary<UUID, int>();
AnimationsNames = new Dictionary<UUID, string>();
}
ScheduleUpdate(PrimUpdateFlags.Animations);
return ret;
}
public int GetAnimations(out UUID[] ids, out int[] seqs)
{
ids = null;

View File

@ -5774,5 +5774,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return Vector3.Zero;
return target.StandOffset;
}
public LSL_Integer osClearObjectAnimations()
{
return m_host.ClearObjectAnimations();
}
}
}

View File

@ -568,5 +568,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
void osSetLinkStandTarget(LSL_Integer linkNumber, vector v);
vector osGetStandTarget();
vector osGetLinkStandTarget(LSL_Integer linkNumber);
LSL_Integer osClearObjectAnimations();
}
}

View File

@ -35,7 +35,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public partial class ScriptBaseClass
{
// SCRIPTS CONSTANTS
public static readonly LSLInteger OS_APIVERSION = 11;
public static readonly LSLInteger OS_APIVERSION = 12;
public static readonly LSLInteger TRUE = 1;
public static readonly LSLInteger FALSE = 0;

View File

@ -1461,5 +1461,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
{
return m_OSSL_Functions.osGetLinkStandTarget(linkNumber);
}
public LSL_Integer osClearObjectAnimations()
{
return m_OSSL_Functions.osClearObjectAnimations();
}
}
}