update scenegraph group find by part information in sog link, so script link functions do update that also.

avinationmerge
UbitUmarov 2014-09-22 13:59:23 +01:00
parent e25849e1c4
commit bcaf202e34
3 changed files with 28 additions and 6 deletions

View File

@ -2548,6 +2548,11 @@ namespace OpenSim.Region.Framework.Scenes
return false;
}
public void updateScenePartGroup(SceneObjectPart part, SceneObjectGroup grp)
{
m_sceneGraph.updateScenePartGroup(part, grp);
}
/// <summary>
/// Move the given scene object into a new region depending on which region its absolute position has moved
/// into.

View File

@ -462,6 +462,20 @@ namespace OpenSim.Region.Framework.Scenes
return true;
}
public void updateScenePartGroup(SceneObjectPart part, SceneObjectGroup grp)
{
// no tests, caller has responsability...
lock (SceneObjectGroupsByFullPartID)
{
SceneObjectGroupsByFullPartID[part.UUID] = grp;
}
lock (SceneObjectGroupsByLocalPartID)
{
SceneObjectGroupsByLocalPartID[part.LocalId] = grp;
}
}
/// <summary>
/// Delete an object from the scene
/// </summary>
@ -1804,7 +1818,7 @@ namespace OpenSim.Region.Framework.Scenes
List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>();
// We do this in reverse to get the link order of the prims correct
for (int i = 0 ; i < children.Count ; i++)
for (int i = 0; i < children.Count; i++)
{
SceneObjectGroup child = children[i].ParentGroup;
@ -1815,7 +1829,7 @@ namespace OpenSim.Region.Framework.Scenes
// Make sure no child prim is set for sale
// So that, on delink, no prims are unwittingly
// left for sale and sold off
if (child != null)
{
child.RootPart.ObjectSaleType = 0;
@ -1850,12 +1864,13 @@ namespace OpenSim.Region.Framework.Scenes
}
finally
{
/*
lock (SceneObjectGroupsByLocalPartID)
{
foreach (SceneObjectPart part in parentGroup.Parts)
SceneObjectGroupsByLocalPartID[part.LocalId] = parentGroup;
}
*/
parentGroup.AdjustChildPrimPermissions();
parentGroup.HasGroupChanged = true;
parentGroup.ProcessBackup(m_parentScene.SimulationDataService, true);

View File

@ -2560,11 +2560,8 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="cGroupID"></param>
public SceneObjectPart CopyPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed)
{
// give new ID to the new part, letting old keep original
// SceneObjectPart newPart = part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, m_parts.Count, userExposed);
SceneObjectPart newPart = part.Copy(part.LocalId, OwnerID, GroupID, m_parts.Count, userExposed);
newPart.LocalId = m_scene.AllocateLocalId();
newPart.SetParent(this);
AddPart(newPart);
@ -2977,6 +2974,8 @@ namespace OpenSim.Region.Framework.Scenes
m_parts.Add(linkPart.UUID, linkPart);
linkPart.SetParent(this);
m_scene.updateScenePartGroup(linkPart, this);
linkPart.CreateSelected = true;
// let physics know preserve part volume dtc messy since UpdatePrimFlags doesn't look to parent changes for now
@ -3238,9 +3237,12 @@ namespace OpenSim.Region.Framework.Scenes
part.SetParent(this);
part.ParentID = m_rootPart.LocalId;
m_parts.Add(part.UUID, part);
part.LinkNum = linkNum;
m_scene.updateScenePartGroup(part, this);
// Compute the new position of this SOP relative to the group position
part.OffsetPosition = newPos - AbsolutePosition;