[Bf-blender-cvs] [918150a0b96] master: Fix T65670: bone envelope head radius missing from transform panel

Campbell Barton noreply at git.blender.org
Tue Aug 13 10:23:39 CEST 2019


Commit: 918150a0b96deec4a413d5689383ee43d7ff4df9
Author: Campbell Barton
Date:   Tue Aug 13 18:15:43 2019 +1000
Branches: master
https://developer.blender.org/rB918150a0b96deec4a413d5689383ee43d7ff4df9

Fix T65670: bone envelope head radius missing from transform panel

Make the transforms section of the properties panel consistent with
the transforms section of the side-bar, and to expose some currently
hidden BBone properties in the Bendy Bone section.

- Object transformations were not consistent with Pose Bone
  transformations in that they did not use single-column layout.

- Even in Pose Bone transformations,
  the rotation mode option was after Scale.

- Edit Bone Transforms panel included "Tail Radius" and
  "Envelope Deform Distance", neither of which belong there. See T65670.

- Expose bbone_x and bbone_z.

D5454 by @Mets

===================================================================

M	release/scripts/startup/bl_ui/properties_data_bone.py
M	release/scripts/startup/bl_ui/properties_object.py
M	source/blender/makesrna/intern/rna_armature.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/properties_data_bone.py b/release/scripts/startup/bl_ui/properties_data_bone.py
index 707b1ca3f1a..f739cd66699 100644
--- a/release/scripts/startup/bl_ui/properties_data_bone.py
+++ b/release/scripts/startup/bl_ui/properties_data_bone.py
@@ -73,36 +73,44 @@ class BONE_PT_transform(BoneButtonsPanel, Panel):
             pchan = ob.pose.bones[bone.name]
             col.active = not (bone.parent and bone.use_connect)
 
-            sub = col.row(align=True)
-            sub.prop(pchan, "location")
-            sub.prop(pchan, "lock_location", text="")
+            row = col.row(align=True)
+            row.prop(pchan, "location")
+            row.use_property_decorate = False
+            row.prop(pchan, "lock_location", text="", emboss=False, icon='DECORATE_UNLOCKED')
 
-            col = layout.column()
             rotation_mode = pchan.rotation_mode
             if rotation_mode == 'QUATERNION':
-                sub = col.row(align=True)
-                sub.prop(pchan, "rotation_quaternion", text="Rotation")
-                subsub = sub.column(align=True)
-                subsub.prop(pchan, "lock_rotation_w", text="")
-                subsub.prop(pchan, "lock_rotation", text="")
+                col = layout.column()
+                row = col.row(align=True)
+                row.prop(pchan, "rotation_quaternion", text="Rotation")
+                sub = row.column(align=True)
+                sub.use_property_decorate = False
+                sub.prop(pchan, "lock_rotation_w", text="", emboss=False, icon='DECORATE_UNLOCKED')
+                sub.prop(pchan, "lock_rotation", text="", emboss=False, icon='DECORATE_UNLOCKED')
             elif rotation_mode == 'AXIS_ANGLE':
-                sub = col.row(align=True)
-                sub.prop(pchan, "rotation_axis_angle", text="Rotation")
-                subsub = sub.column(align=True)
-                subsub.prop(pchan, "lock_rotation_w", text="")
-                subsub.prop(pchan, "lock_rotation", text="")
-            else:
-                sub = col.row(align=True)
-                sub.prop(pchan, "rotation_euler", text="Rotation")
-                sub.prop(pchan, "lock_rotation", text="")
+                col = layout.column()
+                row = col.row(align=True)
+                row.prop(pchan, "rotation_axis_angle", text="Rotation")
 
-            col = layout.column()
-            sub = col.row(align=True)
-            sub.prop(pchan, "scale")
-            sub.prop(pchan, "lock_scale", text="")
+                sub = row.column(align=True)
+                sub.use_property_decorate = False
+                sub.prop(pchan, "lock_rotation_w", text="", emboss=False, icon='DECORATE_UNLOCKED')
+                sub.prop(pchan, "lock_rotation", text="", emboss=False, icon='DECORATE_UNLOCKED')
+            else:
+                col = layout.column()
+                row = col.row(align=True)
+                row.prop(pchan, "rotation_euler", text="Rotation")
+                row.use_property_decorate = False
+                row.prop(pchan, "lock_rotation", text="", emboss=False, icon='DECORATE_UNLOCKED')
+            row = layout.row(align=True)
+            row.prop(pchan, "rotation_mode", text='Mode')
+            row.label(text="", icon='BLANK1')
 
             col = layout.column()
-            col.prop(pchan, "rotation_mode")
+            row = col.row(align=True)
+            row.prop(pchan, "scale")
+            row.use_property_decorate = False
+            row.prop(pchan, "lock_scale", text="", emboss=False, icon='DECORATE_UNLOCKED')
 
         elif context.edit_bone:
             bone = context.edit_bone
@@ -114,10 +122,6 @@ class BONE_PT_transform(BoneButtonsPanel, Panel):
             col.prop(bone, "roll")
             col.prop(bone, "lock")
 
