diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index f718331ec1..cfb3a5d7e2 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -4282,14 +4282,25 @@ namespace OpenSim.Region.Framework.Scenes /// Get a group via its UUID /// /// - /// + /// null if no group with that name exists public SceneObjectGroup GetSceneObjectGroup(UUID fullID) { return m_sceneGraph.GetSceneObjectGroup(fullID); } /// - /// Get a named prim contained in this scene (will return the first + /// Get a group by name from the scene (will return the first + /// found, if there are more than one prim with the same name) + /// + /// + /// null if no group with that name exists + public SceneObjectGroup GetSceneObjectGroup(string name) + { + return m_sceneGraph.GetSceneObjectGroup(name); + } + + /// + /// Get a prim by name from the scene (will return the first /// found, if there are more than one prim with the same name) /// /// diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 2d547f7926..0cff011cf5 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -991,6 +991,35 @@ namespace OpenSim.Region.Framework.Scenes return null; } + /// + /// Get a group by name from the 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 SceneObjectGroup GetSceneObjectGroup(string name) + { + SceneObjectGroup so = null; + + Entities.Find( + delegate(EntityBase entity) + { + if (entity is SceneObjectGroup) + { + if (entity.Name == name) + { + so = (SceneObjectGroup)entity; + return true; + } + } + + return false; + } + ); + + return so; + } + /// /// Get a part contained in this scene. /// @@ -1005,7 +1034,7 @@ namespace OpenSim.Region.Framework.Scenes } /// - /// Get a named prim contained in this scene (will return the first + /// Get a prim by name from the scene (will return the first /// found, if there are more than one prim with the same name) /// ///