bugfix [#26094] Going to Bone Roll menu brings up python error
also correct for pep8 warnings.
This commit is contained in:
parent
78c135d93e
commit
fee5363912
@ -62,11 +62,6 @@ def source_list(path, filename_check=None):
|
|||||||
|
|
||||||
|
|
||||||
# extension checking
|
# extension checking
|
||||||
def is_c_header(filename):
|
|
||||||
ext = splitext(filename)[1]
|
|
||||||
return (ext in (".h", ".hpp", ".hxx"))
|
|
||||||
|
|
||||||
|
|
||||||
def is_cmake(filename):
|
def is_cmake(filename):
|
||||||
ext = splitext(filename)[1]
|
ext = splitext(filename)[1]
|
||||||
return (ext == ".cmake") or (filename == "CMakeLists.txt")
|
return (ext == ".cmake") or (filename == "CMakeLists.txt")
|
||||||
|
@ -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.write("%s %dx%d\n" % (image.filepath, image.size[0], image.size[1]))
|
||||||
|
|
||||||
file.close()
|
file.close()
|
||||||
|
|
||||||
|
|
||||||
|
@ -423,7 +423,7 @@ def pycontext2sphinx(BASEPATH):
|
|||||||
if len(type_map) > len(unique):
|
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]))
|
raise Exception("Some types are not used: %s" % str([member for member in type_map if member not in unique]))
|
||||||
else:
|
else:
|
||||||
pass # will have raised an error above
|
pass # will have raised an error above
|
||||||
|
|
||||||
|
|
||||||
def rna2sphinx(BASEPATH):
|
def rna2sphinx(BASEPATH):
|
||||||
|
@ -78,6 +78,7 @@ class DiscontFilterOp(bpy.types.Operator):
|
|||||||
main(context)
|
main(context)
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
def register():
|
def register():
|
||||||
bpy.utils.register_module(__name__)
|
bpy.utils.register_module(__name__)
|
||||||
|
|
||||||
|
@ -387,6 +387,7 @@ class WM_OT_context_cycle_array(bpy.types.Operator):
|
|||||||
class WM_MT_context_menu_enum(bpy.types.Menu):
|
class WM_MT_context_menu_enum(bpy.types.Menu):
|
||||||
bl_label = ""
|
bl_label = ""
|
||||||
data_path = "" # BAD DESIGN, set from operator below.
|
data_path = "" # BAD DESIGN, set from operator below.
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
data_path = self.data_path
|
data_path = self.data_path
|
||||||
value = context_path_validate(bpy.context, 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'}
|
return {'PASS_THROUGH'}
|
||||||
base_path, prop_string = data_path.rsplit(".", 1)
|
base_path, prop_string = data_path.rsplit(".", 1)
|
||||||
value_base = context_path_validate(context, base_path)
|
value_base = context_path_validate(context, base_path)
|
||||||
|
|
||||||
values = [(i.name, i.identifier) for i in value_base.bl_rna.properties[prop_string].items]
|
values = [(i.name, i.identifier) for i in value_base.bl_rna.properties[prop_string].items]
|
||||||
|
|
||||||
for name, identifier in values:
|
for name, identifier in values:
|
||||||
@ -408,7 +409,7 @@ class WM_OT_context_menu_enum(bpy.types.Operator):
|
|||||||
bl_label = "Context Enum Menu"
|
bl_label = "Context Enum Menu"
|
||||||
bl_options = {'UNDO'}
|
bl_options = {'UNDO'}
|
||||||
data_path = rna_path_prop
|
data_path = rna_path_prop
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
data_path = self.data_path
|
data_path = self.data_path
|
||||||
WM_MT_context_menu_enum.data_path = data_path
|
WM_MT_context_menu_enum.data_path = data_path
|
||||||
|
@ -26,7 +26,7 @@ def register():
|
|||||||
|
|
||||||
|
|
||||||
def unregister():
|
def unregister():
|
||||||
bpy.utils.unregister_class(OBJECT_PT_hello)
|
bpy.utils.unregister_class(OBJECT_PT_hello)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
@ -157,20 +157,20 @@ class DATA_PT_bone_groups(ArmatureButtonsPanel, bpy.types.Panel):
|
|||||||
class DATA_PT_pose_library(ArmatureButtonsPanel, bpy.types.Panel):
|
class DATA_PT_pose_library(ArmatureButtonsPanel, bpy.types.Panel):
|
||||||
bl_label = "Pose Library"
|
bl_label = "Pose Library"
|
||||||
bl_options = {'DEFAULT_CLOSED'}
|
bl_options = {'DEFAULT_CLOSED'}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
return (context.object and context.object.type == 'ARMATURE' and context.object.pose)
|
return (context.object and context.object.type == 'ARMATURE' and context.object.pose)
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
ob = context.object
|
ob = context.object
|
||||||
poselib = ob.pose_library
|
poselib = ob.pose_library
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.template_ID(ob, "pose_library", new="poselib.new", unlink="poselib.unlink")
|
row.template_ID(ob, "pose_library", new="poselib.new", unlink="poselib.unlink")
|
||||||
|
|
||||||
if poselib:
|
if poselib:
|
||||||
activePoseIndex = poselib.pose_markers.active_index
|
activePoseIndex = poselib.pose_markers.active_index
|
||||||
if len(poselib.pose_markers):
|
if len(poselib.pose_markers):
|
||||||
@ -179,23 +179,23 @@ class DATA_PT_pose_library(ArmatureButtonsPanel, bpy.types.Panel):
|
|||||||
else:
|
else:
|
||||||
activePose = None
|
activePose = None
|
||||||
activePoseName = None
|
activePoseName = None
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.template_list(poselib, "pose_markers", poselib.pose_markers, "active_index", rows=5)
|
row.template_list(poselib, "pose_markers", poselib.pose_markers, "active_index", rows=5)
|
||||||
|
|
||||||
col = row.column(align=True)
|
col = row.column(align=True)
|
||||||
col.active = (poselib.library is None)
|
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
|
# add/replace options to be used properly
|
||||||
col.operator("poselib.pose_add", icon='ZOOMIN', text="")
|
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("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_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
|
col.operator("poselib.browse_interactive", icon='ZOOM_SELECTED', text="").pose_index = activePoseIndex
|
||||||
|
|
||||||
# TODO: "validate action" operator to be restored
|
# TODO: "validate action" operator to be restored
|
||||||
|
|
||||||
|
|
||||||
|
@ -383,7 +383,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel):
|
|||||||
col.prop(md, "use_mirror_v", text="V")
|
col.prop(md, "use_mirror_v", text="V")
|
||||||
|
|
||||||
col = layout.column()
|
col = layout.column()
|
||||||
|
|
||||||
if md.use_mirror_merge == True:
|
if md.use_mirror_merge == True:
|
||||||
col.prop(md, "merge_threshold")
|
col.prop(md, "merge_threshold")
|
||||||
col.label(text="Mirror Object:")
|
col.label(text="Mirror Object:")
|
||||||
|
@ -823,7 +823,7 @@ class PARTICLE_PT_render(ParticleButtonsPanel, bpy.types.Panel):
|
|||||||
|
|
||||||
elif part.render_type == 'BILLBOARD':
|
elif part.render_type == 'BILLBOARD':
|
||||||
ob = context.object
|
ob = context.object
|
||||||
|
|
||||||
sub.label(text="Align:")
|
sub.label(text="Align:")
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
@ -850,7 +850,7 @@ class PARTICLE_PT_render(ParticleButtonsPanel, bpy.types.Panel):
|
|||||||
col = layout.column()
|
col = layout.column()
|
||||||
col.active = part.billboard_uv_split > 1
|
col.active = part.billboard_uv_split > 1
|
||||||
col.prop_search(psys, "billboard_split_uv", ob.data, "uv_textures")
|
col.prop_search(psys, "billboard_split_uv", ob.data, "uv_textures")
|
||||||
|
|
||||||
row = col.row()
|
row = col.row()
|
||||||
row.label(text="Animate:")
|
row.label(text="Animate:")
|
||||||
row.prop(part, "billboard_animation", text="")
|
row.prop(part, "billboard_animation", text="")
|
||||||
|
@ -274,7 +274,7 @@ def basic_force_field_falloff_ui(self, context, field):
|
|||||||
sub = row.row()
|
sub = row.row()
|
||||||
sub.active = field.use_min_distance
|
sub.active = field.use_min_distance
|
||||||
sub.prop(field, "distance_min", text="Minimum")
|
sub.prop(field, "distance_min", text="Minimum")
|
||||||
|
|
||||||
col = split.column()
|
col = split.column()
|
||||||
row = col.row(align=True)
|
row = col.row(align=True)
|
||||||
row.prop(field, "use_max_distance", text="")
|
row.prop(field, "use_max_distance", text="")
|
||||||
|
@ -62,10 +62,10 @@ def context_tex_datablock(context):
|
|||||||
idblock = context.brush
|
idblock = context.brush
|
||||||
if idblock:
|
if idblock:
|
||||||
return idblock
|
return idblock
|
||||||
|
|
||||||
if context.particle_system:
|
if context.particle_system:
|
||||||
idblock = context.particle_system.settings
|
idblock = context.particle_system.settings
|
||||||
|
|
||||||
return idblock
|
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")
|
factor_but(col, "use_map_zenith_down", "zenith_down_factor", "Zenith Down")
|
||||||
elif isinstance(idblock, bpy.types.ParticleSettings):
|
elif isinstance(idblock, bpy.types.ParticleSettings):
|
||||||
split = layout.split()
|
split = layout.split()
|
||||||
|
|
||||||
col = split.column()
|
col = split.column()
|
||||||
col.label(text="General:")
|
col.label(text="General:")
|
||||||
factor_but(col, "use_map_time", "time_factor", "Time")
|
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_damp", "damp_factor", "Damp")
|
||||||
factor_but(col, "use_map_gravity", "gravity_factor", "Gravity")
|
factor_but(col, "use_map_gravity", "gravity_factor", "Gravity")
|
||||||
factor_but(col, "use_map_field", "field_factor", "Force Fields")
|
factor_but(col, "use_map_field", "field_factor", "Force Fields")
|
||||||
|
|
||||||
layout.label(text="Hair:")
|
layout.label(text="Hair:")
|
||||||
|
|
||||||
split = layout.split()
|
split = layout.split()
|
||||||
|
|
||||||
col = split.column()
|
col = split.column()
|
||||||
factor_but(col, "use_map_length", "length_factor", "Length")
|
factor_but(col, "use_map_length", "length_factor", "Length")
|
||||||
factor_but(col, "use_map_clump", "clump_factor", "Clump")
|
factor_but(col, "use_map_clump", "clump_factor", "Clump")
|
||||||
|
|
||||||
col = split.column()
|
col = split.column()
|
||||||
factor_but(col, "use_map_kink", "kink_factor", "Kink")
|
factor_but(col, "use_map_kink", "kink_factor", "Kink")
|
||||||
factor_but(col, "use_map_rough", "rough_factor", "Rough")
|
factor_but(col, "use_map_rough", "rough_factor", "Rough")
|
||||||
|
|
||||||
layout.separator()
|
layout.separator()
|
||||||
|
|
||||||
if not isinstance(idblock, bpy.types.ParticleSettings):
|
if not isinstance(idblock, bpy.types.ParticleSettings):
|
||||||
split = layout.split()
|
split = layout.split()
|
||||||
|
|
||||||
|
@ -98,7 +98,6 @@ class NLA_MT_select(bpy.types.Menu):
|
|||||||
layout.operator("nla.select_leftright", text="After Current Frame").mode = 'RIGHT'
|
layout.operator("nla.select_leftright", text="After Current Frame").mode = 'RIGHT'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class NLA_MT_marker(bpy.types.Menu):
|
class NLA_MT_marker(bpy.types.Menu):
|
||||||
bl_label = "Marker"
|
bl_label = "Marker"
|
||||||
|
|
||||||
|
@ -638,11 +638,11 @@ class USERPREF_PT_theme(bpy.types.Panel):
|
|||||||
elif theme.theme_area == 'COLOR_SETS':
|
elif theme.theme_area == 'COLOR_SETS':
|
||||||
col = split.column()
|
col = split.column()
|
||||||
|
|
||||||
for i,ui in enumerate(theme.bone_color_sets):
|
for i, ui in enumerate(theme.bone_color_sets):
|
||||||
col.label(text="Color Set %d:" % (i+1)) # i starts from 0
|
col.label(text="Color Set %d:" % (i + 1)) # i starts from 0
|
||||||
|
|
||||||
row = col.row()
|
row = col.row()
|
||||||
|
|
||||||
subsplit = row.split(percentage=0.95)
|
subsplit = row.split(percentage=0.95)
|
||||||
|
|
||||||
padding = subsplit.split(percentage=0.15)
|
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, "normal")
|
||||||
colsub.row().prop(ui, "select")
|
colsub.row().prop(ui, "select")
|
||||||
colsub.row().prop(ui, "active")
|
colsub.row().prop(ui, "active")
|
||||||
|
|
||||||
subsplit = row.split(percentage=0.85)
|
subsplit = row.split(percentage=0.85)
|
||||||
|
|
||||||
padding = subsplit.split(percentage=0.15)
|
padding = subsplit.split(percentage=0.15)
|
||||||
|
@ -1935,8 +1935,7 @@ class VIEW3D_MT_edit_armature_roll(bpy.types.Menu):
|
|||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
|
||||||
layout.operator("armature.calculate_roll", text="Recalculate with Z-Axis Up").type = 'GLOBALUP'
|
layout.operator_menu_enum("armature.calculate_roll", "type")
|
||||||
layout.operator("armature.calculate_roll", text="Recalculate with Z-Axis to Cursor").type = 'CURSOR'
|
|
||||||
|
|
||||||
layout.separator()
|
layout.separator()
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@ Example Usage:
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
def clear_scene():
|
def clear_scene():
|
||||||
import bpy
|
import bpy
|
||||||
unique_obs = set()
|
unique_obs = set()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user