diff --git a/io_anim_bvh/export_bvh.py b/io_anim_bvh/export_bvh.py index dc7b4207c7320a75a946043f3a9e787256de30d8..25694fa45abec165598a511fde5fc4876c6606fd 100644 --- a/io_anim_bvh/export_bvh.py +++ b/io_anim_bvh/export_bvh.py @@ -29,7 +29,7 @@ def write_armature(context, filepath, frame_start, frame_end, global_scale=1.0): from mathutils import Matrix, Vector, Euler from math import degrees - file = open(filepath, "w") + file = open(filepath, "w", encoding="utf8", newline="\n") obj = context.object arm = obj.data diff --git a/io_mesh_ply/export_ply.py b/io_mesh_ply/export_ply.py index 271a2d23207a063a3a5cce9e3494562d6dac7296..11a16438e7fe1134a6ee0a61a53acbbda43f59eb 100644 --- a/io_mesh_ply/export_ply.py +++ b/io_mesh_ply/export_ply.py @@ -45,7 +45,7 @@ def save(operator, context, filepath="", use_modifiers=True, use_normals=True, u if not obj: raise Exception("Error, Select 1 active object") - file = open(filepath, 'w') + file = open(filepath, "w", encoding="utf8", newline="\n") if scene.objects.active: bpy.ops.object.mode_set(mode='OBJECT') diff --git a/io_scene_fbx/export_fbx.py b/io_scene_fbx/export_fbx.py index be9cdfef57b46b8983cf652c124ae9473ed1780f..99288408e5cd152b2239e0f60fe5ec01c79a6509 100644 --- a/io_scene_fbx/export_fbx.py +++ b/io_scene_fbx/export_fbx.py @@ -549,7 +549,7 @@ def save(operator, context, filepath="", print('\nFBX export starting... %r' % filepath) start_time = time.clock() try: - file = open(filepath, 'w', encoding='utf8') + file = open(filepath, "w", encoding="utf8", newline="\n") except: return False diff --git a/io_scene_obj/export_obj.py b/io_scene_obj/export_obj.py index 4d709d0ed79c6d0e1537b29cadb34d48ec1181f4..2fe4a804b423a3c663b74a19c0dbda06315810df 100644 --- a/io_scene_obj/export_obj.py +++ b/io_scene_obj/export_obj.py @@ -59,7 +59,7 @@ def write_mtl(scene, filepath, copy_images, mtl_dict): rel = fn return rel - file = open(filepath, "w", encoding='utf8') + file = open(filepath, "w", encoding="utf8", newline="\n") file.write('# Blender MTL File: %r\n' % os.path.basename(bpy.data.filepath)) file.write('# Material Count: %i\n' % len(mtl_dict)) # Write material/image combinations we have used. @@ -315,7 +315,7 @@ def write_file(filepath, objects, scene, # time1 = sys.time() # scn = Scene.GetCurrent() - file = open(filepath, "w") + file = open(filepath, "w", encoding="utf8", newline="\n") # Write Header file.write('# Blender v%s OBJ File: %r\n' % (bpy.app.version_string, os.path.basename(bpy.data.filepath))) diff --git a/io_scene_x3d/export_x3d.py b/io_scene_x3d/export_x3d.py index b81e8cf9baacedc5f5e01326f97479a35c0753f9..4157878de51abbc72bb4dfcc58c50bafea9ca913 100644 --- a/io_scene_x3d/export_x3d.py +++ b/io_scene_x3d/export_x3d.py @@ -84,7 +84,7 @@ class x3d_class: self.filepath = filepath[:-1] # remove trailing z if self.file is None: - self.file = open(self.filepath, "w", encoding='utf8') + self.file = open(self.filepath, "w", encoding="utf8", newline="\n") self.bNav = 0 self.nodeID = 0 @@ -357,7 +357,7 @@ class x3d_class: mesh_faces = mesh.faces[:] mesh_faces_materials = [f.material_index for f in mesh_faces] - + if is_uv and True in mesh_materials_use_face_texture: mesh_faces_image = [(fuv.image if (mesh_materials_use_face_texture[mesh_faces_materials[i]] and fuv.use_image) else mesh_material_images[mesh_faces_materials[i]]) for i, fuv in enumerate(mesh.uv_textures.active.data)] mesh_faces_image_unique = set(mesh_faces_image)