fix for various python bugs and remove unused var.
authorCampbell Barton <ideasman42@gmail.com>
Sun, 10 Jul 2011 17:26:15 +0000 (17:26 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 10 Jul 2011 17:26:15 +0000 (17:26 +0000)
13 files changed:
release/scripts/modules/bpy_extras/image_utils.py
release/scripts/modules/bpy_extras/io_utils.py
release/scripts/modules/bpy_extras/mesh_utils.py
release/scripts/startup/bl_ui/properties_animviz.py
release/scripts/startup/bl_ui/properties_data_armature.py
release/scripts/startup/bl_ui/properties_data_curve.py
release/scripts/startup/bl_ui/properties_object.py
release/scripts/startup/bl_ui/properties_texture.py
release/scripts/startup/bl_ui/space_image.py
release/scripts/startup/bl_ui/space_userpref.py
release/scripts/startup/bl_ui/space_userpref_keymap.py
release/scripts/startup/bl_ui/space_view3d_toolbar.py
release/scripts/startup/keyingsets_builtins.py

index 551940b26e2ca88f44b7f577cdaa8b0359c5a0fb..f91535a0ad4a60fd742f5437d58a8756a8d8542c 100644 (file)
@@ -99,7 +99,7 @@ def load_image(imagepath,
                 return _image_load(nfilepath)
 
     if place_holder:
-        image = bpy.data.images.new(os.path.basename(filepath), 128, 128)
+        image = bpy.data.images.new(os.path.basename(imagepath), 128, 128)
         # allow the path to be resolved later
         image.filepath = imagepath
         return image
index 12c2d809132d26a53be48c68456c7b4ec7f5c723..cfa2233f7b60fed2fc76a316a05c68afa5d491a7 100644 (file)
@@ -262,7 +262,7 @@ def path_reference(filepath, base_src, base_dst, mode='AUTO', copy_subdir="", co
         filepath_abs = filepath_cpy
         mode = 'RELATIVE'
     else:
-        Excaption("invalid mode given %r" % mode)
+        raise Exception("invalid mode given %r" % mode)
 
     if mode == 'ABSOLUTE':
         return filepath_abs
index 8ed50972c548df465e37a7cb374e91e7f9bf4a46..34925ccb5e9b21468d88fff4a45e95650e11eaaf 100644 (file)
@@ -212,8 +212,6 @@ def edge_loops_from_edges(mesh, edges=None):
     if not hasattr(edges, "pop"):
         edges = edges[:]
 
-    edge_dict = {ed.key: ed for ed in mesh.edges if ed.select}
-
     while edges:
         current_edge = edges.pop()
         vert_end, vert_start = current_edge.vertices[:]
@@ -300,7 +298,7 @@ def ngon_tesselate(from_data, indices, fix_loops=True):
             if verts[i][1] == verts[i - 1][0]:
                 verts.pop(i - 1)
 
-        fill = fill_polygon([verts])
+        fill = tesselate_polygon([verts])
 
     else:
         '''
index eb1bbfd2fb15826a56befdacd237b41356674212..3b33a7ccc6100444603a03b401f7b7c80dc5297f 100644 (file)
@@ -94,4 +94,5 @@ class OnionSkinButtonsPanel():
         col.prop(arm, "show_only_ghost_selected", text="Selected Only")
 
 if __name__ == "__main__":  # only for live edit.
+    import bpy
     bpy.utils.register_module(__name__)
index 9477dc866ab21e0c0d2add7a33c14ed342dc4ce2..f2a3bac237359912d1b426dc383c90fd387b858e 100644 (file)
@@ -299,10 +299,7 @@ class DATA_PT_onion_skinning(OnionSkinButtonsPanel):  # , bpy.types.Panel): # in
         return (context.object) and (context.armature)
 
     def draw(self, context):
-        layout = self.layout
-
         ob = context.object
-
         self.draw_settings(context, ob.pose.animation_visualisation, bones=True)
 
 
index 00d8d08852ef6a5950610b5c61440be1e8c6ba91..3c88127c72403e07b265dde6e25cd003364ab0b8 100644 (file)
@@ -122,7 +122,6 @@ class DATA_PT_curve_texture_space(CurveButtonsPanel, bpy.types.Panel):
     def draw(self, context):
         layout = self.layout
 
-        ob = context.object
         curve = context.curve
 
         row = layout.row()
index ae66642e9031987a56f31f832703b0f4ac277d6d..cdbcf2cf53313a35af88035f7ce3997f0fbbb49d 100644 (file)
@@ -34,7 +34,6 @@ class OBJECT_PT_context_object(ObjectButtonsPanel, bpy.types.Panel):
     def draw(self, context):
         layout = self.layout
         space = context.space_data
-        ob = context.object
 
         if space.use_pin_id:
             layout.template_ID(space, "pin_id")
index 01890bc3c99d0de455187eeda020ff178d25af44..f0265f8db676c8a5aeee19c50d484333a22d4dc3 100644 (file)
@@ -208,7 +208,7 @@ class TextureSlotPanel(TextureButtonsPanel):
             return False
 
         engine = context.scene.render.engine
-        return TextureButtonsPanel.poll(self, context) and (engine in cls.COMPAT_ENGINES)
+        return TextureButtonsPanel.poll(cls, context) and (engine in cls.COMPAT_ENGINES)
 
 
 # Texture Type Panels #
index b1322d453fce37a68d744202e0ae02df6aba8593..722b46aba1178f13a2ad5c4a65c8688ebb952c80 100644 (file)
@@ -434,7 +434,6 @@ class IMAGE_PT_game_properties(bpy.types.Panel):
 
     @classmethod
     def poll(cls, context):
-        rd = context.scene.render
         sima = context.space_data
         # display even when not in game mode because these settings effect the 3d view
         return (sima and sima.image)  # and (rd.engine == 'BLENDER_GAME')
index c598788006c67a6d2e26e9c284e62f7ed96d583f..24b9098895320c8e624750cc6d677b9d0a62cd0a 100644 (file)
@@ -126,7 +126,7 @@ class USERPREF_MT_appconfigs(bpy.types.Menu):
     preset_operator = "wm.appconfig_activate"
 
     def draw(self, context):
-        props = self.layout.operator("wm.appconfig_default", text="Blender (default)")
+        self.layout.operator("wm.appconfig_default", text="Blender (default)")
 
         # now draw the presets
         bpy.types.Menu.draw_preset(self, context)
@@ -1124,7 +1124,6 @@ class WM_OT_addon_install(bpy.types.Operator):
         del pyfile_dir
         # done checking for exceptional case
 
-        addon_files_old = set(os.listdir(path_addons))
         addons_old = {mod.__name__ for mod in addon_utils.modules(USERPREF_PT_addons._addons_fake_modules)}
 
         #check to see if the file is in compressed format (.zip)
index e99cefb91b8c1209ba8403231b9d553a754befac..29ec6301fc1d3b6c4caab98d3f72c10c0e939c88 100644 (file)
@@ -189,9 +189,9 @@ class InputKeyMapPanel:
         if km.is_modal:
             row.label(text="", icon='LINKED')
         if km.is_user_defined:
-            op = row.operator("wm.keymap_restore", text="Restore")
+            row.operator("wm.keymap_restore", text="Restore")
         else:
-            op = row.operator("wm.keymap_edit", text="Edit")
+            row.operator("wm.keymap_edit", text="Edit")
 
         if km.show_expanded_children:
             if children:
@@ -213,7 +213,7 @@ class InputKeyMapPanel:
                 col = self.indented_layout(col, level + 1)
                 subcol = col.split(percentage=0.2).column()
                 subcol.enabled = km.is_user_defined
-                op = subcol.operator("wm.keyitem_add", text="Add New", icon='ZOOMIN')
+                subcol.operator("wm.keyitem_add", text="Add New", icon='ZOOMIN')
 
             col.separator()
 
@@ -351,9 +351,9 @@ class InputKeyMapPanel:
                 row.label()
 
                 if km.is_user_defined:
-                    op = row.operator("wm.keymap_restore", text="Restore")
+                    row.operator("wm.keymap_restore", text="Restore")
                 else:
-                    op = row.operator("wm.keymap_edit", text="Edit")
+                    row.operator("wm.keymap_edit", text="Edit")
 
                 for kmi in filtered_items:
                     self.draw_kmi(display_keymaps, kc, km, kmi, col, 1)
@@ -362,7 +362,7 @@ class InputKeyMapPanel:
                 col = self.indented_layout(layout, 1)
                 subcol = col.split(percentage=0.2).column()
                 subcol.enabled = km.is_user_defined
-                op = subcol.operator("wm.keyitem_add", text="Add New", icon='ZOOMIN')
+                subcol.operator("wm.keyitem_add", text="Add New", icon='ZOOMIN')
 
     def draw_hierarchy(self, display_keymaps, layout):
         for entry in KM_HIERARCHY:
@@ -723,9 +723,7 @@ class WM_OT_keyitem_add(bpy.types.Operator):
     bl_label = "Add Key Map Item"
 
     def execute(self, context):
-        wm = context.window_manager
         km = context.keymap
-        kc = wm.keyconfigs.default
 
         if km.is_modal:
             km.keymap_items.new_modal("", 'A', 'PRESS')  # kmi
index 52eb76d071032d303663c89123b061ffb5269af2..9a85b87a9eb4716738f514efc943a1a313a5be8b 100644 (file)
@@ -60,7 +60,6 @@ def draw_gpencil_tools(context, layout):
 
 # ********** default tools for objectmode ****************
 
-
 class VIEW3D_PT_tools_objectmode(View3DPanel, bpy.types.Panel):
     bl_context = "objectmode"
     bl_label = "Object Tools"
@@ -944,7 +943,6 @@ class VIEW3D_PT_sculpt_options(PaintPanel, bpy.types.Panel):
 
         tool_settings = context.tool_settings
         sculpt = tool_settings.sculpt
-        settings = __class__.paint_settings(context)
 
         layout.label(text="Lock:")
         row = layout.row(align=True)
@@ -974,7 +972,6 @@ class VIEW3D_PT_sculpt_symmetry(PaintPanel, bpy.types.Panel):
         layout = self.layout
 
         sculpt = context.tool_settings.sculpt
-        settings = __class__.paint_settings(context)
 
         split = layout.split()
 
index 8cb63ea48cffb2fbf41c9d0c2fdef5788ec298bd..dcc1afed74bbae6bce47325f281c01b9585ceac7 100644 (file)
@@ -407,7 +407,7 @@ class BUILTIN_KSI_DeltaRotation(bpy.types.KeyingSetInfo):
         # add the property name to the base path
         #   rotation mode affects the property used
         if data.rotation_mode == 'QUATERNION':
-            path = path_add_property(base_path, "delta_rotation_quaternion")
+            path = keyingsets_utils.path_add_property(base_path, "delta_rotation_quaternion")
         elif data.rotation_mode == 'AXIS_ANGLE':
             # XXX: for now, this is not available yet
             #path = path_add_property(base_path, "delta_rotation_axis_angle")