public TextureEntry( string name, bool isLocal, BakedTextureIndex bakedTextureIndex = BakedTextureIndex.NumIndices, string defaultImageName = "", WearableType wearableType = WearableType.Invalid) { IsLocal = isLocal; IsBaked = !isLocal; IsUsedByBakedTexture = bakedTextureIndex != BakedTextureIndex.NumIndices; BakedTextureIndex = bakedTextureIndex; DefaultImageName = defaultImageName; WearableType = wearableType; }
/// <summary> /// Baked textures are composites of textures; for each such composited texture, /// map it to the baked texture. /// </summary> protected void CreateAssociations() { foreach (KeyValuePair <BakedTextureIndex, BakedEntry> keyValuePair in BakedTextures) { BakedTextureIndex bakedIndex = keyValuePair.Key; BakedEntry bakedEntry = keyValuePair.Value; // For each texture that this baked texture index affects, associate those textures // with this baked texture index. foreach (TextureIndex textureIndex in bakedEntry.LocalTextures) { Textures[textureIndex].IsUsedByBakedTexture = true; Textures[textureIndex].BakedTextureIndex = bakedIndex; } } }
/// <summary> /// Convert from baked texture to associated texture; e.g. BAKED_HEAD -> TEX_HEAD_BAKED /// </summary> /// <param name="index"></param> public static TextureIndex BakedToLocalTextureIndex(BakedTextureIndex index) { return(Instance.BakedTextures[index].TextureIndex); }
/// <summary> /// /// </summary> /// <param name="bakedTextureIndex"></param> /// <param name="name">Name of mesh type as they are used in avatar_lad.xml</param> /// <param name="lod"></param> public MeshEntry(BakedTextureIndex bakedTextureIndex, string name, byte lod) { BakedTextureIndex = bakedTextureIndex; Name = name; Lod = lod; }