Added region console command "edit-scale". To use first use change-region to set the active region as the one you want. Then use "edit-scale <primitivename> <xvalue> <yvalue> <zvalue>" so a example is "edit-scale myprimitive 30.0 25.0 35.0" [ Note the primitive name can't have spaces in it. Also if there is more than one primitive with that name in the region, then it will edit the first one it finds. Also it currently doesn't search through the sub primitives of linked groups. So the primitive needs to be either a single primitive object or the root prim of a group. ]

afrisby
MW 2007-09-08 11:08:38 +00:00
parent 5020e4e602
commit 741a967bb3
2 changed files with 29 additions and 0 deletions

View File

@ -1310,12 +1310,40 @@ namespace OpenSim.Region.Environment.Scenes
HandleAlertCommand(cmdparams); HandleAlertCommand(cmdparams);
break; break;
case "edit-scale":
if (cmdparams.Length == 4)
{
HandleEditCommand(cmdparams);
}
break;
default: default:
MainLog.Instance.Error("Unknown command: " + command); MainLog.Instance.Error("Unknown command: " + command);
break; break;
} }
} }
public void HandleEditCommand(string[] cmmdparams)
{
Console.WriteLine("Searching for Primitive: '" + cmmdparams[0] + "'");
foreach (EntityBase ent in this.Entities.Values)
{
if (ent is SceneObjectGroup)
{
SceneObjectPart part = ((SceneObjectGroup)ent).GetChildPart(((SceneObjectGroup)ent).UUID);
if (part != null)
{
if (part.Name == cmmdparams[0])
{
part.Resize( new LLVector3(Convert.ToSingle(cmmdparams[1]), Convert.ToSingle(cmmdparams[2]), Convert.ToSingle(cmmdparams[3])));
Console.WriteLine("Edited scale of Primitive: " + part.Name);
}
}
}
}
}
public void Show(string ShowWhat) public void Show(string ShowWhat)
{ {
switch (ShowWhat) switch (ShowWhat)

View File

@ -606,6 +606,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="name"></param> /// <param name="name"></param>
public void SetPartName(string name, uint localID) public void SetPartName(string name, uint localID)
{ {
name = name.Remove(name.Length - 1, 1);
SceneObjectPart part = this.GetChildPart(localID); SceneObjectPart part = this.GetChildPart(localID);
if (part != null) if (part != null)
{ {