diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs index 0c8bda50f7..ba301d910e 100644 --- a/OpenSim/Framework/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/PrimitiveBaseShape.cs @@ -890,6 +890,7 @@ namespace OpenSim.Framework } } + // only means we do have flexi data public bool FlexiEntry { get { return _flexiEntry; diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 1054fca419..3b2af30c5a 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -4026,7 +4026,7 @@ namespace OpenSim.Region.Framework.Scenes ProfileShape ps = (ProfileShape)(Shape.ProfileCurve & 0x07); if (ps == ProfileShape.Square) { - if (Shape.PathCurve == (byte)Extrusion.Straight) + if (Shape.PathCurve == (byte)Extrusion.Straight || Shape.PathCurve == (byte)Extrusion.Flexible) return PrimType.BOX; else if (Shape.PathCurve == (byte)Extrusion.Curve1) return PrimType.TUBE; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 7bfb9aed6b..bbff3a6f7d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2245,29 +2245,42 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api protected void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction, float wind, float tension, LSL_Vector Force) { - if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) + if (part == null) + return; + SceneObjectGroup sog = part.ParentGroup; + + if(sog == null || sog.IsDeleted || sog.inTransit) return; - if (flexi) + PrimitiveBaseShape pbs = part.Shape; + pbs.FlexiSoftness = softness; + pbs.FlexiGravity = gravity; + pbs.FlexiDrag = friction; + pbs.FlexiWind = wind; + pbs.FlexiTension = tension; + pbs.FlexiForceX = (float)Force.x; + pbs.FlexiForceY = (float)Force.y; + pbs.FlexiForceZ = (float)Force.z; + + pbs.FlexiEntry = flexi; + + if (!pbs.SculptEntry && (pbs.PathCurve == (byte)Extrusion.Straight || pbs.PathCurve == (byte)Extrusion.Flexible)) { - part.Shape.FlexiEntry = true; // this setting flexi true isn't working, but the below parameters do - // work once the prim is already flexi - part.Shape.FlexiSoftness = softness; - part.Shape.FlexiGravity = gravity; - part.Shape.FlexiDrag = friction; - part.Shape.FlexiWind = wind; - part.Shape.FlexiTension = tension; - part.Shape.FlexiForceX = (float)Force.x; - part.Shape.FlexiForceY = (float)Force.y; - part.Shape.FlexiForceZ = (float)Force.z; - part.Shape.PathCurve = (byte)Extrusion.Flexible; - } - else - { - // Other values not set, they do not seem to be sent to the viewer - // Setting PathCurve appears to be what actually toggles the check box and turns Flexi on and off - part.Shape.PathCurve = (byte)Extrusion.Straight; - part.Shape.FlexiEntry = false; + if(flexi) + { + pbs.PathCurve = (byte)Extrusion.Flexible; + if(!sog.IsPhantom) + { + sog.ScriptSetPhantomStatus(true); + return; + } + } + else + { + // Other values not set, they do not seem to be sent to the viewer + // Setting PathCurve appears to be what actually toggles the check box and turns Flexi on and off + pbs.PathCurve = (byte)Extrusion.Straight; + } } part.ParentGroup.HasGroupChanged = true; part.ScheduleFullUpdate(); @@ -2289,19 +2302,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) return; + PrimitiveBaseShape pbs = part.Shape; + if (light) { - part.Shape.LightEntry = true; - part.Shape.LightColorR = Util.Clip((float)color.x, 0.0f, 1.0f); - part.Shape.LightColorG = Util.Clip((float)color.y, 0.0f, 1.0f); - part.Shape.LightColorB = Util.Clip((float)color.z, 0.0f, 1.0f); - part.Shape.LightIntensity = Util.Clip((float)intensity, 0.0f, 1.0f); - part.Shape.LightRadius = Util.Clip((float)radius, 0.1f, 20.0f); - part.Shape.LightFalloff = Util.Clip((float)falloff, 0.01f, 2.0f); + pbs.LightEntry = true; + pbs.LightColorR = Util.Clip((float)color.x, 0.0f, 1.0f); + pbs.LightColorG = Util.Clip((float)color.y, 0.0f, 1.0f); + pbs.LightColorB = Util.Clip((float)color.z, 0.0f, 1.0f); + pbs.LightIntensity = Util.Clip((float)intensity, 0.0f, 1.0f); + pbs.LightRadius = Util.Clip((float)radius, 0.1f, 20.0f); + pbs.LightFalloff = Util.Clip((float)falloff, 0.01f, 2.0f); } else { - part.Shape.LightEntry = false; + pbs.LightEntry = false; } part.ParentGroup.HasGroupChanged = true; @@ -11498,10 +11513,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } break; } - case (int)ScriptBaseClass.PRIM_FLEXIBLE: + case ScriptBaseClass.PRIM_FLEXIBLE: PrimitiveBaseShape shape = part.Shape; + // at sl this does not return true state, but if data was set if (shape.FlexiEntry) + // correct check should had been: + //if (shape.PathCurve == (byte)Extrusion.Flexible) res.Add(new LSL_Integer(1)); // active else res.Add(new LSL_Integer(0)); diff --git a/Prebuild/ChangeLog b/Prebuild/ChangeLog index a7d06129a6..f860addc63 100644 --- a/Prebuild/ChangeLog +++ b/Prebuild/ChangeLog @@ -1,4 +1,4 @@ -2017, August Unit Umarov +2017, August Ubit Umarov * add Freak Tech patch for prefer32bit default to false * fix comand line target override * fix CSharp target assembly name