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:
authorAlexander Gavrilov <angavrilov@gmail.com>2018-08-05 18:48:05 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2018-10-04 19:55:44 +0300
commit61a24c799b2882c22a43591138a113d7f09be0ed (patch)
treeea85047e68ff64bf7e25329a7e7048f1b9dbfeb1 /release/scripts/startup
parent6932eaa2bcaff0649c82f6b31a205319c966bd15 (diff)
Move B-Bone custom handle settings to Edit mode.
Custom handle settings actually affect the B-Bone rest shape, so they should be changed in Edit mode rather than Pose mode. This is necessary to be able to display the correct rest shape of the bone in Edit Mode. Also, instead of flags, introduce an enum to specify the handle operation modes, so that new ones could be added later. Differential Revision: https://developer.blender.org/D3588
Diffstat (limited to 'release/scripts/startup')
-rw-r--r--release/scripts/startup/bl_ui/properties_data_bone.py35
1 files changed, 20 insertions, 15 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_bone.py b/release/scripts/startup/bl_ui/properties_data_bone.py
index 3fc0c66b0b4..bdee55666fd 100644
--- a/release/scripts/startup/bl_ui/properties_data_bone.py
+++ b/release/scripts/startup/bl_ui/properties_data_bone.py
@@ -130,6 +130,7 @@ class BONE_PT_curved(BoneButtonsPanel, Panel):
bone = context.bone
# arm = context.armature
pchan = None
+ edit = False
if ob and bone:
pchan = ob.pose.bones[bone.name]
@@ -137,6 +138,7 @@ class BONE_PT_curved(BoneButtonsPanel, Panel):
elif bone is None:
bone = context.edit_bone
bbone = bone
+ edit = True
else:
bbone = bone
@@ -169,24 +171,27 @@ class BONE_PT_curved(BoneButtonsPanel, Panel):
col.prop(bbone, "bbone_easein", text="Ease In")
col.prop(bbone, "bbone_easeout", text="Out")
- if pchan:
- topcol.separator()
-
- col = topcol.column()
- col.use_property_split = False
- col.prop(pchan, "use_bbone_custom_handles")
+ col = topcol.column(align=True)
+ col.prop(bone, "bbone_handle_type_start", text="Start Handle")
- col = topcol.column(align=True)
- col.active = pchan.use_bbone_custom_handles
- col.use_property_split = True
+ col = col.column(align=True)
+ col.active = (bone.bbone_handle_type_start != "AUTO")
+ if edit:
+ col.prop_search(bone, "bbone_custom_handle_start", ob.data, "edit_bones", text="Custom")
+ else:
+ # read-only
+ col.prop(bbone, "bbone_custom_handle_start", text="Custom")
- sub = col.column()
- sub.prop_search(pchan, "bbone_custom_handle_start", ob.pose, "bones", text="Custom Handle Start")
- sub.prop_search(pchan, "bbone_custom_handle_end", ob.pose, "bones", text="End")
+ col = topcol.column(align=True)
+ col.prop(bone, "bbone_handle_type_end", text="End Handle")
- sub = col.column(align=True)
- sub.prop(pchan, "use_bbone_relative_start_handle", text="Relative Handle Start")
- sub.prop(pchan, "use_bbone_relative_end_handle", text="End")
+ col = col.column(align=True)
+ col.active = (bone.bbone_handle_type_end != "AUTO")
+ if edit:
+ col.prop_search(bone, "bbone_custom_handle_end", ob.data, "edit_bones", text="Custom")
+ else:
+ # read-only
+ col.prop(bbone, "bbone_custom_handle_end", text="Custom")
class BONE_PT_relations(BoneButtonsPanel, Panel):