Calling ensure_lookup_table for each face is stupid! :/ (Noted by Sergey - thx)
Another script that was missing the lookup_table call.