aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs71
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs38
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs5
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs3
5 files changed, 110 insertions, 11 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
index 75634e0..ab8f0c9 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
@@ -580,6 +580,7 @@ namespace OpenSim.Region.ClientStack.Linden
580 string error; 580 string error;
581 int modelcost; 581 int modelcost;
582 582
583
583 if (!m_ModelCost.MeshModelCost(llsdRequest.asset_resources, baseCost, out modelcost, 584 if (!m_ModelCost.MeshModelCost(llsdRequest.asset_resources, baseCost, out modelcost,
584 meshcostdata, out error, ref warning)) 585 meshcostdata, out error, ref warning))
585 { 586 {
@@ -797,7 +798,7 @@ namespace OpenSim.Region.ClientStack.Linden
797 OSDMap request = (OSDMap)OSDParser.DeserializeLLSDXml(data); 798 OSDMap request = (OSDMap)OSDParser.DeserializeLLSDXml(data);
798 799
799 // compare and get updated information 800 // compare and get updated information
800 801/* does nothing still we do need something to avoid special viewer to upload something diferent from the cost estimation
801 bool mismatchError = true; 802 bool mismatchError = true;
802 803
803 while (mismatchError) 804 while (mismatchError)
@@ -813,7 +814,7 @@ namespace OpenSim.Region.ClientStack.Linden
813 814
814 return; 815 return;
815 } 816 }
816 817*/
817 OSDArray instance_list = (OSDArray)request["instance_list"]; 818 OSDArray instance_list = (OSDArray)request["instance_list"];
818 OSDArray mesh_list = (OSDArray)request["mesh_list"]; 819 OSDArray mesh_list = (OSDArray)request["mesh_list"];
819 OSDArray texture_list = (OSDArray)request["texture_list"]; 820 OSDArray texture_list = (OSDArray)request["texture_list"];
@@ -827,7 +828,7 @@ namespace OpenSim.Region.ClientStack.Linden
827 List<UUID> textures = new List<UUID>(); 828 List<UUID> textures = new List<UUID>();
828 829
829 830
830 if (doTextInv) 831// if (doTextInv)
831 m_Scene.TryGetClient(m_HostCapsObj.AgentID, out client); 832 m_Scene.TryGetClient(m_HostCapsObj.AgentID, out client);
832 833
833 if(client == null) // don't put textures in inventory if there is no client 834 if(client == null) // don't put textures in inventory if there is no client
@@ -875,14 +876,73 @@ namespace OpenSim.Region.ClientStack.Linden
875 876
876 // create and store meshs assets 877 // create and store meshs assets
877 List<UUID> meshAssets = new List<UUID>(); 878 List<UUID> meshAssets = new List<UUID>();
879 List<bool> meshAvatarSkeletons = new List<bool>();
880 List<bool> meshAvatarColliders = new List<bool>();
881
882 bool curAvSkeleton;
883 bool curAvCollider;
878 for (int i = 0; i < mesh_list.Count; i++) 884 for (int i = 0; i < mesh_list.Count; i++)
879 { 885 {
886 curAvSkeleton = false;
887 curAvCollider = false;
888
889 // we do need to parse the mesh now
890 OSD osd = OSDParser.DeserializeLLSDBinary(mesh_list[i]);
891 if (osd is OSDMap)
892 {
893 OSDMap mosd = (OSDMap)osd;
894 if (mosd.ContainsKey("skeleton"))
895 {
896 OSDMap skeleton = (OSDMap)mosd["skeleton"];
897 int sksize = skeleton["size"].AsInteger();
898 if (sksize > 0)
899 curAvSkeleton = true;
900 }
901 }
902
880 AssetBase meshAsset = new AssetBase(UUID.Random(), assetName, (sbyte)AssetType.Mesh, creatorIDstr); 903 AssetBase meshAsset = new AssetBase(UUID.Random(), assetName, (sbyte)AssetType.Mesh, creatorIDstr);
881 meshAsset.Data = mesh_list[i].AsBinary(); 904 meshAsset.Data = mesh_list[i].AsBinary();
882 if (istest) 905 if (istest)
883 meshAsset.Local = true; 906 meshAsset.Local = true;
884 m_assetService.Store(meshAsset); 907 m_assetService.Store(meshAsset);
885 meshAssets.Add(meshAsset.FullID); 908 meshAssets.Add(meshAsset.FullID);
909 meshAvatarSkeletons.Add(curAvSkeleton);
910 meshAvatarColliders.Add(curAvCollider);
911
912 // test code
913 if (curAvSkeleton && client != null)
914 {
915 string name = assetName;
916 if (name.Length > 25)
917 name = name.Substring(0, 24);
918 name += "_Mesh#" + i.ToString();
919 InventoryItemBase meshitem = new InventoryItemBase();
920 meshitem.Owner = m_HostCapsObj.AgentID;
921 meshitem.CreatorId = creatorIDstr;
922 meshitem.CreatorData = String.Empty;
923 meshitem.ID = UUID.Random();
924 meshitem.AssetID = meshAsset.FullID;
925 meshitem.Description = "mesh ";
926 meshitem.Name = name;
927 meshitem.AssetType = (int)AssetType.Mesh;
928 meshitem.InvType = (int)InventoryType.Mesh;
929 // meshitem.Folder = UUID.Zero; // send to default
930
931 meshitem.Folder = parentFolder; // dont let it go to folder Meshes that viewers dont show
932
933 // If we set PermissionMask.All then when we rez the item the next permissions will replace the current
934 // (owner) permissions. This becomes a problem if next permissions are changed.
935 meshitem.CurrentPermissions
936 = (uint)(PermissionMask.Move | PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer);
937
938 meshitem.BasePermissions = (uint)PermissionMask.All;
939 meshitem.EveryOnePermissions = 0;
940 meshitem.NextPermissions = (uint)PermissionMask.All;
941 meshitem.CreationDate = Util.UnixTimeSinceEpoch();
942
943 m_Scene.AddInventoryItem(client, meshitem);
944 meshitem = null;
945 }
886 } 946 }
887 947
888 int skipedMeshs = 0; 948 int skipedMeshs = 0;
@@ -1540,7 +1600,7 @@ namespace OpenSim.Region.ClientStack.Linden
1540 private int m_nreqmeshs; 1600 private int m_nreqmeshs;
1541 private int m_nreqinstances; 1601 private int m_nreqinstances;
1542 private bool m_IsAtestUpload; 1602 private bool m_IsAtestUpload;
1543 1603
1544 public AssetUploader(string assetName, string description, UUID assetID, UUID inventoryItem, 1604 public AssetUploader(string assetName, string description, UUID assetID, UUID inventoryItem,
1545 UUID parentFolderID, string invType, string assetType, string path, 1605 UUID parentFolderID, string invType, string assetType, string path,
1546 IHttpServer httpServer, bool dumpAssetsToFile, 1606 IHttpServer httpServer, bool dumpAssetsToFile,
@@ -1608,7 +1668,8 @@ namespace OpenSim.Region.ClientStack.Linden
1608 if (handlerUpLoad != null) 1668 if (handlerUpLoad != null)
1609 { 1669 {
1610 handlerUpLoad(m_assetName, m_assetDes, newAssetID, inv, parentFolder, data, m_invType, m_assetType, 1670 handlerUpLoad(m_assetName, m_assetDes, newAssetID, inv, parentFolder, data, m_invType, m_assetType,
1611 m_cost, m_texturesFolder, m_nreqtextures, m_nreqmeshs, m_nreqinstances, m_IsAtestUpload, ref m_error); 1671 m_cost, m_texturesFolder, m_nreqtextures, m_nreqmeshs, m_nreqinstances, m_IsAtestUpload,
1672 ref m_error);
1612 } 1673 }
1613 if (m_IsAtestUpload) 1674 if (m_IsAtestUpload)
1614 { 1675 {
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs
index 4a3fae6..546bcd9 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs
@@ -96,11 +96,15 @@ namespace OpenSim.Region.ClientStack.Linden
96 // basicCost input region assets upload cost 96 // basicCost input region assets upload cost
97 // totalcost returns model total upload fee 97 // totalcost returns model total upload fee
98 // meshcostdata returns detailed costs for viewer 98 // meshcostdata returns detailed costs for viewer
99 public bool MeshModelCost(LLSDAssetResource resources, int basicCost, out int totalcost, 99 // avatarSkeleton if mesh includes a avatar skeleton
100 // useAvatarCollider if we should use physics mesh for avatar
101 public bool MeshModelCost(LLSDAssetResource resources, int basicCost, out int totalcost,
100 LLSDAssetUploadResponseData meshcostdata, out string error, ref string warning) 102 LLSDAssetUploadResponseData meshcostdata, out string error, ref string warning)
101 { 103 {
102 totalcost = 0; 104 totalcost = 0;
103 error = string.Empty; 105 error = string.Empty;
106
107 bool avatarSkeleton = false;
104 108
105 if (resources == null || 109 if (resources == null ||
106 resources.instance_list == null || 110 resources.instance_list == null ||
@@ -145,6 +149,10 @@ namespace OpenSim.Region.ClientStack.Linden
145 float meshsfee = 0; 149 float meshsfee = 0;
146 int numberMeshs = 0; 150 int numberMeshs = 0;
147 bool haveMeshs = false; 151 bool haveMeshs = false;
152
153 bool curskeleton;
154 bool curAvatarPhys;
155
148 List<ameshCostParam> meshsCosts = new List<ameshCostParam>(); 156 List<ameshCostParam> meshsCosts = new List<ameshCostParam>();
149 157
150 if (resources.mesh_list != null && resources.mesh_list.Array.Count > 0) 158 if (resources.mesh_list != null && resources.mesh_list.Array.Count > 0)
@@ -156,10 +164,20 @@ namespace OpenSim.Region.ClientStack.Linden
156 ameshCostParam curCost = new ameshCostParam(); 164 ameshCostParam curCost = new ameshCostParam();
157 byte[] data = (byte[])resources.mesh_list.Array[i]; 165 byte[] data = (byte[])resources.mesh_list.Array[i];
158 166
159 if (!MeshCost(data, curCost, out error)) 167 if (!MeshCost(data, curCost,out curskeleton, out curAvatarPhys, out error))
160 { 168 {
161 return false; 169 return false;
162 } 170 }
171
172 if (curskeleton)
173 {
174 if (avatarSkeleton)
175 {
176 error = "model can only contain a avatar skeleton";
177 return false;
178 }
179 avatarSkeleton = true;
180 }
163 meshsCosts.Add(curCost); 181 meshsCosts.Add(curCost);
164 meshsfee += curCost.costFee; 182 meshsfee += curCost.costFee;
165 } 183 }
@@ -273,7 +291,7 @@ namespace OpenSim.Region.ClientStack.Linden
273 } 291 }
274 292
275 // single mesh asset cost 293 // single mesh asset cost
276 private bool MeshCost(byte[] data, ameshCostParam cost, out string error) 294 private bool MeshCost(byte[] data, ameshCostParam cost,out bool skeleton, out bool avatarPhys, out string error)
277 { 295 {
278 cost.highLODSize = 0; 296 cost.highLODSize = 0;
279 cost.medLODSize = 0; 297 cost.medLODSize = 0;
@@ -284,6 +302,9 @@ namespace OpenSim.Region.ClientStack.Linden
284 302
285 error = string.Empty; 303 error = string.Empty;
286 304
305 skeleton = false;
306 avatarPhys = false;
307
287 if (data == null || data.Length == 0) 308 if (data == null || data.Length == 0)
288 { 309 {
289 error = "Missing model information."; 310 error = "Missing model information.";
@@ -330,6 +351,17 @@ namespace OpenSim.Region.ClientStack.Linden
330 351
331 int submesh_offset = -1; 352 int submesh_offset = -1;
332 353
354 if (map.ContainsKey("skeleton"))
355 {
356 tmpmap = (OSDMap)map["skeleton"];
357 if (tmpmap.ContainsKey("offset") && tmpmap.ContainsKey("size"))
358 {
359 int sksize = tmpmap["size"].AsInteger();
360 if(sksize > 0)
361 skeleton = true;
362 }
363 }
364
333 if (map.ContainsKey("physics_convex")) 365 if (map.ContainsKey("physics_convex"))
334 { 366 {
335 tmpmap = (OSDMap)map["physics_convex"]; 367 tmpmap = (OSDMap)map["physics_convex"];
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs
index e4d8a20..7c22a7c 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs
@@ -131,8 +131,11 @@ namespace OpenSim.Region.ClientStack.Linden
131 m_features["MeshRezEnabled"] = true; 131 m_features["MeshRezEnabled"] = true;
132 m_features["MeshUploadEnabled"] = true; 132 m_features["MeshUploadEnabled"] = true;
133 m_features["MeshXferEnabled"] = true; 133 m_features["MeshXferEnabled"] = true;
134 m_features["AvatarSkeleton"] = true;
135 m_features["AnimationSet"] = true;
136
134 m_features["PhysicsMaterialsEnabled"] = true; 137 m_features["PhysicsMaterialsEnabled"] = true;
135 138
136 OSDMap typesMap = new OSDMap(); 139 OSDMap typesMap = new OSDMap();
137 typesMap["convex"] = true; 140 typesMap["convex"] = true;
138 typesMap["none"] = true; 141 typesMap["none"] = true;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index 46b2d2e..931093a 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -291,6 +291,10 @@ namespace OpenSim.Region.Framework.Scenes
291 EventManager.TriggerParcelPrimCountTainted(); 291 EventManager.TriggerParcelPrimCountTainted();
292 } 292 }
293 293
294 // restore targetOmega
295 if (part.AngularVelocity != Vector3.Zero)
296 part.ScheduleTerseUpdate();
297
294 } 298 }
295 299
296 public virtual void ProcessMoneyTransferRequest(UUID source, UUID destination, int amount, 300 public virtual void ProcessMoneyTransferRequest(UUID source, UUID destination, int amount,
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 3fc741c..d5377d0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -666,8 +666,7 @@ namespace OpenSim.Region.Framework.Scenes
666 m_isSelected = value; 666 m_isSelected = value;
667 if (ParentGroup != null) 667 if (ParentGroup != null)
668 ParentGroup.PartSelectChanged(value); 668 ParentGroup.PartSelectChanged(value);
669 if (!m_isSelected && m_angularVelocity != Vector3.Zero) 669
670 ScheduleTerseUpdate();
671 } 670 }
672 } 671 }
673 672