Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2015-03-17 00:46:51 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-03-17 00:46:51 +0300
commit2f35b08beb278075db6cb828bb825eb8cf1cc106 (patch)
treef8f91785a0745692887bff0284236d37e94f2be4
parente716a3503d0e4ece893d42e394e684ebce90ea4e (diff)
Fix T44106: Obj importer broken.
In fact, it's the OBJ file which is utterly broken (thousands of faces reusing the same vertex...). I think 'breakage' comes actually from change in bmesh (raising error when trying to get an edge with same vert in both items of the key), afaiks this is not different from old code in current importer. Anyway, working around this is easy and cheap, so... To be backported in final 2.74.
-rw-r--r--io_scene_obj/import_obj.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/io_scene_obj/import_obj.py b/io_scene_obj/import_obj.py
index 9be826fd..5054e63a 100644
--- a/io_scene_obj/import_obj.py
+++ b/io_scene_obj/import_obj.py
@@ -435,7 +435,7 @@ def create_mesh(new_objects,
smooth_group_users = {context_smooth_group: {} for context_smooth_group in unique_smooth_groups.keys()}
context_smooth_group_old = -1
- fgon_edges = set() # Used for storing fgon keys whe we need to tesselate/untesselate them (ngons with hole).
+ fgon_edges = set() # Used for storing fgon keys when we need to tesselate/untesselate them (ngons with hole).
edges = []
tot_loops = 0
@@ -508,6 +508,8 @@ def create_mesh(new_objects,
prev_vidx = face_vert_loc_indices[ngon[-1]]
for ngidx in ngon:
vidx = face_vert_loc_indices[ngidx]
+ if vidx == prev_vidx:
+ continue # broken OBJ... Just skip.
edge_key = (prev_vidx, vidx) if (prev_vidx < vidx) else (vidx, prev_vidx)
prev_vidx = vidx
if edge_key in edge_users: