fix for various python bugs and remove unused var.
This commit is contained in:
@@ -99,7 +99,7 @@ def load_image(imagepath,
|
|||||||
return _image_load(nfilepath)
|
return _image_load(nfilepath)
|
||||||
|
|
||||||
if place_holder:
|
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
|
# allow the path to be resolved later
|
||||||
image.filepath = imagepath
|
image.filepath = imagepath
|
||||||
return image
|
return image
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ def path_reference(filepath, base_src, base_dst, mode='AUTO', copy_subdir="", co
|
|||||||
filepath_abs = filepath_cpy
|
filepath_abs = filepath_cpy
|
||||||
mode = 'RELATIVE'
|
mode = 'RELATIVE'
|
||||||
else:
|
else:
|
||||||
Excaption("invalid mode given %r" % mode)
|
raise Exception("invalid mode given %r" % mode)
|
||||||
|
|
||||||
if mode == 'ABSOLUTE':
|
if mode == 'ABSOLUTE':
|
||||||
return filepath_abs
|
return filepath_abs
|
||||||
|
|||||||
@@ -212,8 +212,6 @@ def edge_loops_from_edges(mesh, edges=None):
|
|||||||
if not hasattr(edges, "pop"):
|
if not hasattr(edges, "pop"):
|
||||||
edges = edges[:]
|
edges = edges[:]
|
||||||
|
|
||||||
edge_dict = {ed.key: ed for ed in mesh.edges if ed.select}
|
|
||||||
|
|
||||||
while edges:
|
while edges:
|
||||||
current_edge = edges.pop()
|
current_edge = edges.pop()
|
||||||
vert_end, vert_start = current_edge.vertices[:]
|
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]:
|
if verts[i][1] == verts[i - 1][0]:
|
||||||
verts.pop(i - 1)
|
verts.pop(i - 1)
|
||||||
|
|
||||||
fill = fill_polygon([verts])
|
fill = tesselate_polygon([verts])
|
||||||
|
|
||||||
else:
|
else:
|
||||||
'''
|
'''
|
||||||
|
|||||||
@@ -94,4 +94,5 @@ class OnionSkinButtonsPanel():
|
|||||||
col.prop(arm, "show_only_ghost_selected", text="Selected Only")
|
col.prop(arm, "show_only_ghost_selected", text="Selected Only")
|
||||||
|
|
||||||
if __name__ == "__main__": # only for live edit.
|
if __name__ == "__main__": # only for live edit.
|
||||||
|
import bpy
|
||||||
bpy.utils.register_module(__name__)
|
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)
|
return (context.object) and (context.armature)
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
|
||||||
|
|
||||||
ob = context.object
|
ob = context.object
|
||||||
|
|
||||||
self.draw_settings(context, ob.pose.animation_visualisation, bones=True)
|
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):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
ob = context.object
|
|
||||||
curve = context.curve
|
curve = context.curve
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ class OBJECT_PT_context_object(ObjectButtonsPanel, bpy.types.Panel):
|
|||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
space = context.space_data
|
space = context.space_data
|
||||||
ob = context.object
|
|
||||||
|
|
||||||
if space.use_pin_id:
|
if space.use_pin_id:
|
||||||
layout.template_ID(space, "pin_id")
|
layout.template_ID(space, "pin_id")
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ class TextureSlotPanel(TextureButtonsPanel):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
engine = context.scene.render.engine
|
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 #
|
# Texture Type Panels #
|
||||||
|
|||||||
@@ -434,7 +434,6 @@ class IMAGE_PT_game_properties(bpy.types.Panel):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
rd = context.scene.render
|
|
||||||
sima = context.space_data
|
sima = context.space_data
|
||||||
# display even when not in game mode because these settings effect the 3d view
|
# display even when not in game mode because these settings effect the 3d view
|
||||||
return (sima and sima.image) # and (rd.engine == 'BLENDER_GAME')
|
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"
|
preset_operator = "wm.appconfig_activate"
|
||||||
|
|
||||||
def draw(self, context):
|
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
|
# now draw the presets
|
||||||
bpy.types.Menu.draw_preset(self, context)
|
bpy.types.Menu.draw_preset(self, context)
|
||||||
@@ -1124,7 +1124,6 @@ class WM_OT_addon_install(bpy.types.Operator):
|
|||||||
del pyfile_dir
|
del pyfile_dir
|
||||||
# done checking for exceptional case
|
# 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)}
|
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)
|
#check to see if the file is in compressed format (.zip)
|
||||||
|
|||||||
@@ -189,9 +189,9 @@ class InputKeyMapPanel:
|
|||||||
if km.is_modal:
|
if km.is_modal:
|
||||||
row.label(text="", icon='LINKED')
|
row.label(text="", icon='LINKED')
|
||||||
if km.is_user_defined:
|
if km.is_user_defined:
|
||||||
op = row.operator("wm.keymap_restore", text="Restore")
|
row.operator("wm.keymap_restore", text="Restore")
|
||||||
else:
|
else:
|
||||||
op = row.operator("wm.keymap_edit", text="Edit")
|
row.operator("wm.keymap_edit", text="Edit")
|
||||||
|
|
||||||
if km.show_expanded_children:
|
if km.show_expanded_children:
|
||||||
if children:
|
if children:
|
||||||
@@ -213,7 +213,7 @@ class InputKeyMapPanel:
|
|||||||
col = self.indented_layout(col, level + 1)
|
col = self.indented_layout(col, level + 1)
|
||||||
subcol = col.split(percentage=0.2).column()
|
subcol = col.split(percentage=0.2).column()
|
||||||
subcol.enabled = km.is_user_defined
|
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()
|
col.separator()
|
||||||
|
|
||||||
@@ -351,9 +351,9 @@ class InputKeyMapPanel:
|
|||||||
row.label()
|
row.label()
|
||||||
|
|
||||||
if km.is_user_defined:
|
if km.is_user_defined:
|
||||||
op = row.operator("wm.keymap_restore", text="Restore")
|
row.operator("wm.keymap_restore", text="Restore")
|
||||||
else:
|
else:
|
||||||
op = row.operator("wm.keymap_edit", text="Edit")
|
row.operator("wm.keymap_edit", text="Edit")
|
||||||
|
|
||||||
for kmi in filtered_items:
|
for kmi in filtered_items:
|
||||||
self.draw_kmi(display_keymaps, kc, km, kmi, col, 1)
|
self.draw_kmi(display_keymaps, kc, km, kmi, col, 1)
|
||||||
@@ -362,7 +362,7 @@ class InputKeyMapPanel:
|
|||||||
col = self.indented_layout(layout, 1)
|
col = self.indented_layout(layout, 1)
|
||||||
subcol = col.split(percentage=0.2).column()
|
subcol = col.split(percentage=0.2).column()
|
||||||
subcol.enabled = km.is_user_defined
|
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):
|
def draw_hierarchy(self, display_keymaps, layout):
|
||||||
for entry in KM_HIERARCHY:
|
for entry in KM_HIERARCHY:
|
||||||
@@ -723,9 +723,7 @@ class WM_OT_keyitem_add(bpy.types.Operator):
|
|||||||
bl_label = "Add Key Map Item"
|
bl_label = "Add Key Map Item"
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
wm = context.window_manager
|
|
||||||
km = context.keymap
|
km = context.keymap
|
||||||
kc = wm.keyconfigs.default
|
|
||||||
|
|
||||||
if km.is_modal:
|
if km.is_modal:
|
||||||
km.keymap_items.new_modal("", 'A', 'PRESS') # kmi
|
km.keymap_items.new_modal("", 'A', 'PRESS') # kmi
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ def draw_gpencil_tools(context, layout):
|
|||||||
|
|
||||||
# ********** default tools for objectmode ****************
|
# ********** default tools for objectmode ****************
|
||||||
|
|
||||||
|
|
||||||
class VIEW3D_PT_tools_objectmode(View3DPanel, bpy.types.Panel):
|
class VIEW3D_PT_tools_objectmode(View3DPanel, bpy.types.Panel):
|
||||||
bl_context = "objectmode"
|
bl_context = "objectmode"
|
||||||
bl_label = "Object Tools"
|
bl_label = "Object Tools"
|
||||||
@@ -944,7 +943,6 @@ class VIEW3D_PT_sculpt_options(PaintPanel, bpy.types.Panel):
|
|||||||
|
|
||||||
tool_settings = context.tool_settings
|
tool_settings = context.tool_settings
|
||||||
sculpt = tool_settings.sculpt
|
sculpt = tool_settings.sculpt
|
||||||
settings = __class__.paint_settings(context)
|
|
||||||
|
|
||||||
layout.label(text="Lock:")
|
layout.label(text="Lock:")
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
@@ -974,7 +972,6 @@ class VIEW3D_PT_sculpt_symmetry(PaintPanel, bpy.types.Panel):
|
|||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
sculpt = context.tool_settings.sculpt
|
sculpt = context.tool_settings.sculpt
|
||||||
settings = __class__.paint_settings(context)
|
|
||||||
|
|
||||||
split = layout.split()
|
split = layout.split()
|
||||||
|
|
||||||
|
|||||||
@@ -407,7 +407,7 @@ class BUILTIN_KSI_DeltaRotation(bpy.types.KeyingSetInfo):
|
|||||||
# add the property name to the base path
|
# add the property name to the base path
|
||||||
# rotation mode affects the property used
|
# rotation mode affects the property used
|
||||||
if data.rotation_mode == 'QUATERNION':
|
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':
|
elif data.rotation_mode == 'AXIS_ANGLE':
|
||||||
# XXX: for now, this is not available yet
|
# XXX: for now, this is not available yet
|
||||||
#path = path_add_property(base_path, "delta_rotation_axis_angle")
|
#path = path_add_property(base_path, "delta_rotation_axis_angle")
|
||||||
|
|||||||
Reference in New Issue
Block a user