diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-19 20:19:08 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-19 20:19:08 +0400 |
commit | 9ac0a714bee5df2153e0a73bb55962139ba18eb2 (patch) | |
tree | 029104d14b7e942dd616bf8443e09d0461ac6350 /io_scene_obj | |
parent | 5e44117da5a35882e7f3919f4c48c234acebe045 (diff) |
indentation edits and copy pyrimid from contrib (where I had made some edits), removed so this wont happen again.
Diffstat (limited to 'io_scene_obj')
-rw-r--r-- | io_scene_obj/import_obj.py | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/io_scene_obj/import_obj.py b/io_scene_obj/import_obj.py index 02e8dfdb..ae3b87a2 100644 --- a/io_scene_obj/import_obj.py +++ b/io_scene_obj/import_obj.py @@ -591,56 +591,56 @@ def create_mesh(new_objects, edges.append(face[0]) else: - blender_face = me.faces[i] + blender_face = me.faces[i] - (face_vert_loc_indices, - face_vert_tex_indices, - context_material, - context_smooth_group, - context_object, - ) = face + (face_vert_loc_indices, + face_vert_tex_indices, + context_material, + context_smooth_group, + context_object, + ) = face - if context_smooth_group: - blender_face.use_smooth = True + if context_smooth_group: + blender_face.use_smooth = True + + if context_material: + if context_material_old is not context_material: + mat = material_mapping[context_material] + context_material_old = context_material + + blender_face.material_index = mat +# blender_face.mat= mat + + if verts_tex: + + blender_tface = me.uv_textures[0].data[i] if context_material: - if context_material_old is not context_material: - mat = material_mapping[context_material] - context_material_old = context_material - - blender_face.material_index = mat -# blender_face.mat= mat - - if verts_tex: - - blender_tface = me.uv_textures[0].data[i] - - if context_material: - image, has_data = unique_material_images[context_material] - if image: # Can be none if the material dosnt have an image. - blender_tface.image = image - if has_data and image.depth == 32: - blender_tface.alpha_blend = 'ALPHA' - - # BUG - Evil eekadoodle problem where faces that have vert index 0 location at 3 or 4 are shuffled. - if len(face_vert_loc_indices) == 4: - if face_vert_loc_indices[2] == 0 or face_vert_loc_indices[3] == 0: - face_vert_tex_indices = face_vert_tex_indices[2], face_vert_tex_indices[3], face_vert_tex_indices[0], face_vert_tex_indices[1] - else: # length of 3 - if face_vert_loc_indices[2] == 0: - face_vert_tex_indices = face_vert_tex_indices[1], face_vert_tex_indices[2], face_vert_tex_indices[0] - # END EEEKADOODLE FIX - - # assign material, uv's and image - blender_tface.uv1 = verts_tex[face_vert_tex_indices[0]] - blender_tface.uv2 = verts_tex[face_vert_tex_indices[1]] - blender_tface.uv3 = verts_tex[face_vert_tex_indices[2]] - - if len(face_vert_loc_indices) == 4: - blender_tface.uv4 = verts_tex[face_vert_tex_indices[3]] - -# for ii, uv in enumerate(blender_face.uv): -# uv.x, uv.y= verts_tex[face_vert_tex_indices[ii]] + image, has_data = unique_material_images[context_material] + if image: # Can be none if the material dosnt have an image. + blender_tface.image = image + if has_data and image.depth == 32: + blender_tface.alpha_blend = 'ALPHA' + + # BUG - Evil eekadoodle problem where faces that have vert index 0 location at 3 or 4 are shuffled. + if len(face_vert_loc_indices) == 4: + if face_vert_loc_indices[2] == 0 or face_vert_loc_indices[3] == 0: + face_vert_tex_indices = face_vert_tex_indices[2], face_vert_tex_indices[3], face_vert_tex_indices[0], face_vert_tex_indices[1] + else: # length of 3 + if face_vert_loc_indices[2] == 0: + face_vert_tex_indices = face_vert_tex_indices[1], face_vert_tex_indices[2], face_vert_tex_indices[0] + # END EEEKADOODLE FIX + + # assign material, uv's and image + blender_tface.uv1 = verts_tex[face_vert_tex_indices[0]] + blender_tface.uv2 = verts_tex[face_vert_tex_indices[1]] + blender_tface.uv3 = verts_tex[face_vert_tex_indices[2]] + + if len(face_vert_loc_indices) == 4: + blender_tface.uv4 = verts_tex[face_vert_tex_indices[3]] + +# for ii, uv in enumerate(blender_face.uv): +# uv.x, uv.y= verts_tex[face_vert_tex_indices[ii]] del me_faces # del ALPHA |