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:
authorYimingWu <xp8110@outlook.com>2020-05-16 18:08:40 +0300
committerYimingWu <xp8110@outlook.com>2020-05-16 18:08:40 +0300
commitcd54abd2c1316136753f7bbe227bd762a5f9e7d9 (patch)
tree69f2a4a1a5013acc78213bb4f3fe888912380ea4 /release/scripts/startup/bl_ui/properties_data_bone.py
parentf7770cb97bb9d19d0806f67da9377129fd4d09b0 (diff)
parenteaf7d36d66e551c3262d69f472b4028aeccb7e97 (diff)
Merge remote-tracking branch 'origin/master' into temp-lanpr-review
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_data_bone.py')
-rw-r--r--release/scripts/startup/bl_ui/properties_data_bone.py42
1 files changed, 34 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..aca358870c8 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"
@@ -431,6 +456,7 @@ classes = (
BONE_PT_inverse_kinematics,
BONE_PT_deform,
BONE_PT_display,
+ BONE_PT_display_custom_shape,
BONE_PT_custom_props,
)