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 +++++++++++++++++++++++++
1 file changed, 26 insertions(+)
(limited to 'OpenSim/Region/Environment/Scenes/InnerScene.cs')
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.
--
cgit v1.1