diff options
author | UbitUmarov | 2012-09-18 01:07:44 +0100 |
---|---|---|
committer | UbitUmarov | 2012-09-18 01:07:44 +0100 |
commit | e8ba26eac8fdc438ffb72391d00c852ec1fc9950 (patch) | |
tree | 2e7365c0776c0a0c50aa10a90601bd224c8891a4 /OpenSim/Region/ClientStack/Linden/Caps | |
parent | add some locks to GetTextureModule (diff) | |
download | opensim-SC_OLD-e8ba26eac8fdc438ffb72391d00c852ec1fc9950.zip opensim-SC_OLD-e8ba26eac8fdc438ffb72391d00c852ec1fc9950.tar.gz opensim-SC_OLD-e8ba26eac8fdc438ffb72391d00c852ec1fc9950.tar.bz2 opensim-SC_OLD-e8ba26eac8fdc438ffb72391d00c852ec1fc9950.tar.xz |
***TEST*** still bad... create inventory itens for model textures and meshs. Issues: meshs get into root folder, viewer and viewer does not update inventory until relog ( the upload funtion needs to return more information) ,etc. Droping a mesh into a prim, makes viewer think we dropped a sculpt map, but it does work, viewer displays the mesh and physics work (as physics is stored at the sculpt information fields). Textures show up in Textures folder, just its to costly to find that default folder as is..
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 83 |
1 files changed, 76 insertions, 7 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index ace188c..3789ee9 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | |||
@@ -583,24 +583,24 @@ namespace OpenSim.Region.ClientStack.Linden | |||
583 | 583 | ||
584 | if (inventoryType == "sound") | 584 | if (inventoryType == "sound") |
585 | { | 585 | { |
586 | inType = 1; | 586 | inType = (sbyte)InventoryType.Sound; |
587 | assType = 1; | 587 | assType = (sbyte)AssetType.Sound; |
588 | } | 588 | } |
589 | else if (inventoryType == "animation") | 589 | else if (inventoryType == "animation") |
590 | { | 590 | { |
591 | inType = 19; | 591 | inType = (sbyte)InventoryType.Animation; |
592 | assType = 20; | 592 | assType = (sbyte)AssetType.Animation; |
593 | } | 593 | } |
594 | else if (inventoryType == "wearable") | 594 | else if (inventoryType == "wearable") |
595 | { | 595 | { |
596 | inType = 18; | 596 | inType = (sbyte)InventoryType.Wearable; |
597 | switch (assetType) | 597 | switch (assetType) |
598 | { | 598 | { |
599 | case "bodypart": | 599 | case "bodypart": |
600 | assType = 13; | 600 | assType = (sbyte)AssetType.Bodypart; |
601 | break; | 601 | break; |
602 | case "clothing": | 602 | case "clothing": |
603 | assType = 5; | 603 | assType = (sbyte)AssetType.Clothing; |
604 | break; | 604 | break; |
605 | } | 605 | } |
606 | } | 606 | } |
@@ -625,7 +625,42 @@ namespace OpenSim.Region.ClientStack.Linden | |||
625 | textureAsset.Data = texture_list[i].AsBinary(); | 625 | textureAsset.Data = texture_list[i].AsBinary(); |
626 | m_assetService.Store(textureAsset); | 626 | m_assetService.Store(textureAsset); |
627 | textures.Add(textureAsset.FullID); | 627 | textures.Add(textureAsset.FullID); |
628 | |||
629 | // save it to inventory | ||
630 | if (AddNewInventoryItem != null) | ||
631 | { | ||
632 | string name = assetName; | ||
633 | if (name.Length > 25) | ||
634 | name = name.Substring(0, 24); | ||
635 | name += "_Texture#" + i.ToString(); | ||
636 | InventoryItemBase texitem = new InventoryItemBase(); | ||
637 | texitem.Owner = m_HostCapsObj.AgentID; | ||
638 | texitem.CreatorId = m_HostCapsObj.AgentID.ToString(); | ||
639 | texitem.CreatorData = String.Empty; | ||
640 | texitem.ID = UUID.Random(); | ||
641 | texitem.AssetID = textureAsset.FullID; | ||
642 | texitem.Description = "mesh model texture"; | ||
643 | texitem.Name = name; | ||
644 | texitem.AssetType = (int)AssetType.Texture; | ||
645 | texitem.InvType = (int)InventoryType.Texture; | ||
646 | texitem.Folder = UUID.Zero; // send to default | ||
647 | |||
648 | // If we set PermissionMask.All then when we rez the item the next permissions will replace the current | ||
649 | // (owner) permissions. This becomes a problem if next permissions are changed. | ||
650 | texitem.CurrentPermissions | ||
651 | = (uint)(PermissionMask.Move | PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer); | ||
652 | |||
653 | texitem.BasePermissions = (uint)PermissionMask.All; | ||
654 | texitem.EveryOnePermissions = 0; | ||
655 | texitem.NextPermissions = (uint)PermissionMask.All; | ||
656 | texitem.CreationDate = Util.UnixTimeSinceEpoch(); | ||
657 | |||
658 | AddNewInventoryItem(m_HostCapsObj.AgentID, texitem, 0); | ||
659 | texitem = null; | ||
660 | } | ||
661 | |||
628 | textureAsset = null; | 662 | textureAsset = null; |
663 | |||
629 | } | 664 | } |
630 | 665 | ||
631 | // create and store meshs assets | 666 | // create and store meshs assets |
@@ -636,6 +671,40 @@ namespace OpenSim.Region.ClientStack.Linden | |||
636 | meshAsset.Data = mesh_list[i].AsBinary(); | 671 | meshAsset.Data = mesh_list[i].AsBinary(); |
637 | m_assetService.Store(meshAsset); | 672 | m_assetService.Store(meshAsset); |
638 | meshAssets.Add(meshAsset.FullID); | 673 | meshAssets.Add(meshAsset.FullID); |
674 | |||
675 | // save it to inventory | ||
676 | if (AddNewInventoryItem != null) | ||
677 | { | ||
678 | string name = assetName; | ||
679 | if (name.Length > 25) | ||
680 | name = name.Substring(0, 24); | ||
681 | name += "_Mesh#" + i.ToString(); | ||
682 | InventoryItemBase meshitem = new InventoryItemBase(); | ||
683 | meshitem.Owner = m_HostCapsObj.AgentID; | ||
684 | meshitem.CreatorId = m_HostCapsObj.AgentID.ToString(); | ||
685 | meshitem.CreatorData = String.Empty; | ||
686 | meshitem.ID = UUID.Random(); | ||
687 | meshitem.AssetID = meshAsset.FullID; | ||
688 | meshitem.Description = "mesh "; | ||
689 | meshitem.Name = name; | ||
690 | meshitem.AssetType = (int)AssetType.Mesh; | ||
691 | meshitem.InvType = (int)InventoryType.Mesh; | ||
692 | meshitem.Folder = UUID.Zero; // send to default | ||
693 | |||
694 | // If we set PermissionMask.All then when we rez the item the next permissions will replace the current | ||
695 | // (owner) permissions. This becomes a problem if next permissions are changed. | ||
696 | meshitem.CurrentPermissions | ||
697 | = (uint)(PermissionMask.Move | PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer); | ||
698 | |||
699 | meshitem.BasePermissions = (uint)PermissionMask.All; | ||
700 | meshitem.EveryOnePermissions = 0; | ||
701 | meshitem.NextPermissions = (uint)PermissionMask.All; | ||
702 | meshitem.CreationDate = Util.UnixTimeSinceEpoch(); | ||
703 | |||
704 | AddNewInventoryItem(m_HostCapsObj.AgentID, meshitem, 0); | ||
705 | meshitem = null; | ||
706 | } | ||
707 | |||
639 | meshAsset = null; | 708 | meshAsset = null; |
640 | } | 709 | } |
641 | 710 | ||