bugfix [#20579] Context pinning error (pose mode)

This commit is contained in:
Campbell Barton
2010-01-30 23:48:49 +00:00
parent 08ee31990e
commit ebbd1e0b20
2 changed files with 45 additions and 8 deletions

View File

@@ -744,18 +744,14 @@ class BONE_PT_constraints(ConstraintButtonsPanel):
bl_context = "bone_constraint"
def poll(self, context):
ob = context.object
return (ob and ob.type == 'ARMATURE' and context.bone)
return (context.pose_bone)
def draw(self, context):
layout = self.layout
ob = context.object
pchan = ob.pose.bones[context.bone.name]
layout.operator_menu_enum("pose.constraint_add", "type")
for con in pchan.constraints:
for con in context.pose_bone.constraints:
self.draw_constraint(context, con)
bpy.types.register(OBJECT_PT_constraints)