mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 17:05:55 +08:00
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:
@@ -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++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user