From 741a967bb3bf67c986775523996327a3858f3933 Mon Sep 17 00:00:00 2001 From: MW Date: Sat, 8 Sep 2007 11:08:38 +0000 Subject: 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 " 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. ] --- OpenSim/Region/Environment/Scenes/Scene.cs | 28 ++++++++++++++++++++++ .../Region/Environment/Scenes/SceneObjectGroup.cs | 1 + 2 files changed, 29 insertions(+) diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 1ce75e0..4f8d60b 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -1310,12 +1310,40 @@ namespace OpenSim.Region.Environment.Scenes HandleAlertCommand(cmdparams); break; + case "edit-scale": + if (cmdparams.Length == 4) + { + HandleEditCommand(cmdparams); + } + break; + default: MainLog.Instance.Error("Unknown command: " + command); 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) { switch (ShowWhat) diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index b202f3c..45d975c 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -606,6 +606,7 @@ namespace OpenSim.Region.Environment.Scenes /// public void SetPartName(string name, uint localID) { + name = name.Remove(name.Length - 1, 1); SceneObjectPart part = this.GetChildPart(localID); if (part != null) { -- cgit v1.1