diff options
author | UbitUmarov | 2012-09-17 21:15:07 +0100 |
---|---|---|
committer | UbitUmarov | 2012-09-17 21:15:07 +0100 |
commit | c1eec3b82818f91f66580cecc32c2ac9a9d2d968 (patch) | |
tree | e1f33c8c9a5c64af04cf16ca50f39ed0b3241519 /OpenSim/Region | |
parent | make sure client still has money at upload (diff) | |
download | opensim-SC-c1eec3b82818f91f66580cecc32c2ac9a9d2d968.zip opensim-SC-c1eec3b82818f91f66580cecc32c2ac9a9d2d968.tar.gz opensim-SC-c1eec3b82818f91f66580cecc32c2ac9a9d2d968.tar.bz2 opensim-SC-c1eec3b82818f91f66580cecc32c2ac9a9d2d968.tar.xz |
on upload store mesh list contents as mesh assets. Build prims by instances not
meshs. (some prims can have same mesh)
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index 4ba8254..ace188c 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | |||
@@ -617,6 +617,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
617 | OSDArray texture_list = (OSDArray)request["texture_list"]; | 617 | OSDArray texture_list = (OSDArray)request["texture_list"]; |
618 | SceneObjectGroup grp = null; | 618 | SceneObjectGroup grp = null; |
619 | 619 | ||
620 | // create and store texture assets | ||
620 | List<UUID> textures = new List<UUID>(); | 621 | List<UUID> textures = new List<UUID>(); |
621 | for (int i = 0; i < texture_list.Count; i++) | 622 | for (int i = 0; i < texture_list.Count; i++) |
622 | { | 623 | { |
@@ -624,14 +625,28 @@ namespace OpenSim.Region.ClientStack.Linden | |||
624 | textureAsset.Data = texture_list[i].AsBinary(); | 625 | textureAsset.Data = texture_list[i].AsBinary(); |
625 | m_assetService.Store(textureAsset); | 626 | m_assetService.Store(textureAsset); |
626 | textures.Add(textureAsset.FullID); | 627 | textures.Add(textureAsset.FullID); |
628 | textureAsset = null; | ||
627 | } | 629 | } |
628 | 630 | ||
631 | // create and store meshs assets | ||
632 | List<UUID> meshAssets = new List<UUID>(); | ||
629 | for (int i = 0; i < mesh_list.Count; i++) | 633 | for (int i = 0; i < mesh_list.Count; i++) |
630 | { | 634 | { |
635 | AssetBase meshAsset = new AssetBase(UUID.Random(), assetName, (sbyte)AssetType.Mesh, ""); | ||
636 | meshAsset.Data = mesh_list[i].AsBinary(); | ||
637 | m_assetService.Store(meshAsset); | ||
638 | meshAssets.Add(meshAsset.FullID); | ||
639 | meshAsset = null; | ||
640 | } | ||
641 | |||
642 | // build prims from instances | ||
643 | for (int i = 0; i < instance_list.Count; i++) | ||
644 | { | ||
631 | PrimitiveBaseShape pbs = PrimitiveBaseShape.CreateBox(); | 645 | PrimitiveBaseShape pbs = PrimitiveBaseShape.CreateBox(); |
632 | 646 | ||
633 | Primitive.TextureEntry textureEntry | 647 | Primitive.TextureEntry textureEntry |
634 | = new Primitive.TextureEntry(Primitive.TextureEntry.WHITE_TEXTURE); | 648 | = new Primitive.TextureEntry(Primitive.TextureEntry.WHITE_TEXTURE); |
649 | |||
635 | OSDMap inner_instance_list = (OSDMap)instance_list[i]; | 650 | OSDMap inner_instance_list = (OSDMap)instance_list[i]; |
636 | 651 | ||
637 | OSDArray face_list = (OSDArray)inner_instance_list["face_list"]; | 652 | OSDArray face_list = (OSDArray)inner_instance_list["face_list"]; |
@@ -676,14 +691,14 @@ namespace OpenSim.Region.ClientStack.Linden | |||
676 | 691 | ||
677 | pbs.TextureEntry = textureEntry.GetBytes(); | 692 | pbs.TextureEntry = textureEntry.GetBytes(); |
678 | 693 | ||
679 | AssetBase meshAsset = new AssetBase(UUID.Random(), assetName, (sbyte)AssetType.Mesh, ""); | 694 | int meshindx = inner_instance_list["mesh"].AsInteger(); |
680 | meshAsset.Data = mesh_list[i].AsBinary(); | 695 | if (meshAssets.Count > meshindx) |
681 | m_assetService.Store(meshAsset); | 696 | { |
682 | 697 | pbs.SculptEntry = true; | |
683 | pbs.SculptEntry = true; | 698 | pbs.SculptType = (byte)SculptType.Mesh; |
684 | pbs.SculptTexture = meshAsset.FullID; | 699 | pbs.SculptTexture = meshAssets[meshindx]; // actual asset UUID after meshs suport introduction |
685 | pbs.SculptType = (byte)SculptType.Mesh; | 700 | // data will be requested from asset on rez (i hope) |
686 | pbs.SculptData = meshAsset.Data; | 701 | } |
687 | 702 | ||
688 | Vector3 position = inner_instance_list["position"].AsVector3(); | 703 | Vector3 position = inner_instance_list["position"].AsVector3(); |
689 | Vector3 scale = inner_instance_list["scale"].AsVector3(); | 704 | Vector3 scale = inner_instance_list["scale"].AsVector3(); |