pep8 corrections.

This commit is contained in:
2011-01-13 23:00:51 +00:00
parent 6c3d7c7f12
commit 9146ca06dd
11 changed files with 51 additions and 55 deletions

View File

@@ -18,10 +18,10 @@
# <pep8 compliant> # <pep8 compliant>
def image_load(filepath, dirpath, place_holder=False, recursive=False, convert_callback=None): def image_load(filepath, dirpath, place_holder=False, recursive=False, convert_callback=None):
import bpy import bpy
try: try:
return bpy.data.images.load(filepath) return bpy.data.images.load(filepath)
except SystemError: except SystemError:
return bpy.data.images.new("Untitled", 128, 128) return bpy.data.images.new("Untitled", 128, 128)

View File

@@ -108,7 +108,6 @@ class AddTorus(bpy.types.Operator):
location = FloatVectorProperty(name="Location") location = FloatVectorProperty(name="Location")
rotation = FloatVectorProperty(name="Rotation") rotation = FloatVectorProperty(name="Rotation")
def execute(self, context): def execute(self, context):
if self.use_abso == True: if self.use_abso == True:

View File

@@ -31,7 +31,6 @@ def extend(obj, operator, EXTEND_MODE):
if not me.uv_textures: if not me.uv_textures:
me.uv_textures.new() me.uv_textures.new()
# Toggle Edit mode # Toggle Edit mode
is_editmode = (obj.mode == 'EDIT') is_editmode = (obj.mode == 'EDIT')
if is_editmode: if is_editmode:
@@ -86,7 +85,6 @@ def extend(obj, operator, EXTEND_MODE):
except: except:
target_matching_edge = edge_idxs_target.index(edge_key_swap) target_matching_edge = edge_idxs_target.index(edge_key_swap)
edgepair_inner_source = edge_idxs_source[source_matching_edge] edgepair_inner_source = edge_idxs_source[source_matching_edge]
edgepair_inner_target = edge_idxs_target[target_matching_edge] edgepair_inner_target = edge_idxs_target[target_matching_edge]
edgepair_outer_source = edge_idxs_source[OTHER_INDEX[source_matching_edge]] edgepair_outer_source = edge_idxs_source[OTHER_INDEX[source_matching_edge]]
@@ -99,12 +97,10 @@ def extend(obj, operator, EXTEND_MODE):
iA = 1 iA = 1
iB = 0 iB = 0
# Set the target UV's touching source face, no tricky calc needed, # Set the target UV's touching source face, no tricky calc needed,
uvs_vhash_target[edgepair_inner_target[0]][:] = uvs_vhash_source[edgepair_inner_source[iA]] uvs_vhash_target[edgepair_inner_target[0]][:] = uvs_vhash_source[edgepair_inner_source[iA]]
uvs_vhash_target[edgepair_inner_target[1]][:] = uvs_vhash_source[edgepair_inner_source[iB]] uvs_vhash_target[edgepair_inner_target[1]][:] = uvs_vhash_source[edgepair_inner_source[iB]]
# Set the 2 UV's on the target face that are not touching # Set the 2 UV's on the target face that are not touching
# for this we need to do basic expaning on the source faces UV's # for this we need to do basic expaning on the source faces UV's
if EXTEND_MODE == 'LENGTH': if EXTEND_MODE == 'LENGTH':
@@ -137,7 +133,6 @@ def extend(obj, operator, EXTEND_MODE):
uvs_vhash_target[edgepair_outer_target[iB]][:] = uvs_vhash_source[edgepair_inner_source[0]] + (uvs_vhash_source[edgepair_inner_source[0]] - uvs_vhash_source[edgepair_outer_source[1]]) uvs_vhash_target[edgepair_outer_target[iB]][:] = uvs_vhash_source[edgepair_inner_source[0]] + (uvs_vhash_source[edgepair_inner_source[0]] - uvs_vhash_source[edgepair_outer_source[1]])
uvs_vhash_target[edgepair_outer_target[iA]][:] = uvs_vhash_source[edgepair_inner_source[1]] + (uvs_vhash_source[edgepair_inner_source[1]] - uvs_vhash_source[edgepair_outer_source[0]]) uvs_vhash_target[edgepair_outer_target[iA]][:] = uvs_vhash_source[edgepair_inner_source[1]] + (uvs_vhash_source[edgepair_inner_source[1]] - uvs_vhash_source[edgepair_outer_source[0]])
if not me.uv_textures: if not me.uv_textures:
me.uv_textures.new() me.uv_textures.new()
@@ -158,8 +153,6 @@ def extend(obj, operator, EXTEND_MODE):
operator.report({'ERROR'}, "Active face not selected.") operator.report({'ERROR'}, "Active face not selected.")
return return
# Modes # Modes
# 0 unsearched # 0 unsearched
# 1:mapped, use search from this face. - removed!! # 1:mapped, use search from this face. - removed!!
@@ -167,7 +160,6 @@ def extend(obj, operator, EXTEND_MODE):
face_modes = [0] * len(face_sel) face_modes = [0] * len(face_sel)
face_modes[face_act_local_index] = 1 # extend UV's from this face. face_modes[face_act_local_index] = 1 # extend UV's from this face.
# Edge connectivty # Edge connectivty
edge_faces = {} edge_faces = {}
for i, f in enumerate(face_sel): for i, f in enumerate(face_sel):
@@ -187,7 +179,6 @@ def extend(obj, operator, EXTEND_MODE):
looplen[0] += (me_verts[ed[0]].co - me_verts[ed[1]].co).length looplen[0] += (me_verts[ed[0]].co - me_verts[ed[1]].co).length
looplen[0] = looplen[0] / len(loop) looplen[0] = looplen[0] / len(loop)
# remove seams, so we dont map accross seams. # remove seams, so we dont map accross seams.
for ed in me.edges: for ed in me.edges:
if ed.use_seam: if ed.use_seam:
@@ -198,7 +189,6 @@ def extend(obj, operator, EXTEND_MODE):
pass pass
# Done finding seams # Done finding seams
# face connectivity - faces around each face # face connectivity - faces around each face
# only store a list of indicies for each face. # only store a list of indicies for each face.
face_faces = [[] for i in range(len(face_sel))] face_faces = [[] for i in range(len(face_sel))]
@@ -208,7 +198,6 @@ def extend(obj, operator, EXTEND_MODE):
face_faces[faces[0]].append((faces[1], edge_key)) face_faces[faces[0]].append((faces[1], edge_key))
face_faces[faces[1]].append((faces[0], edge_key)) face_faces[faces[1]].append((faces[0], edge_key))
# Now we know what face is connected to what other face, map them by connectivity # Now we know what face is connected to what other face, map them by connectivity
ok = True ok = True
while ok: while ok:

