From f463003c6a078a7734035a53ba88ac247d7d69bc Mon Sep 17 00:00:00 2001
From: Campbell Barton <ideasman42@gmail.com>
Date: Wed, 7 Mar 2012 22:00:35 +0000
Subject: [PATCH] update obj import/export for BMesh api changes. (should now
 works as expected)

---
 io_scene_obj/export_obj.py | 4 ++--
 io_scene_obj/import_obj.py | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/io_scene_obj/export_obj.py b/io_scene_obj/export_obj.py
index 3317438df..33168d302 100644
--- a/io_scene_obj/export_obj.py
+++ b/io_scene_obj/export_obj.py
@@ -338,7 +338,7 @@ def write_file(filepath, objects, scene,
             if EXPORT_UV:
                 faceuv = len(me.uv_textures) > 0
                 if faceuv:
-                    uv_layer = me.uv_textures.active.data[:]
+                    uv_layer = me.tessface_uv_textures.active.data[:]
             else:
                 faceuv = False
 
@@ -412,7 +412,7 @@ def write_file(filepath, objects, scene,
                 uv_face_mapping = [[0, 0, 0, 0] for i in range(len(face_index_pairs))]  # a bit of a waste for tri's :/
 
                 uv_dict = {}  # could use a set() here
-                uv_layer = me.uv_textures.active.data
+                uv_layer = me.tessface_uv_textures.active.data
                 for f, f_index in face_index_pairs:
                     for uv_index, uv in enumerate(uv_layer[f_index].uv):
                         uvkey = veckey2d(uv)
diff --git a/io_scene_obj/import_obj.py b/io_scene_obj/import_obj.py
index 32ec2b8df..f8b36a9c8 100644
--- a/io_scene_obj/import_obj.py
+++ b/io_scene_obj/import_obj.py
@@ -561,7 +561,7 @@ def create_mesh(new_objects,
     me.faces.foreach_set("vertices_raw", unpack_face_list([f[0] for f in faces]))
 
     if verts_tex and me.faces:
-        me.uv_textures.new()
+        me.tessface_uv_textures.new()
 
     context_material_old = -1  # avoid a dict lookup
     mat = 0  # rare case it may be un-initialized.
@@ -597,7 +597,7 @@ def create_mesh(new_objects,
 
             if verts_tex:
 
-                blender_tface = me.uv_textures[0].data[i]
+                blender_tface = me.tessface_uv_textures[0].data[i]
 
                 if context_material:
                     image, has_data = unique_material_images[context_material]
-- 
GitLab