Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-04-07 05:38:03 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-04-07 05:38:03 +0400
commit63d523336f3876f6dca5affd66a190df88a87747 (patch)
treeb4fb4677fe1138ae0476526d442a52b0804fa30b
parent6774e727a28186258b6bfa443da0ef7aec280be3 (diff)
freestyle lineset `tag` attribute was defined but not used, also some code cleanup.
-rw-r--r--intern/cycles/blender/addon/ui.py4
-rw-r--r--release/scripts/modules/bpy/utils.py5
-rw-r--r--release/scripts/modules/bpy_extras/mesh_utils.py6
-rw-r--r--release/scripts/modules/bpy_extras/object_utils.py3
-rw-r--r--release/scripts/startup/bl_operators/object.py3
-rw-r--r--release/scripts/startup/bl_ui/properties_freestyle.py2
-rw-r--r--release/scripts/startup/bl_ui/properties_object.py4
-rw-r--r--release/scripts/startup/bl_ui/properties_paint_common.py2
-rw-r--r--release/scripts/startup/bl_ui/space_image.py3
-rw-r--r--release/scripts/startup/bl_ui/space_node.py2
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py10
-rw-r--r--release/scripts/startup/bl_ui/space_view3d_toolbar.py5
-rw-r--r--source/blender/compositor/operations/COM_MixHueOperation.cpp2
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c8
-rw-r--r--source/blender/editors/render/render_shading.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_ops.c2
-rw-r--r--source/blender/makesrna/intern/rna_main_api.c4
-rw-r--r--source/blender/python/bmesh/bmesh_py_ops.c2
-rw-r--r--source/blender/render/intern/source/convertblender.c21
-rw-r--r--source/tests/bl_load_addons.py4
-rw-r--r--source/tests/pep8.py17
21 files changed, 70 insertions, 41 deletions
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index bd5e1b81ab6..564a62f257d 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -267,6 +267,7 @@ class CyclesRender_PT_layers(CyclesButtonsPanel, Panel):
row.prop(rl, "name")
row.prop(rd, "use_single_layer", text="", icon_only=True)
+
class CyclesRender_PT_layer_options(CyclesButtonsPanel, Panel):
bl_label = "Layer"
bl_context = "render_layer"
@@ -297,7 +298,8 @@ class CyclesRender_PT_layer_options(CyclesButtonsPanel, Panel):
col = split.column()
col.prop(rl, "samples")
col.prop(rl, "use_sky", "Use Environment")
-
+
+
class CyclesRender_PT_layer_passes(CyclesButtonsPanel, Panel):
bl_label = "Passes"
bl_context = "render_layer"
diff --git a/release/scripts/modules/bpy/utils.py b/release/scripts/modules/bpy/utils.py
index 9c4117f0953..b78105dedb5 100644
--- a/release/scripts/modules/bpy/utils.py
+++ b/release/scripts/modules/bpy/utils.py
@@ -654,8 +654,9 @@ def make_rna_paths(struct_name, prop_name, enum_name):
:type prop_name: string
:arg enum_name: Name of a RNA enum identifier.
:type enum_name: string
- :return: A triple of three "RNA paths" (most_complete_path, "struct.prop", "struct.prop:'enum'").
- If no enum_name is given, the third element will always be void.
+ :return: A triple of three "RNA paths"
+ (most_complete_path, "struct.prop", "struct.prop:'enum'").
+ If no enum_name is given, the third element will always be void.
:rtype: tuple of strings
"""
src = src_rna = src_enum = ""
diff --git a/release/scripts/modules/bpy_extras/mesh_utils.py b/release/scripts/modules/bpy_extras/mesh_utils.py
index f4fdfece947..d905964e71c 100644
--- a/release/scripts/modules/bpy_extras/mesh_utils.py
+++ b/release/scripts/modules/bpy_extras/mesh_utils.py
@@ -328,10 +328,12 @@ def ngon_tessellate(from_data, indices, fix_loops=True):
fgon to create from existing verts.
from_data: either a mesh, or a list/tuple of vectors.
- :arg indices: a list of indices to use this list is the ordered closed polyline
+ :arg indices: a list of indices to use this list
+ is the ordered closed polyline
to fill, and can be a subset of the data given.
:type indices: list
- :arg fix_loops: If this is enabled polylines that use loops to make multiple
+ :arg fix_loops: If this is enabled polylines
+ that use loops to make multiple
polylines are delt with correctly.
:type fix_loops: bool
"""
diff --git a/release/scripts/modules/bpy_extras/object_utils.py b/release/scripts/modules/bpy_extras/object_utils.py
index ab5dc3e6aee..786b7b5460e 100644
--- a/release/scripts/modules/bpy_extras/object_utils.py
+++ b/release/scripts/modules/bpy_extras/object_utils.py
@@ -191,7 +191,8 @@ class AddObjectHelper:
def object_add_grid_scale(context):
"""
- Return scale which should be applied on object data to align it to grid scale
+ Return scale which should be applied on object
+ data to align it to grid scale
"""
space_data = context.space_data
diff --git a/release/scripts/startup/bl_operators/object.py b/release/scripts/startup/bl_operators/object.py
index ae6b80865dd..b57594d14f9 100644
--- a/release/scripts/startup/bl_operators/object.py
+++ b/release/scripts/startup/bl_operators/object.py
@@ -473,7 +473,8 @@ class ShapeTransfer(Operator):
class JoinUVs(Operator):
- """Transfer UV Layouts from active to selected objects (needs matching geometry)"""
+ """Transfer UV Layouts from active to selected objects """ \
+ """(needs matching geometry)"""
bl_idname = "object.join_uvs"
bl_label = "Transfer UV Layouts"
diff --git a/release/scripts/startup/bl_ui/properties_freestyle.py b/release/scripts/startup/bl_ui/properties_freestyle.py
index 523c58bfac3..f3434525b82 100644
--- a/release/scripts/startup/bl_ui/properties_freestyle.py
+++ b/release/scripts/startup/bl_ui/properties_freestyle.py
@@ -93,7 +93,7 @@ class RENDERLAYER_UL_linesets(UIList):
layout.label("", icon_value=icon)
##ifdef WITH_FREESTYLE
-# else if (RNA_struct_is_a(itemptr->type, &RNA_SceneRenderLayer) ||
+# else if (RNA_struct_is_a(itemptr->type, &RNA_SceneRenderLayer) ||
# RNA_struct_is_a(itemptr->type, &RNA_FreestyleLineSet)) {
##else
# else if (RNA_struct_is_a(itemptr->type, &RNA_SceneRenderLayer)) {
diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py
index 7c32e72b3e3..ff8cf6ee197 100644
--- a/release/scripts/startup/bl_ui/properties_object.py
+++ b/release/scripts/startup/bl_ui/properties_object.py
@@ -222,9 +222,9 @@ class OBJECT_PT_display(ObjectButtonsPanel, Panel):
col = split.column()
col.prop(obj, "show_name", text="Name")
col.prop(obj, "show_axis", text="Axis")
-
+
obj_type = obj.type
-
+
if obj_type in {'MESH', 'CURVE', 'SURFACE', 'META', 'FONT'}:
# Makes no sense for cameras, armtures, etc.!
col.prop(obj, "show_wire", text="Wire")
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index b130a8a275d..f2566b2f2f5 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -82,7 +82,7 @@ def brush_texture_settings(layout, brush, sculpt):
else:
layout.row().prop(tex_slot, "tex_paint_map_mode", text="")
layout.separator()
-
+
if tex_slot.map_mode == 'STENCIL':
layout.operator("brush.stencil_fit_image_aspect")
diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py
index 3537ca62d93..48af461a82e 100644
--- a/release/scripts/startup/bl_ui/space_image.py
+++ b/release/scripts/startup/bl_ui/space_image.py
@@ -786,7 +786,7 @@ class IMAGE_PT_paint_stroke(BrushButtonsPanel, Panel):
col = layout.column()
col.label(text="Stroke Method:")
-
+
col.prop(brush, "stroke_method", text="")
if brush.use_anchor:
@@ -804,7 +804,6 @@ class IMAGE_PT_paint_stroke(BrushButtonsPanel, Panel):
row.prop(brush, "spacing", text="Spacing")
row.prop(brush, "use_pressure_spacing", toggle=True, text="")
-
col = layout.column()
col.separator()
diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py
index ac76b988e05..8a115c0df0d 100644
--- a/release/scripts/startup/bl_ui/space_node.py
+++ b/release/scripts/startup/bl_ui/space_node.py
@@ -151,7 +151,7 @@ class NODE_MT_select(Menu):
layout.operator("node.select_all", text="Inverse").action = 'INVERT'
layout.operator("node.select_linked_from")
layout.operator("node.select_linked_to")
-
+
layout.separator()
layout.operator("node.select_same_type")
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index be601d0b6a1..c36297a197c 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -1641,12 +1641,12 @@ class VIEW3D_MT_pose_specials(Menu):
def draw(self, context):
layout = self.layout
-
- layout.operator("paint.weight_from_bones", text="Assign Automatic from Bones").type="AUTOMATIC"
- layout.operator("paint.weight_from_bones", text="Assign from Bone Envelopes").type="ENVELOPES"
-
+
+ layout.operator("paint.weight_from_bones", text="Assign Automatic from Bones").type = 'AUTOMATIC'
+ layout.operator("paint.weight_from_bones", text="Assign from Bone Envelopes").type = 'ENVELOPES'
+
layout.separator()
-
+
layout.operator("pose.select_constraint_target")
layout.operator("pose.flip_names")
layout.operator("pose.paths_calculate")
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index ff368a682e9..30212096305 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -707,7 +707,7 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
self.prop_unified_strength(row, context, brush, "use_pressure_strength")
row = col.row(align=True)
-
+
col.prop(brush, "vertex_tool", text="Blend")
# Vertex Paint Mode #
@@ -815,7 +815,7 @@ class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel):
col = layout.column()
col.label(text="Stroke Method:")
-
+
if context.sculpt_object:
col.prop(brush, "sculpt_stroke_method", text="")
else:
@@ -880,6 +880,7 @@ class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel):
sub.prop(brush, "smooth_stroke_radius", text="Radius", slider=True)
sub.prop(brush, "smooth_stroke_factor", text="Factor", slider=True)
+
class VIEW3D_PT_tools_brush_curve(Panel, View3DPaintPanel):
bl_label = "Curve"
bl_options = {'DEFAULT_CLOSED'}
diff --git a/source/blender/compositor/operations/COM_MixHueOperation.cpp b/source/blender/compositor/operations/COM_MixHueOperation.cpp
index 8f898cf8ecf..12cd16bb73b 100644
--- a/source/blender/compositor/operations/COM_MixHueOperation.cpp
+++ b/source/blender/compositor/operations/COM_MixHueOperation.cpp
@@ -58,7 +58,7 @@ void MixHueOperation::executePixel(float output[4], float x, float y, PixelSampl
output[2] = valuem * (inputColor1[2]) + value * tmpb;
}
else {
- copy_v3_v3(output, inputColor1);
+ copy_v3_v3(output, inputColor1);
}
output[3] = inputColor1[3];
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 4f691efe950..f46721ddd62 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -3901,7 +3901,7 @@ static int edbm_mark_freestyle_edge(bContext *C, wmOperator *op)
}
DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data);
return OPERATOR_FINISHED;
}
@@ -3918,7 +3918,7 @@ void MESH_OT_mark_freestyle_edge(wmOperatorType *ot)
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "clear", 0, "Clear", "");
}
@@ -3962,7 +3962,7 @@ static int edbm_mark_freestyle_face_exec(bContext *C, wmOperator *op)
}
DAG_id_tag_update(obedit->data, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
+ WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data);
return OPERATOR_FINISHED;
}
@@ -3979,7 +3979,7 @@ void MESH_OT_mark_freestyle_face(wmOperatorType *ot)
ot->poll = ED_operator_editmesh;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "clear", 0, "Clear", "");
}
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index 5652d4c4b71..62b73b5b0c2 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -1137,7 +1137,7 @@ void SCENE_OT_freestyle_modifier_copy(wmOperatorType *ot)
ot->poll = freestyle_active_lineset_poll;
/* flags */
- ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
static int freestyle_modifier_move_exec(bContext *C, wmOperator *op)
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index d8f3f2827c5..c3b8cc0b275 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -643,7 +643,7 @@ static int stencil_fit_image_aspect_exec(bContext *C, wmOperator *UNUSED(op))
orig_area = aspx*aspy;
stencil_area = br->stencil_dimension[0]*br->stencil_dimension[1];
- factor = sqrt(stencil_area/orig_area);
+ factor = sqrt(stencil_area / orig_area);
br->stencil_dimension[0] = factor*aspx;
br->stencil_dimension[1] = factor*aspy;
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index a2f9b554d3f..b9fb269638a 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -1949,6 +1949,10 @@ void RNA_def_main_linestyles(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Line Styles", "Collection of line styles");
+ func = RNA_def_function(srna, "tag", "rna_Main_linestyle_tag");
+ parm = RNA_def_boolean(func, "value", 0, "Value", "");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+
func = RNA_def_function(srna, "new", "rna_Main_linestyles_new");
RNA_def_function_ui_description(func, "Add a new line style instance to the main database");
parm = RNA_def_string(func, "name", "FreestyleLineStyle", 0, "", "New name for the datablock");
diff --git a/source/blender/python/bmesh/bmesh_py_ops.c b/source/blender/python/bmesh/bmesh_py_ops.c
index 234dd1e5fec..8826baf81b7 100644
--- a/source/blender/python/bmesh/bmesh_py_ops.c
+++ b/source/blender/python/bmesh/bmesh_py_ops.c
@@ -102,7 +102,7 @@ static char *bmp_slots_as_args(const BMOSlotType slot_types[BMO_OP_MAX_SLOTS], c
}
BLI_dynstr_appendf(dyn_str, i ? ", %.*s=%s" : "%.*s=%s", name_len, slot_types[i].name, value);
i++;
- };
+ }
ret = BLI_dynstr_get_cstring(dyn_str);
BLI_dynstr_free(dyn_str);
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c
index aaaab319cc8..95bd967e56e 100644
--- a/source/blender/render/intern/source/convertblender.c
+++ b/source/blender/render/intern/source/convertblender.c
@@ -2731,7 +2731,8 @@ static void init_render_dm(DerivedMesh *dm, Render *re, ObjectRen *obr,
if (ffa) {
int index = (index_mf_to_mpoly) ? DM_origindex_mface_mpoly(index_mf_to_mpoly, index_mp_to_orig, a) : a;
vlr->freestyle_face_mark= (ffa[index].flag & FREESTYLE_FACE_MARK) ? 1 : 0;
- } else {
+ }
+ else {
vlr->freestyle_face_mark= 0;
}
#endif
@@ -3398,8 +3399,10 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset)
if (need_origindex) {
index_vert_orig = dm->getVertDataArray(dm, CD_ORIGINDEX);
/* double lookup for faces -> polys */
+#ifdef WITH_FREESTYLE
index_mf_to_mpoly = dm->getTessFaceDataArray(dm, CD_ORIGINDEX);
index_mp_to_orig = dm->getPolyDataArray(dm, CD_ORIGINDEX);
+#endif
}
for (a=0; a<totvert; a++, mvert++) {
@@ -3506,20 +3509,22 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset)
{
int edge_mark = 0;
- if(has_freestyle_edge_mark(edge_hash, v1, v2)) edge_mark |= R_EDGE_V1V2;
- if(has_freestyle_edge_mark(edge_hash, v2, v3)) edge_mark |= R_EDGE_V2V3;
+ if (has_freestyle_edge_mark(edge_hash, v1, v2)) edge_mark |= R_EDGE_V1V2;
+ if (has_freestyle_edge_mark(edge_hash, v2, v3)) edge_mark |= R_EDGE_V2V3;
if (!v4) {
- if(has_freestyle_edge_mark(edge_hash, v3, v1)) edge_mark |= R_EDGE_V3V1;
- } else {
- if(has_freestyle_edge_mark(edge_hash, v3, v4)) edge_mark |= R_EDGE_V3V4;
- if(has_freestyle_edge_mark(edge_hash, v4, v1)) edge_mark |= R_EDGE_V4V1;
+ if (has_freestyle_edge_mark(edge_hash, v3, v1)) edge_mark |= R_EDGE_V3V1;
+ }
+ else {
+ if (has_freestyle_edge_mark(edge_hash, v3, v4)) edge_mark |= R_EDGE_V3V4;
+ if (has_freestyle_edge_mark(edge_hash, v4, v1)) edge_mark |= R_EDGE_V4V1;
}
vlr->freestyle_edge_mark= edge_mark;
}
if (ffa) {
int index = (index_mf_to_mpoly) ? DM_origindex_mface_mpoly(index_mf_to_mpoly, index_mp_to_orig, a) : a;
vlr->freestyle_face_mark= (ffa[index].flag & FREESTYLE_FACE_MARK) ? 1 : 0;
- } else {
+ }
+ else {
vlr->freestyle_face_mark= 0;
}
#endif
diff --git a/source/tests/bl_load_addons.py b/source/tests/bl_load_addons.py
index 83bdfb42c95..f04ae64ee73 100644
--- a/source/tests/bl_load_addons.py
+++ b/source/tests/bl_load_addons.py
@@ -51,7 +51,7 @@ def test_load_addons():
addon_utils.enable(mod_name)
if mod_name not in addons:
addons_fail.append(mod_name)
-
+
if addons_fail:
print("addons failed to load (%d):" % len(addons_fail))
for mod_name in addons_fail:
@@ -94,7 +94,7 @@ def reload_addons(do_reload=True, do_reverse=True):
def main():
# first load addons, print a list of all addons that fail
test_load_addons()
-
+
reload_addons(do_reload=False, do_reverse=False)
reload_addons(do_reload=False, do_reverse=True)
reload_addons(do_reload=True, do_reverse=True)
diff --git a/source/tests/pep8.py b/source/tests/pep8.py
index cb86953e00e..3ae1828c59a 100644
--- a/source/tests/pep8.py
+++ b/source/tests/pep8.py
@@ -37,6 +37,7 @@ import os
# should be directly after the license header, ~20 in most cases
PEP8_SEEK_COMMENT = 40
SKIP_PREFIX = "./tools", "./config", "./scons", "./extern"
+SKIP_ADDONS = True
FORCE_PEP8_ALL = False
@@ -76,6 +77,10 @@ def main():
if [None for prefix in SKIP_PREFIX if f.startswith(prefix)]:
continue
+ if SKIP_ADDONS:
+ if (os.sep + "addons") in f:
+ continue
+
pep8_type = FORCE_PEP8_ALL or is_pep8(f)
if pep8_type:
@@ -98,12 +103,20 @@ def main():
print("%s:%d:0: global import bad practice" % (f, i + 1))
print("\n\n\n# running pep8...")
+
+ # these are very picky and often hard to follow
+ # while keeping common script formatting.
+ ignore = "E122", "E123", "E124", "E125", "E126", "E127", "E128"
+
for f, pep8_type in files:
+
if pep8_type == 1:
# E501:80 line length
- os.system("pep8 --repeat --ignore=E501 '%s'" % (f))
+ ignore_tmp = ignore + ("E501", )
else:
- os.system("pep8 --repeat '%s'" % (f))
+ ignore_tmp = ignore
+
+ os.system("pep8 --repeat --ignore=%s '%s'" % (",".join(ignore_tmp), f))
# pyflakes
print("\n\n\n# running pyflakes...")