View File

@@ -111,7 +111,6 @@ class DATA_PT_settings(MeshButtonsPanel, bpy.types.Panel):
layout.prop(mesh, "use_auto_texspace") layout.prop(mesh, "use_auto_texspace")
class DATA_PT_vertex_groups(MeshButtonsPanel, bpy.types.Panel): class DATA_PT_vertex_groups(MeshButtonsPanel, bpy.types.Panel):
bl_label = "Vertex Groups" bl_label = "Vertex Groups"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}

View File

@@ -897,9 +897,6 @@ class PARTICLE_PT_draw(ParticleButtonsPanel, bpy.types.Panel):
if part.physics_type == 'BOIDS': if part.physics_type == 'BOIDS':
col.prop(part, "show_health") col.prop(part, "show_health")
col = row.column() col = row.column()
col.prop(part, "show_material_color", text="Use material color") col.prop(part, "show_material_color", text="Use material color")

View File

@@ -20,6 +20,7 @@
import bpy import bpy
####################################### #######################################
# DopeSheet Filtering # DopeSheet Filtering
@@ -72,6 +73,7 @@ def dopesheet_filter(layout, context):
if dopesheet.show_only_group_objects: if dopesheet.show_only_group_objects:
row.prop(dopesheet, "filter_group", text="") row.prop(dopesheet, "filter_group", text="")
####################################### #######################################
# DopeSheet Editor - General/Standard UI # DopeSheet Editor - General/Standard UI
@@ -187,6 +189,7 @@ class DOPESHEET_MT_select(bpy.types.Menu):
layout.separator() layout.separator()
layout.operator("action.select_linked") layout.operator("action.select_linked")
class DOPESHEET_MT_marker(bpy.types.Menu): class DOPESHEET_MT_marker(bpy.types.Menu):
bl_label = "Marker" bl_label = "Marker"
@@ -211,6 +214,7 @@ class DOPESHEET_MT_marker(bpy.types.Menu):
layout.separator() layout.separator()
layout.prop(st, "show_pose_markers") layout.prop(st, "show_pose_markers")
####################################### #######################################
# Keyframe Editing # Keyframe Editing
@@ -277,6 +281,7 @@ class DOPESHEET_MT_key(bpy.types.Menu):
layout.operator("action.copy") layout.operator("action.copy")
layout.operator("action.paste") layout.operator("action.paste")
class DOPESHEET_MT_key_transform(bpy.types.Menu): class DOPESHEET_MT_key_transform(bpy.types.Menu):
bl_label = "Transform" bl_label = "Transform"
@@ -289,6 +294,7 @@ class DOPESHEET_MT_key_transform(bpy.types.Menu):
layout.operator("transform.transform", text="Slide").mode = 'TIME_SLIDE' layout.operator("transform.transform", text="Slide").mode = 'TIME_SLIDE'
layout.operator("transform.transform", text="Scale").mode = 'TIME_SCALE' layout.operator("transform.transform", text="Scale").mode = 'TIME_SCALE'
####################################### #######################################
# Grease Pencil Editing # Grease Pencil Editing
@@ -319,6 +325,7 @@ class DOPESHEET_MT_gpencil_channel(bpy.types.Menu):
#layout.separator() #layout.separator()
#layout.operator_menu_enum("anim.channels_move", "direction", text="Move...") #layout.operator_menu_enum("anim.channels_move", "direction", text="Move...")
class DOPESHEET_MT_gpencil_frame(bpy.types.Menu): class DOPESHEET_MT_gpencil_frame(bpy.types.Menu):
bl_label = "Frame" bl_label = "Frame"

