Mesh upload: request inventory fetching of the newly created item

This commit is contained in:
Latif Khalifa
2014-06-27 15:41:47 +02:00
committed by Justin Clark-Casey
parent 1b4cfd959d
commit 941dc830ca
2 changed files with 20 additions and 5 deletions

View File

@@ -603,12 +603,15 @@ namespace OpenMetaverse.ImportExport
ModelFace face = new ModelFace();
face.MaterialID = list.material;
if (MatSymTarget.ContainsKey(list.material))
if (face.MaterialID != null)
{
ModelMaterial mat = Materials.Find(m => m.ID == MatSymTarget[list.material]);
if (mat != null)
if (MatSymTarget.ContainsKey(list.material))
{
face.Material = mat;
ModelMaterial mat = Materials.Find(m => m.ID == MatSymTarget[list.material]);
if (mat != null)
{
face.Material = mat;
}
}
}

View File

@@ -188,7 +188,19 @@ namespace OpenMetaverse.ImportExport
{
var res = (OSDMap)result;
Uri uploader = new Uri(res["uploader"]);
PerformUpload(uploader, callback);
PerformUpload(uploader, (contents =>
{
if (contents != null)
{
var reply = (OSDMap)contents;
if (reply.ContainsKey("new_inventory_item") && reply.ContainsKey("new_asset"))
{
// Request full update on the item in order to update the local store
Client.Inventory.RequestFetchInventory(reply["new_inventory_item"].AsUUID(), Client.Self.AgentID);
}
}
if (callback != null) callback(contents);
}));
}
}));