Пример #1
0
        public static WearableCacheItem[] BakedFromOSD(OSD pInput)
        {
            WearableCacheItem[] pcache = WearableCacheItem.GetDefaultCacheItem();

            if (pInput.Type == OSDType.Array)
            {
                OSDArray itemarray = (OSDArray)pInput;
                foreach (OSDMap item in itemarray)
                {
                    int idx = (int)item["textureindex"].AsUInteger();
                    if (idx < 0 || idx > pcache.Length)
                    {
                        continue;
                    }
                    pcache[idx].CacheId   = item["cacheid"].AsUUID();
                    pcache[idx].TextureID = item["textureid"].AsUUID();

/*
 *                  if (item.ContainsKey("assetdata"))
 *                  {
 *                      AssetBase asset = new AssetBase(item["textureid"].AsUUID(), "BakedTexture", (sbyte)AssetType.Texture, UUID.Zero.ToString());
 *                      asset.Temporary = true;
 *                      asset.Local = true;
 *                      asset.Data = item["assetdata"].AsBinary();
 *                      pcache[idx].TextureAsset = asset;
 *                  }
 *                  else
 */
                    pcache[idx].TextureAsset = null;
                }
            }
            return(pcache);
        }
Пример #2
0
 public static WearableCacheItem[] BakedFromOSD(OSD pInput)
 {
     WearableCacheItem[] pcache = WearableCacheItem.GetDefaultCacheItem();
     if (pInput.Type == OSDType.Array)
     {
         OSDArray itemarray = (OSDArray)pInput;
         foreach (OSDMap item in itemarray)
         {
             int idx = item["textureindex"].AsInteger();
             if (idx < 0 || idx >= pcache.Length)
             {
                 continue;
             }
             pcache[idx].CacheId      = item["cacheid"].AsUUID();
             pcache[idx].TextureID    = item["textureid"].AsUUID();
             pcache[idx].TextureAsset = null;
         }
     }
     return(pcache);
 }