-            col = layout.column()
-            col.prop(bone, "tail_radius")
-            col.prop(bone, "envelope_distance")
-
 
 class BONE_PT_curved(BoneButtonsPanel, Panel):
     bl_label = "Bendy Bones"
@@ -146,6 +150,10 @@ class BONE_PT_curved(BoneButtonsPanel, Panel):
         topcol = layout.column()
         topcol.active = bone.bbone_segments > 1
 
+        col = topcol.column(align=True)
+        col.prop(bone, "bbone_x", text="Display Size X")
+        col.prop(bone, "bbone_z", text="Z")
+
         col = topcol.column(align=True)
         col.prop(bbone, "bbone_curveinx", text="Curve In X")
         col.prop(bbone, "bbone_curveiny", text="In Y")
diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py
index 0e45f4c97ae..7424c090764 100644
--- a/release/scripts/startup/bl_ui/properties_object.py
+++ b/release/scripts/startup/bl_ui/properties_object.py
@@ -54,11 +54,9 @@ class OBJECT_PT_transform(ObjectButtonsPanel, Panel):
         layout = self.layout
         layout.use_property_split = True
 
-        flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
-
         ob = context.object
 
-        col = flow.column()
+        col = layout.column()
         row = col.row(align=True)
         row.prop(ob, "location")
         row.use_property_decorate = False
@@ -66,7 +64,7 @@ class OBJECT_PT_transform(ObjectButtonsPanel, Panel):
 
         rotation_mode = ob.rotation_mode
         if rotation_mode == 'QUATERNION':
-            col = flow.column()
+            col = layout.column()
             row = col.row(align=True)
             row.prop(ob, "rotation_quaternion", text="Rotation")
             sub = row.column(align=True)
@@ -74,7 +72,7 @@ class OBJECT_PT_transform(ObjectButtonsPanel, Panel):
             sub.prop(ob, "lock_rotation_w", text="", emboss=False, icon='DECORATE_UNLOCKED')
             sub.prop(ob, "lock_rotation", text="", emboss=False, icon='DECORATE_UNLOCKED')
         elif rotation_mode == 'AXIS_ANGLE':
-            col = flow.column()
+            col = layout.column()
             row = col.row(align=True)
             row.prop(ob, "rotation_axis_angle", text="Rotation")
 
@@ -83,22 +81,21 @@ class OBJECT_PT_transform(ObjectButtonsPanel, Panel):
             sub.prop(ob, "lock_rotation_w", text="", emboss=False, icon='DECORATE_UNLOCKED')
             sub.prop(ob, "lock_rotation", text="", emboss=False, icon='DECORATE_UNLOCKED')
         else:
-            col = flow.column()
+            col = layout.column()
             row = col.row(align=True)
             row.prop(ob, "rotation_euler", text="Rotation")
             row.use_property_decorate = False
             row.prop(ob, "lock_rotation", text="", emboss=False, icon='DECORATE_UNLOCKED')
+        row = layout.row(align=True)
+        row.prop(ob, "rotation_mode", text="Mode")
+        row.label(text="", icon='BLANK1')
 
-        col = flow.column()
+        col = layout.column()
         row = col.row(align=True)
         row.prop(ob, "scale")
         row.use_property_decorate = False
         row.prop(ob, "lock_scale", text="", emboss=False, icon='DECORATE_UNLOCKED')
 
-        row = layout.row(align=True)
-        row.prop(ob, "rotation_mode")
-        row.label(text="", icon='BLANK1')
-
 
 class OBJECT_PT_delta_transform(ObjectButtonsPanel, Panel):
     bl_label = "Delta Transform"
diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c
index 6737363bae4..59e5c584811 100644
--- a/source/blender/makesrna/intern/rna_armature.c
+++ b/source/blender/makesrna/intern/rna_armature.c
@@ -922,13 +922,13 @@ static void rna_def_bone_common(StructRNA *srna, int editbone)
 
   prop = RNA_def_property(srna, "bbone_x", PROP_FLOAT, PROP_NONE);
   RNA_def_property_float_sdna(prop, NULL, "xwidth");
-  RNA_def_property_range(prop, 0.0f, 1000.0f);
+  RNA_def_property_ui_range(prop, 0.0f, 1000.0f, 1, RNA_TRANSLATION_PREC_DEFAULT);
   RNA_def_property_ui_text(prop, "B-Bone Display X Width", "B-Bone X size");
   RNA_def_property_update(prop, 0, "rna_Armature_update_data");
 
   prop = RNA_def_property(srna, "bbone_z", PROP_FLOAT, PROP_NONE);
   RNA_def_property_float_sdna(prop, NULL, "zwidth");
-  RNA_def_property_range(prop, 0.0f, 1000.0f);
+  RNA_def_property_ui_range(prop, 0.0f, 1000.0f, 1, RNA_TRANSLATION_PREC_DEFAULT);
   RNA_def_property_ui_text(prop, "B-Bone Display Z Width", "B-Bone Z size");
   RNA_def_property_update(prop, 0, "rna_Armature_update_data");



More information about the Bf-blender-cvs mailing list