From 6a841acab637c6e614bfcf17de8452bebd3f6c20 Mon Sep 17 00:00:00 2001 From: William Reynish Date: Mon, 10 Feb 2020 10:53:59 +0100 Subject: 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 --- .../scripts/startup/bl_ui/properties_data_bone.py | 41 +++++++++++++++++----- 1 file changed, 33 insertions(+), 8 deletions(-) (limited to 'release') 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" -- cgit v1.2.3