***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..
parent
fd20ef5c91
commit
e8ba26eac8
|
@ -583,24 +583,24 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
|
|
||||||
if (inventoryType == "sound")
|
if (inventoryType == "sound")
|
||||||
{
|
{
|
||||||
inType = 1;
|
inType = (sbyte)InventoryType.Sound;
|
||||||
assType = 1;
|
assType = (sbyte)AssetType.Sound;
|
||||||
}
|
}
|
||||||
else if (inventoryType == "animation")
|
else if (inventoryType == "animation")
|
||||||
{
|
{
|
||||||
inType = 19;
|
inType = (sbyte)InventoryType.Animation;
|
||||||
assType = 20;
|
assType = (sbyte)AssetType.Animation;
|
||||||
}
|
}
|
||||||
else if (inventoryType == "wearable")
|
else if (inventoryType == "wearable")
|
||||||
{
|
{
|
||||||
inType = 18;
|
inType = (sbyte)InventoryType.Wearable;
|
||||||
switch (assetType)
|
switch (assetType)
|
||||||
{
|
{
|
||||||
case "bodypart":
|
case "bodypart":
|
||||||
assType = 13;
|
assType = (sbyte)AssetType.Bodypart;
|
||||||
break;
|
break;
|
||||||
case "clothing":
|
case "clothing":
|
||||||
assType = 5;
|
assType = (sbyte)AssetType.Clothing;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -625,7 +625,42 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
textureAsset.Data = texture_list[i].AsBinary();
|
textureAsset.Data = texture_list[i].AsBinary();
|
||||||
m_assetService.Store(textureAsset);
|
m_assetService.Store(textureAsset);
|
||||||
textures.Add(textureAsset.FullID);
|
textures.Add(textureAsset.FullID);
|
||||||
|
|
||||||
|
// save it to inventory
|
||||||
|
if (AddNewInventoryItem != null)
|
||||||
|
{
|
||||||
|
string name = assetName;
|
||||||
|
if (name.Length > 25)
|
||||||
|
name = name.Substring(0, 24);
|
||||||
|
name += "_Texture#" + i.ToString();
|
||||||
|
InventoryItemBase texitem = new InventoryItemBase();
|
||||||
|
texitem.Owner = m_HostCapsObj.AgentID;
|
||||||
|
texitem.CreatorId = m_HostCapsObj.AgentID.ToString();
|
||||||
|
texitem.CreatorData = String.Empty;
|
||||||
|
texitem.ID = UUID.Random();
|
||||||
|
texitem.AssetID = textureAsset.FullID;
|
||||||
|
texitem.Description = "mesh model texture";
|
||||||
|
texitem.Name = name;
|
||||||
|
texitem.AssetType = (int)AssetType.Texture;
|
||||||
|
texitem.InvType = (int)InventoryType.Texture;
|
||||||
|
texitem.Folder = UUID.Zero; // send to default
|
||||||
|
|
||||||
|
// If we set PermissionMask.All then when we rez the item the next permissions will replace the current
|
||||||
|
// (owner) permissions. This becomes a problem if next permissions are changed.
|
||||||
|
texitem.CurrentPermissions
|
||||||
|
= (uint)(PermissionMask.Move | PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer);
|
||||||
|
|
||||||
|
texitem.BasePermissions = (uint)PermissionMask.All;
|
||||||
|
texitem.EveryOnePermissions = 0;
|
||||||
|
texitem.NextPermissions = (uint)PermissionMask.All;
|
||||||
|
texitem.CreationDate = Util.UnixTimeSinceEpoch();
|
||||||
|
|
||||||
|
AddNewInventoryItem(m_HostCapsObj.AgentID, texitem, 0);
|
||||||
|
texitem = null;
|
||||||
|
}
|
||||||
|
|
||||||
textureAsset = null;
|
textureAsset = null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// create and store meshs assets
|
// create and store meshs assets
|
||||||
|
@ -636,6 +671,40 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||||
meshAsset.Data = mesh_list[i].AsBinary();
|
meshAsset.Data = mesh_list[i].AsBinary();
|
||||||
m_assetService.Store(meshAsset);
|
m_assetService.Store(meshAsset);
|
||||||
meshAssets.Add(meshAsset.FullID);
|
meshAssets.Add(meshAsset.FullID);
|
||||||
|
|
||||||
|
// save it to inventory
|
||||||
|
if (AddNewInventoryItem != null)
|
||||||
|
{
|
||||||
|
string name = assetName;
|
||||||
|
if (name.Length > 25)
|
||||||
|
name = name.Substring(0, 24);
|
||||||
|
name += "_Mesh#" + i.ToString();
|
||||||
|
InventoryItemBase meshitem = new InventoryItemBase();
|
||||||
|
meshitem.Owner = m_HostCapsObj.AgentID;
|
||||||
|
meshitem.CreatorId = m_HostCapsObj.AgentID.ToString();
|
||||||
|
meshitem.CreatorData = String.Empty;
|
||||||
|
meshitem.ID = UUID.Random();
|
||||||
|
meshitem.AssetID = meshAsset.FullID;
|
||||||
|
meshitem.Description = "mesh ";
|
||||||
|
meshitem.Name = name;
|
||||||
|
meshitem.AssetType = (int)AssetType.Mesh;
|
||||||
|
meshitem.InvType = (int)InventoryType.Mesh;
|
||||||
|
meshitem.Folder = UUID.Zero; // send to default
|
||||||
|
|
||||||
|
// If we set PermissionMask.All then when we rez the item the next permissions will replace the current
|
||||||
|
// (owner) permissions. This becomes a problem if next permissions are changed.
|
||||||
|
meshitem.CurrentPermissions
|
||||||
|
= (uint)(PermissionMask.Move | PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer);
|
||||||
|
|
||||||
|
meshitem.BasePermissions = (uint)PermissionMask.All;
|
||||||
|
meshitem.EveryOnePermissions = 0;
|
||||||
|
meshitem.NextPermissions = (uint)PermissionMask.All;
|
||||||
|
meshitem.CreationDate = Util.UnixTimeSinceEpoch();
|
||||||
|
|
||||||
|
AddNewInventoryItem(m_HostCapsObj.AgentID, meshitem, 0);
|
||||||
|
meshitem = null;
|
||||||
|
}
|
||||||
|
|
||||||
meshAsset = null;
|
meshAsset = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue