From 36e3123069fb7524d3872d095c0f54c155c55a28 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 26 Sep 2012 23:17:21 +0100 Subject: [PATCH 1/4] Make it possible to rescale SOGs when they are not in a scene. --- .../Framework/Scenes/SceneObjectGroup.cs | 54 ++++++++++--------- .../Framework/Scenes/SceneObjectPart.cs | 20 ++++--- 2 files changed, 40 insertions(+), 34 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index ac26be7bee..85a37e9ac3 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -2703,29 +2703,32 @@ namespace OpenSim.Region.Framework.Scenes // m_log.DebugFormat( // "[SCENE OBJECT GROUP]: Group resizing {0} {1} from {2} to {3}", Name, LocalId, RootPart.Scale, scale); - RootPart.StoreUndoState(true); - - scale.X = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.X)); - scale.Y = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.Y)); - scale.Z = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.Z)); - PhysicsActor pa = m_rootPart.PhysActor; - if (pa != null && pa.IsPhysical) + RootPart.StoreUndoState(true); + + if (Scene != null) { - scale.X = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.X)); - scale.Y = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.Y)); - scale.Z = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.Z)); + scale.X = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.X)); + scale.Y = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.Y)); + scale.Z = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.Z)); + + if (pa != null && pa.IsPhysical) + { + scale.X = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.X)); + scale.Y = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.Y)); + scale.Z = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.Z)); + } } float x = (scale.X / RootPart.Scale.X); float y = (scale.Y / RootPart.Scale.Y); float z = (scale.Z / RootPart.Scale.Z); - SceneObjectPart[] parts; - if (x > 1.0f || y > 1.0f || z > 1.0f) + SceneObjectPart[] parts = m_parts.GetArray(); + + if (Scene != null & (x > 1.0f || y > 1.0f || z > 1.0f)) { - parts = m_parts.GetArray(); for (int i = 0; i < parts.Length; i++) { SceneObjectPart obPart = parts[i]; @@ -2739,7 +2742,7 @@ namespace OpenSim.Region.Framework.Scenes if (pa != null && pa.IsPhysical) { - if (oldSize.X * x > m_scene.m_maxPhys) + if (oldSize.X * x > Scene.m_maxPhys) { f = m_scene.m_maxPhys / oldSize.X; a = f / x; @@ -2747,7 +2750,7 @@ namespace OpenSim.Region.Framework.Scenes y *= a; z *= a; } - else if (oldSize.X * x < m_scene.m_minPhys) + else if (oldSize.X * x < Scene.m_minPhys) { f = m_scene.m_minPhys / oldSize.X; a = f / x; @@ -2756,7 +2759,7 @@ namespace OpenSim.Region.Framework.Scenes z *= a; } - if (oldSize.Y * y > m_scene.m_maxPhys) + if (oldSize.Y * y > Scene.m_maxPhys) { f = m_scene.m_maxPhys / oldSize.Y; a = f / y; @@ -2764,7 +2767,7 @@ namespace OpenSim.Region.Framework.Scenes y *= a; z *= a; } - else if (oldSize.Y * y < m_scene.m_minPhys) + else if (oldSize.Y * y < Scene.m_minPhys) { f = m_scene.m_minPhys / oldSize.Y; a = f / y; @@ -2773,7 +2776,7 @@ namespace OpenSim.Region.Framework.Scenes z *= a; } - if (oldSize.Z * z > m_scene.m_maxPhys) + if (oldSize.Z * z > Scene.m_maxPhys) { f = m_scene.m_maxPhys / oldSize.Z; a = f / z; @@ -2781,7 +2784,7 @@ namespace OpenSim.Region.Framework.Scenes y *= a; z *= a; } - else if (oldSize.Z * z < m_scene.m_minPhys) + else if (oldSize.Z * z < Scene.m_minPhys) { f = m_scene.m_minPhys / oldSize.Z; a = f / z; @@ -2792,7 +2795,7 @@ namespace OpenSim.Region.Framework.Scenes } else { - if (oldSize.X * x > m_scene.m_maxNonphys) + if (oldSize.X * x > Scene.m_maxNonphys) { f = m_scene.m_maxNonphys / oldSize.X; a = f / x; @@ -2800,7 +2803,7 @@ namespace OpenSim.Region.Framework.Scenes y *= a; z *= a; } - else if (oldSize.X * x < m_scene.m_minNonphys) + else if (oldSize.X * x < Scene.m_minNonphys) { f = m_scene.m_minNonphys / oldSize.X; a = f / x; @@ -2809,7 +2812,7 @@ namespace OpenSim.Region.Framework.Scenes z *= a; } - if (oldSize.Y * y > m_scene.m_maxNonphys) + if (oldSize.Y * y > Scene.m_maxNonphys) { f = m_scene.m_maxNonphys / oldSize.Y; a = f / y; @@ -2817,7 +2820,7 @@ namespace OpenSim.Region.Framework.Scenes y *= a; z *= a; } - else if (oldSize.Y * y < m_scene.m_minNonphys) + else if (oldSize.Y * y < Scene.m_minNonphys) { f = m_scene.m_minNonphys / oldSize.Y; a = f / y; @@ -2826,7 +2829,7 @@ namespace OpenSim.Region.Framework.Scenes z *= a; } - if (oldSize.Z * z > m_scene.m_maxNonphys) + if (oldSize.Z * z > Scene.m_maxNonphys) { f = m_scene.m_maxNonphys / oldSize.Z; a = f / z; @@ -2834,7 +2837,7 @@ namespace OpenSim.Region.Framework.Scenes y *= a; z *= a; } - else if (oldSize.Z * z < m_scene.m_minNonphys) + else if (oldSize.Z * z < Scene.m_minNonphys) { f = m_scene.m_minNonphys / oldSize.Z; a = f / z; @@ -2858,7 +2861,6 @@ namespace OpenSim.Region.Framework.Scenes RootPart.Resize(prevScale); // RootPart.IgnoreUndoUpdate = false; - parts = m_parts.GetArray(); for (int i = 0; i < parts.Length; i++) { SceneObjectPart obPart = parts[i]; diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 9e782426fd..018e4fc59e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -2368,16 +2368,20 @@ namespace OpenSim.Region.Framework.Scenes /// public void Resize(Vector3 scale) { - scale.X = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.X)); - scale.Y = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.Y)); - scale.Z = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.Z)); - PhysicsActor pa = PhysActor; - if (pa != null && pa.IsPhysical) + + if (ParentGroup.Scene != null) { - scale.X = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.X)); - scale.Y = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.Y)); - scale.Z = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.Z)); + scale.X = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.X)); + scale.Y = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.Y)); + scale.Z = Math.Max(ParentGroup.Scene.m_minNonphys, Math.Min(ParentGroup.Scene.m_maxNonphys, scale.Z)); + + if (pa != null && pa.IsPhysical) + { + scale.X = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.X)); + scale.Y = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.Y)); + scale.Z = Math.Max(ParentGroup.Scene.m_minPhys, Math.Min(ParentGroup.Scene.m_maxPhys, scale.Z)); + } } // m_log.DebugFormat("[SCENE OBJECT PART]: Resizing {0} {1} to {2}", Name, LocalId, scale); From 31c636f1e48db2a42950e2ec0e8c7eba2c16616c Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 26 Sep 2012 23:25:50 +0100 Subject: [PATCH 2/4] refactor: Change control structures in SOP.StoreUndoState() to reduce nesting. --- .../Framework/Scenes/SceneObjectPart.cs | 102 +++++++++--------- 1 file changed, 50 insertions(+), 52 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 018e4fc59e..8710c3e526 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -3170,64 +3170,62 @@ namespace OpenSim.Region.Framework.Scenes public void StoreUndoState(bool forGroup) { - if (!Undoing) + if (Undoing) { - if (!IgnoreUndoUpdate) - { - if (ParentGroup != null) - { - lock (m_undo) - { - if (m_undo.Count > 0) - { - UndoState last = m_undo[m_undo.Count - 1]; - if (last != null) - { - // TODO: May need to fix for group comparison - if (last.Compare(this)) - { - // m_log.DebugFormat( - // "[SCENE OBJECT PART]: Not storing undo for {0} {1} since current state is same as last undo state, initial stack size {2}", - // Name, LocalId, m_undo.Count); - - return; - } - } - } - -// m_log.DebugFormat( -// "[SCENE OBJECT PART]: Storing undo state for {0} {1}, forGroup {2}, initial stack size {3}", -// Name, LocalId, forGroup, m_undo.Count); - - if (ParentGroup.GetSceneMaxUndo() > 0) - { - UndoState nUndo = new UndoState(this, forGroup); - - m_undo.Add(nUndo); +// m_log.DebugFormat( +// "[SCENE OBJECT PART]: Ignoring undo store for {0} {1} since already undoing", Name, LocalId); + return; + } - if (m_undo.Count > ParentGroup.GetSceneMaxUndo()) - m_undo.RemoveAt(0); - - if (m_redo.Count > 0) - m_redo.Clear(); - -// m_log.DebugFormat( -// "[SCENE OBJECT PART]: Stored undo state for {0} {1}, forGroup {2}, stack size now {3}", -// Name, LocalId, forGroup, m_undo.Count); - } + if (IgnoreUndoUpdate) + { +// m_log.DebugFormat("[SCENE OBJECT PART]: Ignoring undo store for {0} {1}", Name, LocalId); + return; + } + + if (ParentGroup == null) + return; + + lock (m_undo) + { + if (m_undo.Count > 0) + { + UndoState last = m_undo[m_undo.Count - 1]; + if (last != null) + { + // TODO: May need to fix for group comparison + if (last.Compare(this)) + { +// m_log.DebugFormat( +// "[SCENE OBJECT PART]: Not storing undo for {0} {1} since current state is same as last undo state, initial stack size {2}", +// Name, LocalId, m_undo.Count); + + return; } } } -// else -// { -// m_log.DebugFormat("[SCENE OBJECT PART]: Ignoring undo store for {0} {1}", Name, LocalId); -// } + +// m_log.DebugFormat( +// "[SCENE OBJECT PART]: Storing undo state for {0} {1}, forGroup {2}, initial stack size {3}", +// Name, LocalId, forGroup, m_undo.Count); + + if (ParentGroup.GetSceneMaxUndo() > 0) + { + UndoState nUndo = new UndoState(this, forGroup); + + m_undo.Add(nUndo); + + if (m_undo.Count > ParentGroup.GetSceneMaxUndo()) + m_undo.RemoveAt(0); + + if (m_redo.Count > 0) + m_redo.Clear(); + +// m_log.DebugFormat( +// "[SCENE OBJECT PART]: Stored undo state for {0} {1}, forGroup {2}, stack size now {3}", +// Name, LocalId, forGroup, m_undo.Count); + } } -// else -// { -// m_log.DebugFormat( -// "[SCENE OBJECT PART]: Ignoring undo store for {0} {1} since already undoing", Name, LocalId); -// } } /// From b9934fc4dbb1267409fa7264f3dd83a98959ea87 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 26 Sep 2012 23:31:10 +0100 Subject: [PATCH 3/4] Don't store undo states if a scene object is manipulated when it is not in a scene. Adds regression test for this. --- .../Framework/Scenes/SceneObjectPart.cs | 6 ++--- .../Scenes/Tests/SceneObjectUndoRedoTests.cs | 23 +++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 8710c3e526..3d4bc3c4af 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -3170,6 +3170,9 @@ namespace OpenSim.Region.Framework.Scenes public void StoreUndoState(bool forGroup) { + if (ParentGroup == null || ParentGroup.Scene == null) + return; + if (Undoing) { // m_log.DebugFormat( @@ -3183,9 +3186,6 @@ namespace OpenSim.Region.Framework.Scenes return; } - if (ParentGroup == null) - return; - lock (m_undo) { if (m_undo.Count > 0) diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUndoRedoTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUndoRedoTests.cs index c93562d500..133fac573a 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUndoRedoTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUndoRedoTests.cs @@ -102,6 +102,29 @@ namespace OpenSim.Region.Framework.Scenes.Tests Assert.That(g1.GroupScale, Is.EqualTo(secondSize)); } + [Test] + public void TestNoUndoOnObjectsNotInScene() + { + TestHelpers.InMethod(); + + Vector3 firstSize = new Vector3(2, 3, 4); + Vector3 secondSize = new Vector3(5, 6, 7); + Vector3 thirdSize = new Vector3(8, 9, 10); + Vector3 fourthSize = new Vector3(11, 12, 13); + + Scene scene = new SceneHelpers().SetupScene(); + SceneObjectGroup g1 = SceneHelpers.CreateSceneObject(1, TestHelpers.ParseTail(0x1)); + + g1.GroupResize(firstSize); + g1.GroupResize(secondSize); + + Assert.That(g1.RootPart.UndoCount, Is.EqualTo(0)); + + g1.RootPart.Undo(); + + Assert.That(g1.GroupScale, Is.EqualTo(secondSize)); + } + [Test] public void TestUndoBeyondAvailable() { From 2bf42f30af5030890b8e3ff5bb29074a1f0e9085 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 27 Sep 2012 00:12:34 +0100 Subject: [PATCH 4/4] Add MaxPrimsUndo config setting to [Startup] section of OpenSim.ini. This controls how many undo steps the simulator will store for each prim. Default is now 20 rather than 5 as it briefly was. The default number could be increased through this is a memory tradeoff which will scale with the number of prims in the sim and level of activity. --- OpenSim/Region/Framework/Scenes/Scene.cs | 5 ++--- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 8 -------- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 12 ++++++------ .../Framework/Scenes/Tests/SceneObjectResizeTests.cs | 2 -- .../Scenes/Tests/SceneObjectUndoRedoTests.cs | 4 ++++ bin/OpenSim.ini.example | 4 ++++ bin/OpenSimDefaults.ini | 4 ++++ 7 files changed, 20 insertions(+), 19 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 872c0611b3..2e03874c20 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -742,6 +742,8 @@ namespace OpenSim.Region.Framework.Scenes //Animation states m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false); + MaxUndoCount = startupConfig.GetInt("MaxPrimUndos", 20); + PhysicalPrims = startupConfig.GetBoolean("physical_prim", PhysicalPrims); CollidablePrims = startupConfig.GetBoolean("collidable_prim", CollidablePrims); @@ -932,9 +934,6 @@ namespace OpenSim.Region.Framework.Scenes WestBorders.Add(westBorder); BordersLocked = false; - // TODO: At some point this should be made configurable. - MaxUndoCount = 5; - m_eventManager = new EventManager(); m_permissions = new ScenePermissions(this); diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 85a37e9ac3..45bbbda50a 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -1119,14 +1119,6 @@ namespace OpenSim.Region.Framework.Scenes parts[i].UUID = UUID.Random(); } - // helper provided for parts. - public int GetSceneMaxUndo() - { - if (m_scene != null) - return m_scene.MaxUndoCount; - return 5; - } - // justincc: I don't believe this hack is needed any longer, especially since the physics // parts of set AbsolutePosition were already commented out. By changing HasGroupChanged to false // this method was preventing proper reload of scene objects. diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 3d4bc3c4af..3f10b34d7b 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -3209,13 +3209,13 @@ namespace OpenSim.Region.Framework.Scenes // "[SCENE OBJECT PART]: Storing undo state for {0} {1}, forGroup {2}, initial stack size {3}", // Name, LocalId, forGroup, m_undo.Count); - if (ParentGroup.GetSceneMaxUndo() > 0) + if (ParentGroup.Scene.MaxUndoCount > 0) { UndoState nUndo = new UndoState(this, forGroup); m_undo.Add(nUndo); - if (m_undo.Count > ParentGroup.GetSceneMaxUndo()) + if (m_undo.Count > ParentGroup.Scene.MaxUndoCount) m_undo.RemoveAt(0); if (m_redo.Count > 0) @@ -3255,7 +3255,7 @@ namespace OpenSim.Region.Framework.Scenes UndoState nUndo = null; - if (ParentGroup.GetSceneMaxUndo() > 0) + if (ParentGroup.Scene.MaxUndoCount > 0) { nUndo = new UndoState(this, goback.ForGroup); } @@ -3266,7 +3266,7 @@ namespace OpenSim.Region.Framework.Scenes { m_redo.Add(nUndo); - if (m_redo.Count > ParentGroup.GetSceneMaxUndo()) + if (m_redo.Count > ParentGroup.Scene.MaxUndoCount) m_redo.RemoveAt(0); } } @@ -3290,13 +3290,13 @@ namespace OpenSim.Region.Framework.Scenes UndoState gofwd = m_redo[m_redo.Count - 1]; m_redo.RemoveAt(m_redo.Count - 1); - if (ParentGroup.GetSceneMaxUndo() > 0) + if (ParentGroup.Scene.MaxUndoCount > 0) { UndoState nUndo = new UndoState(this, gofwd.ForGroup); m_undo.Add(nUndo); - if (m_undo.Count > ParentGroup.GetSceneMaxUndo()) + if (m_undo.Count > ParentGroup.Scene.MaxUndoCount) m_undo.RemoveAt(0); } diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs index e9318594ce..89647d68fc 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectResizeTests.cs @@ -62,8 +62,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests Assert.That(g1Post.RootPart.Scale.X, Is.EqualTo(2)); Assert.That(g1Post.RootPart.Scale.Y, Is.EqualTo(3)); Assert.That(g1Post.RootPart.Scale.Z, Is.EqualTo(4)); - - Assert.That(g1Post.RootPart.UndoCount, Is.EqualTo(1)); } /// diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUndoRedoTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUndoRedoTests.cs index 133fac573a..96973de181 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUndoRedoTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUndoRedoTests.cs @@ -52,6 +52,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests Vector3 secondSize = new Vector3(5, 6, 7); Scene scene = new SceneHelpers().SetupScene(); + scene.MaxUndoCount = 20; SceneObjectGroup g1 = SceneHelpers.AddSceneObject(scene); // TODO: It happens to be the case that we are not storing undo states for SOPs which are not yet in a SOG, @@ -113,6 +114,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests Vector3 fourthSize = new Vector3(11, 12, 13); Scene scene = new SceneHelpers().SetupScene(); + scene.MaxUndoCount = 20; SceneObjectGroup g1 = SceneHelpers.CreateSceneObject(1, TestHelpers.ParseTail(0x1)); g1.GroupResize(firstSize); @@ -133,6 +135,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests Vector3 newSize = new Vector3(2, 3, 4); Scene scene = new SceneHelpers().SetupScene(); + scene.MaxUndoCount = 20; SceneObjectGroup g1 = SceneHelpers.AddSceneObject(scene); Vector3 originalSize = g1.GroupScale; @@ -160,6 +163,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests Vector3 newSize = new Vector3(2, 3, 4); Scene scene = new SceneHelpers().SetupScene(); + scene.MaxUndoCount = 20; SceneObjectGroup g1 = SceneHelpers.AddSceneObject(scene); Vector3 originalSize = g1.GroupScale; diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 6dbb61162a..4f0bb079f6 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -97,6 +97,10 @@ ;; from the selected region_info_source. ; allow_regionless = false + ;# {MaxPrimUndos} {} {Maximum number of undos avialable for position, rotation and scale changes of each prim} {} 20 + ;; Increasing the number of undos available number will increase memory usage. + MaxPrimUndos = 20 + ;# {NonPhysicalPrimMin} {} {Minimum size of nonphysical prims?} {} 0.001 ;; Minimum size for non-physical prims. Affects resizing of existing ;; prims. This can be overriden in the region config file (as diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index 744187baa7..046aa67b89 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -85,6 +85,10 @@ ;; from the selected region_info_source. allow_regionless = false + ; Maximum number of position, rotation and scale changes for each prim that the simulator will store for later undos + ; Increasing this number will increase memory usage. + MaxPrimUndos = 20 + ; Maximum size of non physical prims. Affects resizing of existing prims. This can be overriden in the region config file (as NonPhysicalPrimMax!). NonPhysicalPrimMax = 256