[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2840] trunk/py/scripts/addons/ io_mesh_uv_layout: formatting edits only
Campbell Barton
ideasman42 at gmail.com
Sat Dec 31 11:27:37 CET 2011
Revision: 2840
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2840
Author: campbellbarton
Date: 2011-12-31 10:27:24 +0000 (Sat, 31 Dec 2011)
Log Message:
-----------
formatting edits only
Modified Paths:
--------------
trunk/py/scripts/addons/io_mesh_uv_layout/export_uv_eps.py
trunk/py/scripts/addons/io_mesh_uv_layout/export_uv_png.py
trunk/py/scripts/addons/io_mesh_uv_layout/export_uv_svg.py
Modified: trunk/py/scripts/addons/io_mesh_uv_layout/export_uv_eps.py
===================================================================
--- trunk/py/scripts/addons/io_mesh_uv_layout/export_uv_eps.py 2011-12-31 09:59:39 UTC (rev 2839)
+++ trunk/py/scripts/addons/io_mesh_uv_layout/export_uv_eps.py 2011-12-31 10:27:24 UTC (rev 2840)
@@ -16,7 +16,7 @@
#
# ##### END GPL LICENSE BLOCK #####
-# <pep8 compliant>
+# <pep8-80 compliant>
import bpy
@@ -27,7 +27,8 @@
fw("%%Pages: 1\n")
fw("%%Orientation: Portrait\n")
fw("%%%%BoundingBox: 0 0 %d %d\n" % (image_width, image_height))
- fw("%%%%HiResBoundingBox: 0.0 0.0 %.4f %.4f\n" % (image_width, image_height))
+ fw("%%%%HiResBoundingBox: 0.0 0.0 %.4f %.4f\n" %
+ (image_width, image_height))
fw("%%EndComments\n")
fw("%%Page: 1 1\n")
fw("0 0 translate\n")
@@ -45,7 +46,8 @@
fw("/DRAW_%d {" % i)
fw("gsave\n")
if mat:
- color = tuple((1.0 - ((1.0 - c) * opacity)) for c in mat.diffuse_color)
+ color = tuple((1.0 - ((1.0 - c) * opacity))
+ for c in mat.diffuse_color)
else:
color = 1.0, 1.0, 1.0
fw("%.3g %.3g %.3g setrgbcolor\n" % color)
Modified: trunk/py/scripts/addons/io_mesh_uv_layout/export_uv_png.py
===================================================================
--- trunk/py/scripts/addons/io_mesh_uv_layout/export_uv_png.py 2011-12-31 09:59:39 UTC (rev 2839)
+++ trunk/py/scripts/addons/io_mesh_uv_layout/export_uv_png.py 2011-12-31 10:27:24 UTC (rev 2840)
@@ -16,7 +16,7 @@
#
# ##### END GPL LICENSE BLOCK #####
-# <pep8 compliant>
+# <pep8-80 compliant>
import bpy
@@ -25,7 +25,9 @@
filepath = fw.__self__.name
fw.__self__.close()
- material_solids = [bpy.data.materials.new("uv_temp_solid") for i in range(max(1, len(mesh_source.materials)))]
+ material_solids = [bpy.data.materials.new("uv_temp_solid")
+ for i in range(max(1, len(mesh_source.materials)))]
+
material_wire = bpy.data.materials.new("uv_temp_wire")
scene = bpy.data.scenes.new("uv_temp")
@@ -39,15 +41,21 @@
faces_source = mesh_source.faces
- # get unique UV's in case there are many overlapping which slow down filling.
+ # get unique UV's in case there are many overlapping
+ # which slow down filling.
face_hash_3 = set()
face_hash_4 = set()
for i, uv in face_iter_func():
material_index = faces_source[i].material_index
if len(uv) == 3:
- face_hash_3.add((uv[0][0], uv[0][1], uv[1][0], uv[1][1], uv[2][0], uv[2][1], material_index))
+ face_hash_3.add((uv[0][0], uv[0][1],
+ uv[1][0], uv[1][1],
+ uv[2][0], uv[2][1], material_index))
else:
- face_hash_4.add((uv[0][0], uv[0][1], uv[1][0], uv[1][1], uv[2][0], uv[2][1], uv[3][0], uv[3][1], material_index))
+ face_hash_4.add((uv[0][0], uv[0][1],
+ uv[1][0], uv[1][1],
+ uv[2][0], uv[2][1],
+ uv[3][0], uv[3][1], material_index))
# now set the faces coords and locations
# build mesh data
@@ -58,13 +66,20 @@
current_vert = 0
for face_data in face_hash_3:
- mesh_new_vertices.extend([face_data[0], face_data[1], 0.0, face_data[2], face_data[3], 0.0, face_data[4], face_data[5], 0.0])
- mesh_new_face_vertices.extend([current_vert, current_vert + 1, current_vert + 2, 0])
+ mesh_new_vertices.extend([face_data[0], face_data[1], 0.0,
+ face_data[2], face_data[3], 0.0,
+ face_data[4], face_data[5], 0.0])
+ mesh_new_face_vertices.extend([current_vert, current_vert + 1,
+ current_vert + 2, 0])
mesh_new_materials.append(face_data[6])
current_vert += 3
for face_data in face_hash_4:
- mesh_new_vertices.extend([face_data[0], face_data[1], 0.0, face_data[2], face_data[3], 0.0, face_data[4], face_data[5], 0.0, face_data[6], face_data[7], 0.0])
- mesh_new_face_vertices.extend([current_vert, current_vert + 1, current_vert + 2, current_vert + 3])
+ mesh_new_vertices.extend([face_data[0], face_data[1], 0.0,
+ face_data[2], face_data[3], 0.0,
+ face_data[4], face_data[5], 0.0,
+ face_data[6], face_data[7], 0.0])
+ mesh_new_face_vertices.extend([current_vert, current_vert + 1,
+ current_vert + 2, current_vert + 3])
mesh_new_materials.append(face_data[8])
current_vert += 4
Modified: trunk/py/scripts/addons/io_mesh_uv_layout/export_uv_svg.py
===================================================================
--- trunk/py/scripts/addons/io_mesh_uv_layout/export_uv_svg.py 2011-12-31 09:59:39 UTC (rev 2839)
+++ trunk/py/scripts/addons/io_mesh_uv_layout/export_uv_svg.py 2011-12-31 10:27:24 UTC (rev 2840)
@@ -16,7 +16,7 @@
#
# ##### END GPL LICENSE BLOCK #####
-# <pep8 compliant>
+# <pep8-80 compliant>
import bpy
@@ -29,9 +29,11 @@
fw('<?xml version="1.0" standalone="no"?>\n')
fw('<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" \n')
fw(' "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')
- fw('<svg width="%dpx" height="%dpx" viewBox="0px 0px %dpx %dpx"\n' % (image_width, image_height, image_width, image_height))
+ fw('<svg width="%dpx" height="%dpx" viewBox="0px 0px %dpx %dpx"\n' %
+ (image_width, image_height, image_width, image_height))
fw(' xmlns="http://www.w3.org/2000/svg" version="1.1">\n')
- desc = "%r, %s, (Blender %s)" % (basename(bpy.data.filepath), mesh.name, bpy.app.version_string)
+ desc = ("%r, %s, (Blender %s)" %
+ (basename(bpy.data.filepath), mesh.name, bpy.app.version_string))
fw('<desc>%s</desc>\n' % escape(desc))
# svg colors
@@ -39,7 +41,9 @@
fill_default = 'fill="grey"'
for mat in mesh.materials if mesh.materials else [None]:
if mat:
- fill_settings.append('fill="rgb(%d, %d, %d)"' % tuple(int(c * 255) for c in mat.diffuse_color))
+ fill_settings.append('fill="rgb(%d, %d, %d)"' %
+ tuple(int(c * 255)
+ for c in mat.diffuse_color))
else:
fill_settings.append(fill_default)
More information about the Bf-extensions-cvs
mailing list