diff --git a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs index f8cbc5e970..101247022c 100755 --- a/OpenSim/Data/PGSQL/PGSQLSimulationData.cs +++ b/OpenSim/Data/PGSQL/PGSQLSimulationData.cs @@ -355,7 +355,7 @@ namespace OpenSim.Data.PGSQL ""ClickAction"" = :ClickAction, ""Material"" = :Material, ""CollisionSound"" = :CollisionSound, ""CollisionSoundVolume"" = :CollisionSoundVolume, ""PassTouches"" = :PassTouches, ""LinkNumber"" = :LinkNumber, ""MediaURL"" = :MediaURL, ""DynAttrs"" = :DynAttrs, ""Vehicle"" = :Vehicle, ""PhysInertia"" = :PhysInertia, ""standtargetx"" =:standtargetx, ""standtargety"" =:standtargety, ""standtargetz"" =:standtargetz, - ""sitactrange"" =:sitactrange, ""pseudocrc"" = :pseudocrc + ""sitactrange"" =:sitactrange, ""pseudocrc"" = :pseudocrc, ""sopanims"" = :sopanims WHERE ""UUID"" = :UUID ; @@ -371,7 +371,7 @@ namespace OpenSim.Data.PGSQL ""ForceMouselook"", ""ScriptAccessPin"", ""AllowedDrop"", ""DieAtEdge"", ""SalePrice"", ""SaleType"", ""ColorR"", ""ColorG"", ""ColorB"", ""ColorA"", ""ParticleSystem"", ""ClickAction"", ""Material"", ""CollisionSound"", ""CollisionSoundVolume"", ""PassTouches"", ""LinkNumber"", ""MediaURL"", ""DynAttrs"", ""PhysicsShapeType"", ""Density"", ""GravityModifier"", ""Friction"", ""Restitution"", ""PassCollisions"", ""RotationAxisLocks"", ""RezzerID"" , ""Vehicle"", ""PhysInertia"", - ""standtargetx"", ""standtargety"", ""standtargetz"", ""sitactrange"", ""pseudocrc"" + ""standtargetx"", ""standtargety"", ""standtargetz"", ""sitactrange"", ""pseudocrc"",""sopanims"" ) Select :UUID, :CreationDate, :Name, :Text, :Description, :SitName, :TouchName, :ObjectFlags, :OwnerMask, :NextOwnerMask, :GroupMask, :EveryoneMask, :BaseMask, :PositionX, :PositionY, :PositionZ, :GroupPositionX, :GroupPositionY, :GroupPositionZ, :VelocityX, @@ -383,7 +383,7 @@ namespace OpenSim.Data.PGSQL :ForceMouselook, :ScriptAccessPin, :AllowedDrop, :DieAtEdge, :SalePrice, :SaleType, :ColorR, :ColorG, :ColorB, :ColorA, :ParticleSystem, :ClickAction, :Material, :CollisionSound, :CollisionSoundVolume, :PassTouches, :LinkNumber, :MediaURL, :DynAttrs, :PhysicsShapeType, :Density, :GravityModifier, :Friction, :Restitution, :PassCollisions, :RotationAxisLocks, :RezzerID, :Vehicle, :PhysInertia, - :standtargetx, :standtargety, :standtargetz,:sitactrange, :pseudocrc + :standtargetx, :standtargety, :standtargetz,:sitactrange, :pseudocrc, :sopanims where not EXISTS (SELECT ""UUID"" FROM prims WHERE ""UUID"" = :UUID); "; @@ -414,19 +414,19 @@ namespace OpenSim.Data.PGSQL ""PathSkew"" = :PathSkew, ""PathCurve"" = :PathCurve, ""PathRadiusOffset"" = :PathRadiusOffset, ""PathRevolutions"" = :PathRevolutions, ""PathTaperX"" = :PathTaperX, ""PathTaperY"" = :PathTaperY, ""PathTwist"" = :PathTwist, ""PathTwistBegin"" = :PathTwistBegin, ""ProfileBegin"" = :ProfileBegin, ""ProfileEnd"" = :ProfileEnd, ""ProfileCurve"" = :ProfileCurve, ""ProfileHollow"" = :ProfileHollow, - ""Texture"" = :Texture, ""ExtraParams"" = :ExtraParams, ""State"" = :State, ""Media"" = :Media + ""Texture"" = :Texture, ""ExtraParams"" = :ExtraParams, ""State"" = :State, ""Media"" = :Media, ""MatOvrd"" = :MatOvrd WHERE ""UUID"" = :UUID ; INSERT INTO primshapes ( ""UUID"", ""Shape"", ""ScaleX"", ""ScaleY"", ""ScaleZ"", ""PCode"", ""PathBegin"", ""PathEnd"", ""PathScaleX"", ""PathScaleY"", ""PathShearX"", ""PathShearY"", ""PathSkew"", ""PathCurve"", ""PathRadiusOffset"", ""PathRevolutions"", ""PathTaperX"", ""PathTaperY"", ""PathTwist"", ""PathTwistBegin"", ""ProfileBegin"", - ""ProfileEnd"", ""ProfileCurve"", ""ProfileHollow"", ""Texture"", ""ExtraParams"", ""State"", ""Media"" + ""ProfileEnd"", ""ProfileCurve"", ""ProfileHollow"", ""Texture"", ""ExtraParams"", ""State"", ""Media"", ""MatOvrd"" ) Select :UUID, :Shape, :ScaleX, :ScaleY, :ScaleZ, :PCode, :PathBegin, :PathEnd, :PathScaleX, :PathScaleY, :PathShearX, :PathShearY, :PathSkew, :PathCurve, :PathRadiusOffset, :PathRevolutions, :PathTaperX, :PathTaperY, :PathTwist, :PathTwistBegin, :ProfileBegin, - :ProfileEnd, :ProfileCurve, :ProfileHollow, :Texture, :ExtraParams, :State, :Media + :ProfileEnd, :ProfileCurve, :ProfileHollow, :Texture, :ExtraParams, :State, :Media, :MatOvrd where not EXISTS (SELECT ""UUID"" FROM primshapes WHERE ""UUID"" = :UUID); "; @@ -1397,6 +1397,19 @@ namespace OpenSim.Data.PGSQL if(pseudocrc != 0) prim.PseudoCRC = pseudocrc; + if (primRow["sopanims"] is not DBNull) + { + byte[] data = (byte[])primRow["sopanims"]; + if (data.Length > 0) + prim.DeSerializeAnimations(data); + else + prim.Animations = null; + } + else + { + prim.Animations = null; + } + return prim; } @@ -1449,11 +1462,16 @@ namespace OpenSim.Data.PGSQL { } - if (!(shapeRow["Media"] is System.DBNull)) + if (shapeRow["Media"] is not System.DBNull) { baseShape.Media = PrimitiveBaseShape.MediaList.FromXml((string)shapeRow["Media"]); } + if (shapeRow["MatOvrd"] is not System.DBNull) + baseShape.RenderMaterialsOvrFromRawBin((byte[])shapeRow["MatOvrd"]); + else + baseShape.RenderMaterialsOvrFromRawBin(null); + return baseShape; } @@ -1856,6 +1874,11 @@ namespace OpenSim.Data.PGSQL parameters.Add(_Database.CreateParameter("pseudocrc", prim.PseudoCRC)); + if (prim.Animations != null) + parameters.Add(_Database.CreateParameter("sopanims", prim.SerializeAnimations())); + else + parameters.Add(_Database.CreateParameter("sopanims", null)); + return parameters.ToArray(); } @@ -1912,6 +1935,9 @@ namespace OpenSim.Data.PGSQL parameters.Add(_Database.CreateParameter("Media", s.Media.ToXml())); } + byte[] matovrdata = s.RenderMaterialsOvrToRawBin(); + parameters.Add(_Database.CreateParameter("MatOvrd", matovrdata)); + return parameters.ToArray(); } diff --git a/OpenSim/Data/PGSQL/Resources/RegionStore.migrations b/OpenSim/Data/PGSQL/Resources/RegionStore.migrations index e267345420..1def32ef1f 100644 --- a/OpenSim/Data/PGSQL/Resources/RegionStore.migrations +++ b/OpenSim/Data/PGSQL/Resources/RegionStore.migrations @@ -1254,4 +1254,10 @@ COMMIT; :VERSION 51 #----- parcel environment store BEGIN; ALTER TABLE `land` ADD COLUMN `environment` varchar default NULL; -COMMIT; \ No newline at end of file +COMMIT; + +:VERSION 52 ##----- sop animations and materials +BEGIN; +ALTER TABLE `prims` ADD COLUMN `sopanims` bytea NULL; +ALTER TABLE `primshapes` ADD COLUMN `MatOvrd` bytea NULL; +COMMIT;