mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 18:25:33 +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:
@@ -1738,6 +1738,27 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
m_serialiser.SavePrimsToXml2(this, fileName);
|
||||
}
|
||||
|
||||
|
||||
public void SaveNamedPrimsToXml2(string primName, string fileName)
|
||||
{
|
||||
List<EntityBase> entityList = GetEntities();
|
||||
List<EntityBase> primList = new List<EntityBase>();
|
||||
|
||||
foreach (EntityBase ent in entityList)
|
||||
{
|
||||
if (ent is SceneObjectGroup)
|
||||
{
|
||||
if (ent.Name == primName)
|
||||
{
|
||||
primList.Add(ent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_serialiser.SavePrimListToXml2(primList, fileName);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Load a prim archive into the scene. This loads both prims and their assets.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user