[Bf-blender-cvs] [6a302e6845e] master: UI: Fix alignment in kinematic constraint layout

Hans Goudey noreply at git.blender.org
Wed Jul 1 15:06:56 CEST 2020


Commit: 6a302e6845e193aab8946947df53b0b2c7a1b70f
Author: Hans Goudey
Date:   Wed Jul 1 09:06:50 2020 -0400
Branches: master
https://developer.blender.org/rB6a302e6845e193aab8946947df53b0b2c7a1b70f

UI: Fix alignment in kinematic constraint layout

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

M	release/scripts/startup/bl_ui/properties_constraint.py

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

diff --git a/release/scripts/startup/bl_ui/properties_constraint.py b/release/scripts/startup/bl_ui/properties_constraint.py
index 9e68cb2d502..8bae32775a9 100644
--- a/release/scripts/startup/bl_ui/properties_constraint.py
+++ b/release/scripts/startup/bl_ui/properties_constraint.py
@@ -865,9 +865,9 @@ class ConstraintButtonsPanel(Panel):
         self.target_template(layout, con)
 
         if context.object.pose.ik_solver == 'ITASC':
-            col = layout.column()
-            col.prop(con, "ik_type")
+            layout.prop(con, "ik_type")
 
+            # This button gives itself too much padding, so put it in a column with the subtarget
             col = layout.column()
             col.prop(con, "pole_target")
 
@@ -884,30 +884,37 @@ class ConstraintButtonsPanel(Panel):
             if con.ik_type == 'COPY_POSE':
                 layout.prop(con, "reference_axis", expand=True)
 
-                col = layout.column()
-                col.prop(con, "use_location")
+                # Use separate rows and columns here to avoid an alignment issue with the lock buttons
+                loc_col = layout.column()
+                loc_col.prop(con, "use_location")
+
+                row = loc_col.row()
+                row.active = con.use_location
+                row.prop(con, "weight", text="Weight", slider=True)
 
-                sub = col.column()
-                sub.active = con.use_location
-                sub.prop(con, "weight", text="Weight", slider=True)
-                row = sub.row(heading="Lock")
+                row = loc_col.row(heading="Lock", align=True)
                 row.use_property_decorate = False
-                row.prop(con, "lock_location_x", text="X", toggle=True)
-                row.prop(con, "lock_location_y", text="Y", toggle=True)
-                row.prop(con, "lock_location_z", text="Z", toggle=True)
+                row.active = con.use_location
+                sub = row.row(align=True)
+                sub.prop(con, "lock_location_x", text="X", toggle=True)
+                sub.prop(con, "lock_location_y", text="Y", toggle=True)
+                sub.prop(con, "lock_location_z", text="Z", toggle=True)
                 row.label(icon='BLANK1')
 
-                col = layout.column()
-                col.prop(con, "use_rotation")
+                rot_col = layout.column()
+                rot_col.prop(con, "use_rotation")
+
+                row = rot_col.row()
+                row.active = con.use_rotation
+                row.prop(con, "orient_weight", text="Weight", slider=True)
 
-                sub = col.column()
-                sub.active = con.use_rotation
-                sub.prop(con, "orient_weight", text="Weight", slider=True)
-                row = sub.row(heading="Lock")
+                row = rot_col.row(heading="Lock", align=True)
                 row.use_property_decorate = False
-                row.prop(con, "lock_rotation_x", text="X", toggle=True)
-                row.prop(con, "lock_rotation_y", text="Y", toggle=True)
-                row.prop(con, "lock_rotation_z", text="Z", toggle=True)
+                row.active = con.use_rotation
+                sub = row.row(align=True)
+                sub.prop(con, "lock_rotation_x", text="X", toggle=True)
+                sub.prop(con, "lock_rotation_y", text="Y", toggle=True)
+                sub.prop(con, "lock_rotation_z", text="Z", toggle=True)
                 row.label(icon='BLANK1')
 
             elif con.ik_type == 'DISTANCE':



More information about the Bf-blender-cvs mailing list