bugfix [#26094] Going to Bone Roll menu brings up python error
authorCampbell Barton <ideasman42@gmail.com>
Wed, 16 Feb 2011 02:25:03 +0000 (02:25 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 16 Feb 2011 02:25:03 +0000 (02:25 +0000)
also correct for pep8 warnings.

15 files changed:
build_files/cmake/cmake_consistency_check.py
doc/python_api/examples/bpy.data.py
doc/python_api/sphinx_doc_gen.py
release/scripts/op/fcurve_euler_filter.py
release/scripts/op/wm.py
release/scripts/templates/panel_simple.py
release/scripts/ui/properties_data_armature.py
release/scripts/ui/properties_data_modifier.py
release/scripts/ui/properties_particle.py
release/scripts/ui/properties_physics_common.py
release/scripts/ui/properties_texture.py
release/scripts/ui/space_nla.py
release/scripts/ui/space_userpref.py
release/scripts/ui/space_view3d.py
source/tests/batch_import.py

index 87bbc929a9342a1e9aae860abd0979aa902ad951..ec82d1b3b2312d930c65d8d0f7b5b128a9154557 100644 (file)
@@ -62,11 +62,6 @@ def source_list(path, filename_check=None):
 
 
 # extension checking
-def is_c_header(filename):
-    ext = splitext(filename)[1]
-    return (ext in (".h", ".hpp", ".hxx"))
-
-
 def is_cmake(filename):
     ext = splitext(filename)[1]
     return (ext == ".cmake") or (filename == "CMakeLists.txt")
index fc1145a523fec788b8acab11fff68aadd64bdccf..555b421ddac436585ad0dd354e46a28a48184050 100644 (file)
@@ -25,5 +25,3 @@ for image in bpy.data.images:
     file.write("%s %dx%d\n" % (image.filepath, image.size[0], image.size[1]))
 
 file.close()
-
-
index 68c14a75c5b36ee3050dec27e50ac39ee47695d0..b383499e822bfb4b2ff5f0defa847a2b12b91f9b 100644 (file)
@@ -423,7 +423,7 @@ def pycontext2sphinx(BASEPATH):
     if len(type_map) > len(unique):
         raise Exception("Some types are not used: %s" % str([member for member in type_map if member not in unique]))
     else:
-        pass # will have raised an error above
+        pass  # will have raised an error above
 
 
 def rna2sphinx(BASEPATH):
index 6332bbe309c01d0681673bbb7953f92b093f3b81..b7d456dd5253ef090dcbeb3b2058c205b34b6b46 100644 (file)
@@ -78,6 +78,7 @@ class DiscontFilterOp(bpy.types.Operator):
         main(context)
         return {'FINISHED'}
 
+
 def register():
     bpy.utils.register_module(__name__)
 
index 0210dc912df59b198fa8425c57358aba04334b98..c6ab406c29db63f65dbe04971f0fdeca39458fe8 100644 (file)
@@ -387,6 +387,7 @@ class WM_OT_context_cycle_array(bpy.types.Operator):
 class WM_MT_context_menu_enum(bpy.types.Menu):
     bl_label = ""
     data_path = ""  # BAD DESIGN, set from operator below.
+
     def draw(self, context):
         data_path = self.data_path
         value = context_path_validate(bpy.context, data_path)
@@ -394,7 +395,7 @@ class WM_MT_context_menu_enum(bpy.types.Menu):
             return {'PASS_THROUGH'}
         base_path, prop_string = data_path.rsplit(".", 1)
         value_base = context_path_validate(context, base_path)
-        
+
         values = [(i.name, i.identifier) for i in value_base.bl_rna.properties[prop_string].items]
 
         for name, identifier in values:
@@ -408,7 +409,7 @@ class WM_OT_context_menu_enum(bpy.types.Operator):
     bl_label = "Context Enum Menu"
     bl_options = {'UNDO'}
     data_path = rna_path_prop
-    
+
     def execute(self, context):
         data_path = self.data_path
         WM_MT_context_menu_enum.data_path = data_path
index ddbd4eb7aa489465bda1773e855c2bfaa2e9e3d6..e5bf70cb6546743bbd6c1574b9b06d811efed9bf 100644 (file)
@@ -26,7 +26,7 @@ def register():
 
 
 def unregister():
-    bpy.utils.unregister_class(OBJECT_PT_hello)    
+    bpy.utils.unregister_class(OBJECT_PT_hello)
 
 
 if __name__ == "__main__":
index 793b75d6d5a8538299ba779c2cee0dc64bcca0ec..4efb49ac6a8e30c2b5d94e888271e395dc47105e 100644 (file)
@@ -157,20 +157,20 @@ class DATA_PT_bone_groups(ArmatureButtonsPanel, bpy.types.Panel):
 class DATA_PT_pose_library(ArmatureButtonsPanel, bpy.types.Panel):
     bl_label = "Pose Library"
     bl_options = {'DEFAULT_CLOSED'}
-    
+
     @classmethod
     def poll(cls, context):
         return (context.object and context.object.type == 'ARMATURE' and context.object.pose)
-        
+
     def draw(self, context):
         layout = self.layout
-        
+
         ob = context.object
         poselib = ob.pose_library
-        
+
         row = layout.row()
         row.template_ID(ob, "pose_library", new="poselib.new", unlink="poselib.unlink")
-        
+
         if poselib:
             activePoseIndex = poselib.pose_markers.active_index
             if len(poselib.pose_markers):
@@ -179,23 +179,23 @@ class DATA_PT_pose_library(ArmatureButtonsPanel, bpy.types.Panel):
             else:
                 activePose = None
                 activePoseName = None
-            
+
             row = layout.row()
             row.template_list(poselib, "pose_markers", poselib.pose_markers, "active_index", rows=5)
-            
+
             col = row.column(align=True)
             col.active = (poselib.library is None)
-            
-            # invoke should still be used for 'add', as it is needed to allow 
+
+            # invoke should still be used for 'add', as it is needed to allow
             # add/replace options to be used properly
             col.operator("poselib.pose_add", icon='ZOOMIN', text="")
-            
-            col.operator_context = 'EXEC_DEFAULT' # exec not invoke, so that menu doesn't need showing
+
+            col.operator_context = 'EXEC_DEFAULT'  # exec not invoke, so that menu doesn't need showing
             col.operator("poselib.pose_remove", icon='ZOOMOUT', text="").pose = activePoseName
-            
+
             #col.operator_context = 'EXEC_DEFAULT' # exec not invoke, so modal preview loop doesn't run
             col.operator("poselib.browse_interactive", icon='ZOOM_SELECTED', text="").pose_index = activePoseIndex
-            
+
             # TODO: "validate action" operator to be restored
 
 
index e93b34fe0556e18f57ea2e92d06fd58ef04b9adb..564963130ac609298a1688fe39e156c50f4df2ac 100644 (file)
@@ -383,7 +383,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
         col.prop(md, "use_mirror_v", text="V")
 
         col = layout.column()
-        
+
         if md.use_mirror_merge == True:
             col.prop(md, "merge_threshold")
         col.label(text="Mirror Object:")
index 4b4708317169ff48440a0b528f85f50a4b27a01b..b48e354f526c5a00441e44af7bf210f653f4fd26 100644 (file)
@@ -823,7 +823,7 @@ class PARTICLE_PT_render(ParticleButtonsPanel, bpy.types.Panel):
 
         elif part.render_type == 'BILLBOARD':
             ob = context.object
-            
+
             sub.label(text="Align:")
 
             row = layout.row()
@@ -850,7 +850,7 @@ class PARTICLE_PT_render(ParticleButtonsPanel, bpy.types.Panel):
             col = layout.column()
             col.active = part.billboard_uv_split > 1
             col.prop_search(psys, "billboard_split_uv", ob.data, "uv_textures")
-            
+
             row = col.row()
             row.label(text="Animate:")
             row.prop(part, "billboard_animation", text="")
index e462bd958f77759ee8f19aa24ebdab7f655cda5f..c16a0df01673fa4bc215f7e4ea1cac7b551c6f36 100644 (file)
@@ -274,7 +274,7 @@ def basic_force_field_falloff_ui(self, context, field):
     sub = row.row()
     sub.active = field.use_min_distance
     sub.prop(field, "distance_min", text="Minimum")
-    
+
     col = split.column()
     row = col.row(align=True)
     row.prop(field, "use_max_distance", text="")
index ac3fc2d0b1daef9dcc8e6911b1bd07c47c82659b..8b652ba6e60bd65cfe05b5d8f4190a02b66e47bb 100644 (file)
@@ -62,10 +62,10 @@ def context_tex_datablock(context):
     idblock = context.brush
     if idblock:
         return idblock
-    
+
     if context.particle_system:
         idblock = context.particle_system.settings
-        
+
     return idblock
 
 
@@ -991,7 +991,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, bpy.types.Panel):
             factor_but(col, "use_map_zenith_down", "zenith_down_factor", "Zenith Down")
         elif isinstance(idblock, bpy.types.ParticleSettings):
             split = layout.split()
-            
+
             col = split.column()
             col.label(text="General:")
             factor_but(col, "use_map_time", "time_factor", "Time")
@@ -1005,21 +1005,21 @@ class TEXTURE_PT_influence(TextureSlotPanel, bpy.types.Panel):
             factor_but(col, "use_map_damp", "damp_factor", "Damp")
             factor_but(col, "use_map_gravity", "gravity_factor", "Gravity")
             factor_but(col, "use_map_field", "field_factor", "Force Fields")
-            
+
             layout.label(text="Hair:")
-            
+
             split = layout.split()
-            
+
             col = split.column()
             factor_but(col, "use_map_length", "length_factor", "Length")
             factor_but(col, "use_map_clump", "clump_factor", "Clump")
-            
+
             col = split.column()
             factor_but(col, "use_map_kink", "kink_factor", "Kink")
             factor_but(col, "use_map_rough", "rough_factor", "Rough")
 
         layout.separator()
-        
+
         if not isinstance(idblock, bpy.types.ParticleSettings):
             split = layout.split()
 
index 3ebd8b1661e9c2382e30cd146f7804e9f6197955..7388a839d6da009a04da33006b6c4802c4ef16d9 100644 (file)
@@ -98,7 +98,6 @@ class NLA_MT_select(bpy.types.Menu):
         layout.operator("nla.select_leftright", text="After Current Frame").mode = 'RIGHT'
 
 
-
 class NLA_MT_marker(bpy.types.Menu):
     bl_label = "Marker"
 
index 3f03647855c2d314298befa6332242108cae4364..e8d80f79ad894a152b038ed10c895ad16a013a49 100644 (file)
@@ -638,11 +638,11 @@ class USERPREF_PT_theme(bpy.types.Panel):
         elif theme.theme_area == 'COLOR_SETS':
             col = split.column()
 
-            for i,ui in enumerate(theme.bone_color_sets):
-                col.label(text="Color Set %d:" % (i+1)) # i starts from 0
-                
+            for i, ui in enumerate(theme.bone_color_sets):
+                col.label(text="Color Set %d:" % (i + 1))  # i starts from 0
+
                 row = col.row()
-                
+
                 subsplit = row.split(percentage=0.95)
 
                 padding = subsplit.split(percentage=0.15)
@@ -651,7 +651,7 @@ class USERPREF_PT_theme(bpy.types.Panel):
                 colsub.row().prop(ui, "normal")
                 colsub.row().prop(ui, "select")
                 colsub.row().prop(ui, "active")
-                
+
                 subsplit = row.split(percentage=0.85)
 
                 padding = subsplit.split(percentage=0.15)
index 813539579b8f8d027345609fed065c8b0061fb4c..d401b779efb00c25000f4dfac70d45b26255afe5 100644 (file)
@@ -1935,8 +1935,7 @@ class VIEW3D_MT_edit_armature_roll(bpy.types.Menu):
     def draw(self, context):
         layout = self.layout
 
-        layout.operator("armature.calculate_roll", text="Recalculate with Z-Axis Up").type = 'GLOBALUP'
-        layout.operator("armature.calculate_roll", text="Recalculate with Z-Axis to Cursor").type = 'CURSOR'
+        layout.operator_menu_enum("armature.calculate_roll", "type")
 
         layout.separator()
 
index 29b6bb8b9aaf671b655a9b0853a28c06d02aa016..5fbe38e08ce12517d59821c4159975a237f72a46 100644 (file)
@@ -39,6 +39,7 @@ Example Usage:
 import os
 import sys
 
+
 def clear_scene():
     import bpy
     unique_obs = set()