View File

@@ -133,6 +133,7 @@ class GRAPH_MT_select(bpy.types.Menu):
layout.separator() layout.separator()
layout.operator("graph.select_linked") layout.operator("graph.select_linked")
class GRAPH_MT_marker(bpy.types.Menu): class GRAPH_MT_marker(bpy.types.Menu):
bl_label = "Marker" bl_label = "Marker"
@@ -153,6 +154,7 @@ class GRAPH_MT_marker(bpy.types.Menu):
# TODO: pose markers for action edit mode only? # TODO: pose markers for action edit mode only?
class GRAPH_MT_channel(bpy.types.Menu): class GRAPH_MT_channel(bpy.types.Menu):
bl_label = "Channel" bl_label = "Channel"

View File

@@ -93,6 +93,7 @@ class NLA_MT_select(bpy.types.Menu):
layout.operator("nla.select_border") layout.operator("nla.select_border")
layout.operator("nla.select_border", text="Border Axis Range").axis_range = True layout.operator("nla.select_border", text="Border Axis Range").axis_range = True
class NLA_MT_marker(bpy.types.Menu): class NLA_MT_marker(bpy.types.Menu):
bl_label = "Marker" bl_label = "Marker"
@@ -111,6 +112,7 @@ class NLA_MT_marker(bpy.types.Menu):
layout.operator("marker.rename", text="Rename Marker") layout.operator("marker.rename", text="Rename Marker")
layout.operator("marker.move", text="Grab/Move Marker") layout.operator("marker.move", text="Grab/Move Marker")
class NLA_MT_edit(bpy.types.Menu): class NLA_MT_edit(bpy.types.Menu):
bl_label = "Edit" bl_label = "Edit"

View File

@@ -34,6 +34,7 @@ def draw_repeat_tools(context, layout):
col.operator("screen.repeat_last") col.operator("screen.repeat_last")
col.operator("screen.repeat_history", text="History...") col.operator("screen.repeat_history", text="History...")
# Grease Pencil tools # Grease Pencil tools
def draw_gpencil_tools(context, layout): def draw_gpencil_tools(context, layout):
col = layout.column(align=True) col = layout.column(align=True)