Index: release/scripts/ui/properties_data_bone.py =================================================================== --- release/scripts/ui/properties_data_bone.py (revision 25040) +++ release/scripts/ui/properties_data_bone.py (working copy) @@ -146,7 +146,66 @@ row.column().prop(pchan, "lock_scale") +class BONE_PT_IK_restrictions(BoneButtonsPanel): + bl_label = "IK Restrictions" + bl_default_closed = True + def poll(self, context): + return context.bone + + def draw(self, context): + layout = self.layout + + ob = context.object + bone = context.bone + pchan = ob.pose.bones[context.bone.name] + wide_ui = context.region.width > narrowui + + row = layout.row() + col = layout.column() + + if pchan: + col.active = pchan.has_ik + + col.label(text="Allow Rotations:") + col.prop(pchan, "ik_dof_x", text="X") + col.prop(pchan, "ik_dof_y", text="Y") + col.prop(pchan, "ik_dof_z", text="Z") + + col.label(text="Limits:") + + if wide_ui: + split = layout.split() + col = split.column() + + col.active = pchan.has_ik + col.prop(pchan, "ik_limit_x", text="X") + sub = col.column(align=True) + sub.active = (pchan.ik_limit_x and pchan.ik_dof_x) + sub.prop(pchan, "ik_max_x", text="Maximum") + sub.prop(pchan, "ik_min_x", text="Minimum") + sub.prop(pchan, "ik_stiffness_x", text="Stiffness") + + if wide_ui: + col = split.column() + col.active = (pchan.has_ik and pchan.ik_dof_y) + col.prop(pchan, "ik_limit_y", text="Y") + sub = col.column(align=True) + sub.active = pchan.ik_limit_y + sub.prop(pchan, "ik_max_y", text="Maximum") + sub.prop(pchan, "ik_min_y", text="Minimum") + sub.prop(pchan, "ik_stiffness_y", text="Stiffness") + + if wide_ui: + col = split.column() + col.active = (pchan.has_ik and pchan.ik_dof_z) + col.prop(pchan, "ik_limit_z", text="Z") + sub = col.column(align=True) + sub.active = pchan.ik_limit_z + sub.prop(pchan, "ik_max_z", text="Maximum") + sub.prop(pchan, "ik_min_z", text="Minimum") + sub.prop(pchan, "ik_stiffness_z", text="Stiffness") + class BONE_PT_relations(BoneButtonsPanel): bl_label = "Relations" @@ -299,4 +358,5 @@ bpy.types.register(BONE_PT_relations) bpy.types.register(BONE_PT_display) bpy.types.register(BONE_PT_deform) +bpy.types.register(BONE_PT_IK_restrictions) bpy.types.register(BONE_PT_properties)