Make the custom material enum serializable