forked from bartvdbraak/blender
fix for various python bugs and remove unused var.
This commit is contained in:
parent
de7592b489
commit
301e5b4ea0
@ -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
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
'''
|
||||
|
@ -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__)
|
||||
|
@ -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)
|
||||
|
||||
|
||||
|
@ -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()
|
||||
|
@ -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")
|
||||
|
@ -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 #
|
||||
|
@ -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')
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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()
|
||||
|
||||
|
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user