From 217b2d93ae77925e9ebbb0ef3e9b44d47e4234db Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 11 Apr 2009 16:51:27 +0000 Subject: Adding a script event, changed(CHANGED_ANIMATION) This is sent to all root prims of all attachments of an avatar when the animation state changes. llGetAnimation() can thenbe used to find the new movement animation. This eliminates the need for fast timers in AOs --- .../Region/Framework/Interfaces/IScriptModule.cs | 1 + OpenSim/Region/Framework/Scenes/ScenePresence.cs | 23 +++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs index 7d7f904..51dcb7d 100644 --- a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs @@ -38,5 +38,6 @@ namespace OpenSim.Region.Framework.Interfaces string GetXMLState(UUID itemID); bool PostScriptEvent(UUID itemID, string name, Object[] args); + bool PostObjectEvent(UUID itemID, string name, Object[] args); } } diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 2c316a6..d06c583 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -223,6 +223,8 @@ namespace OpenSim.Region.Framework.Scenes string m_callbackURI; ulong m_rootRegionHandle; + private IScriptModule[] m_scriptEngines; + #region Properties /// @@ -585,6 +587,8 @@ namespace OpenSim.Region.Framework.Scenes if (gm != null) m_grouptitle = gm.GetGroupTitle(m_uuid); + m_scriptEngines = m_scene.RequestModuleInterfaces(); + AbsolutePosition = m_controllingClient.StartPos; AdjustKnownSeeds(); @@ -1943,7 +1947,24 @@ namespace OpenSim.Region.Framework.Scenes if (m_animations.TrySetDefaultAnimation(anim, m_controllingClient.NextAnimationSequenceNumber, UUID.Zero)) { - SendAnimPack(); + if (m_scriptEngines != null) + { + lock (m_attachments) + { + foreach (SceneObjectGroup grp in m_attachments) + { + // 16384 is CHANGED_ANIMATION + // + // Send this to all attachment root prims + // + foreach (IScriptModule m in m_scriptEngines) + { + m.PostObjectEvent(grp.RootPart.UUID, "changed", new Object[] {16384}); + } + SendAnimPack(); + } + } + } } } -- cgit v1.1