UI: move bone constraints panel to bone tab again.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Sat, 27 Jun 2009 14:07:17 +0000 (14:07 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Sat, 27 Jun 2009 14:07:17 +0000 (14:07 +0000)
release/ui/buttons_object_constraint.py

index 3048bdaa39978903c749dcbb3b37fb963ccb793a..f2b0b986ab9d46ce5704d537a1f82cb9b9581964 100644 (file)
@@ -529,20 +529,20 @@ class OBJECT_PT_constraints(ConstraintButtonsPanel):
 class BONE_PT_constraints(ConstraintButtonsPanel):
        __idname__ = "BONE_PT_constraints"
        __label__ = "Bone Constraints"
 class BONE_PT_constraints(ConstraintButtonsPanel):
        __idname__ = "BONE_PT_constraints"
        __label__ = "Bone Constraints"
-       __context__ = "constraint"
+       __context__ = "bone"
 
        def poll(self, context):
                ob = context.object
 
        def poll(self, context):
                ob = context.object
-               return (ob and ob.type == "ARMATURE")
+               return (ob and ob.type == "ARMATURE" and context.bone)
                
        def draw(self, context):
                ob = context.object
                
        def draw(self, context):
                ob = context.object
-               pchan = ob.pose.pose_channels[0] # XXX
+               pchan = ob.pose.pose_channels[context.bone.name]
                layout = self.layout
 
                layout = self.layout
 
-               #row = layout.row()
-               #row.item_menu_enumO("BONE_OT_constraint_add", "type")
-               #row.itemL();
+               row = layout.row()
+               row.item_menu_enumO("OBJECT_OT_constraint_add", "type")
+               row.itemL();
 
                for con in pchan.constraints:
                        self.draw_constraint(con)
 
                for con in pchan.constraints:
                        self.draw_constraint(con)