From 248d56d3ad2f4a452a1e433204d0f72624cac129 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 3 Mar 2020 23:21:05 +0000 Subject: [PATCH] add LSL_Integer osClearObjectAnimations() to remove all animations on a prim, returning the number it had; some clean on sending --- .../ClientStack/Linden/UDP/LLClientView.cs | 21 ------------------- .../Framework/Scenes/SceneObjectPart.cs | 18 ++++++++++++++++ .../Shared/Api/Implementation/OSSL_Api.cs | 5 +++++ .../Shared/Api/Interface/IOSSL_Api.cs | 1 + .../Shared/Api/Runtime/LSL_Constants.cs | 2 +- .../Shared/Api/Runtime/OSSL_Stub.cs | 6 ++++++ 6 files changed, 31 insertions(+), 22 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 43e78c9223..f14ba3e171 100755 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -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(); - 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(); - ObjectAnimationUpdates.Add(sop); - } - eu.Flags &= ~PrimUpdateFlags.Animations; - } - lastpos = zc.Position; lastzc = zc.ZeroCount; diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 96085948fd..7b5b729043 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -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(); + AnimationsNames = new Dictionary(); + } + ScheduleUpdate(PrimUpdateFlags.Animations); + return ret; + } + public int GetAnimations(out UUID[] ids, out int[] seqs) { ids = null; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 6fe9a1040d..e4f7987cca 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -5774,5 +5774,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return Vector3.Zero; return target.StandOffset; } + + public LSL_Integer osClearObjectAnimations() + { + return m_host.ClearObjectAnimations(); + } } } \ No newline at end of file diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 7150f78bdd..e9aeda5f28 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -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(); } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index 806449c928..adb327cdc8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs @@ -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; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index b3ef21fd62..4bae45e392 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -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(); + } + } }