From 513ce9caee7bbacc167c1f3241e64e201ac412cf Mon Sep 17 00:00:00 2001
From: Johan Berntsson
Date: Wed, 1 Oct 2008 06:39:36 +0000
Subject: Added functions to find prims by name
---
OpenSim/Region/Environment/Scenes/InnerScene.cs | 26 +++++++++++++++++++++++++
OpenSim/Region/Environment/Scenes/Scene.cs | 11 +++++++++++
2 files changed, 37 insertions(+)
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs
index cd5a9f5..3be1592 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 3799259..bbc50e6 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);
+ }
+
///
///
///
--
cgit v1.1