diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index e718aa6c47..8c32734980 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs @@ -312,6 +312,7 @@ namespace OpenSim.Framework public AgentGroupData[] Groups; public Animation[] Anims; public Animation DefaultAnim = null; + public Animation AnimState = null; public UUID GranterID; public UUID ParentPart; @@ -403,6 +404,11 @@ namespace OpenSim.Framework args["default_animation"] = DefaultAnim.PackUpdateMessage(); } + if (AnimState != null) + { + args["animation_state"] = AnimState.PackUpdateMessage(); + } + if (Appearance != null) args["packed_appearance"] = Appearance.Pack(); @@ -612,6 +618,18 @@ namespace OpenSim.Framework } } + if (args["animation_state"] != null) + { + try + { + AnimState = new Animation((OSDMap)args["animation_state"]); + } + catch + { + AnimState = null; + } + } + //if ((args["agent_textures"] != null) && (args["agent_textures"]).Type == OSDType.Array) //{ // OSDArray textures = (OSDArray)(args["agent_textures"]); diff --git a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs index 3d8e8be795..65ae445950 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs @@ -45,6 +45,11 @@ namespace OpenSim.Region.Framework.Scenes.Animation private OpenSim.Framework.Animation m_defaultAnimation = new OpenSim.Framework.Animation(); private List m_animations = new List(); + public OpenSim.Framework.Animation DefaultAnimation + { + get { return m_defaultAnimation; } + } + public OpenSim.Framework.Animation ImplicitDefaultAnimation { get { return m_implicitDefaultAnimation; } @@ -126,6 +131,12 @@ namespace OpenSim.Region.Framework.Scenes.Animation return false; } + // Called from serialization only + public void SetImplicitDefaultAnimation(UUID animID, int sequenceNum, UUID objectID) + { + m_implicitDefaultAnimation = new OpenSim.Framework.Animation(animID, sequenceNum, objectID); + } + protected bool ResetDefaultAnimation() { return TrySetDefaultAnimation("STAND", 1, UUID.Zero); diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 2066536ff7..4282b46c56 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1748,15 +1748,19 @@ namespace OpenSim.Region.Framework.Scenes private void CheckAtTargets() { - List objs = new List(); + List objs = null; + lock (m_groupsWithTargets) { - foreach (SceneObjectGroup grp in m_groupsWithTargets.Values) - objs.Add(grp); + if (m_groupsWithTargets.Count != 0) + objs = new List(m_groupsWithTargets.Values); } - foreach (SceneObjectGroup entry in objs) - entry.checkAtTargets(); + if (objs != null) + { + foreach (SceneObjectGroup entry in objs) + entry.checkAtTargets(); + } } /// diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 285d1ae76c..f9c7935c5f 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3276,7 +3276,8 @@ namespace OpenSim.Region.Framework.Scenes cAgent.Anims = Animator.Animations.ToArray(); } catch { } - cAgent.DefaultAnim = Animator.Animations.ImplicitDefaultAnimation; + cAgent.DefaultAnim = Animator.Animations.DefaultAnimation; + cAgent.AnimState = Animator.Animations.ImplicitDefaultAnimation; if (Scene.AttachmentsModule != null) Scene.AttachmentsModule.CopyAttachments(this, cAgent); @@ -3353,6 +3354,8 @@ namespace OpenSim.Region.Framework.Scenes Animator.Animations.FromArray(cAgent.Anims); if (cAgent.DefaultAnim != null) Animator.Animations.SetDefaultAnimation(cAgent.DefaultAnim.AnimID, cAgent.DefaultAnim.SequenceNum, UUID.Zero); + if (cAgent.AnimState != null) + Animator.Animations.SetImplicitDefaultAnimation(cAgent.AnimState.AnimID, cAgent.AnimState.SequenceNum, UUID.Zero); if (Scene.AttachmentsModule != null) Scene.AttachmentsModule.CopyAttachments(cAgent, this); diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index b5beffca23..a59f63fcdd 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs @@ -3357,7 +3357,7 @@ Console.WriteLine(" JointCreateFixed"); private void MeshAssetReceived(AssetBase asset) { - if (asset.Data != null && asset.Data.Length > 0) + if (asset != null && asset.Data != null && asset.Data.Length > 0) { if (!_pbs.SculptEntry) return; @@ -3370,6 +3370,12 @@ Console.WriteLine(" JointCreateFixed"); m_taintshape = true; _parent_scene.AddPhysicsActorTaint(this); } + else + { + m_log.WarnFormat( + "[ODE PRIM]: Could not get mesh/sculpt asset {0} for {1} at {2} in {3}", + _pbs.SculptTexture, Name, _position, _parent_scene.Name); + } } } } diff --git a/OpenSim/Services/Interfaces/IAssetService.cs b/OpenSim/Services/Interfaces/IAssetService.cs index 80494f177a..3c469c6f43 100644 --- a/OpenSim/Services/Interfaces/IAssetService.cs +++ b/OpenSim/Services/Interfaces/IAssetService.cs @@ -68,7 +68,11 @@ namespace OpenSim.Services.Interfaces /// /// The asset id /// Represents the requester. Passed back via the handler - /// The handler to call back once the asset has been retrieved + /// + /// The handler to call back once the asset has been retrieved. This will be called back with a null AssetBase + /// if the asset could not be found for some reason (e.g. if it does not exist, if a remote asset service + /// was not contactable, if it is not in the database, etc.). + /// /// True if the id was parseable, false otherwise bool Get(string id, Object sender, AssetRetrieved handler);