Code Cleanup: style, spelling and pep8 edits
This commit is contained in:
@@ -35,6 +35,7 @@ error_duplicates = False
|
||||
error_encoding = False
|
||||
addons_fake_modules = {}
|
||||
|
||||
|
||||
def paths():
|
||||
# RELEASE SCRIPTS: official scripts distributed in Blender releases
|
||||
addon_paths = _bpy.utils.script_paths("addons")
|
||||
|
||||
@@ -321,7 +321,7 @@ def reduce_dirs(dirs):
|
||||
"""
|
||||
dirs = list({_os.path.normpath(_os.path.abspath(d)) for d in dirs})
|
||||
dirs.sort(key=lambda d: len(d))
|
||||
for i in range(len(dirs) -1, -1, -1):
|
||||
for i in range(len(dirs) - 1, -1, -1):
|
||||
for j in range(i):
|
||||
print(i, j)
|
||||
if len(dirs[i]) == len(dirs[j]):
|
||||
|
||||
@@ -98,6 +98,7 @@ class InfoStructRNA:
|
||||
)
|
||||
|
||||
global_lookup = {}
|
||||
|
||||
def __init__(self, rna_type):
|
||||
self.bl_rna = rna_type
|
||||
|
||||
|
||||
@@ -281,4 +281,3 @@ class ClearUselessActions(Operator):
|
||||
self.report({'INFO'}, "Removed %d empty and/or fake-user only Actions"
|
||||
% removed)
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
@@ -111,7 +111,6 @@ class VIEW3D_OT_edit_mesh_extrude_move(Operator):
|
||||
return self.execute(context)
|
||||
|
||||
|
||||
|
||||
class VIEW3D_OT_edit_mesh_extrude_shrink_fatten(Operator):
|
||||
"Extrude and move along individual normals"
|
||||
bl_label = "Extrude and Move on Individual Normals"
|
||||
|
||||
@@ -306,7 +306,7 @@ class DATA_PT_font(CurveButtonsPanel, Panel):
|
||||
row.template_ID(text, "font_bold_italic", open="font.open", unlink="font.unlink")
|
||||
|
||||
#layout.prop(text, "font")
|
||||
|
||||
|
||||
row = layout.split(percentage=0.25)
|
||||
row.label(text="Body Text:")
|
||||
row.prop(text, "body", text="")
|
||||
|
||||
@@ -339,7 +339,7 @@ class DATA_PT_uv_texture(MeshButtonsPanel, Panel):
|
||||
col = row.column(align=True)
|
||||
col.operator("mesh.uv_texture_add", icon='ZOOMIN', text="")
|
||||
col.operator("mesh.uv_texture_remove", icon='ZOOMOUT', text="")
|
||||
|
||||
|
||||
if lay:
|
||||
layout.prop(lay, "name")
|
||||
|
||||
@@ -362,7 +362,7 @@ class DATA_PT_vertex_colors(MeshButtonsPanel, Panel):
|
||||
col = row.column(align=True)
|
||||
col.operator("mesh.vertex_color_add", icon='ZOOMIN', text="")
|
||||
col.operator("mesh.vertex_color_remove", icon='ZOOMOUT', text="")
|
||||
|
||||
|
||||
if lay:
|
||||
layout.prop(lay, "name")
|
||||
|
||||
|
||||
@@ -1218,27 +1218,27 @@ class PARTICLE_PT_vertexgroups(ParticleButtonsPanel, Panel):
|
||||
row = col.row(align=True)
|
||||
row.prop_search(psys, "vertex_group_density", ob, "vertex_groups", text="Density")
|
||||
row.prop(psys, "invert_vertex_group_density", text="", toggle=True, icon='ARROW_LEFTRIGHT')
|
||||
|
||||
|
||||
row = col.row(align=True)
|
||||
row.prop_search(psys, "vertex_group_length", ob, "vertex_groups", text="Length")
|
||||
row.prop(psys, "invert_vertex_group_length", text="", toggle=True, icon='ARROW_LEFTRIGHT')
|
||||
|
||||
|
||||
row = col.row(align=True)
|
||||
row.prop_search(psys, "vertex_group_clump", ob, "vertex_groups", text="Clump")
|
||||
row.prop(psys, "invert_vertex_group_clump", text="", toggle=True, icon='ARROW_LEFTRIGHT')
|
||||
|
||||
|
||||
row = col.row(align=True)
|
||||
row.prop_search(psys, "vertex_group_kink", ob, "vertex_groups", text="Kink")
|
||||
row.prop(psys, "invert_vertex_group_kink", text="", toggle=True, icon='ARROW_LEFTRIGHT')
|
||||
|
||||
|
||||
row = col.row(align=True)
|
||||
row.prop_search(psys, "vertex_group_roughness_1", ob, "vertex_groups", text="Roughness 1")
|
||||
row.prop(psys, "invert_vertex_group_roughness_1", text="", toggle=True, icon='ARROW_LEFTRIGHT')
|
||||
|
||||
|
||||
row = col.row(align=True)
|
||||
row.prop_search(psys, "vertex_group_roughness_2", ob, "vertex_groups", text="Roughness 2")
|
||||
row.prop(psys, "invert_vertex_group_roughness_2", text="", toggle=True, icon='ARROW_LEFTRIGHT')
|
||||
|
||||
|
||||
row = col.row(align=True)
|
||||
row.prop_search(psys, "vertex_group_roughness_end", ob, "vertex_groups", text="Roughness End")
|
||||
row.prop(psys, "invert_vertex_group_roughness_end", text="", toggle=True, icon='ARROW_LEFTRIGHT')
|
||||
|
||||
@@ -727,7 +727,7 @@ class IMAGE_PT_tools_brush_overlay(BrushButtonsPanel, Panel):
|
||||
tex_slot_mask = brush.mask_texture_slot
|
||||
|
||||
col = layout.column()
|
||||
|
||||
|
||||
col.label(text="Curve:")
|
||||
|
||||
row = col.row(align=True)
|
||||
|
||||
@@ -169,7 +169,6 @@ class INFO_MT_file_external_data(Menu):
|
||||
layout.operator("file.find_missing_files")
|
||||
|
||||
|
||||
|
||||
class INFO_MT_game(Menu):
|
||||
bl_label = "Game"
|
||||
|
||||
|
||||
@@ -364,7 +364,7 @@ class NODE_PT_backdrop(Panel):
|
||||
col.prop(snode, "backdrop_x", text="X")
|
||||
col.prop(snode, "backdrop_y", text="Y")
|
||||
col.operator("node.backimage_move", text="Move")
|
||||
|
||||
|
||||
layout.operator("node.backimage_fit", text="Fit")
|
||||
|
||||
|
||||
|
||||
@@ -228,9 +228,9 @@ def marker_menu_generic(layout):
|
||||
|
||||
layout.operator("marker.rename", text="Rename Marker")
|
||||
layout.operator("marker.move", text="Grab/Move Marker")
|
||||
|
||||
|
||||
layout.separator()
|
||||
|
||||
|
||||
layout.operator("screen.marker_jump", text="Jump to Next Marker").next = True
|
||||
layout.operator("screen.marker_jump", text="Jump to Previous Marker").next = False
|
||||
|
||||
|
||||
@@ -833,6 +833,7 @@ class VIEW3D_MT_select_paint_mask_vertex(Menu):
|
||||
|
||||
# XXX: INFO_MT_ names used to keep backwards compatibility (Addons etc that hook into the menu)
|
||||
|
||||
|
||||
class INFO_MT_mesh_add(Menu):
|
||||
bl_idname = "INFO_MT_mesh_add"
|
||||
bl_label = "Mesh"
|
||||
@@ -1597,7 +1598,7 @@ class VIEW3D_MT_hide_mask(Menu):
|
||||
props = layout.operator("paint.mask_flood_fill", text="Clear Mask")
|
||||
props.mode = 'VALUE'
|
||||
props.value = 0
|
||||
|
||||
|
||||
props = layout.operator("view3d.select_border", text="Box Mask")
|
||||
props = layout.operator("paint.mask_lasso_gesture", text="Lasso Mask")
|
||||
|
||||
@@ -2799,7 +2800,7 @@ class VIEW3D_PT_view3d_shading(Panel):
|
||||
if not scene.render.use_shading_nodes:
|
||||
col.prop(gs, "material_mode", text="")
|
||||
col.prop(view, "show_textured_solid")
|
||||
|
||||
|
||||
if view.viewport_shade == 'SOLID':
|
||||
col.prop(view, "use_matcap")
|
||||
if view.use_matcap:
|
||||
|
||||
@@ -740,6 +740,7 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
|
||||
|
||||
col.prop(brush, "vertex_tool", text="Blend")
|
||||
|
||||
|
||||
class VIEW3D_PT_tools_brush_overlay(Panel, View3DPaintPanel):
|
||||
bl_label = "Overlay"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
@@ -753,8 +754,7 @@ class VIEW3D_PT_tools_brush_overlay(Panel, View3DPaintPanel):
|
||||
context.vertex_paint_object or
|
||||
context.weight_paint_object or
|
||||
context.image_paint_object))
|
||||
|
||||
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
@@ -764,7 +764,7 @@ class VIEW3D_PT_tools_brush_overlay(Panel, View3DPaintPanel):
|
||||
tex_slot_mask = brush.mask_texture_slot
|
||||
|
||||
col = layout.column()
|
||||
|
||||
|
||||
col.label(text="Curve:")
|
||||
|
||||
row = col.row(align=True)
|
||||
@@ -778,7 +778,7 @@ class VIEW3D_PT_tools_brush_overlay(Panel, View3DPaintPanel):
|
||||
sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
|
||||
|
||||
col.active = brush.brush_capabilities.has_overlay
|
||||
|
||||
|
||||
if context.image_paint_object or context.sculpt_object or context.vertex_paint_object:
|
||||
col.label(text="Texture:")
|
||||
row = col.row(align=True)
|
||||
|
||||
@@ -147,14 +147,14 @@ void *CustomData_add_layer_named(struct CustomData *data, int type, int alloctyp
|
||||
void *layer, int totelem, const char *name);
|
||||
|
||||
/* frees the active or first data layer with the give type.
|
||||
* returns 1 on succes, 0 if no layer with the given type is found
|
||||
* returns 1 on success, 0 if no layer with the given type is found
|
||||
*
|
||||
* in editmode, use EDBM_data_layer_free instead of this function
|
||||
*/
|
||||
bool CustomData_free_layer(struct CustomData *data, int type, int totelem, int index);
|
||||
|
||||
/* frees the layer index with the give type.
|
||||
* returns 1 on succes, 0 if no layer with the given type is found
|
||||
* returns 1 on success, 0 if no layer with the given type is found
|
||||
*
|
||||
* in editmode, use EDBM_data_layer_free instead of this function
|
||||
*/
|
||||
|
||||
@@ -204,7 +204,7 @@ void detectBitmapFont(ImBuf *ibuf)
|
||||
printf("detectBitmapFont :Unsupported version %d\n", (int)version);
|
||||
}
|
||||
|
||||
/* on succes ibuf->userdata points to the bitmapfont */
|
||||
/* on success ibuf->userdata points to the bitmapfont */
|
||||
if (ibuf->userdata) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -3242,7 +3242,8 @@ int autocomplete_end(AutoComplete *autocpl, char *autoname)
|
||||
if (autocpl->truncate[0]) {
|
||||
if (autocpl->matches == 1) {
|
||||
match = AUTOCOMPLETE_FULL_MATCH;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
match = AUTOCOMPLETE_PARTIAL_MATCH;
|
||||
}
|
||||
BLI_strncpy(autoname, autocpl->truncate, autocpl->maxlen);
|
||||
|
||||
@@ -218,7 +218,7 @@ typedef struct FlyInfo {
|
||||
short persp_backup; /* remember if were ortho or not, only used for restoring the view if it was a ortho view */
|
||||
|
||||
/* are we flying an ortho camera in perspective view,
|
||||
* which was originall in ortho view?
|
||||
* which was originally in ortho view?
|
||||
* could probably figure it out but better be explicit */
|
||||
bool is_ortho_cam;
|
||||
void *obtfm; /* backup the objects transform */
|
||||
|
||||
@@ -172,7 +172,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
|
||||
}
|
||||
|
||||
/* if no dverts (i.e. no data for vertex groups exists), we've got an
|
||||
* inconsistent situation, so free hashes and return oirginal mesh
|
||||
* inconsistent situation, so free hashes and return original mesh
|
||||
*/
|
||||
dvert = dm->getVertDataArray(dm, CD_MDEFORMVERT);
|
||||
if (dvert == NULL) {
|
||||
|
||||
Reference in New Issue
Block a user