style cleanup: pep8 + picky edits
authorCampbell Barton <ideasman42@gmail.com>
Thu, 8 Mar 2012 05:36:05 +0000 (05:36 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 8 Mar 2012 05:36:05 +0000 (05:36 +0000)
12 files changed:
doc/python_api/sphinx_doc_gen.py
intern/cycles/blender/addon/enums.py
intern/cycles/blender/addon/ui.py
release/scripts/modules/bpy_types.py
release/scripts/startup/bl_operators/uvcalc_follow_active.py
release/scripts/startup/bl_ui/properties_data_curve.py
release/scripts/startup/bl_ui/properties_data_modifier.py
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/blenlib/CMakeLists.txt
source/blender/editors/space_view3d/drawobject.c
source/blender/makesrna/intern/CMakeLists.txt

index 7cfcfcf6085c62671b3a95cd42a8ed3af35e3f51..a4fa27fd90db1143ea64adbdb2a74797b0bdd9bf 100644 (file)
@@ -79,6 +79,7 @@ PLATFORM = platform().split('-')[0].lower()    # 'linux', 'darwin', 'windows'
 
 SCRIPT_DIR = os.path.dirname(__file__)
 
+
 def handle_args():
     '''
     Parse the args passed to Blender after "--", ignored by Blender
@@ -127,7 +128,6 @@ def handle_args():
                         help="Write the rst file of the bpy module (default=False)",
                         required=False)
 
-    
     # parse only the args passed after '--'
     argv = []
     if "--" in sys.argv:
@@ -227,7 +227,7 @@ RNA_BLACKLIST = {
 
 def sphinx_dirs():
     '''
-    Directories where we write rst files for Sphinx 
+    Directories where we write rst files for Sphinx
     '''
     if not os.path.exists(ARGS.output_dir):
         os.mkdir(ARGS.output_dir)
@@ -237,7 +237,7 @@ def sphinx_dirs():
     sphinx_in_tmp = sphinx_in + "-tmp"
     if not os.path.exists(sphinx_in):
         os.mkdir(sphinx_in)
-    
+
     return sphinx_in, sphinx_in_tmp, sphinx_out
 
 SPHINX_THEME = ARGS.sphinx_theme
@@ -258,7 +258,7 @@ version_strings = [str(v) for v in bpy.app.version]
 BLENDER_VERSION_DOTS = ".".join(version_strings)    # '2.62.1'
 if bpy.app.build_revision != b"Unknown":
     # converting bytes to strings, due to #30154
-    BLENDER_VERSION_DOTS += " r" + str(bpy.app.build_revision, 'utf_8') # '2.62.1 r44584'
+    BLENDER_VERSION_DOTS += " r" + str(bpy.app.build_revision, 'utf_8')  # '2.62.1 r44584'
 
 BLENDER_VERSION_PDF = "_".join(version_strings)    # '2_62_1'
 if bpy.app.version_cycle == "release":
@@ -1203,9 +1203,9 @@ def pyrna2sphinx(basepath):
                     else:
                         url_base = API_BASEURL
 
-                    fw("   :file: `%s <%s/%s>`_:%d\n\n" % (location[0], 
-                                                           url_base, 
-                                                           location[0], 
+                    fw("   :file: `%s <%s/%s>`_:%d\n\n" % (location[0],
+                                                           url_base,
+                                                           location[0],
                                                            location[1]))
 
             file.close()
@@ -1221,7 +1221,7 @@ def write_sphinx_conf_py(basepath):
     filepath = os.path.join(basepath, "conf.py")
     file = open(filepath, "w", encoding="utf-8")
     fw = file.write
-    
+
     fw("project = 'Blender'\n")
     # fw("master_doc = 'index'\n")
     fw("copyright = u'Blender Foundation'\n")
@@ -1238,7 +1238,7 @@ def write_sphinx_conf_py(basepath):
     # not helpful since the source is generated, adds to upload size.
     fw("html_copy_source = False\n")
     fw("\n")
-    
+
     # needed for latex, pdf gen
     fw("latex_documents = [ ('contents', 'contents.tex', 'Blender Index', 'Blender Foundation', 'manual'), ]\n")
     fw("latex_paper_size = 'a4paper'\n")
@@ -1283,26 +1283,26 @@ def write_rst_contents(basepath):
     fw("\n")
     fw(".. toctree::\n")
     fw("   :maxdepth: 1\n\n")
-    
+
     app_modules = [
         "bpy.context",  # note: not actually a module
         "bpy.data",     # note: not actually a module
         "bpy.ops",
         "bpy.types",
-        
+
         # py modules
         "bpy.utils",
         "bpy.path",
         "bpy.app",
         "bpy.app.handlers",
-        
+
         # C modules
         "bpy.props"
     ]
     for mod in app_modules:
         if mod not in EXCLUDE_MODULES:
             fw("   %s\n\n" % mod)
+
     fw("==================\n")
     fw("Standalone Modules\n")
     fw("==================\n")
@@ -1475,12 +1475,12 @@ def write_rst_importable_modules(basepath):
 
 
 def copy_handwritten_rsts(basepath):
-    
+
     # info docs
     if not EXCLUDE_INFO_DOCS:
         for info, info_desc in INFO_DOCS:
             shutil.copy2(os.path.join(RST_DIR, info), basepath)
-    
+
     # TODO put this docs in blender's code and use import as per modules above
     handwritten_modules = [
         "bge.types",
@@ -1522,13 +1522,13 @@ def rna2sphinx(basepath):
             pycontext2sphinx(basepath)
 
     # internal modules
-    write_rst_bpy(basepath)                 # bpy, disabled by default    
+    write_rst_bpy(basepath)                 # bpy, disabled by default
     write_rst_types_index(basepath)         # bpy.types
     write_rst_ops_index(basepath)           # bpy.ops
     pyrna2sphinx(basepath)                  # bpy.types.* and bpy.ops.*
     write_rst_data(basepath)                # bpy.data
     write_rst_importable_modules(basepath)
-    
+
     # copy the other rsts
     copy_handwritten_rsts(basepath)
 
index 889a8f03552565e6c004116ae2d8b96b8a9e0e74..b4b1646c10ddae42bf197ffe33ddcbed925a1805 100644 (file)
 from . import engine
 
 devices = (
-    ("CPU", "CPU", "Use CPU for rendering"),
-    ("GPU", "GPU Compute", "Use GPU compute device for rendering, configured in user preferences"))
+    ('CPU', "CPU", "Use CPU for rendering"),
+    ('GPU', "GPU Compute", "Use GPU compute device for rendering, configured in user preferences"))
 
 feature_set = (
-    ("SUPPORTED", "Supported", "Only use finished and supported features"),
-    ("EXPERIMENTAL", "Experimental", "Use experimental and incomplete features that might be broken or change in the future"),
+    ('SUPPORTED', "Supported", "Only use finished and supported features"),
+    ('EXPERIMENTAL', "Experimental", "Use experimental and incomplete features that might be broken or change in the future"),
     )
 
 shading_systems = (
-    ("GPU_COMPATIBLE", "GPU Compatible", "Restricted shading system compatible with GPU rendering"),
-    ("OSL", "Open Shading Language", "Open Shading Language shading system that only runs on the CPU"),
+    ('GPU_COMPATIBLE', "GPU Compatible", "Restricted shading system compatible with GPU rendering"),
+    ('OSL', "Open Shading Language", "Open Shading Language shading system that only runs on the CPU"),
     )
 
 displacement_methods = (
-    ("BUMP", "Bump", "Bump mapping to simulate the appearance of displacement"),
-    ("TRUE", "True", "Use true displacement only, requires fine subdivision"),
-    ("BOTH", "Both", "Combination of displacement and bump mapping"),
+    ('BUMP', "Bump", "Bump mapping to simulate the appearance of displacement"),
+    ('TRUE', "True", "Use true displacement only, requires fine subdivision"),
+    ('BOTH', "Both", "Combination of displacement and bump mapping"),
     )
 
 bvh_types = (
-    ("DYNAMIC_BVH", "Dynamic BVH", "Objects can be individually updated, at the cost of slower render time"),
-    ("STATIC_BVH", "Static BVH", "Any object modification requires a complete BVH rebuild, but renders faster"),
+    ('DYNAMIC_BVH', "Dynamic BVH", "Objects can be individually updated, at the cost of slower render time"),
+    ('STATIC_BVH', "Static BVH", "Any object modification requires a complete BVH rebuild, but renders faster"),
     )
 
 filter_types = (
-    ("BOX", "Box", "Box filter"),
-    ("GAUSSIAN", "Gaussian", "Gaussian filter"),
+    ('BOX', "Box", "Box filter"),
+    ('GAUSSIAN', "Gaussian", "Gaussian filter"),
     )
 
 aperture_types = (
-    ("RADIUS", "Radius", "Directly change the size of the aperture"),
-    ("FSTOP", "F/stop", "Change the size of the aperture by f/stops"),
+    ('RADIUS', "Radius", "Directly change the size of the aperture"),
+    ('FSTOP', "F/stop", "Change the size of the aperture by f/stops"),
     )
-
index a8f499cf324fd71888713523ff5aaab2dd7dda51..5897ddb6358f9f21f362db62169179f1d0dd25be 100644 (file)
@@ -489,6 +489,7 @@ class CyclesWorld_PT_surface(CyclesButtonsPanel, Panel):
         if not panel_node_draw(layout, world, 'OUTPUT_WORLD', 'Surface'):
             layout.prop(world, "horizon_color", text="Color")
 
+
 class CyclesWorld_PT_volume(CyclesButtonsPanel, Panel):
     bl_label = "Volume"
     bl_context = "world"
@@ -507,6 +508,7 @@ class CyclesWorld_PT_volume(CyclesButtonsPanel, Panel):
         world = context.world
         panel_node_draw(layout, world, 'OUTPUT_WORLD', 'Volume')
 
+
 class CyclesWorld_PT_ambient_occlusion(CyclesButtonsPanel, Panel):
     bl_label = "Ambient Occlusion"
     bl_context = "world"
@@ -529,6 +531,7 @@ class CyclesWorld_PT_ambient_occlusion(CyclesButtonsPanel, Panel):
         split.prop(light, "ao_factor", text="Factor")
         split.prop(light, "distance", text="Distance")
 
+
 class CyclesWorld_PT_settings(CyclesButtonsPanel, Panel):
     bl_label = "Settings"
     bl_context = "world"
@@ -551,6 +554,7 @@ class CyclesWorld_PT_settings(CyclesButtonsPanel, Panel):
         row.active = cworld.sample_as_light
         row.prop(cworld, "sample_map_resolution")
 
+
 class CyclesMaterial_PT_surface(CyclesButtonsPanel, Panel):
     bl_label = "Surface"
     bl_context = "material"
index a43d26b2c89c0f6df5427102113d54d753c124ef..8c02e845071f8fad41391f426a48062d38e76775 100644 (file)
@@ -446,6 +446,7 @@ class MeshFace(StructRNA):
                     ord_ind(verts[3], verts[0]),
                     )
 
+
 class MeshPolygon(StructRNA):
     __slots__ = ()
 
@@ -453,7 +454,7 @@ class MeshPolygon(StructRNA):
     def edge_keys(self):
         verts = self.vertices[:]
         vlen = len(self.vertices)
-        return [ord_ind(verts[i], verts[(i+1) % vlen]) for i in range(vlen)]
+        return [ord_ind(verts[i], verts[(i + 1) % vlen]) for i in range(vlen)]
 
     @property
     def loops(self):
@@ -461,6 +462,7 @@ class MeshPolygon(StructRNA):
         end = start + self.loop_total
         return range(start, end)
 
+
 class Text(bpy_types.ID):
     __slots__ = ()
 
index 0df86a3869e11fd97f9008de4d7fb872360979ad..d2a5d83c188e365da1cf88c7265c270acc6255b9 100644 (file)
@@ -54,7 +54,7 @@ def extend(obj, operator, EXTEND_MODE):
 
         def face_edge_vs(vi):
             vlen = len(vi)
-            return [(vi[i], vi[(i+1) % vlen]) for i in range(vlen)]
+            return [(vi[i], vi[(i + 1) % vlen]) for i in range(vlen)]
 
         vidx_source = face_source.vertices
         vidx_target = face_target.vertices
index fb365ea1fa4cee31bdf4a956de1b6b24503b9340..b8e531dd72997c69844a33b0b2eec144b02d7ece 100644 (file)
@@ -197,7 +197,6 @@ class DATA_PT_pathanim(CurveButtonsPanelCurve, Panel):
         layout.prop(curve, "path_duration", text="Frames")
         layout.prop(curve, "eval_time")
 
-
         # these are for paths only
         row = layout.row()
         row.prop(curve, "use_path_follow")
index f3e4942f7320ca6c7e4dafa0e8712b8efe4f71bc..2dad06836f3bc6089b226eed362cfa87683c0f8e 100644 (file)
@@ -126,7 +126,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
         split = layout.split()
         split.prop(md, "use_even_offset")
         split.prop(md, "use_distance_offset")
-        # -- end 
+        # -- end
 
         layout.label(text="Limit Method:")
         layout.row().prop(md, "limit_method", expand=True)
index aee9c20d25cf2eea945270ff081d118bdc0bb192..e639300998a9a2ce2d238b2560fed442212fd4a2 100644 (file)
@@ -527,10 +527,10 @@ class VIEW3D_MT_select_edit_mesh(Menu):
 
         layout.separator()
 
-        layout.operator("mesh.select_by_number_vertices", text = "By Number of Verts")
+        layout.operator("mesh.select_by_number_vertices", text="By Number of Verts")
         if context.scene.tool_settings.mesh_select_mode[2] == False:
             layout.operator("mesh.select_non_manifold", text="Non Manifold")
-        layout.operator("mesh.select_loose_verts", text = "Loose Verts/Edges")
+        layout.operator("mesh.select_loose_verts", text="Loose Verts/Edges")
         layout.operator("mesh.select_similar", text="Similar")
 
         layout.separator()
@@ -1032,7 +1032,7 @@ class VIEW3D_MT_object_game(Menu):
 
         layout.operator("object.game_property_clear")
 
-        
+
 # ********** Brush menu **********
 class VIEW3D_MT_brush(Menu):
     bl_label = "Brush"
index 75636ab5c23dcbb98065c385771b62c3cbba696c..5ca2e876e28a23c30f80699e56ea40ca8d5f4f05 100644 (file)
@@ -3012,7 +3012,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
 
        has_edge_origindex = CustomData_has_layer(&ccgdm->dm.edgeData, CD_ORIGINDEX);
 
-       faceNum = 0;
+
        loopindex = loopindex2 = 0; //current loop index
        for (index = 0; index < totface; index++) {
                CCGFace *f = ccgdm->faceMap[index].face;
index 76019f01030c6b5ab18851ae6397c4ba4d0b14cb..d69ecbe325b3b573b3a961d24fde335ae9d1d66f 100644 (file)
@@ -103,6 +103,7 @@ set(SRC
        BLI_dynlib.h
        BLI_dynstr.h
        BLI_edgehash.h
+       BLI_editVert.h
        BLI_fileops.h
        BLI_fileops_types.h
        BLI_fnmatch.h
index 73e7bbc6e90be818da55fa18c7229e23c4ea52ec..aad6530f0491c1942e2cccd933f85f4a29529f49 100644 (file)
@@ -1562,7 +1562,7 @@ static void draw_viewport_object_reconstruction(Scene *scene, Base *base, View3D
        for (track= tracksbase->first; track; track= track->next) {
                int selected= TRACK_SELECTED(track);
 
-               if ((draw_selected && !selected) || (draw_selected && !selected))
+               if (draw_selected && !selected)
                        continue;
 
                if ((track->flag&TRACK_HAS_BUNDLE)==0)
index 2782aa8aca57499769068c6c77709350642baf15..6f8e7656a833cc62bcc2211a00817d6737df97b9 100644 (file)
@@ -280,6 +280,7 @@ set(SRC
        rna_internal.h
        rna_internal_types.h
        rna_nodetree_types.h
+       rna_mesh_utils.h
 )
 
 blender_add_lib(bf_rna "${SRC}" "${INC}" "${INC_SYS}")