diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-04-07 14:10:37 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-04-07 14:17:01 +0400 |
commit | 8714ae09f89426242ecd0c65f3291de1a2b51fc4 (patch) | |
tree | 9bb7eae32b739ff7972670909271e81fa10fa186 /release/scripts/startup/bl_ui/properties_constraint.py | |
parent | f3db0389c02bf9fec7a195fa5c2767e81337e3b2 (diff) |
Fix T39563: Tiny unit-display problem in constraint panels.
There is no good solution here, since RNA props can only have one type/unit.
Tried to find the less worse one - have different RNA props for same DNA value
(a bit like the angle/length for camera lens).
Also fixed two other issues with Transform conctraint:
* Angle were still in degrees (yes, another backward-compatibility breacking).
* Scale was absolute, unlike loc/rot.
Also cleaned up a bit the code, replaced some magic numbers by proper enums, ...
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_constraint.py')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_constraint.py | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/release/scripts/startup/bl_ui/properties_constraint.py b/release/scripts/startup/bl_ui/properties_constraint.py index 91999e1f5ee..09dfbcff3f5 100644 --- a/release/scripts/startup/bl_ui/properties_constraint.py +++ b/release/scripts/startup/bl_ui/properties_constraint.py @@ -653,21 +653,22 @@ class ConstraintButtonsPanel(): col.row().prop(con, "map_from", expand=True) split = layout.split() + ext = "" if con.map_from == 'LOCATION' else "_rot" if con.map_from == 'ROTATION' else "_scale" sub = split.column(align=True) sub.label(text="X:") - sub.prop(con, "from_min_x", text="Min") - sub.prop(con, "from_max_x", text="Max") + sub.prop(con, "from_min_x" + ext, text="Min") + sub.prop(con, "from_max_x" + ext, text="Max") sub = split.column(align=True) sub.label(text="Y:") - sub.prop(con, "from_min_y", text="Min") - sub.prop(con, "from_max_y", text="Max") + sub.prop(con, "from_min_y" + ext, text="Min") + sub.prop(con, "from_max_y" + ext, text="Max") sub = split.column(align=True) sub.label(text="Z:") - sub.prop(con, "from_min_z", text="Min") - sub.prop(con, "from_max_z", text="Max") + sub.prop(con, "from_min_z" + ext, text="Min") + sub.prop(con, "from_max_z" + ext, text="Max") col = layout.column() row = col.row() @@ -694,27 +695,28 @@ class ConstraintButtonsPanel(): col.row().prop(con, "map_to", expand=True) split = layout.split() + ext = "" if con.map_to == 'LOCATION' else "_rot" if con.map_to == 'ROTATION' else "_scale" col = split.column() col.label(text="X:") sub = col.column(align=True) - sub.prop(con, "to_min_x", text="Min") - sub.prop(con, "to_max_x", text="Max") + sub.prop(con, "to_min_x" + ext, text="Min") + sub.prop(con, "to_max_x" + ext, text="Max") col = split.column() col.label(text="Y:") sub = col.column(align=True) - sub.prop(con, "to_min_y", text="Min") - sub.prop(con, "to_max_y", text="Max") + sub.prop(con, "to_min_y" + ext, text="Min") + sub.prop(con, "to_max_y" + ext, text="Max") col = split.column() col.label(text="Z:") sub = col.column(align=True) - sub.prop(con, "to_min_z", text="Min") - sub.prop(con, "to_max_z", text="Max") + sub.prop(con, "to_min_z" + ext, text="Min") + sub.prop(con, "to_max_z" + ext, text="Max") self.space_template(layout, con) |