public static TextureEntryFace FromOSD(OSD osd, TextureEntryFace defaultFace, out int faceNumber)
{
OSDMap map = (OSDMap)osd;
TextureEntryFace face = new TextureEntryFace(defaultFace);
faceNumber = (map.ContainsKey("face_number")) ? map["face_number"].AsInteger() : -1;
Color4 rgba = face.RGBA;
rgba = ((OSDArray)map["colors"]).AsColor4();
face.RGBA = rgba;
face.RepeatU = (float)map["scales"].AsReal();
face.RepeatV = (float)map["scalet"].AsReal();
face.OffsetU = (float)map["offsets"].AsReal();
face.OffsetV = (float)map["offsett"].AsReal();
face.Rotation = (float)map["imagerot"].AsReal();
face.Bump = (Bumpiness)map["bump"].AsInteger();
face.Shiny = (Shininess)map["shiny"].AsInteger();
face.Fullbright = map["fullbright"].AsBoolean();
face.MediaFlags = map["media_flags"].AsBoolean();
face.TexMapType = (MappingType)map["mapping"].AsInteger();
face.Glow = (float)map["glow"].AsReal();
face.TextureID = map["imageid"].AsUUID();
return face;
}