diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 3b19ec802a..d1a52cbb2d 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -997,18 +997,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments (uint)PermissionMask.Export | (uint)PermissionMask.FoldedMask); // Preserve folded permissions ?? + string name = grp.RootPart.Name; + string desc = grp.RootPart.Description; + AssetBase asset = m_scene.CreateAsset( - grp.GetPartName(grp.LocalId), - grp.GetPartDescription(grp.LocalId), + name, desc, (sbyte)AssetType.Object, Utils.StringToBytes(sceneObjectXml), sp.UUID); + item.Name = name; + item.Description = desc; + item.AssetID = asset.FullID; + item.AssetType = (int)AssetType.Object; + item.InvType = (int)InventoryType.Object; + if (m_invAccessModule != null) m_invAccessModule.UpdateInventoryItemAsset(sp.UUID, item, asset); - // If the name of the object has been changed whilst attached then we want to update the inventory - // item in the viewer. if (sp.ControllingClient != null) sp.ControllingClient.SendInventoryItemCreateUpdate(item, 0); } diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 788ed1c667..8dfe5c1407 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -333,11 +333,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess // "[INVENTORY ACCESS MODULE]: Updating item {0} {1} with new asset {2}", // item.Name, item.ID, asset.ID); - item.AssetID = asset.FullID; - item.Description = asset.Description; - item.Name = asset.Name; - item.AssetType = asset.Type; - item.InvType = (int)InventoryType.Object; m_Scene.AssetService.Store(asset); m_Scene.InventoryService.UpdateItem(item);