[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2846] contrib/py/scripts/addons: pep8 edits
Campbell Barton
ideasman42 at gmail.com
Sun Jan 1 11:22:36 CET 2012
Revision: 2846
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2846
Author: campbellbarton
Date: 2012-01-01 10:22:31 +0000 (Sun, 01 Jan 2012)
Log Message:
-----------
pep8 edits
Modified Paths:
--------------
contrib/py/scripts/addons/io_import_fbx.py
contrib/py/scripts/addons/io_scene_ms3d/__init__.py
contrib/py/scripts/addons/render_clay.py
Modified: contrib/py/scripts/addons/io_import_fbx.py
===================================================================
--- contrib/py/scripts/addons/io_import_fbx.py 2012-01-01 08:26:23 UTC (rev 2845)
+++ contrib/py/scripts/addons/io_import_fbx.py 2012-01-01 10:22:31 UTC (rev 2846)
@@ -250,12 +250,12 @@
blen_faces_edges = [] # faces that have a length of 2
blen_poly_mapping = {}
poly_idx = 0
-
+
for idx, f in enumerate(faces):
-
+
if f < 0:
face.append(f ^ -1)
- edge_points[idx] = [face[-1],face[0]]
+ edge_points[idx] = [face[-1], face[0]]
face = []
if len(blen_faces[-1]) == 2:
@@ -265,25 +265,24 @@
blen_faces.append(face)
poly_idx += 1
-
- else:
+ else:
face.append(f)
edge_final = []
- if(len(faces) == 2): # Special case if there is only one edge in scene.
+ if len(faces) == 2: # Special case if there is only one edge in scene.
edge1 = faces[0]
- if(edge1<0):
- edge1 ^= -1
+ if edge1 < 0:
+ edge1 ^= -1
edge2 = faces[1]
- if(edge2<0):
+ if edge2 < 0:
edge2 ^= -1
- edge_final.append((edge1,edge2))
-
- else: # More than one edges.
+ edge_final.append((edge1, edge2))
+
+ else: # More than one edges
for idx, e in enumerate(edges):
- if (faces[e]<0): #If this is the faces last point, use edge_points to create edge between last and first points of face
+ if faces[e] < 0: # If this is the faces last point, use edge_points to create edge between last and first points of face
edge1 = edge_points[e][0]
edge2 = edge_points[e][1]
else:
@@ -293,10 +292,9 @@
edge2 ^= -1
edge_final.append((edge1, edge2))
-
+
if not blen_faces[-1]:
del blen_faces[-1]
-
me.from_pydata(blen_verts, edge_final, blen_faces)
me.update()
@@ -321,8 +319,6 @@
else:
print("WARNING: %s, unsupported smoothing type: %s" % (fbx_name, type))
-
-
# Handle edge weighting
for i in tag_get_iter(value2, "LayerElementEdgeCrease"):
i = i[1]
@@ -343,12 +339,12 @@
else:
print("WARNING: %s, unsupported smoothing type: %s" % (fbx_name, type))
- # Create the Uv-sets
+ # Create the Uv-sets
for i in tag_get_iter(value2, "LayerElementUV"):
- i=i[1]
+ i = i[1]
uv_in = 0
uv_face = []
- uv_name = tag_get_single(i,"Name")[1]
+ uv_name = tag_get_single(i, "Name")[1]
print(uv_name)
uv_verts = tag_get_single(i, "UV")[1]
uv_index = tag_get_single(i, "UVIndex")[1]
@@ -356,12 +352,12 @@
if(uv_verts):
blen_uv_verts = [uv_verts[i - 2:i] for i in range(2, len(uv_verts) + 2, 2)]
- for ind,uv_i in enumerate(uv_index):
+ for ind, uv_i in enumerate(uv_index):
if(uv_i == -1):
- uv_face.append([-0.1,-0.1])
+ uv_face.append([-0.1, -0.1])
else:
uv_face.append(blen_uv_verts[uv_i])
- uv_in +=1
+ uv_in += 1
me.uv_textures.new(uv_name)
uv_layer = me.uv_textures[-1].data
@@ -370,16 +366,15 @@
for fi, uv in enumerate(uv_layer):
if(len(me.faces[fi].vertices) == 4):
uv.uv1 = uv_face[uv_counter]
- uv.uv2 = uv_face[uv_counter+1]
- uv.uv3 = uv_face[uv_counter+2]
- uv.uv4 = uv_face[uv_counter+3]
+ uv.uv2 = uv_face[uv_counter + 1]
+ uv.uv3 = uv_face[uv_counter + 2]
+ uv.uv4 = uv_face[uv_counter + 3]
uv_counter += 4
else:
uv.uv1 = uv_face[uv_counter]
- uv.uv2 = uv_face[uv_counter+1]
- uv.uv3 = uv_face[uv_counter+2]
+ uv.uv2 = uv_face[uv_counter + 1]
+ uv.uv3 = uv_face[uv_counter + 2]
uv_counter += 3
-
obj = bpy.data.objects.new(fbx_name, me)
base = scene.objects.link(obj)
Modified: contrib/py/scripts/addons/io_scene_ms3d/__init__.py
===================================================================
--- contrib/py/scripts/addons/io_scene_ms3d/__init__.py 2012-01-01 08:26:23 UTC (rev 2845)
+++ contrib/py/scripts/addons/io_scene_ms3d/__init__.py 2012-01-01 10:22:31 UTC (rev 2846)
@@ -16,13 +16,30 @@
#
# ##### END GPL LICENSE BLOCK #####
+# <pep8 compliant>
+bl_info = {
+ "name": "MilkShape3D MS3D format (.ms3d)",
+ "description": "Import / Export MilkShape3D MS3D files"
+ " (conform with v1.8.4)",
+ "author": "Alexander Nussbaumer",
+ "version": (0, 3, 6),
+ "blender": (2, 60, 0),
+ "api": 41226,
+ "location": "File > Import-Export",
+ "warning": "imports and exports only geometry and material of ms3d"\
+ " file. (poor performance)",
+ "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
+ "Scripts/Import-Export/MilkShape3D_MS3D",
+ "tracker_url": "http://projects.blender.org/tracker/index.php"\
+ "?func=detail&aid=29404",
+ "category": 'Import-Export',
+ }
+
###############################################################################
#234567890123456789012345678901234567890123456789012345678901234567890123456789
#--------1---------2---------3---------4---------5---------6---------7---------
-# <pep8 compliant>
-
# ##### BEGIN COPYRIGHT BLOCK #####
#
# initial script copyright (c)2011 Alexander Nussbaumer
@@ -50,26 +67,6 @@
import bpy
import bpy_extras
-
-bl_info = {
- "name": "MilkShape3D MS3D format (.ms3d)",
- "description": "Import / Export MilkShape3D MS3D files"
- " (conform with v1.8.4)",
- "author": "Alexander Nussbaumer",
- "version": (0, 3, 6),
- "blender": (2, 60, 0),
- "api": 41226,
- "location": "File > Import-Export",
- "warning": "imports and exports only geometry and material of ms3d"\
- " file. (poor performance)",
- "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"\
- "Scripts/Import-Export/MilkShape3D_MS3D",
- "tracker_url": "http://projects.blender.org/tracker/index.php"\
- "?func=detail&aid=29404",
- "category": 'Import-Export',
- }
-
-
###############################################################################
# registration
def menu_func_import(self, context):
Modified: contrib/py/scripts/addons/render_clay.py
===================================================================
--- contrib/py/scripts/addons/render_clay.py 2012-01-01 08:26:23 UTC (rev 2845)
+++ contrib/py/scripts/addons/render_clay.py 2012-01-01 10:22:31 UTC (rev 2846)
@@ -202,7 +202,6 @@
description='Use as Clay',
default=False)
-
bpy.utils.register_class(ClayPinned)
bpy.utils.register_class(CheckClay)
bpy.types.RENDER_PT_render.prepend(draw_clay_render)
More information about the Bf-extensions-cvs
mailing list