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:
authorWilliam Reynish <billrey@me.com>2020-02-10 12:53:59 +0300
committerWilliam Reynish <billrey@me.com>2020-02-10 12:53:59 +0300
commit6a841acab637c6e614bfcf17de8452bebd3f6c20 (patch)
tree4c7fcd3341869b8533a248fafb259f411d505bf8 /release/scripts/startup/bl_ui/properties_data_bone.py
parentdbf48758d956bb23ad6b07ab16c3d0dacb657ccd (diff)
UI: Bone Custom Shape layout
The layout was somewhat poor - hard to see what relates to the custom object, and also weirdly we show the Wireframe toggle above the Custom Object control, even though it can only be active if a bone has a custom object set. Instead, I grouped everything in a Custom Shape sub-panel and used greying out. Differential Revision: https://developer.blender.org/D6789 Reviewed by Brecht van Lommel
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_data_bone.py')
-rw-r--r--release/scripts/startup/bl_ui/properties_data_bone.py41
1 files changed, 33 insertions, 8 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_bone.py b/release/scripts/startup/bl_ui/properties_data_bone.py
index c50b9414667..4eb93f0f93c 100644
--- a/release/scripts/startup/bl_ui/properties_data_bone.py
+++ b/release/scripts/startup/bl_ui/properties_data_bone.py
@@ -268,18 +268,43 @@ class BONE_PT_display(BoneButtonsPanel, Panel):
col = layout.column()
col.prop(bone, "hide", text="Hide")
+
+
+class BONE_PT_display_custom_shape(BoneButtonsPanel, Panel):
+ bl_label = "Custom Shape"
+ bl_parent_id = "BONE_PT_display"
+
+ @classmethod
+ def poll(cls, context):
+ return context.bone
+
+ def draw(self, context):
+ layout = self.layout
+ layout.use_property_split = True
+
+ ob = context.object
+ bone = context.bone
+ pchan = None
+
+ if ob and bone:
+ pchan = ob.pose.bones[bone.name]
+ elif bone is None:
+ bone = context.edit_bone
+
+ if bone and pchan:
+ col = layout.column()
+ col.prop(pchan, "custom_shape")
+
sub = col.column()
sub.active = bool(pchan and pchan.custom_shape)
+ sub.separator()
+ sub.prop(pchan, "custom_shape_scale", text="Scale")
+ sub.prop_search(pchan, "custom_shape_transform",
+ ob.pose, "bones", text="Override Transform")
+ sub.prop(pchan, "use_custom_shape_bone_size")
+ sub.separator()
sub.prop(bone, "show_wire", text="Wireframe")
- if pchan:
- col = layout.column()
- col.prop(pchan, "custom_shape")
- if pchan.custom_shape:
- col.prop(pchan, "use_custom_shape_bone_size", text="Bone Size")
- col.prop(pchan, "custom_shape_scale", text="Scale")
- col.prop_search(pchan, "custom_shape_transform", ob.pose, "bones")
-
class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel):
bl_label = "Inverse Kinematics"