Added "save-prims-xml2 <PrimName> <FileName>", as we were lacking a method to save a single primitive or small group of them. This command will save all prims in the current scene that name matches the "PrimName" parameter. The saved file is in standard xml2 format, so can be loaded using load-xml2

This commit is contained in:
MW
2008-07-01 19:23:45 +00:00
parent 0aaf0c4565
commit c9fe500212
6 changed files with 58 additions and 4 deletions

View File

@@ -185,19 +185,24 @@ namespace OpenSim.Region.Environment.Scenes
}
public static void SavePrimsToXml2(Scene scene, string fileName)
{
List<EntityBase> EntityList = scene.GetEntities();
SavePrimListToXml2(EntityList, fileName);
}
public static void SavePrimListToXml2(List<EntityBase> entityList, string fileName)
{
FileStream file = new FileStream(fileName, FileMode.Create);
StreamWriter stream = new StreamWriter(file);
int primCount = 0;
stream.WriteLine("<scene>\n");
List<EntityBase> EntityList = scene.GetEntities();
foreach (EntityBase ent in EntityList)
foreach (EntityBase ent in entityList)
{
if (ent is SceneObjectGroup)
{
stream.WriteLine(((SceneObjectGroup) ent).ToXmlString2());
stream.WriteLine(((SceneObjectGroup)ent).ToXmlString2());
primCount++;
}
}