diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index cd5a9f5a0d..3be1592ec7 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs @@ -821,6 +821,32 @@ namespace OpenSim.Region.Environment.Scenes else return null; } + + /// + /// Get a named prim contained in this scene (will return the first + /// found, if there are more than one prim with the same name) + /// + /// + /// null if the part was not found + protected internal SceneObjectPart GetSceneObjectPart(string name) + { + List EntityList = GetEntities(); + + foreach (EntityBase ent in EntityList) + { + if (ent is SceneObjectGroup) + { + foreach(SceneObjectPart p in ((SceneObjectGroup) ent).GetParts()) + { + if (p.Name==name) + { + return p; + } + } + } + } + return null; + } /// /// Get a part contained in this scene. diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 3799259a54..bbc50e67c2 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -3882,6 +3882,17 @@ namespace OpenSim.Region.Environment.Scenes // } // } + /// + /// Get a named prim contained in this scene (will return the first + /// found, if there are more than one prim with the same name) + /// + /// + /// + public SceneObjectPart GetSceneObjectPart(string name) + { + return m_innerScene.GetSceneObjectPart(name); + } + /// /// ///