diff options
7 files changed, 137 insertions, 68 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs index 04d11cb..bc3798d 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs | |||
@@ -356,7 +356,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
356 | rootGroup.LinkToGroup(allparts[j]); | 356 | rootGroup.LinkToGroup(allparts[j]); |
357 | } | 357 | } |
358 | 358 | ||
359 | rootGroup.ScheduleGroupForFullUpdate(); | 359 | rootGroup.ScheduleGroupForFullAnimUpdate(); |
360 | pos | 360 | pos |
361 | = m_scene.GetNewRezLocation( | 361 | = m_scene.GetNewRezLocation( |
362 | Vector3.Zero, rootpos, UUID.Zero, rot, (byte)1, 1, true, allparts[0].GroupScale, false); | 362 | Vector3.Zero, rootpos, UUID.Zero, rot, (byte)1, 1, true, allparts[0].GroupScale, false); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index d1a52cb..d36d770 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -1096,7 +1096,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
1096 | // will succeed, as that will not update if an attachment is selected. | 1096 | // will succeed, as that will not update if an attachment is selected. |
1097 | so.IsSelected = false; // fudge.... | 1097 | so.IsSelected = false; // fudge.... |
1098 | 1098 | ||
1099 | so.ScheduleGroupForFullUpdate(); | 1099 | so.ScheduleGroupForFullAnimUpdate(); |
1100 | } | 1100 | } |
1101 | 1101 | ||
1102 | // In case it is later dropped again, don't let | 1102 | // In case it is later dropped again, don't let |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index c32e01b..79ad0e0 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2537,7 +2537,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2537 | sceneObject.RootPart.CreatorIdentification = UserManagementModule.GetUserUUI(ownerID); | 2537 | sceneObject.RootPart.CreatorIdentification = UserManagementModule.GetUserUUI(ownerID); |
2538 | 2538 | ||
2539 | sceneObject.InvalidateDeepEffectivePerms();; | 2539 | sceneObject.InvalidateDeepEffectivePerms();; |
2540 | sceneObject.ScheduleGroupForFullUpdate(); | 2540 | sceneObject.ScheduleGroupForFullAnimUpdate(); |
2541 | 2541 | ||
2542 | return sceneObject; | 2542 | return sceneObject; |
2543 | } | 2543 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 6ba9d7a..6d9844e 100755 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -485,7 +485,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
485 | } | 485 | } |
486 | 486 | ||
487 | if (sendClientUpdates) | 487 | if (sendClientUpdates) |
488 | sceneObject.ScheduleGroupForFullUpdate(); | 488 | sceneObject.ScheduleGroupForFullAnimUpdate(); |
489 | 489 | ||
490 | if (attachToBackup) | 490 | if (attachToBackup) |
491 | sceneObject.AttachToBackup(); | 491 | sceneObject.AttachToBackup(); |
@@ -1825,7 +1825,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1825 | 1825 | ||
1826 | try | 1826 | try |
1827 | { | 1827 | { |
1828 | |||
1829 | List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>(); | 1828 | List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>(); |
1830 | 1829 | ||
1831 | // We do this in reverse to get the link order of the prims correct | 1830 | // We do this in reverse to get the link order of the prims correct |
@@ -1870,8 +1869,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1870 | { | 1869 | { |
1871 | parentGroup.RootPart.CreateSelected = true; | 1870 | parentGroup.RootPart.CreateSelected = true; |
1872 | parentGroup.TriggerScriptChangedEvent(Changed.LINK); | 1871 | parentGroup.TriggerScriptChangedEvent(Changed.LINK); |
1873 | parentGroup.HasGroupChanged = true; | ||
1874 | parentGroup.ScheduleGroupForFullUpdate(); | ||
1875 | } | 1872 | } |
1876 | } | 1873 | } |
1877 | finally | 1874 | finally |
@@ -1886,7 +1883,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1886 | parentGroup.AdjustChildPrimPermissions(false); | 1883 | parentGroup.AdjustChildPrimPermissions(false); |
1887 | parentGroup.HasGroupChanged = true; | 1884 | parentGroup.HasGroupChanged = true; |
1888 | parentGroup.ProcessBackup(m_parentScene.SimulationDataService, true); | 1885 | parentGroup.ProcessBackup(m_parentScene.SimulationDataService, true); |
1889 | parentGroup.ScheduleGroupForFullUpdate(); | 1886 | parentGroup.ScheduleGroupForFullAnimUpdate(); |
1890 | Monitor.Exit(m_updateLock); | 1887 | Monitor.Exit(m_updateLock); |
1891 | } | 1888 | } |
1892 | } | 1889 | } |
@@ -1949,7 +1946,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1949 | child.ParentGroup.DelinkFromGroup(child, true); | 1946 | child.ParentGroup.DelinkFromGroup(child, true); |
1950 | //child.ParentGroup is now other | 1947 | //child.ParentGroup is now other |
1951 | child.ParentGroup.HasGroupChanged = true; | 1948 | child.ParentGroup.HasGroupChanged = true; |
1952 | child.ParentGroup.ScheduleGroupForFullUpdate(); | 1949 | child.ParentGroup.ScheduleGroupForFullAnimUpdate(); |
1953 | } | 1950 | } |
1954 | } | 1951 | } |
1955 | 1952 | ||
@@ -1991,7 +1988,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1991 | newRoot.TriggerScriptChangedEvent(Changed.LINK); | 1988 | newRoot.TriggerScriptChangedEvent(Changed.LINK); |
1992 | newRoot.ParentGroup.HasGroupChanged = true; | 1989 | newRoot.ParentGroup.HasGroupChanged = true; |
1993 | newRoot.ParentGroup.InvalidatePartsLinkMaps(); | 1990 | newRoot.ParentGroup.InvalidatePartsLinkMaps(); |
1994 | newRoot.ParentGroup.ScheduleGroupForFullUpdate(); | 1991 | newRoot.ParentGroup.ScheduleGroupForFullAnimUpdate(); |
1995 | } | 1992 | } |
1996 | } | 1993 | } |
1997 | 1994 | ||
@@ -2131,7 +2128,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2131 | copy.ResumeScripts(); | 2128 | copy.ResumeScripts(); |
2132 | 2129 | ||
2133 | copy.HasGroupChanged = true; | 2130 | copy.HasGroupChanged = true; |
2134 | copy.ScheduleGroupForFullUpdate(); | 2131 | copy.ScheduleGroupForFullAnimUpdate(); |
2135 | return copy; | 2132 | return copy; |
2136 | } | 2133 | } |
2137 | } | 2134 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 080faeb..8274136 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -950,7 +950,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
950 | 950 | ||
951 | sog.inTransit = false; | 951 | sog.inTransit = false; |
952 | AttachToBackup(); | 952 | AttachToBackup(); |
953 | sog.ScheduleGroupForFullUpdate(); | 953 | sog.ScheduleGroupForFullAnimUpdate(); |
954 | } | 954 | } |
955 | } | 955 | } |
956 | 956 | ||
@@ -2668,7 +2668,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2668 | dupe.HasGroupChanged = true; | 2668 | dupe.HasGroupChanged = true; |
2669 | dupe.AttachToBackup(); | 2669 | dupe.AttachToBackup(); |
2670 | 2670 | ||
2671 | dupe.ScheduleGroupForFullUpdate(); | 2671 | dupe.ScheduleGroupForFullAnimUpdate(); |
2672 | } | 2672 | } |
2673 | 2673 | ||
2674 | dupe.InvalidatePartsLinkMaps(); | 2674 | dupe.InvalidatePartsLinkMaps(); |
@@ -3028,10 +3028,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
3028 | /// </remarks> | 3028 | /// </remarks> |
3029 | public void ScheduleGroupForFullUpdate() | 3029 | public void ScheduleGroupForFullUpdate() |
3030 | { | 3030 | { |
3031 | // if (IsAttachment) | 3031 | // if (IsAttachment) |
3032 | // m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, LocalId); | 3032 | // m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, LocalId); |
3033 | |||
3034 | checkAtTargets(); | 3033 | checkAtTargets(); |
3034 | if (Scene.GetNumberOfClients() == 0) | ||
3035 | return; | ||
3036 | |||
3035 | RootPart.ScheduleFullUpdate(); | 3037 | RootPart.ScheduleFullUpdate(); |
3036 | 3038 | ||
3037 | SceneObjectPart[] parts = m_parts.GetArray(); | 3039 | SceneObjectPart[] parts = m_parts.GetArray(); |
@@ -3043,54 +3045,58 @@ namespace OpenSim.Region.Framework.Scenes | |||
3043 | } | 3045 | } |
3044 | } | 3046 | } |
3045 | 3047 | ||
3046 | /// <summary> | 3048 | public void ScheduleGroupForFullAnimUpdate() |
3047 | /// Schedule a terse update for this scene object to all interested viewers. | ||
3048 | /// </summary> | ||
3049 | /// <remarks> | ||
3050 | /// Ultimately, this should be managed such that region modules can invoke it at the end of a set of operations | ||
3051 | /// so that either all changes are sent at once. However, currently, a large amount of internal | ||
3052 | /// code will set this anyway when some object properties are changed. | ||
3053 | /// </remarks> | ||
3054 | public void ScheduleGroupForTerseUpdate() | ||
3055 | { | 3049 | { |
3056 | // m_log.DebugFormat("[SOG]: Scheduling terse update for {0} {1}", Name, UUID); | 3050 | // if (IsAttachment) |
3057 | 3051 | // m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, LocalId); | |
3058 | SceneObjectPart[] parts = m_parts.GetArray(); | 3052 | checkAtTargets(); |
3059 | for (int i = 0; i < parts.Length; i++) | ||
3060 | parts[i].ScheduleTerseUpdate(); | ||
3061 | } | ||
3062 | 3053 | ||
3063 | /// <summary> | 3054 | if (Scene.GetNumberOfClients() == 0) |
3064 | /// Immediately send a full update for this scene object. | ||
3065 | /// </summary> | ||
3066 | public void SendGroupFullUpdate() | ||
3067 | { | ||
3068 | if (IsDeleted) | ||
3069 | return; | 3055 | return; |
3070 | 3056 | ||
3071 | // m_log.DebugFormat("[SOG]: Sending immediate full group update for {0} {1}", Name, UUID); | 3057 | SceneObjectPart[] parts = m_parts.GetArray(); |
3072 | 3058 | ||
3073 | if (IsAttachment) | 3059 | if (!RootPart.Shape.MeshFlagEntry) |
3074 | { | 3060 | { |
3075 | ScenePresence sp = m_scene.GetScenePresence(AttachedAvatar); | 3061 | RootPart.ScheduleFullUpdate(); |
3076 | if (sp != null) | 3062 | |
3063 | for (int i = 0; i < parts.Length; i++) | ||
3077 | { | 3064 | { |
3078 | sp.SendAttachmentUpdate(this, PrimUpdateFlags.FullUpdate); | 3065 | SceneObjectPart part = parts[i]; |
3079 | return; | 3066 | if (part != RootPart) |
3067 | part.ScheduleFullUpdate(); | ||
3080 | } | 3068 | } |
3069 | return; | ||
3081 | } | 3070 | } |
3082 | 3071 | ||
3083 | RootPart.SendFullUpdateToAllClientsNoAttachment(); | 3072 | RootPart.ScheduleFullAnimUpdate(); |
3084 | SceneObjectPart[] parts = m_parts.GetArray(); | 3073 | |
3085 | for (int i = 0; i < parts.Length; i++) | 3074 | for (int i = 0; i < parts.Length; i++) |
3086 | { | 3075 | { |
3087 | SceneObjectPart part = parts[i]; | 3076 | SceneObjectPart part = parts[i]; |
3088 | if (part != RootPart) | 3077 | if (part != RootPart) |
3089 | part.SendFullUpdateToAllClientsNoAttachment(); | 3078 | part.ScheduleFullAnimUpdate(); |
3090 | } | 3079 | } |
3091 | } | 3080 | } |
3092 | 3081 | ||
3093 | /// <summary> | 3082 | /// <summary> |
3083 | /// Schedule a terse update for this scene object to all interested viewers. | ||
3084 | /// </summary> | ||
3085 | /// <remarks> | ||
3086 | /// Ultimately, this should be managed such that region modules can invoke it at the end of a set of operations | ||
3087 | /// so that either all changes are sent at once. However, currently, a large amount of internal | ||
3088 | /// code will set this anyway when some object properties are changed. | ||
3089 | /// </remarks> | ||
3090 | public void ScheduleGroupForTerseUpdate() | ||
3091 | { | ||
3092 | // m_log.DebugFormat("[SOG]: Scheduling terse update for {0} {1}", Name, UUID); | ||
3093 | |||
3094 | SceneObjectPart[] parts = m_parts.GetArray(); | ||
3095 | for (int i = 0; i < parts.Length; i++) | ||
3096 | parts[i].ScheduleTerseUpdate(); | ||
3097 | } | ||
3098 | |||
3099 | /// <summary> | ||
3094 | /// Immediately send an update for this scene object's root prim only. | 3100 | /// Immediately send an update for this scene object's root prim only. |
3095 | /// This is for updates regarding the object as a whole, and none of its parts in particular. | 3101 | /// This is for updates regarding the object as a whole, and none of its parts in particular. |
3096 | /// Note: this may not be used by opensim (it probably should) but it's used by | 3102 | /// Note: this may not be used by opensim (it probably should) but it's used by |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 651884f..4ab0f15 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -3297,6 +3297,26 @@ namespace OpenSim.Region.Framework.Scenes | |||
3297 | ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this, true); | 3297 | ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this, true); |
3298 | } | 3298 | } |
3299 | 3299 | ||
3300 | public void ScheduleFullAnimUpdate() | ||
3301 | { | ||
3302 | if (ParentGroup == null || ParentGroup.IsDeleted || ParentGroup.Scene == null) | ||
3303 | return; | ||
3304 | |||
3305 | if (ParentGroup.Scene.GetNumberOfClients() == 0) | ||
3306 | return; | ||
3307 | |||
3308 | PrimUpdateFlags update = PrimUpdateFlags.FullUpdatewithAnim; | ||
3309 | if (Animations == null || !ParentGroup.RootPart.Shape.MeshFlagEntry) | ||
3310 | update = PrimUpdateFlags.FullUpdate; | ||
3311 | |||
3312 | ParentGroup.QueueForUpdateCheck(); // just in case | ||
3313 | |||
3314 | lock (UpdateFlagLock) | ||
3315 | UpdateFlag |= update; | ||
3316 | |||
3317 | ParentGroup.Scene.EventManager.TriggerSceneObjectPartUpdated(this, true); | ||
3318 | } | ||
3319 | |||
3300 | /// <summary> | 3320 | /// <summary> |
3301 | /// Schedule a terse update for this prim. Terse updates only send position, | 3321 | /// Schedule a terse update for this prim. Terse updates only send position, |
3302 | /// rotation, velocity and rotational velocity information. | 3322 | /// rotation, velocity and rotational velocity information. |
@@ -3334,6 +3354,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
3334 | if (ParentGroup == null || ParentGroup.IsDeleted || ParentGroup.Scene == null) | 3354 | if (ParentGroup == null || ParentGroup.IsDeleted || ParentGroup.Scene == null) |
3335 | return; | 3355 | return; |
3336 | 3356 | ||
3357 | if (Animations == null) | ||
3358 | update &= ~PrimUpdateFlags.Animations; | ||
3359 | if (update == PrimUpdateFlags.None) | ||
3360 | return; | ||
3361 | |||
3337 | ParentGroup.HasGroupChanged = true; | 3362 | ParentGroup.HasGroupChanged = true; |
3338 | 3363 | ||
3339 | if (ParentGroup.Scene.GetNumberOfClients() == 0) | 3364 | if (ParentGroup.Scene.GetNumberOfClients() == 0) |
@@ -4571,7 +4596,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4571 | if (ParentGroup != null) | 4596 | if (ParentGroup != null) |
4572 | { | 4597 | { |
4573 | ParentGroup.HasGroupChanged = true; | 4598 | ParentGroup.HasGroupChanged = true; |
4574 | ScheduleFullUpdate(); | 4599 | ScheduleFullAnimUpdate(); |
4575 | } | 4600 | } |
4576 | } | 4601 | } |
4577 | 4602 | ||
@@ -5367,16 +5392,23 @@ namespace OpenSim.Region.Framework.Scenes | |||
5367 | 5392 | ||
5368 | #endregion Public Methods | 5393 | #endregion Public Methods |
5369 | 5394 | ||
5370 | public void SendUpdateToClient(IClientAPI remoteClient, PrimUpdateFlags PrimUpdateFlags) | 5395 | public void SendUpdateToClient(IClientAPI remoteClient, PrimUpdateFlags update) |
5371 | { | 5396 | { |
5372 | if (ParentGroup.IsDeleted) | 5397 | if (ParentGroup.IsDeleted) |
5373 | return; | 5398 | return; |
5374 | 5399 | ||
5400 | if (Animations == null) | ||
5401 | { | ||
5402 | update &= ~PrimUpdateFlags.Animations; | ||
5403 | if (update == PrimUpdateFlags.None) | ||
5404 | return; | ||
5405 | } | ||
5406 | |||
5375 | if (ParentGroup.IsAttachment && | 5407 | if (ParentGroup.IsAttachment && |
5376 | (ParentGroup.RootPart != this || ParentGroup.AttachedAvatar != remoteClient.AgentId && ParentGroup.HasPrivateAttachmentPoint)) | 5408 | (ParentGroup.RootPart != this || ParentGroup.AttachedAvatar != remoteClient.AgentId && ParentGroup.HasPrivateAttachmentPoint)) |
5377 | return; | 5409 | return; |
5378 | 5410 | ||
5379 | remoteClient.SendEntityUpdate(this, PrimUpdateFlags); | 5411 | remoteClient.SendEntityUpdate(this, update); |
5380 | 5412 | ||
5381 | ParentGroup.Scene.StatsReporter.AddObjectUpdates(1); | 5413 | ParentGroup.Scene.StatsReporter.AddObjectUpdates(1); |
5382 | } | 5414 | } |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 5bd1cf1..2b6c5e6 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -5364,7 +5364,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5364 | 5364 | ||
5365 | return validated; | 5365 | return validated; |
5366 | } | 5366 | } |
5367 | 5367 | /* | |
5368 | public void SendAttachmentsToAllAgents() | 5368 | public void SendAttachmentsToAllAgents() |
5369 | { | 5369 | { |
5370 | lock (m_attachments) | 5370 | lock (m_attachments) |
@@ -5385,7 +5385,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5385 | } | 5385 | } |
5386 | } | 5386 | } |
5387 | } | 5387 | } |
5388 | 5388 | */ | |
5389 | // send attachments to a client without filters except for huds | 5389 | // send attachments to a client without filters except for huds |
5390 | // for now they are checked in several places down the line... | 5390 | // for now they are checked in several places down the line... |
5391 | public void SendAttachmentsToAgentNF(ScenePresence p) | 5391 | public void SendAttachmentsToAgentNF(ScenePresence p) |
@@ -5429,14 +5429,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
5429 | if (IsChildAgent || IsInTransit) | 5429 | if (IsChildAgent || IsInTransit) |
5430 | return; | 5430 | return; |
5431 | 5431 | ||
5432 | |||
5432 | SceneObjectPart[] origparts = sog.Parts; | 5433 | SceneObjectPart[] origparts = sog.Parts; |
5433 | SceneObjectPart[] parts = new SceneObjectPart[origparts.Length]; | 5434 | SceneObjectPart[] parts = new SceneObjectPart[origparts.Length]; |
5434 | PrimUpdateFlags[] flags = new PrimUpdateFlags[origparts.Length]; | 5435 | PrimUpdateFlags[] flags = new PrimUpdateFlags[origparts.Length]; |
5435 | 5436 | ||
5436 | SceneObjectPart rootpart = sog.RootPart; | 5437 | SceneObjectPart rootpart = sog.RootPart; |
5437 | PrimUpdateFlags cur = sog.RootPart.GetAndClearUpdateFlag(); | 5438 | PrimUpdateFlags cur = sog.RootPart.GetAndClearUpdateFlag(); |
5439 | bool noanim = !rootpart.Shape.MeshFlagEntry; | ||
5438 | 5440 | ||
5439 | int nparts = 0; | 5441 | int nparts = 0; |
5442 | if (noanim || rootpart.Animations == null) | ||
5443 | cur &= ~PrimUpdateFlags.Animations; | ||
5440 | if (cur != PrimUpdateFlags.None) | 5444 | if (cur != PrimUpdateFlags.None) |
5441 | { | 5445 | { |
5442 | flags[nparts] = cur; | 5446 | flags[nparts] = cur; |
@@ -5450,7 +5454,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
5450 | continue; | 5454 | continue; |
5451 | 5455 | ||
5452 | cur = origparts[i].GetAndClearUpdateFlag(); | 5456 | cur = origparts[i].GetAndClearUpdateFlag(); |
5453 | if(cur == PrimUpdateFlags.None) | 5457 | if (noanim || origparts[i].Animations == null) |
5458 | cur &= ~PrimUpdateFlags.Animations; | ||
5459 | if (cur == PrimUpdateFlags.None) | ||
5454 | continue; | 5460 | continue; |
5455 | flags[nparts] = cur; | 5461 | flags[nparts] = cur; |
5456 | parts[nparts] = origparts[i]; | 5462 | parts[nparts] = origparts[i]; |
@@ -5485,19 +5491,45 @@ namespace OpenSim.Region.Framework.Scenes | |||
5485 | if (IsChildAgent || IsInTransit) | 5491 | if (IsChildAgent || IsInTransit) |
5486 | return; | 5492 | return; |
5487 | 5493 | ||
5488 | SceneObjectPart[] parts = sog.Parts; | 5494 | SceneObjectPart[] origparts = sog.Parts; |
5495 | SceneObjectPart[] parts = new SceneObjectPart[origparts.Length]; | ||
5496 | PrimUpdateFlags[] flags = new PrimUpdateFlags[origparts.Length]; | ||
5497 | |||
5489 | SceneObjectPart rootpart = sog.RootPart; | 5498 | SceneObjectPart rootpart = sog.RootPart; |
5499 | bool noanim = !rootpart.Shape.MeshFlagEntry; | ||
5490 | 5500 | ||
5491 | ControllingClient.SendEntityUpdate(rootpart, update); | 5501 | int nparts = 0; |
5502 | PrimUpdateFlags cur = update; | ||
5503 | if (noanim || rootpart.Animations == null) | ||
5504 | cur &= ~PrimUpdateFlags.Animations; | ||
5505 | if (cur != PrimUpdateFlags.None) | ||
5506 | { | ||
5507 | flags[nparts] = cur; | ||
5508 | parts[nparts] = rootpart; | ||
5509 | ++nparts; | ||
5510 | } | ||
5492 | 5511 | ||
5493 | for (int i = 0; i < parts.Length; i++) | 5512 | for (int i = 0; i < origparts.Length; i++) |
5494 | { | 5513 | { |
5495 | SceneObjectPart part = parts[i]; | 5514 | if (origparts[i] == rootpart) |
5496 | if (part == rootpart) | ||
5497 | continue; | 5515 | continue; |
5498 | ControllingClient.SendEntityUpdate(part, update); | 5516 | |
5517 | cur = update; | ||
5518 | if (noanim || origparts[i].Animations == null) | ||
5519 | cur &= ~PrimUpdateFlags.Animations; | ||
5520 | if (cur == PrimUpdateFlags.None) | ||
5521 | continue; | ||
5522 | flags[nparts] = cur; | ||
5523 | parts[nparts] = origparts[i]; | ||
5524 | ++nparts; | ||
5499 | } | 5525 | } |
5500 | 5526 | ||
5527 | if (nparts == 0) | ||
5528 | return; | ||
5529 | |||
5530 | for(int i = 0; i < nparts; i++) | ||
5531 | ControllingClient.SendEntityUpdate(parts[i], flags[i]); | ||
5532 | |||
5501 | if (sog.HasPrivateAttachmentPoint) | 5533 | if (sog.HasPrivateAttachmentPoint) |
5502 | return; | 5534 | return; |
5503 | 5535 | ||
@@ -5512,22 +5544,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
5512 | 5544 | ||
5513 | p.ControllingClient.SendEntityUpdate(rootpart, update); | 5545 | p.ControllingClient.SendEntityUpdate(rootpart, update); |
5514 | 5546 | ||
5515 | for (int i = 0; i < parts.Length; i++) | 5547 | for (int i = 0; i < nparts; i++) |
5516 | { | 5548 | p.ControllingClient.SendEntityUpdate(parts[i], flags[i]); |
5517 | SceneObjectPart part = parts[i]; | ||
5518 | if (part == rootpart) | ||
5519 | continue; | ||
5520 | p.ControllingClient.SendEntityUpdate(part, update); | ||
5521 | } | ||
5522 | } | 5549 | } |
5523 | } | 5550 | } |
5524 | 5551 | ||
5525 | public void SendAttachmentUpdate(SceneObjectPart part, PrimUpdateFlags flag) | 5552 | public void SendAttachmentUpdate(SceneObjectPart part, PrimUpdateFlags update) |
5526 | { | 5553 | { |
5527 | if (IsChildAgent || IsInTransit) | 5554 | if (IsChildAgent || IsInTransit) |
5528 | return; | 5555 | return; |
5529 | 5556 | ||
5530 | ControllingClient.SendEntityUpdate(part, flag); | 5557 | if ((update & PrimUpdateFlags.Animations) != 0 && part.Animations == null) |
5558 | { | ||
5559 | update &= ~PrimUpdateFlags.Animations; | ||
5560 | if (update == PrimUpdateFlags.None) | ||
5561 | return; | ||
5562 | } | ||
5563 | |||
5564 | ControllingClient.SendEntityUpdate(part, update); | ||
5531 | 5565 | ||
5532 | if (part.ParentGroup.HasPrivateAttachmentPoint) | 5566 | if (part.ParentGroup.HasPrivateAttachmentPoint) |
5533 | return; | 5567 | return; |
@@ -5540,7 +5574,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5540 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) | 5574 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && !p.IsViewerUIGod) |
5541 | continue; | 5575 | continue; |
5542 | 5576 | ||
5543 | p.ControllingClient.SendEntityUpdate(part, flag); | 5577 | p.ControllingClient.SendEntityUpdate(part, update); |
5544 | } | 5578 | } |
5545 | } | 5579 | } |
5546 | 5580 | ||