Patch from William
[blender-staging.git] / release / ui / buttons_data_bone.py
index 044f7b93806f6dbd91b88208583d68003c53c6f5..397a5eb0cd4f43180bc132e7069515ecdc85b723 100644 (file)
@@ -9,10 +9,25 @@ class BoneButtonsPanel(bpy.types.Panel):
        def poll(self, context):
                return (context.bone or context.edit_bone)
 
+class BONE_PT_context(BoneButtonsPanel):
+       __idname__ = "BONE_PT_context"
+       __label__ = " "
+
+       def draw(self, context):
+               layout = self.layout
+               bone = context.bone
+               if not bone:
+                       bone = context.edit_bone
+               
+               split = layout.split(percentage=0.06)
+               split.itemL(text="", icon="ICON_BONE_DATA")
+               split.itemR(bone, "name", text="")
+
 class BONE_PT_bone(BoneButtonsPanel):
        __idname__ = "BONE_PT_bone"
        __label__ = "Bone"
 
+
        def draw(self, context):
                layout = self.layout
                bone = context.bone
@@ -22,28 +37,53 @@ class BONE_PT_bone(BoneButtonsPanel):
                split = layout.split()
 
                sub = split.column()
-               sub.itemR(bone, "name")
                sub.itemR(bone, "parent")
                sub.itemR(bone, "connected")
-               sub.itemR(bone, "deform")
+
+               sub.itemL(text="Layers:")
+               sub.template_layers(bone, "layer")
+
+               sub = split.column()
 
                sub.itemL(text="Inherit:")
-               sub.itemR(bone, "hinge")
-               sub.itemR(bone, "inherit_scale")
+               sub.itemR(bone, "hinge", text="Rotation")
+               sub.itemR(bone, "inherit_scale", text="Scale")
+               
+               sub.itemL(text="Display:")
+               sub.itemR(bone, "draw_wire", text="Wireframe")
+               sub.itemR(bone, "hidden", text="Hide")
+
 
+               
+class BONE_PT_deform(BoneButtonsPanel):
+       __idname__ = "BONE_PT_deform"
+       __label__ = "Deform"
+
+       def draw_header(self, context):
+               layout = self.layout
+               bone = context.bone
+               if not bone:
+                       bone = context.edit_bone
+                       
+               layout.itemR(bone, "deform", text="")
+
+       def draw(self, context):
+               layout = self.layout
+               bone = context.bone
+               if not bone:
+                       bone = context.edit_bone
+       
+               layout.active = bone.deform
+                       
+               split = layout.split()
+
+               sub = split.column()
                sub.itemL(text="Envelope:")
                sub.itemR(bone, "envelope_distance", text="Distance")
                sub.itemR(bone, "envelope_weight", text="Weight")
                sub.itemR(bone, "multiply_vertexgroup_with_envelope", text="Multiply")
-
                sub = split.column()
-               sub.itemL(text="Layers:")
-               sub.template_layers(bone, "layer")
                
-               sub.itemL(text="Display:")
-               sub.itemR(bone, "draw_wire", text="Wireframe")
-               sub.itemR(bone, "hidden", text="Hide")
-
                sub.itemL(text="Curved Bones:")
                sub.itemR(bone, "bbone_segments", text="Segments")
                sub.itemR(bone, "bbone_in", text="Ease In")
@@ -51,4 +91,7 @@ class BONE_PT_bone(BoneButtonsPanel):
                
                sub.itemR(bone, "cyclic_offset")
 
+
+bpy.types.register(BONE_PT_context)
 bpy.types.register(BONE_PT_bone)
+bpy.types.register(BONE_PT_deform)