OpenSim.Modules.PathFinding/src/BasicPathFinding.cs

508 lines
20 KiB
C#
Raw Normal View History

2020-06-10 15:44:15 +00:00
using log4net;
using Mono.Addins;
using Nini.Config;
using OpenMetaverse;
2020-06-10 20:04:56 +00:00
using OpenSim.Region.CoreModules.World.LegacyMap;
2020-06-10 15:44:15 +00:00
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
2020-06-10 19:26:18 +00:00
using OpenSim.Region.ScriptEngine.Interfaces;
using OpenSim.Region.ScriptEngine.Shared.Api;
2020-06-22 22:58:09 +00:00
using Roy_T.AStar.Graphs;
2020-06-22 22:51:24 +00:00
using Roy_T.AStar.Grids;
using Roy_T.AStar.Paths;
using Roy_T.AStar.Primitives;
2020-06-10 15:44:15 +00:00
using System;
2020-06-10 20:46:58 +00:00
using System.Collections.Generic;
2020-06-10 15:44:15 +00:00
using System.Drawing;
2020-06-10 16:03:33 +00:00
using System.Drawing.Imaging;
2020-06-10 15:44:15 +00:00
using System.Reflection;
2020-06-10 16:03:33 +00:00
using System.Threading;
2020-06-10 15:44:15 +00:00
2020-06-19 07:13:47 +00:00
using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat;
using LSL_Integer = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger;
using LSL_Key = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
using LSL_List = OpenSim.Region.ScriptEngine.Shared.LSL_Types.list;
using LSL_Rotation = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion;
using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
using LSL_Vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3;
2020-06-10 15:44:15 +00:00
[assembly: Addin("BasicPathFindingModule", "0.1")]
[assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)]
namespace OpenSim.Modules.PathFinding
{
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "BasicPathFindingModule")]
public class BasicPathFindingModule : INonSharedRegionModule
{
#region Region Module
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private Scene m_scene = null;
private IConfig m_config = null;
private bool m_enabled = true;
private IScriptModuleComms m_scriptModule;
2020-06-18 23:52:18 +00:00
private List<Environment> m_environments = new List<Environment>();
2020-06-10 15:44:15 +00:00
public string Name
{
get { return "BasicPathFindingModule"; }
}
public Type ReplaceableInterface
{
get { return null; }
}
public void AddRegion(Scene scene)
{
}
public void Close()
{
}
public void Initialise(IConfigSource source)
{
try
{
m_config = source.Configs["XEngine"];
if (m_config != null)
{
m_enabled = m_config.GetBoolean("EnablePathFinding", m_enabled);
}
else
{
m_log.Error("[" + Name + "]: Cant find config.");
}
}
catch (Exception e)
{
m_log.ErrorFormat("[" + Name + "]: initialization error: {0}", e.Message);
return;
}
if (m_enabled)
{
m_log.Info("[" + Name + "]: module is enabled");
}
else
{
m_log.Info("[" + Name + "]: module is disabled");
}
}
public void RegionLoaded(Scene scene)
{
if (m_enabled)
{
m_log.Info("[" + Name + "]: Load region " + scene.Name);
m_scene = scene;
m_scriptModule = m_scene.RequestModuleInterface<IScriptModuleComms>();
if (m_scriptModule == null)
{
m_log.ErrorFormat("[" + Name + "]: Failed to load IScriptModuleComms!");
m_enabled = false;
return;
}
try
{
2020-06-18 23:52:18 +00:00
m_scriptModule.RegisterScriptInvocation(this, "osGeneratePathEnv");
m_scriptModule.RegisterScriptInvocation(this, "osKeepAlivePathEnv");
2020-06-19 08:53:59 +00:00
m_scriptModule.RegisterScriptInvocation(this, "osSetPathPositionData");
m_scriptModule.RegisterScriptInvocation(this, "osSetPathLineData");
2020-06-18 23:52:18 +00:00
m_scriptModule.RegisterScriptInvocation(this, "osGeneratePath");
2020-06-19 08:53:59 +00:00
m_scriptModule.RegisterScriptInvocation(this, "osGetSearchableObjectList");
2020-06-19 07:13:47 +00:00
2020-06-18 23:52:18 +00:00
m_scriptModule.RegisterScriptInvocation(this, "osGenerateDebugImage");
m_scriptModule.RegisterConstant("PATH_ENV_SUCCESSFUL", 19850);
2020-06-19 08:53:59 +00:00
m_scriptModule.RegisterConstant("PATH_ENV_ERR_NOT_FOUND", 19851);
m_scriptModule.RegisterConstant("PATH_ENV_ERR_OUT_OF_RANGE", 19852);
m_scriptModule.RegisterConstant("PATH_ENV_ERR_NOT_IN_LINE", 19853);
2020-06-22 22:51:24 +00:00
m_scriptModule.RegisterConstant("PATH_ENV_ERR_START_OR_END_UNKNOWN", 19854);
2020-06-23 00:27:17 +00:00
m_scriptModule.RegisterConstant("PATH_ENV_ERR_TARGET_NOT_REACHABLE", 19855);
2020-06-19 18:10:23 +00:00
m_scriptModule.RegisterConstant("PATH_ENV_ERR_UNKNOWN", 19860);
2020-06-10 15:44:15 +00:00
}
catch (Exception e)
{
m_log.WarnFormat("[" + Name + "]: script method registration failed; {0}", e.Message);
m_enabled = false;
}
2020-06-10 18:46:06 +00:00
2020-06-10 19:13:06 +00:00
m_log.Info("[" + Name + "]: Region loading done!");
2020-06-10 15:44:15 +00:00
}
}
public void RemoveRegion(Scene scene)
{
}
#endregion
2020-06-18 23:52:18 +00:00
#region Asyn Funktions
private void generatePathEnvironment(ScriptRequestData requestData)
2020-06-18 23:52:18 +00:00
{
2020-06-19 18:44:56 +00:00
lock(m_environments)
2020-06-19 18:10:23 +00:00
{
2020-06-19 18:44:56 +00:00
try
2020-06-19 18:10:23 +00:00
{
2020-06-19 18:44:56 +00:00
UUID _envID = UUID.Random();
Environment _newEnv = new Environment(_envID.ToString(), (int)m_scene.RegionInfo.RegionSizeX);
2020-06-19 18:10:23 +00:00
m_environments.Add(_newEnv);
2020-06-18 23:52:18 +00:00
2020-06-19 18:44:56 +00:00
m_scriptModule.DispatchReply(requestData.ScriptID, 19850, _envID.ToString(), requestData.RequestID.ToString());
}
catch (Exception _error)
{
m_scriptModule.DispatchReply(requestData.ScriptID, 19860, _error.Message, requestData.RequestID.ToString());
}
2020-06-18 23:52:18 +00:00
}
}
private void keepAlivePathEnv(ScriptRequestData requestData)
{
2020-06-19 18:44:56 +00:00
lock (m_environments)
2020-06-19 18:10:23 +00:00
{
2020-06-19 18:44:56 +00:00
try
2020-06-19 18:10:23 +00:00
{
2020-06-19 18:44:56 +00:00
Environment _env = m_environments.Find(X => X.ID == requestData.EnvironmentID);
if (_env != null)
2020-06-19 18:12:22 +00:00
{
_env.LastTimeUsed = (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;
m_scriptModule.DispatchReply(requestData.ScriptID, 19850, "", requestData.RequestID.ToString());
return;
}
2020-06-19 18:10:23 +00:00
2020-06-19 18:44:56 +00:00
m_scriptModule.DispatchReply(requestData.ScriptID, 19851, "", requestData.RequestID.ToString());
}
catch (Exception _error)
{
m_scriptModule.DispatchReply(requestData.ScriptID, 19860, _error.Message, requestData.RequestID.ToString());
}
2020-06-18 23:52:18 +00:00
}
}
2020-06-22 22:51:24 +00:00
private void setPositionData(ScriptRequestData requestData, Vector3 position, int walkable, int isTarget, int isStart)
2020-06-18 23:52:18 +00:00
{
2020-06-19 18:44:56 +00:00
lock(m_environments)
2020-06-18 23:52:18 +00:00
{
2020-06-19 18:44:56 +00:00
try
2020-06-19 00:11:51 +00:00
{
2020-06-19 18:44:56 +00:00
Environment _env = m_environments.Find(X => X.ID == requestData.EnvironmentID);
if (_env != null)
2020-06-19 18:12:22 +00:00
{
PathNode _node = _env.Nodes.Find(X => X.PositionX == (int)position.X && X.PositionY == (int)position.Y);
2020-06-18 23:52:18 +00:00
2020-06-19 18:12:22 +00:00
if (_node == null)
{
2020-06-23 14:24:33 +00:00
_node = new PathNode((int)position.X, (int)position.Y, false);
2020-06-19 18:12:22 +00:00
_env.Nodes.Add(_node);
}
2020-06-18 23:52:18 +00:00
2020-06-19 18:12:22 +00:00
if (walkable == 1)
_node.Walkable = true;
2020-06-18 23:52:18 +00:00
2020-06-19 18:12:22 +00:00
if (walkable == 0)
_node.Walkable = false;
2020-06-18 23:52:18 +00:00
2020-06-19 18:12:22 +00:00
if (isTarget == 1)
2020-06-23 14:24:33 +00:00
_env.Target = _node;
2020-06-18 23:52:18 +00:00
2020-06-22 22:51:24 +00:00
if (isStart == 1)
2020-06-23 14:24:33 +00:00
_env.Start = _node;
2020-06-22 22:51:24 +00:00
2020-06-19 18:12:22 +00:00
return;
}
2020-06-19 18:10:23 +00:00
2020-06-19 18:44:56 +00:00
m_scriptModule.DispatchReply(requestData.ScriptID, 19851, "", requestData.RequestID.ToString());
}
catch (Exception _error)
{
m_scriptModule.DispatchReply(requestData.ScriptID, 19860, _error.Message, requestData.RequestID.ToString());
}
2020-06-19 18:10:23 +00:00
}
2020-06-18 23:52:18 +00:00
}
2020-06-19 08:53:59 +00:00
private void setLineData(ScriptRequestData requestData, Vector3 start, Vector3 target, int walkable)
{
2020-06-19 18:44:56 +00:00
lock(m_environments)
2020-06-19 08:53:59 +00:00
{
2020-06-19 18:44:56 +00:00
try
2020-06-19 18:10:23 +00:00
{
2020-06-19 18:44:56 +00:00
Environment _env = m_environments.Find(X => X.ID == requestData.EnvironmentID);
if (_env != null)
2020-06-19 08:53:59 +00:00
{
2020-06-19 18:12:22 +00:00
if ((int)start.X == (int)target.X || (int)start.Y == (int)target.Y)
2020-06-19 10:45:28 +00:00
{
2020-06-19 18:12:22 +00:00
if ((int)start.X == (int)target.X && (int)start.Y == (int)target.Y)
2020-06-19 18:10:23 +00:00
{
2020-06-19 18:12:22 +00:00
m_scriptModule.DispatchReply(requestData.ScriptID, 19850, "", requestData.RequestID.ToString());
return;
2020-06-19 18:10:23 +00:00
}
2020-06-19 18:12:22 +00:00
Vector3 _PointA = new Vector3(0, 0, 0);
Vector3 _PointB = new Vector3(0, 0, 0);
2020-06-19 08:53:59 +00:00
2020-06-19 18:12:22 +00:00
if ((int)start.X != (int)target.X)
2020-06-19 18:10:23 +00:00
{
2020-06-19 18:12:22 +00:00
if ((int)start.X < (int)target.X)
{
_PointA = start;
_PointB = target;
}
if ((int)start.X > (int)target.X)
{
_PointA = target;
_PointB = start;
}
2020-06-19 19:27:29 +00:00
while ((int)_PointA.X <= (int)_PointB.X)
2020-06-19 18:12:22 +00:00
{
2020-06-22 22:51:24 +00:00
setPositionData(requestData, _PointA, walkable, 0, 0);
2020-06-19 18:12:22 +00:00
_PointA.X = (int)_PointA.X + 1;
}
2020-06-19 18:10:23 +00:00
}
2020-06-19 18:12:22 +00:00
if ((int)start.Y != (int)target.Y)
2020-06-19 18:10:23 +00:00
{
2020-06-19 18:12:22 +00:00
if ((int)start.Y < (int)target.Y)
{
_PointA = start;
_PointB = target;
}
if ((int)start.Y > (int)target.Y)
{
_PointA = target;
_PointB = start;
}
2020-06-19 19:27:29 +00:00
while ((int)_PointA.Y <= (int)_PointB.Y)
2020-06-19 18:12:22 +00:00
{
2020-06-22 22:51:24 +00:00
setPositionData(requestData, _PointA, walkable, 0, 0);
2020-06-19 18:12:22 +00:00
_PointA.Y = (int)_PointA.Y + 1;
}
2020-06-19 18:10:23 +00:00
}
2020-06-19 18:12:22 +00:00
m_scriptModule.DispatchReply(requestData.ScriptID, 19850, "", requestData.RequestID.ToString());
return;
2020-06-19 10:45:28 +00:00
}
2020-06-19 18:27:33 +00:00
else
{
m_scriptModule.DispatchReply(requestData.ScriptID, 19853, "", requestData.RequestID.ToString());
}
2020-06-19 08:53:59 +00:00
}
2020-06-19 18:44:56 +00:00
else
{
m_scriptModule.DispatchReply(requestData.ScriptID, 19851, "", requestData.RequestID.ToString());
}
2020-06-19 08:53:59 +00:00
}
2020-06-19 18:44:56 +00:00
catch (Exception _error)
2020-06-19 18:10:23 +00:00
{
2020-06-19 18:44:56 +00:00
m_scriptModule.DispatchReply(requestData.ScriptID, 19860, _error.Message, requestData.RequestID.ToString());
2020-06-19 18:10:23 +00:00
}
2020-06-19 08:53:59 +00:00
}
}
2020-06-18 23:52:18 +00:00
private void generatePath(ScriptRequestData requestData)
{
2020-06-23 15:19:45 +00:00
try
2020-06-22 22:51:24 +00:00
{
2020-06-23 15:19:45 +00:00
lock (m_environments)
2020-06-22 22:51:24 +00:00
{
2020-06-23 15:19:45 +00:00
Environment _env = m_environments.Find(X => X.ID == requestData.EnvironmentID);
2020-06-23 15:12:06 +00:00
2020-06-23 15:19:45 +00:00
if (_env.Start != null && _env.Target != null)
{
if (_env.Start.PositionX == _env.Target.PositionX && _env.Start.PositionY == _env.Target.PositionY)
m_scriptModule.DispatchReply(requestData.ScriptID, 19850, "", requestData.RequestID.ToString());
2020-06-22 22:51:24 +00:00
2020-06-23 15:19:45 +00:00
GridSize _pathFindingGridSize = new GridSize(_env.Size, _env.Size);
Roy_T.AStar.Primitives.Size _pathFindingCellSize = new Roy_T.AStar.Primitives.Size(Distance.FromMeters(1), Distance.FromMeters(1));
Velocity _pathFindingVelocity = Velocity.FromKilometersPerHour(11.5f);
2020-06-22 22:58:09 +00:00
2020-06-23 15:19:45 +00:00
Grid _pathFindingGrid = Grid.CreateGridWithLateralAndDiagonalConnections(_pathFindingGridSize, _pathFindingCellSize, _pathFindingVelocity);
2020-06-22 22:58:09 +00:00
2020-06-23 15:19:45 +00:00
foreach (INode _thisNode in _pathFindingGrid.GetAllNodes())
2020-06-23 00:29:38 +00:00
{
2020-06-23 15:19:45 +00:00
PathNode _node = _env.Nodes.Find(X => X.PositionX == (int)_thisNode.Position.X && X.PositionY == (int)_thisNode.Position.Y);
if (_node == null)
{
_pathFindingGrid.DisconnectNode(new GridPosition((int)_thisNode.Position.X, (int)_thisNode.Position.Y));
_pathFindingGrid.RemoveDiagonalConnectionsIntersectingWithNode(new GridPosition((int)_thisNode.Position.X, (int)_thisNode.Position.Y));
}
2020-06-23 00:29:38 +00:00
}
2020-06-22 22:58:09 +00:00
2020-06-23 15:19:45 +00:00
PathFinder pathFinder = new PathFinder();
Path _pathFindingPath = pathFinder.FindPath(new GridPosition(_env.Start.PositionX, _env.Start.PositionY), new GridPosition(_env.Target.PositionX, _env.Target.PositionY), _pathFindingGrid);
2020-06-22 22:51:24 +00:00
2020-06-23 15:19:45 +00:00
String _pathString = "";
int lastX = 0;
int lastY = 0;
2020-06-22 22:51:24 +00:00
2020-06-23 15:19:45 +00:00
foreach (var _thisEdge in _pathFindingPath.Edges)
{
2020-06-23 15:19:45 +00:00
if (lastX != (int)_thisEdge.End.Position.X && lastY != (int)_thisEdge.End.Position.Y)
{
_pathString += "<" + _thisEdge.End.Position.X + ", " + _thisEdge.End.Position.Y + ", 0>;";
2020-06-23 06:30:32 +00:00
2020-06-23 15:19:45 +00:00
lastX = (int)_thisEdge.End.Position.X;
lastY = (int)_thisEdge.End.Position.Y;
}
}
2020-06-23 06:30:32 +00:00
2020-06-23 15:19:45 +00:00
_pathString += "<" + _pathFindingPath.Edges[_pathFindingPath.Edges.Count - 1].End.Position.X + ", " + _pathFindingPath.Edges[_pathFindingPath.Edges.Count - 1].End.Position.Y + ", 0>;";
2020-06-23 06:30:32 +00:00
2020-06-22 22:51:24 +00:00
2020-06-23 15:19:45 +00:00
if (_pathFindingPath.Type == PathType.Complete)
{
m_scriptModule.DispatchReply(requestData.ScriptID, 19850, _pathString, requestData.RequestID.ToString());
}
else
{
m_scriptModule.DispatchReply(requestData.ScriptID, 19855, _pathString, requestData.RequestID.ToString());
}
2020-06-22 22:51:24 +00:00
}
else
{
2020-06-23 15:19:45 +00:00
m_scriptModule.DispatchReply(requestData.ScriptID, 19854, "", requestData.RequestID.ToString());
2020-06-22 22:51:24 +00:00
}
}
2020-06-23 15:19:45 +00:00
}catch(Exception _error)
{
m_scriptModule.DispatchReply(requestData.ScriptID, 19860, _error.Message, requestData.RequestID.ToString());
2020-06-22 22:51:24 +00:00
}
2020-06-18 23:52:18 +00:00
}
private void generateDebugImage(ScriptRequestData requestData)
{
2020-06-19 18:44:56 +00:00
lock(m_environments)
2020-06-18 23:52:18 +00:00
{
2020-06-19 18:44:56 +00:00
try
2020-06-18 23:52:18 +00:00
{
2020-06-19 18:44:56 +00:00
Environment _env = m_environments.Find(X => X.ID == requestData.EnvironmentID);
if (_env != null)
2020-06-19 18:27:33 +00:00
{
Bitmap _bitmap = new Bitmap(_env.Size, _env.Size);
foreach (PathNode thisNode in _env.Nodes)
{
if (thisNode.Walkable)
_bitmap.SetPixel(thisNode.PositionX, thisNode.PositionY, Color.Green);
if (!thisNode.Walkable)
_bitmap.SetPixel(thisNode.PositionX, thisNode.PositionY, Color.Black);
}
2020-06-18 23:52:18 +00:00
2020-06-19 18:27:33 +00:00
_bitmap.Save(requestData.EnvironmentID + ".png");
2020-06-19 18:44:56 +00:00
m_scriptModule.DispatchReply(requestData.ScriptID, 19850, requestData.EnvironmentID + ".png", requestData.RequestID.ToString());
2020-06-19 18:27:33 +00:00
return;
}
2020-06-18 23:52:18 +00:00
2020-06-19 18:44:56 +00:00
m_scriptModule.DispatchReply(requestData.ScriptID, 19851, "", requestData.RequestID.ToString());
}
catch (Exception _error)
{
m_scriptModule.DispatchReply(requestData.ScriptID, 19860, _error.Message, requestData.RequestID.ToString());
}
2020-06-18 23:52:18 +00:00
}
}
#endregion
2020-06-10 15:44:15 +00:00
#region Script Funktions
2020-06-18 23:52:18 +00:00
[ScriptInvocation]
2020-06-19 10:45:28 +00:00
public string osGeneratePathEnv(UUID hostID, UUID scriptID)
2020-06-10 15:44:15 +00:00
{
2020-06-18 23:52:18 +00:00
UUID requestKey = UUID.Random();
SceneObjectGroup _host = m_scene.GetSceneObjectGroup(hostID);
2020-06-19 00:23:43 +00:00
(new Thread(delegate () { generatePathEnvironment(new ScriptRequestData(hostID, scriptID, null, requestKey)); })).Start();
2020-06-18 23:52:18 +00:00
return requestKey.ToString();
2020-06-10 16:03:33 +00:00
}
[ScriptInvocation]
2020-06-18 23:52:18 +00:00
public string osKeepAlivePathEnv(UUID hostID, UUID scriptID, String environmentID)
2020-06-10 16:03:33 +00:00
{
2020-06-11 09:47:24 +00:00
UUID requestKey = UUID.Random();
2020-06-11 09:53:19 +00:00
2020-06-18 23:52:18 +00:00
SceneObjectGroup _host = m_scene.GetSceneObjectGroup(hostID);
(new Thread(delegate () { keepAlivePathEnv(new ScriptRequestData(hostID, scriptID, environmentID, requestKey)); })).Start();
return requestKey.ToString();
}
[ScriptInvocation]
2020-06-22 22:51:24 +00:00
public void osSetPathPositionData(UUID hostID, UUID scriptID, String environmentID, Vector3 position, int walkable, int isTarget, int isStart)
2020-06-18 23:52:18 +00:00
{
SceneObjectGroup _host = m_scene.GetSceneObjectGroup(hostID);
2020-06-22 22:51:24 +00:00
(new Thread(delegate () { setPositionData(new ScriptRequestData(hostID, scriptID, environmentID), position, walkable, isTarget, isStart); })).Start();
2020-06-18 23:52:18 +00:00
}
2020-06-19 08:53:59 +00:00
[ScriptInvocation]
public void osSetPathLineData(UUID hostID, UUID scriptID, String environmentID, Vector3 start, Vector3 target, int walkable)
{
SceneObjectGroup _host = m_scene.GetSceneObjectGroup(hostID);
(new Thread(delegate () { setLineData(new ScriptRequestData(hostID, scriptID, environmentID), start, target, walkable); })).Start();
}
2020-06-18 23:52:18 +00:00
[ScriptInvocation]
public string osGeneratePath(UUID hostID, UUID scriptID, String environmentID)
{
UUID requestKey = UUID.Random();
SceneObjectGroup _host = m_scene.GetSceneObjectGroup(hostID);
(new Thread(delegate () { generatePath(new ScriptRequestData(hostID, scriptID, environmentID, requestKey)); })).Start();
return requestKey.ToString();
}
[ScriptInvocation]
public string osGenerateDebugImage(UUID hostID, UUID scriptID, String environmentID)
{
UUID requestKey = UUID.Random();
2020-06-10 18:21:19 +00:00
2020-06-11 09:47:24 +00:00
SceneObjectGroup _host = m_scene.GetSceneObjectGroup(hostID);
2020-06-18 23:52:18 +00:00
(new Thread(delegate () { generateDebugImage(new ScriptRequestData(hostID, scriptID, environmentID, requestKey)); })).Start();
2020-06-10 16:03:33 +00:00
2020-06-11 09:47:24 +00:00
return requestKey.ToString();
2020-06-10 15:44:15 +00:00
}
2020-06-19 07:13:47 +00:00
[ScriptInvocation]
2020-06-19 09:05:12 +00:00
public object[] osGetSearchableObjectList(UUID hostID, UUID scriptID, String searchString)
2020-06-19 07:13:47 +00:00
{
2020-06-19 09:05:12 +00:00
List<object> returnList = new List<object>();
2020-06-19 07:13:47 +00:00
foreach (SceneObjectGroup thisGroup in m_scene.GetSceneObjectGroups())
{
if(thisGroup.Name == searchString)
2020-06-19 10:57:05 +00:00
returnList.Add(thisGroup.UUID);
2020-06-19 07:13:47 +00:00
}
2020-06-19 09:05:12 +00:00
return returnList.ToArray();
2020-06-19 07:13:47 +00:00
}
2020-06-10 15:44:15 +00:00
#endregion
}
}