bugfix [#26094] Going to Bone Roll menu brings up python error

also correct for pep8 warnings.
This commit is contained in:
Campbell Barton 2011-02-16 02:25:03 +00:00
parent 78c135d93e
commit fee5363912
15 changed files with 38 additions and 44 deletions

View 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")

View 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()

View 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):

View File

@ -78,6 +78,7 @@ class DiscontFilterOp(bpy.types.Operator):
main(context)
return {'FINISHED'}
def register():
bpy.utils.register_module(__name__)

View 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

View 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__":

View 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

View 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:")

View 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="")

View 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="")

View 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()

View 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"

View 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)

View 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()

View File

@ -39,6 +39,7 @@ Example Usage:
import os
import sys
def clear_scene():
import bpy
unique_obs = set()