Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-12-04 09:21:08 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-12-04 09:21:08 +0300
commit627e56b614f7eb72f650244b5d4d9845b2192562 (patch)
treec682ac0f3cf42b94b2f174c18078001e1f093592 /release
parentfe67fc645926935c05aa583585c9241b3d0d88eb (diff)
minor changes to bone UI script.
Diffstat (limited to 'release')
-rw-r--r--release/scripts/ui/properties_data_bone.py66
1 files changed, 34 insertions, 32 deletions
diff --git a/release/scripts/ui/properties_data_bone.py b/release/scripts/ui/properties_data_bone.py
index 9a98e8c0544..488aa01a475 100644
--- a/release/scripts/ui/properties_data_bone.py
+++ b/release/scripts/ui/properties_data_bone.py
@@ -56,21 +56,8 @@ class BONE_PT_transform(BoneButtonsPanel, bpy.types.Panel):
ob = context.object
bone = context.bone
- if not bone:
- bone = context.edit_bone
- row = layout.row()
- row.column().prop(bone, "head")
- row.column().prop(bone, "tail")
-
- col = row.column()
- sub = col.column(align=True)
- sub.label(text="Roll:")
- sub.prop(bone, "roll", text="")
- sub.label()
- sub.prop(bone, "lock")
-
- else:
- pchan = ob.pose.bones[context.bone.name]
+ if bone:
+ pchan = ob.pose.bones[bone.name]
row = layout.row()
col = row.column()
@@ -92,6 +79,19 @@ class BONE_PT_transform(BoneButtonsPanel, bpy.types.Panel):
layout.prop(pchan, "rotation_mode")
+ else:
+ bone = context.edit_bone
+ row = layout.row()
+ row.column().prop(bone, "head")
+ row.column().prop(bone, "tail")
+
+ col = row.column()
+ sub = col.column(align=True)
+ sub.label(text="Roll:")
+ sub.prop(bone, "roll", text="")
+ sub.label()
+ sub.prop(bone, "lock")
+
class BONE_PT_transform_locks(BoneButtonsPanel, bpy.types.Panel):
bl_label = "Transform Locks"
@@ -106,7 +106,7 @@ class BONE_PT_transform_locks(BoneButtonsPanel, bpy.types.Panel):
ob = context.object
bone = context.bone
- pchan = ob.pose.bones[context.bone.name]
+ pchan = ob.pose.bones[bone.name]
row = layout.row()
col = row.column()
@@ -135,11 +135,11 @@ class BONE_PT_relations(BoneButtonsPanel, bpy.types.Panel):
bone = context.bone
arm = context.armature
- if not bone:
+ if bone:
+ pchan = ob.pose.bones[bone.name]
+ else:
bone = context.edit_bone
pchan = None
- else:
- pchan = ob.pose.bones[context.bone.name]
split = layout.split()
@@ -178,31 +178,33 @@ class BONE_PT_display(BoneButtonsPanel, bpy.types.Panel):
return context.bone
def draw(self, context):
+ # note. this works ok in editmode but isnt
+ # all that useful so disabling for now.
layout = self.layout
ob = context.object
bone = context.bone
- if not bone:
+ if bone:
+ pchan = ob.pose.bones[bone.name]
+ else:
bone = context.edit_bone
pchan = None
- else:
- pchan = ob.pose.bones[context.bone.name]
-
- if ob and pchan:
+ if bone:
split = layout.split()
col = split.column()
col.prop(bone, "show_wire", text="Wireframe")
col.prop(bone, "hide", text="Hide")
- col = split.column()
+ if pchan:
+ col = split.column()
- col.label(text="Custom Shape:")
- col.prop(pchan, "custom_shape", text="")
- if pchan.custom_shape:
- col.prop_search(pchan, "custom_shape_transform", ob.pose, "bones", text="At")
+ col.label(text="Custom Shape:")
+ col.prop(pchan, "custom_shape", text="")
+ if pchan.custom_shape:
+ col.prop_search(pchan, "custom_shape_transform", ob.pose, "bones", text="At")
class BONE_PT_inverse_kinematics(BoneButtonsPanel, bpy.types.Panel):
@@ -216,9 +218,9 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, bpy.types.Panel):
def draw(self, context):
layout = self.layout
- ob = context.object
- bone = context.bone
- pchan = ob.pose.bones[bone.name]
+ pchan = context.active_pose_bone
+ # incase pose bone context is pinned don't use 'context.object'
+ ob = pchan.id_data
row = layout.row()
row.prop(ob.pose, "ik_solver")