Skip to content

Commit

Permalink
write \n even on windows so files can be compared between windows and…
Browse files Browse the repository at this point in the history
… linux (for testing).

most editors (besides notepad) will open these files without trouble.
  • Loading branch information
ideasman42 committed Jan 22, 2011
1 parent 5b308e0 commit 0a2db96
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion io_anim_bvh/export_bvh.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion io_mesh_ply/export_ply.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def rvec2d(v):
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')
Expand Down
2 changes: 1 addition & 1 deletion io_scene_fbx/export_fbx.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ def getAnimParRelMatrixRot(self, frame):
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

Expand Down
4 changes: 2 additions & 2 deletions io_scene_obj/export_obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def copy_image(image):
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.
Expand Down Expand Up @@ -315,7 +315,7 @@ def findVertexGroupName(face, vWeightMap):
# 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)))
Expand Down
4 changes: 2 additions & 2 deletions io_scene_x3d/export_x3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def __init__(self, filepath):
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
Expand Down Expand Up @@ -357,7 +357,7 @@ def writeIndexedFaceSet(self, ob, mesh, mtx, world, EXPORT_TRI=False):

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)
Expand Down

0 comments on commit 0a2db96

Please sign in to comment.