/// <summary> /// Gets all the texture names attached to the model. /// </summary> public static ICollection <TextureUsage> GetTextures(this ModelMeshPart part) { ModelMeshPartTag extensions = part.Tag as ModelMeshPartTag; if (extensions != null && extensions.Textures != null) { return(extensions.Textures.Keys); } return(EmptyTextureNamesCollection); }
/// <summary> /// Gets the texture attached to the model with the specified name. /// </summary> public static Texture GetTexture(this ModelMeshPart part, TextureUsage usage) { Texture result; ModelMeshPartTag extensions = part.Tag as ModelMeshPartTag; if (extensions != null && extensions.Textures != null && extensions.Textures.TryGetValue(usage, out result)) { return(result); } return(null); }